File tree 1 file changed +8
-15
lines changed
1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -2388,21 +2388,14 @@ impl<'tcx> AdtDef {
2388
2388
None
2389
2389
}
2390
2390
}
2391
- Err ( ErrorHandled :: Reported ( ErrorReported ) | ErrorHandled :: Linted ) => {
2392
- if !expr_did. is_local ( ) {
2393
- span_bug ! (
2394
- tcx. def_span( expr_did) ,
2395
- "variant discriminant evaluation succeeded \
2396
- in its crate but failed locally"
2397
- ) ;
2398
- }
2399
- None
2400
- }
2401
- Err ( ErrorHandled :: TooGeneric ) => {
2402
- tcx. sess . delay_span_bug (
2403
- tcx. def_span ( expr_did) ,
2404
- "enum discriminant depends on generic arguments" ,
2405
- ) ;
2391
+ Err ( err) => {
2392
+ let msg = match err {
2393
+ ErrorHandled :: Reported ( ErrorReported ) | ErrorHandled :: Linted => {
2394
+ "enum discriminant evaluation failed"
2395
+ }
2396
+ ErrorHandled :: TooGeneric => "enum discriminant depends on generics" ,
2397
+ } ;
2398
+ tcx. sess . delay_span_bug ( tcx. def_span ( expr_did) , msg) ;
2406
2399
None
2407
2400
}
2408
2401
}
You can’t perform that action at this time.
0 commit comments