-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-visibilityArea: Visibility / privacyArea: Visibility / privacy
Description
#![feature(existential_type)]
pub mod foo {
pub existential type Foo: ::std::fmt::Debug;
pub fn foo() -> Foo {
S
}
#[derive(Debug)] struct S;
}
gives
warning: private type `foo::S` in public interface (error E0446)
--> src/lib.rs:4:5
|
4 | pub existential type Foo: ::std::fmt::Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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>
Returning impl ::std::fmt::Debug
does not have this restriction.
Metadata
Metadata
Assignees
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-visibilityArea: Visibility / privacyArea: Visibility / privacy