diff options
| author | Jeremy Stucki <dev@jeremystucki.ch> | 2022-12-20 22:10:40 +0100 |
|---|---|---|
| committer | Jeremy Stucki <dev@jeremystucki.ch> | 2022-12-20 22:10:40 +0100 |
| commit | 3dde32ca974721daa4dfd526226d6c9e707fd8af (patch) | |
| tree | 5d6407e56538d2c5e2e0a5a8e8ed9981ec95adda /compiler/rustc_mir_build/src/thir | |
| parent | 65bd2a6a73d6a74fb1266a1d96b23de8810a5fb2 (diff) | |
| download | rust-3dde32ca974721daa4dfd526226d6c9e707fd8af.tar.gz rust-3dde32ca974721daa4dfd526226d6c9e707fd8af.zip | |
rustc: Remove needless lifetimes
Diffstat (limited to 'compiler/rustc_mir_build/src/thir')
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/cx/mod.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs | 4 |
3 files changed, 7 insertions, 10 deletions
diff --git a/compiler/rustc_mir_build/src/thir/cx/mod.rs b/compiler/rustc_mir_build/src/thir/cx/mod.rs index b5c4b7b137d..a355e1bdab5 100644 --- a/compiler/rustc_mir_build/src/thir/cx/mod.rs +++ b/compiler/rustc_mir_build/src/thir/cx/mod.rs @@ -18,10 +18,10 @@ use rustc_middle::thir::*; use rustc_middle::ty::{self, RvalueScopes, TyCtxt}; use rustc_span::Span; -pub(crate) fn thir_body<'tcx>( - tcx: TyCtxt<'tcx>, +pub(crate) fn thir_body( + tcx: TyCtxt<'_>, owner_def: ty::WithOptConstParam<LocalDefId>, -) -> Result<(&'tcx Steal<Thir<'tcx>>, ExprId), ErrorGuaranteed> { +) -> Result<(&Steal<Thir<'_>>, ExprId), ErrorGuaranteed> { let hir = tcx.hir(); let body = hir.body(hir.body_owned_by(owner_def.did)); let mut cx = Cx::new(tcx, owner_def); @@ -52,10 +52,7 @@ pub(crate) fn thir_body<'tcx>( Ok((tcx.alloc_steal_thir(cx.thir), expr)) } -pub(crate) fn thir_tree<'tcx>( - tcx: TyCtxt<'tcx>, - owner_def: ty::WithOptConstParam<LocalDefId>, -) -> String { +pub(crate) fn thir_tree(tcx: TyCtxt<'_>, owner_def: ty::WithOptConstParam<LocalDefId>) -> String { match thir_body(tcx, owner_def) { Ok((thir, _)) => format!("{:#?}", thir.steal()), Err(_) => "error".into(), diff --git a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs index 7e1f708b0d6..6470efab2e9 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs @@ -70,7 +70,7 @@ mod fallback_to_const_ref { /// hoops to get a reference to the value. pub(super) struct FallbackToConstRef(()); - pub(super) fn fallback_to_const_ref<'tcx>(c2p: &super::ConstToPat<'tcx>) -> FallbackToConstRef { + pub(super) fn fallback_to_const_ref(c2p: &super::ConstToPat<'_>) -> FallbackToConstRef { assert!(c2p.behind_reference.get()); FallbackToConstRef(()) } diff --git a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs index 18e9c69c487..a95349d7670 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs @@ -404,7 +404,7 @@ impl SplitIntRange { } /// Iterate over the contained ranges. - fn iter<'a>(&'a self) -> impl Iterator<Item = IntRange> + Captures<'a> { + fn iter(&self) -> impl Iterator<Item = IntRange> + Captures<'_> { use IntBorder::*; let self_range = Self::to_borders(self.range.clone()); @@ -612,7 +612,7 @@ impl SplitVarLenSlice { } /// Iterate over the partition of this slice. - fn iter<'a>(&'a self) -> impl Iterator<Item = Slice> + Captures<'a> { + fn iter(&self) -> impl Iterator<Item = Slice> + Captures<'_> { let smaller_lengths = match self.array_len { // The only admissible fixed-length slice is one of the array size. Whether `max_slice` // is fixed-length or variable-length, it will be the only relevant slice to output |
