-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #62682 - alessandrod:issue-58375, r=eddyb
Normalize type parameters in create_mono_items_for_default_impls. Fix for #58375. I've added a test in `src/tests/run-pass` to reproduce the bug, not sure that's the best place for it. See #58375 (comment) for more context.
- Loading branch information
Showing
2 changed files
with
29 additions
and
2 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
23 changes: 23 additions & 0 deletions
23
src/test/run-pass/issue-58375-monomorphize-default-impls.rs
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,23 @@ | ||
// Make sure that the mono-item collector does not crash when trying to | ||
// instantiate a default impl for DecodeUtf16<<u8 as A>::Item> | ||
// See https://github.com/rust-lang/rust/issues/58375 | ||
// compile-flags:-C link-dead-code | ||
|
||
#![crate_type = "rlib"] | ||
|
||
pub struct DecodeUtf16<I>(I); | ||
|
||
pub trait Arbitrary { | ||
fn arbitrary() {} | ||
} | ||
|
||
pub trait A { | ||
type Item; | ||
} | ||
|
||
impl A for u8 { | ||
type Item = char; | ||
} | ||
|
||
impl Arbitrary for DecodeUtf16<<u8 as A>::Item> { | ||
} |