Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ec5b2cc

Browse files
Updated uitests for new parser
1 parent 17e34f6 commit ec5b2cc

25 files changed

+193
-151
lines changed

‎tests/assembly-llvm/asm/mips-types.rs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ check!(reg_f32, f32, freg, "mov.s");
9494
// CHECK: #APP
9595
// CHECK: mov.s $f0, $f0
9696
// CHECK: #NO_APP
97-
#[no_mangle]
9897
check_reg!(f0_f32, f32, "$f0", "mov.s");
9998

10099
// CHECK-LABEL: reg_f32_64:
@@ -107,21 +106,18 @@ check!(reg_f32_64, f32, freg, "mov.d");
107106
// CHECK: #APP
108107
// CHECK: mov.d $f0, $f0
109108
// CHECK: #NO_APP
110-
#[no_mangle]
111109
check_reg!(f0_f32_64, f32, "$f0", "mov.d");
112110

113111
// CHECK-LABEL: reg_f64:
114112
// CHECK: #APP
115113
// CHECK: mov.d $f{{[0-9]+}}, $f{{[0-9]+}}
116114
// CHECK: #NO_APP
117-
#[no_mangle]
118115
check!(reg_f64, f64, freg, "mov.d");
119116

120117
// CHECK-LABEL: f0_f64:
121118
// CHECK: #APP
122119
// CHECK: mov.d $f0, $f0
123120
// CHECK: #NO_APP
124-
#[no_mangle]
125121
check_reg!(f0_f64, f64, "$f0", "mov.d");
126122

127123
// CHECK-LABEL: reg_ptr:

‎tests/ui/attributes/key-value-expansion.stderr‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
error: attribute value must be a literal
2-
--> $DIR/key-value-expansion.rs:21:6
3-
|
4-
LL | bug!((column!()));
5-
| ^^^^^^^^^^^
6-
71
error: attribute value must be a literal
82
--> $DIR/key-value-expansion.rs:27:14
93
|
@@ -26,5 +20,11 @@ LL | some_macro!(u8);
2620
|
2721
= note: this error originates in the macro `some_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
2822

23+
error: attribute value must be a literal
24+
--> $DIR/key-value-expansion.rs:21:6
25+
|
26+
LL | bug!((column!()));
27+
| ^^^^^^^^^^^
28+
2929
error: aborting due to 3 previous errors
3030

‎tests/ui/attributes/malformed-fn-align.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fn f3() {}
2626
#[repr(align(16))] //~ ERROR `#[repr(align(...))]` is not supported on functions
2727
fn f4() {}
2828

29-
#[rustc_align(-1)] //~ ERROR expected unsuffixed literal, found `-`
29+
#[rustc_align(-1)] //~ ERROR expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `-`
3030
fn f5() {}
3131

3232
#[rustc_align(3)] //~ ERROR invalid alignment value: not a power of two

‎tests/ui/attributes/malformed-fn-align.stderr‎

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
error: expected unsuffixed literal, found `-`
2-
--> $DIR/malformed-fn-align.rs:29:15
3-
|
4-
LL | #[rustc_align(-1)]
5-
| ^
6-
7-
error: suffixed literals are not allowed in attributes
8-
--> $DIR/malformed-fn-align.rs:35:15
9-
|
10-
LL | #[rustc_align(4usize)]
11-
| ^^^^^^
12-
|
13-
= help: instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)
14-
151
error[E0539]: malformed `rustc_align` attribute input
162
--> $DIR/malformed-fn-align.rs:10:5
173
|
@@ -51,12 +37,32 @@ error[E0589]: invalid alignment value: not a power of two
5137
LL | #[rustc_align(0)]
5238
| ^
5339

40+
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `-`
41+
--> $DIR/malformed-fn-align.rs:29:15
42+
|
43+
LL | #[rustc_align(-1)]
44+
| ^
45+
|
46+
help: negative numbers are not literals, try removing the `-` sign
47+
|
48+
LL - #[rustc_align(-1)]
49+
LL + #[rustc_align(1)]
50+
|
51+
5452
error[E0589]: invalid alignment value: not a power of two
5553
--> $DIR/malformed-fn-align.rs:32:15
5654
|
5755
LL | #[rustc_align(3)]
5856
| ^
5957

58+
error: suffixed literals are not allowed in attributes
59+
--> $DIR/malformed-fn-align.rs:35:15
60+
|
61+
LL | #[rustc_align(4usize)]
62+
| ^^^^^^
63+
|
64+
= help: instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)
65+
6066
error[E0589]: invalid alignment value: not an unsuffixed integer
6167
--> $DIR/malformed-fn-align.rs:35:15
6268
|

