Skip to content

Commit db74031

Browse files
committed
Remove unrelated errors from parse stderr tests
1 parent 1550787 commit db74031

12 files changed

+35
-105
lines changed

src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
struct RefIntPair<'a, 'b>(&'a u32, &'b u32);
66

77
fn hof_lt<Q>(_: Q)
8-
where Q: for <#[rustc_1] 'a, 'b, #[oops]> Fn(RefIntPair<'a,'b>) -> &'b u32
8+
where Q: for <#[allow(unused)] 'a, 'b, #[oops]> Fn(RefIntPair<'a,'b>) -> &'b u32
99
//~^ ERROR trailing attribute after lifetime parameters
10-
//~| ERROR unless otherwise specified, attributes with the prefix `rustc_` are reserved for
11-
{
12-
}
10+
{}
1311

14-
fn main() {
15-
}
12+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
error: trailing attribute after lifetime parameters
2-
--> $DIR/attrs-with-no-formal-in-generics-3.rs:8:38
2+
--> $DIR/attrs-with-no-formal-in-generics-3.rs:8:44
33
|
4-
LL | where Q: for <#[rustc_1] 'a, 'b, #[oops]> Fn(RefIntPair<'a,'b>) -> &'b u32
5-
| ^^^^^^^ attributes must go before parameters
4+
LL | where Q: for <#[allow(unused)] 'a, 'b, #[oops]> Fn(RefIntPair<'a,'b>) -> &'b u32
5+
| ^^^^^^^ attributes must go before parameters
66

7-
error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics (see issue #29642)
8-
--> $DIR/attrs-with-no-formal-in-generics-3.rs:8:19
9-
|
10-
LL | where Q: for <#[rustc_1] 'a, 'b, #[oops]> Fn(RefIntPair<'a,'b>) -> &'b u32
11-
| ^^^^^^^^^^
12-
|
13-
= help: add #![feature(rustc_attrs)] to the crate attributes to enable
14-
15-
error: aborting due to 2 previous errors
7+
error: aborting due to previous error
168

17-
For more information about this error, try `rustc --explain E0658`.
+10-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
1+
mod foo {
2+
pub struct X<'a, 'b, 'c, T> {
3+
a: &'a str,
4+
b: &'b str,
5+
c: &'c str,
6+
t: T,
7+
}
8+
}
9+
10+
fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {}
211
//~^ ERROR lifetime parameters must be declared prior to type parameters
312
//~| ERROR lifetime parameters must be declared prior to type parameters
4-
//~| ERROR failed to resolve: use of undeclared type or module `mymodule`
5-
//~| ERROR use of undeclared lifetime name `'b`
6-
//~| ERROR use of undeclared lifetime name `'c`
713

814
fn main() {}
+7-27
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,14 @@
11
error: lifetime parameters must be declared prior to type parameters
2-
--> $DIR/issue-14303-path.rs:1:37
2+
--> $DIR/issue-14303-path.rs:10:40
33
|
4-
LL | fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
5-
| ^^ must be declared prior to type parameters
4+
LL | fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {}
5+
| ^^ must be declared prior to type parameters
66

77
error: lifetime parameters must be declared prior to type parameters
8-
--> $DIR/issue-14303-path.rs:1:41
8+
--> $DIR/issue-14303-path.rs:10:44
99
|
10-
LL | fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
11-
| ^^ must be declared prior to type parameters
10+
LL | fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {}
11+
| ^^ must be declared prior to type parameters
1212

13-
error[E0433]: failed to resolve: use of undeclared type or module `mymodule`
14-
--> $DIR/issue-14303-path.rs:1:18
15-
|
16-
LL | fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
17-
| ^^^^^^^^ use of undeclared type or module `mymodule`
18-
19-
error[E0261]: use of undeclared lifetime name `'b`
20-
--> $DIR/issue-14303-path.rs:1:37
21-
|
22-
LL | fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
23-
| ^^ undeclared lifetime
24-
25-
error[E0261]: use of undeclared lifetime name `'c`
26-
--> $DIR/issue-14303-path.rs:1:41
27-
|
28-
LL | fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
29-
| ^^ undeclared lifetime
30-
31-
error: aborting due to 5 previous errors
13+
error: aborting due to 2 previous errors
3214

33-
Some errors occurred: E0261, E0433.
34-
For more information about an error, try `rustc --explain E0261`.

