diff options
Diffstat (limited to 'tests/ui/traits/next-solver/lazy-nested-obligations-2.rs')
-rw-r--r-- | tests/ui/traits/next-solver/lazy-nested-obligations-2.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/traits/next-solver/lazy-nested-obligations-2.rs b/tests/ui/traits/next-solver/lazy-nested-obligations-2.rs new file mode 100644 index 000000000..b85f9d973 --- /dev/null +++ b/tests/ui/traits/next-solver/lazy-nested-obligations-2.rs @@ -0,0 +1,22 @@ +// compile-flags: -Znext-solver +// check-pass + +pub trait With { + type F; +} + +impl With for i32 { + type F = fn(&str); +} + +fn f(_: &str) {} + +fn main() { + let _: V<i32> = V(f); + pub struct V<T: With>(<T as With>::F); + + pub enum E3<T: With> { + Var(<T as With>::F), + } + let _: E3<i32> = E3::Var(f); +} |