-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-coroutinesArea: CoroutinesArea: CoroutinesA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
#![feature(async_await, await_macro, futures_api)]
#![deny(missing_debug_implementations)]
struct DontLookAtMe(i32);
async fn secret() -> DontLookAtMe {
DontLookAtMe(41)
}
// Comment this function out to fix the lint...
pub async fn looking() -> i32 {
await!(secret()).0
}
fn main() {
}
Playground: https://play.rust-lang.org/?gist=0baad2fb680123d124806d6269c15c43&version=nightly&mode=debug&edition=2018
The DontLookAtMe
struct isn't public, so it normally shouldn't trigger the missing_debug_implementations
lint. But once await!
is used on a future that happens to be holding the field somewhere inside, it trips the lint:
error: type does not implement `fmt::Debug`; consider adding #[derive(Debug)] or a manual implementation
--> src/main.rs:4:1
|
4 | struct DontLookAtMe(i32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> src/main.rs:2:9
|
2 | #![deny(missing_debug_implementations)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-coroutinesArea: CoroutinesArea: CoroutinesA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.