diff options
| author | Michael Goulet <michael@errs.io> | 2024-04-04 12:54:56 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-04-15 16:45:01 -0400 |
| commit | 42ba57c0133306ff510bf641e9d90b33419d7ac7 (patch) | |
| tree | df7fe9e9b5b5976f17da016354e838a87fe5cd3d /compiler/rustc_hir_analysis/src/errors | |
| parent | 41cf87b71b792b40155cd79f96234a89ae7dc27f (diff) | |
| download | rust-42ba57c0133306ff510bf641e9d90b33419d7ac7.tar.gz rust-42ba57c0133306ff510bf641e9d90b33419d7ac7.zip | |
Validation and other things
Diffstat (limited to 'compiler/rustc_hir_analysis/src/errors')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/errors/precise_captures.rs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/errors/precise_captures.rs b/compiler/rustc_hir_analysis/src/errors/precise_captures.rs new file mode 100644 index 00000000000..3b22437abb2 --- /dev/null +++ b/compiler/rustc_hir_analysis/src/errors/precise_captures.rs @@ -0,0 +1,33 @@ +use rustc_macros::Diagnostic; +use rustc_span::Span; + +#[derive(Diagnostic)] +#[diag(hir_analysis_param_not_captured)] +#[note] +pub struct ParamNotCaptured { + #[primary_span] + pub param_span: Span, + #[label] + pub opaque_span: Span, + pub kind: &'static str, +} + +#[derive(Diagnostic)] +#[diag(hir_analysis_lifetime_not_captured)] +pub struct LifetimeNotCaptured { + #[primary_span] + pub use_span: Span, + #[label(hir_analysis_param_label)] + pub param_span: Option<Span>, + #[label] + pub opaque_span: Span, +} + +#[derive(Diagnostic)] +#[diag(hir_analysis_bad_precise_capture)] +pub struct BadPreciseCapture { + #[primary_span] + pub span: Span, + pub kind: &'static str, + pub found: String, +} |
