-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #67004 - estebank:issue-66958, r=eddyb
Do not ICE on async fn with non-Copy infered type arg Fix #66958.
- Loading branch information
Showing
3 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/test/ui/async-await/issues/issue-66958-non-copy-infered-type-arg.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |
13 changes: 13 additions & 0 deletions
13
src/test/ui/async-await/issues/issue-66958-non-copy-infered-type-arg.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`. |