Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for nalgebra hang in coherence #130276

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add test for nalgebra hang in coherence
compiler-errors committed Sep 12, 2024
commit d3ebd232a5f6765373b8b7ef23ed5b87477fbd1e
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() {}