Skip to content

Commit 9e00fb0

Browse files
committed
tweak some bug!s
1 parent c7b0452 commit 9e00fb0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

compiler/rustc_const_eval/src/interpret/intrinsics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
169169
sym::needs_drop => self.tcx.types.bool,
170170
sym::type_id => self.tcx.types.u64,
171171
sym::type_name => self.tcx.mk_static_str(),
172-
_ => bug!("already checked for nullary intrinsics"),
172+
_ => bug!(),
173173
};
174174
let val =
175175
self.tcx.const_eval_global_id(self.param_env, gid, Some(self.tcx.span))?;
@@ -215,7 +215,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
215215
sym::add_with_overflow => BinOp::Add,
216216
sym::sub_with_overflow => BinOp::Sub,
217217
sym::mul_with_overflow => BinOp::Mul,
218-
_ => bug!("Already checked for int ops"),
218+
_ => bug!(),
219219
};
220220
self.binop_with_overflow(bin_op, &lhs, &rhs, dest)?;
221221
}
@@ -251,7 +251,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
251251
sym::unchecked_mul => BinOp::Mul,
252252
sym::unchecked_div => BinOp::Div,
253253
sym::unchecked_rem => BinOp::Rem,
254-
_ => bug!("Already checked for int ops"),
254+
_ => bug!(),
255255
};
256256
let (val, overflowed, _ty) = self.overflowing_binary_op(bin_op, &l, &r)?;
257257
if overflowed {

compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
7070
}
7171
}
7272

73-
bug!("no non-`#[track_caller]` frame found")
73+
span_bug!(self.cur_span(), "no non-`#[track_caller]` frame found")
7474
}
7575

7676
/// Allocate a `const core::panic::Location` with the provided filename and line/column numbers.

compiler/rustc_const_eval/src/interpret/operator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
154154
let result = match bin_op {
155155
Shl => l.checked_shl(r).unwrap(),
156156
Shr => l.checked_shr(r).unwrap(),
157-
_ => bug!("it has already been checked that this is a shift op"),
157+
_ => bug!(),
158158
};
159159
result as u128
160160
} else {
161161
match bin_op {
162162
Shl => l.checked_shl(r).unwrap(),
163163
Shr => l.checked_shr(r).unwrap(),
164-
_ => bug!("it has already been checked that this is a shift op"),
164+
_ => bug!(),
165165
}
166166
};
167167
let truncated = self.truncate(result, left_layout);

0 commit comments

Comments
 (0)