mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-13 23:42:56 +00:00
Fix test
This commit is contained in:
parent
6437295b17
commit
7dec8a4e99
@ -1081,10 +1081,12 @@ impl<'a> StringReader<'a> {
|
||||
);
|
||||
if let Some(ch) = self.ch {
|
||||
// check for e.g. Unicode minus '−' (Issue #49746)
|
||||
unicode_chars::check_for_substitution(self, ch, &mut err);
|
||||
if unicode_chars::check_for_substitution(self, ch, &mut err) {
|
||||
self.bump();
|
||||
self.scan_digits(10, 10);
|
||||
}
|
||||
}
|
||||
err.emit();
|
||||
FatalError.raise();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ const ASCII_ARRAY: &'static [(char, &'static str)] = &[
|
||||
|
||||
pub fn check_for_substitution<'a>(reader: &StringReader<'a>,
|
||||
ch: char,
|
||||
err: &mut DiagnosticBuilder<'a>) {
|
||||
err: &mut DiagnosticBuilder<'a>) -> bool {
|
||||
UNICODE_ARRAY
|
||||
.iter()
|
||||
.find(|&&(c, _, _)| c == ch)
|
||||
@ -347,11 +347,13 @@ pub fn check_for_substitution<'a>(reader: &StringReader<'a>,
|
||||
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());
|
||||
true
|
||||
},
|
||||
None => {
|
||||
let msg = format!("substitution character not found for '{}'", ch);
|
||||
reader.sess.span_diagnostic.span_bug_no_panic(span, &msg);
|
||||
false
|
||||
}
|
||||
}
|
||||
});
|
||||
}).unwrap_or(false)
|
||||
}
|
||||
|
@ -13,5 +13,5 @@
|
||||
fn main() {
|
||||
let y = 0;
|
||||
//~^ ERROR unknown start of token: \u{37e}
|
||||
//~^^ HELP unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it's not
|
||||
//~^^ HELP Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
const UNIVERSAL_GRAVITATIONAL_CONSTANT = 6.674e−11; // m³⋅kg⁻¹⋅s⁻²
|
||||
const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹⋅s⁻²
|
||||
//~^ ERROR expected at least one digit in exponent
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,12 +1,12 @@
|
||||
error: expected at least one digit in exponent
|
||||
--> $DIR/issue-49746-unicode-confusable-in-float-literal-expt.rs:11:48
|
||||
--> $DIR/issue-49746-unicode-confusable-in-float-literal-expt.rs:11:53
|
||||
|
|
||||
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT = 6.674e−11; // m³⋅kg⁻¹⋅s⁻²
|
||||
| ^
|
||||
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹⋅s⁻²
|
||||
| ^
|
||||
help: Unicode character '−' (Minus Sign) looks like '-' (Minus/Hyphen), but it is not
|
||||
|
|
||||
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT = 6.674e-11; // m³⋅kg⁻¹⋅s⁻²
|
||||
| ^
|
||||
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e-11; // m³⋅kg⁻¹⋅s⁻²
|
||||
| ^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user