‎tests/ui/attributes/nonterminal-expansion.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
macro_rules! pass_nonterminal {
66
($n:expr) => {
77
#[repr(align($n))]
8-
//~^ ERROR expected unsuffixed literal, found `expr` metavariable
8+
//~^ ERROR expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
99
struct S;
1010
};
1111
}
@@ -15,6 +15,5 @@ macro_rules! n {
1515
}
1616

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

2019
fn main() {}
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: expected unsuffixed literal, found `expr` metavariable
1+
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
22
--> $DIR/nonterminal-expansion.rs:7:22
33
|
44
LL | #[repr(align($n))]
@@ -9,12 +9,5 @@ LL | pass_nonterminal!(n!());
99
|
1010
= note: this error originates in the macro `pass_nonterminal` (in Nightly builds, run with -Z macro-backtrace for more info)
1111

12-
error[E0693]: incorrect `repr(align)` attribute format: `align` expects a literal integer as argument
13-
--> $DIR/nonterminal-expansion.rs:17:19
14-
|
15-
LL | pass_nonterminal!(n!());
16-
| ^
17-
18-
error: aborting due to 2 previous errors
12+
error: aborting due to 1 previous error
1913

20-
For more information about this error, try `rustc --explain E0693`.

‎tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,6 @@ LL | #[unsafe(proc_macro_derive(Foo))]
2828
|
2929
= note: extraneous unsafe is not allowed in attributes
3030

31-
error: expected identifier, found keyword `unsafe`
32-
--> $DIR/proc-unsafe-attributes.rs:12:21
33-
|
34-
LL | #[proc_macro_derive(unsafe(Foo))]
35-
| ^^^^^^ expected identifier, found keyword
36-
|
37-
help: escape `unsafe` to use it as an identifier
38-
|
39-
LL | #[proc_macro_derive(r#unsafe(Foo))]
40-
| ++
41-
4231
error: `proc_macro_attribute` is not an unsafe attribute
4332
--> $DIR/proc-unsafe-attributes.rs:18:3
4433
|
@@ -114,6 +103,17 @@ LL | #[unsafe(allow(unsafe(dead_code)))]
114103
|
115104
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
116105

106+
error: expected identifier, found keyword `unsafe`
107+
--> $DIR/proc-unsafe-attributes.rs:12:21
108+
|
109+
LL | #[proc_macro_derive(unsafe(Foo))]
110+
| ^^^^^^ expected identifier, found keyword
111+
|
112+
help: escape `unsafe` to use it as an identifier
113+
|
114+
LL | #[proc_macro_derive(r#unsafe(Foo))]
115+
| ++
116+
117117
error[E0565]: malformed `proc_macro_derive` attribute input
118118
--> $DIR/proc-unsafe-attributes.rs:12:1
119119
|

‎tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct S9;
4343
macro_rules! generate_s10 {
4444
($expr: expr) => {
4545
#[cfg(feature = $expr)]
46-
//~^ ERROR expected unsuffixed literal, found `expr` metavariable
46+
//~^ ERROR expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
4747
struct S10;
4848
}
4949
}

‎tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ LL | #[cfg(a = b"hi")]
8181
|
8282
= note: expected a normal string literal, not a byte string literal
8383

84-
error: expected unsuffixed literal, found `expr` metavariable
84+
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
8585
--> $DIR/cfg-attr-syntax-validation.rs:45:25
8686
|
8787
LL | #[cfg(feature = $expr)]

‎tests/ui/coverage-attr/bad-syntax.stderr‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
error: expected identifier, found `,`
2-
--> $DIR/bad-syntax.rs:44:12
3-
|
4-
LL | #[coverage(,off)]
5-
| ^ expected identifier
6-
|
7-
help: remove this comma
8-
|
9-
LL - #[coverage(,off)]
10-
LL + #[coverage(off)]
11-
|
12-
131
error: multiple `coverage` attributes
142
--> $DIR/bad-syntax.rs:9:1
153
|
@@ -162,6 +150,18 @@ LL - #[coverage(off, bogus)]
162150
LL + #[coverage(on)]
163151
|
164152

153+
error: expected identifier, found `,`
154+
--> $DIR/bad-syntax.rs:44:12
155+
|
156+
LL | #[coverage(,off)]
157+
| ^ expected identifier
158+
|
159+
help: remove this comma
160+
|
161+
LL - #[coverage(,off)]
162+
LL + #[coverage(off)]
163+
|
164+
165165
error: aborting due to 11 previous errors
166166

167167
Some errors have detailed explanations: E0539, E0805.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /