Skip to content

Commit 4f23c48

Browse files
Migrate LinkerOutput lint to Diagnostic
1 parent 36116e3 commit 4f23c48

File tree

1 file changed

+5
-7
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+5
-7
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ use rustc_attr_parsing::eval_config_entry;
1818
use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
1919
use rustc_data_structures::memmap::Mmap;
2020
use rustc_data_structures::temp_dir::MaybeTempDir;
21-
use rustc_errors::{DiagCtxtHandle, LintDiagnostic};
21+
use rustc_errors::DiagCtxtHandle;
2222
use rustc_fs_util::{TempDirBuilder, fix_windows_verbatim_for_gcc, try_canonicalize};
2323
use rustc_hir::attrs::NativeLibKind;
2424
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
25-
use rustc_macros::LintDiagnostic;
25+
use rustc_macros::Diagnostic;
2626
use rustc_metadata::fs::{METADATA_FILENAME, copy_to_stdout, emit_wrapper_file};
2727
use rustc_metadata::{
2828
EncodedMetadata, NativeLibSearchFallback, find_native_static_library,
2929
walk_native_lib_search_dirs,
3030
};
3131
use rustc_middle::bug;
32-
use rustc_middle::lint::lint_level;
32+
use rustc_middle::lint::diag_lint_level;
3333
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
3434
use rustc_middle::middle::dependency_format::Linkage;
3535
use rustc_middle::middle::exported_symbols::SymbolExportKind;
@@ -662,7 +662,7 @@ fn link_dwarf_object(sess: &Session, cg_results: &CodegenResults, executable_out
662662
}
663663
}
664664

665-
#[derive(LintDiagnostic)]
665+
#[derive(Diagnostic)]
666666
#[diag("{$inner}")]
667667
/// Translating this is kind of useless. We don't pass translation flags to the linker, so we'd just
668668
/// end up with inconsistent languages within the same diagnostic.
@@ -938,9 +938,7 @@ fn link_natively(
938938

939939
let level = codegen_results.crate_info.lint_levels.linker_messages;
940940
let lint = |msg| {
941-
lint_level(sess, LINKER_MESSAGES, level, None, |diag| {
942-
LinkerOutput { inner: msg }.decorate_lint(diag)
943-
})
941+
diag_lint_level(sess, LINKER_MESSAGES, level, None, LinkerOutput { inner: msg });
944942
};
945943

946944
if !prog.stderr.is_empty() {

0 commit comments

Comments
 (0)