Skip to content

Commit 309b46a

Browse files
committed
Fix test output expectations
1 parent 80314b1 commit 309b46a

36 files changed

+186
-246
lines changed

tests/ui-fulldeps/stable-mir/check_attribute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn test_stable_mir() -> ControlFlow<()> {
3939
fn test_builtins(items: &CrateItems) {
4040
let target_fn = *get_item(&items, "builtins_fn").unwrap();
4141
let allow_attrs = target_fn.attrs_by_path(&["allow".to_string()]);
42-
assert_eq!(allow_attrs[0].as_str(), "#![allow(unused_variables)]");
42+
assert_eq!(allow_attrs[0].as_str(), "#[allow(unused_variables)]");
4343

4444
let inline_attrs = target_fn.attrs_by_path(&["inline".to_string()]);
4545
assert_eq!(inline_attrs[0].as_str(), "#[inline]");

tests/ui/attributes/arg-error-issue-121425.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses
2+
--> $DIR/arg-error-issue-121425.rs:16:8
3+
|
4+
LL | #[repr(align())]
5+
| ^^^^^^^
6+
17
error[E0693]: incorrect `repr(align)` attribute format: `align` expects a literal integer as argument
28
--> $DIR/arg-error-issue-121425.rs:4:14
39
|
@@ -16,12 +22,6 @@ error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer
1622
LL | #[repr(align("str"))]
1723
| ^^^^^
1824

19-
error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses
20-
--> $DIR/arg-error-issue-121425.rs:16:8
21-
|
22-
LL | #[repr(align())]
23-
| ^^^^^^^
24-
2525
error[E0552]: incorrect `repr(packed)` attribute format: `packed` expects a literal integer as argument
2626
--> $DIR/arg-error-issue-121425.rs:21:15
2727
|

tests/ui/attributes/issue-100631.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0084]: unsupported representation for zero-variant enum
2-
--> $DIR/issue-100631.rs:4:1
2+
--> $DIR/issue-100631.rs:4:8
33
|
44
LL | #[repr(C)]
5-
| ^^^^^^^^^^
5+
| ^
66
LL | #[repr(C)]
77
LL | enum Foo {}
88
| -------- zero-variant enum

tests/ui/attributes/mixed_export_name_and_no_mangle.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@ check-pass
44

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

tests/ui/attributes/mixed_export_name_and_no_mangle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

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

tests/ui/attributes/mixed_export_name_and_no_mangle.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
warning: `#[no_mangle]` attribute may not be used in combination with `#[export_name]`
1+
warning: `#[unsafe(no_mangle)]` attribute may not be used in combination with `#[export_name]`
22
--> $DIR/mixed_export_name_and_no_mangle.rs:6:1
33
|
44
LL | #[no_mangle]
5-
| ^^^^^^^^^^^^ `#[no_mangle]` is ignored
5+
| ^^^^^^^^^^^^ `#[unsafe(no_mangle)]` is ignored
66
|
77
note: `#[export_name]` takes precedence
88
--> $DIR/mixed_export_name_and_no_mangle.rs:8:1
@@ -14,7 +14,7 @@ note: the lint level is defined here
1414
|
1515
LL | #![warn(unused_attributes)]
1616
| ^^^^^^^^^^^^^^^^^
17-
help: remove the `#[no_mangle]` attribute
17+
help: remove the `#[unsafe(no_mangle)]` attribute
1818
|
1919
LL - #[no_mangle]
2020
|

tests/ui/attributes/nonterminal-expansion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ macro_rules! pass_nonterminal {
66
($n:expr) => {
77
#[repr(align($n))]
88
//~^ ERROR expected unsuffixed literal, found `n!()`
9+
//~^^ ERROR incorrect `repr(align)` attribute format: `align` expects a literal integer as argument [E0693]
910
struct S;
1011
};
1112
}
@@ -15,6 +16,5 @@ macro_rules! n {
1516
}
1617

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

2020
fn main() {}

tests/ui/attributes/nonterminal-expansion.stderr

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ LL | pass_nonterminal!(n!());
1010
= note: this error originates in the macro `pass_nonterminal` (in Nightly builds, run with -Z macro-backtrace for more info)
1111

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

1823
error: aborting due to 2 previous errors
1924

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
trait MyTrait {
2+
#[repr(align)] //~ ERROR invalid `repr(align)` attribute: `align` needs an argument
3+
fn myfun();
4+
}
5+
6+
pub fn main() {}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0589]: invalid `repr(align)` attribute: `align` needs an argument
2+
--> $DIR/repr-align-in-trait-issue-132391.rs:2:12
3+
|
4+
LL | #[repr(align)]
5+
| ^^^^^ help: supply an argument here: `align(...)`
6+
7+
error: aborting due to 1 previous error
8+
9+
For more information about this error, try `rustc --explain E0589`.

0 commit comments

Comments
 (0)