diff options
| author | bors <bors@rust-lang.org> | 2024-01-10 18:03:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-01-10 18:03:53 +0000 |
| commit | a2d9d73e608f1b24eba840c4fd2d68dbe3b65e01 (patch) | |
| tree | 42523e01769059455f89af632b53b841b1401d69 /compiler/rustc_codegen_ssa/src/back | |
| parent | e9271846294c4ee5bd7706df68180320c0b5ff20 (diff) | |
| parent | 700a3965202f4f403956fcce744ce5ba6adf2ddb (diff) | |
| download | rust-a2d9d73e608f1b24eba840c4fd2d68dbe3b65e01.tar.gz rust-a2d9d73e608f1b24eba840c4fd2d68dbe3b65e01.zip | |
Auto merge of #119751 - nnethercote:error-api-fixes, r=oli-obk
Diagnostic API fixes Some improvements to diagnostic APIs: improve some naming, use shortcuts in more places, and add a couple of missing methods. r? `@compiler-errors`
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/linker.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/write.rs | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 215649f33ff..70fda982b01 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -1016,7 +1016,7 @@ fn link_natively<'a>( if !prog.status.success() { let mut output = prog.stderr.clone(); output.extend_from_slice(&prog.stdout); - sess.dcx().emit_warning(errors::ProcessingDymutilFailed { + sess.dcx().emit_warn(errors::ProcessingDymutilFailed { status: prog.status, output: escape_string(&output), }); @@ -1091,7 +1091,7 @@ fn strip_symbols_with_external_utility<'a>( if !prog.status.success() { let mut output = prog.stderr.clone(); output.extend_from_slice(&prog.stdout); - sess.dcx().emit_warning(errors::StrippingDebugInfoFailed { + sess.dcx().emit_warn(errors::StrippingDebugInfoFailed { util, status: prog.status, output: escape_string(&output), @@ -2406,7 +2406,7 @@ fn collect_natvis_visualizers( visualizer_paths.push(visualizer_out_file); } Err(error) => { - sess.dcx().emit_warning(errors::UnableToWriteDebuggerVisualizer { + sess.dcx().emit_warn(errors::UnableToWriteDebuggerVisualizer { path: visualizer_out_file, error, }); diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs index 695aeb0b2fb..90f5027c264 100644 --- a/compiler/rustc_codegen_ssa/src/back/linker.rs +++ b/compiler/rustc_codegen_ssa/src/back/linker.rs @@ -446,11 +446,11 @@ impl<'a> Linker for GccLinker<'a> { // FIXME(81490): ld64 doesn't support these flags but macOS 11 // has -needed-l{} / -needed_library {} // but we have no way to detect that here. - self.sess.dcx().emit_warning(errors::Ld64UnimplementedModifier); + self.sess.dcx().emit_warn(errors::Ld64UnimplementedModifier); } else if self.is_gnu && !self.sess.target.is_like_windows { self.linker_arg("--no-as-needed"); } else { - self.sess.dcx().emit_warning(errors::LinkerUnsupportedModifier); + self.sess.dcx().emit_warn(errors::LinkerUnsupportedModifier); } } self.hint_dynamic(); @@ -504,7 +504,7 @@ impl<'a> Linker for GccLinker<'a> { // FIXME(81490): ld64 as of macOS 11 supports the -needed_framework // flag but we have no way to detect that here. // self.cmd.arg("-needed_framework").arg(framework); - self.sess.dcx().emit_warning(errors::Ld64UnimplementedModifier); + self.sess.dcx().emit_warn(errors::Ld64UnimplementedModifier); } self.cmd.arg("-framework").arg(framework); } @@ -950,7 +950,7 @@ impl<'a> Linker for MsvcLinker<'a> { } } Err(error) => { - self.sess.dcx().emit_warning(errors::NoNatvisDirectory { error }); + self.sess.dcx().emit_warn(errors::NoNatvisDirectory { error }); } } } @@ -1501,7 +1501,7 @@ impl<'a> Linker for L4Bender<'a> { fn export_symbols(&mut self, _: &Path, _: CrateType, _: &[String]) { // ToDo, not implemented, copy from GCC - self.sess.dcx().emit_warning(errors::L4BenderExportingSymbolsUnimplemented); + self.sess.dcx().emit_warn(errors::L4BenderExportingSymbolsUnimplemented); return; } diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index d2c6b6e0c7b..6c066e61a58 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -573,11 +573,11 @@ fn produce_final_output_artifacts( if crate_output.outputs.contains_key(&output_type) { // 2) Multiple codegen units, with `--emit foo=some_name`. We have // no good solution for this case, so warn the user. - sess.dcx().emit_warning(errors::IgnoringEmitPath { extension }); + sess.dcx().emit_warn(errors::IgnoringEmitPath { extension }); } else if crate_output.single_output_file.is_some() { // 3) Multiple codegen units, with `-o some_name`. We have // no good solution for this case, so warn the user. - sess.dcx().emit_warning(errors::IgnoringOutput { extension }); + sess.dcx().emit_warn(errors::IgnoringOutput { extension }); } else { // 4) Multiple codegen units, but no explicit name. We // just leave the `foo.0.x` files in place. |
