diff options
23 files changed, 122 insertions, 110 deletions
diff --git a/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.fixed b/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.fixed index b5513818f63..3408463ce49 100644 --- a/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.fixed +++ b/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.fixed @@ -5,13 +5,10 @@ struct Foo { } impl Foo { - fn foo<'a>(&'a self, x: &'a i32) -> &'a i32 { - - x - //~^ ERROR lifetime may not live long enough - - } - + fn foo<'a>(&'a self, x: &'a i32) -> &'a i32 { + x + //~^ ERROR lifetime may not live long enough + } } fn main() {} diff --git a/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs b/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs index 52646ff89eb..c8dd958b37c 100644 --- a/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs +++ b/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs @@ -5,13 +5,10 @@ struct Foo { } impl Foo { - fn foo<'a>(&self, x: &'a i32) -> &i32 { - - x - //~^ ERROR lifetime may not live long enough - - } - + fn foo<'a>(&self, x: &'a i32) -> &i32 { + x + //~^ ERROR lifetime may not live long enough + } } fn main() {} diff --git a/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr b/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr index e2f42cbfb28..ca6ee1c25cd 100644 --- a/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr +++ b/tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr @@ -1,18 +1,17 @@ error: lifetime may not live long enough - --> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:10:5 + --> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:9:9 | -LL | fn foo<'a>(&self, x: &'a i32) -> &i32 { - | -- - let's call the lifetime of this reference `'1` - | | - | lifetime `'a` defined here -LL | -LL | x - | ^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a` +LL | fn foo<'a>(&self, x: &'a i32) -> &i32 { + | -- - let's call the lifetime of this reference `'1` + | | + | lifetime `'a` defined here +LL | x + | ^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a` | help: consider introducing a named lifetime parameter and update trait if needed | -LL | fn foo<'a>(&'a self, x: &'a i32) -> &'a i32 { - | ++ ++ +LL | fn foo<'a>(&'a self, x: &'a i32) -> &'a i32 { + | ++ ++ error: aborting due to 1 previous error diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.fixed b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.fixed index d9f454f346c..3408463ce49 100644 --- a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.fixed +++ b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.fixed @@ -1,14 +1,14 @@ //@ run-rustfix #![allow(dead_code)] struct Foo { - field: i32, + field: i32, } impl Foo { - fn foo<'a>(&'a self, x: &'a i32) -> &'a i32 { - x - //~^ ERROR lifetime may not live long enough - } + fn foo<'a>(&'a self, x: &'a i32) -> &'a i32 { + x + //~^ ERROR lifetime may not live long enough + } } -fn main() { } +fn main() {} diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs index bf66a551a80..0225d8c7961 100644 --- a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs +++ b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs @@ -1,14 +1,14 @@ //@ run-rustfix #![allow(dead_code)] struct Foo { - field: i32, + field: i32, } impl Foo { - fn foo<'a>(&self, x: &i32) -> &i32 { - x - //~^ ERROR lifetime may not live long enough - } + fn foo<'a>(&self, x: &i32) -> &i32 { + x + //~^ ERROR lifetime may not live long enough + } } -fn main() { } +fn main() {} diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr index 778634e95be..a81b5cfad5a 100644 --- a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr +++ b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr @@ -1,17 +1,17 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:9:5 + --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:9:9 | -LL | fn foo<'a>(&self, x: &i32) -> &i32 { - | - - let's call the lifetime of this reference `'1` - | | - | let's call the lifetime of this reference `'2` -LL | x - | ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` +LL | fn foo<'a>(&self, x: &i32) -> &i32 { + | - - let's call the lifetime of this reference `'1` + | | + | let's call the lifetime of this reference `'2` +LL | x + | ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | help: consider introducing a named lifetime parameter and update trait if needed | -LL | fn foo<'a>(&'a self, x: &'a i32) -> &'a i32 { - | ++ ++ ++ +LL | fn foo<'a>(&'a self, x: &'a i32) -> &'a i32 { + | ++ ++ ++ error: aborting due to 1 previous error diff --git a/tests/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs b/tests/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs index 3b2c8c7bc79..784afa8b40f 100644 --- a/tests/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs +++ b/tests/ui/self/arbitrary_self_types_pin_lifetime_mismatch.rs @@ -3,20 +3,23 @@ use std::pin::Pin; struct Foo; impl Foo { - fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } - //~^ lifetime may not live long enough + fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { + f //~ ERROR lifetime may not live long enough + } // For this suggestion to be right, we'd need to also suggest `self: Pin<&'a Self>`, which we // don't, but we provide a follow up suggestion to do so, so I condider that good at least for // now. - fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } - //~^ lifetime may not live long enough + fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { + (self, f) //~ ERROR lifetime may not live long enough + } } type Alias<T> = Pin<T>; impl Foo { - fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } - //~^ lifetime may not live long enough + fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { + arg //~ ERROR lifetime may not live long enough + } } fn main() {} diff --git a/tests/ui/self/arbitrary_self_types_pin_lifetime_mismatch.stderr b/tests/ui/self/arbitrary_self_types_pin_lifetime_mismatch.stderr index 773f9362ec5..549b03b061b 100644 --- a/tests/ui/self/arbitrary_self_types_pin_lifetime_mismatch.stderr +++ b/tests/ui/self/arbitrary_self_types_pin_lifetime_mismatch.stderr @@ -1,42 +1,46 @@ error: lifetime may not live long enough - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:6:46 + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:7:9 | -LL | fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } - | - - ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` - | | | - | | let's call the lifetime of this reference `'1` +LL | fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { + | - - let's call the lifetime of this reference `'1` + | | | let's call the lifetime of this reference `'2` +LL | f + | ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | help: consider introducing a named lifetime parameter and update trait if needed | -LL | fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &'a Foo { f } +LL | fn a<'a>(self: Pin<&'a Foo>, f: &'a Foo) -> &'a Foo { | ++++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:12:69 + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:14:9 | -LL | fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } - | - - ^^^^^^^^^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` - | | | - | | let's call the lifetime of this reference `'1` +LL | fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { + | - - let's call the lifetime of this reference `'1` + | | | let's call the lifetime of this reference `'2` +LL | (self, f) + | ^^^^^^^^^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | help: consider introducing a named lifetime parameter and update trait if needed | -LL | fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&'a Foo>, &'a Foo) { (self, f) } +LL | fn c<'a>(self: Pin<&'a Self>, f: &'a Foo, g: &Foo) -> (Pin<&'a Foo>, &'a Foo) { | ++++ ++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:18:58 + --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:21:9 | -LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } - | -- ---- has type `Pin<&'1 Foo>` ^^^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a` +LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { + | -- ---- has type `Pin<&'1 Foo>` | | | lifetime `'a` defined here +LL | arg + | ^^^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a` | help: consider introducing a named lifetime parameter and update trait if needed | -LL | fn bar<'a>(self: Alias<&'a Self>, arg: &'a ()) -> &'a () { arg } +LL | fn bar<'a>(self: Alias<&'a Self>, arg: &'a ()) -> &'a () { | ++ ++ error: aborting due to 3 previous errors diff --git a/tests/ui/self/elision/lt-ref-self-async.fixed b/tests/ui/self/elision/lt-ref-self-async.fixed index 6d875ef0cec..aa1d62012da 100644 --- a/tests/ui/self/elision/lt-ref-self-async.fixed +++ b/tests/ui/self/elision/lt-ref-self-async.fixed @@ -4,7 +4,9 @@ use std::pin::Pin; -struct Struct<'a> { data: &'a u32 } +struct Struct<'a> { + data: &'a u32, +} impl<'a> Struct<'a> { // Test using `&self` sugar: @@ -42,4 +44,4 @@ impl<'a> Struct<'a> { } } -fn main() { } +fn main() {} diff --git a/tests/ui/self/elision/lt-ref-self-async.rs b/tests/ui/self/elision/lt-ref-self-async.rs index a70e22ab77a..38de0fd39f0 100644 --- a/tests/ui/self/elision/lt-ref-self-async.rs +++ b/tests/ui/self/elision/lt-ref-self-async.rs @@ -4,7 +4,9 @@ use std::pin::Pin; -struct Struct<'a> { data: &'a u32 } +struct Struct<'a> { + data: &'a u32, +} impl<'a> Struct<'a> { // Test using `&self` sugar: @@ -42,4 +44,4 @@ impl<'a> Struct<'a> { } } -fn main() { } +fn main() {} diff --git a/tests/ui/self/elision/lt-ref-self-async.stderr b/tests/ui/self/elision/lt-ref-self-async.stderr index c8b49de7671..b84044f7548 100644 --- a/tests/ui/self/elision/lt-ref-self-async.stderr +++ b/tests/ui/self/elision/lt-ref-self-async.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:13:9 + --> $DIR/lt-ref-self-async.rs:15:9 | LL | async fn ref_self(&self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | async fn ref_self<'b>(&'b self, f: &'b u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:20:9 + --> $DIR/lt-ref-self-async.rs:22:9 | LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | async fn ref_Self<'b>(self: &'b Self, f: &'b u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:25:9 + --> $DIR/lt-ref-self-async.rs:27:9 | LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | async fn box_ref_Self<'b>(self: Box<&'b Self>, f: &'b u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:30:9 + --> $DIR/lt-ref-self-async.rs:32:9 | LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | async fn pin_ref_Self<'b>(self: Pin<&'b Self>, f: &'b u32) -> &u32 { | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:35:9 + --> $DIR/lt-ref-self-async.rs:37:9 | LL | async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -74,7 +74,7 @@ LL | async fn box_box_ref_Self<'b>(self: Box<Box<&'b Self>>, f: &'b u32) -> | ++++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self-async.rs:40:9 + --> $DIR/lt-ref-self-async.rs:42:9 | LL | async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/tests/ui/self/elision/lt-ref-self.fixed b/tests/ui/self/elision/lt-ref-self.fixed index c9faa86c441..ff0c057fe42 100644 --- a/tests/ui/self/elision/lt-ref-self.fixed +++ b/tests/ui/self/elision/lt-ref-self.fixed @@ -3,7 +3,9 @@ use std::pin::Pin; -struct Struct<'a> { data: &'a u32 } +struct Struct<'a> { + data: &'a u32, +} impl<'a> Struct<'a> { // Test using `&self` sugar: @@ -41,4 +43,4 @@ impl<'a> Struct<'a> { } } -fn main() { } +fn main() {} diff --git a/tests/ui/self/elision/lt-ref-self.rs b/tests/ui/self/elision/lt-ref-self.rs index fbd0665b22d..4cd97c5b729 100644 --- a/tests/ui/self/elision/lt-ref-self.rs +++ b/tests/ui/self/elision/lt-ref-self.rs @@ -3,7 +3,9 @@ use std::pin::Pin; -struct Struct<'a> { data: &'a u32 } +struct Struct<'a> { + data: &'a u32, +} impl<'a> Struct<'a> { // Test using `&self` sugar: @@ -41,4 +43,4 @@ impl<'a> Struct<'a> { } } -fn main() { } +fn main() {} diff --git a/tests/ui/self/elision/lt-ref-self.stderr b/tests/ui/self/elision/lt-ref-self.stderr index 53b662bcb69..237175ac763 100644 --- a/tests/ui/self/elision/lt-ref-self.stderr +++ b/tests/ui/self/elision/lt-ref-self.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:12:9 + --> $DIR/lt-ref-self.rs:14:9 | LL | fn ref_self(&self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | fn ref_self<'b>(&'b self, f: &'b u32) -> &'b u32 { | ++++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:19:9 + --> $DIR/lt-ref-self.rs:21:9 | LL | fn ref_Self(self: &Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | fn ref_Self<'b>(self: &'b Self, f: &'b u32) -> &'b u32 { | ++++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:24:9 + --> $DIR/lt-ref-self.rs:26:9 | LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | fn box_ref_Self<'b>(self: Box<&'b Self>, f: &'b u32) -> &'b u32 { | ++++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:29:9 + --> $DIR/lt-ref-self.rs:31:9 | LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | fn pin_ref_Self<'b>(self: Pin<&'b Self>, f: &'b u32) -> &'b u32 { | ++++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:34:9 + --> $DIR/lt-ref-self.rs:36:9 | LL | fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -74,7 +74,7 @@ LL | fn box_box_ref_Self<'b>(self: Box<Box<&'b Self>>, f: &'b u32) -> &'b u3 | ++++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/lt-ref-self.rs:39:9 + --> $DIR/lt-ref-self.rs:41:9 | LL | fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` diff --git a/tests/ui/self/elision/ref-mut-self.fixed b/tests/ui/self/elision/ref-mut-self.fixed index 90e50221a19..7886d097976 100644 --- a/tests/ui/self/elision/ref-mut-self.fixed +++ b/tests/ui/self/elision/ref-mut-self.fixed @@ -3,7 +3,7 @@ use std::pin::Pin; -struct Struct { } +struct Struct {} impl Struct { // Test using `&mut self` sugar: @@ -41,4 +41,4 @@ impl Struct { } } -fn main() { } +fn main() {} diff --git a/tests/ui/self/elision/ref-mut-self.rs b/tests/ui/self/elision/ref-mut-self.rs index a09fcdfcbb2..87dab2a9ab4 100644 --- a/tests/ui/self/elision/ref-mut-self.rs +++ b/tests/ui/self/elision/ref-mut-self.rs @@ -3,7 +3,7 @@ use std::pin::Pin; -struct Struct { } +struct Struct {} impl Struct { // Test using `&mut self` sugar: @@ -41,4 +41,4 @@ impl Struct { } } -fn main() { } +fn main() {} diff --git a/tests/ui/self/elision/ref-mut-struct.fixed b/tests/ui/self/elision/ref-mut-struct.fixed index 275fafbad53..188d3bb517e 100644 --- a/tests/ui/self/elision/ref-mut-struct.fixed +++ b/tests/ui/self/elision/ref-mut-struct.fixed @@ -3,7 +3,7 @@ use std::pin::Pin; -struct Struct { } +struct Struct {} impl Struct { // Test using `&mut Struct` explicitly: @@ -34,4 +34,4 @@ impl Struct { } } -fn main() { } +fn main() {} diff --git a/tests/ui/self/elision/ref-mut-struct.rs b/tests/ui/self/elision/ref-mut-struct.rs index 6bfdca62bca..c227fa8bbfc 100644 --- a/tests/ui/self/elision/ref-mut-struct.rs +++ b/tests/ui/self/elision/ref-mut-struct.rs @@ -3,7 +3,7 @@ use std::pin::Pin; -struct Struct { } +struct Struct {} impl Struct { // Test using `&mut Struct` explicitly: @@ -34,4 +34,4 @@ impl Struct { } } -fn main() { } +fn main() {} diff --git a/tests/ui/self/elision/ref-self.fixed b/tests/ui/self/elision/ref-self.fixed index 41b11c2d77a..1369bb83e97 100644 --- a/tests/ui/self/elision/ref-self.fixed +++ b/tests/ui/self/elision/ref-self.fixed @@ -12,7 +12,9 @@ struct Wrap<T, P>(T, PhantomData<P>); impl<T, P> Deref for Wrap<T, P> { type Target = T; - fn deref(&self) -> &T { &self.0 } + fn deref(&self) -> &T { + &self.0 + } } impl Struct { @@ -56,4 +58,4 @@ impl Struct { } } -fn main() { } +fn main() {} diff --git a/tests/ui/self/elision/ref-self.rs b/tests/ui/self/elision/ref-self.rs index 9b204e2a43b..4b4b8aa5b51 100644 --- a/tests/ui/self/elision/ref-self.rs +++ b/tests/ui/self/elision/ref-self.rs @@ -12,7 +12,9 @@ struct Wrap<T, P>(T, PhantomData<P>); impl<T, P> Deref for Wrap<T, P> { type Target = T; - fn deref(&self) -> &T { &self.0 } + fn deref(&self) -> &T { + &self.0 + } } impl Struct { @@ -56,4 +58,4 @@ impl Struct { } } -fn main() { } +fn main() {} diff --git a/tests/ui/self/elision/ref-self.stderr b/tests/ui/self/elision/ref-self.stderr index b17667827bb..a39a6a15385 100644 --- a/tests/ui/self/elision/ref-self.stderr +++ b/tests/ui/self/elision/ref-self.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/ref-self.rs:22:9 + --> $DIR/ref-self.rs:24:9 | LL | fn ref_self(&self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -14,7 +14,7 @@ LL | fn ref_self<'a>(&'a self, f: &'a u32) -> &'a u32 { | ++++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:29:9 + --> $DIR/ref-self.rs:31:9 | LL | fn ref_Self(self: &Self, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -29,7 +29,7 @@ LL | fn ref_Self<'a>(self: &'a Self, f: &'a u32) -> &'a u32 { | ++++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:34:9 + --> $DIR/ref-self.rs:36:9 | LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -44,7 +44,7 @@ LL | fn box_ref_Self<'a>(self: Box<&'a Self>, f: &'a u32) -> &'a u32 { | ++++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:39:9 + --> $DIR/ref-self.rs:41:9 | LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -59,7 +59,7 @@ LL | fn pin_ref_Self<'a>(self: Pin<&'a Self>, f: &'a u32) -> &'a u32 { | ++++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:44:9 + --> $DIR/ref-self.rs:46:9 | LL | fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -74,7 +74,7 @@ LL | fn box_box_ref_Self<'a>(self: Box<Box<&'a Self>>, f: &'a u32) -> &'a u3 | ++++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:49:9 + --> $DIR/ref-self.rs:51:9 | LL | fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 { | - - let's call the lifetime of this reference `'1` @@ -89,7 +89,7 @@ LL | fn box_pin_ref_Self<'a>(self: Box<Pin<&'a Self>>, f: &'a u32) -> &'a u3 | ++++ ++ ++ ++ error: lifetime may not live long enough - --> $DIR/ref-self.rs:54:9 + --> $DIR/ref-self.rs:56:9 | LL | fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { | - - let's call the lifetime of this reference `'1` diff --git a/tests/ui/self/elision/ref-struct.fixed b/tests/ui/self/elision/ref-struct.fixed index 1c26c84c088..a9ecbc9c3ae 100644 --- a/tests/ui/self/elision/ref-struct.fixed +++ b/tests/ui/self/elision/ref-struct.fixed @@ -3,7 +3,7 @@ use std::pin::Pin; -struct Struct { } +struct Struct {} impl Struct { // Test using `&Struct` explicitly: @@ -34,4 +34,4 @@ impl Struct { } } -fn main() { } +fn main() {} diff --git a/tests/ui/self/elision/ref-struct.rs b/tests/ui/self/elision/ref-struct.rs index 78b894765aa..733a175e7a1 100644 --- a/tests/ui/self/elision/ref-struct.rs +++ b/tests/ui/self/elision/ref-struct.rs @@ -3,7 +3,7 @@ use std::pin::Pin; -struct Struct { } +struct Struct {} impl Struct { // Test using `&Struct` explicitly: @@ -34,4 +34,4 @@ impl Struct { } } -fn main() { } +fn main() {} |
