-
Notifications
You must be signed in to change notification settings - Fork 13.3k
reachability/dead_code doesn't visit some type parameters #11115
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
Comments
This is vaguely along the lines of #10573 as well. There's a question as to whether we want to allow this at all, but it definitely seems bad that there's a link error today. |
Just a bug, denominating. |
Doesn't seem to have anything to do with type parameters, neither fields nor methods are taken into consideration (probably assuming that a field or a method can't expose a private type with public methods): #![crate_type="lib"]
pub struct Foo {
pub x: Bar
}
impl Foo {
pub fn new() -> Foo {
Foo { x: Bar}
}
pub fn get_x(&self) -> Bar {
self.x
}
}
struct Bar;
impl Bar {
pub fn bar(&self) {
println!("onoez");
}
}
The link error is still there, using either the field or the method to get a |
Since this bug was filed, struct fields have switched from public by default to private by default, and, private types in public position have been outlawed, meaning (a) the external crate crate in @cmr's original example fails to compile before hitting linking errors (
Closing. |
New lint [`filter_map_bool_then`] Closes rust-lang#9098 changelog: New lint [`filter_map_bool_then`]
warns:
But it could be used, since it's exported through
Foo
which is public.When trying to use the method with:
there's a link failure:
cc @ktt3ja @alexcrichton
The text was updated successfully, but these errors were encountered: