Auto merge of #57344 - petrochenkov:regreach, r=arielb1

privacy: Fix regression in impl reachability

Rollback to pre-https://github.com/rust-lang/rust/pull/56878 logic of determining reachability.
`reachability(impl Trait<Substs> for Type<Substs>) = reachability(Trait & Type)`, substs are ignored.

Fixes https://github.com/rust-lang/rust/issues/57264
This commit is contained in:
bors 2019-01-06 22:26:16 +00:00
commit d39dddf795
5 changed files with 78 additions and 11 deletions

View file

@ -0,0 +1,9 @@
mod inner {
pub struct PubUnnameable;
}
pub struct Pub<T>(T);
impl Pub<inner::PubUnnameable> {
pub fn pub_method() {}
}

View file

@ -0,0 +1,10 @@
mod inner {
pub struct PubUnnameable;
impl PubUnnameable {
pub fn pub_method(self) {}
}
}
pub trait PubTraitWithSingleImplementor {}
impl PubTraitWithSingleImplementor for Option<inner::PubUnnameable> {}

View file

@ -0,0 +1,8 @@
// compile-pass
// aux-build:issue-57264-1.rs
extern crate issue_57264_1;
fn main() {
issue_57264_1::Pub::pub_method();
}

View file

@ -0,0 +1,10 @@
// compile-pass
// aux-build:issue-57264-2.rs
extern crate issue_57264_2;
fn infer<T: issue_57264_2::PubTraitWithSingleImplementor>(arg: T) -> T { arg }
fn main() {
infer(None).unwrap().pub_method();
}