From d3ebd232a5f6765373b8b7ef23ed5b87477fbd1e Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 12 Sep 2024 09:55:25 -0400 Subject: [PATCH] Add test for nalgebra hang in coherence --- tests/ui/traits/coherence-alias-hang.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/ui/traits/coherence-alias-hang.rs diff --git a/tests/ui/traits/coherence-alias-hang.rs b/tests/ui/traits/coherence-alias-hang.rs new file mode 100644 index 0000000000000..37b8073958994 --- /dev/null +++ b/tests/ui/traits/coherence-alias-hang.rs @@ -0,0 +1,23 @@ +//@ check-pass + +// Regression test for nalgebra hang . + +#![feature(lazy_type_alias)] +#![allow(incomplete_features)] + +type Id = T; +trait NotImplemented {} + +struct W(*const T, *const U); +trait Trait { + type Assoc: ?Sized; +} +impl Trait for W { + type Assoc = W>; +} + +trait Overlap {} +impl Overlap for W {} +impl Overlap for T {} + +fn main() {}