Skip to content

Commit b5343d6

Browse files
committed
rename def_id -> static_def_id
1 parent 4920a33 commit b5343d6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/librustc_mir/const_eval/machine.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -350,15 +350,15 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter {
350350
memory_extra: &MemoryExtra,
351351
alloc_id: AllocId,
352352
allocation: &Allocation,
353-
def_id: Option<DefId>,
353+
static_def_id: Option<DefId>,
354354
is_write: bool,
355355
) -> InterpResult<'tcx> {
356356
if is_write && allocation.mutability == Mutability::Not {
357357
Err(err_ub!(WriteToReadOnly(alloc_id)).into())
358358
} else if is_write {
359359
Err(ConstEvalErrKind::ModifiedGlobal.into())
360-
} else if memory_extra.can_access_statics || def_id.is_none() {
361-
// `def_id.is_none()` indicates this is not a static, but a const or so.
360+
} else if memory_extra.can_access_statics || static_def_id.is_none() {
361+
// `static_def_id.is_none()` indicates this is not a static, but a const or so.
362362
Ok(())
363363
} else {
364364
Err(ConstEvalErrKind::ConstAccessesStatic.into())

src/librustc_mir/interpret/machine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ pub trait Machine<'mir, 'tcx>: Sized {
215215
_memory_extra: &Self::MemoryExtra,
216216
_alloc_id: AllocId,
217217
_allocation: &Allocation,
218-
_def_id: Option<DefId>,
218+
_static_def_id: Option<DefId>,
219219
_is_write: bool,
220220
) -> InterpResult<'tcx> {
221221
Ok(())

src/librustc_mir/transform/const_prop.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine {
274274
_memory_extra: &(),
275275
_alloc_id: AllocId,
276276
allocation: &Allocation<Self::PointerTag, Self::AllocExtra>,
277-
def_id: Option<DefId>,
277+
static_def_id: Option<DefId>,
278278
is_write: bool,
279279
) -> InterpResult<'tcx> {
280280
if is_write {
@@ -285,7 +285,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine {
285285
if allocation.mutability == Mutability::Mut {
286286
throw_machine_stop_str!("can't eval mutable globals in ConstProp");
287287
}
288-
if def_id.is_some() && allocation.relocations().len() > 0 {
288+
if static_def_id.is_some() && allocation.relocations().len() > 0 {
289289
throw_machine_stop_str!("can't eval statics with pointers in ConstProp");
290290
}
291291

0 commit comments

Comments
 (0)