Skip to content

Commit 408ba98

Browse files
committed
Derive traversable impls for BindingForm
BindingForm has been a no-op traversable ever since it was first added in cac6126, but it was modified in 0193d1f to (optionally) contain a Place without its implementations being updated to fold/visit such. By using the derive macro to implement the visitable traits, we ensure that all contained types of interest are folded/visited.
1 parent 99e070f commit 408ba98

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_middle/src/mir

1 file changed

+3
-3
lines changed

Diff for: compiler/rustc_middle/src/mir/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ pub enum LocalKind {
674674
ReturnPointer,
675675
}
676676

677-
#[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable)]
677+
#[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)]
678678
pub struct VarBindingForm<'tcx> {
679679
/// Is variable bound via `x`, `mut x`, `ref x`, or `ref mut x`?
680680
pub binding_mode: ty::BindingMode,
@@ -696,7 +696,7 @@ pub struct VarBindingForm<'tcx> {
696696
pub pat_span: Span,
697697
}
698698

699-
#[derive(Clone, Debug, TyEncodable, TyDecodable)]
699+
#[derive(Clone, Debug, TyEncodable, TyDecodable, TypeFoldable, TypeVisitable)]
700700
pub enum BindingForm<'tcx> {
701701
/// This is a binding for a non-`self` binding, or a `self` that has an explicit type.
702702
Var(VarBindingForm<'tcx>),
@@ -706,7 +706,7 @@ pub enum BindingForm<'tcx> {
706706
RefForGuard,
707707
}
708708

709-
TrivialTypeTraversalAndLiftImpls! {
709+
CloneLiftImpls! {
710710
for<'tcx> {
711711
BindingForm<'tcx>,
712712
}

0 commit comments

Comments
 (0)