Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
Local(mir::RETURN_POINTER) => self.frame().return_lvalue,
Local(local) => Lvalue::Local { frame: self.stack.len() - 1, local, field: None },

Static(def_id) => {
Static(ref statik) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/statik/static_/

I prefer to use a deterministic keyword renaming (append _) rather than coming up with weird unique replacements.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm, I was just following the style seen in rustc (krate)

let substs = self.tcx.intern_substs(&[]);
Lvalue::Global(GlobalId { def_id, substs, promoted: None })
Lvalue::Global(GlobalId { def_id: statik.def_id, substs, promoted: None })
}

Projection(ref proj) => return self.eval_lvalue_projection(proj),
Expand Down
3 changes: 2 additions & 1 deletion src/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for ConstantExtractor<'a, 'b, 'tcx> {
location: mir::Location
) {
self.super_lvalue(lvalue, context, location);
if let mir::Lvalue::Static(def_id) = *lvalue {
if let mir::Lvalue::Static(ref statik) = *lvalue {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/statik/static_/

let def_id = statik.def_id;
let substs = self.ecx.tcx.intern_substs(&[]);
let span = self.span;
if let Some(node_item) = self.ecx.tcx.hir.get_if_local(def_id) {
Expand Down