-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #109321 - compiler-errors:illegal-mono-w-regions, r=c…
…jgillot Erase impl regions when checking for impossible to eagerly monomorphize items We were inserting `ReErased` for method substs, but not for impl substs, leading to the call for `subst_and_check_impossible_predicates` being a bit weaker than it should be (since it ignores predicates that need substitution -- incl early-bound regions). Fixes #109297
- Loading branch information
Showing
2 changed files
with
48 additions
and
19 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,19 @@ | ||
//compile-flags: --crate-type=lib -Clink-dead-code=on | ||
// build-pass | ||
|
||
// Make sure that we don't monomorphize the impossible method `<() as Visit>::visit`, | ||
// which does not hold under a reveal-all param env. | ||
|
||
pub trait Visit { | ||
fn visit() {} | ||
} | ||
|
||
pub trait Array { | ||
type Element; | ||
} | ||
|
||
impl<'a> Visit for () where (): Array<Element = &'a ()> {} | ||
|
||
impl Array for () { | ||
type Element = (); | ||
} |