Skip to content

Commit a847d5e

Browse files
committed
Use &'hir Ty everywhere.
For consistency, and because it makes HIR measurement simpler and more accurate.
1 parent db35b68 commit a847d5e

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11521152
}
11531153
_ => {}
11541154
}
1155-
GenericArg::Type(self.lower_ty_direct(&ty, itctx))
1155+
GenericArg::Type(self.lower_ty(&ty, itctx))
11561156
}
11571157
ast::GenericArg::Const(ct) => GenericArg::Const(ConstArg {
11581158
value: self.lower_anon_const(&ct),

compiler/rustc_ast_lowering/src/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
359359
}
360360
FnRetTy::Default(_) => self.arena.alloc(self.ty_tup(*span, &[])),
361361
};
362-
let args = smallvec![GenericArg::Type(self.ty_tup(*inputs_span, inputs))];
362+
let args = smallvec![GenericArg::Type(self.arena.alloc(self.ty_tup(*inputs_span, inputs)))];
363363
let binding = self.output_ty_binding(output_ty.span, output_ty);
364364
(
365365
GenericArgsCtor {

compiler/rustc_hir/src/hir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ impl InferArg {
265265
#[derive(Debug, HashStable_Generic)]
266266
pub enum GenericArg<'hir> {
267267
Lifetime(Lifetime),
268-
Type(Ty<'hir>),
268+
Type(&'hir Ty<'hir>),
269269
Const(ConstArg),
270270
Infer(InferArg),
271271
}
@@ -3502,7 +3502,7 @@ mod size_asserts {
35023502
static_assert_size!(FnDecl<'_>, 40);
35033503
static_assert_size!(ForeignItem<'_>, 72);
35043504
static_assert_size!(ForeignItemKind<'_>, 40);
3505-
static_assert_size!(GenericArg<'_>, 80);
3505+
static_assert_size!(GenericArg<'_>, 40);
35063506
static_assert_size!(GenericBound<'_>, 48);
35073507
static_assert_size!(Generics<'_>, 56);
35083508
static_assert_size!(Impl<'_>, 80);

src/tools/clippy/clippy_lints/src/manual_bits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn get_size_of_ty<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<
105105
if let Some(def_id) = cx.qpath_res(count_func_qpath, count_func.hir_id).opt_def_id();
106106
if cx.tcx.is_diagnostic_item(sym::mem_size_of, def_id);
107107
then {
108-
cx.typeck_results().node_substs(count_func.hir_id).types().next().map(|resolved_ty| (real_ty, resolved_ty))
108+
cx.typeck_results().node_substs(count_func.hir_id).types().next().map(|resolved_ty| (*real_ty, resolved_ty))
109109
} else {
110110
None
111111
}

src/tools/clippy/clippy_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ pub fn qpath_generic_tys<'tcx>(qpath: &QPath<'tcx>) -> impl Iterator<Item = &'tc
333333
.map_or(&[][..], |a| a.args)
334334
.iter()
335335
.filter_map(|a| match a {
336-
hir::GenericArg::Type(ty) => Some(ty),
336+
hir::GenericArg::Type(ty) => Some(*ty),
337337
_ => None,
338338
})
339339
}

0 commit comments

Comments
 (0)