Skip to content

Commit

Permalink
Rollup merge of #130276 - compiler-errors:nalgebra-hang, r=lcnr
Browse files Browse the repository at this point in the history
Add test for nalgebra hang in coherence

r? lcnr
  • Loading branch information
matthiaskrgr authored Sep 12, 2024
2 parents cb1d80d + d3ebd23 commit ed1602e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/ui/traits/coherence-alias-hang.rs
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit ed1602e

Please sign in to comment.