Auto merge of #67004 - estebank:issue-66958, r=eddyb
Do not ICE on async fn with non-Copy infered type arg Fix #66958.
This commit is contained in:
commit
dbbe4f10fa
3 changed files with 38 additions and 9 deletions
|
|
@ -0,0 +1,15 @@
|
|||
// edition:2018
|
||||
|
||||
struct Ia<S>(S);
|
||||
|
||||
impl<S> Ia<S> {
|
||||
fn partial(_: S) {}
|
||||
fn full(self) {}
|
||||
|
||||
async fn crash(self) {
|
||||
Self::partial(self.0);
|
||||
Self::full(self); //~ ERROR use of moved value: `self`
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
error[E0382]: use of moved value: `self`
|
||||
--> $DIR/issue-66958-non-copy-infered-type-arg.rs:11:20
|
||||
|
|
||||
LL | Self::partial(self.0);
|
||||
| ------ value moved here
|
||||
LL | Self::full(self);
|
||||
| ^^^^ value used here after partial move
|
||||
|
|
||||
= note: move occurs because `self.0` has type `S`, which does not implement the `Copy` trait
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0382`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue