rust/tests/ui/privacy/private-inferred-type-2.rs

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

21 lines
473 B
Rust
Raw Normal View History

2017-04-22 19:46:34 +00:00
//@ aux-build:private-inferred-type.rs
#![allow(private_interfaces)]
2017-05-25 02:04:03 +00:00
2017-04-22 19:46:34 +00:00
extern crate private_inferred_type as ext;
2017-03-25 02:37:55 +00:00
2017-04-22 19:46:34 +00:00
mod m {
struct Priv;
pub struct Pub<T>(pub T);
2017-03-25 02:37:55 +00:00
2017-04-22 19:46:34 +00:00
impl Pub<Priv> {
pub fn get_priv() -> Priv { Priv }
pub fn static_method() {}
2017-03-25 02:37:55 +00:00
}
}
fn main() {
m::Pub::get_priv; //~ ERROR type `Priv` is private
m::Pub::static_method; //~ ERROR type `Priv` is private
2017-04-22 19:46:34 +00:00
ext::Pub::static_method; //~ ERROR type `ext::Priv` is private
2017-03-25 02:37:55 +00:00
}