Skip to content

Commit

Permalink
Fix test output expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
jdonszelmann committed Jan 20, 2025
1 parent 6c69b5f commit 2f73b56
Show file tree
Hide file tree
Showing 36 changed files with 185 additions and 253 deletions.
8 changes: 0 additions & 8 deletions tests/crashes/132391.rs

This file was deleted.

12 changes: 6 additions & 6 deletions tests/ui/attributes/arg-error-issue-121425.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses
--> $DIR/arg-error-issue-121425.rs:16:8
|
LL | #[repr(align())]
| ^^^^^^^

error[E0693]: incorrect `repr(align)` attribute format: `align` expects a literal integer as argument
--> $DIR/arg-error-issue-121425.rs:4:14
|
Expand All @@ -16,12 +22,6 @@ error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer
LL | #[repr(align("str"))]
| ^^^^^

error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses
--> $DIR/arg-error-issue-121425.rs:16:8
|
LL | #[repr(align())]
| ^^^^^^^

error[E0552]: incorrect `repr(packed)` attribute format: `packed` expects a literal integer as argument
--> $DIR/arg-error-issue-121425.rs:21:15
|
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/attributes/issue-100631.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0084]: unsupported representation for zero-variant enum
--> $DIR/issue-100631.rs:4:1
--> $DIR/issue-100631.rs:4:8
|
LL | #[repr(C)]
| ^^^^^^^^^^
| ^
LL | #[repr(C)]
LL | enum Foo {}
| -------- zero-variant enum
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/attributes/mixed_export_name_and_no_mangle.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//@ check-pass

#![warn(unused_attributes)]
//~^ WARN `#[no_mangle]` attribute may not be used in combination with `#[export_name]` [unused_attributes]
//~^ WARN `#[unsafe(no_mangle)]` attribute may not be used in combination with `#[export_name]` [unused_attributes]
#[export_name = "foo"]
pub fn bar() {}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/attributes/mixed_export_name_and_no_mangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#![warn(unused_attributes)]
#[no_mangle]
//~^ WARN `#[no_mangle]` attribute may not be used in combination with `#[export_name]` [unused_attributes]
//~^ WARN `#[unsafe(no_mangle)]` attribute may not be used in combination with `#[export_name]` [unused_attributes]
#[export_name = "foo"]
pub fn bar() {}

Expand Down
6 changes: 3 additions & 3 deletions tests/ui/attributes/mixed_export_name_and_no_mangle.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
warning: `#[no_mangle]` attribute may not be used in combination with `#[export_name]`
warning: `#[unsafe(no_mangle)]` attribute may not be used in combination with `#[export_name]`
--> $DIR/mixed_export_name_and_no_mangle.rs:6:1
|
LL | #[no_mangle]
| ^^^^^^^^^^^^ `#[no_mangle]` is ignored
| ^^^^^^^^^^^^ `#[unsafe(no_mangle)]` is ignored
|
note: `#[export_name]` takes precedence
--> $DIR/mixed_export_name_and_no_mangle.rs:8:1
Expand All @@ -14,7 +14,7 @@ note: the lint level is defined here
|
LL | #![warn(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
help: remove the `#[no_mangle]` attribute
help: remove the `#[unsafe(no_mangle)]` attribute
|
LL - #[no_mangle]
|
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/attributes/nonterminal-expansion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ macro_rules! pass_nonterminal {
($n:expr) => {
#[repr(align($n))]
//~^ ERROR expected unsuffixed literal, found `n!()`
//~^^ ERROR incorrect `repr(align)` attribute format: `align` expects a literal integer as argument [E0693]
struct S;
};
}
Expand All @@ -15,6 +16,5 @@ macro_rules! n {
}

pass_nonterminal!(n!());
//~^ ERROR incorrect `repr(align)` attribute format: `align` expects a literal integer as argument [E0693]

fn main() {}
9 changes: 7 additions & 2 deletions tests/ui/attributes/nonterminal-expansion.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ LL | pass_nonterminal!(n!());
= note: this error originates in the macro `pass_nonterminal` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0693]: incorrect `repr(align)` attribute format: `align` expects a literal integer as argument
--> $DIR/nonterminal-expansion.rs:17:19
--> $DIR/nonterminal-expansion.rs:7:22
|
LL | #[repr(align($n))]
| ^^
...
LL | pass_nonterminal!(n!());
| ^
| ----------------------- in this macro invocation
|
= note: this error originates in the macro `pass_nonterminal` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors

