diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/parser/public-instead-of-pub.fixed | 8 | ||||
| -rw-r--r-- | src/test/ui/parser/public-instead-of-pub.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/parser/public-instead-of-pub.stderr | 13 |
3 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/parser/public-instead-of-pub.fixed b/src/test/ui/parser/public-instead-of-pub.fixed new file mode 100644 index 00000000000..01db609990e --- /dev/null +++ b/src/test/ui/parser/public-instead-of-pub.fixed @@ -0,0 +1,8 @@ +// Checks what happens when `public` is used instead of the correct, `pub` +// edition:2018 +// run-rustfix +pub struct X; +//~^ ERROR expected one of `!` or `::`, found keyword `struct` +//~^^ HELP write `pub` instead of `public` to make the item public + +fn main() {} diff --git a/src/test/ui/parser/public-instead-of-pub.rs b/src/test/ui/parser/public-instead-of-pub.rs new file mode 100644 index 00000000000..18e0fd3af1c --- /dev/null +++ b/src/test/ui/parser/public-instead-of-pub.rs @@ -0,0 +1,8 @@ +// Checks what happens when `public` is used instead of the correct, `pub` +// edition:2018 +// run-rustfix +public struct X; +//~^ ERROR expected one of `!` or `::`, found keyword `struct` +//~^^ HELP write `pub` instead of `public` to make the item public + +fn main() {} diff --git a/src/test/ui/parser/public-instead-of-pub.stderr b/src/test/ui/parser/public-instead-of-pub.stderr new file mode 100644 index 00000000000..af875491e85 --- /dev/null +++ b/src/test/ui/parser/public-instead-of-pub.stderr @@ -0,0 +1,13 @@ +error: expected one of `!` or `::`, found keyword `struct` + --> $DIR/public-instead-of-pub.rs:4:8 + | +LL | public struct X; + | ^^^^^^ expected one of `!` or `::` + | +help: write `pub` instead of `public` to make the item public + | +LL | pub struct X; + | ~~~ + +error: aborting due to previous error + |
