forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement support for GeneratorWitnessMIR in new solver
- Loading branch information
1 parent
2fb0e8d
commit 4a4fc3b
Showing
3 changed files
with
90 additions
and
3 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
18 changes: 18 additions & 0 deletions
18
tests/ui/traits/new-solver/auto-with-drop_tracking_mir.fail.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,18 @@ | ||
error[E0277]: `impl Future<Output = ()>` cannot be sent between threads safely | ||
--> $DIR/auto-with-drop_tracking_mir.rs:24:13 | ||
| | ||
LL | is_send(foo()); | ||
| ------- ^^^^^ `impl Future<Output = ()>` cannot be sent between threads safely | ||
| | | ||
| required by a bound introduced by this call | ||
| | ||
= help: the trait `Send` is not implemented for `impl Future<Output = ()>` | ||
note: required by a bound in `is_send` | ||
--> $DIR/auto-with-drop_tracking_mir.rs:23:24 | ||
| | ||
LL | fn is_send(_: impl Send) {} | ||
| ^^^^ required by this bound in `is_send` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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,26 @@ | ||
// compile-flags: -Ztrait-solver=next -Zdrop-tracking-mir | ||
// edition: 2021 | ||
// revisions: pass fail | ||
//[pass] check-pass | ||
|
||
#![feature(negative_impls)] | ||
|
||
struct NotSync; | ||
impl !Sync for NotSync {} | ||
|
||
async fn foo() { | ||
#[cfg(pass)] | ||
let x = &(); | ||
#[cfg(fail)] | ||
let x = &NotSync; | ||
bar().await; | ||
drop(x); | ||
} | ||
|
||
async fn bar() {} | ||
|
||
fn main() { | ||
fn is_send(_: impl Send) {} | ||
is_send(foo()); | ||
//[fail]~^ ERROR `impl Future<Output = ()>` cannot be sent between threads safely | ||
} |