-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #57344 - petrochenkov:regreach, r=arielb1
privacy: Fix regression in impl reachability Rollback to pre-#56878 logic of determining reachability. `reachability(impl Trait<Substs> for Type<Substs>) = reachability(Trait & Type)`, substs are ignored. Fixes #57264
- Loading branch information
Showing
5 changed files
with
78 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
mod inner { | ||
pub struct PubUnnameable; | ||
} | ||
|
||
pub struct Pub<T>(T); | ||
|
||
impl Pub<inner::PubUnnameable> { | ||
pub fn pub_method() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} |