-
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.
Rollup merge of #109755 - compiler-errors:new-solver-generator-witnes…
…s-mir, r=cjgillot Implement support for `GeneratorWitnessMIR` in new solver r? ```@cjgillot``` I mostly want this to cut down the number of failing UI tests when running the UI test suite with `--compare-mode=next-solver`, but there doesn't seem like much reason to block implementing this since it adds minimal complexity to the existing structural traits impl in the new solver. If others are against adding this for some reason, then maybe we should just make `GeneratorWitnessMIR` return `NoSolution` for these traits. Anything but an ICE please 😸 🧊
- Loading branch information
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 | ||
} |