about summary refs log tree commit diff
path: root/compiler/rustc_lint/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-10-10 01:12:11 +0000
committerbors <bors@rust-lang.org>2024-10-10 01:12:11 +0000
commitdf1b5d3cc2117f1ee96abca25678bc5f5604d450 (patch)
treeb1e970cb6955c336272c0f11f0b043d4162afdfe /compiler/rustc_lint/src
parentfc0f045dd1fe9b0f14f504d0513623342be6f0dc (diff)
parent7a764894548c1367d9c2612b8a5d98853fc9aa13 (diff)
downloadrust-df1b5d3cc2117f1ee96abca25678bc5f5604d450.tar.gz
rust-df1b5d3cc2117f1ee96abca25678bc5f5604d450.zip
Auto merge of #131466 - matthiaskrgr:rollup-3qtz83x, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #123951 (Reserve guarded string literals (RFC 3593))
 - #130827 (Library: Rename "object safe" to "dyn compatible")
 - #131383 (Add docs about slicing slices at the ends)
 - #131403 (Fix needless_lifetimes in rustc_serialize)
 - #131417 (Fix methods alignment on mobile)
 - #131449 (Decouple WASIp2 sockets from WasiFd)
 - #131462 (Mention allocation errors for `open_buffered`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_lint/src')
-rw-r--r--compiler/rustc_lint/src/context/diagnostics.rs3
-rw-r--r--compiler/rustc_lint/src/lints.rs7
2 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/context/diagnostics.rs b/compiler/rustc_lint/src/context/diagnostics.rs
index b5ab56912cb..565c3c04252 100644
--- a/compiler/rustc_lint/src/context/diagnostics.rs
+++ b/compiler/rustc_lint/src/context/diagnostics.rs
@@ -176,6 +176,9 @@ pub(super) fn decorate_lint(sess: &Session, diagnostic: BuiltinLintDiag, diag: &
             lints::RawPrefix { label: label_span, suggestion: label_span.shrink_to_hi() }
                 .decorate_lint(diag);
         }
+        BuiltinLintDiag::ReservedString(suggestion) => {
+            lints::ReservedString { suggestion }.decorate_lint(diag);
+        }
         BuiltinLintDiag::UnusedBuiltinAttribute { attr_name, macro_name, invoc_span } => {
             lints::UnusedBuiltinAttribute { invoc_span, attr_name, macro_name }.decorate_lint(diag);
         }
diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs
index a861894a444..87afeca0b28 100644
--- a/compiler/rustc_lint/src/lints.rs
+++ b/compiler/rustc_lint/src/lints.rs
@@ -3053,3 +3053,10 @@ pub(crate) enum MutRefSugg {
 #[derive(LintDiagnostic)]
 #[diag(lint_unqualified_local_imports)]
 pub(crate) struct UnqualifiedLocalImportsDiag {}
+
+#[derive(LintDiagnostic)]
+#[diag(lint_reserved_string)]
+pub(crate) struct ReservedString {
+    #[suggestion(code = " ", applicability = "machine-applicable")]
+    pub suggestion: Span,
+}