Skip to content

Commit 9c87ec8

Browse files
committed
remove an unused helper method
1 parent 268a5f4 commit 9c87ec8

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

Diff for: src/tools/miri/src/helpers.rs

+4-13
Original file line numberDiff line numberDiff line change
@@ -332,19 +332,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
332332
base: &P,
333333
name: &str,
334334
) -> InterpResult<'tcx, P> {
335-
if let Some(field) = self.try_project_field_named(base, name)? {
336-
return interp_ok(field);
337-
}
338-
bug!("No field named {} in type {}", name, base.layout().ty);
339-
}
340-
341-
/// Search if `base` (which must be a struct or union type) contains the `name` field.
342-
fn projectable_has_field<P: Projectable<'tcx, Provenance>>(
343-
&self,
344-
base: &P,
345-
name: &str,
346-
) -> bool {
347-
self.try_project_field_named(base, name).unwrap().is_some()
335+
interp_ok(
336+
self.try_project_field_named(base, name)?
337+
.unwrap_or_else(|| bug!("no field named {} in type {}", name, base.layout().ty)),
338+
)
348339
}
349340

350341
/// Write an int of the appropriate size to `dest`. The target type may be signed or unsigned,

Diff for: src/tools/miri/src/shims/native_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
173173
// Wildcard pointer, whatever it points to must be already exposed.
174174
continue;
175175
};
176-
// The first time this happens at a particular location, print a warning.
176+
// The first time this happens, print a warning.
177177
thread_local! {
178178
static HAVE_WARNED: RefCell<bool> = const { RefCell::new(false) };
179179
}

0 commit comments

Comments
 (0)