Expand Down
6 changes: 6 additions & 0 deletions tests/ui/attributes/repr-align-in-trait-issue-132391.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
trait MyTrait {
#[repr(align)] //~ ERROR invalid `repr(align)` attribute: `align` needs an argument
fn myfun();
}

pub fn main() {}
9 changes: 9 additions & 0 deletions tests/ui/attributes/repr-align-in-trait-issue-132391.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0589]: invalid `repr(align)` attribute: `align` needs an argument
--> $DIR/repr-align-in-trait-issue-132391.rs:2:12
|
LL | #[repr(align)]
| ^^^^^ help: supply an argument here: `align(...)`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0589`.
12 changes: 6 additions & 6 deletions tests/ui/attributes/rustc_confusables.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ error: malformed `rustc_confusables` attribute input
LL | #[rustc_confusables]
| ^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_confusables("name1", "name2", ...)]`

error: attribute should be applied to an inherent method
--> $DIR/rustc_confusables.rs:45:1
|
LL | #[rustc_confusables("blah")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: expected at least one confusable name
--> $DIR/rustc_confusables.rs:30:5
|
Expand All @@ -27,6 +21,12 @@ help: consider surrounding this with quotes
LL | #[rustc_confusables("invalid_meta_item")]
| + +

error: attribute should be applied to an inherent method
--> $DIR/rustc_confusables.rs:45:1
|
LL | #[rustc_confusables("blah")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0599]: no method named `inser` found for struct `rustc_confusables_across_crate::BTreeSet` in the current scope
--> $DIR/rustc_confusables.rs:12:7
|
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/deprecation/deprecation-sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ mod bogus_attribute_types_1 {
#[deprecated(since = "a", note = "a", reason)] //~ ERROR unknown meta item 'reason'
fn f1() { }

#[deprecated(since = "a", note)] //~ ERROR incorrect meta item
#[deprecated(since = "a", note)] //~ ERROR expected a quoted string literal
fn f2() { }

#[deprecated(since, note = "a")] //~ ERROR incorrect meta item
#[deprecated(since, note = "a")] //~ ERROR expected a quoted string literal
fn f3() { }

#[deprecated(since = "a", note(b))] //~ ERROR incorrect meta item
#[deprecated(since = "a", note(b))] //~ ERROR expected a quoted string literal
fn f5() { }

#[deprecated(since(b), note = "a")] //~ ERROR incorrect meta item
#[deprecated(since(b), note = "a")] //~ ERROR expected a quoted string literal
fn f6() { }

#[deprecated(note = b"test")] //~ ERROR literal in `deprecated` value must be a string
Expand Down
32 changes: 16 additions & 16 deletions tests/ui/deprecation/deprecation-sanity.stderr
Original file line number Diff line number Diff line change
@@ -1,40 +1,28 @@
error: multiple `deprecated` attributes
--> $DIR/deprecation-sanity.rs:27:1
|
LL | #[deprecated(since = "a", note = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/deprecation-sanity.rs:26:1
|
LL | #[deprecated(since = "a", note = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0541]: unknown meta item 'reason'
--> $DIR/deprecation-sanity.rs:4:43
|
LL | #[deprecated(since = "a", note = "a", reason)]
| ^^^^^^ expected one of `since`, `note`

error[E0539]: incorrect meta item
error[E0539]: expected a quoted string literal
--> $DIR/deprecation-sanity.rs:7:31
|
LL | #[deprecated(since = "a", note)]
| ^^^^

error[E0539]: incorrect meta item
error[E0539]: expected a quoted string literal
--> $DIR/deprecation-sanity.rs:10:18
|
LL | #[deprecated(since, note = "a")]
| ^^^^^

error[E0539]: incorrect meta item
error[E0539]: expected a quoted string literal
--> $DIR/deprecation-sanity.rs:13:31
|
LL | #[deprecated(since = "a", note(b))]
| ^^^^^^^

error[E0539]: incorrect meta item
error[E0539]: expected a quoted string literal
--> $DIR/deprecation-sanity.rs:16:18
|
LL | #[deprecated(since(b), note = "a")]
Expand All @@ -54,6 +42,18 @@ error[E0565]: item in `deprecated` must be a key/value pair
LL | #[deprecated("test")]
| ^^^^^^

error: multiple `deprecated` attributes
--> $DIR/deprecation-sanity.rs:27:1
|
LL | #[deprecated(since = "a", note = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/deprecation-sanity.rs:26:1
|
LL | #[deprecated(since = "a", note = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0538]: multiple 'since' items
--> $DIR/deprecation-sanity.rs:30:27
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// was a well-formed `MetaItem`.

fn main() {
foo()
foo() //~ WARNING use of deprecated function `foo`
}

#[deprecated(note = test)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,13 @@ help: surround the identifier with quotation marks to make it into a string lite
LL | #[deprecated(note = "test")]
| + +

error: aborting due to 1 previous error
warning: use of deprecated function `foo`
--> $DIR/issue-66340-deprecated-attr-non-meta-grammar.rs:6:5
|
LL | foo()
| ^^^
|
= note: `#[warn(deprecated)]` on by default

error: aborting due to 1 previous error; 1 warning emitted

4 changes: 2 additions & 2 deletions tests/ui/error-codes/E0084.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0084]: unsupported representation for zero-variant enum
--> $DIR/E0084.rs:1:1
--> $DIR/E0084.rs:1:8
|
LL | #[repr(i32)]
| ^^^^^^^^^^^^
| ^^^
LL | enum Foo {}
| -------- zero-variant enum

