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_middle/src/ty/consts.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'compiler/rustc_middle/src/ty/consts.rs') diff --git a/compiler/rustc_middle/src/ty/consts.rs b/compiler/rustc_middle/src/ty/consts.rs index c2be08e49..65cbac3e8 100644 --- a/compiler/rustc_middle/src/ty/consts.rs +++ b/compiler/rustc_middle/src/ty/consts.rs @@ -14,10 +14,10 @@ pub use int::*; pub use kind::*; pub use valtree::*; -/// Use this rather than `ConstS`, whenever possible. +/// Use this rather than `ConstData, whenever possible. #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable)] #[rustc_pass_by_value] -pub struct Const<'tcx>(pub Interned<'tcx, ConstS<'tcx>>); +pub struct Const<'tcx>(pub(super) Interned<'tcx, ConstData<'tcx>>); impl<'tcx> fmt::Debug for Const<'tcx> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -30,13 +30,13 @@ impl<'tcx> fmt::Debug for Const<'tcx> { /// Typed constant value. #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, HashStable, TyEncodable, TyDecodable)] -pub struct ConstS<'tcx> { +pub struct ConstData<'tcx> { pub ty: Ty<'tcx>, pub kind: ConstKind<'tcx>, } #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] -static_assert_size!(ConstS<'_>, 40); +static_assert_size!(ConstData<'_>, 40); impl<'tcx> Const<'tcx> { #[inline] @@ -239,7 +239,7 @@ impl<'tcx> Const<'tcx> { } } -pub fn const_param_default<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Const<'tcx> { +pub fn const_param_default(tcx: TyCtxt<'_>, def_id: DefId) -> ty::EarlyBinder> { let default_def_id = match tcx.hir().get_by_def_id(def_id.expect_local()) { hir::Node::GenericParam(hir::GenericParam { kind: hir::GenericParamKind::Const { default: Some(ac), .. }, @@ -250,5 +250,5 @@ pub fn const_param_default<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Const<'tcx "`const_param_default` expected a generic parameter with a constant" ), }; - Const::from_anon_const(tcx, default_def_id) + ty::EarlyBinder(Const::from_anon_const(tcx, default_def_id)) } -- cgit v1.2.3