1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // aux-build:private-inferred-type.rs
13 #![feature(conservative_impl_trait)]
16 extern crate private_inferred_type as ext;
20 pub type Alias = Priv;
22 pub trait Trait { type X; }
23 impl Trait for Priv { type X = u8; }
26 fn f(_: m::Alias) {} //~ ERROR type `m::Priv` is private
27 //~^ ERROR type `m::Priv` is private
28 fn f_ext(_: ext::Alias) {} //~ ERROR type `ext::Priv` is private
29 //~^ ERROR type `ext::Priv` is private
32 impl m::Alias {} //~ ERROR type `m::Priv` is private
33 impl Tr1 for ext::Alias {} //~ ERROR type `ext::Priv` is private
34 //~^ ERROR type `ext::Priv` is private
35 type A = <m::Alias as m::Trait>::X; //~ ERROR type `m::Priv` is private
38 impl<T> Tr2<T> for u8 {}
39 fn g() -> impl Tr2<m::Alias> { 0 } //~ ERROR type `m::Priv` is private
40 fn g_ext() -> impl Tr2<ext::Alias> { 0 } //~ ERROR type `ext::Priv` is private