Skip to content

Miri error reform #69839

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

Merged
merged 10 commits into from
Mar 19, 2020
Prev Previous commit
Next Next commit
fmt, and fix rustfmt-induced rebase hickup
  • Loading branch information
RalfJung committed Mar 11, 2020
commit 3ebcd78b4285cee14f6b479d33bc939a5cc0414b
7 changes: 2 additions & 5 deletions src/librustc_mir/interpret/terminator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
// this is a single iterator (that handles `spread_arg`), then
// `pass_argument` would be the loop body. It takes care to
// not advance `caller_iter` for ZSTs.
let mut locals_iter = body.args_iter();
while let Some(local) = locals_iter.next() {
for local in body.args_iter() {
let dest = self.eval_place(&mir::Place::from(local))?;
if Some(local) == body.spread_arg {
// Must be a tuple
Expand All @@ -340,9 +339,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
}
// Now we should have no more caller args
if caller_iter.next().is_some() {
throw_ub_format!(
"calling a function with more arguments than it expected"
)
throw_ub_format!("calling a function with more arguments than it expected")
}
// Don't forget to check the return type!
if let Some((caller_ret, _)) = ret {
Expand Down