diff options
| author | Taiki Endo <te316e89@gmail.com> | 2019-07-16 00:48:28 +0900 |
|---|---|---|
| committer | Taiki Endo <te316e89@gmail.com> | 2019-07-27 12:28:06 +0900 |
| commit | aab9edc68ab034f94bc956e145d155eb6d26fb3d (patch) | |
| tree | 75978807307e1b39c238e4fa7a747dcc1b3e8f62 | |
| parent | c1f22c018e6b2fd64f7f3f94fe48b66c719e243a (diff) | |
| download | rust-aab9edc68ab034f94bc956e145d155eb6d26fb3d.tar.gz rust-aab9edc68ab034f94bc956e145d155eb6d26fb3d.zip | |
Minor clean up
| -rw-r--r-- | src/test/ui/self/elision/README.md | 9 | ||||
| -rw-r--r-- | src/test/ui/self/elision/ref-mut-self.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/self/elision/ref-mut-self.stderr | 12 | ||||
| -rw-r--r-- | src/test/ui/self/elision/ref-mut-struct.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/self/elision/ref-mut-struct.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/self/elision/ref-self.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/self/elision/ref-struct.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/self/elision/ref-struct.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/self/elision/struct.rs | 12 | ||||
| -rw-r--r-- | src/test/ui/self/self_lifetime.rs | 2 |
10 files changed, 27 insertions, 36 deletions
diff --git a/src/test/ui/self/elision/README.md b/src/test/ui/self/elision/README.md index 9e874e2753e..793eb16b037 100644 --- a/src/test/ui/self/elision/README.md +++ b/src/test/ui/self/elision/README.md @@ -1,5 +1,5 @@ Test cases intended to to document behavior and try to exhaustively -explore the combinations. +explore the combinations. ## Confidence @@ -23,11 +23,11 @@ in the "confidence" field in the following table. Values: | `struct.rs` | `Struct` | `Struct` | ignore `self` parameter | 100% | | `alias.rs` | `Struct` | `Alias` | ignore `self` parameter | 100% | | `ref-self.rs` | `Struct` | `&Self` | take lifetime from `&Self` | 100% | -| `ref-mut-self.rs` | `Struct` | `&mut Self` | take lifetime from `&Self` | 100% | +| `ref-mut-self.rs` | `Struct` | `&mut Self` | take lifetime from `&mut Self` | 100% | | `ref-struct.rs` | `Struct` | `&Struct` | take lifetime from `&Self` | 50% | -| `ref-mut-struct.rs` | `Struct` | `&Struct` | take lifetime from `&Self` | 50% | +| `ref-mut-struct.rs` | `Struct` | `&mut Struct` | take lifetime from `&mut Self` | 50% | | `ref-alias.rs` | `Struct` | `&Alias` | ignore `Alias` | 0% | -| `ref-mut-alias.rs` | `Struct` | `&Alias` | ignore `Alias` | 0% | +| `ref-mut-alias.rs` | `Struct` | `&mut Alias` | ignore `Alias` | 0% | | `lt-self.rs` | `Struct<'a>` | `Self` | ignore `Self` (and hence `'a`) | 25% | | `lt-struct.rs` | `Struct<'a>` | `Self` | ignore `Self` (and hence `'a`) | 0% | | `lt-alias.rs` | `Alias<'a>` | `Self` | ignore `Self` (and hence `'a`) | 0% | @@ -42,4 +42,3 @@ In each case, we test the following patterns: - `self: Box<Pin<XXX>>` In the non-reference cases, `Pin` causes errors so we substitute `Rc`. - diff --git a/src/test/ui/self/elision/ref-mut-self.rs b/src/test/ui/self/elision/ref-mut-self.rs index 6705ca9e305..a7ea47bb7f6 100644 --- a/src/test/ui/self/elision/ref-mut-self.rs +++ b/src/test/ui/self/elision/ref-mut-self.rs @@ -5,8 +5,6 @@ use std::pin::Pin; struct Struct { } -type Alias = Struct; - impl Struct { // Test using `&mut self` sugar: diff --git a/src/test/ui/self/elision/ref-mut-self.stderr b/src/test/ui/self/elision/ref-mut-self.stderr index 05dc5b774c8..37984cd72fb 100644 --- a/src/test/ui/self/elision/ref-mut-self.stderr +++ b/src/test/ui/self/elision/ref-mut-self.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:14:9 + --> $DIR/ref-mut-self.rs:12:9 | LL | fn ref_self(&mut self, f: &u32) -> &u32 { | ---- ---- @@ -9,7 +9,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:20:9 + --> $DIR/ref-mut-self.rs:18:9 | LL | fn ref_Self(self: &mut Self, f: &u32) -> &u32 { | ---- ---- @@ -19,7 +19,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:24:9 + --> $DIR/ref-mut-self.rs:22:9 | LL | fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { | ---- ---- @@ -29,7 +29,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:28:9 + --> $DIR/ref-mut-self.rs:26:9 | LL | fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { | ---- ---- @@ -39,7 +39,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:32:9 + --> $DIR/ref-mut-self.rs:30:9 | LL | fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 { | ---- ---- @@ -49,7 +49,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-self.rs:36:9 + --> $DIR/ref-mut-self.rs:34:9 | LL | fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 { | ---- ---- diff --git a/src/test/ui/self/elision/ref-mut-struct.rs b/src/test/ui/self/elision/ref-mut-struct.rs index f063728e247..795ddf8ac13 100644 --- a/src/test/ui/self/elision/ref-mut-struct.rs +++ b/src/test/ui/self/elision/ref-mut-struct.rs @@ -5,8 +5,6 @@ use std::pin::Pin; struct Struct { } -type Alias = Struct; - impl Struct { // Test using `&mut Struct` explicitly: diff --git a/src/test/ui/self/elision/ref-mut-struct.stderr b/src/test/ui/self/elision/ref-mut-struct.stderr index 88dfb17892a..2a4826905b9 100644 --- a/src/test/ui/self/elision/ref-mut-struct.stderr +++ b/src/test/ui/self/elision/ref-mut-struct.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:14:9 + --> $DIR/ref-mut-struct.rs:12:9 | LL | fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { | ---- ---- @@ -9,7 +9,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:18:9 + --> $DIR/ref-mut-struct.rs:16:9 | LL | fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { | ---- ---- @@ -19,7 +19,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:22:9 + --> $DIR/ref-mut-struct.rs:20:9 | LL | fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { | ---- ---- @@ -29,7 +29,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:26:9 + --> $DIR/ref-mut-struct.rs:24:9 | LL | fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 { | ---- ---- @@ -39,7 +39,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-mut-struct.rs:30:9 + --> $DIR/ref-mut-struct.rs:28:9 | LL | fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 { | ---- ---- diff --git a/src/test/ui/self/elision/ref-self.rs b/src/test/ui/self/elision/ref-self.rs index af10e10d311..9655c11f45e 100644 --- a/src/test/ui/self/elision/ref-self.rs +++ b/src/test/ui/self/elision/ref-self.rs @@ -5,8 +5,6 @@ use std::pin::Pin; struct Struct { } -type Alias = Struct; - impl Struct { // Test using `&self` sugar: diff --git a/src/test/ui/self/elision/ref-struct.rs b/src/test/ui/self/elision/ref-struct.rs index 28afe17c234..342d6d2b363 100644 --- a/src/test/ui/self/elision/ref-struct.rs +++ b/src/test/ui/self/elision/ref-struct.rs @@ -5,8 +5,6 @@ use std::pin::Pin; struct Struct { } -type Alias = Struct; - impl Struct { // Test using `&Struct` explicitly: diff --git a/src/test/ui/self/elision/ref-struct.stderr b/src/test/ui/self/elision/ref-struct.stderr index 8a17ab13d57..186e651c143 100644 --- a/src/test/ui/self/elision/ref-struct.stderr +++ b/src/test/ui/self/elision/ref-struct.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:14:9 + --> $DIR/ref-struct.rs:12:9 | LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 { | ---- ---- @@ -9,7 +9,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:18:9 + --> $DIR/ref-struct.rs:16:9 | LL | fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { | ---- ---- @@ -19,7 +19,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:22:9 + --> $DIR/ref-struct.rs:20:9 | LL | fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { | ---- ---- @@ -29,7 +29,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:26:9 + --> $DIR/ref-struct.rs:24:9 | LL | fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 { | ---- ---- @@ -39,7 +39,7 @@ LL | f | ^ ...but data from `f` is returned here error[E0623]: lifetime mismatch - --> $DIR/ref-struct.rs:30:9 + --> $DIR/ref-struct.rs:28:9 | LL | fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 { | ---- ---- diff --git a/src/test/ui/self/elision/struct.rs b/src/test/ui/self/elision/struct.rs index f6e7c0fb129..227e993bd3c 100644 --- a/src/test/ui/self/elision/struct.rs +++ b/src/test/ui/self/elision/struct.rs @@ -8,26 +8,24 @@ use std::rc::Rc; struct Struct { } impl Struct { - // Test using `&mut Struct` explicitly: - fn ref_Struct(self: Struct, f: &u32) -> &u32 { - f //~ ERROR lifetime mismatch + f } fn box_Struct(self: Box<Struct>, f: &u32) -> &u32 { - f //~ ERROR lifetime mismatch + f } fn rc_Struct(self: Rc<Struct>, f: &u32) -> &u32 { - f //~ ERROR lifetime mismatch + f } fn box_box_Struct(self: Box<Box<Struct>>, f: &u32) -> &u32 { - f //~ ERROR lifetime mismatch + f } fn box_rc_Struct(self: Box<Rc<Struct>>, f: &u32) -> &u32 { - f //~ ERROR lifetime mismatch + f } } diff --git a/src/test/ui/self/self_lifetime.rs b/src/test/ui/self/self_lifetime.rs index edb47fd4d32..f04bd83ab6e 100644 --- a/src/test/ui/self/self_lifetime.rs +++ b/src/test/ui/self/self_lifetime.rs @@ -1,5 +1,7 @@ // check-pass +// https://github.com/rust-lang/rust/pull/60944#issuecomment-495346120 + struct Foo<'a>(&'a ()); impl<'a> Foo<'a> { fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 } |
