File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed
rustc_mir_build/src/thir/cx Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,9 @@ pub enum Const<'tcx> {
221221}
222222
223223impl < ' tcx > Const < ' tcx > {
224- pub fn identity_unevaluated (
224+ /// Creates an unevaluated const from a `DefId` for a const item.
225+ /// The binders of the const item still need to be instantiated.
226+ pub fn from_unevaluated (
225227 tcx : TyCtxt < ' tcx > ,
226228 def_id : DefId ,
227229 ) -> ty:: EarlyBinder < ' tcx , Const < ' tcx > > {
Original file line number Diff line number Diff line change @@ -699,21 +699,17 @@ impl<'tcx> Cx<'tcx> {
699699 }
700700 }
701701 hir:: InlineAsmOperand :: Const { ref anon_const } => {
702- let value = mir:: Const :: identity_unevaluated (
703- tcx,
704- anon_const. def_id . to_def_id ( ) ,
705- )
706- . instantiate_identity ( ) ;
702+ let value =
703+ mir:: Const :: from_unevaluated ( tcx, anon_const. def_id . to_def_id ( ) )
704+ . instantiate_identity ( ) ;
707705 let span = tcx. def_span ( anon_const. def_id ) ;
708706
709707 InlineAsmOperand :: Const { value, span }
710708 }
711709 hir:: InlineAsmOperand :: SymFn { ref anon_const } => {
712- let value = mir:: Const :: identity_unevaluated (
713- tcx,
714- anon_const. def_id . to_def_id ( ) ,
715- )
716- . instantiate_identity ( ) ;
710+ let value =
711+ mir:: Const :: from_unevaluated ( tcx, anon_const. def_id . to_def_id ( ) )
712+ . instantiate_identity ( ) ;
717713 let span = tcx. def_span ( anon_const. def_id ) ;
718714
719715 InlineAsmOperand :: SymFn { value, span }
You can’t perform that action at this time.
0 commit comments