@@ -310,11 +310,13 @@ pub fn const_eval_raw_provider<'tcx>(
310310 // constant defined in this crate, we can figure out a lint level!
311311 match tcx. def_kind ( def_id) {
312312 // constants never produce a hard error at the definition site. Anything else is
313- // a backwards compatibility hazard (and will break old versions of winapi for sure)
313+ // a backwards compatibility hazard (and will break old versions of winapi for
314+ // sure)
314315 //
315316 // note that validation may still cause a hard error on this very same constant,
316- // because any code that existed before validation could not have failed validation
317- // thus preventing such a hard error from being a backwards compatibility hazard
317+ // because any code that existed before validation could not have failed
318+ // validation thus preventing such a hard error from being a backwards
319+ // compatibility hazard
318320 Some ( DefKind :: Const ) | Some ( DefKind :: AssocConst ) => {
319321 let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id) . unwrap ( ) ;
320322 err. report_as_lint (
@@ -324,8 +326,9 @@ pub fn const_eval_raw_provider<'tcx>(
324326 Some ( err. span ) ,
325327 )
326328 }
327- // promoting runtime code is only allowed to error if it references broken constants
328- // any other kind of error will be reported to the user as a deny-by-default lint
329+ // promoting runtime code is only allowed to error if it references broken
330+ // constants any other kind of error will be reported to the user as a
331+ // deny-by-default lint
329332 _ => {
330333 if let Some ( p) = cid. promoted {
331334 let span = tcx. promoted_mir ( def_id) [ p] . span ;
@@ -342,8 +345,8 @@ pub fn const_eval_raw_provider<'tcx>(
342345 Some ( err. span ) ,
343346 )
344347 }
345- // anything else (array lengths, enum initializers, constant patterns) are reported
346- // as hard errors
348+ // anything else (array lengths, enum initializers, constant patterns) are
349+ // reported as hard errors
347350 } else {
348351 err. report_as_error ( ecx. tcx , "evaluation of constant value failed" )
349352 }
0 commit comments