Skip to content

Commit b2d5d68

Browse files
committed
cleanup op_to_const a bit; rename ConstValue::ByRef → Indirect
1 parent 2aaaeb4 commit b2d5d68

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/utils/internal_lints/unnecessary_def_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ fn path_to_matched_type(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> Option<Ve
232232
cx.tcx.type_of(def_id).instantiate_identity(),
233233
),
234234
Res::Def(DefKind::Const, def_id) => match cx.tcx.const_eval_poly(def_id).ok()? {
235-
ConstValue::ByRef { alloc, offset } if offset.bytes() == 0 => {
235+
ConstValue::Indirect { alloc, offset } if offset.bytes() == 0 => {
236236
read_mir_alloc_def_path(cx, alloc.inner(), cx.tcx.type_of(def_id).instantiate_identity())
237237
},
238238
_ => None,

clippy_utils/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ pub fn miri_to_const<'tcx>(lcx: &LateContext<'tcx>, result: mir::ConstantKind<'t
684684
},
685685
_ => None,
686686
},
687-
mir::ConstantKind::Val(ConstValue::ByRef { alloc_id, offset: _ }, _) => {
687+
mir::ConstantKind::Val(ConstValue::Indirect { alloc_id, offset: _ }, _) => {
688688
let alloc = lcx.tcx.global_alloc(alloc_id).unwrap_memory();
689689
match result.ty().kind() {
690690
ty::Adt(adt_def, _) if adt_def.is_struct() => Some(Constant::Adt(result)),

0 commit comments

Comments
 (0)