@@ -310,11 +310,13 @@ pub fn const_eval_raw_provider<'tcx>(
310
310
// constant defined in this crate, we can figure out a lint level!
311
311
match tcx. def_kind ( def_id) {
312
312
// 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)
314
315
//
315
316
// 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
318
320
Some ( DefKind :: Const ) | Some ( DefKind :: AssocConst ) => {
319
321
let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id) . unwrap ( ) ;
320
322
err. report_as_lint (
@@ -324,8 +326,9 @@ pub fn const_eval_raw_provider<'tcx>(
324
326
Some ( err. span ) ,
325
327
)
326
328
}
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
329
332
_ => {
330
333
if let Some ( p) = cid. promoted {
331
334
let span = tcx. promoted_mir ( def_id) [ p] . span ;
@@ -342,8 +345,8 @@ pub fn const_eval_raw_provider<'tcx>(
342
345
Some ( err. span ) ,
343
346
)
344
347
}
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
347
350
} else {
348
351
err. report_as_error ( ecx. tcx , "evaluation of constant value failed" )
349
352
}
0 commit comments