Skip to content

Commit

Permalink
Bless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed Dec 27, 2021
1 parent f0579eb commit 1627b6e
Show file tree
Hide file tree
Showing 25 changed files with 295 additions and 447 deletions.
36 changes: 18 additions & 18 deletions tests/test/auto_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn auto_semantics() {
T: Send
}
} yields {
expect![["Ambiguous"]]
expect![["Ambiguous; no inference guidance"]]
}
}
}
Expand Down Expand Up @@ -201,7 +201,7 @@ fn enum_auto_trait() {
goal {
A: Send
} yields {
expect![["Unique; substitution [], lifetime constraints []"]]
expect![["Unique"]]
}

goal {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -317,7 +317,7 @@ fn adt_auto_trait() {
Yes: AutoTrait
}
yields {
expect![["Unique; substitution [], lifetime constraints []"]]
expect![["Unique"]]
}

goal {
Expand All @@ -331,7 +331,7 @@ fn adt_auto_trait() {
X: AutoTrait
}
yields {
expect![["Unique; substitution [], lifetime constraints []"]]
expect![["Unique"]]
}

goal {
Expand Down
2 changes: 1 addition & 1 deletion tests/test/coherence_goals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> { not { IsLocal(Box<T>) } } } yields { expect![["Ambiguous"]] }
goal { forall<T> { not { IsLocal(Box<T>) } } } yields { expect![["Ambiguous; no inference guidance"]] }
goal { forall<T> { IsLocal(Box<T>) } } yields { expect![["No possible solution"]] }
goal { forall<T> { IsUpstream(Box<T>) } } yields { expect![["No possible solution"]] }

Expand Down
10 changes: 5 additions & 5 deletions tests/test/coinduction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fn coinductive_trivial_variant1() {
goal {
exists<T, U> { T: C1<U> }
} yields {
expect![["Unique; substitution [?0 := X, ?1 := X], lifetime constraints []"]]
expect![["Unique; substitution [?0 := X, ?1 := X]"]]
}
}
}
Expand All @@ -150,7 +150,7 @@ fn coinductive_trivial_variant2() {
goal {
exists<T, U> { T: C1<U> }
} yields {
expect![["Unique; substitution [?0 := X, ?1 := X], lifetime constraints []"]]
expect![["Unique; substitution [?0 := X, ?1 := X]"]]
}
}
}
Expand All @@ -168,7 +168,7 @@ fn coinductive_trivial_variant3() {
goal {
exists<T, U> { T: C1<U> }
} yields {
expect![["Unique; for<?U0,?U0> { substitution [?0 := ^0.0, ?1 := ^0.1], lifetime constraints [] }"]]
expect![["Unique; for<?U0,?U0> { substitution [?0 := ^0.0, ?1 := ^0.1] }"]]
}
}
}
Expand Down Expand Up @@ -494,7 +494,7 @@ fn coinductive_multicycle1() {
goal {
forall<X> { X: Any }
} yields {
expect![["Unique; substitution [], lifetime constraints []"]]
expect![["Unique"]]
}
}
}
Expand Down Expand Up @@ -534,7 +534,7 @@ fn coinductive_multicycle2() {
goal {
forall<X> { X: Any }
} yields {
expect![["Unique; substitution [], lifetime constraints []"]]
expect![["Unique"]]
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions tests/test/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn single_impl() {
S<N>: Trait
}
} yields {
expect![["Unique; substitution [?0 := 3], lifetime constraints []"]]
expect![["Unique; substitution [?0 := 3]"]]
}

goal {
Expand Down Expand Up @@ -92,15 +92,15 @@ fn generic_impl() {
S<N>: Trait
}
} yields {
expect![["Unique; for<?U0> { substitution [?0 := ^0.0], lifetime constraints [] }"]]
expect![["Unique; for<?U0> { substitution [?0 := ^0.0] }"]]
}

goal {
forall<const N> {
S<N>: Trait
}
} yields {
expect![["Unique; substitution [], lifetime constraints []"]]
expect![["Unique"]]
}
}
}
Expand Down Expand Up @@ -133,7 +133,7 @@ fn placeholders_eq() {
}
}
} yields {
expect![["Unique; substitution [?0 := !1_0], lifetime constraints []"]]
expect![["Unique; substitution [?0 := !1_0]"]]
}

