From 6c4feb681f8062060ed0c21d311c27eba8791d42 Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Sat, 25 Jul 2020 15:14:12 +0100 Subject: [PATCH] Fix bootstrap --- compiler/rustc_trait_selection/src/traits/project.rs | 4 +++- .../src/traits/select/candidate_assembly.rs | 2 +- src/test/ui/issues/issue-60283.rs | 2 +- src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index c33c8a67aa8..518719d76d4 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -978,7 +978,9 @@ fn assemble_candidates_from_predicates<'cx, 'tcx>( if is_match { candidate_set.push_candidate(ctor(data)); - if potentially_unnormalized_candidates && !obligation.predicate.needs_infer() { + if potentially_unnormalized_candidates + && !obligation.predicate.has_infer_types_or_consts() + { // HACK: Pick the first trait def candidate for a fully // inferred predicate. This is to allow duplicates that // differ only in normalization. diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index 1ac9be64f1f..038ba431c47 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -165,7 +165,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { debug!("winnowed to {} candidates for {:?}: {:?}", candidates.len(), stack, candidates); - let needs_infer = stack.obligation.predicate.needs_infer(); + let needs_infer = stack.obligation.predicate.has_infer_types_or_consts(); // If there are STILL multiple candidates, we can further // reduce the list by dropping duplicates -- including diff --git a/src/test/ui/issues/issue-60283.rs b/src/test/ui/issues/issue-60283.rs index 9f4813071a1..c63b1544a53 100644 --- a/src/test/ui/issues/issue-60283.rs +++ b/src/test/ui/issues/issue-60283.rs @@ -16,5 +16,5 @@ where fn main() { foo((), drop) //~^ ERROR type mismatch in function arguments - //~| ERROR the size for values of type `<() as Trait<'_>>::Item` cannot be known at compilation time + //~| ERROR size for values of type `<() as Trait<'_>>::Item` cannot be known at compilation time } diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr index 42468b91a62..574be0eb0a2 100644 --- a/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr +++ b/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr @@ -12,8 +12,8 @@ error[E0308]: mismatched types LL | type X<'a> = impl Into<&'static str> + From<&'a str>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | - = note: expected type `std::convert::From<&'a str>` - found type `std::convert::From<&'static str>` + = note: expected trait `std::convert::From<&'a str>` + found trait `std::convert::From<&'static str>` note: the lifetime `'a` as defined on the item at 6:8... --> $DIR/bounds-are-checked.rs:6:8 |