diff options
Diffstat (limited to 'tests/ui/issues/issue-58375-monomorphize-default-impls.rs')
-rw-r--r-- | tests/ui/issues/issue-58375-monomorphize-default-impls.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-58375-monomorphize-default-impls.rs b/tests/ui/issues/issue-58375-monomorphize-default-impls.rs new file mode 100644 index 000000000..6da6f398d --- /dev/null +++ b/tests/ui/issues/issue-58375-monomorphize-default-impls.rs @@ -0,0 +1,24 @@ +// 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 + +// build-pass +// 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> {} |