-
Notifications
You must be signed in to change notification settings - Fork 391
lvalue references into fields of ValPair locals #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/eval_context.rs
Outdated
let mut allocs = Vec::new(); | ||
let mut msg = format!("{:?}", local); | ||
let last_frame = self.stack.len() - 1; | ||
if frame != last_frame { | ||
write!(msg, " ({} frames up)", last_frame - frame).unwrap(); | ||
} | ||
if let Some(field) = field { | ||
write!(msg, " (field {:?})", field).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you print it like {local}.{field}
, e.g. _42.1: Bytes(13)
?
return Ok(base); | ||
}, | ||
Value::ByValPair(_, _) => { | ||
assert!(field_index < 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we know this won't be hit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We most likely can hit it with zst fields, but right now we don't create any ByValPairs for custom structs.
src/eval_context.rs
Outdated
@@ -1367,13 +1367,13 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> { | |||
if let Lvalue::Local { frame, local, field } = lvalue { | |||
let mut allocs = Vec::new(); | |||
let mut msg = format!("{:?}", local); | |||
if let Some(field) = field { | |||
write!(msg, ".{}", field).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This failed to compile, and the error message makes me realize it should only be printing the index part of the field
tuple.
Update the README for the hashbrown-based implementation
I ran this on the rustc test suite and found no regressions, but your changes also came in there (and reduced the number of errors significantly), so maybe I don't see something.
more groundwork towards