Use recorded types in rustc_privacy

This commit is contained in:
Vadim Petrochenkov 2017-09-16 16:45:49 +03:00
parent 505ff71ac1
commit 419069d984
6 changed files with 43 additions and 121 deletions

View file

@ -107,6 +107,7 @@ mod cross_crate {
struct S1<T: TraitWithAssociatedTypes>(T::TypeUnstable);
struct S2<T: TraitWithAssociatedTypes>(T::TypeDeprecated);
//~^ WARN use of deprecated item
//~| WARN use of deprecated item
let _ = DeprecatedStruct { //~ WARN use of deprecated item
i: 0 //~ WARN use of deprecated item

View file

@ -103,10 +103,11 @@ mod adjust {
fn main() {
let _: m::Alias; //~ ERROR type `m::Priv` is private
let _: <m::Alias as m::TraitWithAssocTy>::AssocTy; // FIXME
//~^ ERROR type `m::Priv` is private
let _: <m::Alias as m::TraitWithAssocTy>::AssocTy; //~ ERROR type `m::Priv` is private
m::Alias {}; //~ ERROR type `m::Priv` is private
m::Pub { 0: m::Alias {} }; //~ ERROR type `m::Priv` is private
m::Pub { 0: loop {} }; // FIXME
m::Pub { 0: loop {} }; // OK, `m::Pub` is in value context, so it means Pub<_>, not Pub<Priv>
m::Pub::static_method; //~ ERROR type `m::Priv` is private
m::Pub::INHERENT_ASSOC_CONST; //~ ERROR type `m::Priv` is private
m::Pub(0u8).method_with_substs::<m::Alias>(); //~ ERROR type `m::Priv` is private

View file

@ -31,7 +31,6 @@ fn f_ext(_: ext::Alias) {} //~ ERROR type `ext::Priv` is private
trait Tr1 {}
impl m::Alias {} //~ ERROR type `m::Priv` is private
impl Tr1 for ext::Alias {} //~ ERROR type `ext::Priv` is private
//~^ ERROR type `ext::Priv` is private
type A = <m::Alias as m::Trait>::X; //~ ERROR type `m::Priv` is private
trait Tr2<T> {}