Skip to content

Commit 5e84273

Browse files
nilehmanngithub-actions[bot]
authored andcommitted
Remove Rvalue::Len
1 parent 596373d commit 5e84273

File tree

4 files changed

+0
-27
lines changed

4 files changed

+0
-27
lines changed

crates/flux-refineck/src/checker.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,6 @@ impl<'ck, 'genv, 'tcx, M: Mode> Checker<'ck, 'genv, 'tcx, M> {
12661266
.with_span(stmt_span)
12671267
}
12681268
Rvalue::NullaryOp(null_op, ty) => Ok(self.check_nullary_op(*null_op, ty)),
1269-
Rvalue::Len(place) => self.check_len(infcx, env, stmt_span, place),
12701269
Rvalue::UnaryOp(UnOp::PtrMetadata, Operand::Copy(place))
12711270
| Rvalue::UnaryOp(UnOp::PtrMetadata, Operand::Move(place)) => {
12721271
self.check_raw_ptr_metadata(infcx, env, stmt_span, place)
@@ -1366,26 +1365,6 @@ impl<'ck, 'genv, 'tcx, M: Mode> Checker<'ck, 'genv, 'tcx, M> {
13661365
}
13671366
}
13681367

1369-
fn check_len(
1370-
&mut self,
1371-
infcx: &mut InferCtxt,
1372-
env: &mut TypeEnv,
1373-
stmt_span: Span,
1374-
place: &Place,
1375-
) -> Result<Ty> {
1376-
let ty = env
1377-
.lookup_place(&mut infcx.at(stmt_span), place)
1378-
.with_span(stmt_span)?;
1379-
1380-
let idx = match ty.kind() {
1381-
TyKind::Indexed(BaseTy::Array(_, len), _) => Expr::from_const(self.genv.tcx(), len),
1382-
TyKind::Indexed(BaseTy::Slice(_), idx) => idx.clone(),
1383-
_ => tracked_span_bug!("check_len: expected array or slice type found `{ty:?}`"),
1384-
};
1385-
1386-
Ok(Ty::indexed(BaseTy::Uint(UintTy::Usize), idx))
1387-
}
1388-
13891368
fn check_binary_op(
13901369
&mut self,
13911370
infcx: &mut InferCtxt,

crates/flux-refineck/src/ghost_statements/fold_unfold.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,6 @@ impl<M: Mode> FoldUnfoldAnalysis<'_, '_, '_, M> {
298298
}
299299
StatementKind::Assign(place, rvalue) => {
300300
match rvalue {
301-
Rvalue::Len(place) => {
302-
M::projection(self, env, place)?;
303-
}
304301
Rvalue::UnaryOp(UnOp::PtrMetadata, Operand::Copy(place))
305302
| Rvalue::UnaryOp(UnOp::PtrMetadata, Operand::Move(place)) => {
306303
let deref_place = place.deref();

crates/flux-rustc-bridge/src/lowering.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,6 @@ impl<'sess, 'tcx> MirLoweringCtxt<'_, 'sess, 'tcx> {
455455
rustc_mir::Rvalue::RawPtr(kind, place) => {
456456
Ok(Rvalue::RawPtr(*kind, lower_place(self.tcx, place)?))
457457
}
458-
rustc_mir::Rvalue::Len(place) => Ok(Rvalue::Len(lower_place(self.tcx, place)?)),
459458
rustc_mir::Rvalue::Cast(kind, op, ty) => {
460459
let kind = self.lower_cast_kind(*kind).ok_or_else(|| {
461460
UnsupportedReason::new(format!("unsupported cast `{kind:?}`"))

crates/flux-rustc-bridge/src/mir.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ pub enum Rvalue {
207207
Repeat(Operand, Const),
208208
Ref(Region, BorrowKind, Place),
209209
RawPtr(RawPtrKind, Place),
210-
Len(Place),
211210
Cast(CastKind, Operand, Ty),
212211
BinaryOp(BinOp, Operand, Operand),
213212
NullaryOp(NullOp, Ty),
@@ -721,7 +720,6 @@ impl fmt::Debug for Rvalue {
721720
Rvalue::Aggregate(AggregateKind::Tuple, args) => {
722721
write!(f, "({:?})", args.iter().format(", "))
723722
}
724-
Rvalue::Len(place) => write!(f, "Len({place:?})"),
725723
Rvalue::Cast(kind, op, ty) => write!(f, "{op:?} as {ty:?} [{kind:?}]"),
726724
Rvalue::Repeat(op, c) => write!(f, "[{op:?}; {c:?}]"),
727725
Rvalue::ShallowInitBox(op, ty) => write!(f, "ShallowInitBox({op:?}, {ty:?})"),

0 commit comments

Comments
 (0)