diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-12 09:55:25 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-09-12 09:55:25 -0400 |
| commit | d3ebd232a5f6765373b8b7ef23ed5b87477fbd1e (patch) | |
| tree | 749b5585a7d3983fd1a9752056c21766a616f1ef | |
| parent | f753bc769b16ca9673f11a4cc06e5cc681efd84e (diff) | |
| download | rust-d3ebd232a5f6765373b8b7ef23ed5b87477fbd1e.tar.gz rust-d3ebd232a5f6765373b8b7ef23ed5b87477fbd1e.zip | |
Add test for nalgebra hang in coherence
| -rw-r--r-- | tests/ui/traits/coherence-alias-hang.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/traits/coherence-alias-hang.rs b/tests/ui/traits/coherence-alias-hang.rs new file mode 100644 index 00000000000..37b80739589 --- /dev/null +++ b/tests/ui/traits/coherence-alias-hang.rs @@ -0,0 +1,23 @@ +//@ check-pass + +// Regression test for nalgebra hang <https://github.com/rust-lang/rust/issues/130056>. + +#![feature(lazy_type_alias)] +#![allow(incomplete_features)] + +type Id<T: ?Sized> = T; +trait NotImplemented {} + +struct W<T: ?Sized, U: ?Sized>(*const T, *const U); +trait Trait { + type Assoc: ?Sized; +} +impl<T: ?Sized + Trait> Trait for W<T, T> { + type Assoc = W<T::Assoc, Id<T::Assoc>>; +} + +trait Overlap<T: ?Sized> {} +impl<T: ?Sized> Overlap<T> for W<T, T> {} +impl<T: ?Sized + Trait + NotImplemented> Overlap<T::Assoc> for T {} + +fn main() {} |