goal {
Expand Down
4 changes: 2 additions & 2 deletions tests/test/cycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn inner_cycle() {
goal {
exists<T> { T: A }
} yields {
expect![["Ambiguous"]]
expect![["Ambiguous; no inference guidance"]]
}
}
}
Expand Down Expand Up @@ -141,7 +141,7 @@ fn multiple_ambiguous_cycles() {
T: WF
}
} yields {
expect![["Ambig"]]
expect![["Ambiguous; no inference guidance"]]
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test/discriminant_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ fn discriminant_kind_assoc() {
}
}
} yields {
expect![["Ambiguous"]]
expect![["Ambiguous; no inference guidance"]]
}
}
}
42 changes: 15 additions & 27 deletions tests/test/existential_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn dyn_Clone_is_Clone() {
dyn Clone + 's: Clone
}
} yields {
expect![["Unique; substitution []"]]
expect![["Unique"]]
}
}
}
Expand Down Expand Up @@ -50,7 +50,7 @@ fn dyn_Clone_Send_is_Send() {
(dyn Clone + Send + 's): Send
}
} yields {
expect![["Unique; substitution []"]]
expect![["Unique"]]
}
}
}
Expand Down Expand Up @@ -80,7 +80,7 @@ fn dyn_Foo_Bar() {
}
}
} yields {
expect![["Unique; substitution [?0 := Bar], lifetime constraints []"]]
expect![["Unique; substitution [?0 := Bar]"]]
}
}
}
Expand Down Expand Up @@ -127,7 +127,7 @@ fn dyn_super_trait_simple() {
}
}
} yields {
expect![["Unique; substitution [?0 := B], lifetime constraints []"]]
expect![["Unique; substitution [?0 := B]"]]
}
}
}
Expand Down Expand Up @@ -279,23 +279,23 @@ fn dyn_higher_ranked_type_arguments() {
dyn forall<'a> Foo<Ref<'a>> + 's: Foo<Ref<'s>>
}
} yields {
expect![["Unique; substitution [], lifetime constraints []"]]
expect![["Unique"]]
}

goal {
forall<'s> {
dyn forall<'a> Foo<Ref<'a>> + Bar + 's: Foo<Ref<'s>>
}
} yields {
expect![["Unique; substitution [], lifetime constraints []"]]
expect![["Unique"]]
}

goal {
forall<'s> {
dyn forall<'a> Foo<Ref<'a>> + Bar + 's: Bar
}
} yields {
expect![["Unique; substitution [], lifetime constraints []"]]
expect![["Unique"]]
}

goal {
Expand All @@ -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 }]"]]
}
}
}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -365,7 +356,7 @@ fn dyn_binders_reverse() {
>
}
} yields {
expect![["Unique; substitution [], lifetime constraints []"]]
expect![["Unique"]]
}
}
}
Expand All @@ -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 }]"]]
}
}
}
Expand All @@ -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"]]
}
}
}
Expand All @@ -430,7 +418,7 @@ fn dyn_well_formed() {
WellFormed(dyn MyTrait + 's)
}
} yields {
expect![["Unique"]]
expect![["Unique; for<?U0> { substitution [?0 := '^0.0] }"]]
}
}
}
4 changes: 2 additions & 2 deletions tests/test/fn_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ fn generic_fn_implements_fn_traits() {
goal {
exists<T> { foo<T>: Fn<(T,)> }
} yields {
expect![["Unique"]]
expect![["Unique; for<?U0> { substitution [?0 := ^0.0] }"]]
}

goal {
Expand All @@ -156,7 +156,7 @@ fn generic_fn_implements_fn_traits() {
goal {
exists<T> { Normalize(<foo<T> as FnOnce<(T,)>>::Output -> T) }
} yields {
expect![["Unique"]]
expect![["Unique; for<?U0> { substitution [?0 := ^0.0] }"]]
}

goal {
Expand Down
Loading

0 comments on commit 1627b6e

Please sign in to comment.