forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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 rust-lang#111491 - compiler-errors:nested-fut-must-us…
…e, r=wesleywiser Dont check `must_use` on nested `impl Future` from fn Fixes (but does not close, per beta policy) rust-lang#111484 Also fixes a `FIXME` left in the code about (presumably) false-positives on non-async `#[must_use] fn() -> impl Future` cases, though if that's not desirable to include in the beta backport then I can certainly revert it. Beta nominating as it fixes a beta ICE.
- Loading branch information
Showing
5 changed files
with
32 additions
and
14 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
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