Skip to content

Commit

Permalink
Remove unrelated errors from parse stderr tests
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jan 13, 2019
1 parent 1550787 commit db74031
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 105 deletions.
Expand Up @@ -5,11 +5,8 @@
struct RefIntPair<'a, 'b>(&'a u32, &'b u32);

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

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

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

error: aborting due to 2 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
14 changes: 10 additions & 4 deletions src/test/ui/parser/issue-14303-path.rs
@@ -1,8 +1,14 @@
fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
mod foo {
pub struct X<'a, 'b, 'c, T> {
a: &'a str,
b: &'b str,
c: &'c str,
t: T,
}
}

fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {}
//~^ ERROR lifetime parameters must be declared prior to type parameters
//~| ERROR lifetime parameters must be declared prior to type parameters
//~| ERROR failed to resolve: use of undeclared type or module `mymodule`
//~| ERROR use of undeclared lifetime name `'b`
//~| ERROR use of undeclared lifetime name `'c`

fn main() {}
34 changes: 7 additions & 27 deletions src/test/ui/parser/issue-14303-path.stderr
@@ -1,34 +1,14 @@
error: lifetime parameters must be declared prior to type parameters
--> $DIR/issue-14303-path.rs:1:37
--> $DIR/issue-14303-path.rs:10:40
|
LL | fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
| ^^ must be declared prior to type parameters
LL | fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {}
| ^^ must be declared prior to type parameters

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

error[E0433]: failed to resolve: use of undeclared type or module `mymodule`
--> $DIR/issue-14303-path.rs:1:18
|
LL | fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
| ^^^^^^^^ use of undeclared type or module `mymodule`

error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/issue-14303-path.rs:1:37
|
LL | fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
| ^^ undeclared lifetime

error[E0261]: use of undeclared lifetime name `'c`
--> $DIR/issue-14303-path.rs:1:41
|
LL | fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {}
| ^^ undeclared lifetime

error: aborting due to 5 previous errors
error: aborting due to 2 previous errors

Some errors occurred: E0261, E0433.
For more information about an error, try `rustc --explain E0261`.
3 changes: 1 addition & 2 deletions src/test/ui/parser/issue-1802-2.rs
Expand Up @@ -2,7 +2,6 @@ fn log(a: i32, b: i32) {}

fn main() {
let error = 42;
log(error, 0b_usize);
log(error, 0b);
//~^ ERROR no valid digits found for number
//~| ERROR mismatched types
}
13 changes: 3 additions & 10 deletions src/test/ui/parser/issue-1802-2.stderr
@@ -1,15 +1,8 @@
error: no valid digits found for number
--> $DIR/issue-1802-2.rs:5:16
|
LL | log(error, 0b_usize);
| ^^^
LL | log(error, 0b);
| ^^

error[E0308]: mismatched types
--> $DIR/issue-1802-2.rs:5:16
|
LL | log(error, 0b_usize);
| ^^^^^^^^ expected i32, found usize

error: aborting due to 2 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
3 changes: 1 addition & 2 deletions src/test/ui/parser/pat-tuple-2.rs
@@ -1,7 +1,6 @@
fn main() {
match 0 {
match (0, 1, 2) {
(pat, ..,) => {}
//~^ ERROR trailing comma is not permitted after `..`
//~| ERROR mismatched types
}
}
12 changes: 1 addition & 11 deletions src/test/ui/parser/pat-tuple-2.stderr
Expand Up @@ -4,15 +4,5 @@ error: trailing comma is not permitted after `..`
LL | (pat, ..,) => {}
| ^ trailing comma is not permitted after `..`

error[E0308]: mismatched types
--> $DIR/pat-tuple-2.rs:3:9
|
LL | (pat, ..,) => {}
| ^^^^^^^^^^ expected integer, found tuple
|
= note: expected type `{integer}`
found type `(_,)`

error: aborting due to 2 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
3 changes: 1 addition & 2 deletions src/test/ui/parser/pat-tuple-3.rs
@@ -1,7 +1,6 @@
fn main() {
match 0 {
match (0, 1, 2) {
(.., pat, ..) => {}
//~^ ERROR `..` can only be used once per tuple or tuple struct pattern
//~| ERROR mismatched types
}
}
12 changes: 1 addition & 11 deletions src/test/ui/parser/pat-tuple-3.stderr
Expand Up @@ -4,15 +4,5 @@ error: `..` can only be used once per tuple or tuple struct pattern
LL | (.., pat, ..) => {}
| ^^ can only be used once per pattern

error[E0308]: mismatched types
--> $DIR/pat-tuple-3.rs:3:9
|
LL | (.., pat, ..) => {}
| ^^^^^^^^^^^^^ expected integer, found tuple
|
= note: expected type `{integer}`
found type `(_,)`

error: aborting due to 2 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
5 changes: 1 addition & 4 deletions src/test/ui/parser/tag-variant-disr-non-nullary.rs
@@ -1,14 +1,11 @@

enum Color {
Red = 0xff0000,
//~^ ERROR discriminator values can only be used with a field-less enum
Green = 0x00ff00,
Blue = 0x0000ff,
Black = 0x000000,
White = 0xffffff,
Other (str),
//~^ ERROR the size for values of type
// the above is kept in order to verify that we get beyond parse errors
Other(usize),
}

fn main() {}
15 changes: 2 additions & 13 deletions src/test/ui/parser/tag-variant-disr-non-nullary.stderr
@@ -1,5 +1,5 @@
error: discriminator values can only be used with a field-less enum
--> $DIR/tag-variant-disr-non-nullary.rs:3:11
--> $DIR/tag-variant-disr-non-nullary.rs:2:11
|
LL | Red = 0xff0000,
| ^^^^^^^^ only valid in field-less enums
Expand All @@ -13,16 +13,5 @@ LL | Black = 0x000000,
LL | White = 0xffffff,
| ^^^^^^^^ only valid in field-less enums

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

error: aborting due to 2 previous errors
error: aborting due to previous error

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

0 comments on commit db74031

Please sign in to comment.