Skip to content

Commit 3bcce82

Browse files
committed
Auto merge of #87424 - RalfJung:const-check, r=oli-obk
rename const checking visitor module to check_consts::check This avoids naming ambiguities with "const validation" which is in `interpret/validity.rs` and checks *values*. r? `@oli-obk`
2 parents 0ded6ad + 83bc657 commit 3bcce82

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

compiler/rustc_mir/src/transform/check_consts/validation.rs renamed to compiler/rustc_mir/src/transform/check_consts/check.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl Qualifs<'mir, 'tcx> {
180180
}
181181
}
182182

183-
pub struct Validator<'mir, 'tcx> {
183+
pub struct Checker<'mir, 'tcx> {
184184
ccx: &'mir ConstCx<'mir, 'tcx>,
185185
qualifs: Qualifs<'mir, 'tcx>,
186186

@@ -194,17 +194,17 @@ pub struct Validator<'mir, 'tcx> {
194194
secondary_errors: Vec<Diagnostic>,
195195
}
196196

197-
impl Deref for Validator<'mir, 'tcx> {
197+
impl Deref for Checker<'mir, 'tcx> {
198198
type Target = ConstCx<'mir, 'tcx>;
199199

200200
fn deref(&self) -> &Self::Target {
201201
&self.ccx
202202
}
203203
}
204204

205-
impl Validator<'mir, 'tcx> {
205+
impl Checker<'mir, 'tcx> {
206206
pub fn new(ccx: &'mir ConstCx<'mir, 'tcx>) -> Self {
207-
Validator {
207+
Checker {
208208
span: ccx.body.span,
209209
ccx,
210210
qualifs: Default::default(),
@@ -477,7 +477,7 @@ impl Validator<'mir, 'tcx> {
477477
}
478478
}
479479

480-
impl Visitor<'tcx> for Validator<'mir, 'tcx> {
480+
impl Visitor<'tcx> for Checker<'mir, 'tcx> {
481481
fn visit_basic_block_data(&mut self, bb: BasicBlock, block: &BasicBlockData<'tcx>) {
482482
trace!("visit_basic_block_data: bb={:?} is_cleanup={:?}", bb, block.is_cleanup);
483483

compiler/rustc_mir/src/transform/check_consts/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ use rustc_span::Symbol;
1313

1414
pub use self::qualifs::Qualif;
1515

16+
pub mod check;
1617
mod ops;
1718
pub mod post_drop_elaboration;
1819
pub mod qualifs;
1920
mod resolver;
20-
pub mod validation;
2121

2222
/// Information about the item currently being const-checked, as well as a reference to the global
2323
/// context.

compiler/rustc_mir/src/transform/check_consts/post_drop_elaboration.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use rustc_middle::mir::{self, BasicBlock, Location};
33
use rustc_middle::ty::TyCtxt;
44
use rustc_span::Span;
55

6+
use super::check::Qualifs;
67
use super::ops::{self, NonConstOp};
78
use super::qualifs::{NeedsDrop, Qualif};
8-
use super::validation::Qualifs;
99
use super::ConstCx;
1010

1111
/// Returns `true` if we should use the more precise live drop checker that runs after drop

compiler/rustc_mir/src/transform/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ fn mir_const_qualif(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) ->
241241

242242
let ccx = check_consts::ConstCx { body, tcx, const_kind, param_env: tcx.param_env(def.did) };
243243

244-
let mut validator = check_consts::validation::Validator::new(&ccx);
244+
let mut validator = check_consts::check::Checker::new(&ccx);
245245
validator.check_body();
246246

247247
// We return the qualifs in the return place for every MIR body, even though it is only used

0 commit comments

Comments
 (0)