We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
span_delayed_bug
AdtDef::eval_explicit_discr
1 parent 10dcd73 commit 4620994Copy full SHA for 4620994
compiler/rustc_middle/src/ty/adt.rs
@@ -494,11 +494,15 @@ impl<'tcx> AdtDef<'tcx> {
494
}
495
496
Err(err) => {
497
- let msg = match err {
498
- ErrorHandled::Reported(..) => "enum discriminant evaluation failed",
499
- ErrorHandled::TooGeneric(..) => "enum discriminant depends on generics",
+ match err {
+ ErrorHandled::Reported(..) => {} // error guaranteed by `Reported`
+ ErrorHandled::TooGeneric(..) => {
500
+ tcx.dcx().span_delayed_bug(
501
+ tcx.def_span(expr_did),
502
+ "enum discriminant depends on generics",
503
+ );
504
+ }
505
};
- tcx.dcx().span_delayed_bug(tcx.def_span(expr_did), msg);
506
None
507
508
0 commit comments