drive-by: use is_const and is_const_if_const

This commit is contained in:
Michael Goulet 2022-01-26 19:24:01 -08:00
parent 1ab97dbc52
commit c6de4d55aa
7 changed files with 16 additions and 15 deletions

View file

@ -1173,9 +1173,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
ImplCandidate(def_id)
if tcx.impl_constness(def_id) == hir::Constness::Const => {}
// const param
ParamCandidate(trait_pred)
if trait_pred.skip_binder().constness
== ty::BoundConstness::ConstIfConst => {}
ParamCandidate(trait_pred) if trait_pred.is_const_if_const() => {}
// auto trait impl
AutoImplCandidate(..) => {}
// generator, this will raise error in other places