Simplify some internal code

Addresses #2709
This commit is contained in:
Cyril Plisko 2018-05-01 20:33:32 +03:00
parent f69dd6ad2c
commit e94ec44ab3

View File

@ -301,9 +301,7 @@ pub fn implements_trait<'a, 'tcx>(
let obligation =
cx.tcx
.predicate_for_trait_def(cx.param_env, traits::ObligationCause::dummy(), trait_id, 0, ty, ty_params);
cx.tcx.infer_ctxt().enter(|infcx| {
traits::SelectionContext::new(&infcx).infcx().predicate_must_hold(&obligation)
})
cx.tcx.infer_ctxt().enter(|infcx| infcx.predicate_must_hold(&obligation))
}
/// Check whether this type implements Drop.