about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_lint_defs/src/builtin.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index 8bf01adc5b5..5b4a1f174cb 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -4091,6 +4091,7 @@ declare_lint! {
     /// ### Example
     ///
     /// ```rust,ignore (needs CLI args, platform-specific)
+    /// #[warn(linker_messages)]
     /// extern "C" {
     ///   fn foo();
     /// }
@@ -4104,17 +4105,24 @@ declare_lint! {
     ///          >>> referenced by rust_out.69edbd30df4ae57d-cgu.0
     ///          >>>               rust_out.rust_out.69edbd30df4ae57d-cgu.0.rcgu.o:(rust_out::main::h3a90094b06757803)
     ///   |
-    ///   = note: `#[warn(linker_messages)]` on by default
-    ///
+    /// note: the lint level is defined here
+    ///  --> warn.rs:1:9
+    ///   |
+    /// 1 | #![warn(linker_messages)]
+    ///   |         ^^^^^^^^^^^^^^^
     /// warning: 1 warning emitted
     /// ```
     ///
     /// ### Explanation
     ///
-    /// Linkers emit platform-specific and program-specific warnings that cannot be predicted in advance by the rust compiler.
-    /// They are forwarded by default, but can be disabled by adding `#![allow(linker_messages)]` at the crate root.
+    /// Linkers emit platform-specific and program-specific warnings that cannot be predicted in
+    /// advance by the Rust compiler. Such messages are ignored by default for now. While linker
+    /// warnings could be very useful they have been ignored for many years by essentially all
+    /// users, so we need to do a bit more work than just surfacing their text to produce a clear
+    /// and actionable warning of similar quality to our other diagnostics. See this tracking
+    /// issue for more details: <https://github.com/rust-lang/rust/issues/136096>.
     pub LINKER_MESSAGES,
-    Warn,
+    Allow,
     "warnings emitted at runtime by the target-specific linker program"
 }