Skip to content

Commit e2c47a0

Browse files
committed
Downgrade linker-warnings to allow-by-default
This needs more time to bake before we turn it on. Turning it on early risks people silencing the warning indefinitely, before we have the chance to make it less noisy.
1 parent 15c6f7e commit e2c47a0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

compiler/rustc_lint_defs/src/builtin.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -4091,6 +4091,7 @@ declare_lint! {
40914091
/// ### Example
40924092
///
40934093
/// ```rust,ignore (needs CLI args, platform-specific)
4094+
/// #[warn(linker_messages)]
40944095
/// extern "C" {
40954096
/// fn foo();
40964097
/// }
@@ -4104,17 +4105,20 @@ declare_lint! {
41044105
/// >>> referenced by rust_out.69edbd30df4ae57d-cgu.0
41054106
/// >>> rust_out.rust_out.69edbd30df4ae57d-cgu.0.rcgu.o:(rust_out::main::h3a90094b06757803)
41064107
/// |
4107-
/// = note: `#[warn(linker_messages)]` on by default
4108-
///
4108+
/// note: the lint level is defined here
4109+
/// --> warn.rs:1:9
4110+
/// |
4111+
/// 1 | #![warn(linker_messages)]
4112+
/// | ^^^^^^^^^^^^^^^
41094113
/// warning: 1 warning emitted
41104114
/// ```
41114115
///
41124116
/// ### Explanation
41134117
///
41144118
/// Linkers emit platform-specific and program-specific warnings that cannot be predicted in advance by the rust compiler.
4115-
/// They are forwarded by default, but can be disabled by adding `#![allow(linker_messages)]` at the crate root.
4119+
/// They are forwarded by default, but can be disabled by adding `#![allow(linker_messages)]` at the root of a crate that requires linking.
41164120
pub LINKER_MESSAGES,
4117-
Warn,
4121+
Allow,
41184122
"warnings emitted at runtime by the target-specific linker program"
41194123
}
41204124

tests/run-make/linker-warning/rmake.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ fn run_rustc() -> Rustc {
88
// Make sure we use a consistent value.
99
.arg("-Clink-self-contained=-linker")
1010
.arg("-Zunstable-options")
11+
.arg("-Wlinker-messages")
1112
.output("main")
1213
.linker("./fake-linker");
1314
if run_make_support::target() == "x86_64-unknown-linux-gnu" {

0 commit comments

Comments
 (0)