rust/tests/ui/traits/next-solver/overflow/coherence-alias-hang.rs
David Wood 1fd13fddba
tests: add #![rustc_no_implicit_bounds]
After reviewing all tests with `?Sized` and discussing with lcnr, these
tests seem like they could probably benefit from
`#![rustc_no_implicit_bounds]`.
2025-06-27 05:34:08 +00:00

32 lines
699 B
Rust

//@ check-pass
//@ revisions: ai ia ii
// Regression test for nalgebra hang <https://github.com/rust-lang/rust/issues/130056>.
#![feature(lazy_type_alias)]
#![feature(rustc_attrs)]
#![rustc_no_implicit_bounds]
#![allow(incomplete_features)]
type Id<T> = T;
trait NotImplemented {}
struct W<T, U>(*const T, *const U);
trait Trait {
type Assoc;
}
impl<T: Trait> Trait for W<T, T> {
#[cfg(ai)]
type Assoc = W<T::Assoc, Id<T::Assoc>>;
#[cfg(ia)]
type Assoc = W<Id<T::Assoc>, T::Assoc>;
#[cfg(ii)]
type Assoc = W<Id<T::Assoc>, Id<T::Assoc>>;
}
trait Overlap<T> {}
impl<T> Overlap<T> for W<T, T> {}
impl<T: Trait + NotImplemented> Overlap<T::Assoc> for T {}
fn main() {}