Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TaKO8Ki committed Aug 24, 2022
1 parent 87991d5 commit 8e80ca6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/util/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl LitKind {
let symbol = if value { kw::True } else { kw::False };
(token::Bool, symbol, None)
}
LitKind::Err => unreachable!(),
LitKind::Err => (token::Err, kw::Empty, None),
};

token::Lit::new(kind, symbol, suffix)
Expand Down
5 changes: 5 additions & 0 deletions src/test/ui/issues/issue-100948.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// compile-flags: -Zunpretty=hir

fn main() {
1u; //~ ERROR invalid suffix `u` for number literal
}
10 changes: 10 additions & 0 deletions src/test/ui/issues/issue-100948.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
error: invalid suffix `u` for number literal
--> $DIR/issue-100948.rs:4:5
|
LL | 1u;
| ^^ invalid suffix `u`
|
= help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)

error: aborting due to previous error

9 changes: 9 additions & 0 deletions src/test/ui/issues/issue-100948.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
// compile-flags: -Zunpretty=hir

fn main() {
;
}

0 comments on commit 8e80ca6

Please sign in to comment.