-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyA-visibilityArea: Visibility / privacyArea: Visibility / privacyF-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`I-needs-decisionIssue: In need of a decision.Issue: In need of a decision.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.T-langRelevant to the language teamRelevant to the language teamrequires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Description
The current implementation of existential_type does not trigger any "private type in public interface" errors, for the following code (playground):
#![feature(existential_type)]
existential type Foo: std::fmt::Debug;
pub fn foo() -> Foo {
5usize
}I would expect it to give an error like
error[E0446]: private type alias `Foo` in public interface
--> src/lib.rs:8:1
|
5 | existential type Foo: std::fmt::Debug
| - `Foo` declared as private
...
8 | / pub fn foo() -> Foo {
9 | | 5usize
10 | | }
| |_^ can't leak private type alias
(although, because normal type aliases are transparent to the visibility checking, I'm not certain exactly what the error message should say; it just seems bad to introduce another way to accidentally forget to make part of your API publicly nameable)
cc #63063
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-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyA-visibilityArea: Visibility / privacyArea: Visibility / privacyF-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`I-needs-decisionIssue: In need of a decision.Issue: In need of a decision.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.T-langRelevant to the language teamRelevant to the language teamrequires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Projects
Status
Done