]>
Commit | Line | Data |
---|---|---|
041b39d2 XL |
1 | // aux-build:private-inferred-type.rs |
2 | ||
3b2f2976 | 3 | #![allow(warnings)] |
041b39d2 XL |
4 | |
5 | extern crate private_inferred_type as ext; | |
6 | ||
7 | mod m { | |
8 | struct Priv; | |
9 | pub type Alias = Priv; | |
10 | ||
11 | pub trait Trait { type X; } | |
12 | impl Trait for Priv { type X = u8; } | |
13 | } | |
14 | ||
1b1a35ee XL |
15 | fn f(_: m::Alias) {} //~ ERROR type `Priv` is private |
16 | //~^ ERROR type `Priv` is private | |
041b39d2 XL |
17 | fn f_ext(_: ext::Alias) {} //~ ERROR type `ext::Priv` is private |
18 | //~^ ERROR type `ext::Priv` is private | |
19 | ||
20 | trait Tr1 {} | |
1b1a35ee | 21 | impl m::Alias {} //~ ERROR type `Priv` is private |
041b39d2 | 22 | impl Tr1 for ext::Alias {} //~ ERROR type `ext::Priv` is private |
1b1a35ee | 23 | type A = <m::Alias as m::Trait>::X; //~ ERROR type `Priv` is private |
041b39d2 XL |
24 | |
25 | trait Tr2<T> {} | |
26 | impl<T> Tr2<T> for u8 {} | |
1b1a35ee | 27 | fn g() -> impl Tr2<m::Alias> { 0 } //~ ERROR type `Priv` is private |
041b39d2 XL |
28 | fn g_ext() -> impl Tr2<ext::Alias> { 0 } //~ ERROR type `ext::Priv` is private |
29 | ||
30 | fn main() {} |