impl<'_> IceCube<'_> {} is now only one error in both editions

This commit is contained in:
Scott McMurray 2018-10-19 22:57:41 -07:00
parent 74df5ec387
commit 18f7db3d69
3 changed files with 12 additions and 68 deletions

View File

@ -1,46 +0,0 @@
error[E0637]: `'_` cannot be used here
--> $DIR/in-binder.rs:12:6
|
LL | impl<'_> IceCube<'_> {}
| ^^ `'_` is a reserved lifetime name
error[E0637]: `'_` cannot be used here
--> $DIR/in-binder.rs:17:15
|
LL | struct Struct<'_> {
| ^^ `'_` is a reserved lifetime name
error[E0637]: `'_` cannot be used here
--> $DIR/in-binder.rs:23:11
|
LL | enum Enum<'_> {
| ^^ `'_` is a reserved lifetime name
error[E0637]: `'_` cannot be used here
--> $DIR/in-binder.rs:29:13
|
LL | union Union<'_> {
| ^^ `'_` is a reserved lifetime name
error[E0637]: `'_` cannot be used here
--> $DIR/in-binder.rs:35:13
|
LL | trait Trait<'_> {
| ^^ `'_` is a reserved lifetime name
error[E0637]: `'_` cannot be used here
--> $DIR/in-binder.rs:40:8
|
LL | fn foo<'_>() {
| ^^ `'_` is a reserved lifetime name
error[E0106]: missing lifetime specifier
--> $DIR/in-binder.rs:12:18
|
LL | impl<'_> IceCube<'_> {}
| ^^ expected lifetime parameter
error: aborting due to 7 previous errors
Some errors occurred: E0106, E0637.
For more information about an error, try `rustc --explain E0106`.

View File

@ -2,44 +2,34 @@
//
// Regression test for #52098.
// revisions: Rust2015 Rust2018
//[Rust2018] edition:2018
struct IceCube<'a> {
v: Vec<&'a char>
}
impl<'_> IceCube<'_> {}
//[Rust2015]~^ ERROR `'_` cannot be used here
//[Rust2015]~| ERROR missing lifetime specifier
//[Rust2018]~^^^ ERROR `'_` cannot be used here
//~^ ERROR `'_` cannot be used here
struct Struct<'_> {
//[Rust2015]~^ ERROR `'_` cannot be used here
//[Rust2018]~^^ ERROR `'_` cannot be used here
//~^ ERROR `'_` cannot be used here
v: Vec<&'static char>
}
enum Enum<'_> {
//[Rust2015]~^ ERROR `'_` cannot be used here
//[Rust2018]~^^ ERROR `'_` cannot be used here
//~^ ERROR `'_` cannot be used here
Variant
}
union Union<'_> {
//[Rust2015]~^ ERROR `'_` cannot be used here
//[Rust2018]~^^ ERROR `'_` cannot be used here
//~^ ERROR `'_` cannot be used here
a: u32
}
trait Trait<'_> {
//[Rust2015]~^ ERROR `'_` cannot be used here
//[Rust2018]~^^ ERROR `'_` cannot be used here
//~^ ERROR `'_` cannot be used here
}
fn foo<'_>() {
//[Rust2015]~^ ERROR `'_` cannot be used here
//[Rust2018]~^^ ERROR `'_` cannot be used here
//~^ ERROR `'_` cannot be used here
}
fn main() {}

View File

@ -1,35 +1,35 @@
error[E0637]: `'_` cannot be used here
--> $DIR/in-binder.rs:12:6
--> $DIR/in-binder.rs:9:6
|
LL | impl<'_> IceCube<'_> {}
| ^^ `'_` is a reserved lifetime name
error[E0637]: `'_` cannot be used here
--> $DIR/in-binder.rs:17:15
--> $DIR/in-binder.rs:12:15
|
LL | struct Struct<'_> {
| ^^ `'_` is a reserved lifetime name
error[E0637]: `'_` cannot be used here
--> $DIR/in-binder.rs:23:11
--> $DIR/in-binder.rs:17:11
|
LL | enum Enum<'_> {
| ^^ `'_` is a reserved lifetime name
error[E0637]: `'_` cannot be used here
--> $DIR/in-binder.rs:29:13
--> $DIR/in-binder.rs:22:13
|
LL | union Union<'_> {
| ^^ `'_` is a reserved lifetime name
error[E0637]: `'_` cannot be used here
--> $DIR/in-binder.rs:35:13
--> $DIR/in-binder.rs:27:13
|
LL | trait Trait<'_> {
| ^^ `'_` is a reserved lifetime name
error[E0637]: `'_` cannot be used here
--> $DIR/in-binder.rs:40:8
--> $DIR/in-binder.rs:31:8
|
LL | fn foo<'_>() {
| ^^ `'_` is a reserved lifetime name