File tree 2 files changed +9
-11
lines changed
rustc_mir_build/src/thir/cx
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> {
221
221
}
222
222
223
223
impl < ' 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 (
225
227
tcx : TyCtxt < ' tcx > ,
226
228
def_id : DefId ,
227
229
) -> ty:: EarlyBinder < ' tcx , Const < ' tcx > > {
Original file line number Diff line number Diff line change @@ -699,21 +699,17 @@ impl<'tcx> Cx<'tcx> {
699
699
}
700
700
}
701
701
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 ( ) ;
707
705
let span = tcx. def_span ( anon_const. def_id ) ;
708
706
709
707
InlineAsmOperand :: Const { value, span }
710
708
}
711
709
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 ( ) ;
717
713
let span = tcx. def_span ( anon_const. def_id ) ;
718
714
719
715
InlineAsmOperand :: SymFn { value, span }
You can’t perform that action at this time.
0 commit comments