mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
WIP fix tests
This commit is contained in:
parent
81cd596bc5
commit
dce20bf62a
@ -20,7 +20,7 @@ fn return_targets_async_block_not_fn() -> u8 {
|
||||
}
|
||||
|
||||
async fn return_targets_async_block_not_async_fn() -> u8 {
|
||||
//~^ ERROR type mismatch resolving
|
||||
//~^ ERROR mismatched types
|
||||
let block = async {
|
||||
return 0u8;
|
||||
};
|
||||
|
@ -39,6 +39,22 @@ LL | let _: &dyn Future<Output = ()> = █
|
||||
found type `()`
|
||||
= note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/async-block-control-flow-static-semantics.rs:22:58
|
||||
|
|
||||
LL | async fn return_targets_async_block_not_async_fn() -> u8 {
|
||||
| __________________________________________________________^
|
||||
LL | |
|
||||
LL | | let block = async {
|
||||
LL | | return 0u8;
|
||||
... |
|
||||
LL | |
|
||||
LL | | }
|
||||
| |_^ expected u8, found ()
|
||||
|
|
||||
= note: expected type `u8`
|
||||
found type `()`
|
||||
|
||||
error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
|
||||
--> $DIR/async-block-control-flow-static-semantics.rs:27:39
|
||||
|
|
||||
@ -49,16 +65,6 @@ LL | let _: &dyn Future<Output = ()> = █
|
||||
found type `()`
|
||||
= note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
|
||||
|
||||
error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == u8`
|
||||
--> $DIR/async-block-control-flow-static-semantics.rs:22:55
|
||||
|
|
||||
LL | async fn return_targets_async_block_not_async_fn() -> u8 {
|
||||
| ^^ expected (), found u8
|
||||
|
|
||||
= note: expected type `()`
|
||||
found type `u8`
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/async-block-control-flow-static-semantics.rs:48:44
|
||||
|
|
||||
|
@ -9,7 +9,7 @@ fn get_future() -> impl Future<Output = ()> {
|
||||
}
|
||||
|
||||
async fn foo() {
|
||||
let a; //~ ERROR type inside `async` object must be known in this context
|
||||
let a; //~ ERROR type inside `async` fn body must be known in this context
|
||||
get_future().await;
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0698]: type inside `async` object must be known in this context
|
||||
error[E0698]: type inside `async` fn body must be known in this context
|
||||
--> $DIR/async-error-span.rs:12:9
|
||||
|
|
||||
LL | let a;
|
||||
| ^ cannot infer type
|
||||
|
|
||||
note: the type is part of the `async` object because of this `await`
|
||||
note: the type is part of the `async` fn body because of this `await`
|
||||
--> $DIR/async-error-span.rs:13:5
|
||||
|
|
||||
LL | get_future().await;
|
||||
|
@ -9,9 +9,9 @@ trait Foo {}
|
||||
impl Xyz {
|
||||
async fn do_sth<'a>(
|
||||
&'a self, foo: &dyn Foo
|
||||
) -> &dyn Foo //~ ERROR lifetime mismatch
|
||||
) -> &dyn Foo
|
||||
{
|
||||
foo
|
||||
foo //~ ERROR lifetime mismatch
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,13 @@
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/issue-63388-1.rs:12:10
|
||||
--> $DIR/issue-63388-1.rs:14:9
|
||||
|
|
||||
LL | &'a self, foo: &dyn Foo
|
||||
| -------- this parameter and the return type are declared with different lifetimes...
|
||||
LL | ) -> &dyn Foo
|
||||
| ^^^^^^^^
|
||||
| |
|
||||
| ...but data from `foo` is returned here
|
||||
| --------
|
||||
LL | {
|
||||
LL | foo
|
||||
| ^^^ ...but data from `foo` is returned here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -11,8 +11,9 @@ error: cannot infer an appropriate lifetime
|
||||
|
|
||||
LL | foo: &dyn Foo, bar: &'a dyn Foo
|
||||
| ^^^ ...but this borrow...
|
||||
LL | ) -> &dyn Foo
|
||||
| -------- this return type evaluates to the `'static` lifetime...
|
||||
...
|
||||
LL | foo
|
||||
| --- this return type evaluates to the `'static` lifetime...
|
||||
|
|
||||
note: ...can't outlive the lifetime '_ as defined on the method body at 11:14
|
||||
--> $DIR/issue-63388-2.rs:11:14
|
||||
@ -21,8 +22,8 @@ LL | foo: &dyn Foo, bar: &'a dyn Foo
|
||||
| ^
|
||||
help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime '_ as defined on the method body at 11:14
|
||||
|
|
||||
LL | ) -> &dyn Foo + '_
|
||||
| ^^^^^^^^^^^^^
|
||||
LL | foo + '_
|
||||
|
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -7,9 +7,9 @@ async fn bar<T>() -> () {}
|
||||
|
||||
async fn foo() {
|
||||
bar().await;
|
||||
//~^ ERROR type inside `async` object must be known in this context
|
||||
//~^ ERROR type inside `async` fn body must be known in this context
|
||||
//~| NOTE cannot infer type for `T`
|
||||
//~| NOTE the type is part of the `async` object because of this `await`
|
||||
//~| NOTE the type is part of the `async` fn body because of this `await`
|
||||
//~| NOTE in this expansion of desugaring of `await`
|
||||
}
|
||||
fn main() {}
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0698]: type inside `async` object must be known in this context
|
||||
error[E0698]: type inside `async` fn body must be known in this context
|
||||
--> $DIR/unresolved_type_param.rs:9:5
|
||||
|
|
||||
LL | bar().await;
|
||||
| ^^^ cannot infer type for `T`
|
||||
|
|
||||
note: the type is part of the `async` object because of this `await`
|
||||
note: the type is part of the `async` fn body because of this `await`
|
||||
--> $DIR/unresolved_type_param.rs:9:5
|
||||
|
|
||||
LL | bar().await;
|
||||
|
@ -1,28 +1,25 @@
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:8:45
|
||||
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:8:52
|
||||
|
|
||||
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
|
||||
| ---- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ---- ---- ^ ...but data from `f` is returned here
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:55
|
||||
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:82
|
||||
|
|
||||
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
|
||||
| ----- ^^^^^^^^^^^^^^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----------------- ^ ...but data from `f` is returned here
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:17:58
|
||||
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:17:64
|
||||
|
|
||||
LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
|
||||
| ----- ^^^
|
||||
| | |
|
||||
| | ...but data from `arg` is returned here
|
||||
| ----- --- ^^^ ...but data from `arg` is returned here
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
@ -11,29 +11,29 @@ impl<'a> Struct<'a> {
|
||||
// Test using `&self` sugar:
|
||||
|
||||
async fn ref_self(&self, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
// Test using `&Self` explicitly:
|
||||
|
||||
async fn ref_Self(self: &Self, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,56 +1,62 @@
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/lt-ref-self-async.rs:13:42
|
||||
--> $DIR/lt-ref-self-async.rs:14:9
|
||||
|
|
||||
LL | async fn ref_self(&self, f: &u32) -> &u32 {
|
||||
| ----- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/lt-ref-self-async.rs:19:48
|
||||
--> $DIR/lt-ref-self-async.rs:20:9
|
||||
|
|
||||
LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 {
|
||||
| ----- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/lt-ref-self-async.rs:23:57
|
||||
--> $DIR/lt-ref-self-async.rs:24:9
|
||||
|
|
||||
LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
|
||||
| ----- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/lt-ref-self-async.rs:27:57
|
||||
--> $DIR/lt-ref-self-async.rs:28:9
|
||||
|
|
||||
LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
|
||||
| ----- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/lt-ref-self-async.rs:31:66
|
||||
--> $DIR/lt-ref-self-async.rs:32:9
|
||||
|
|
||||
LL | async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
|
||||
| ----- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/lt-ref-self-async.rs:35:62
|
||||
--> $DIR/lt-ref-self-async.rs:36:9
|
||||
|
|
||||
LL | async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
|
||||
| ----- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
@ -10,30 +10,30 @@ struct Struct { }
|
||||
impl Struct {
|
||||
// Test using `&mut self` sugar:
|
||||
|
||||
async fn ref_self(&mut self, f: &u32) -> &u32 { //~ ERROR lifetime mismatch
|
||||
f
|
||||
async fn ref_self(&mut self, f: &u32) -> &u32 {
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
// Test using `&mut Self` explicitly:
|
||||
|
||||
async fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,56 +1,62 @@
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-mut-self-async.rs:13:46
|
||||
--> $DIR/ref-mut-self-async.rs:14:9
|
||||
|
|
||||
LL | async fn ref_self(&mut self, f: &u32) -> &u32 {
|
||||
| --------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| --------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-mut-self-async.rs:19:52
|
||||
--> $DIR/ref-mut-self-async.rs:20:9
|
||||
|
|
||||
LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
|
||||
| --------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| --------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-mut-self-async.rs:23:61
|
||||
--> $DIR/ref-mut-self-async.rs:24:9
|
||||
|
|
||||
LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
|
||||
| --------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| --------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-mut-self-async.rs:27:61
|
||||
--> $DIR/ref-mut-self-async.rs:28:9
|
||||
|
|
||||
LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
|
||||
| --------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| --------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-mut-self-async.rs:31:70
|
||||
--> $DIR/ref-mut-self-async.rs:32:9
|
||||
|
|
||||
LL | async fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
|
||||
| --------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| --------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-mut-self-async.rs:35:70
|
||||
--> $DIR/ref-mut-self-async.rs:36:9
|
||||
|
|
||||
LL | async fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
|
||||
| --------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| --------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
@ -11,23 +11,23 @@ impl Struct {
|
||||
// Test using `&mut Struct` explicitly:
|
||||
|
||||
async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,47 +1,52 @@
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-mut-struct-async.rs:13:56
|
||||
--> $DIR/ref-mut-struct-async.rs:14:9
|
||||
|
|
||||
LL | async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
|
||||
| ----------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-mut-struct-async.rs:17:65
|
||||
--> $DIR/ref-mut-struct-async.rs:18:9
|
||||
|
|
||||
LL | async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
|
||||
| ----------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-mut-struct-async.rs:21:65
|
||||
--> $DIR/ref-mut-struct-async.rs:22:9
|
||||
|
|
||||
LL | async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
|
||||
| ----------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-mut-struct-async.rs:25:74
|
||||
--> $DIR/ref-mut-struct-async.rs:26:9
|
||||
|
|
||||
LL | async fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 {
|
||||
| ----------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-mut-struct-async.rs:29:74
|
||||
--> $DIR/ref-mut-struct-async.rs:30:9
|
||||
|
|
||||
LL | async fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 {
|
||||
| ----------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
@ -19,34 +19,34 @@ impl<T, P> Deref for Wrap<T, P> {
|
||||
impl Struct {
|
||||
// Test using `&self` sugar:
|
||||
|
||||
async fn ref_self(&self, f: &u32) -> &u32 { //~ ERROR lifetime mismatch
|
||||
f
|
||||
async fn ref_self(&self, f: &u32) -> &u32 {
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
// Test using `&Self` explicitly:
|
||||
|
||||
async fn ref_Self(self: &Self, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,65 +1,72 @@
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-self-async.rs:22:42
|
||||
--> $DIR/ref-self-async.rs:23:9
|
||||
|
|
||||
LL | async fn ref_self(&self, f: &u32) -> &u32 {
|
||||
| ----- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-self-async.rs:28:48
|
||||
--> $DIR/ref-self-async.rs:29:9
|
||||
|
|
||||
LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 {
|
||||
| ----- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-self-async.rs:32:57
|
||||
--> $DIR/ref-self-async.rs:33:9
|
||||
|
|
||||
LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
|
||||
| ----- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-self-async.rs:36:57
|
||||
--> $DIR/ref-self-async.rs:37:9
|
||||
|
|
||||
LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
|
||||
| ----- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-self-async.rs:40:66
|
||||
--> $DIR/ref-self-async.rs:41:9
|
||||
|
|
||||
LL | async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
|
||||
| ----- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-self-async.rs:44:66
|
||||
--> $DIR/ref-self-async.rs:45:9
|
||||
|
|
||||
LL | async fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
|
||||
| ----- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-self-async.rs:48:69
|
||||
--> $DIR/ref-self-async.rs:49:9
|
||||
|
|
||||
LL | async fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
|
||||
| ----- ^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ----- ---
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
|
@ -11,23 +11,23 @@ impl Struct {
|
||||
// Test using `&Struct` explicitly:
|
||||
|
||||
async fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
|
||||
async fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
|
||||
f //~^ ERROR lifetime mismatch
|
||||
f //~ ERROR lifetime mismatch
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,47 +1,52 @@
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-struct-async.rs:13:52
|
||||
--> $DIR/ref-struct-async.rs:14:9
|
||||
|
|
||||
LL | async fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
|
||||
| ------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-struct-async.rs:17:61
|
||||
--> $DIR/ref-struct-async.rs:18:9
|
||||
|
|
||||
LL | async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
|
||||
| ------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-struct-async.rs:21:61
|
||||
--> $DIR/ref-struct-async.rs:22:9
|
||||
|
|
||||
LL | async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
|
||||
| ------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-struct-async.rs:25:70
|
||||
--> $DIR/ref-struct-async.rs:26:9
|
||||
|
|
||||
LL | async fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 {
|
||||
| ------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error[E0623]: lifetime mismatch
|
||||
--> $DIR/ref-struct-async.rs:29:66
|
||||
--> $DIR/ref-struct-async.rs:30:9
|
||||
|
|
||||
LL | async fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
|
||||
| ------- ^^^^
|
||||
| | |
|
||||
| | ...but data from `f` is returned here
|
||||
| ------- ----
|
||||
| |
|
||||
| this parameter and the return type are declared with different lifetimes...
|
||||
LL | f
|
||||
| ^ ...but data from `f` is returned here
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user