diff --git a/tests/test/arrays.rs b/tests/test/arrays.rs index ff5b8a3e045..5ff36e0d606 100644 --- a/tests/test/arrays.rs +++ b/tests/test/arrays.rs @@ -13,7 +13,7 @@ fn arrays_are_sized() { [u32; N]: Sized } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } @@ -35,7 +35,7 @@ fn arrays_are_copy_if_element_copy() { [Foo; N]: Copy } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -76,7 +76,7 @@ fn arrays_are_clone_if_element_clone() { [Foo; N]: Clone } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -116,7 +116,7 @@ fn arrays_are_well_formed_if_elem_sized() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { diff --git a/tests/test/auto_traits.rs b/tests/test/auto_traits.rs index d9244392b78..6fd557c006c 100644 --- a/tests/test/auto_traits.rs +++ b/tests/test/auto_traits.rs @@ -34,13 +34,13 @@ fn auto_semantics() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { List: Send } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -48,7 +48,7 @@ fn auto_semantics() { T: Send } } yields { - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } } } @@ -71,7 +71,7 @@ fn auto_trait_without_impls() { goal { TypeA: Send } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // No fields so `Useless` is `Send`. @@ -80,7 +80,7 @@ fn auto_trait_without_impls() { Useless: Send } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -90,7 +90,7 @@ fn auto_trait_without_impls() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -118,7 +118,7 @@ fn auto_trait_with_impls() { goal { TypeB: Send } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -130,7 +130,7 @@ fn auto_trait_with_impls() { goal { Vec: Send } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { diff --git a/tests/test/closures.rs b/tests/test/closures.rs index 40f8d78f78d..63c48425725 100644 --- a/tests/test/closures.rs +++ b/tests/test/closures.rs @@ -12,17 +12,17 @@ fn closure_is_well_formed() { goal { WellFormed(foo) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { WellFormed(bar) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { WellFormed(baz) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -40,7 +40,7 @@ fn closure_is_sized() { goal { foo: Sized } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -76,17 +76,17 @@ fn closure_is_copy() { goal { foo: Copy } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { bar: Copy } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { baz: Copy } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // A closure with non-Copy upvars is not copy @@ -103,7 +103,7 @@ fn closure_is_copy() { foobar<'a>: Copy } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { forall { with_ty: Copy } @@ -113,7 +113,7 @@ fn closure_is_copy() { goal { forall { if (T: Copy) { with_ty: Copy } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -132,17 +132,17 @@ fn closure_is_clone() { goal { foo: Clone } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { bar: Clone } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { baz: Clone } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -191,34 +191,34 @@ fn closure_implements_fn_traits() { goal { foo: FnOnce<()> } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { Normalize(>::Output -> ()) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // A closure with kind `Fn` implements all `Fn` traits goal { bar: Fn<()> } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { bar: FnMut<()> } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { bar: FnOnce<()> } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { Normalize(>::Output -> ()) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // A closure with kind `FnMut` implements `FnMut` and `FnOnce` @@ -230,17 +230,17 @@ fn closure_implements_fn_traits() { goal { baz: FnMut<()> } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { baz: FnOnce<()> } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { Normalize(>::Output -> ()) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // A closure also implements the `Fn` traits regardless of upvars goal { @@ -248,35 +248,35 @@ fn closure_implements_fn_traits() { foobar<'a>: FnOnce<(u8, f32)> } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { forall<'a> { Normalize( as FnOnce<(u8, f32)>>::Output -> u32) } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { forall<'a> { Normalize( as FnOnce<(u8, f32)>>::Output -> u32) } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { forall<'a> { foobuzz<'a>: FnOnce<(u8, f32)> } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { forall<'a> { Normalize( as FnOnce<(u8, f32)>>::Output -> u32) } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } diff --git a/tests/test/coherence_goals.rs b/tests/test/coherence_goals.rs index 9238fb657e4..5a18e6849ec 100644 --- a/tests/test/coherence_goals.rs +++ b/tests/test/coherence_goals.rs @@ -12,9 +12,9 @@ fn local_and_upstream_types() { } goal { IsLocal(Upstream) } yields { expect![["No possible solution"]] } - goal { IsUpstream(Upstream) } yields { expect![["Unique"]] } + goal { IsUpstream(Upstream) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } - goal { IsLocal(Local) } yields { expect![["Unique"]] } + goal { IsLocal(Local) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { IsUpstream(Local) } yields { expect![["No possible solution"]] } } @@ -29,9 +29,9 @@ fn local_and_upstream_types() { } goal { forall { IsLocal(Upstream) } } yields { expect![["No possible solution"]] } - goal { forall { IsUpstream(Upstream) } } yields { expect![["Unique"]] } + goal { forall { IsUpstream(Upstream) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } - goal { forall { IsLocal(Local) } } yields { expect![["Unique"]] } + goal { forall { IsLocal(Local) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { forall { IsUpstream(Local) } } yields { expect![["No possible solution"]] } } } @@ -49,10 +49,10 @@ fn is_fully_visible() { struct Box { } } - goal { IsFullyVisible(Upstream) } yields { expect![["Unique"]] } - goal { IsFullyVisible(Local) } yields { expect![["Unique"]] } - goal { IsFullyVisible(Box) } yields { expect![["Unique"]] } - goal { IsFullyVisible(Box) } yields { expect![["Unique"]] } + goal { IsFullyVisible(Upstream) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { IsFullyVisible(Local) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { IsFullyVisible(Box) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { IsFullyVisible(Box) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } // Should be visible regardless of local, fundamental, or upstream @@ -75,20 +75,20 @@ fn is_fully_visible() { goal { forall { IsFullyVisible(Local2) } } yields { expect![["No possible solution"]] } // Without any unknown type parameters, local and upstream should not matter - goal { forall { IsFullyVisible(Upstream2) } } yields { expect![["Unique"]] } - goal { forall { IsFullyVisible(Upstream2) } } yields { expect![["Unique"]] } - goal { forall { IsFullyVisible(Local2) } } yields { expect![["Unique"]] } - goal { forall { IsFullyVisible(Local2) } } yields { expect![["Unique"]] } + goal { forall { IsFullyVisible(Upstream2) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { IsFullyVisible(Upstream2) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { IsFullyVisible(Local2) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { IsFullyVisible(Local2) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Fundamental anywhere should not change the outcome - goal { forall { IsFullyVisible(Box>) } } yields { expect![["Unique"]] } - goal { forall { IsFullyVisible(Box>) } } yields { expect![["Unique"]] } - goal { forall { IsFullyVisible(Box>) } } yields { expect![["Unique"]] } - goal { forall { IsFullyVisible(Box>) } } yields { expect![["Unique"]] } - goal { forall { IsFullyVisible(Upstream2>) } } yields { expect![["Unique"]] } - goal { forall { IsFullyVisible(Upstream2>) } } yields { expect![["Unique"]] } - goal { forall { IsFullyVisible(Local2>) } } yields { expect![["Unique"]] } - goal { forall { IsFullyVisible(Local2>) } } yields { expect![["Unique"]] } + goal { forall { IsFullyVisible(Box>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { IsFullyVisible(Box>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { IsFullyVisible(Box>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { IsFullyVisible(Box>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { IsFullyVisible(Upstream2>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { IsFullyVisible(Upstream2>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { IsFullyVisible(Local2>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { IsFullyVisible(Local2>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -109,15 +109,15 @@ fn fundamental_types() { } // Without fundamental, Box should behave like a regular upstream type - goal { forall { not { IsLocal(Box) } } } yields { expect![["Unique"]] } + goal { forall { not { IsLocal(Box) } } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { forall { IsLocal(Box) } } yields { expect![["No possible solution"]] } - goal { forall { IsUpstream(Box) } } yields { expect![["Unique"]] } + goal { forall { IsUpstream(Box) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Without fundamental, Box is upstream regardless of its inner type goal { IsLocal(Box) } yields { expect![["No possible solution"]] } goal { IsLocal(Box) } yields { expect![["No possible solution"]] } - goal { IsUpstream(Box) } yields { expect![["Unique"]] } - goal { IsUpstream(Box) } yields { expect![["Unique"]] } + goal { IsUpstream(Box) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { IsUpstream(Box) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } test! { @@ -132,15 +132,15 @@ fn fundamental_types() { // With fundamental, Box can be local for certain types, so there is no unique solution // anymore for any of these - goal { forall { not { IsLocal(Box) } } } yields { expect![["Ambiguous"]] } + goal { forall { not { IsLocal(Box) } } } yields { expect![[r#"Ambiguous; no inference guidance"#]] } goal { forall { IsLocal(Box) } } yields { expect![["No possible solution"]] } goal { forall { IsUpstream(Box) } } yields { expect![["No possible solution"]] } // With fundamental, some of these yield different results -- no longer depends on Box // itself goal { IsLocal(Box) } yields { expect![["No possible solution"]] } - goal { IsLocal(Box) } yields { expect![["Unique"]] } - goal { IsUpstream(Box) } yields { expect![["Unique"]] } + goal { IsLocal(Box) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { IsUpstream(Box) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { IsUpstream(Box) } yields { expect![["No possible solution"]] } } @@ -160,28 +160,28 @@ fn fundamental_types() { // Upstream is upstream no matter what, so this should not be local for any T goal { forall { IsLocal(Box>) } } yields { expect![["No possible solution"]] } - goal { forall { IsUpstream(Box>) } } yields { expect![["Unique"]] } + goal { forall { IsUpstream(Box>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // A fundamental type inside an upstream type should not make a difference (i.e. the rules // for the outer, non-fundamental type should apply) goal { forall { IsLocal(Upstream>) } } yields { expect![["No possible solution"]] } - goal { forall { IsUpstream(Upstream>) } } yields { expect![["Unique"]] } + goal { forall { IsUpstream(Upstream>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Make sure internal types within an upstream type do not make a difference goal { forall { IsLocal(Box>>) } } yields { expect![["No possible solution"]] } - goal { forall { IsUpstream(Box>>) } } yields { expect![["Unique"]] } + goal { forall { IsUpstream(Box>>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Local is local no matter what, so this should be local for any T - goal { forall { IsLocal(Box>) } } yields { expect![["Unique"]] } + goal { forall { IsLocal(Box>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { forall { IsUpstream(Box>) } } yields { expect![["No possible solution"]] } // A fundamental type inside an internal type should not make a difference - goal { forall { IsLocal(Local>) } } yields { expect![["Unique"]] } + goal { forall { IsLocal(Local>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { forall { IsUpstream(Local>) } } yields { expect![["No possible solution"]] } // Make sure upstream types within an internal type and vice versa do not make a difference - goal { forall { IsLocal(Box>>) } } yields { expect![["Unique"]] } - goal { forall { IsUpstream(Box>>) } } yields { expect![["Unique"]] } + goal { forall { IsLocal(Box>>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { IsUpstream(Box>>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } // Nested fundamental types should still be local if they can be recursively proven to be local @@ -207,9 +207,9 @@ fn fundamental_types() { goal { forall { IsUpstream(Ref>) } } yields { expect![["No possible solution"]] } goal { IsLocal(Ref>) } yields { expect![["No possible solution"]] } - goal { IsUpstream(Ref>) } yields { expect![["Unique"]] } + goal { IsUpstream(Ref>) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } - goal { IsLocal(Ref>) } yields { expect![["Unique"]] } + goal { IsLocal(Ref>) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { IsUpstream(Ref>) } yields { expect![["No possible solution"]] } } @@ -224,9 +224,9 @@ fn fundamental_types() { struct Local { } } - goal { forall { IsLocal(Box) } } yields { expect![["Unique"]] } - goal { IsLocal(Box) } yields { expect![["Unique"]] } - goal { IsLocal(Box) } yields { expect![["Unique"]] } + goal { forall { IsLocal(Box) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { IsLocal(Box) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { IsLocal(Box) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -242,13 +242,13 @@ fn local_impl_allowed_for_traits() { } // Local traits are always implementable - goal { forall { LocalImplAllowed(T: LocalTrait) } } yields { expect![["Unique"]] } - goal { LocalImplAllowed(Local: LocalTrait) } yields { expect![["Unique"]] } - goal { LocalImplAllowed(Upstream: LocalTrait) } yields { expect![["Unique"]] } - goal { forall { LocalImplAllowed(T: LocalTrait2) } } yields { expect![["Unique"]] } - goal { forall { LocalImplAllowed(T: LocalTrait2) } } yields { expect![["Unique"]] } - goal { forall { LocalImplAllowed(Local: LocalTrait2) } } yields { expect![["Unique"]] } - goal { forall { LocalImplAllowed(Upstream: LocalTrait2) } } yields { expect![["Unique"]] } + goal { forall { LocalImplAllowed(T: LocalTrait) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { LocalImplAllowed(Local: LocalTrait) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { LocalImplAllowed(Upstream: LocalTrait) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { LocalImplAllowed(T: LocalTrait2) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { LocalImplAllowed(T: LocalTrait2) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { LocalImplAllowed(Local: LocalTrait2) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { LocalImplAllowed(Upstream: LocalTrait2) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } // Single-type parameter trait refs (Self only) @@ -268,7 +268,7 @@ fn local_impl_allowed_for_traits() { // Local type, not preceded by anything // Notice that the types after the first local type do not matter at all - goal { LocalImplAllowed(Local: UpstreamTrait) } yields { expect![["Unique"]] } + goal { LocalImplAllowed(Local: UpstreamTrait) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } // Multi-type parameter trait refs (Self, T) @@ -293,19 +293,19 @@ fn local_impl_allowed_for_traits() { // Local type, not preceded by anything // Notice that the types after the first local type do not matter at all - goal { forall { LocalImplAllowed(Local: UpstreamTrait2) } } yields { expect![["Unique"]] } - goal { LocalImplAllowed(Local: UpstreamTrait2) } yields { expect![["Unique"]] } - goal { LocalImplAllowed(Local: UpstreamTrait2) } yields { expect![["Unique"]] } + goal { forall { LocalImplAllowed(Local: UpstreamTrait2) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { LocalImplAllowed(Local: UpstreamTrait2) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { LocalImplAllowed(Local: UpstreamTrait2) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Local type, but preceded by a fully visible type (i.e. no placeholder types) - goal { LocalImplAllowed(Upstream: UpstreamTrait2) } yields { expect![["Unique"]] } - goal { LocalImplAllowed(Upstream2: UpstreamTrait2) } yields { expect![["Unique"]] } - goal { LocalImplAllowed(Upstream2: UpstreamTrait2) } yields { expect![["Unique"]] } + goal { LocalImplAllowed(Upstream: UpstreamTrait2) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { LocalImplAllowed(Upstream2: UpstreamTrait2) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { LocalImplAllowed(Upstream2: UpstreamTrait2) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Type parameter covered by the local type - goal { forall { LocalImplAllowed(Upstream: UpstreamTrait2>) } } yields { expect![["Unique"]] } - goal { forall { LocalImplAllowed(Upstream2: UpstreamTrait2>) } } yields { expect![["Unique"]] } - goal { forall { LocalImplAllowed(Upstream2: UpstreamTrait2>) } } yields { expect![["Unique"]] } + goal { forall { LocalImplAllowed(Upstream: UpstreamTrait2>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { LocalImplAllowed(Upstream2: UpstreamTrait2>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall { LocalImplAllowed(Upstream2: UpstreamTrait2>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Type parameter covered by a deeply nested upstream type // Notice that it does not matter that the T is wrapped in a local type because the outer @@ -331,7 +331,7 @@ fn local_impl_allowed_for_traits() { } // Local traits can be implemented regardless of the types involved - goal { forall { LocalImplAllowed(Self: InternalTrait<'a, T, U, V>) } } yields { expect![["Unique"]] } + goal { forall { LocalImplAllowed(Self: InternalTrait<'a, T, U, V>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Upstream traits definitely cannot be implemented for all types goal { forall { LocalImplAllowed(Self: UpstreamTrait<'a, T, U, V>) } } yields { expect![["No possible solution"]] } @@ -346,10 +346,10 @@ fn local_impl_allowed_for_traits() { >) } } yields { expect![["No possible solution"]] } // Local type, not preceded by anything -- types after the first local type do not matter - goal { forall<'a, T, U, V> { LocalImplAllowed(Local: UpstreamTrait<'a, T, U, V>) } } yields { expect![["Unique"]] } - goal { forall<'a, U, V> { LocalImplAllowed(Local: UpstreamTrait<'a, Local, U, V>) } } yields { expect![["Unique"]] } - goal { forall<'a, U, V> { LocalImplAllowed(Local: UpstreamTrait<'a, Upstream, U, V>) } } yields { expect![["Unique"]] } - goal { forall<'a> { LocalImplAllowed(Local: UpstreamTrait<'a, Upstream, Local, Local>) } } yields { expect![["Unique"]] } + goal { forall<'a, T, U, V> { LocalImplAllowed(Local: UpstreamTrait<'a, T, U, V>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall<'a, U, V> { LocalImplAllowed(Local: UpstreamTrait<'a, Local, U, V>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall<'a, U, V> { LocalImplAllowed(Local: UpstreamTrait<'a, Upstream, U, V>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { forall<'a> { LocalImplAllowed(Local: UpstreamTrait<'a, Upstream, Local, Local>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Local type preceded by a type that is not fully visible goal { forall<'a, T> { LocalImplAllowed(T: UpstreamTrait<'a, Upstream, Upstream, Local>) } } yields { expect![["No possible solution"]] } @@ -357,6 +357,6 @@ fn local_impl_allowed_for_traits() { goal { forall<'a, T> { LocalImplAllowed(Upstream: UpstreamTrait<'a, Upstream, T, Local>) } } yields { expect![["No possible solution"]] } // Once again, types after the first local do not matter - goal { forall<'a, T> { LocalImplAllowed(Upstream: UpstreamTrait<'a, Upstream, Local, T>) } } yields { expect![["Unique"]] } + goal { forall<'a, T> { LocalImplAllowed(Upstream: UpstreamTrait<'a, Upstream, Local, T>) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } diff --git a/tests/test/constants.rs b/tests/test/constants.rs index 70a194c1b5c..c13473a54a3 100644 --- a/tests/test/constants.rs +++ b/tests/test/constants.rs @@ -24,7 +24,7 @@ fn single_impl() { goal { S<3>: Trait } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { diff --git a/tests/test/cycle.rs b/tests/test/cycle.rs index ad8ce52ef2d..0aef80e4c8b 100644 --- a/tests/test/cycle.rs +++ b/tests/test/cycle.rs @@ -31,7 +31,7 @@ fn inner_cycle() { goal { exists { T: A } } yields { - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } } } @@ -95,7 +95,7 @@ fn cycle_unique_solution() { T: Foo } } yields { - expect![["Unique; substitution [?0 := Zero]"]] + expect![[r#"Unique; substitution [?0 := Zero], lifetime constraints []"#]] } } } @@ -141,7 +141,7 @@ fn multiple_ambiguous_cycles() { T: WF } } yields { - expect![["Ambig"]] + expect![[r#"Ambiguous; no inference guidance"#]] } } } diff --git a/tests/test/discriminant_kind.rs b/tests/test/discriminant_kind.rs index 934078ba05e..098e1490aaa 100644 --- a/tests/test/discriminant_kind.rs +++ b/tests/test/discriminant_kind.rs @@ -38,19 +38,19 @@ fn discriminant_kind_impl() { goal { A: DiscriminantKind } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { i32: DiscriminantKind } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { (i32, A): DiscriminantKind } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -58,7 +58,7 @@ fn discriminant_kind_impl() { dyn Principal + 'a: DiscriminantKind } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -99,7 +99,7 @@ fn discriminant_kind_assoc() { goal { Normalize(::Discriminant -> u8) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Same as above @@ -108,14 +108,14 @@ fn discriminant_kind_assoc() { Normalize(::Discriminant -> u8) } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Discriminant for enums with unspecified discriminant should be isize goal { Normalize(::Discriminant -> isize) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Discriminant should be the same as specified in `repr` @@ -123,25 +123,25 @@ fn discriminant_kind_assoc() { goal { Normalize(::Discriminant -> isize) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { Normalize(::Discriminant -> i32) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { Normalize(::Discriminant -> u32) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { Normalize(::Discriminant -> usize) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } //-------- @@ -149,7 +149,7 @@ fn discriminant_kind_assoc() { goal { Normalize(::Discriminant -> u32) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // Placeholders don't have a determined discriminant @@ -160,7 +160,7 @@ fn discriminant_kind_assoc() { } } } yields { - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } } } diff --git a/tests/test/existential_types.rs b/tests/test/existential_types.rs index 0fe2e852f07..9aae2173a0e 100644 --- a/tests/test/existential_types.rs +++ b/tests/test/existential_types.rs @@ -14,7 +14,7 @@ fn dyn_Clone_is_Clone() { dyn Clone + 's: Clone } } yields { - expect![["Unique; substitution []"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -50,7 +50,7 @@ fn dyn_Clone_Send_is_Send() { (dyn Clone + Send + 's): Send } } yields { - expect![["Unique; substitution []"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -101,7 +101,7 @@ fn dyn_super_trait_simple() { dyn Bar + 's: Bar } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -109,7 +109,7 @@ fn dyn_super_trait_simple() { dyn Bar + 's: Foo } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -172,7 +172,7 @@ fn dyn_super_trait_not_a_cycle() { dyn Bar + 's: Foo } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -180,7 +180,7 @@ fn dyn_super_trait_not_a_cycle() { dyn Bar + 's: Thing } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -188,7 +188,7 @@ fn dyn_super_trait_not_a_cycle() { dyn Bar + 's: Thing } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -212,7 +212,7 @@ fn dyn_super_trait_higher_ranked() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -222,7 +222,7 @@ fn dyn_super_trait_higher_ranked() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -230,7 +230,7 @@ fn dyn_super_trait_higher_ranked() { dyn Bar<'y> + 's: Foo<'x> } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -251,7 +251,7 @@ fn dyn_super_trait_non_super_trait_clause() { dyn Foo + 's: Foo } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -413,7 +413,7 @@ fn dyn_associated_type_binding() { expect![["Unique; substitution [?0 := Int(I32)], lifetime constraints []"]] } yields[SolverChoice::slg_default()] { // #234 - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } } } @@ -430,7 +430,7 @@ fn dyn_well_formed() { WellFormed(dyn MyTrait + 's) } } yields { - expect![["Unique"]] + expect![[r#"Unique; for { substitution [?0 := '^0.0], lifetime constraints [] }"#]] } } } diff --git a/tests/test/fn_def.rs b/tests/test/fn_def.rs index 7d24417b83c..9350dcb4acc 100644 --- a/tests/test/fn_def.rs +++ b/tests/test/fn_def.rs @@ -9,7 +9,7 @@ fn fn_def_is_well_formed() { goal { WellFormed(foo) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -26,7 +26,7 @@ fn fn_def_is_sized() { goal { foo: Sized } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -43,7 +43,7 @@ fn fn_def_is_copy() { goal { foo: Copy } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -60,7 +60,7 @@ fn fn_def_is_clone() { goal { foo: Clone } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -88,37 +88,37 @@ fn fn_def_implements_fn_traits() { goal { foo: Fn<()> } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { Normalize(>::Output -> ()) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { bar: Fn<(i32,)> } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { Normalize(>::Output -> ()) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { baz: Fn<(i32,)> } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { Normalize(>::Output -> u8) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -144,25 +144,25 @@ fn generic_fn_implements_fn_traits() { goal { exists { foo: Fn<(T,)> } } yields { - expect![["Unique"]] + expect![[r#"Unique; for { substitution [?0 := ^0.0], lifetime constraints [] }"#]] } goal { forall { foo: Fn<(T,)> } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { exists { Normalize( as FnOnce<(T,)>>::Output -> T) } } yields { - expect![["Unique"]] + expect![[r#"Unique; for { substitution [?0 := ^0.0], lifetime constraints [] }"#]] } goal { forall { Normalize( as FnOnce<(T,)>>::Output -> T) } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -193,13 +193,13 @@ fn fn_defs() { goal { WellFormed(baz) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { WellFormed(garply) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } @@ -221,7 +221,7 @@ fn fn_def_implied_bounds_from_env() { Bar: Foo } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } diff --git a/tests/test/foreign_types.rs b/tests/test/foreign_types.rs index 0133730c993..90570943a17 100644 --- a/tests/test/foreign_types.rs +++ b/tests/test/foreign_types.rs @@ -12,7 +12,7 @@ fn foreign_ty_trait_impl() { impl Foo for A {} } - goal { A: Foo } yields { expect![["Unique"]] } + goal { A: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -33,7 +33,7 @@ fn foreign_ty_is_well_formed() { extern type A; } - goal { WellFormed(A) } yields { expect![["Unique"]] } + goal { WellFormed(A) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -46,7 +46,7 @@ fn foreign_ty_is_not_sized() { extern type A; } - goal { not { A: Sized } } yields { expect![["Unique"]] } + goal { not { A: Sized } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -59,7 +59,7 @@ fn foreign_ty_is_not_copy() { extern type A; } - goal { not { A: Copy } } yields { expect![["Unique"]] } + goal { not { A: Copy } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -72,6 +72,6 @@ fn foreign_ty_is_not_clone() { extern type A; } - goal { not { A: Clone } } yields { expect![["Unique"]] } + goal { not { A: Clone } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } diff --git a/tests/test/generators.rs b/tests/test/generators.rs index 4cb01af0eff..a0f3368f89b 100644 --- a/tests/test/generators.rs +++ b/tests/test/generators.rs @@ -51,19 +51,19 @@ fn generator_test() { goal { WellFormed(empty_gen) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { empty_gen: Send } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { empty_gen: Generator<()> } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -71,7 +71,7 @@ fn generator_test() { gen_with_types: Generator } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -79,7 +79,7 @@ fn generator_test() { Normalize( as Generator>::Yield -> StructOne) } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -87,7 +87,7 @@ fn generator_test() { Normalize( as Generator>::Return -> NotSend) } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { diff --git a/tests/test/implied_bounds.rs b/tests/test/implied_bounds.rs index f1dcc6e2a71..cf05ec5f9bc 100644 --- a/tests/test/implied_bounds.rs +++ b/tests/test/implied_bounds.rs @@ -18,7 +18,7 @@ fn implied_bounds() { } } } yields { - expect![["Unique; substitution []"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -39,7 +39,7 @@ fn gat_implied_bounds() { } } } yields { - expect![["Unique; substitution []"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } @@ -82,7 +82,7 @@ fn gat_implied_bounds() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -102,7 +102,7 @@ fn implied_from_env() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -134,7 +134,7 @@ fn higher_ranked_implied_bounds() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } @@ -153,7 +153,7 @@ fn higher_ranked_implied_bounds() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } diff --git a/tests/test/impls.rs b/tests/test/impls.rs index f55ccaf0ec1..206d3b5b02c 100644 --- a/tests/test/impls.rs +++ b/tests/test/impls.rs @@ -111,13 +111,13 @@ fn prove_forall() { goal { forall { not { T: Marker } } } yields { - expect![["No"]] + expect![[r#"No possible solution"#]] } goal { not { forall { T: Marker } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } // If we assume `T: Marker`, then obviously `T: Marker`. @@ -216,7 +216,7 @@ fn normalize_rev_infer() { T: Identity } } yields { - expect![["Unique; substitution [?0 := A]"]] + expect![[r#"Unique; substitution [?0 := A], lifetime constraints []"#]] } } } @@ -241,7 +241,7 @@ fn normalize_rev_infer_gat() { } } yields { // T is ?1 and U is ?0, so this is surprising, but correct! (See #126.) - expect![["Unique; substitution [?0 := B, ?1 := A]"]] + expect![[r#"Unique; substitution [?0 := B, ?1 := A], lifetime constraints []"#]] } } } @@ -324,7 +324,7 @@ fn deep_success() { goal { exists { Foo: Bar } } yields { - expect![["Unique; substitution [?0 := ImplsBaz]"]] + expect![[r#"Unique; substitution [?0 := ImplsBaz], lifetime constraints []"#]] } } } @@ -374,7 +374,7 @@ fn suggested_subst() { Foo: SomeTrait } } yields { - expect![["Unique; substitution [?0 := Baz]"]] + expect![[r#"Unique; substitution [?0 := Baz], lifetime constraints []"#]] } goal { @@ -384,7 +384,7 @@ fn suggested_subst() { } } } yields { - expect![["Unique; substitution [?0 := Qux]"]] + expect![[r#"Unique; substitution [?0 := Qux], lifetime constraints []"#]] } goal { @@ -394,7 +394,7 @@ fn suggested_subst() { } } } yields { - expect![["Unique; substitution [?0 := Baz]"]] + expect![[r#"Unique; substitution [?0 := Baz], lifetime constraints []"#]] } goal { @@ -404,7 +404,7 @@ fn suggested_subst() { } } } yields { - expect![["Unique; substitution [?0 := Baz]"]] + expect![[r#"Unique; substitution [?0 := Baz], lifetime constraints []"#]] } goal { @@ -481,7 +481,7 @@ fn where_clause_trumps() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -507,7 +507,7 @@ fn inapplicable_assumption_does_not_shadow() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [?0 := A], lifetime constraints []"#]] } } } @@ -534,7 +534,7 @@ fn partial_overlap_2() { } } } yields { - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } goal { @@ -544,7 +544,7 @@ fn partial_overlap_2() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -554,7 +554,7 @@ fn partial_overlap_2() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -580,13 +580,13 @@ fn partial_overlap_3() { if (T: Foo; T: Bar) { T: Marker } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { Struct: Marker } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -605,7 +605,7 @@ fn clauses_in_if_goals() { forall { T: Foo } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -617,7 +617,7 @@ fn clauses_in_if_goals() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -627,7 +627,7 @@ fn clauses_in_if_goals() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { diff --git a/tests/test/misc.rs b/tests/test/misc.rs index cf7abb2d7eb..6b68906d034 100644 --- a/tests/test/misc.rs +++ b/tests/test/misc.rs @@ -258,10 +258,7 @@ fn basic_region_constraint_from_positive_impl() { goal { forall<'a, 'b, T> { Ref<'a, 'b, T>: Foo } } yields_all[SolverChoice::slg(3, None)] { - expect![["substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 } \ - ]"]] + expect![[r#"substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"#]] } } } @@ -750,9 +747,9 @@ fn empty_definite_guidance() { // isn't that important -- this is mainly a regression test for a // recursive solver infinite loop. } yields[SolverChoice::slg_default()] { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } yields[SolverChoice::recursive_default()] { - expect![["Ambiguous"]] + expect![[r#"Ambiguous; suggested substitution []"#]] } } } @@ -775,7 +772,7 @@ fn ambiguous_unification_in_fn() { MyClosure ()>: FnOnce<(&'static T,)> } } yields { - expect![["Unique"]] + expect![[r#"Unique; for { substitution [?0 := ^0.0, ?1 := ^0.0], lifetime constraints [InEnvironment { environment: Env([]), goal: 'static: 'static }, InEnvironment { environment: Env([]), goal: 'static: 'static }] }"#]] } } } @@ -823,7 +820,7 @@ fn env_bound_vars() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; for { substitution [?0 := '^0.0], lifetime constraints [InEnvironment { environment: Env([]), goal: 0: '^0.0 }] }"#]] } } } diff --git a/tests/test/mod.rs b/tests/test/mod.rs index 5e28ae143a9..a7498362c28 100644 --- a/tests/test/mod.rs +++ b/tests/test/mod.rs @@ -1,5 +1,7 @@ #![allow(non_snake_case)] +use std::collections::HashMap; + use expect_test::{Expect, expect}; use crate::test_util::assert_same; @@ -288,10 +290,10 @@ fn solve_goal(program_text: &str, goals: Vec<(&str, SolverChoice, TestGoal)>, co println!("using solver: {:?}", solver_choice); let peeled_goal = goal.into_peeled_goal(db.interner()); - match &expected { + match expected { TestGoal::Aggregated(expected) => { let result = db.solve(&peeled_goal); - assert_result(result, expected, db.interner()); + assert_result(result, &expected, db.interner()); } TestGoal::All(expected) => { let mut expected = expected.into_iter(); diff --git a/tests/test/negation.rs b/tests/test/negation.rs index c271337d484..42cada3c26e 100644 --- a/tests/test/negation.rs +++ b/tests/test/negation.rs @@ -13,7 +13,7 @@ fn simple_negation() { goal { not { Bar: Foo } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -21,7 +21,7 @@ fn simple_negation() { not { Bar: Foo } } } yields { - expect![["No"]] + expect![[r#"No possible solution"#]] } goal { @@ -31,7 +31,7 @@ fn simple_negation() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -39,7 +39,7 @@ fn simple_negation() { not { T: Foo } } } yields { - expect![["Ambig"]] + expect![[r#"Ambiguous; no inference guidance"#]] } goal { @@ -47,7 +47,7 @@ fn simple_negation() { not { T: Foo } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -55,7 +55,7 @@ fn simple_negation() { exists { T: Foo } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -63,7 +63,7 @@ fn simple_negation() { forall { T: Foo } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -84,7 +84,7 @@ fn deep_negation() { exists { T: Baz } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -92,7 +92,7 @@ fn deep_negation() { exists { Foo: Bar } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -112,7 +112,7 @@ fn negation_quantifiers() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -122,7 +122,7 @@ fn negation_quantifiers() { } } } yields { - expect![["No"]] + expect![[r#"No possible solution"#]] } goal { @@ -132,7 +132,7 @@ fn negation_quantifiers() { } } } yields { - expect![["No"]] + expect![[r#"No possible solution"#]] } } } @@ -153,7 +153,7 @@ fn negation_free_vars() { not { Vec: Foo } } } yields { - expect![["Ambig"]] + expect![[r#"Ambiguous; no inference guidance"#]] } } } diff --git a/tests/test/never.rs b/tests/test/never.rs index ffd39b57243..bdbc8280815 100644 --- a/tests/test/never.rs +++ b/tests/test/never.rs @@ -6,7 +6,7 @@ fn never_is_well_formed() { goal { WellFormed(!) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -21,7 +21,7 @@ fn never_is_sized() { goal { !: Sized } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } diff --git a/tests/test/numerics.rs b/tests/test/numerics.rs index c865e77d932..45ecb37f3b9 100644 --- a/tests/test/numerics.rs +++ b/tests/test/numerics.rs @@ -28,7 +28,7 @@ fn integer_index() { Slice: Index } } yields { - expect![["Unique; substitution [?0 := Uint(Usize)]"]] + expect![[r#"Unique; substitution [?0 := Uint(Usize)], lifetime constraints []"#]] } } } @@ -54,7 +54,7 @@ fn integer_kind_trait() { N: Foo } } yields { - expect![["Unique; substitution [?0 := Uint(Usize)]"]] + expect![[r#"Unique; substitution [?0 := Uint(Usize)], lifetime constraints []"#]] } } } @@ -77,7 +77,7 @@ fn float_kind_trait() { N: Foo } } yields { - expect![["Unique; substitution [?0 := Float(F32)]"]] + expect![[r#"Unique; substitution [?0 := Float(F32)], lifetime constraints []"#]] } } } @@ -197,7 +197,7 @@ fn integers_are_copy() { I: Copy } } yields { - expect![["Unique"]] + expect![[r#"Unique; for { substitution [?0 := ^0.0], lifetime constraints [] }"#]] } } } @@ -215,7 +215,7 @@ fn integers_are_sized() { I: Sized } } yields { - expect![["Unique"]] + expect![[r#"Unique; for { substitution [?0 := ^0.0], lifetime constraints [] }"#]] } } } @@ -261,7 +261,7 @@ fn shl_ice() { u32: Shl } } yields { - expect![["Ambiguous"]] + expect![[r#"Ambiguous; definite substitution for { [?0 := (&'^0.0 ^0.1)] }"#]] } } } @@ -284,7 +284,7 @@ fn unify_general_then_specific_ty() { Bar<(N, T, T, T)>: Foo } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [?0 := Int(I32), ?1 := Int(I32)], lifetime constraints []"#]] } } } diff --git a/tests/test/object_safe.rs b/tests/test/object_safe.rs index 52839a7c2fb..7bf23131e2e 100644 --- a/tests/test/object_safe.rs +++ b/tests/test/object_safe.rs @@ -9,7 +9,7 @@ fn object_safe_flag() { trait Bar {} } - goal { ObjectSafe(Foo) } yields { expect![["Unique"]] } - goal { not { ObjectSafe(Bar) } } yields { expect![["Unique"]] } + goal { ObjectSafe(Foo) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { not { ObjectSafe(Bar) } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } diff --git a/tests/test/opaque_types.rs b/tests/test/opaque_types.rs index b3c9245cff7..91c96f016be 100644 --- a/tests/test/opaque_types.rs +++ b/tests/test/opaque_types.rs @@ -16,7 +16,7 @@ fn opaque_bounds() { goal { T: Clone } yields { - expect![["Unique; substitution []"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -39,7 +39,7 @@ fn opaque_reveal() { T: Trait } } yields { - expect![["Unique; substitution []"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -77,7 +77,7 @@ fn opaque_where_clause() { WellFormed(T) } } yields { - expect![["Unique; substitution []"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -93,7 +93,7 @@ fn opaque_where_clause() { } } } yields { - expect![["Unique; substitution []"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -124,7 +124,7 @@ fn opaque_generics_simple() { goal { Foo: Iterator } yields { - expect![["Unique; substitution []"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } @@ -149,7 +149,7 @@ fn opaque_generics() { goal { Foo: Iterator } yields { - expect![["Unique; substitution []"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -157,7 +157,7 @@ fn opaque_generics() { Foo: Iterator } } yields { - expect![["Unique; substitution []"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -165,7 +165,7 @@ fn opaque_generics() { as Iterator>::Item = T } } yields[SolverChoice::slg_default()] { - expect![["Ambiguous"]] // #234 + expect![[r#"Ambiguous; no inference guidance"#]] // #234 } yields[SolverChoice::recursive_default()] { expect![["Unique; substitution [?0 := Bar], lifetime constraints []"]] } @@ -188,7 +188,7 @@ fn opaque_trait_generic() { Bar: Trait } } yields { - expect![["Unique; substitution [?0 := Uint(U32)]"]] + expect![[r#"Unique; substitution [?0 := Uint(U32)], lifetime constraints []"#]] } } } @@ -216,7 +216,7 @@ fn opaque_auto_traits() { goal { Opaque1: Send } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -253,7 +253,7 @@ fn opaque_auto_traits_indirect() { goal { Opaque1: SendDerived } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -279,7 +279,7 @@ fn opaque_super_trait() { goal { Opaque: Base } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } diff --git a/tests/test/projection.rs b/tests/test/projection.rs index 3ce3ead325a..45c6f91fa7b 100644 --- a/tests/test/projection.rs +++ b/tests/test/projection.rs @@ -39,7 +39,7 @@ fn normalize_basic() { } } } yields { - expect![["Unique; substitution []"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -51,7 +51,7 @@ fn normalize_basic() { } } } yields { - expect![["Unique; substitution [?0 := (Iterator::Item)]"]] + expect![[r#"Unique; substitution [?0 := (Iterator::Item)], lifetime constraints []"#]] } goal { @@ -63,7 +63,7 @@ fn normalize_basic() { } } } yields { - expect![["Unique; substitution [?0 := (Iterator::Item)]"]] + expect![[r#"Unique; substitution [?0 := (Iterator::Item)], lifetime constraints []"#]] } goal { @@ -73,7 +73,7 @@ fn normalize_basic() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -86,7 +86,7 @@ fn normalize_basic() { } } yields { // True for `U = T`, of course, but also true for `U = Vec<::Item>`. - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } } } @@ -114,7 +114,7 @@ fn normalize_into_iterator() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [?0 := !1_0], lifetime constraints []"#]] } } } @@ -141,9 +141,9 @@ fn projection_equality() { } } yields[SolverChoice::slg_default()] { // this is wrong, chalk#234 - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } yields[SolverChoice::recursive_default()] { - expect![["Unique; substitution [?0 := Uint(U32)]"]] + expect![[r#"Unique; substitution [?0 := Uint(U32)], lifetime constraints []"#]] } goal { @@ -152,9 +152,9 @@ fn projection_equality() { } } yields[SolverChoice::slg_default()] { // this is wrong, chalk#234 - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } yields[SolverChoice::recursive_default()] { - expect![["Unique; substitution [?0 := Uint(U32)]"]] + expect![[r#"Unique; substitution [?0 := Uint(U32)], lifetime constraints []"#]] } } } @@ -182,7 +182,7 @@ fn projection_equality_priority1() { } } yields[SolverChoice::slg_default()] { // this is wrong, chalk#234 - expect![["Ambiguous"]] + expect![[r#"Ambiguous; definite substitution for { [?0 := S2, ?1 := ^0.0] }"#]] } yields[SolverChoice::recursive_default()] { // This is.. interesting, but not necessarily wrong. // It's certainly true that based on the impls we see @@ -194,7 +194,7 @@ fn projection_equality_priority1() { // constrained `T` at all? I can't come up with // an example where that's the case, so maybe // not. -Niko - expect![["Unique; substitution [?0 := S2, ?1 := Uint(U32)]"]] + expect![[r#"Unique; substitution [?0 := S2, ?1 := Uint(U32)], lifetime constraints []"#]] } } } @@ -297,9 +297,9 @@ fn projection_equality_from_env() { } } yields[SolverChoice::slg_default()] { // this is wrong, chalk#234 - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } yields[SolverChoice::recursive_default()] { - expect![["Unique; substitution [?0 := Uint(U32)]"]] + expect![[r#"Unique; substitution [?0 := Uint(U32)], lifetime constraints []"#]] } } } @@ -325,9 +325,9 @@ fn projection_equality_nested() { } } yields[SolverChoice::slg_default()] { // this is wrong, chalk#234 - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } yields[SolverChoice::recursive_default()] { - expect![["Unique; substitution [?0 := Uint(U32)]"]] + expect![[r#"Unique; substitution [?0 := Uint(U32)], lifetime constraints []"#]] } } } @@ -367,9 +367,9 @@ fn iterator_flatten() { } } yields[SolverChoice::slg_default()] { // this is wrong, chalk#234 - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } yields[SolverChoice::recursive_default()] { - expect![["Unique; substitution [?0 := Uint(U32)]"]] + expect![[r#"Unique; substitution [?0 := Uint(U32)], lifetime constraints []"#]] } } } @@ -534,7 +534,7 @@ fn normalize_gat_with_where_clause() { } } } yields { - expect![["Unique; substitution [?0 := Value]"]] + expect![[r#"Unique; substitution [?0 := Value], lifetime constraints []"#]] } } } @@ -573,7 +573,7 @@ fn normalize_gat_with_where_clause2() { } } } yields { - expect![["Unique; substitution [?0 := !1_1]"]] + expect![[r#"Unique; substitution [?0 := !1_1], lifetime constraints []"#]] } } } @@ -719,7 +719,7 @@ fn normalize_under_binder() { } } yields[SolverChoice::slg_default()] { // chalk#234, I think - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } yields[SolverChoice::recursive_default()] { expect![["Unique; substitution [?0 := I32], lifetime constraints []"]] } @@ -742,7 +742,7 @@ fn normalize_under_binder() { } } yields[SolverChoice::slg_default()] { // chalk#234, I think - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } yields[SolverChoice::recursive_default()] { expect![["Unique; substitution [?0 := Ref<'!1_0, I32>], lifetime constraints []"]] } @@ -846,7 +846,7 @@ fn projection_from_env_a() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -901,7 +901,7 @@ fn projection_from_env_slow() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -934,7 +934,7 @@ fn gat_unify_with_implied_wc() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -1012,7 +1012,7 @@ fn issue_144_regression() { } } } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } diff --git a/tests/test/scalars.rs b/tests/test/scalars.rs index 3513c158924..c1d1a0c2c28 100644 --- a/tests/test/scalars.rs +++ b/tests/test/scalars.rs @@ -14,13 +14,13 @@ fn scalar_in_tuple_trait_impl() { goal { (usize, usize): Foo } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { (usize, isize): Foo } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -32,7 +32,7 @@ fn scalar_in_tuple_trait_impl() { goal { (usize, usize, usize): Foo } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { @@ -76,22 +76,22 @@ fn scalar_trait_impl() { } - goal { i8: Foo } yields { expect![["Unique"]] } - goal { i16: Foo } yields { expect![["Unique"]] } - goal { i32: Foo } yields { expect![["Unique"]] } - goal { i64: Foo } yields { expect![["Unique"]] } - goal { i128: Foo } yields { expect![["Unique"]] } - goal { isize: Foo } yields { expect![["Unique"]] } - goal { u8: Foo } yields { expect![["Unique"]] } - goal { u16: Foo } yields { expect![["Unique"]] } - goal { u32: Foo } yields { expect![["Unique"]] } - goal { u64: Foo } yields { expect![["Unique"]] } - goal { u128: Foo } yields { expect![["Unique"]] } - goal { usize: Foo } yields { expect![["Unique"]] } - goal { f32: Foo } yields { expect![["Unique"]] } - goal { f64: Foo } yields { expect![["Unique"]] } - goal { bool: Foo } yields { expect![["Unique"]] } - goal { char: Foo } yields { expect![["Unique"]] } + goal { i8: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { i16: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { i32: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { i64: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { i128: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { isize: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u8: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u16: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u32: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u64: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u128: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { usize: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { f32: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { f64: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { bool: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { char: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { i8: UnsignedFoo } yields { expect![["No possible solution"]] } goal { i16: UnsignedFoo } yields { expect![["No possible solution"]] } @@ -99,12 +99,12 @@ fn scalar_trait_impl() { goal { i64: UnsignedFoo } yields { expect![["No possible solution"]] } goal { i128: UnsignedFoo } yields { expect![["No possible solution"]] } goal { isize: UnsignedFoo } yields { expect![["No possible solution"]] } - goal { u8: UnsignedFoo } yields { expect![["Unique"]] } - goal { u16: UnsignedFoo } yields { expect![["Unique"]] } - goal { u32: UnsignedFoo } yields { expect![["Unique"]] } - goal { u64: UnsignedFoo } yields { expect![["Unique"]] } - goal { u128: UnsignedFoo } yields { expect![["Unique"]] } - goal { usize: UnsignedFoo } yields { expect![["Unique"]] } + goal { u8: UnsignedFoo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u16: UnsignedFoo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u32: UnsignedFoo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u64: UnsignedFoo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u128: UnsignedFoo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { usize: UnsignedFoo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { f32: UnsignedFoo } yields { expect![["No possible solution"]] } goal { f64: UnsignedFoo } yields { expect![["No possible solution"]] } goal { bool: UnsignedFoo } yields { expect![["No possible solution"]] } @@ -116,22 +116,22 @@ fn scalar_trait_impl() { #[test] fn scalars_are_well_formed() { test! { - goal { WellFormed(i8) } yields { expect![["Unique"]] } - goal { WellFormed(i16) } yields { expect![["Unique"]] } - goal { WellFormed(i32) } yields { expect![["Unique"]] } - goal { WellFormed(i64) } yields { expect![["Unique"]] } - goal { WellFormed(i128) } yields { expect![["Unique"]] } - goal { WellFormed(isize) } yields { expect![["Unique"]] } - goal { WellFormed(u8) } yields { expect![["Unique"]] } - goal { WellFormed(u16) } yields { expect![["Unique"]] } - goal { WellFormed(u32) } yields { expect![["Unique"]] } - goal { WellFormed(u64) } yields { expect![["Unique"]] } - goal { WellFormed(u128) } yields { expect![["Unique"]] } - goal { WellFormed(usize) } yields { expect![["Unique"]] } - goal { WellFormed(f32) } yields { expect![["Unique"]] } - goal { WellFormed(f64) } yields { expect![["Unique"]] } - goal { WellFormed(bool) } yields { expect![["Unique"]] } - goal { WellFormed(char) } yields { expect![["Unique"]] } + goal { WellFormed(i8) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(i16) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(i32) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(i64) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(i128) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(isize) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(u8) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(u16) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(u32) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(u64) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(u128) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(usize) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(f32) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(f64) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(bool) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { WellFormed(char) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -142,21 +142,21 @@ fn scalars_are_sized() { #[lang(sized)] trait Sized { } } - goal { i8: Sized } yields { expect![["Unique"]] } - goal { i16: Sized } yields { expect![["Unique"]] } - goal { i32: Sized } yields { expect![["Unique"]] } - goal { i64: Sized } yields { expect![["Unique"]] } - goal { i128: Sized } yields { expect![["Unique"]] } - goal { isize: Sized } yields { expect![["Unique"]] } - goal { u8: Sized } yields { expect![["Unique"]] } - goal { u16: Sized } yields { expect![["Unique"]] } - goal { u32: Sized } yields { expect![["Unique"]] } - goal { u64: Sized } yields { expect![["Unique"]] } - goal { u128: Sized } yields { expect![["Unique"]] } - goal { usize: Sized } yields { expect![["Unique"]] } - goal { f32: Sized } yields { expect![["Unique"]] } - goal { f64: Sized } yields { expect![["Unique"]] } - goal { bool: Sized } yields { expect![["Unique"]] } - goal { char: Sized } yields { expect![["Unique"]] } + goal { i8: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { i16: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { i32: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { i64: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { i128: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { isize: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u8: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u16: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u32: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u64: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { u128: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { usize: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { f32: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { f64: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { bool: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } + goal { char: Sized } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } diff --git a/tests/test/string.rs b/tests/test/string.rs index 355a0af60e0..bb50ead0c06 100644 --- a/tests/test/string.rs +++ b/tests/test/string.rs @@ -8,14 +8,14 @@ fn str_trait_impl() { impl Foo for str {} } - goal { str: Foo } yields { expect![["Unique"]] } + goal { str: Foo } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } #[test] fn str_is_well_formed() { test! { - goal { WellFormed(str) } yields { expect![["Unique"]] } + goal { WellFormed(str) } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -26,7 +26,7 @@ fn str_is_not_sized() { #[lang(sized)] trait Sized {} } - goal { not { str: Sized } } yields { expect![["Unique"]] } + goal { not { str: Sized } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -37,7 +37,7 @@ fn str_is_not_copy() { #[lang(copy)] trait Copy {} } - goal { not { str: Copy } } yields { expect![["Unique"]] } + goal { not { str: Copy } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -48,6 +48,6 @@ fn str_is_not_clone() { #[lang(clone)] trait Clone {} } - goal { not { str: Clone } } yields { expect![["Unique"]] } + goal { not { str: Clone } } yields { expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } diff --git a/tests/test/subtype.rs b/tests/test/subtype.rs index f70bebfbc72..25273cb3ae2 100644 --- a/tests/test/subtype.rs +++ b/tests/test/subtype.rs @@ -24,7 +24,7 @@ fn subtype_simple() { goal { Subtype(Foo, Foo) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -44,9 +44,7 @@ fn struct_lifetime_variance() { Subtype(Foo<'a>, Foo<'b>) } } yields { - expect![["Unique; substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 } \ - ]"]] + expect![[r#"Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"#]] } } } @@ -61,9 +59,7 @@ fn ref_lifetime_variance() { } } yields { // Seems good! - expect![["Unique; substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 } \ - ]"]] + expect![[r#"Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }]"#]] } } } @@ -98,20 +94,12 @@ fn fn_lifetime_variance_with_return_type() { Subtype(for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32, for<'a> fn(&'a u32, &'a u32) -> &'a u32) } yields { // TODO: are these results actually correct? - expect![["Unique; for { substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.1 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 } \ - ]}"]] + expect![[r#"Unique; for { substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_0: '^0.1 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }] }"#]] } goal { Subtype(for<'a> fn(&'a u32, &'a u32) -> &'a u32, for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32) } yields { - expect![["Unique; for { substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 } \ - ] }"]] + expect![[r#"Unique; for { substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }] }"#]] } } } @@ -159,10 +147,7 @@ fn multi_lifetime() { // This is incorrect, as we shouldn't be requiring 'a and 'b to be // related to eachother. Instead, U should be &'?1 u32, with constraints // ?1 : 'a, ?1: 'b. - expect![["Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 } \ - ]}"]] + expect![[r#"Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }] }"#]] } } } @@ -189,10 +174,7 @@ fn multi_lifetime_inverted() { // This is incorrect, as we shouldn't be requiring 'a and 'b to be // related to eachother. Instead, U should be &'?1 u32, with constraints // ?1 : 'a, ?1: 'b. - expect![["Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 } \ - ]}"]] + expect![[r#"Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 }] }"#]] } } } @@ -215,10 +197,7 @@ fn multi_lifetime_covariant_struct() { } } yields { // Result should be identical to multi_lifetime result. - expect![["Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 } \ - ]}"]] + expect![[r#"Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }] }"#]] } goal { forall<'a, 'b> { @@ -229,10 +208,7 @@ fn multi_lifetime_covariant_struct() { } } yields { // Result should be identical to multi_lifetime result. - expect![["Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 } \ - ]}"]] + expect![[r#"Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 }] }"#]] } } } @@ -255,10 +231,7 @@ fn multi_lifetime_contravariant_struct() { } } yields { // Result should be opposite multi_lifetime result. - expect![["Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 } \ - ]}"]] + expect![[r#"Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 }] }"#]] } goal { forall<'a, 'b> { @@ -269,10 +242,7 @@ fn multi_lifetime_contravariant_struct() { } } yields { // Result should be opposite multi_lifetime result. - expect![["Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 } \ - ]}"]] + expect![[r#"Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }] }"#]] } } } @@ -295,16 +265,10 @@ fn multi_lifetime_invariant_struct() { } } yields[SolverChoice::recursive_default()] { // Because A is invariant, we require the lifetimes to be equal - expect![["Unique; substitution [?0 := (&'!1_0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 } \ - ]"]] + expect![[r#"Unique; substitution [?0 := (&'!1_0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"#]] } yields[SolverChoice::slg_default()] { // Because A is invariant, we require the lifetimes to be equal - expect![["Unique; substitution [?0 := (&'!1_1 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 } \ - ]"]] + expect![[r#"Unique; substitution [?0 := (&'!1_1 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"#]] } goal { @@ -316,16 +280,10 @@ fn multi_lifetime_invariant_struct() { } } yields[SolverChoice::recursive_default()] { // Because A is invariant, we require the lifetimes to be equal - expect![["Unique; substitution [?0 := (&'!1_0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 } \ - ]"]] + expect![[r#"Unique; substitution [?0 := (&'!1_0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"#]] } yields[SolverChoice::slg_default()] { // Because A is invariant, we require the lifetimes to be equal - expect![["Unique; substitution [?0 := (&'!1_1 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 } \ - ]"]] + expect![[r#"Unique; substitution [?0 := (&'!1_1 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"#]] } } } @@ -343,10 +301,7 @@ fn multi_lifetime_slice() { } } yields { // Result should be identical to multi_lifetime result. - expect![["Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 } \ - ]}"]] + expect![[r#"Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }] }"#]] } goal { forall<'a, 'b> { @@ -357,10 +312,7 @@ fn multi_lifetime_slice() { } } yields { // Result should be identical to multi_lifetime result. - expect![["Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 } \ - ]}"]] + expect![[r#"Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 }] }"#]] } } } @@ -378,10 +330,7 @@ fn multi_lifetime_tuple() { } } yields { // Result should be identical to multi_lifetime result. - expect![["Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 } \ - ]}"]] + expect![[r#"Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }] }"#]] } goal { forall<'a, 'b> { @@ -392,10 +341,7 @@ fn multi_lifetime_tuple() { } } yields { // Result should be identical to multi_lifetime result. - expect![["Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 } \ - ]}"]] + expect![[r#"Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 }] }"#]] } } } @@ -413,10 +359,7 @@ fn multi_lifetime_array() { } } yields { // Result should be identical to multi_lifetime result. - expect![["Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 } \ - ]}"]] + expect![[r#"Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }] }"#]] } goal { forall<'a, 'b> { @@ -427,10 +370,7 @@ fn multi_lifetime_array() { } } yields { // Result should be identical to multi_lifetime result. - expect![["Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 } \ - ]}"]] + expect![[r#"Unique; for { substitution [?0 := (&'^0.0 Uint(U32))], lifetime constraints [InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 }] }"#]] } } } @@ -452,10 +392,7 @@ fn generalize_covariant_struct() { } } } yields { - expect![["Unique; for { substitution [?0 := Foo<(&'^0.0 Uint(U32))>], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 } \ - ] }"]] + expect![[r#"Unique; for { substitution [?0 := Foo<(&'^0.0 Uint(U32))>], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }] }"#]] } } } @@ -478,10 +415,7 @@ fn generalize_contravariant_struct() { } } yields { // Result should be opposite generalize_covariant_struct result. - expect![["Unique; for { substitution [?0 := Foo<(&'^0.0 Uint(U32))>], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 } \ - ] }"]] + expect![[r#"Unique; for { substitution [?0 := Foo<(&'^0.0 Uint(U32))>], lifetime constraints [InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 }] }"#]] } } } @@ -504,15 +438,9 @@ fn generalize_invariant_struct() { } } yields[SolverChoice::recursive_default()] { // Because A is invariant, we require the lifetimes to be equal - expect![["Unique; substitution [?0 := Foo<(&'!1_0 Uint(U32))>], lifetime constraints [ \ - InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 } \ - ]"]] + expect![[r#"Unique; substitution [?0 := Foo<(&'!1_0 Uint(U32))>], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"#]] } yields[SolverChoice::slg_default()] { - expect![["Unique; substitution [?0 := Foo<(&'!1_1 Uint(U32))>], lifetime constraints [ \ - InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 } \ - ]"]] + expect![[r#"Unique; substitution [?0 := Foo<(&'!1_1 Uint(U32))>], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"#]] } } } @@ -530,7 +458,7 @@ fn generalize_slice() { } } yields { // Result should be identical to generalize_covariant_struct result. - expect![["Unique; for { substitution [?0 := [(&'^0.0 Uint(U32))]], lifetime constraints [\ + expect![[r#"Unique; for { substitution [?0 := [(&'^0.0 Uint(U32))]], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }] }"#]], lifetime constraints [\ InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 } \ ] }"]] @@ -544,7 +472,7 @@ fn generalize_slice() { } } yields { // Result should be identical to generalize_covariant_struct result. - expect![["Unique; for { substitution [?0 := [(&'^0.0 Uint(U32))]], lifetime constraints [\ + expect![[r#"Unique; for { substitution [?0 := [(&'^0.0 Uint(U32))]], lifetime constraints [InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 }] }"#]], lifetime constraints [\ InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 } \ ] }"]] @@ -565,10 +493,7 @@ fn generalize_tuple() { } } yields { // Result should be identical to generalize_covariant_struct result. - expect![["Unique; for { substitution [?0 := 1<(&'^0.0 Uint(U32))>], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 } \ - ] }"]] + expect![[r#"Unique; for { substitution [?0 := 1<(&'^0.0 Uint(U32))>], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }] }"#]] } goal { forall<'a, 'b> { @@ -579,10 +504,7 @@ fn generalize_tuple() { } } yields { // Result should be identical to generalize_covariant_struct result. - expect![["Unique; for { substitution [?0 := 1<(&'^0.0 Uint(U32))>], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 } \ - ] }"]] + expect![[r#"Unique; for { substitution [?0 := 1<(&'^0.0 Uint(U32))>], lifetime constraints [InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 }] }"#]] } } } @@ -599,12 +521,7 @@ fn generalize_2tuple() { } } } yields { - expect![["Unique; for { substitution [?0 := 2<(&'^0.0 Uint(U32)), (&'^0.1 Uint(U32))>], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_2: '^0.1 }, \ - InEnvironment { environment: Env([]), goal: '!1_3: '^0.1 } \ - ] }"]] + expect![[r#"Unique; for { substitution [?0 := 2<(&'^0.0 Uint(U32)), (&'^0.1 Uint(U32))>], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_2: '^0.1 }, InEnvironment { environment: Env([]), goal: '!1_3: '^0.1 }] }"#]] } goal { forall<'a, 'b, 'c, 'd> { @@ -614,12 +531,7 @@ fn generalize_2tuple() { } } } yields { - expect![["Unique; for { substitution [?0 := 2<(&'^0.0 Uint(U32)), (&'^0.1 Uint(U32))>], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 }, \ - InEnvironment { environment: Env([]), goal: '^0.1: '!1_2 }, \ - InEnvironment { environment: Env([]), goal: '^0.1: '!1_3 } \ - ] }"]] + expect![[r#"Unique; for { substitution [?0 := 2<(&'^0.0 Uint(U32)), (&'^0.1 Uint(U32))>], lifetime constraints [InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 }, InEnvironment { environment: Env([]), goal: '^0.1: '!1_2 }, InEnvironment { environment: Env([]), goal: '^0.1: '!1_3 }] }"#]] } } } @@ -637,7 +549,7 @@ fn generalize_array() { } } yields { // Result should be identical to generalize_covariant_struct result. - expect![["Unique; for { substitution [?0 := [(&'^0.0 Uint(U32)); 16]], lifetime constraints [\ + expect![[r#"Unique; for { substitution [?0 := [(&'^0.0 Uint(U32)); 16]], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }] }"#]], lifetime constraints [\ InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 } \ ] }"]] @@ -652,7 +564,7 @@ fn generalize_array() { } } yields { // Result should be identical to generalize_covariant_struct result. - expect![["Unique; for { substitution [?0 := [(&'^0.0 Uint(U32)); 16]], lifetime constraints [\ + expect![[r#"Unique; for { substitution [?0 := [(&'^0.0 Uint(U32)); 16]], lifetime constraints [InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 }] }"#]], lifetime constraints [\ InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 } \ ] }"]] diff --git a/tests/test/tuples.rs b/tests/test/tuples.rs index 6770ee7dc60..632ad8b0b9a 100644 --- a/tests/test/tuples.rs +++ b/tests/test/tuples.rs @@ -12,13 +12,13 @@ fn tuple_trait_impl() { goal { (S1, S1): Foo } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { (): Foo } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } test! { @@ -30,7 +30,7 @@ fn tuple_trait_impl() { goal { (i32, i32, (i32, )): Foo } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -86,7 +86,7 @@ fn tuples_are_copy() { goal { exists { (T, u8): Copy } } yields { - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } goal { @@ -220,7 +220,7 @@ fn tuples_are_clone() { goal { exists { (T, u8): Clone } } yields { - expect![["Ambiguous"]] + expect![[r#"Ambiguous; no inference guidance"#]] } goal { diff --git a/tests/test/unify.rs b/tests/test/unify.rs index 8605994f3e3..2e501cb2868 100644 --- a/tests/test/unify.rs +++ b/tests/test/unify.rs @@ -21,11 +21,7 @@ fn region_equality() { Ref<'a, Unit>: Eq> } } yields { - expect![["Unique; substitution [], - lifetime constraints \ - [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }] - "]] + expect![[r#"Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"#]] } goal { @@ -247,7 +243,7 @@ fn equality_binder() { } } } yields { - expect![["]]Unique; for { \ + expect![[r#"Unique; for { substitution [?0 := '^0.0], lifetime constraints [InEnvironment { environment: Env([]), goal: '!2_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '^0.0: '!2_0 }] }"#]]Unique; for { \ substitution [?0 := '^0.0], \ lifetime constraints [\ InEnvironment { environment: Env([]), goal: '!2_0: '^0.0 }, \ @@ -301,10 +297,7 @@ fn mixed_indices_unify() { } } } yields { - expect![["Unique; for { \ - substitution [?0 := '^0.0, ?1 := ^0.1, ?2 := ^0.1], \ - lifetime constraints []\ - }"]] + expect![[r#"Unique; for { substitution [?0 := '^0.0, ?1 := ^0.1, ?2 := ^0.1], lifetime constraints [] }"#]] } } } @@ -359,7 +352,7 @@ fn mixed_indices_normalize_application() { } } } yields { - expect![["Unique; for { substitution [?0 := '^0.0, ?1 := ^0.1, ?2 := ^0.1], "]] + expect![[r#"Unique; for { substitution [?0 := '^0.0, ?1 := ^0.1, ?2 := ^0.1], lifetime constraints [] }"#]] } } } @@ -386,8 +379,7 @@ fn mixed_indices_normalize_gat_application() { } yields { // Our GAT parameter is mapped to ?0; all others appear left to right // in our Normalize(...) goal. - expect![["Unique; for { \ - substitution [?0 := ^0.0, ?1 := '^0.1, ?2 := ^0.2, ?3 := ^0.0, ?4 := ^0.2], "]] + expect![[r#"Unique; for { substitution [?0 := ^0.0, ?1 := '^0.1, ?2 := ^0.2, ?3 := ^0.0, ?4 := ^0.2], lifetime constraints [] }"#]] } } } @@ -405,13 +397,13 @@ fn quantified_types() { goal { for<'a> fn(fn1<'a>): Foo } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { for<'a, 'b> fn(fn2<'a, 'b>) = for<'b, 'a> fn(fn2<'a, 'b>) } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { diff --git a/tests/test/unpin.rs b/tests/test/unpin.rs index e113889208e..ef76990b4b6 100644 --- a/tests/test/unpin.rs +++ b/tests/test/unpin.rs @@ -26,7 +26,7 @@ fn unpin_auto_trait() { goal { A: Unpin } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -80,7 +80,7 @@ fn unpin_overwrite() { goal { B: Unpin } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } @@ -118,13 +118,13 @@ fn generator_unpin() { goal { movable_gen: Unpin } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal { movable_with_pin: Unpin } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } } } diff --git a/tests/test/unsize.rs b/tests/test/unsize.rs index 1fc0699be74..9a218d8f79f 100644 --- a/tests/test/unsize.rs +++ b/tests/test/unsize.rs @@ -404,7 +404,7 @@ fn array_unsizing() { goal { [Foo; 2]: Unsize<[Foo]> } yields { - expect![["Unique"]] + expect![[r#"Unique; substitution [], lifetime constraints []"#]] } goal {