Open
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.