Skip to content

Commit

Permalink
impl<'_> IceCube<'_> {} is now only one error in both editions
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmcm committed Oct 20, 2018
1 parent 74df5ec commit 18f7db3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 68 deletions.
46 changes: 0 additions & 46 deletions src/test/ui/underscore-lifetime/in-binder.Rust2015.stderr

This file was deleted.

22 changes: 6 additions & 16 deletions src/test/ui/underscore-lifetime/in-binder.rs
Expand Up @@ -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() {}
@@ -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
Expand Down

0 comments on commit 18f7db3

Please sign in to comment.