forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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 rust-lang#116417 - ouz-a:trait_type_detective, r=<try>
Remove is global hack In attempt to fix rust-lang#114057 we found several issues with how compiler computes layouts, this change removes `is_global` from `and` to stop impl from being shadowed. In depth conversation can be read here https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Getting.20different.20types.20from.20almost.20same.20inputs This is a fix candidate opened for performance run. r? `@lcnr`
- Loading branch information
Showing
2 changed files
with
23 additions
and
12 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,21 @@ | ||
// check-pass | ||
trait Bar<'a> { | ||
type Assoc: 'static; | ||
} | ||
|
||
impl<'a> Bar<'a> for () { | ||
type Assoc = (); | ||
} | ||
|
||
struct ImplsStatic<CG: Bar<'static>> { | ||
d: &'static <CG as Bar<'static>>::Assoc, | ||
} | ||
|
||
fn caller(b: ImplsStatic<()>) | ||
where | ||
for<'a> (): Bar<'a> | ||
{ | ||
let _: &<() as Bar<'static>>::Assoc = b.d; | ||
} | ||
|
||
fn main() {} |