Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRules governing references to private types in public APIs not enforced in impls #28325
Comments
nikomatsakis
added
I-nominated
T-compiler
labels
Sep 9, 2015
This comment has been minimized.
This comment has been minimized.
|
nominating, as this seems like a backcompat hazard. |
This comment has been minimized.
This comment has been minimized.
|
See also #18082 |
This comment has been minimized.
This comment has been minimized.
|
triage: P-high |
rust-highfive
added
P-high
and removed
I-nominated
labels
Sep 17, 2015
nikomatsakis
assigned
nrc
Sep 17, 2015
This comment has been minimized.
This comment has been minimized.
|
(a slightly more complicated example that shows the privacy hole being exploited: mod x {
pub struct Foo { pub x: u32 }
struct Bar { _x: u32 }
impl Foo {
pub fn foo(&self, _x: Self, _y: Bar) { }
pub fn bar(&self) -> Bar { Bar { _x: self.x } }
}
}
pub fn main() {
let f = x::Foo { x: 4 };
let b = f.bar();
f.foo(x::Foo { x: 5 }, b);
}
) |
nikomatsakis
referenced this issue
Sep 17, 2015
Closed
Type alias can be used to bypass privacy check #28450
nrc
assigned
aturon
and unassigned
nrc
Oct 9, 2015
jethrogb
referenced this issue
Nov 7, 2015
Closed
Non-exported type in exported type signature does not error #29668
This comment has been minimized.
This comment has been minimized.
|
@petrochenkov do you think your rewritten privacy pass will fix this? |
This comment has been minimized.
This comment has been minimized.
|
Yes, it should. |
petrochenkov
referenced this issue
Nov 21, 2015
Merged
privacy: Rewrite VisiblePrivateTypesVisitor #29973
bors
added a commit
that referenced
this issue
Dec 18, 2015
bors
closed this
in
#29973
Dec 18, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nikomatsakis commentedSep 9, 2015
This code compiles, it should not:
cc @nrc