cleanup op_to_const a bit; rename ConstValue::ByRef → Indirect

This commit is contained in:
Ralf Jung 2023-09-12 07:49:25 +02:00
parent 2aaaeb4e81
commit b2d5d68c58
2 changed files with 2 additions and 2 deletions

View file

@ -232,7 +232,7 @@ fn path_to_matched_type(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> Option<Ve
cx.tcx.type_of(def_id).instantiate_identity(),
),
Res::Def(DefKind::Const, def_id) => match cx.tcx.const_eval_poly(def_id).ok()? {
ConstValue::ByRef { alloc, offset } if offset.bytes() == 0 => {
ConstValue::Indirect { alloc, offset } if offset.bytes() == 0 => {
read_mir_alloc_def_path(cx, alloc.inner(), cx.tcx.type_of(def_id).instantiate_identity())
},
_ => None,