]> git.lizzy.rs Git - rust.git/commit
in which we check for confusable Unicodepoints in float literal exponent
authorZack M. Davis <code@zackmdavis.net>
Sun, 15 Apr 2018 21:30:23 +0000 (14:30 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Sat, 26 May 2018 03:48:31 +0000 (20:48 -0700)
commit6437295b173a17361fdca1a45d2f9e7547cbc99f
tree127b25cabc961c5d5ca67b7e207a69d52609ee03
parent7426f5ccf7b362785a5abeb365674d3da3d4df2e
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.
src/libsyntax/parse/lexer/mod.rs
src/libsyntax/parse/lexer/unicode_chars.rs
src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.rs [new file with mode: 0644]
src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr [new file with mode: 0644]