1
Fork 0

Rollup merge of #98136 - fee1-dead-contrib:rename_impl_constness, r=oli-obk

Rename `impl_constness` to `constness`

The current code is a basis for `is_const_fn_raw`, and `impl_constness`
is no longer a valid name, which is previously used for determining the
constness of impls, and not items in general.

r? `@oli-obk`
This commit is contained in:
Dylan DPC 2022-06-19 15:26:28 +02:00 committed by GitHub
commit 6e8f541fff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 26 additions and 26 deletions

View file

@ -970,7 +970,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
if let Some(impl_def_id) = relevant_impl {
// Check that `impl Drop` is actually const, if there is a custom impl
if self.tcx().impl_constness(impl_def_id) == hir::Constness::Const {
if self.tcx().constness(impl_def_id) == hir::Constness::Const {
candidates.vec.push(ConstDestructCandidate(Some(impl_def_id)));
}
} else {

View file

@ -1119,8 +1119,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
if obligation.is_const() {
match candidate {
// const impl
ImplCandidate(def_id)
if tcx.impl_constness(def_id) == hir::Constness::Const => {}
ImplCandidate(def_id) if tcx.constness(def_id) == hir::Constness::Const => {}
// const param
ParamCandidate(trait_pred) if trait_pred.is_const_if_const() => {}
// auto trait impl