forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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 rust-lang#111971 - cuviper:beta-next, r=cuviper
[beta] backport - Dont check `must_use` on nested `impl Future` from fn rust-lang#111491 - fix recursion depth handling after confirmation rust-lang#111754 r? cuviper
- Loading branch information
Showing
10 changed files
with
130 additions
and
18 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
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
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
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,12 @@ | ||
// edition:2021 | ||
|
||
use std::future::Future; | ||
|
||
pub struct Manager; | ||
|
||
impl Manager { | ||
#[must_use] | ||
pub async fn new() -> (Self, impl Future<Output = ()>) { | ||
(Manager, async {}) | ||
} | ||
} |
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:2021 | ||
// aux-build:must-use-foreign.rs | ||
// check-pass | ||
|
||
extern crate must_use_foreign; | ||
|
||
use must_use_foreign::Manager; | ||
|
||
async fn async_main() { | ||
Manager::new().await.1.await; | ||
} | ||
|
||
fn main() { | ||
let _ = async_main(); | ||
} |
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
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
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
34 changes: 34 additions & 0 deletions
34
tests/ui/traits/solver-cycles/cycle-via-builtin-auto-trait-impl.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,34 @@ | ||
//~ ERROR overflow | ||
// A regression test for #111729 checking that we correctly | ||
// track recursion depth for obligations returned by confirmation. | ||
use std::panic::RefUnwindSafe; | ||
|
||
trait Database { | ||
type Storage; | ||
} | ||
trait Query<DB> { | ||
type Data; | ||
} | ||
struct ParseQuery; | ||
struct RootDatabase { | ||
_runtime: Runtime<RootDatabase>, | ||
} | ||
|
||
impl<T: RefUnwindSafe> Database for T { | ||
type Storage = SalsaStorage; | ||
} | ||
impl Database for RootDatabase { | ||
type Storage = SalsaStorage; | ||
} | ||
|
||
struct Runtime<DB: Database> { | ||
_storage: Box<DB::Storage>, | ||
} | ||
struct SalsaStorage { | ||
_parse: <ParseQuery as Query<RootDatabase>>::Data, | ||
} | ||
|
||
impl<DB: Database> Query<DB> for ParseQuery { | ||
type Data = RootDatabase; | ||
} | ||
fn main() {} |
24 changes: 24 additions & 0 deletions
24
tests/ui/traits/solver-cycles/cycle-via-builtin-auto-trait-impl.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,24 @@ | ||
error[E0275]: overflow evaluating the requirement `Runtime<RootDatabase>: RefUnwindSafe` | ||
| | ||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`cycle_via_builtin_auto_trait_impl`) | ||
note: required because it appears within the type `RootDatabase` | ||
--> $DIR/cycle-via-builtin-auto-trait-impl.rs:13:8 | ||
| | ||
LL | struct RootDatabase { | ||
| ^^^^^^^^^^^^ | ||
note: required for `RootDatabase` to implement `Database` | ||
--> $DIR/cycle-via-builtin-auto-trait-impl.rs:17:24 | ||
| | ||
LL | impl<T: RefUnwindSafe> Database for T { | ||
| ------------- ^^^^^^^^ ^ | ||
| | | ||
| unsatisfied trait bound introduced here | ||
note: required because it appears within the type `Runtime<RootDatabase>` | ||
--> $DIR/cycle-via-builtin-auto-trait-impl.rs:24:8 | ||
| | ||
LL | struct Runtime<DB: Database> { | ||
| ^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0275`. |