rust/tests/ui/privacy/privacy-ufcs.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
241 B
Rust
Raw Normal View History

2015-09-22 08:06:43 +00:00
// Test to ensure private traits are inaccessible with UFCS angle-bracket syntax.
mod foo {
trait Bar {
fn baz() {}
}
impl Bar for i32 {}
}
fn main() {
2016-02-22 22:33:38 +00:00
<i32 as ::foo::Bar>::baz(); //~ERROR trait `Bar` is private
2015-09-22 08:06:43 +00:00
}