diff options
Diffstat (limited to 'tests/ui/traits/next-solver/overflow')
| -rw-r--r-- | tests/ui/traits/next-solver/overflow/coherence-alias-hang.rs | 16 | ||||
| -rw-r--r-- | tests/ui/traits/next-solver/overflow/recursion-limit-normalizes-to-constraints.rs | 8 |
2 files changed, 14 insertions, 10 deletions
diff --git a/tests/ui/traits/next-solver/overflow/coherence-alias-hang.rs b/tests/ui/traits/next-solver/overflow/coherence-alias-hang.rs index f88f74680b9..4874e2e1f99 100644 --- a/tests/ui/traits/next-solver/overflow/coherence-alias-hang.rs +++ b/tests/ui/traits/next-solver/overflow/coherence-alias-hang.rs @@ -4,16 +4,18 @@ // 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: ?Sized> = T; +type Id<T> = T; trait NotImplemented {} -struct W<T: ?Sized, U: ?Sized>(*const T, *const U); +struct W<T, U>(*const T, *const U); trait Trait { - type Assoc: ?Sized; + type Assoc; } -impl<T: ?Sized + Trait> Trait for W<T, T> { +impl<T: Trait> Trait for W<T, T> { #[cfg(ai)] type Assoc = W<T::Assoc, Id<T::Assoc>>; #[cfg(ia)] @@ -22,8 +24,8 @@ impl<T: ?Sized + Trait> Trait for W<T, T> { type Assoc = W<Id<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 {} +trait Overlap<T> {} +impl<T> Overlap<T> for W<T, T> {} +impl<T: Trait + NotImplemented> Overlap<T::Assoc> for T {} fn main() {} diff --git a/tests/ui/traits/next-solver/overflow/recursion-limit-normalizes-to-constraints.rs b/tests/ui/traits/next-solver/overflow/recursion-limit-normalizes-to-constraints.rs index dee5500aadd..e5a57a44d49 100644 --- a/tests/ui/traits/next-solver/overflow/recursion-limit-normalizes-to-constraints.rs +++ b/tests/ui/traits/next-solver/overflow/recursion-limit-normalizes-to-constraints.rs @@ -1,5 +1,7 @@ //@ compile-flags: -Znext-solver=coherence //@ check-pass +#![feature(rustc_attrs)] +#![rustc_no_implicit_bounds] // A regression test for trait-system-refactor-initiative#70. @@ -7,8 +9,8 @@ trait Trait { type Assoc; } -struct W<T: ?Sized>(*mut T); -impl<T: ?Sized> Trait for W<W<T>> +struct W<T>(*mut T); +impl<T> Trait for W<W<T>> where W<T>: Trait, { @@ -20,6 +22,6 @@ impl<T: Trait<Assoc = u32>> NoOverlap for T {} // `Projection(<W<_> as Trait>::Assoc, u32)` should result in error even // though applying the impl results in overflow. This is necessary to match // the behavior of the old solver. -impl<T: ?Sized> NoOverlap for W<T> {} +impl<T> NoOverlap for W<T> {} fn main() {} |
