diff options
| author | Sébastien Duquette <ekse.0x@gmail.com> | 2018-08-19 15:01:33 -0400 |
|---|---|---|
| committer | Sébastien Duquette <ekse.0x@gmail.com> | 2018-08-20 03:56:06 -0400 |
| commit | 5a23a0d283653c79fd623b479b1e8e71d5eea093 (patch) | |
| tree | f5a826bf3d390bfef82b343a7ec1f2a393ea7822 /src/libsyntax/parse | |
| parent | d2048b6db375299b681d4f4728b8e7cad9f74d5f (diff) | |
| download | rust-5a23a0d283653c79fd623b479b1e8e71d5eea093.tar.gz rust-5a23a0d283653c79fd623b479b1e8e71d5eea093.zip | |
Set applicability for more suggestions.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/lexer/unicode_chars.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libsyntax/parse/lexer/unicode_chars.rs b/src/libsyntax/parse/lexer/unicode_chars.rs index 88ff8582da8..03bf1b5a4e1 100644 --- a/src/libsyntax/parse/lexer/unicode_chars.rs +++ b/src/libsyntax/parse/lexer/unicode_chars.rs @@ -12,7 +12,7 @@ // http://www.unicode.org/Public/security/10.0.0/confusables.txt use syntax_pos::{Span, NO_EXPANSION}; -use errors::DiagnosticBuilder; +use errors::{Applicability, DiagnosticBuilder}; use super::StringReader; const UNICODE_ARRAY: &[(char, &str, char)] = &[ @@ -346,7 +346,11 @@ crate fn check_for_substitution<'a>(reader: &StringReader<'a>, let msg = format!("Unicode character '{}' ({}) looks like '{}' ({}), but it is not", ch, u_name, ascii_char, ascii_name); - err.span_suggestion(span, &msg, ascii_char.to_string()); + err.span_suggestion_with_applicability( + span, + &msg, + ascii_char.to_string(), + Applicability::MaybeIncorrect); true }, None => { |
