ADD - create and emit Bug support for Diagnostics
UPDATE - migrate constant span_bug to translatable diagnostic.
This commit is contained in:
parent
d1030fab22
commit
27744460e2
5 changed files with 82 additions and 2 deletions
|
@ -585,6 +585,13 @@ pub struct ErroneousConstant {
|
|||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(codegen_ssa_polymorphic_constant_too_generic)]
|
||||
pub struct PolymorphicConstantTooGeneric {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(codegen_ssa_shuffle_indices_evaluation)]
|
||||
pub struct ShuffleIndicesEvaluation {
|
||||
|
|
|
@ -48,7 +48,11 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
self.cx.tcx().sess.emit_err(errors::ErroneousConstant { span: constant.span });
|
||||
}
|
||||
ErrorHandled::TooGeneric => {
|
||||
span_bug!(constant.span, "codegen encountered polymorphic constant: {:?}", err);
|
||||
self.cx
|
||||
.tcx()
|
||||
.sess
|
||||
.diagnostic()
|
||||
.emit_bug(errors::PolymorphicConstantTooGeneric { span: constant.span });
|
||||
}
|
||||
}
|
||||
err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue