Revert "Auto merge of #133734 - scottmcm:lower-indexing-to-ptrmetadata, r=davidtwco,RalfJung"
This reverts commitb57d93d8b9
, reversing changes made to0aeaa5eb22
.
This commit is contained in:
parent
0bb4880581
commit
122a55bb44
100 changed files with 1663 additions and 1451 deletions
|
@ -580,27 +580,12 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
|
|||
) => {}
|
||||
Rvalue::ShallowInitBox(_, _) => {}
|
||||
|
||||
Rvalue::UnaryOp(op, operand) => {
|
||||
Rvalue::UnaryOp(_, operand) => {
|
||||
let ty = operand.ty(self.body, self.tcx);
|
||||
match op {
|
||||
UnOp::Not | UnOp::Neg => {
|
||||
if is_int_bool_float_or_char(ty) {
|
||||
// Int, bool, float, and char operations are fine.
|
||||
} else {
|
||||
span_bug!(
|
||||
self.span,
|
||||
"non-primitive type in `Rvalue::UnaryOp{op:?}`: {ty:?}",
|
||||
);
|
||||
}
|
||||
}
|
||||
UnOp::PtrMetadata => {
|
||||
if !ty.is_ref() && !ty.is_unsafe_ptr() {
|
||||
span_bug!(
|
||||
self.span,
|
||||
"non-pointer type in `Rvalue::UnaryOp({op:?})`: {ty:?}",
|
||||
);
|
||||
}
|
||||
}
|
||||
if is_int_bool_float_or_char(ty) {
|
||||
// Int, bool, float, and char operations are fine.
|
||||
} else {
|
||||
span_bug!(self.span, "non-primitive type in `Rvalue::UnaryOp`: {:?}", ty);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue