in which we check for confusable Unicodepoints in float literal exponent
The `FatalError.raise()` might seem unmotivated (in most places in
the compiler, `err.emit()` suffices), but it's actually used to
maintain behavior (viz., stop lexing, don't emit potentially spurious
errors looking for the next token after the bad Unicodepoint in the
exponent): the previous revision's `self.err_span_` ultimately calls
`Handler::emit`, which aborts if the `Handler`'s continue_after_error
flag is set, which seems to typically be true during lexing (see
`phase_1_parse_input` and and how `CompileController::basic` has
`continue_parse_after_error: false` in librustc_driver).
Also, let's avoid apostrophes in error messages (the present author
would argue that users expect a reassuringly detached, formal,
above-it-all tone from a Serious tool like a compiler), and use an
RLS-friendly structured suggestion.
Resolves #49746.
2018-04-15 16:30:23 -05:00
|
|
|
|
error: expected at least one digit in exponent
|
2019-05-06 03:53:40 -05:00
|
|
|
|
--> $DIR/issue-49746-unicode-confusable-in-float-literal-expt.rs:1:47
|
|
|
|
|
|
|
|
|
|
|
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹⋅s⁻²
|
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
|
error: unknown start of token: \u{2212}
|
2018-12-25 09:56:47 -06:00
|
|
|
|
--> $DIR/issue-49746-unicode-confusable-in-float-literal-expt.rs:1:53
|
in which we check for confusable Unicodepoints in float literal exponent
The `FatalError.raise()` might seem unmotivated (in most places in
the compiler, `err.emit()` suffices), but it's actually used to
maintain behavior (viz., stop lexing, don't emit potentially spurious
errors looking for the next token after the bad Unicodepoint in the
exponent): the previous revision's `self.err_span_` ultimately calls
`Handler::emit`, which aborts if the `Handler`'s continue_after_error
flag is set, which seems to typically be true during lexing (see
`phase_1_parse_input` and and how `CompileController::basic` has
`continue_parse_after_error: false` in librustc_driver).
Also, let's avoid apostrophes in error messages (the present author
would argue that users expect a reassuringly detached, formal,
above-it-all tone from a Serious tool like a compiler), and use an
RLS-friendly structured suggestion.
Resolves #49746.
2018-04-15 16:30:23 -05:00
|
|
|
|
|
|
2018-05-25 23:57:02 -05:00
|
|
|
|
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹⋅s⁻²
|
|
|
|
|
| ^
|
2019-10-24 00:20:58 -05:00
|
|
|
|
|
|
in which we check for confusable Unicodepoints in float literal exponent
The `FatalError.raise()` might seem unmotivated (in most places in
the compiler, `err.emit()` suffices), but it's actually used to
maintain behavior (viz., stop lexing, don't emit potentially spurious
errors looking for the next token after the bad Unicodepoint in the
exponent): the previous revision's `self.err_span_` ultimately calls
`Handler::emit`, which aborts if the `Handler`'s continue_after_error
flag is set, which seems to typically be true during lexing (see
`phase_1_parse_input` and and how `CompileController::basic` has
`continue_parse_after_error: false` in librustc_driver).
Also, let's avoid apostrophes in error messages (the present author
would argue that users expect a reassuringly detached, formal,
above-it-all tone from a Serious tool like a compiler), and use an
RLS-friendly structured suggestion.
Resolves #49746.
2018-04-15 16:30:23 -05:00
|
|
|
|
help: Unicode character '−' (Minus Sign) looks like '-' (Minus/Hyphen), but it is not
|
|
|
|
|
|
|
2018-05-25 23:57:02 -05:00
|
|
|
|
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e-11; // m³⋅kg⁻¹⋅s⁻²
|
2021-06-21 21:07:19 -05:00
|
|
|
|
| ~
|
in which we check for confusable Unicodepoints in float literal exponent
The `FatalError.raise()` might seem unmotivated (in most places in
the compiler, `err.emit()` suffices), but it's actually used to
maintain behavior (viz., stop lexing, don't emit potentially spurious
errors looking for the next token after the bad Unicodepoint in the
exponent): the previous revision's `self.err_span_` ultimately calls
`Handler::emit`, which aborts if the `Handler`'s continue_after_error
flag is set, which seems to typically be true during lexing (see
`phase_1_parse_input` and and how `CompileController::basic` has
`continue_parse_after_error: false` in librustc_driver).
Also, let's avoid apostrophes in error messages (the present author
would argue that users expect a reassuringly detached, formal,
above-it-all tone from a Serious tool like a compiler), and use an
RLS-friendly structured suggestion.
Resolves #49746.
2018-04-15 16:30:23 -05:00
|
|
|
|
|
2022-08-28 01:27:31 -05:00
|
|
|
|
error[E0277]: cannot subtract `{integer}` from `{float}` in const contexts
|
2019-07-24 18:10:42 -05:00
|
|
|
|
--> $DIR/issue-49746-unicode-confusable-in-float-literal-expt.rs:1:53
|
|
|
|
|
|
|
|
|
|
|
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹⋅s⁻²
|
|
|
|
|
| ^ no implementation for `{float} - {integer}`
|
|
|
|
|
|
|
2022-08-28 01:27:31 -05:00
|
|
|
|
= help: the trait `~const Sub<{integer}>` is not implemented for `{float}`
|
2022-03-26 21:02:07 -05:00
|
|
|
|
= help: the following other types implement trait `Sub<Rhs>`:
|
2021-12-13 14:56:40 -06:00
|
|
|
|
<&'a f32 as Sub<f32>>
|
|
|
|
|
<&'a f64 as Sub<f64>>
|
|
|
|
|
<&'a i128 as Sub<i128>>
|
|
|
|
|
<&'a i16 as Sub<i16>>
|
2022-03-26 18:14:47 -05:00
|
|
|
|
<&'a i32 as Sub<i32>>
|
|
|
|
|
<&'a i64 as Sub<i64>>
|
|
|
|
|
<&'a i8 as Sub<i8>>
|
|
|
|
|
<&'a isize as Sub<isize>>
|
2021-12-13 14:56:40 -06:00
|
|
|
|
and 48 others
|
2019-07-24 18:10:42 -05:00
|
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
in which we check for confusable Unicodepoints in float literal exponent
The `FatalError.raise()` might seem unmotivated (in most places in
the compiler, `err.emit()` suffices), but it's actually used to
maintain behavior (viz., stop lexing, don't emit potentially spurious
errors looking for the next token after the bad Unicodepoint in the
exponent): the previous revision's `self.err_span_` ultimately calls
`Handler::emit`, which aborts if the `Handler`'s continue_after_error
flag is set, which seems to typically be true during lexing (see
`phase_1_parse_input` and and how `CompileController::basic` has
`continue_parse_after_error: false` in librustc_driver).
Also, let's avoid apostrophes in error messages (the present author
would argue that users expect a reassuringly detached, formal,
above-it-all tone from a Serious tool like a compiler), and use an
RLS-friendly structured suggestion.
Resolves #49746.
2018-04-15 16:30:23 -05:00
|
|
|
|
|
2019-07-24 18:10:42 -05:00
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|