-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-visibilityArea: Visibility / privacyArea: Visibility / privacyAsyncAwait-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.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
mod foo {
struct Bar;
pub async fn bar() -> Bar {
Bar
}
}
This compiles just fine, despite the async fn returning a private type. There is a warning, but that's about it.
warning: private type `foo::Bar` in public interface (error E0446)
--> src/lib.rs:4:5
|
4 | / pub async fn bar() -> Bar {
5 | | Bar
6 | | }
| |_____^
|
= note: `#[warn(private_in_public)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
I don't think the warning was intended for async fn. This seems like it slipped through for async fn.
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-visibilityArea: Visibility / privacyArea: Visibility / privacyAsyncAwait-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.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.