From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_mir_dataflow/src/impls/liveness.rs | 4 ++-- compiler/rustc_mir_dataflow/src/impls/mod.rs | 2 +- compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs | 13 +++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'compiler/rustc_mir_dataflow/src/impls') diff --git a/compiler/rustc_mir_dataflow/src/impls/liveness.rs b/compiler/rustc_mir_dataflow/src/impls/liveness.rs index 3e08a8799..923dc16c1 100644 --- a/compiler/rustc_mir_dataflow/src/impls/liveness.rs +++ b/compiler/rustc_mir_dataflow/src/impls/liveness.rs @@ -149,7 +149,7 @@ enum DefUse { } impl DefUse { - fn apply<'tcx>(trans: &mut impl GenKill, place: Place<'tcx>, context: PlaceContext) { + fn apply(trans: &mut impl GenKill, place: Place<'_>, context: PlaceContext) { match DefUse::for_place(place, context) { Some(DefUse::Def) => trans.kill(place.local), Some(DefUse::Use) => trans.gen(place.local), @@ -157,7 +157,7 @@ impl DefUse { } } - fn for_place<'tcx>(place: Place<'tcx>, context: PlaceContext) -> Option { + fn for_place(place: Place<'_>, context: PlaceContext) -> Option { match context { PlaceContext::NonUse(_) => None, diff --git a/compiler/rustc_mir_dataflow/src/impls/mod.rs b/compiler/rustc_mir_dataflow/src/impls/mod.rs index bc31ec42b..4b5324e20 100644 --- a/compiler/rustc_mir_dataflow/src/impls/mod.rs +++ b/compiler/rustc_mir_dataflow/src/impls/mod.rs @@ -750,7 +750,7 @@ where /// Calls `f` for each mutable borrow or raw reference in the program. /// -/// This DOES NOT call `f` for a shared borrow of a type with interior mutability. That's okay for +/// This DOES NOT call `f` for a shared borrow of a type with interior mutability. That's okay for /// initializedness, because we cannot move from an `UnsafeCell` (outside of `core::cell`), but /// other analyses will likely need to check for `!Freeze`. fn for_each_mut_borrow<'tcx>( diff --git a/compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs b/compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs index 18760b6c6..8d379b90a 100644 --- a/compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs +++ b/compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs @@ -3,20 +3,21 @@ pub use super::*; use crate::{CallReturnPlaces, GenKill, Results, ResultsRefCursor}; use rustc_middle::mir::visit::{NonMutatingUseContext, PlaceContext, Visitor}; use rustc_middle::mir::*; +use std::borrow::Cow; use std::cell::RefCell; #[derive(Clone)] -pub struct MaybeStorageLive { - always_live_locals: BitSet, +pub struct MaybeStorageLive<'a> { + always_live_locals: Cow<'a, BitSet>, } -impl MaybeStorageLive { - pub fn new(always_live_locals: BitSet) -> Self { +impl<'a> MaybeStorageLive<'a> { + pub fn new(always_live_locals: Cow<'a, BitSet>) -> Self { MaybeStorageLive { always_live_locals } } } -impl<'tcx> crate::AnalysisDomain<'tcx> for MaybeStorageLive { +impl<'tcx, 'a> crate::AnalysisDomain<'tcx> for MaybeStorageLive<'a> { type Domain = BitSet; const NAME: &'static str = "maybe_storage_live"; @@ -38,7 +39,7 @@ impl<'tcx> crate::AnalysisDomain<'tcx> for MaybeStorageLive { } } -impl<'tcx> crate::GenKillAnalysis<'tcx> for MaybeStorageLive { +impl<'tcx, 'a> crate::GenKillAnalysis<'tcx> for MaybeStorageLive<'a> { type Idx = Local; fn statement_effect( -- cgit v1.2.3