diff options
| author | Martin Nordholts <enselic@gmail.com> | 2023-08-29 19:29:14 +0200 |
|---|---|---|
| committer | Martin Nordholts <enselic@gmail.com> | 2023-08-30 20:43:31 +0200 |
| commit | 456007af125d3822285135659ea5ea0b67084b66 (patch) | |
| tree | 721c4bdb2a628c196a43b0534a1e7d088176aa37 /compiler/rustc_monomorphize/src/errors.rs | |
| parent | e877e2a2c9a39103410ab94a7db4747af4497585 (diff) | |
| download | rust-456007af125d3822285135659ea5ea0b67084b66.tar.gz rust-456007af125d3822285135659ea5ea0b67084b66.zip | |
Emit error instead of ICE when optimized MIR is missing
Closes 51388.
Diffstat (limited to 'compiler/rustc_monomorphize/src/errors.rs')
| -rw-r--r-- | compiler/rustc_monomorphize/src/errors.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/rustc_monomorphize/src/errors.rs b/compiler/rustc_monomorphize/src/errors.rs index 495a73490a2..fdcc95f137f 100644 --- a/compiler/rustc_monomorphize/src/errors.rs +++ b/compiler/rustc_monomorphize/src/errors.rs @@ -4,7 +4,7 @@ use crate::fluent_generated as fluent; use rustc_errors::ErrorGuaranteed; use rustc_errors::IntoDiagnostic; use rustc_macros::{Diagnostic, LintDiagnostic}; -use rustc_span::Span; +use rustc_span::{Span, Symbol}; #[derive(Diagnostic)] #[diag(monomorphize_recursion_limit)] @@ -33,6 +33,14 @@ pub struct TypeLengthLimit { pub type_length: usize, } +#[derive(Diagnostic)] +#[diag(monomorphize_no_optimized_mir)] +pub struct NoOptimizedMir { + #[note] + pub span: Span, + pub crate_name: Symbol, +} + pub struct UnusedGenericParamsHint { pub span: Span, pub param_spans: Vec<Span>, |
