Skip to content

Commit e8773d9

Browse files
committed
Fix test output expectations
1 parent cb5fcc8 commit e8773d9

36 files changed

+185
-253
lines changed

tests/crashes/132391.rs

-8
This file was deleted.

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

+6-6
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

+2-2
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

+1-1
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

+1-1
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

+3-3
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

+1-1
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

+7-2
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

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() {}
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`.

tests/ui/attributes/rustc_confusables.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ error: malformed `rustc_confusables` attribute input
44
LL | #[rustc_confusables]
55
| ^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_confusables("name1", "name2", ...)]`
66

7-
error: attribute should be applied to an inherent method
8-
--> $DIR/rustc_confusables.rs:45:1
9-
|
10-
LL | #[rustc_confusables("blah")]
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12-
137
error: expected at least one confusable name
148
--> $DIR/rustc_confusables.rs:30:5
159
|
@@ -27,6 +21,12 @@ help: consider surrounding this with quotes
2721
LL | #[rustc_confusables("invalid_meta_item")]
2822
| + +
2923

24+
error: attribute should be applied to an inherent method
25+
--> $DIR/rustc_confusables.rs:45:1
26+
|
27+
LL | #[rustc_confusables("blah")]
28+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29+
3030
error[E0599]: no method named `inser` found for struct `rustc_confusables_across_crate::BTreeSet` in the current scope
3131
--> $DIR/rustc_confusables.rs:12:7
3232
|

tests/ui/deprecation/deprecation-sanity.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ mod bogus_attribute_types_1 {
44
#[deprecated(since = "a", note = "a", reason)] //~ ERROR unknown meta item 'reason'
55
fn f1() { }
66

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

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

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

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

1919
#[deprecated(note = b"test")] //~ ERROR literal in `deprecated` value must be a string

tests/ui/deprecation/deprecation-sanity.stderr

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,28 @@
1-
error: multiple `deprecated` attributes
2-
--> $DIR/deprecation-sanity.rs:27:1
3-
|
4-
LL | #[deprecated(since = "a", note = "b")]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
6-
|
7-
note: attribute also specified here
8-
--> $DIR/deprecation-sanity.rs:26:1
9-
|
10-
LL | #[deprecated(since = "a", note = "b")]
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12-
131
error[E0541]: unknown meta item 'reason'
142
--> $DIR/deprecation-sanity.rs:4:43
153
|
164
LL | #[deprecated(since = "a", note = "a", reason)]
175
| ^^^^^^ expected one of `since`, `note`
186

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

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

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

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

45+
error: multiple `deprecated` attributes
46+
--> $DIR/deprecation-sanity.rs:27:1
47+
|
48+
LL | #[deprecated(since = "a", note = "b")]
49+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
50+
|
51+
note: attribute also specified here
52+
--> $DIR/deprecation-sanity.rs:26:1
53+
|
54+
LL | #[deprecated(since = "a", note = "b")]
55+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56+
5757
error[E0538]: multiple 'since' items
5858
--> $DIR/deprecation-sanity.rs:30:27
5959
|

tests/ui/deprecation/issue-66340-deprecated-attr-non-meta-grammar.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// was a well-formed `MetaItem`.
44

55
fn main() {
6-
foo()
6+
foo() //~ WARNING use of deprecated function `foo`
77
}
88

99
#[deprecated(note = test)]

tests/ui/deprecation/issue-66340-deprecated-attr-non-meta-grammar.stderr

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,13 @@ help: surround the identifier with quotation marks to make it into a string lite
99
LL | #[deprecated(note = "test")]
1010
| + +
1111

12-
error: aborting due to 1 previous error
12+
warning: use of deprecated function `foo`
13+
--> $DIR/issue-66340-deprecated-attr-non-meta-grammar.rs:6:5
14+
|
15+
LL | foo()
16+
| ^^^
17+
|
18+
= note: `#[warn(deprecated)]` on by default
19+
20+
error: aborting due to 1 previous error; 1 warning emitted
1321

tests/ui/error-codes/E0084.stderr

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

tests/ui/error-codes/E0565.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0565]: meta item in `repr` must be an identifier
2-
--> $DIR/E0565.rs:2:8
2+
--> $DIR/E0565.rs:2:1
33
|
44
LL | #[repr("C")]
5-
| ^^^
5+
| ^^^^^^^^^^^^
66

77
error: aborting due to 1 previous error
88

tests/ui/error-codes/E0789.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@
88
// #[stable(feature = "foo", since = "1.0")]
99
struct Foo;
1010
//~^ ERROR `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
11-
//~^^ ERROR `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
12-
// FIXME: we shouldn't have two errors here, only occurs when using `-Zdeduplicate-diagnostics=no`

tests/ui/error-codes/E0789.stderr

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ error[E0789]: `rustc_allowed_through_unstable_modules` attribute must be paired
44
LL | struct Foo;
55
| ^^^^^^^^^^^
66

7-
error[E0789]: `rustc_allowed_through_unstable_modules` attribute must be paired with a `stable` attribute
8-
--> $DIR/E0789.rs:9:1
9-
|
10-
LL | struct Foo;
11-
| ^^^^^^^^^^^
12-
|
13-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
14-
15-
error: aborting due to 2 previous errors
7+
error: aborting due to 1 previous error
168

179
For more information about this error, try `rustc --explain E0789`.

tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// checks that this attribute is caught on non-macro items.
22
// this needs a different test since this is done after expansion
33

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

tests/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr

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

1010
error: attribute should be applied to a macro
11-
--> $DIR/feature-gate-allow-internal-unstable-struct.rs:4:1
11+
--> $DIR/feature-gate-allow-internal-unstable-struct.rs:6:1
1212
|
13-
LL | #[allow_internal_unstable()]
14-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13+
LL | #[allow_internal_unstable(something)]
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1515
LL |
1616
LL | struct S;
1717
| --------- not a macro

tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr

+15-15
Original file line numberDiff line numberDiff line change
@@ -175,21 +175,6 @@ LL - #![start]
175175
LL + #[start]
176176
|
177177

178-
error: `repr` attribute cannot be used at crate level
179-
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:19:1
180-
|
181-
LL | #![repr()]
182-
| ^^^^^^^^^^
183-
...
184-
LL | mod inline {
185-
| ------ the inner attribute doesn't annotate this module
186-
|
187-
help: perhaps you meant to use an outer attribute
188-
|
189-
LL - #![repr()]
190-
LL + #[repr()]
191-
|
192-
193178
error: `path` attribute cannot be used at crate level
194179
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:21:1
195180
|
@@ -220,6 +205,21 @@ LL - #![automatically_derived]
220205
LL + #[automatically_derived]
221206
|
222207

208+
error: `repr` attribute cannot be used at crate level
209+
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:19:1
210+
|
211+
LL | #![repr()]
212+
| ^^^^^^^^^^
213+
...
214+
LL | mod inline {
215+
| ------ the inner attribute doesn't annotate this module
216+
|
217+
help: perhaps you meant to use an outer attribute
218+
|
219+
LL - #![repr()]
220+
LL + #[repr()]
221+
|
222+
223223
error[E0518]: attribute should be applied to function or closure
224224
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:43:17
225225
|

0 commit comments

Comments
 (0)