about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-04 00:32:27 +0000
committerbors <bors@rust-lang.org>2024-05-04 00:32:27 +0000
commit09cd00fea4aecaa6707f122d7e143196b8a12ee2 (patch)
tree6a761042886683a93980d152908945b361349519 /src
parentd2d24e395a1e4fcee62ca17bf4cbddb1f903af97 (diff)
parentfea1fe7f01e99e0ef9eb6ceac8c97fb17ff3263e (diff)
downloadrust-09cd00fea4aecaa6707f122d7e143196b8a12ee2.tar.gz
rust-09cd00fea4aecaa6707f122d7e143196b8a12ee2.zip
Auto merge of #124401 - oli-obk:some_hir_cleanups, r=cjgillot
Some hir cleanups

It seemed odd to not put `AnonConst` in the arena, compared with the other types that we did put into an arena. This way we can also give it a `Span` without growing a lot of other HIR data structures because of the extra field.

r? compiler
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/clean/mod.rs7
-rw-r--r--src/tools/clippy/clippy_utils/src/hir_utils.rs4
2 files changed, 7 insertions, 4 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index fc4f48262e5..f437c7d319d 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -281,7 +281,10 @@ fn clean_lifetime<'tcx>(lifetime: &hir::Lifetime, cx: &mut DocContext<'tcx>) ->
     Lifetime(lifetime.ident.name)
 }
 
-pub(crate) fn clean_const<'tcx>(constant: &hir::ConstArg, cx: &mut DocContext<'tcx>) -> Constant {
+pub(crate) fn clean_const<'tcx>(
+    constant: &hir::ConstArg<'_>,
+    cx: &mut DocContext<'tcx>,
+) -> Constant {
     let def_id = cx.tcx.hir().body_owner_def_id(constant.value.body).to_def_id();
     Constant {
         type_: Box::new(clean_middle_ty(
@@ -2450,7 +2453,7 @@ pub(crate) fn clean_variant_def_with_args<'tcx>(
 
 fn clean_variant_data<'tcx>(
     variant: &hir::VariantData<'tcx>,
-    disr_expr: &Option<hir::AnonConst>,
+    disr_expr: &Option<&hir::AnonConst>,
     cx: &mut DocContext<'tcx>,
 ) -> Variant {
     let discriminant = disr_expr
diff --git a/src/tools/clippy/clippy_utils/src/hir_utils.rs b/src/tools/clippy/clippy_utils/src/hir_utils.rs
index 07c443acb05..c921168df29 100644
--- a/src/tools/clippy/clippy_utils/src/hir_utils.rs
+++ b/src/tools/clippy/clippy_utils/src/hir_utils.rs
@@ -224,7 +224,7 @@ impl HirEqInterExpr<'_, '_, '_> {
         })
     }
 
-    pub fn eq_array_length(&mut self, left: ArrayLen, right: ArrayLen) -> bool {
+    pub fn eq_array_length(&mut self, left: ArrayLen<'_>, right: ArrayLen<'_>) -> bool {
         match (left, right) {
             (ArrayLen::Infer(..), ArrayLen::Infer(..)) => true,
             (ArrayLen::Body(l_ct), ArrayLen::Body(r_ct)) => self.eq_body(l_ct.body, r_ct.body),
@@ -1116,7 +1116,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
         }
     }
 
-    pub fn hash_array_length(&mut self, length: ArrayLen) {
+    pub fn hash_array_length(&mut self, length: ArrayLen<'_>) {
         match length {
             ArrayLen::Infer(..) => {},
             ArrayLen::Body(anon_const) => self.hash_body(anon_const.body),