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 03:06:43 -05: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 16:33:38 -06:00
<i32 as ::foo::Bar>::baz(); //~ERROR trait `Bar` is private
2015-09-22 03:06:43 -05:00
}