Skip to content

Commit bf1e4a1

Browse files
committed
make struct-variant matches less future-proof, and other clippy fixes
1 parent 667da1e commit bf1e4a1

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
865865
let this = self.eval_context_mut();
866866
let new_perm = NewPermission::from_ref_ty(val.layout.ty, kind, this);
867867
let cause = match kind {
868-
RetagKind::TwoPhase { .. } => RetagCause::TwoPhase,
868+
RetagKind::TwoPhase => RetagCause::TwoPhase,
869869
RetagKind::FnEntry => unreachable!(),
870870
RetagKind::Raw | RetagKind::Default => RetagCause::Normal,
871871
};
@@ -880,7 +880,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
880880
let this = self.eval_context_mut();
881881
let retag_fields = this.machine.borrow_tracker.as_mut().unwrap().get_mut().retag_fields;
882882
let retag_cause = match kind {
883-
RetagKind::TwoPhase { .. } => unreachable!(), // can only happen in `retag_ptr_value`
883+
RetagKind::TwoPhase => unreachable!(), // can only happen in `retag_ptr_value`
884884
RetagKind::FnEntry => RetagCause::FnEntry,
885885
RetagKind::Default | RetagKind::Raw => RetagCause::Normal,
886886
};

src/tools/miri/src/eval.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,15 +558,15 @@ where
558558

559559
match chars.next() {
560560
Some('"') => {
561-
cmd.extend(iter::repeat('\\').take(nslashes * 2 + 1));
561+
cmd.extend(iter::repeat_n('\\', nslashes * 2 + 1));
562562
cmd.push('"');
563563
}
564564
Some(c) => {
565-
cmd.extend(iter::repeat('\\').take(nslashes));
565+
cmd.extend(iter::repeat_n('\\', nslashes));
566566
cmd.push(c);
567567
}
568568
None => {
569-
cmd.extend(iter::repeat('\\').take(nslashes * 2));
569+
cmd.extend(iter::repeat_n('\\', nslashes * 2));
570570
break;
571571
}
572572
}

src/tools/miri/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
clippy::needless_question_mark,
3737
clippy::needless_lifetimes,
3838
clippy::too_long_first_doc_paragraph,
39+
// Temporarily disabled as fixing it would cause conflicts
40+
clippy::manual_repeat_n,
41+
// We don't use translatable diagnostics
3942
rustc::diagnostic_outside_of_impl,
4043
// We are not implementing queries here so it's fine
4144
rustc::potential_query_instability,

0 commit comments

Comments
 (0)