-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Existential type complains about private type in public interface if concrete type is not pub #53546
Comments
This also happens with closures: #![feature(existential_type)]
pub existential type X: FnOnce();
pub fn foo() -> X {
|| ()
} gives
And as far as I can tell, there isn't a way to work around this? |
This should probably be tagged |
I'll look what happens. |
For some weird reason, I'm getting a hard error instead of a warning for this when it's happening in a much larger crate of mine on
|
Ouch, when this is an error, it's really hard to work around. @petrochenkov any luck trying to figure out the cause of this? |
Sadly the bug also manifests itself in netsoup, which is really hard to work around, so we're kind of stuck here for now... Unless we Box everything.
Fixed in #57556 |
privacy: Fix private-in-public check for existential types Fixes rust-lang#53546 (regression from rust-lang#56878) r? @arielb1
privacy: Fix private-in-public check for existential types Fixes rust-lang#53546 (regression from rust-lang#56878) r? @arielb1
I still get the warning for this example: #![feature(existential_type)]
pub trait Test {
type Foo;
fn foo() -> Self::Foo;
}
struct FooImpl;
impl Test for () {
existential type Foo: ;
fn foo() -> Self::Foo {
FooImpl
}
} |
Reopening to investigate #53546 (comment) |
#53546 (comment) is fixed in #57649 |
privacy: Account for associated existential types Turns out they *can* be associated (but only in impls, not traits). Fixes rust-lang#53546 (comment) r? @arielb1
privacy: Account for associated existential types Turns out they *can* be associated (but only in impls, not traits). Fixes rust-lang#53546 (comment) r? @arielb1
gives
Returning
impl ::std::fmt::Debug
does not have this restriction.The text was updated successfully, but these errors were encountered: