about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-08-22 17:45:34 +0200
committerGitHub <noreply@github.com>2018-08-22 17:45:34 +0200
commit4fa4bb56339868a125c2f5a80a1cea982d92d545 (patch)
treea031de63ea6d04b05e36a01eb99057444a4a8f23 /src/libsyntax
parent55d98236f9fcdf88f574bcf8180c0e92924d616c (diff)
parent5a23a0d283653c79fd623b479b1e8e71d5eea093 (diff)
downloadrust-4fa4bb56339868a125c2f5a80a1cea982d92d545.tar.gz
rust-4fa4bb56339868a125c2f5a80a1cea982d92d545.zip
Rollup merge of #53504 - ekse:suggestions-applicability-2, r=estebank
Set applicability for more suggestions.

Converts a couple more calls to `span_suggestion_with_applicability`  (#50723). To be on the safe side, I marked suggestions that depend on the intent of the user or that are potentially lossy conversions as MaybeIncorrect.

r? @estebank
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/parse/lexer/unicode_chars.rs8
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 => {