diff options
| author | bors <bors@rust-lang.org> | 2024-09-20 17:25:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-09-20 17:25:34 +0000 |
| commit | 5ba6db1b648d93fbbab4ae0466e40db682fa45fc (patch) | |
| tree | c9c5732d1f0b4eee1f04aa23d4ff945545d2a698 /compiler/rustc_hir_analysis/src/errors.rs | |
| parent | fb46739014564a3c709c43e1429a6a5d71c97e26 (diff) | |
| parent | 3b0ce1bc33d30d7d116ee9af60df873e04bd74dc (diff) | |
| download | rust-5ba6db1b648d93fbbab4ae0466e40db682fa45fc.tar.gz rust-5ba6db1b648d93fbbab4ae0466e40db682fa45fc.zip | |
Auto merge of #124895 - obeis:static-mut-hidden-ref, r=compiler-errors
Disallow hidden references to mutable static Closes #123060 Tracking: - https://github.com/rust-lang/rust/issues/123758
Diffstat (limited to 'compiler/rustc_hir_analysis/src/errors.rs')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/errors.rs | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs index 39df18ff658..e4e5f76ae32 100644 --- a/compiler/rustc_hir_analysis/src/errors.rs +++ b/compiler/rustc_hir_analysis/src/errors.rs @@ -1523,57 +1523,6 @@ pub(crate) struct OnlyCurrentTraitsPointerSugg<'a> { } #[derive(Diagnostic)] -#[diag(hir_analysis_static_mut_ref, code = E0796)] -#[note] -pub(crate) struct StaticMutRef<'a> { - #[primary_span] - #[label] - pub span: Span, - #[subdiagnostic] - pub sugg: MutRefSugg, - pub shared: &'a str, -} - -#[derive(Subdiagnostic)] -pub(crate) enum MutRefSugg { - #[multipart_suggestion( - hir_analysis_suggestion, - style = "verbose", - applicability = "maybe-incorrect" - )] - Shared { - #[suggestion_part(code = "addr_of!(")] - lo: Span, - #[suggestion_part(code = ")")] - hi: Span, - }, - #[multipart_suggestion( - hir_analysis_suggestion_mut, - style = "verbose", - applicability = "maybe-incorrect" - )] - Mut { - #[suggestion_part(code = "addr_of_mut!(")] - lo: Span, - #[suggestion_part(code = ")")] - hi: Span, - }, -} - -// STATIC_MUT_REF lint -#[derive(LintDiagnostic)] -#[diag(hir_analysis_static_mut_refs_lint)] -#[note] -#[note(hir_analysis_why_note)] -pub(crate) struct RefOfMutStatic<'a> { - #[label] - pub span: Span, - #[subdiagnostic] - pub sugg: MutRefSugg, - pub shared: &'a str, -} - -#[derive(Diagnostic)] #[diag(hir_analysis_not_supported_delegation)] pub(crate) struct UnsupportedDelegation<'a> { #[primary_span] |
