@@ -240,7 +240,7 @@ impl<'tcx> Const<'tcx> {
240240
241241 let ty = tcx. type_of ( def) . no_bound_vars ( ) . expect ( "const parameter types cannot be generic" ) ;
242242
243- match Self :: try_from_lit_or_param ( tcx, ty, expr) {
243+ match Self :: try_from_lit ( tcx, ty, expr) {
244244 Some ( v) => v,
245245 None => ty:: Const :: new_unevaluated ( tcx, ty:: UnevaluatedConst {
246246 def : def. to_def_id ( ) ,
@@ -278,11 +278,7 @@ impl<'tcx> Const<'tcx> {
278278 }
279279
280280 #[ instrument( skip( tcx) , level = "debug" ) ]
281- fn try_from_lit_or_param (
282- tcx : TyCtxt < ' tcx > ,
283- ty : Ty < ' tcx > ,
284- expr : & ' tcx hir:: Expr < ' tcx > ,
285- ) -> Option < Self > {
281+ fn try_from_lit ( tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > , expr : & ' tcx hir:: Expr < ' tcx > ) -> Option < Self > {
286282 // Unwrap a block, so that e.g. `{ P }` is recognised as a parameter. Const arguments
287283 // currently have to be wrapped in curly brackets, so it's necessary to special-case.
288284 let expr = match & expr. kind {
@@ -321,7 +317,7 @@ impl<'tcx> Const<'tcx> {
321317 Err ( e) => {
322318 tcx. dcx ( ) . span_delayed_bug (
323319 expr. span ,
324- format ! ( "Const::from_anon_const : couldn't lit_to_const {e:?}" ) ,
320+ format ! ( "Const::try_from_lit : couldn't lit_to_const {e:?}" ) ,
325321 ) ;
326322 }
327323 }
0 commit comments