mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
ty: use delay_span_bug
in ty::AdtDef::eval_explicit_discr
.
This commit is contained in:
parent
7184d137f6
commit
50c63e48f1
@ -2388,21 +2388,14 @@ impl<'tcx> AdtDef {
|
||||
None
|
||||
}
|
||||
}
|
||||
Err(ErrorHandled::Reported(ErrorReported) | ErrorHandled::Linted) => {
|
||||
if !expr_did.is_local() {
|
||||
span_bug!(
|
||||
tcx.def_span(expr_did),
|
||||
"variant discriminant evaluation succeeded \
|
||||
in its crate but failed locally"
|
||||
);
|
||||
}
|
||||
None
|
||||
}
|
||||
Err(ErrorHandled::TooGeneric) => {
|
||||
tcx.sess.delay_span_bug(
|
||||
tcx.def_span(expr_did),
|
||||
"enum discriminant depends on generic arguments",
|
||||
);
|
||||
Err(err) => {
|
||||
let msg = match err {
|
||||
ErrorHandled::Reported(ErrorReported) | ErrorHandled::Linted => {
|
||||
"enum discriminant evaluation failed"
|
||||
}
|
||||
ErrorHandled::TooGeneric => "enum discriminant depends on generics",
|
||||
};
|
||||
tcx.sess.delay_span_bug(tcx.def_span(expr_did), msg);
|
||||
None
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user