diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /compiler/rustc_mir_dataflow/src/impls | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_mir_dataflow/src/impls')
-rw-r--r-- | compiler/rustc_mir_dataflow/src/impls/liveness.rs | 4 | ||||
-rw-r--r-- | compiler/rustc_mir_dataflow/src/impls/mod.rs | 2 | ||||
-rw-r--r-- | compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs | 13 |
3 files changed, 10 insertions, 9 deletions
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<Local>, place: Place<'tcx>, context: PlaceContext) { + fn apply(trans: &mut impl GenKill<Local>, 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<DefUse> { + fn for_place(place: Place<'_>, context: PlaceContext) -> Option<DefUse> { 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<Local>, +pub struct MaybeStorageLive<'a> { + always_live_locals: Cow<'a, BitSet<Local>>, } -impl MaybeStorageLive { - pub fn new(always_live_locals: BitSet<Local>) -> Self { +impl<'a> MaybeStorageLive<'a> { + pub fn new(always_live_locals: Cow<'a, BitSet<Local>>) -> Self { MaybeStorageLive { always_live_locals } } } -impl<'tcx> crate::AnalysisDomain<'tcx> for MaybeStorageLive { +impl<'tcx, 'a> crate::AnalysisDomain<'tcx> for MaybeStorageLive<'a> { type Domain = BitSet<Local>; 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( |