Skip to content

Commit b4d0457

Browse files
committed
Use exhaustive match in const_prop.rs
1 parent 0ca7f74 commit b4d0457

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/librustc_mir/transform/const_prop.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,20 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
638638

639639
return None;
640640
}
641+
Rvalue::ThreadLocalRef(def_id) => {
642+
trace!("skipping ThreadLocalRef({:?})", def_id);
641643

642-
_ => {}
644+
return None;
645+
}
646+
647+
// There's no other checking to do at this time.
648+
Rvalue::Aggregate(..)
649+
| Rvalue::Use(..)
650+
| Rvalue::Repeat(..)
651+
| Rvalue::Len(..)
652+
| Rvalue::Cast(..)
653+
| Rvalue::Discriminant(..)
654+
| Rvalue::NullaryOp(..) => {}
643655
}
644656

645657
// FIXME we need to revisit this for #67176

0 commit comments

Comments
 (0)