diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-23 13:05:22 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-23 13:05:22 +0100 |
| commit | 368bfb2c10541129f9e6af98d88125d9bfc77820 (patch) | |
| tree | 2913146fed68d5c0277250000263640f34bc442e | |
| parent | f2bc9c5997a3647a61cfb5045866314088c6befa (diff) | |
| download | rust-368bfb2c10541129f9e6af98d88125d9bfc77820.tar.gz rust-368bfb2c10541129f9e6af98d88125d9bfc77820.zip | |
add test for #107228
Fixes #107228
| -rw-r--r-- | tests/ui/specialization/broken-mir-drop-glue-107228.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ui/specialization/broken-mir-drop-glue-107228.rs b/tests/ui/specialization/broken-mir-drop-glue-107228.rs new file mode 100644 index 00000000000..5a6dbf9ffc7 --- /dev/null +++ b/tests/ui/specialization/broken-mir-drop-glue-107228.rs @@ -0,0 +1,28 @@ +// issue: rust-lang/rust#107228 +// ICE broken MIR in DropGlue +//@ compile-flags: -Zvalidate-mir +//@ check-pass + +#![feature(specialization)] +#![crate_type="lib"] +#![allow(incomplete_features)] + +pub(crate) trait SpecTrait { + type Assoc; +} + +impl<C> SpecTrait for C { + default type Assoc = Vec<Self>; +} + +pub(crate) struct AssocWrap<C: SpecTrait> { + _assoc: C::Assoc, +} + +fn instantiate<C: SpecTrait>() -> AssocWrap<C> { + loop {} +} + +pub fn main() { + instantiate::<()>(); +} |
