Skip to content

Commit 73ebb2b

Browse files
committed
fix test cases
1 parent 485a4da commit 73ebb2b

7 files changed

+121
-252
lines changed

tests/ui/parser/attr-stmt-expr-attr-bad.stderr

+50-226
Large diffs are not rendered by default.

tests/ui/resolve/resolve-variant-assoc-item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ use E::V;
33

44
fn main() {
55
E::V::associated_item; //~ ERROR failed to resolve: `V` is a variant, not a module
6-
V::associated_item(); //~ ERROR failed to resolve: `V` is a variant, not a module
6+
V::associated_item; //~ ERROR failed to resolve: `V` is a variant, not a module
77
}

tests/ui/resolve/resolve-variant-assoc-item.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ LL | E;
1212
error[E0433]: failed to resolve: `V` is a variant, not a module
1313
--> $DIR/resolve-variant-assoc-item.rs:6:5
1414
|
15-
LL | V::associated_item();
15+
LL | V::associated_item;
1616
| ^ `V` is a variant, not a module
1717
|
1818
help: there is an enum variant `E::V`; try using the variant's enum
1919
|
20-
LL | E();
20+
LL | E;
2121
| ~
2222
help: an enum with a similar name exists
2323
|
24-
LL | E::associated_item();
24+
LL | E::associated_item;
2525
| ~
2626

2727
error: aborting due to 2 previous errors
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
22
fn main() {
33
let _ = Box::new("foo".to_string());
4-
//~^ ERROR path separator must be a double colo
4+
//~^ ERROR path separator must be a double colon
55
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
22
fn main() {
33
let _ = Box:new("foo".to_string());
4-
//~^ ERROR path separator must be a double colo
4+
//~^ ERROR path separator must be a double colon
55
}
+25-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Operator precedence of type ascription
22
// Type ascription has very high precedence, the same as operator `as`
3-
use std::ops::*;
3+
#![feature(type_ascription)]
44

5+
use std::ops::*;
56
struct S;
67
struct Z;
78

@@ -22,28 +23,34 @@ impl Deref for S {
2223
fn deref(&self) -> &Z { panic!() }
2324
}
2425

25-
fn main() {
26+
fn test1() {
2627
&S: &S; //~ ERROR expected one of
27-
(&S): &S; // OK
28+
(&S): &S;
2829
&(S: &S);
30+
}
31+
32+
fn test2() {
33+
*(S: Z); //~ ERROR expected identifier
34+
}
2935

30-
*S: Z; // OK
31-
(*S): Z; // OK
32-
*(S: Z);
36+
fn test3() {
37+
-(S: Z); //~ ERROR expected identifier
38+
}
3339

34-
-S: Z; // OK
35-
(-S): Z; // OK
36-
-(S: Z);
40+
fn test4() {
41+
(S + Z): Z; //~ ERROR expected one of
42+
}
3743

38-
S + Z: Z; // OK
39-
S + (Z: Z); // OK
40-
(S + Z): Z;
44+
fn test5() {
45+
(S * Z): Z; //~ ERROR expected one of
46+
}
4147

42-
S * Z: Z; // OK
43-
S * (Z: Z); // OK
44-
(S * Z): Z;
48+
fn test6() {
49+
S .. S: S; //~ ERROR expected identifier, found `:`
50+
}
4551

46-
S .. S: S; // OK
47-
S .. (S: S); // OK
48-
(S .. S): S;
52+
fn test7() {
53+
(S .. S): S; //~ ERROR expected one of
4954
}
55+
56+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,46 @@
11
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `:`
2-
--> $DIR/type-ascription-precedence.rs:26:7
2+
--> $DIR/type-ascription-precedence.rs:27:7
33
|
44
LL | &S: &S;
55
| ^ expected one of 8 possible tokens
66

7-
error: aborting due to previous error
7+
error: expected identifier, found `:`
8+
--> $DIR/type-ascription-precedence.rs:33:8
9+
|
10+
LL | *(S: Z);
11+
| ^ expected identifier
12+
13+
error: expected identifier, found `:`
14+
--> $DIR/type-ascription-precedence.rs:37:8
15+
|
16+
LL | -(S: Z);
17+
| ^ expected identifier
18+
19+
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `:`
20+
--> $DIR/type-ascription-precedence.rs:41:12
21+
|
22+
LL | (S + Z): Z;
23+
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
24+
25+
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `:`
26+
--> $DIR/type-ascription-precedence.rs:45:12
27+
|
28+
LL | (S * Z): Z;
29+
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
30+
31+
error: expected identifier, found `:`
32+
--> $DIR/type-ascription-precedence.rs:49:11
33+
|
34+
LL | S .. S: S;
35+
| ^ expected identifier
36+
|
37+
= note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
38+
39+
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `:`
40+
--> $DIR/type-ascription-precedence.rs:53:13
41+
|
42+
LL | (S .. S): S;
43+
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
44+
45+
error: aborting due to 7 previous errors
846

0 commit comments

Comments
 (0)