diff --git a/tests/test/auto_traits.rs b/tests/test/auto_traits.rs index d9244392b78..2a3f579fa7a 100644 --- a/tests/test/auto_traits.rs +++ b/tests/test/auto_traits.rs @@ -48,7 +48,7 @@ fn auto_semantics() { T: Send } } yields { - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } } } @@ -201,7 +201,7 @@ fn enum_auto_trait() { goal { A: Send } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -239,46 +239,46 @@ fn builtin_auto_trait() { // The following types only contain AutoTrait-types, and thus implement AutoTrait themselves. goal { (i32, f32): AutoTrait } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { [(); 1]: AutoTrait } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { [()]: AutoTrait } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { u32: AutoTrait } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { *const (): AutoTrait } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { *mut (): AutoTrait } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { forall<'a> { &'a (): AutoTrait } } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { forall<'a> { &'a mut (): AutoTrait } } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { str: AutoTrait } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { !: AutoTrait } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { Enum: AutoTrait } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { func: AutoTrait } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { good_closure: AutoTrait } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } goal { fn(Marker) -> Marker: AutoTrait } - yields { expect![["Unique; substitution [], lifetime constraints []"]] } + yields { expect![["Unique"]] } // foreign types do not implement AutoTraits automatically @@ -317,7 +317,7 @@ fn adt_auto_trait() { Yes: AutoTrait } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -331,7 +331,7 @@ fn adt_auto_trait() { X: AutoTrait } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { diff --git a/tests/test/coherence_goals.rs b/tests/test/coherence_goals.rs index 9238fb657e4..86cbdb6d868 100644 --- a/tests/test/coherence_goals.rs +++ b/tests/test/coherence_goals.rs @@ -132,7 +132,7 @@ 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![["Ambiguous; no inference guidance"]] } goal { forall { IsLocal(Box) } } yields { expect![["No possible solution"]] } goal { forall { IsUpstream(Box) } } yields { expect![["No possible solution"]] } diff --git a/tests/test/coinduction.rs b/tests/test/coinduction.rs index 128219a5c2c..65bf0f328f2 100644 --- a/tests/test/coinduction.rs +++ b/tests/test/coinduction.rs @@ -126,7 +126,7 @@ fn coinductive_trivial_variant1() { goal { exists { T: C1 } } yields { - expect![["Unique; substitution [?0 := X, ?1 := X], lifetime constraints []"]] + expect![["Unique; substitution [?0 := X, ?1 := X]"]] } } } @@ -150,7 +150,7 @@ fn coinductive_trivial_variant2() { goal { exists { T: C1 } } yields { - expect![["Unique; substitution [?0 := X, ?1 := X], lifetime constraints []"]] + expect![["Unique; substitution [?0 := X, ?1 := X]"]] } } } @@ -168,7 +168,7 @@ fn coinductive_trivial_variant3() { goal { exists { T: C1 } } yields { - expect![["Unique; for { substitution [?0 := ^0.0, ?1 := ^0.1], lifetime constraints [] }"]] + expect![["Unique; for { substitution [?0 := ^0.0, ?1 := ^0.1] }"]] } } } @@ -494,7 +494,7 @@ fn coinductive_multicycle1() { goal { forall { X: Any } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -534,7 +534,7 @@ fn coinductive_multicycle2() { goal { forall { X: Any } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } diff --git a/tests/test/constants.rs b/tests/test/constants.rs index 70a194c1b5c..2189d14f8c6 100644 --- a/tests/test/constants.rs +++ b/tests/test/constants.rs @@ -18,7 +18,7 @@ fn single_impl() { S: Trait } } yields { - expect![["Unique; substitution [?0 := 3], lifetime constraints []"]] + expect![["Unique; substitution [?0 := 3]"]] } goal { @@ -92,7 +92,7 @@ fn generic_impl() { S: Trait } } yields { - expect![["Unique; for { substitution [?0 := ^0.0], lifetime constraints [] }"]] + expect![["Unique; for { substitution [?0 := ^0.0] }"]] } goal { @@ -100,7 +100,7 @@ fn generic_impl() { S: Trait } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -133,7 +133,7 @@ fn placeholders_eq() { } } } yields { - expect![["Unique; substitution [?0 := !1_0], lifetime constraints []"]] + expect![["Unique; substitution [?0 := !1_0]"]] } goal { diff --git a/tests/test/cycle.rs b/tests/test/cycle.rs index ad8ce52ef2d..41f6369f8d6 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![["Ambiguous; no inference guidance"]] } } } @@ -141,7 +141,7 @@ fn multiple_ambiguous_cycles() { T: WF } } yields { - expect![["Ambig"]] + expect![["Ambiguous; no inference guidance"]] } } } diff --git a/tests/test/discriminant_kind.rs b/tests/test/discriminant_kind.rs index 934078ba05e..a4e0cd14072 100644 --- a/tests/test/discriminant_kind.rs +++ b/tests/test/discriminant_kind.rs @@ -160,7 +160,7 @@ fn discriminant_kind_assoc() { } } } yields { - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } } } diff --git a/tests/test/existential_types.rs b/tests/test/existential_types.rs index 0fe2e852f07..d6e23d49398 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![["Unique"]] } } } @@ -50,7 +50,7 @@ fn dyn_Clone_Send_is_Send() { (dyn Clone + Send + 's): Send } } yields { - expect![["Unique; substitution []"]] + expect![["Unique"]] } } } @@ -80,7 +80,7 @@ fn dyn_Foo_Bar() { } } } yields { - expect![["Unique; substitution [?0 := Bar], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Bar]"]] } } } @@ -127,7 +127,7 @@ fn dyn_super_trait_simple() { } } } yields { - expect![["Unique; substitution [?0 := B], lifetime constraints []"]] + expect![["Unique; substitution [?0 := B]"]] } } } @@ -279,7 +279,7 @@ fn dyn_higher_ranked_type_arguments() { dyn forall<'a> Foo> + 's: Foo> } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -287,7 +287,7 @@ fn dyn_higher_ranked_type_arguments() { dyn forall<'a> Foo> + Bar + 's: Foo> } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -295,7 +295,7 @@ fn dyn_higher_ranked_type_arguments() { dyn forall<'a> Foo> + Bar + 's: Bar } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -306,10 +306,7 @@ fn dyn_higher_ranked_type_arguments() { } } yields { // Note that this requires 'a == 's, so it would be resolveable later on. - expect![["Unique; substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '!2_0 }, \ - InEnvironment { environment: Env([]), goal: '!2_0: '!1_0 }\ - ]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!2_0 }, InEnvironment { environment: Env([]), goal: '!2_0: '!1_0 }]"]] } } } @@ -336,10 +333,7 @@ fn dyn_binders_reverse() { > } } yields { - expect![["Unique; substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!5_0: '!5_1 }, \ - InEnvironment { environment: Env([]), goal: '!5_1: '!5_0 }\ - ]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!5_0: '!5_1 }, InEnvironment { environment: Env([]), goal: '!5_1: '!5_0 }]"]] } // Note: these constraints are ultimately unresolveable (we @@ -351,10 +345,7 @@ fn dyn_binders_reverse() { > } } yields { - expect![["Unique; substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!3_0: '!3_1 }, \ - InEnvironment { environment: Env([]), goal: '!3_1: '!3_0 }\ - ]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!3_0: '!3_1 }, InEnvironment { environment: Env([]), goal: '!3_1: '!3_0 }]"]] } // Note: ordering of parameters is reversed here, but that's no problem @@ -365,7 +356,7 @@ fn dyn_binders_reverse() { > } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -388,10 +379,7 @@ fn dyn_lifetime_bound() { } } } yields { - expect![["Unique; substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '!2_0 }, \ - InEnvironment { environment: Env([]), goal: '!2_0: '!1_0 }\ - ]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!2_0 }, InEnvironment { environment: Env([]), goal: '!2_0: '!1_0 }]"]] } } } @@ -410,10 +398,10 @@ fn dyn_associated_type_binding() { } } } yields[SolverChoice::recursive_default()] { - expect![["Unique; substitution [?0 := Int(I32)], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Int(I32)]"]] } yields[SolverChoice::slg_default()] { // #234 - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } } } @@ -430,7 +418,7 @@ fn dyn_well_formed() { WellFormed(dyn MyTrait + 's) } } yields { - expect![["Unique"]] + expect![["Unique; for { substitution [?0 := '^0.0] }"]] } } } diff --git a/tests/test/fn_def.rs b/tests/test/fn_def.rs index 7d24417b83c..d4a5d134f44 100644 --- a/tests/test/fn_def.rs +++ b/tests/test/fn_def.rs @@ -144,7 +144,7 @@ fn generic_fn_implements_fn_traits() { goal { exists { foo: Fn<(T,)> } } yields { - expect![["Unique"]] + expect![["Unique; for { substitution [?0 := ^0.0] }"]] } goal { @@ -156,7 +156,7 @@ fn generic_fn_implements_fn_traits() { goal { exists { Normalize( as FnOnce<(T,)>>::Output -> T) } } yields { - expect![["Unique"]] + expect![["Unique; for { substitution [?0 := ^0.0] }"]] } goal { diff --git a/tests/test/functions.rs b/tests/test/functions.rs index 2f5e6e515ff..d68693d8c7f 100644 --- a/tests/test/functions.rs +++ b/tests/test/functions.rs @@ -11,13 +11,13 @@ fn functions_are_sized() { goal { fn(()): Sized } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { fn([u8]): Sized } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -33,13 +33,13 @@ fn functions_are_copy() { goal { fn(()): Copy } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { fn([u8]): Copy } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -73,21 +73,21 @@ fn function_implement_fn_traits() { goal { fn(u8): FnOnce<(u8,)> } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } // Same as above, but for FnMut goal { fn(u8): FnMut<(u8,)> } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } // Same as above, but for Fn goal { fn(u8): Fn<(u8,)> } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } // Make sure unsafe function pointers don't implement FnOnce @@ -115,14 +115,14 @@ fn function_implement_fn_traits() { goal { Normalize(>::Output -> ()) } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } // Tests normalizing when an explicit return type is used goal { Normalize( bool as FnOnce<(u8,)>>::Output -> bool) } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } // Tests that we fail to normalize when there's a mismatch with @@ -152,7 +152,7 @@ fn function_implement_fn_traits() { } } } yields { - expect![["Unique; substitution [?0 := !1_0], lifetime constraints []"]] + expect![["Unique; substitution [?0 := !1_0]"]] } // Tests that we properly tuple function arguments when constrcting @@ -160,7 +160,7 @@ fn function_implement_fn_traits() { goal { fn(u8, u32): FnOnce<(u8,u32)> } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } // Tests that we don't find a solution when fully monomorphic @@ -179,7 +179,7 @@ fn function_implement_fn_traits() { for<'b> fn(&'b u8): FnOnce<(&'a u8,)> } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } // Tests that a 'stricter' function (requires lifetimes to be the same) @@ -191,7 +191,7 @@ fn function_implement_fn_traits() { for<'c> fn(&'c u8, &'c i32): FnOnce<(&'a u8, &'b i32)> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"]] } // Tests the opposite case as the previous test: a 'less strict' function @@ -203,7 +203,7 @@ fn function_implement_fn_traits() { for<'b, 'c> fn(&'b u8, &'c i32): FnOnce<(&'a u8, &'a i32)> } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } // Similiar to the above test, but for types instead of lifetimes: diff --git a/tests/test/generators.rs b/tests/test/generators.rs index 4cb01af0eff..3ba9a61b314 100644 --- a/tests/test/generators.rs +++ b/tests/test/generators.rs @@ -105,13 +105,13 @@ fn generator_test() { } } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!2_0: '!2_1 }, InEnvironment { environment: Env([]), goal: '!2_1: '!2_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!2_0: '!2_1 }, InEnvironment { environment: Env([]), goal: '!2_1: '!2_0 }]"]] } goal { not_send_resume_yield: Send } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -121,7 +121,7 @@ fn generator_test() { } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { diff --git a/tests/test/implied_bounds.rs b/tests/test/implied_bounds.rs index f1dcc6e2a71..a9f9a90a628 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![["Unique"]] } } } @@ -39,7 +39,7 @@ fn gat_implied_bounds() { } } } yields { - expect![["Unique; substitution []"]] + expect![["Unique"]] } } diff --git a/tests/test/impls.rs b/tests/test/impls.rs index f55ccaf0ec1..5576c1d5900 100644 --- a/tests/test/impls.rs +++ b/tests/test/impls.rs @@ -18,13 +18,13 @@ fn prove_clone() { goal { Vec: Clone } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { Foo: Clone } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -67,13 +67,13 @@ fn prove_infer() { goal { exists { A: Map } } yields { - expect![["Unique; substitution [?0 := Foo], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Foo]"]] } goal { exists { Foo: Map } } yields { - expect![["Unique; substitution [?0 := Bar], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Bar]"]] } } } @@ -111,7 +111,7 @@ fn prove_forall() { goal { forall { not { T: Marker } } } yields { - expect![["No"]] + expect![["No possible solution"]] } goal { @@ -124,7 +124,7 @@ fn prove_forall() { goal { forall { if (T: Marker) { T: Marker } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } // We don't have to know anything about `T` to know that @@ -132,7 +132,7 @@ fn prove_forall() { goal { forall { Vec: Marker } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } // Here, we don't know that `T: Clone`, so we can't prove that @@ -151,7 +151,7 @@ fn prove_forall() { } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -173,7 +173,7 @@ fn higher_ranked() { } } } yields { - expect![["Unique; substitution [?0 := BestType], lifetime constraints []"]] + expect![["Unique; substitution [?0 := BestType]"]] } } } @@ -262,13 +262,13 @@ fn generic_trait() { goal { Int: Eq } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { Uint: Eq } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -507,7 +507,7 @@ fn inapplicable_assumption_does_not_shadow() { } } } yields { - expect![["Unique"]] + expect![["Unique; substitution [?0 := A]"]] } } } @@ -534,7 +534,7 @@ fn partial_overlap_2() { } } } yields { - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } goal { @@ -673,7 +673,7 @@ fn unify_types_in_impl() { goal { exists { A: Trait } } yields { - expect![["Unique; for { substitution [?0 := ^0.0, ?1 := ^0.0], lifetime constraints [] }"]] + expect![["Unique; for { substitution [?0 := ^0.0, ?1 := ^0.0] }"]] } } } diff --git a/tests/test/lifetimes.rs b/tests/test/lifetimes.rs index f242f5633fa..0d91a2a3599 100644 --- a/tests/test/lifetimes.rs +++ b/tests/test/lifetimes.rs @@ -58,7 +58,7 @@ fn static_outlives() { Bar: Foo<'a> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: 'static }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: 'static }]"]] } } } @@ -86,7 +86,7 @@ fn empty_outlives() { Bar: Foo<'a> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: ' }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: ' }]"]] } } } @@ -114,7 +114,7 @@ fn erased_outlives() { Bar: Foo<'a> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: ' }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: ' }]"]] } } } @@ -131,19 +131,19 @@ fn static_impls() { goal { &'static Foo: Bar } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { forall<'a> { &'a Foo: Bar } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { exists<'a> { &'a Foo: Bar } } yields { - expect![["Unique; for { substitution [?0 := '^0.0], lifetime constraints [] }"]] + expect![["Unique; for { substitution [?0 := '^0.0] }"]] } } } @@ -160,7 +160,7 @@ fn erased_impls() { goal { &'erased Foo: Bar } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -177,7 +177,7 @@ fn empty_impls() { goal { &'empty Foo: Bar } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } diff --git a/tests/test/misc.rs b/tests/test/misc.rs index 4a41eb0c8b3..1efe8d46b4c 100644 --- a/tests/test/misc.rs +++ b/tests/test/misc.rs @@ -36,7 +36,7 @@ fn futures_ambiguity() { goal { forall { if (T: FutureResult) { exists { T: Future> } } } } yields { - expect![["Unique; substitution [?0 := (FutureResult::Item), ?1 := (FutureResult::Error)], lifetime constraints []"]] + expect![["Unique; substitution [?0 := (FutureResult::Item), ?1 := (FutureResult::Error)]"]] } } } @@ -54,7 +54,7 @@ fn basic() { goal { forall { if (T: Sized) { T: Sized } } } yields_all[SolverChoice::slg(10, None)] { - expect![["substitution [], lifetime constraints []"]] + expect![[""]] } } } @@ -119,11 +119,11 @@ fn only_draw_so_many() { goal { exists { T: Sized } } yields_first[SolverChoice::slg(10, None)] { - expect![["substitution [?0 := Foo], lifetime constraints []"]], - expect![["substitution [?0 := Slice], lifetime constraints []"]], - expect![["substitution [?0 := Vec], lifetime constraints []"]], - expect![["substitution [?0 := Slice>], lifetime constraints []"]], - expect![["substitution [?0 := Vec>], lifetime constraints []"]] + expect![["substitution [?0 := Foo]"]], + expect![["substitution [?0 := Slice]"]], + expect![["substitution [?0 := Vec]"]], + expect![["substitution [?0 := Slice>]"]], + expect![["substitution [?0 := Vec>]"]] } goal { @@ -180,7 +180,7 @@ fn subgoal_cycle_uninhabited() { goal { exists { T: Foo } } yields_first[SolverChoice::slg(2, None)] { - expect![["Ambiguous(for { substitution [?0 := Box<^0.0>], lifetime constraints [] })"]] + expect![["Ambiguous(for { substitution [?0 := Box<^0.0>] })"]] } // Unsurprisingly, applying negation also flounders. @@ -202,22 +202,22 @@ fn subgoal_cycle_uninhabited() { goal { exists { T = Vec, not { Vec>: Foo } } } yields_first[SolverChoice::slg(2, None)] { - expect![["Ambiguous(substitution [?0 := Vec], lifetime constraints [])"]] + expect![["Ambiguous(substitution [?0 := Vec])"]] } // Same query with larger threshold works fine, though. goal { exists { T = Vec, not { Vec>: Foo } } } yields_all[SolverChoice::slg(4, None)] { - expect![["substitution [?0 := Vec], lifetime constraints []"]] + expect![["substitution [?0 := Vec]"]] } // Here, due to the hypothesis, there does indeed exist a suitable T, `U`. goal { forall { if (U: Foo) { exists { T: Foo } } } } yields_first[SolverChoice::slg(2, None)] { - expect![["substitution [?0 := !1_0], lifetime constraints []"]], - expect![["Ambiguous(for { substitution [?0 := Box<^0.0>], lifetime constraints [] })"]] + expect![["substitution [?0 := !1_0]"]], + expect![["Ambiguous(for { substitution [?0 := Box<^0.0>] })"]] } } } @@ -239,8 +239,8 @@ fn subgoal_cycle_inhabited() { goal { exists { T: Foo } } yields_first[SolverChoice::slg(3, None)] { - expect![["substitution [?0 := Alice], lifetime constraints []"]], - expect![["Ambiguous(for { substitution [?0 := Box<^0.0>], lifetime constraints [] })"]] + expect![["substitution [?0 := Alice]"]], + expect![["Ambiguous(for { substitution [?0 := Box<^0.0>] })"]] } } } @@ -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![["lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"]] } } } @@ -287,9 +284,9 @@ fn example_2_1_EWFS() { goal { exists { a: TransitiveClosure } } yields_all[SolverChoice::slg(3, None)] { - expect![["substitution [?0 := b], lifetime constraints []"]], - expect![["substitution [?0 := c], lifetime constraints []"]], - expect![["substitution [?0 := a], lifetime constraints []"]] + expect![["substitution [?0 := b]"]], + expect![["substitution [?0 := c]"]], + expect![["substitution [?0 := a]"]] } } } @@ -323,10 +320,10 @@ fn cached_answers_1() { goal { exists { T: Sour } } yields_first[SolverChoice::slg(2, None)] { - expect![["substitution [?0 := Lemon], lifetime constraints []"]], - expect![["substitution [?0 := Vinegar], lifetime constraints []"]], - expect![["substitution [?0 := HotSauce], lifetime constraints []"]], - expect![["substitution [?0 := HotSauce], lifetime constraints []"]], + expect![["substitution [?0 := Lemon]"]], + expect![["substitution [?0 := Vinegar]"]], + expect![["substitution [?0 := HotSauce]"]], + expect![["substitution [?0 := HotSauce]"]], expect![["Floundered"]] } } @@ -350,10 +347,10 @@ fn cached_answers_2() { goal { exists { T: Sour } } yields_first[SolverChoice::slg(2, None)] { - expect![["substitution [?0 := Lemon], lifetime constraints []"]], - expect![["substitution [?0 := Vinegar], lifetime constraints []"]], - expect![["substitution [?0 := HotSauce], lifetime constraints []"]], - expect![["substitution [?0 := HotSauce], lifetime constraints []"]], + expect![["substitution [?0 := Lemon]"]], + expect![["substitution [?0 := Vinegar]"]], + expect![["substitution [?0 := HotSauce]"]], + expect![["substitution [?0 := HotSauce]"]], expect![["Floundered"]] } } @@ -377,9 +374,9 @@ fn cached_answers_3() { goal { exists { T: Sour } } yields_first[SolverChoice::slg(2, None)] { - expect![["substitution [?0 := Lemon], lifetime constraints []"]], - expect![["substitution [?0 := HotSauce], lifetime constraints []"]], - expect![["substitution [?0 := Vinegar], lifetime constraints []"]], + expect![["substitution [?0 := Lemon]"]], + expect![["substitution [?0 := HotSauce]"]], + expect![["substitution [?0 := Vinegar]"]], expect![["Floundered"]] } } @@ -411,14 +408,14 @@ fn non_enumerable_traits_direct() { goal { exists { A: Enumerable } } yields_all[SolverChoice::slg(3, None)] { - expect![["substitution [?0 := Foo], lifetime constraints []"]], - expect![["substitution [?0 := Bar], lifetime constraints []"]] + expect![["substitution [?0 := Foo]"]], + expect![["substitution [?0 := Bar]"]] } goal { Foo: NonEnumerable } yields_all[SolverChoice::slg(3, None)] { - expect![["substitution [], lifetime constraints []"]] + expect![[""]] } } } @@ -506,14 +503,14 @@ fn non_enumerable_traits_reorder() { goal { exists { A: Debug1 } } yields_all[SolverChoice::slg(3, None)] { - expect![["substitution [?0 := Foo], lifetime constraints []"]] + expect![["substitution [?0 := Foo]"]] } goal { exists { A: Debug2 } } yields_all[SolverChoice::slg(3, None)] { - expect![["substitution [?0 := Foo], lifetime constraints []"]] + expect![["substitution [?0 := Foo]"]] } } } @@ -692,7 +689,7 @@ fn not_really_ambig() { goal { exists { Vec: A } } yields[SolverChoice::slg_default()] { - expect![["Unique; substitution [?0 := Uint(U32)], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Uint(U32)]"]] } yields[SolverChoice::recursive_default()] { expect![["Ambiguous; no inference guidance"]] } @@ -720,7 +717,7 @@ fn canonicalization_regression() { } } } yields { - expect![["Unique; substitution [?0 := !2_0], lifetime constraints []"]] + expect![["Unique; substitution [?0 := !2_0]"]] } } } @@ -752,7 +749,7 @@ fn empty_definite_guidance() { } yields[SolverChoice::slg_default()] { expect![["Unique"]] } yields[SolverChoice::recursive_default()] { - expect![["Ambiguous"]] + expect![["Ambiguous; suggested substitution []"]] } } } @@ -801,7 +798,7 @@ fn endless_loop() { T> as FnOnce>::Output = T } } yields { - expect![["Unique; for { substitution [?0 := ^0.0], lifetime constraints [] }"]] + expect![["Unique; for { substitution [?0 := ^0.0] }"]] } } } @@ -825,7 +822,7 @@ fn env_bound_vars() { } } } yields { - expect![["Unique"]] + expect![["Unique; for { substitution [?0 := '^0.0], lifetime constraints [InEnvironment { environment: Env([]), goal: 0: '^0.0 }] }"]] } } } diff --git a/tests/test/negation.rs b/tests/test/negation.rs index c271337d484..708b959bcc7 100644 --- a/tests/test/negation.rs +++ b/tests/test/negation.rs @@ -21,7 +21,7 @@ fn simple_negation() { not { Bar: Foo } } } yields { - expect![["No"]] + expect![["No possible solution"]] } goal { @@ -39,7 +39,7 @@ fn simple_negation() { not { T: Foo } } } yields { - expect![["Ambig"]] + expect![["Ambiguous; no inference guidance"]] } goal { @@ -122,7 +122,7 @@ fn negation_quantifiers() { } } } yields { - expect![["No"]] + expect![["No possible solution"]] } goal { @@ -132,7 +132,7 @@ fn negation_quantifiers() { } } } yields { - expect![["No"]] + expect![["No possible solution"]] } } } @@ -153,7 +153,7 @@ fn negation_free_vars() { not { Vec: Foo } } } yields { - expect![["Ambig"]] + expect![["Ambiguous; no inference guidance"]] } } } @@ -204,7 +204,7 @@ fn example_2_2_EWFS() { goal { c: M } yields_all[SolverChoice::slg(3, None)] { - expect![["substitution [], lifetime constraints []"]] + expect![[""]] } } } @@ -343,14 +343,14 @@ fn negative_reorder() { goal { exists { A: Debug1 } } yields_all[SolverChoice::slg(3, None)] { - expect![["substitution [?0 := Bar], lifetime constraints []"]] + expect![["substitution [?0 := Bar]"]] } goal { exists { A: Debug2 } } yields_all[SolverChoice::slg(3, None)] { - expect![["substitution [?0 := Bar], lifetime constraints []"]] + expect![["substitution [?0 := Bar]"]] } } } diff --git a/tests/test/numerics.rs b/tests/test/numerics.rs index 86f432b6131..688cb47ba02 100644 --- a/tests/test/numerics.rs +++ b/tests/test/numerics.rs @@ -134,7 +134,7 @@ fn integer_and_float_are_specialized_ty_kinds() { T = N, N = usize } } yields { - expect![["Unique; substitution [?0 := Uint(Usize), ?1 := Uint(Usize)], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Uint(Usize), ?1 := Uint(Usize)]"]] } goal { @@ -142,7 +142,7 @@ fn integer_and_float_are_specialized_ty_kinds() { T = N, N = f32 } } yields { - expect![["Unique; substitution [?0 := Float(F32), ?1 := Float(F32)], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Float(F32), ?1 := Float(F32)]"]] } } } @@ -197,7 +197,7 @@ fn integers_are_copy() { I: Copy } } yields { - expect![["Unique"]] + expect![["Unique; for { substitution [?0 := ^0.0] }"]] } } } @@ -215,7 +215,7 @@ fn integers_are_sized() { I: Sized } } yields { - expect![["Unique"]] + expect![["Unique; for { substitution [?0 := ^0.0] }"]] } } } @@ -286,7 +286,7 @@ fn unify_general_then_specific_ty() { Bar<(N, T, T, T)>: Foo } } yields { - expect![["Unique"]] + expect![["Unique; substitution [?0 := Int(I32), ?1 := Int(I32)]"]] } } } diff --git a/tests/test/opaque_types.rs b/tests/test/opaque_types.rs index b3c9245cff7..767db8c8a15 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![["Unique"]] } } } @@ -39,7 +39,7 @@ fn opaque_reveal() { T: Trait } } yields { - expect![["Unique; substitution []"]] + expect![["Unique"]] } goal { @@ -77,7 +77,7 @@ fn opaque_where_clause() { WellFormed(T) } } yields { - expect![["Unique; substitution []"]] + expect![["Unique"]] } goal { @@ -93,7 +93,7 @@ fn opaque_where_clause() { } } } yields { - expect![["Unique; substitution []"]] + expect![["Unique"]] } goal { @@ -124,7 +124,7 @@ fn opaque_generics_simple() { goal { Foo: Iterator } yields { - expect![["Unique; substitution []"]] + expect![["Unique"]] } } @@ -149,7 +149,7 @@ fn opaque_generics() { goal { Foo: Iterator } yields { - expect![["Unique; substitution []"]] + expect![["Unique"]] } goal { @@ -157,7 +157,7 @@ fn opaque_generics() { Foo: Iterator } } yields { - expect![["Unique; substitution []"]] + expect![["Unique"]] } goal { @@ -165,9 +165,9 @@ fn opaque_generics() { as Iterator>::Item = T } } yields[SolverChoice::slg_default()] { - expect![["Ambiguous"]] // #234 + expect![["Ambiguous; no inference guidance"]] // #234 } yields[SolverChoice::recursive_default()] { - expect![["Unique; substitution [?0 := Bar], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Bar]"]] } } } diff --git a/tests/test/projection.rs b/tests/test/projection.rs index 3ce3ead325a..aaddd17ffa8 100644 --- a/tests/test/projection.rs +++ b/tests/test/projection.rs @@ -21,7 +21,7 @@ fn normalize_basic() { } } } yields { - expect![["Unique; substitution [?0 := !1_0], lifetime constraints []"]] + expect![["Unique; substitution [?0 := !1_0]"]] } goal { @@ -29,7 +29,7 @@ fn normalize_basic() { Vec: Iterator } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -39,7 +39,7 @@ fn normalize_basic() { } } } yields { - expect![["Unique; substitution []"]] + expect![["Unique"]] } 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![["Ambiguous; no inference guidance"]] } } } @@ -114,7 +114,7 @@ fn normalize_into_iterator() { } } } yields { - expect![["Unique"]] + expect![["Unique; substitution [?0 := !1_0]"]] } } } @@ -141,7 +141,7 @@ fn projection_equality() { } } yields[SolverChoice::slg_default()] { // this is wrong, chalk#234 - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } yields[SolverChoice::recursive_default()] { expect![["Unique; substitution [?0 := Uint(U32)]"]] } @@ -152,7 +152,7 @@ fn projection_equality() { } } yields[SolverChoice::slg_default()] { // this is wrong, chalk#234 - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } yields[SolverChoice::recursive_default()] { expect![["Unique; substitution [?0 := Uint(U32)]"]] } @@ -182,7 +182,7 @@ fn projection_equality_priority1() { } } yields[SolverChoice::slg_default()] { // this is wrong, chalk#234 - expect![["Ambiguous"]] + expect![["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 @@ -240,7 +240,7 @@ fn projection_equality_priority2() { } } yields { // Constraining Out1 = Y gives us only one choice. - expect![["Unique; substitution [?0 := !1_1, ?1 := (Trait1::Type)], lifetime constraints []"]] + expect![["Unique; substitution [?0 := !1_1, ?1 := (Trait1::Type)]"]] } goal { @@ -254,7 +254,7 @@ fn projection_equality_priority2() { } } yields { // Constraining Out1 = Y gives us only one choice. - expect![["Unique; substitution [?0 := !1_1, ?1 := (Trait1::Type)], lifetime constraints []"]] + expect![["Unique; substitution [?0 := !1_1, ?1 := (Trait1::Type)]"]] } goal { @@ -274,7 +274,7 @@ fn projection_equality_priority2() { } yields[SolverChoice::recursive_default()] { // Constraining Out1 = S1 gives us only one choice, use the impl, // and the recursive solver prefers the normalized form. - expect![["Unique; substitution [?0 := S1, ?1 := Uint(U32)], lifetime constraints []"]] + expect![["Unique; substitution [?0 := S1, ?1 := Uint(U32)]"]] } } } @@ -297,7 +297,7 @@ fn projection_equality_from_env() { } } yields[SolverChoice::slg_default()] { // this is wrong, chalk#234 - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } yields[SolverChoice::recursive_default()] { expect![["Unique; substitution [?0 := Uint(U32)]"]] } @@ -325,7 +325,7 @@ fn projection_equality_nested() { } } yields[SolverChoice::slg_default()] { // this is wrong, chalk#234 - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } yields[SolverChoice::recursive_default()] { expect![["Unique; substitution [?0 := Uint(U32)]"]] } @@ -367,7 +367,7 @@ fn iterator_flatten() { } } yields[SolverChoice::slg_default()] { // this is wrong, chalk#234 - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } yields[SolverChoice::recursive_default()] { expect![["Unique; substitution [?0 := Uint(U32)]"]] } @@ -409,7 +409,7 @@ fn normalize_gat1() { } } } yields { - expect![["Unique; substitution [?0 := Iter<'!2_0, !1_0>], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Iter<'!2_0, !1_0>]"]] } } } @@ -434,7 +434,7 @@ fn normalize_gat2() { } } } yields { - expect![["Unique; substitution [?0 := Span<'!1_0, !1_1>], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Span<'!1_0, !1_1>]"]] } goal { @@ -442,7 +442,7 @@ fn normalize_gat2() { as StreamingIterator>::Item<'a> = Span<'a, T> } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -452,7 +452,7 @@ fn normalize_gat2() { } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -476,7 +476,7 @@ fn normalize_gat_const() { } } } yields { - expect![["Unique; substitution [?0 := Span], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Span]"]] } goal { @@ -484,7 +484,7 @@ fn normalize_gat_const() { as StreamingIterator>::Item = Span } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -494,7 +494,7 @@ fn normalize_gat_const() { } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -604,7 +604,7 @@ fn normalize_gat_with_higher_ranked_trait_bound() { } } } yields { - expect![["Unique; substitution [?0 := Baz], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Baz]"]] } } } @@ -626,7 +626,7 @@ fn forall_projection() { goal { for<'a> fn(>::Item): Eq } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -664,7 +664,7 @@ fn forall_projection_gat() { } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -682,7 +682,7 @@ fn forall_projection_gat() { } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -719,9 +719,9 @@ fn normalize_under_binder() { } } yields[SolverChoice::slg_default()] { // chalk#234, I think - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } yields[SolverChoice::recursive_default()] { - expect![["Unique; substitution [?0 := I32], lifetime constraints []"]] + expect![["Unique; substitution [?0 := I32]"]] } goal { @@ -731,7 +731,7 @@ fn normalize_under_binder() { } } } yields { - expect![["Unique; substitution [?0 := I32], lifetime constraints []"]] + expect![["Unique; substitution [?0 := I32]"]] } goal { @@ -742,9 +742,9 @@ fn normalize_under_binder() { } } yields[SolverChoice::slg_default()] { // chalk#234, I think - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } yields[SolverChoice::recursive_default()] { - expect![["Unique; substitution [?0 := Ref<'!1_0, I32>], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Ref<'!1_0, I32>]"]] } goal { @@ -754,7 +754,7 @@ fn normalize_under_binder() { } } } yields { - expect![["Unique; substitution [?0 := Ref<'!1_0, I32>], lifetime constraints []"]] + expect![["Unique; substitution [?0 := Ref<'!1_0, I32>]"]] } goal { @@ -797,7 +797,7 @@ fn normalize_under_binder_multi() { } } } yields_all { - expect![["substitution [?0 := I32], lifetime constraints []"]], + expect![["substitution [?0 := I32]"]], expect![["for { substitution [?0 := (Deref::Item), '^0.1>], lifetime constraints [\ InEnvironment { environment: Env([]), goal: '!1_0: '^0.1 }, \ InEnvironment { environment: Env([]), goal: '^0.1: '!1_0 }, \ @@ -812,7 +812,7 @@ fn normalize_under_binder_multi() { } } } yields_first { - expect![["substitution [?0 := I32], lifetime constraints []"]] + expect![["substitution [?0 := I32]"]] } } } @@ -1063,7 +1063,7 @@ fn projection_to_dyn() { goal { <() as AsDyn>::Dyn: Debug } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -1097,13 +1097,13 @@ fn projection_to_opaque() { goal { ::Proj: Debug } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { <::Proj as Debug>::Output = () } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } diff --git a/tests/test/refs.rs b/tests/test/refs.rs index 58289c723d2..c8933071890 100644 --- a/tests/test/refs.rs +++ b/tests/test/refs.rs @@ -12,7 +12,7 @@ fn immut_refs_are_well_formed() { WellFormed(&'a T) } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: !1_1: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: !1_1: '!1_0 }]"]] } goal { @@ -36,7 +36,7 @@ fn immut_refs_are_sized() { goal { forall<'a, T> { &'a T: Sized } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -47,7 +47,7 @@ fn mut_refs_are_well_formed() { goal { forall<'a, T> { WellFormed(&'a mut T) } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: !1_1: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: !1_1: '!1_0 }]"]] } } } @@ -63,7 +63,7 @@ fn mut_refs_are_sized() { goal { forall<'a, T> { &'a mut T: Sized } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } diff --git a/tests/test/slices.rs b/tests/test/slices.rs index 71c13ea57ba..90d4b348ec0 100644 --- a/tests/test/slices.rs +++ b/tests/test/slices.rs @@ -11,7 +11,7 @@ fn slices_are_not_sized() { goal { forall { not { [T]: Sized } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -27,7 +27,7 @@ fn slices_are_well_formed_if_elem_sized() { goal { forall { if (T: Sized) { WellFormed([T]) } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -49,7 +49,7 @@ fn slices_are_not_copy() { goal { forall { not { [T]: Copy } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -65,7 +65,7 @@ fn slices_are_not_clone() { goal { forall { not { [T]: Clone } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } diff --git a/tests/test/subtype.rs b/tests/test/subtype.rs index f70bebfbc72..815fd111760 100644 --- a/tests/test/subtype.rs +++ b/tests/test/subtype.rs @@ -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![["Unique; 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![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }]"]] } } } @@ -74,19 +70,9 @@ fn fn_lifetime_variance_args() { goal { for<'a, 'b> fn(&'a u32, &'b u32) = for<'a> fn(&'a u32, &'a u32) } yields[SolverChoice::recursive_default()] { - 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: '!2_0: '^0.1 }, \ - InEnvironment { environment: Env([]), goal: '!2_0: '^0.2 }\ - ] }"]] + expect![["Unique; for { lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 }, InEnvironment { environment: Env([]), goal: '!2_0: '^0.1 }, InEnvironment { environment: Env([]), goal: '!2_0: '^0.2 }] }"]] } yields[SolverChoice::slg_default()] { - expect![["Unique; for { substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.2 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.2 }, \ - InEnvironment { environment: Env([]), goal: '!2_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!2_0: '^0.1 }\ - ] }"]] + expect![["Unique; for { lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '^0.2 }, InEnvironment { environment: Env([]), goal: '!1_1: '^0.2 }, InEnvironment { environment: Env([]), goal: '!2_0: '^0.0 }, InEnvironment { environment: Env([]), goal: '!2_0: '^0.1 }] }"]] } } } @@ -98,20 +84,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![["Unique; for { 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![["Unique; for { 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 }] }"]] } } } @@ -133,7 +111,7 @@ fn generalize() { // If this is invariant, then the generalizer might be doing // the right thing here by creating the general form of `&'a u32` equal to // just `&'a u32` - expect![["Unique; substitution [?0 := (&'!1_0 Uint(U32))], lifetime constraints []"]] + expect![["Unique; substitution [?0 := (&'!1_0 Uint(U32))]"]] } } } @@ -159,10 +137,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![["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 +164,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![["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 +187,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![["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 +198,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![["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 +221,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![["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 +232,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![["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 +255,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![["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![["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 +270,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![["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![["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 +291,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![["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 +302,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![["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 +320,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![["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 +331,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![["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 +349,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![["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 +360,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![["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 +382,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![["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 +405,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![["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 +428,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![["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![["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,10 +448,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 [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 } \ - ] }"]] + 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 }] }"]] } goal { forall<'a, 'b> { @@ -544,10 +459,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 [\ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 } \ - ] }"]] + 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 }] }"]] } } } @@ -565,10 +477,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![["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 +488,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![["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 +505,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![["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 +515,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![["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,10 +533,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 [\ - InEnvironment { environment: Env([]), goal: '!1_0: '^0.0 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '^0.0 } \ - ] }"]] + expect![["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 }] }"]] } goal { @@ -652,10 +545,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 [\ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '^0.0: '!1_1 } \ - ] }"]] + expect![["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 }] }"]] } } } diff --git a/tests/test/tuples.rs b/tests/test/tuples.rs index 6770ee7dc60..9f087a979e1 100644 --- a/tests/test/tuples.rs +++ b/tests/test/tuples.rs @@ -68,31 +68,31 @@ fn tuples_are_copy() { goal { (): Copy } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { (u8,): Copy } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { (u8, u8): Copy } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { exists { (T, u8): Copy } } yields { - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } goal { forall { if (T: Copy) { (T, u8): Copy } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -122,37 +122,37 @@ fn tuples_are_sized() { goal { ([u8], u8): Sized } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { (): Sized } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { (u8,): Sized } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { (u8, u8): Sized } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { exists { (T, u8): Sized } } yields { - expect![["Unique; for { substitution [?0 := ^0.0], lifetime constraints [] }"]] + expect![["Unique; for { substitution [?0 := ^0.0] }"]] } goal { forall { (T, u8): Sized } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -164,7 +164,7 @@ fn tuples_are_sized() { goal { forall { if (T: Sized) { (u8, T): Sized } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -202,31 +202,31 @@ fn tuples_are_clone() { goal { (): Clone } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { (u8,): Clone } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { (u8, u8): Clone } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { exists { (T, u8): Clone } } yields { - expect![["Ambiguous"]] + expect![["Ambiguous; no inference guidance"]] } goal { forall { if (T: Clone) { (T, u8): Clone } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -242,31 +242,31 @@ fn tuples_are_wf() { goal { WellFormed(()) } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { WellFormed((u8,)) } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { WellFormed((u8, u8)) } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { WellFormed(([u8],)) } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { WellFormed((u8, [u8])) } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -290,7 +290,7 @@ fn tuples_are_wf() { goal { forall { if (T: Sized) { WellFormed((T, u8)) } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } diff --git a/tests/test/unify.rs b/tests/test/unify.rs index 1ae5a407886..f0e8e662851 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![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"]] } goal { @@ -35,7 +31,7 @@ fn region_equality() { } } } yields { - expect![["Unique; substitution [?0 := '!1_0], lifetime constraints []"]] + expect![["Unique; substitution [?0 := '!1_0]"]] } } } @@ -59,7 +55,7 @@ fn forall_equality_solveable_simple() { // all in a valid universe to do so (universe 4). for<'a> fn(Ref<'a, Unit>): Eq fn(Ref<'c, Unit>)> } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -85,11 +81,7 @@ fn forall_equality_unsolveable_simple() { for<'a, 'b> fn(Ref<'a, Ref<'b, Ref<'a, Unit>>>): Eq< for<'c, 'd> fn(Ref<'c, Ref<'d, Ref<'d, Unit>>>)> } yields { - expect![["Unique; substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '!2_0: '!2_1 }, \ - InEnvironment { environment: Env([]), goal: '!2_1: '!2_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }, InEnvironment { environment: Env([]), goal: '!2_0: '!2_1 }, InEnvironment { environment: Env([]), goal: '!2_1: '!2_0 }]"]] } } } @@ -114,7 +106,7 @@ fn forall_equality() { // all in a valid universe to do so (universe 4). for<'a, 'b> fn(Ref<'a, Ref<'b, Unit>>): Eq fn(Ref<'c, Ref<'d, Unit>>)> } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -126,11 +118,7 @@ fn forall_equality() { for<'a, 'b> fn(Ref<'a, Ref<'b, Ref<'a, Unit>>>): Eq< for<'c, 'd> fn(Ref<'c, Ref<'d, Ref<'d, Unit>>>)> } yields { - expect![["Unique; substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }, \ - InEnvironment { environment: Env([]), goal: '!2_0: '!2_1 }, \ - InEnvironment { environment: Env([]), goal: '!2_1: '!2_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }, InEnvironment { environment: Env([]), goal: '!2_0: '!2_1 }, InEnvironment { environment: Env([]), goal: '!2_1: '!2_0 }]"]] } goal { @@ -144,7 +132,7 @@ fn forall_equality() { // Function pointers with identical ABIs should be equal. extern "Rust" fn(): Eq } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -158,7 +146,7 @@ fn forall_equality() { // Function pointers with identical safety should be equal. unsafe fn(): Eq } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { @@ -172,7 +160,7 @@ fn forall_equality() { // Variadic function pointers should be equal to variadic fn pointers. fn(u8, ...): Eq } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -268,19 +256,13 @@ fn equality_binder2() { goal { for<'b, 'c> fn(Ref<'b, 'c>) = for<'a> fn(Ref<'a, 'a>) } yields { - expect![["Unique; substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, \ - InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }\ - ]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_1 }, InEnvironment { environment: Env([]), goal: '!1_1: '!1_0 }]"]] } goal { for<'a> fn(Ref<'a, 'a>) = for<'b, 'c> fn(Ref<'b, 'c>) } yields { - expect![["Unique; substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!2_0: '!2_1 }, \ - InEnvironment { environment: Env([]), goal: '!2_1: '!2_0 }\ - ]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!2_0: '!2_1 }, InEnvironment { environment: Env([]), goal: '!2_1: '!2_0 }]"]] } } } @@ -301,10 +283,7 @@ fn mixed_indices_unify() { } } } yields { - expect![["Unique; for { \ - substitution [?0 := '^0.0, ?1 := ^0.1, ?2 := ^0.1], \ - lifetime constraints []\ - }"]] + expect![["Unique; for { substitution [?0 := '^0.0, ?1 := ^0.1, ?2 := ^0.1] }"]] } } } @@ -328,10 +307,7 @@ fn mixed_indices_match_program() { } } } yields { - expect![["Unique; for { \ - substitution [?0 := '^0.0, ?1 := S, ?2 := S], \ - lifetime constraints [] \ - }"]] + expect![["Unique; for { substitution [?0 := '^0.0, ?1 := S, ?2 := S] }"]] } } } @@ -359,7 +335,7 @@ fn mixed_indices_normalize_application() { } } } yields { - expect![["Unique; for { substitution [?0 := '^0.0, ?1 := ^0.1, ?2 := ^0.1], "]] + expect![["Unique; for { substitution [?0 := '^0.0, ?1 := ^0.1, ?2 := ^0.1] }"]] } } } @@ -386,8 +362,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![["Unique; for { substitution [?0 := ^0.0, ?1 := '^0.1, ?2 := ^0.2, ?3 := ^0.0, ?4 := ^0.2] }"]] } } } @@ -418,9 +393,7 @@ fn quantified_types() { forall<'a> { fn(fn1<'a>): Foo } } yields { // Lifetime constraints are unsatisfiable - expect![["Unique; substitution [], lifetime constraints [\ - InEnvironment { environment: Env([]), goal: '!1_0: '!2_0 }, \ - InEnvironment { environment: Env([]), goal: '!2_0: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!2_0 }, InEnvironment { environment: Env([]), goal: '!2_0: '!1_0 }]"]] } } } diff --git a/tests/test/unsize.rs b/tests/test/unsize.rs index 1fc0699be74..21dd0c62ef9 100644 --- a/tests/test/unsize.rs +++ b/tests/test/unsize.rs @@ -37,7 +37,7 @@ fn dyn_to_dyn_unsizing() { } } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!2_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!2_0 }]"]] } goal { @@ -47,7 +47,7 @@ fn dyn_to_dyn_unsizing() { } } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!2_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!2_0 }]"]] } // Target has a subset of source auto traits @@ -56,7 +56,7 @@ fn dyn_to_dyn_unsizing() { dyn Principal + Auto1 + Auto2 + 'a: Unsize } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_0 }]"]] } // Both target and source don't have principal as their first trait @@ -65,7 +65,7 @@ fn dyn_to_dyn_unsizing() { dyn Auto1 + Principal + 'a: Unsize } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_0 }]"]] } // Different order of traits in target and source @@ -74,7 +74,7 @@ fn dyn_to_dyn_unsizing() { dyn Principal + Auto1 + 'a: Unsize } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_0 }]"]] } // See above @@ -83,7 +83,7 @@ fn dyn_to_dyn_unsizing() { dyn Principal + Auto2 + Auto1 + 'a: Unsize } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_0 }]"]] } // Source has a subset of auto traits of target @@ -128,7 +128,7 @@ fn dyn_to_dyn_unsizing() { dyn GenericPrincipal + 'a: Unsize + 'a> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: '!1_0: '!1_0 }]"]] } // Non-matching generic principal traits @@ -192,7 +192,7 @@ fn ty_to_dyn_unsizing() { Foo: Unsize } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] } // Principal is not the first trait @@ -201,7 +201,7 @@ fn ty_to_dyn_unsizing() { Foo: Unsize } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] } // Auto-only trait object @@ -210,7 +210,7 @@ fn ty_to_dyn_unsizing() { Foo: Unsize } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] } // TypeOutlives test @@ -219,7 +219,7 @@ fn ty_to_dyn_unsizing() { FooLifetime<'a>: Unsize } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: FooLifetime<'!1_0>: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: FooLifetime<'!1_0>: '!1_0 }]"]] } // See above @@ -266,7 +266,7 @@ fn ty_to_dyn_unsizing() { Foo: Unsize + 'a> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] } @@ -309,7 +309,7 @@ fn ty_to_dyn_unsizing() { } } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: FooNotSized: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: FooNotSized: '!1_0 }]"]] } } } @@ -350,7 +350,7 @@ fn tuple_unsizing() { (u32, Foo): Unsize<(u32, dyn Principal + 'a)> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] } // Last field does not implement `Unsize` @@ -386,7 +386,7 @@ fn tuple_unsizing() { (u32, (u32, Foo)): Unsize<(u32, (u32, dyn Principal + 'a))> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] } } } @@ -497,7 +497,7 @@ fn struct_unsizing() { S1: Unsize> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] } goal { @@ -524,7 +524,7 @@ fn struct_unsizing() { S12: Unsize> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] } // Test for the unsizing parameters collector @@ -534,7 +534,7 @@ fn struct_unsizing() { SWithBinders: Unsize> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] } // Non-trivial unsizing of the last field @@ -543,7 +543,7 @@ fn struct_unsizing() { SNested, Foo>: Unsize, dyn Principal + 'a>> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] } goal { @@ -560,14 +560,14 @@ fn struct_unsizing() { SLifetime<'a, Foo>: Unsize> } } yields { - expect![["Unique; substitution [], lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] + expect![["Unique; lifetime constraints [InEnvironment { environment: Env([]), goal: Foo: '!1_0 }]"]] } // Tests with constant as an unsizing parameter goal { SGoodConst<5, [u32; 2]>: Unsize> } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } diff --git a/tests/test/wf_goals.rs b/tests/test/wf_goals.rs index 2d5922c3993..08436ed331a 100644 --- a/tests/test/wf_goals.rs +++ b/tests/test/wf_goals.rs @@ -25,13 +25,13 @@ fn struct_wf() { goal { WellFormed(Foo) } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { WellFormed(Foo>) } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -59,13 +59,13 @@ fn enum_wf() { goal { WellFormed(Foo) } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } goal { WellFormed(Foo>) } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -103,7 +103,7 @@ fn drop_compatible() { goal { compatible { not { exists { S: Drop } } } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } } @@ -114,7 +114,7 @@ fn placeholder_wf() { goal { forall { WellFormed(T) } } yields { - expect![["Unique; substitution [], lifetime constraints []"]] + expect![["Unique"]] } } }