bring back un_derefer and rewrite it again

This commit is contained in:
DrMeepster
2023-07-04 00:39:30 -07:00
parent 4fbd6d5af4
commit d1c9696b7d
6 changed files with 112 additions and 112 deletions

View File

@@ -731,11 +731,11 @@ fn switch_on_enum_discriminant<'mir, 'tcx>(
struct OnMutBorrow<F>(F);
impl<F> Visitor<'_> for OnMutBorrow<F>
impl<'tcx, F> Visitor<'tcx> for OnMutBorrow<F>
where
F: FnMut(&mir::Place<'_>),
F: FnMut(&mir::Place<'tcx>),
{
fn visit_rvalue(&mut self, rvalue: &mir::Rvalue<'_>, location: Location) {
fn visit_rvalue(&mut self, rvalue: &mir::Rvalue<'tcx>, location: Location) {
// FIXME: Does `&raw const foo` allow mutation? See #90413.
match rvalue {
mir::Rvalue::Ref(_, mir::BorrowKind::Mut { .. }, place)
@@ -756,7 +756,7 @@ where
fn for_each_mut_borrow<'tcx>(
mir: &impl MirVisitable<'tcx>,
location: Location,
f: impl FnMut(&mir::Place<'_>),
f: impl FnMut(&mir::Place<'tcx>),
) {
let mut vis = OnMutBorrow(f);