File tree 2 files changed +9
-4
lines changed
compiler/rustc_lint_defs/src
tests/run-make/linker-warning
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -4091,6 +4091,7 @@ declare_lint! {
4091
4091
/// ### Example
4092
4092
///
4093
4093
/// ```rust,ignore (needs CLI args, platform-specific)
4094
+ /// #[warn(linker_messages)]
4094
4095
/// extern "C" {
4095
4096
/// fn foo();
4096
4097
/// }
@@ -4104,17 +4105,20 @@ declare_lint! {
4104
4105
/// >>> referenced by rust_out.69edbd30df4ae57d-cgu.0
4105
4106
/// >>> rust_out.rust_out.69edbd30df4ae57d-cgu.0.rcgu.o:(rust_out::main::h3a90094b06757803)
4106
4107
/// |
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
+ /// | ^^^^^^^^^^^^^^^
4109
4113
/// warning: 1 warning emitted
4110
4114
/// ```
4111
4115
///
4112
4116
/// ### Explanation
4113
4117
///
4114
4118
/// 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 .
4116
4120
pub LINKER_MESSAGES ,
4117
- Warn ,
4121
+ Allow ,
4118
4122
"warnings emitted at runtime by the target-specific linker program"
4119
4123
}
4120
4124
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ fn run_rustc() -> Rustc {
8
8
// Make sure we use a consistent value.
9
9
. arg ( "-Clink-self-contained=-linker" )
10
10
. arg ( "-Zunstable-options" )
11
+ . arg ( "-Wlinker-messages" )
11
12
. output ( "main" )
12
13
. linker ( "./fake-linker" ) ;
13
14
if run_make_support:: target ( ) == "x86_64-unknown-linux-gnu" {
You can’t perform that action at this time.
0 commit comments