add note suggesting that predicate is satisfied but is not const
This commit is contained in:
@@ -803,6 +803,10 @@ impl<'tcx> PolyTraitPredicate<'tcx> {
|
||||
p
|
||||
});
|
||||
}
|
||||
|
||||
pub fn is_const(self) -> bool {
|
||||
self.skip_binder().constness == BoundConstness::ConstIfConst
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)]
|
||||
@@ -1388,6 +1392,10 @@ impl<'tcx> ParamEnv<'tcx> {
|
||||
self.packed.tag().constness
|
||||
}
|
||||
|
||||
pub fn is_const(self) -> bool {
|
||||
self.packed.tag().constness == hir::Constness::Const
|
||||
}
|
||||
|
||||
/// Construct a trait environment with no where-clauses in scope
|
||||
/// where the values of all `impl Trait` and other hidden types
|
||||
/// are revealed. This is suitable for monomorphized, post-typeck
|
||||
@@ -1503,6 +1511,7 @@ impl<'tcx> PolyTraitRef<'tcx> {
|
||||
polarity: ty::ImplPolarity::Positive,
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn without_const(self) -> PolyTraitPredicate<'tcx> {
|
||||
self.with_constness(BoundConstness::NotConst)
|
||||
|
||||
Reference in New Issue
Block a user