Skip to content

Commit

Permalink
Merge pull request #4103 from RalfJung/remove-unused
Browse files Browse the repository at this point in the history
remove an unused helper method
  • Loading branch information
RalfJung authored Dec 21, 2024
2 parents fd532c1 + 7cdc6ea commit b8c5f1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,19 +332,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
base: &P,
name: &str,
) -> InterpResult<'tcx, P> {
if let Some(field) = self.try_project_field_named(base, name)? {
return interp_ok(field);
}
bug!("No field named {} in type {}", name, base.layout().ty);
}

/// Search if `base` (which must be a struct or union type) contains the `name` field.
fn projectable_has_field<P: Projectable<'tcx, Provenance>>(
&self,
base: &P,
name: &str,
) -> bool {
self.try_project_field_named(base, name).unwrap().is_some()
interp_ok(
self.try_project_field_named(base, name)?
.unwrap_or_else(|| bug!("no field named {} in type {}", name, base.layout().ty)),
)
}

/// Write an int of the appropriate size to `dest`. The target type may be signed or unsigned,
Expand Down
2 changes: 1 addition & 1 deletion src/shims/native_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
// Wildcard pointer, whatever it points to must be already exposed.
continue;
};
// The first time this happens at a particular location, print a warning.
// The first time this happens, print a warning.
thread_local! {
static HAVE_WARNED: RefCell<bool> = const { RefCell::new(false) };
}
Expand Down

0 comments on commit b8c5f1d

Please sign in to comment.