Use the constness from the param env instead of having a separate dimension for it

This breaks a ~const test that will be fixed in a follow up commit of this PR
This commit is contained in:
Oli Scherer 2021-10-21 16:07:37 +00:00 committed by Deadbeef
parent 19f2101272
commit d51068ca28
No known key found for this signature in database
GPG key ID: 6D017A96D8E6C2F9
12 changed files with 25 additions and 142 deletions

View file

@ -817,8 +817,7 @@ impl Visitor<'tcx> for Checker<'mir, 'tcx> {
);
let implsrc = tcx.infer_ctxt().enter(|infcx| {
let mut selcx =
SelectionContext::with_constness(&infcx, hir::Constness::Const);
let mut selcx = SelectionContext::new(&infcx);
selcx.select(&obligation)
});

View file

@ -3,7 +3,6 @@
//! See the `Qualif` trait for more info.
use rustc_errors::ErrorReported;
use rustc_hir as hir;
use rustc_infer::infer::TyCtxtInferExt;
use rustc_middle::mir::*;
use rustc_middle::ty::{self, subst::SubstsRef, AdtDef, Ty};
@ -167,7 +166,7 @@ impl Qualif for NeedsNonConstDrop {
);
let implsrc = cx.tcx.infer_ctxt().enter(|infcx| {
let mut selcx = SelectionContext::with_constness(&infcx, hir::Constness::Const);
let mut selcx = SelectionContext::new(&infcx);
selcx.select(&obligation)
});
!matches!(