Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ impl Token {
kw::Extern,
kw::Impl,
kw::Unsafe,
kw::Const,
kw::Static,
kw::Union,
kw::Macro,
Expand Down
9 changes: 9 additions & 0 deletions src/test/ui/parser/public-instead-of-pub-3.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// run-rustfix
mod test {
pub const X: i32 = 123;
//~^ ERROR expected one of `!` or `::`, found keyword `const`
}

fn main() {
println!("{}", test::X);
}
9 changes: 9 additions & 0 deletions src/test/ui/parser/public-instead-of-pub-3.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// run-rustfix
mod test {
public const X: i32 = 123;
//~^ ERROR expected one of `!` or `::`, found keyword `const`
}

fn main() {
println!("{}", test::X);
}
13 changes: 13 additions & 0 deletions src/test/ui/parser/public-instead-of-pub-3.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error: expected one of `!` or `::`, found keyword `const`
--> $DIR/public-instead-of-pub-3.rs:3:12
|
LL | public const X: i32 = 123;
| ^^^^^ expected one of `!` or `::`
|
help: write `pub` instead of `public` to make the item public
|
LL | pub const X: i32 = 123;
| ~~~

error: aborting due to previous error