diff options
Diffstat (limited to 'tests')
32 files changed, 229 insertions, 76 deletions
diff --git a/tests/codegen/cffi/c-variadic-naked.rs b/tests/codegen/cffi/c-variadic-naked.rs new file mode 100644 index 00000000000..807873ea368 --- /dev/null +++ b/tests/codegen/cffi/c-variadic-naked.rs @@ -0,0 +1,19 @@ +//@ needs-asm-support +//@ only-x86_64 + +// tests that `va_start` is not injected into naked functions + +#![crate_type = "lib"] +#![feature(c_variadic)] +#![feature(naked_functions)] +#![no_std] + +#[naked] +pub unsafe extern "C" fn c_variadic(_: usize, _: ...) { + // CHECK-NOT: va_start + // CHECK-NOT: alloca + core::arch::asm! { + "ret", + options(noreturn), + } +} diff --git a/tests/codegen/naked-fn/naked-functions.rs b/tests/codegen/naked-fn/naked-functions.rs index 755dd155112..3c426825537 100644 --- a/tests/codegen/naked-fn/naked-functions.rs +++ b/tests/codegen/naked-fn/naked-functions.rs @@ -19,7 +19,7 @@ pub unsafe extern "C" fn naked_empty() { } // CHECK: Function Attrs: naked -// CHECK-NEXT: define{{.*}}i{{[0-9]+}} @naked_with_args_and_return(i64 %a, i64 %b) +// CHECK-NEXT: define{{.*}}i{{[0-9]+}} @naked_with_args_and_return(i64 %0, i64 %1) #[no_mangle] #[naked] pub unsafe extern "C" fn naked_with_args_and_return(a: isize, b: isize) -> isize { diff --git a/tests/rustdoc-ui/auxiliary/include-str-bare-urls.md b/tests/rustdoc-ui/auxiliary/include-str-bare-urls.md new file mode 100644 index 00000000000..b07717d8f02 --- /dev/null +++ b/tests/rustdoc-ui/auxiliary/include-str-bare-urls.md @@ -0,0 +1,10 @@ +HEADS UP! https://example.com MUST SHOW UP IN THE STDERR FILE! + +Normally, a line with errors on it will also have a comment +marking it up as something that needs to generate an error. + +The test harness doesn't gather hot comments from this file. +Rustdoc will generate an error for the line, and the `.stderr` +snapshot includes this error, but Compiletest doesn't see it. + +If the stderr file changes, make sure the warning points at the URL! diff --git a/tests/rustdoc-ui/include-str-bare-urls.rs b/tests/rustdoc-ui/include-str-bare-urls.rs new file mode 100644 index 00000000000..c452c88cdd3 --- /dev/null +++ b/tests/rustdoc-ui/include-str-bare-urls.rs @@ -0,0 +1,15 @@ +// https://github.com/rust-lang/rust/issues/118549 +// +// HEADS UP! +// +// Normally, a line with errors on it will also have a comment +// marking it up as something that needs to generate an error. +// +// The test harness doesn't gather hot comments from the `.md` file. +// Rustdoc will generate an error for the line, and the `.stderr` +// snapshot includes this error, but Compiletest doesn't see it. +// +// If the stderr file changes, make sure the warning points at the URL! + +#![deny(rustdoc::bare_urls)] +#![doc=include_str!("auxiliary/include-str-bare-urls.md")] diff --git a/tests/rustdoc-ui/include-str-bare-urls.stderr b/tests/rustdoc-ui/include-str-bare-urls.stderr new file mode 100644 index 00000000000..a4234196b23 --- /dev/null +++ b/tests/rustdoc-ui/include-str-bare-urls.stderr @@ -0,0 +1,15 @@ +error: this URL is not a hyperlink + --> $DIR/auxiliary/include-str-bare-urls.md:1:11 + | +LL | HEADS UP! https://example.com MUST SHOW UP IN THE STDERR FILE! + | ^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com>` + | + = note: bare URLs are not automatically turned into clickable links +note: the lint level is defined here + --> $DIR/include-str-bare-urls.rs:14:9 + | +LL | #![deny(rustdoc::bare_urls)] + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/rustdoc-ui/intra-doc/warning.rs b/tests/rustdoc-ui/intra-doc/warning.rs index 96b5c2b36a1..ed51b2fa41b 100644 --- a/tests/rustdoc-ui/intra-doc/warning.rs +++ b/tests/rustdoc-ui/intra-doc/warning.rs @@ -47,11 +47,11 @@ pub fn d() {} macro_rules! f { ($f:expr) => { - #[doc = $f] //~ WARNING `BarF` + #[doc = $f] pub fn f() {} } } -f!("Foo\nbar [BarF] bar\nbaz"); +f!("Foo\nbar [BarF] bar\nbaz"); //~ WARNING `BarF` /** # for example, * diff --git a/tests/rustdoc-ui/intra-doc/warning.stderr b/tests/rustdoc-ui/intra-doc/warning.stderr index 19399a0df5b..3a06f1787e0 100644 --- a/tests/rustdoc-ui/intra-doc/warning.stderr +++ b/tests/rustdoc-ui/intra-doc/warning.stderr @@ -69,10 +69,10 @@ LL | bar [BarC] bar = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `BarD` - --> $DIR/warning.rs:45:1 + --> $DIR/warning.rs:45:9 | LL | #[doc = "Foo\nbar [BarD] bar\nbaz"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the link appears in this line: @@ -82,13 +82,10 @@ LL | #[doc = "Foo\nbar [BarD] bar\nbaz"] = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `BarF` - --> $DIR/warning.rs:50:9 + --> $DIR/warning.rs:54:4 | -LL | #[doc = $f] - | ^^^^^^^^^^^ -... LL | f!("Foo\nbar [BarF] bar\nbaz"); - | ------------------------------ in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the link appears in this line: @@ -115,10 +112,10 @@ LL | * time to introduce a link [error] = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error` - --> $DIR/warning.rs:68:1 + --> $DIR/warning.rs:68:9 | LL | #[doc = "single line [error]"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ | = note: the link appears in this line: @@ -128,10 +125,10 @@ LL | #[doc = "single line [error]"] = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error` - --> $DIR/warning.rs:71:1 + --> $DIR/warning.rs:71:9 | LL | #[doc = "single line with \"escaping\" [error]"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the link appears in this line: diff --git a/tests/rustdoc-ui/invalid-syntax.stderr b/tests/rustdoc-ui/invalid-syntax.stderr index 6140a06c555..46d7cdb4f7e 100644 --- a/tests/rustdoc-ui/invalid-syntax.stderr +++ b/tests/rustdoc-ui/invalid-syntax.stderr @@ -90,12 +90,13 @@ LL | | /// ``` = note: error from rustc: unknown start of token: \ warning: could not parse code block as Rust code - --> $DIR/invalid-syntax.rs:70:1 + --> $DIR/invalid-syntax.rs:70:9 | -LL | / #[doc = "```"] +LL | #[doc = "```"] + | _________^ LL | | /// \_ LL | | #[doc = "```"] - | |______________^ + | |_____________^ | = help: mark blocks that do not contain Rust code as text: ```text = note: error from rustc: unknown start of token: \ diff --git a/tests/rustdoc-ui/unescaped_backticks.stderr b/tests/rustdoc-ui/unescaped_backticks.stderr index 000a5b597d2..67b87f353a1 100644 --- a/tests/rustdoc-ui/unescaped_backticks.stderr +++ b/tests/rustdoc-ui/unescaped_backticks.stderr @@ -640,10 +640,10 @@ LL | /// or even to add a number `n` to 42 (`add(42, n)\`)! | + error: unescaped backtick - --> $DIR/unescaped_backticks.rs:108:1 + --> $DIR/unescaped_backticks.rs:108:9 | LL | #[doc = "`"] - | ^^^^^^^^^^^^ + | ^^^ | = help: the opening or closing backtick of an inline code may be missing = help: if you meant to use a literal backtick, escape it @@ -651,10 +651,10 @@ LL | #[doc = "`"] to this: \` error: unescaped backtick - --> $DIR/unescaped_backticks.rs:115:1 + --> $DIR/unescaped_backticks.rs:115:9 | LL | #[doc = concat!("\\", "`")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ | = help: the opening backtick of an inline code may be missing change: \` @@ -664,10 +664,10 @@ LL | #[doc = concat!("\\", "`")] to this: \\` error: unescaped backtick - --> $DIR/unescaped_backticks.rs:119:1 + --> $DIR/unescaped_backticks.rs:119:9 | LL | #[doc = "Addition is commutative, which means that add(a, b)` is the same as `add(b, a)`."] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: the opening backtick of a previous inline code may be missing change: Addition is commutative, which means that add(a, b)` is the same as `add(b, a)`. @@ -677,10 +677,10 @@ LL | #[doc = "Addition is commutative, which means that add(a, b)` is the same a to this: Addition is commutative, which means that add(a, b)` is the same as `add(b, a)\`. error: unescaped backtick - --> $DIR/unescaped_backticks.rs:123:1 + --> $DIR/unescaped_backticks.rs:123:9 | LL | #[doc = "Addition is commutative, which means that `add(a, b) is the same as `add(b, a)`."] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: a previous inline code might be longer than expected change: Addition is commutative, which means that `add(a, b) is the same as `add(b, a)`. @@ -690,10 +690,10 @@ LL | #[doc = "Addition is commutative, which means that `add(a, b) is the same a to this: Addition is commutative, which means that `add(a, b) is the same as `add(b, a)\`. error: unescaped backtick - --> $DIR/unescaped_backticks.rs:127:1 + --> $DIR/unescaped_backticks.rs:127:9 | LL | #[doc = "Addition is commutative, which means that `add(a, b)` is the same as add(b, a)`."] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: the opening backtick of an inline code may be missing change: Addition is commutative, which means that `add(a, b)` is the same as add(b, a)`. @@ -703,10 +703,10 @@ LL | #[doc = "Addition is commutative, which means that `add(a, b)` is the same to this: Addition is commutative, which means that `add(a, b)` is the same as add(b, a)\`. error: unescaped backtick - --> $DIR/unescaped_backticks.rs:131:1 + --> $DIR/unescaped_backticks.rs:131:9 | LL | #[doc = "Addition is commutative, which means that `add(a, b)` is the same as `add(b, a)."] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: the closing backtick of an inline code may be missing change: Addition is commutative, which means that `add(a, b)` is the same as `add(b, a). diff --git a/tests/ui/error-codes/E0449.fixed b/tests/ui/error-codes/E0449.fixed new file mode 100644 index 00000000000..c7b4566303d --- /dev/null +++ b/tests/ui/error-codes/E0449.fixed @@ -0,0 +1,18 @@ +//@ run-rustfix + +#![allow(warnings)] + +struct Bar; + +trait Foo { + fn foo(); +} + + impl Bar {} //~ ERROR E0449 + + impl Foo for Bar { //~ ERROR E0449 + fn foo() {} //~ ERROR E0449 +} + +fn main() { +} diff --git a/tests/ui/error-codes/E0449.rs b/tests/ui/error-codes/E0449.rs index eba0d479e97..32d9b35169c 100644 --- a/tests/ui/error-codes/E0449.rs +++ b/tests/ui/error-codes/E0449.rs @@ -1,3 +1,7 @@ +//@ run-rustfix + +#![allow(warnings)] + struct Bar; trait Foo { diff --git a/tests/ui/error-codes/E0449.stderr b/tests/ui/error-codes/E0449.stderr index cf41bcce8c2..c6a98269a19 100644 --- a/tests/ui/error-codes/E0449.stderr +++ b/tests/ui/error-codes/E0449.stderr @@ -1,24 +1,24 @@ error[E0449]: visibility qualifiers are not permitted here - --> $DIR/E0449.rs:7:1 + --> $DIR/E0449.rs:11:1 | LL | pub impl Bar {} - | ^^^ + | ^^^ help: remove the qualifier | = note: place qualifiers on individual impl items instead error[E0449]: visibility qualifiers are not permitted here - --> $DIR/E0449.rs:9:1 + --> $DIR/E0449.rs:13:1 | LL | pub impl Foo for Bar { - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait error[E0449]: visibility qualifiers are not permitted here - --> $DIR/E0449.rs:10:5 + --> $DIR/E0449.rs:14:5 | LL | pub fn foo() {} - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait diff --git a/tests/ui/include-macros/mismatched-types.stderr b/tests/ui/include-macros/mismatched-types.stderr index 4f2880e2f5d..9bc0e64464e 100644 --- a/tests/ui/include-macros/mismatched-types.stderr +++ b/tests/ui/include-macros/mismatched-types.stderr @@ -1,8 +1,11 @@ error[E0308]: mismatched types - --> $DIR/mismatched-types.rs:2:20 + --> $DIR/file.txt:0:1 + | + | + ::: $DIR/mismatched-types.rs:2:12 | LL | let b: &[u8] = include_str!("file.txt"); - | ----- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[u8]`, found `&str` + | ----- ------------------------ in this macro invocation | | | expected due to this | diff --git a/tests/ui/issues/issue-28433.stderr b/tests/ui/issues/issue-28433.stderr index 5fb8a89621c..0fa67e35f1d 100644 --- a/tests/ui/issues/issue-28433.stderr +++ b/tests/ui/issues/issue-28433.stderr @@ -2,7 +2,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/issue-28433.rs:2:5 | LL | pub Duck, - | ^^^ + | ^^^ help: remove the qualifier | = note: enum variants and their fields always share the visibility of the enum they are in @@ -10,7 +10,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/issue-28433.rs:5:5 | LL | pub(crate) Dove - | ^^^^^^^^^^ + | ^^^^^^^^^^ help: remove the qualifier | = note: enum variants and their fields always share the visibility of the enum they are in diff --git a/tests/ui/lexer/dont-ice-on-invalid-lifetime-in-macro-definition.rs b/tests/ui/lexer/dont-ice-on-invalid-lifetime-in-macro-definition.rs new file mode 100644 index 00000000000..caae48dfd3b --- /dev/null +++ b/tests/ui/lexer/dont-ice-on-invalid-lifetime-in-macro-definition.rs @@ -0,0 +1,9 @@ +//@ edition:2021 +macro_rules! a { + ( ) => { + impl<'b> c for d { + e::<f'g> //~ ERROR prefix `f` is unknown + } + }; +} +fn main() {} diff --git a/tests/ui/lexer/dont-ice-on-invalid-lifetime-in-macro-definition.stderr b/tests/ui/lexer/dont-ice-on-invalid-lifetime-in-macro-definition.stderr new file mode 100644 index 00000000000..ecce2c66504 --- /dev/null +++ b/tests/ui/lexer/dont-ice-on-invalid-lifetime-in-macro-definition.stderr @@ -0,0 +1,14 @@ +error: prefix `f` is unknown + --> $DIR/dont-ice-on-invalid-lifetime-in-macro-definition.rs:5:17 + | +LL | e::<f'g> + | ^ unknown prefix + | + = note: prefixed identifiers and literals are reserved since Rust 2021 +help: consider inserting whitespace here + | +LL | e::<f 'g> + | + + +error: aborting due to 1 previous error + diff --git a/tests/ui/lexer/lex-bad-str-literal-as-char-3.rs b/tests/ui/lexer/lex-bad-str-literal-as-char-3.rs index 0ae227da5f1..52781d9c6d8 100644 --- a/tests/ui/lexer/lex-bad-str-literal-as-char-3.rs +++ b/tests/ui/lexer/lex-bad-str-literal-as-char-3.rs @@ -3,5 +3,6 @@ //@[rust2021] edition:2021 fn main() { println!('hello world'); - //[rust2015,rust2018,rust2021]~^ ERROR unterminated character literal + //~^ ERROR unterminated character literal + //[rust2021]~| ERROR prefix `world` is unknown } diff --git a/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2021.stderr b/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2021.stderr index 06f12742667..4170560cfcb 100644 --- a/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2021.stderr +++ b/tests/ui/lexer/lex-bad-str-literal-as-char-3.rust2021.stderr @@ -1,3 +1,15 @@ +error: prefix `world` is unknown + --> $DIR/lex-bad-str-literal-as-char-3.rs:5:21 + | +LL | println!('hello world'); + | ^^^^^ unknown prefix + | + = note: prefixed identifiers and literals are reserved since Rust 2021 +help: if you meant to write a string literal, use double quotes + | +LL | println!("hello world"); + | ~ ~ + error[E0762]: unterminated character literal --> $DIR/lex-bad-str-literal-as-char-3.rs:5:26 | @@ -9,6 +21,6 @@ help: if you meant to write a string literal, use double quotes LL | println!("hello world"); | ~ ~ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0762`. diff --git a/tests/ui/lexer/lex-bad-str-literal-as-char-4.rs b/tests/ui/lexer/lex-bad-str-literal-as-char-4.rs new file mode 100644 index 00000000000..f0c7ad8f82b --- /dev/null +++ b/tests/ui/lexer/lex-bad-str-literal-as-char-4.rs @@ -0,0 +1,9 @@ +//@edition:2021 +macro_rules! foo { + () => { + println!('hello world'); + //~^ ERROR unterminated character literal + //~| ERROR prefix `world` is unknown + } +} +fn main() {} diff --git a/tests/ui/lexer/lex-bad-str-literal-as-char-4.stderr b/tests/ui/lexer/lex-bad-str-literal-as-char-4.stderr new file mode 100644 index 00000000000..af42b5b7f7b --- /dev/null +++ b/tests/ui/lexer/lex-bad-str-literal-as-char-4.stderr @@ -0,0 +1,26 @@ +error: prefix `world` is unknown + --> $DIR/lex-bad-str-literal-as-char-4.rs:4:25 + | +LL | println!('hello world'); + | ^^^^^ unknown prefix + | + = note: prefixed identifiers and literals are reserved since Rust 2021 +help: if you meant to write a string literal, use double quotes + | +LL | println!("hello world"); + | ~ ~ + +error[E0762]: unterminated character literal + --> $DIR/lex-bad-str-literal-as-char-4.rs:4:30 + | +LL | println!('hello world'); + | ^^^ + | +help: if you meant to write a string literal, use double quotes + | +LL | println!("hello world"); + | ~ ~ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0762`. diff --git a/tests/ui/parser/assoc/assoc-static-semantic-fail.stderr b/tests/ui/parser/assoc/assoc-static-semantic-fail.stderr index 8178bd22373..cc21df77353 100644 --- a/tests/ui/parser/assoc/assoc-static-semantic-fail.stderr +++ b/tests/ui/parser/assoc/assoc-static-semantic-fail.stderr @@ -138,7 +138,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/assoc-static-semantic-fail.rs:32:5 | LL | pub(crate) default static TD: u8; - | ^^^^^^^^^^ + | ^^^^^^^^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -162,7 +162,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/assoc-static-semantic-fail.rs:47:5 | LL | pub default static TD: u8; - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait diff --git a/tests/ui/parser/default.stderr b/tests/ui/parser/default.stderr index e6330f368d9..c420e5a774d 100644 --- a/tests/ui/parser/default.stderr +++ b/tests/ui/parser/default.stderr @@ -21,7 +21,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/default.rs:17:5 | LL | pub default fn foo<T: Default>() -> T { - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait diff --git a/tests/ui/parser/trait-pub-assoc-const.stderr b/tests/ui/parser/trait-pub-assoc-const.stderr index 436f6a3909c..1bace786b21 100644 --- a/tests/ui/parser/trait-pub-assoc-const.stderr +++ b/tests/ui/parser/trait-pub-assoc-const.stderr @@ -2,7 +2,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/trait-pub-assoc-const.rs:2:5 | LL | pub const Foo: u32; - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait diff --git a/tests/ui/parser/trait-pub-assoc-ty.stderr b/tests/ui/parser/trait-pub-assoc-ty.stderr index 279e3a95354..28e05bdc630 100644 --- a/tests/ui/parser/trait-pub-assoc-ty.stderr +++ b/tests/ui/parser/trait-pub-assoc-ty.stderr @@ -2,7 +2,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/trait-pub-assoc-ty.rs:2:5 | LL | pub type Foo; - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait diff --git a/tests/ui/parser/trait-pub-method.stderr b/tests/ui/parser/trait-pub-method.stderr index ee8b6f7cb62..cc1ba0eaaea 100644 --- a/tests/ui/parser/trait-pub-method.stderr +++ b/tests/ui/parser/trait-pub-method.stderr @@ -2,7 +2,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/trait-pub-method.rs:2:5 | LL | pub fn foo(); - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait diff --git a/tests/ui/privacy/issue-113860-1.stderr b/tests/ui/privacy/issue-113860-1.stderr index c33ce26f0f6..c05452fb51c 100644 --- a/tests/ui/privacy/issue-113860-1.stderr +++ b/tests/ui/privacy/issue-113860-1.stderr @@ -2,7 +2,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/issue-113860-1.rs:12:5 | LL | pub(self) fn fun() {} - | ^^^^^^^^^ + | ^^^^^^^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait diff --git a/tests/ui/privacy/issue-113860-2.stderr b/tests/ui/privacy/issue-113860-2.stderr index 6748bc27668..c53c490ca1e 100644 --- a/tests/ui/privacy/issue-113860-2.stderr +++ b/tests/ui/privacy/issue-113860-2.stderr @@ -2,7 +2,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/issue-113860-2.rs:12:5 | LL | pub(self) type X = Self; - | ^^^^^^^^^ + | ^^^^^^^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait diff --git a/tests/ui/privacy/issue-113860.stderr b/tests/ui/privacy/issue-113860.stderr index 3204f4ff916..d813b740ac5 100644 --- a/tests/ui/privacy/issue-113860.stderr +++ b/tests/ui/privacy/issue-113860.stderr @@ -2,7 +2,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/issue-113860.rs:12:5 | LL | pub(self) const X: u32 = 3; - | ^^^^^^^^^ + | ^^^^^^^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait diff --git a/tests/ui/privacy/issue-29161.stderr b/tests/ui/privacy/issue-29161.stderr index 1a6c80499a1..f8911cb09c1 100644 --- a/tests/ui/privacy/issue-29161.stderr +++ b/tests/ui/privacy/issue-29161.stderr @@ -2,7 +2,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/issue-29161.rs:5:9 | LL | pub fn default() -> A { - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait diff --git a/tests/ui/privacy/priv-in-bad-locations.stderr b/tests/ui/privacy/priv-in-bad-locations.stderr index 70dab5bfe13..93a0eabb914 100644 --- a/tests/ui/privacy/priv-in-bad-locations.stderr +++ b/tests/ui/privacy/priv-in-bad-locations.stderr @@ -2,7 +2,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/priv-in-bad-locations.rs:1:1 | LL | pub extern "C" { - | ^^^ + | ^^^ help: remove the qualifier | = note: place qualifiers on individual foreign items instead @@ -10,7 +10,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/priv-in-bad-locations.rs:11:1 | LL | pub impl B {} - | ^^^ + | ^^^ help: remove the qualifier | = note: place qualifiers on individual impl items instead @@ -18,7 +18,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/priv-in-bad-locations.rs:13:1 | LL | pub impl A for B { - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -26,7 +26,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/priv-in-bad-locations.rs:14:5 | LL | pub fn foo(&self) {} - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait diff --git a/tests/ui/privacy/privacy-sanity.stderr b/tests/ui/privacy/privacy-sanity.stderr index a537f8c1901..0acb05cbaba 100644 --- a/tests/ui/privacy/privacy-sanity.stderr +++ b/tests/ui/privacy/privacy-sanity.stderr @@ -2,7 +2,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:13:1 | LL | pub impl Tr for S { - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -10,7 +10,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:14:5 | LL | pub fn f() {} - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -18,7 +18,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:15:5 | LL | pub const C: u8 = 0; - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -26,7 +26,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:16:5 | LL | pub type T = u8; - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -34,7 +34,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:18:1 | LL | pub impl S { - | ^^^ + | ^^^ help: remove the qualifier | = note: place qualifiers on individual impl items instead @@ -42,7 +42,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:23:1 | LL | pub extern "C" { - | ^^^ + | ^^^ help: remove the qualifier | = note: place qualifiers on individual foreign items instead @@ -50,7 +50,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:39:5 | LL | pub impl Tr for S { - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -58,7 +58,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:40:9 | LL | pub fn f() {} - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -66,7 +66,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:41:9 | LL | pub const C: u8 = 0; - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -74,7 +74,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:42:9 | LL | pub type T = u8; - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -82,7 +82,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:44:5 | LL | pub impl S { - | ^^^ + | ^^^ help: remove the qualifier | = note: place qualifiers on individual impl items instead @@ -90,7 +90,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:49:5 | LL | pub extern "C" { - | ^^^ + | ^^^ help: remove the qualifier | = note: place qualifiers on individual foreign items instead @@ -98,7 +98,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:68:5 | LL | pub impl Tr for S { - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -106,7 +106,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:69:9 | LL | pub fn f() {} - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -114,7 +114,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:70:9 | LL | pub const C: u8 = 0; - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -122,7 +122,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:71:9 | LL | pub type T = u8; - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -130,7 +130,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:73:5 | LL | pub impl S { - | ^^^ + | ^^^ help: remove the qualifier | = note: place qualifiers on individual impl items instead @@ -138,7 +138,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/privacy-sanity.rs:78:5 | LL | pub extern "C" { - | ^^^ + | ^^^ help: remove the qualifier | = note: place qualifiers on individual foreign items instead diff --git a/tests/ui/privacy/useless-pub.stderr b/tests/ui/privacy/useless-pub.stderr index 73497e3fed5..7d064c12a09 100644 --- a/tests/ui/privacy/useless-pub.stderr +++ b/tests/ui/privacy/useless-pub.stderr @@ -2,7 +2,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/useless-pub.rs:8:5 | LL | pub fn foo(&self) {} - | ^^^ + | ^^^ help: remove the qualifier | = note: trait items always share the visibility of their trait @@ -10,7 +10,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/useless-pub.rs:12:10 | LL | V1 { pub f: i32 }, - | ^^^ + | ^^^ help: remove the qualifier | = note: enum variants and their fields always share the visibility of the enum they are in @@ -18,7 +18,7 @@ error[E0449]: visibility qualifiers are not permitted here --> $DIR/useless-pub.rs:13:8 | LL | V2(pub i32), - | ^^^ + | ^^^ help: remove the qualifier | = note: enum variants and their fields always share the visibility of the enum they are in |
