This commit is contained in:
Matthias Krüger 2020-04-11 01:41:52 +02:00
parent 5e8c0c5ae0
commit f7bdead5ec
2 changed files with 8 additions and 3 deletions

View File

@ -113,8 +113,8 @@ fn check_fn(
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.to_vec())
.filter(|p| !p.is_global())
.filter_map(|pred| {
if let ty::Predicate::Trait(poly_trait_ref, _) = pred {
.filter_map(|obligation| {
if let ty::Predicate::Trait(poly_trait_ref, _) = obligation.predicate {
if poly_trait_ref.def_id() == sized_trait || poly_trait_ref.skip_binder().has_escaping_bound_vars()
{
return None;

View File

@ -1389,7 +1389,12 @@ pub fn fn_has_unsatisfiable_preds(cx: &LateContext<'_, '_>, did: DefId) -> bool
.iter()
.filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None })
.collect();
!traits::normalize_and_test_predicates(cx.tcx, traits::elaborate_predicates(cx.tcx, predicates).collect())
!traits::normalize_and_test_predicates(
cx.tcx,
traits::elaborate_predicates(cx.tcx, predicates)
.map(|o| o.predicate)
.collect::<Vec<_>>(),
)
}
#[cfg(test)]