src/test/ui/parser/issue-1802-2.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ fn log(a: i32, b: i32) {}
22

33
fn main() {
44
let error = 42;
5-
log(error, 0b_usize);
5+
log(error, 0b);
66
//~^ ERROR no valid digits found for number
7-
//~| ERROR mismatched types
87
}
+3-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
error: no valid digits found for number
22
--> $DIR/issue-1802-2.rs:5:16
33
|
4-
LL | log(error, 0b_usize);
5-
| ^^^
4+
LL | log(error, 0b);
5+
| ^^
66

7-
error[E0308]: mismatched types
8-
--> $DIR/issue-1802-2.rs:5:16
9-
|
10-
LL | log(error, 0b_usize);
11-
| ^^^^^^^^ expected i32, found usize
12-
13-
error: aborting due to 2 previous errors
7+
error: aborting due to previous error
148

15-
For more information about this error, try `rustc --explain E0308`.

src/test/ui/parser/pat-tuple-2.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
fn main() {
2-
match 0 {
2+
match (0, 1, 2) {
33
(pat, ..,) => {}
44
//~^ ERROR trailing comma is not permitted after `..`
5-
//~| ERROR mismatched types
65
}
76
}

src/test/ui/parser/pat-tuple-2.stderr

+1-11
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,5 @@ error: trailing comma is not permitted after `..`
44
LL | (pat, ..,) => {}
55
| ^ trailing comma is not permitted after `..`
66

7-
error[E0308]: mismatched types
8-
--> $DIR/pat-tuple-2.rs:3:9
9-
|
10-
LL | (pat, ..,) => {}
11-
| ^^^^^^^^^^ expected integer, found tuple
12-
|
13-
= note: expected type `{integer}`
14-
found type `(_,)`
15-
16-
error: aborting due to 2 previous errors
7+
error: aborting due to previous error
178

18-
For more information about this error, try `rustc --explain E0308`.

src/test/ui/parser/pat-tuple-3.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
fn main() {
2-
match 0 {
2+
match (0, 1, 2) {
33
(.., pat, ..) => {}
44
//~^ ERROR `..` can only be used once per tuple or tuple struct pattern
5-
//~| ERROR mismatched types
65
}
76
}

src/test/ui/parser/pat-tuple-3.stderr

+1-11
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,5 @@ error: `..` can only be used once per tuple or tuple struct pattern
44
LL | (.., pat, ..) => {}
55
| ^^ can only be used once per pattern
66

7-
error[E0308]: mismatched types
8-
--> $DIR/pat-tuple-3.rs:3:9
9-
|
10-
LL | (.., pat, ..) => {}
11-
| ^^^^^^^^^^^^^ expected integer, found tuple
12-
|
13-
= note: expected type `{integer}`
14-
found type `(_,)`
15-
16-
error: aborting due to 2 previous errors
7+
error: aborting due to previous error
178

18-
For more information about this error, try `rustc --explain E0308`.
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
21
enum Color {
32
Red = 0xff0000,
43
//~^ ERROR discriminator values can only be used with a field-less enum
54
Green = 0x00ff00,
65
Blue = 0x0000ff,
76
Black = 0x000000,
87
White = 0xffffff,
9-
Other (str),
10-
//~^ ERROR the size for values of type
11-
// the above is kept in order to verify that we get beyond parse errors
8+
Other(usize),
129
}
1310

1411
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: discriminator values can only be used with a field-less enum
2-
--> $DIR/tag-variant-disr-non-nullary.rs:3:11
2+
--> $DIR/tag-variant-disr-non-nullary.rs:2:11
33
|
44
LL | Red = 0xff0000,
55
| ^^^^^^^^ only valid in field-less enums
@@ -13,16 +13,5 @@ LL | Black = 0x000000,
1313
LL | White = 0xffffff,
1414
| ^^^^^^^^ only valid in field-less enums
1515

16-
error[E0277]: the size for values of type `str` cannot be known at compilation time
17-
--> $DIR/tag-variant-disr-non-nullary.rs:9:12
18-
|
19-
LL | Other (str),
20-
| ^^^ doesn't have a size known at compile-time
21-
|
22-
= help: the trait `std::marker::Sized` is not implemented for `str`
23-
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
24-
= note: no field of an enum variant may have a dynamically sized type
25-
26-
error: aborting due to 2 previous errors
16+
error: aborting due to previous error
2717

28-
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)