Expand Down
4 changes: 2 additions & 2 deletions tests/ui/error-codes/E0565.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0565]: meta item in `repr` must be an identifier
--> $DIR/E0565.rs:2:8
--> $DIR/E0565.rs:2:1
|
LL | #[repr("C")]
| ^^^
| ^^^^^^^^^^^^

error: aborting due to 1 previous error

Expand Down
2 changes: 0 additions & 2 deletions tests/ui/error-codes/E0789.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@
// #[stable(feature = "foo", since = "1.0")]
struct Foo;
//~^ ERROR `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
//~^^ ERROR `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
// FIXME: we shouldn't have two errors here, only occurs when using `-Zdeduplicate-diagnostics=no`
10 changes: 1 addition & 9 deletions tests/ui/error-codes/E0789.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ error[E0789]: `rustc_allowed_through_unstable_modules` attribute must be paired
LL | struct Foo;
| ^^^^^^^^^^^

error[E0789]: `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
--> $DIR/E0789.rs:9:1
|
LL | struct Foo;
| ^^^^^^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: aborting due to 2 previous errors
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0789`.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// checks that this attribute is caught on non-macro items.
// this needs a different test since this is done after expansion

#[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps
// FIXME(jdonszelmann): empty attributes are currently ignored, since when its empty no actual
// change is applied. This should be fixed when later moving this check to attribute parsing.
#[allow_internal_unstable(something)] //~ ERROR allow_internal_unstable side-steps
//~| ERROR attribute should
struct S;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
error[E0658]: allow_internal_unstable side-steps feature gating and stability checks
--> $DIR/feature-gate-allow-internal-unstable-struct.rs:4:1
--> $DIR/feature-gate-allow-internal-unstable-struct.rs:6:1
|
LL | #[allow_internal_unstable()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #[allow_internal_unstable(something)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(allow_internal_unstable)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error: attribute should be applied to a macro
--> $DIR/feature-gate-allow-internal-unstable-struct.rs:4:1
--> $DIR/feature-gate-allow-internal-unstable-struct.rs:6:1
|
LL | #[allow_internal_unstable()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #[allow_internal_unstable(something)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL |
LL | struct S;
| --------- not a macro
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,21 +175,6 @@ LL - #![start]
LL + #[start]
|

error: `repr` attribute cannot be used at crate level
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:19:1
|
LL | #![repr()]
| ^^^^^^^^^^
...
LL | mod inline {
| ------ the inner attribute doesn't annotate this module
|
help: perhaps you meant to use an outer attribute
|
LL - #![repr()]
LL + #[repr()]
|

error: `path` attribute cannot be used at crate level
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:21:1
|
Expand Down Expand Up @@ -220,6 +205,21 @@ LL - #![automatically_derived]
LL + #[automatically_derived]
|

error: `repr` attribute cannot be used at crate level
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:19:1
|
LL | #![repr()]
| ^^^^^^^^^^
...
LL | mod inline {
| ------ the inner attribute doesn't annotate this module
|
help: perhaps you meant to use an outer attribute
|
LL - #![repr()]
LL + #[repr()]
|

error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:43:17
|
Expand Down
Loading

0 comments on commit 2f73b56

Please sign in to comment.