use smaller span for suggestions
This commit is contained in:
parent
9845f4c47e
commit
b33c3d6cd6
10 changed files with 35 additions and 33 deletions
|
@ -223,14 +223,12 @@ impl<'a> SessionDiagnostic<'a> for UnsupportedLiteral {
|
|||
error_code!(E0565),
|
||||
);
|
||||
if self.is_bytestr {
|
||||
if let Ok(lint_str) = sess.source_map().span_to_snippet(self.span) {
|
||||
diag.span_suggestion(
|
||||
self.span,
|
||||
fluent::attr::unsupported_literal_suggestion,
|
||||
&lint_str[1..],
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
}
|
||||
diag.span_suggestion(
|
||||
sess.source_map().start_point(self.span),
|
||||
fluent::attr::unsupported_literal_suggestion,
|
||||
"",
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
}
|
||||
diag
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue