File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -2388,21 +2388,14 @@ impl<'tcx> AdtDef {
23882388 None
23892389 }
23902390 }
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) ;
24062399 None
24072400 }
24082401 }
You can’t perform that action at this time.
0 commit comments