about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/errors.rs
diff options
context:
space:
mode:
authorJing Peng <pj.hades@gmail.com>2023-02-26 15:27:27 -0500
committerJing Peng <pj.hades@gmail.com>2023-06-06 17:53:29 -0400
commit9b1a1e1d95d1e40bdf57ef9d37ccbac91fc9c280 (patch)
treea9dfaf211a9e470ba26b20416916ab214a2be476 /compiler/rustc_codegen_ssa/src/errors.rs
parent1221e43bdf413f7c405e9b17ef19d76c88222098 (diff)
downloadrust-9b1a1e1d95d1e40bdf57ef9d37ccbac91fc9c280.tar.gz
rust-9b1a1e1d95d1e40bdf57ef9d37ccbac91fc9c280.zip
Write to stdout if `-` is given as output file
If `-o -` or `--emit KIND=-` is provided, output will be written
to stdout instead. Binary output (`obj`, `llvm-bc`, `link` and
`metadata`) being written this way will result in an error unless
stdout is not a tty. Multiple output types going to stdout will
trigger an error too, as they will all be mixded together.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/errors.rs')
-rw-r--r--compiler/rustc_codegen_ssa/src/errors.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs
index cf4893b8226..3fed9ea0b41 100644
--- a/compiler/rustc_codegen_ssa/src/errors.rs
+++ b/compiler/rustc_codegen_ssa/src/errors.rs
@@ -83,6 +83,12 @@ impl IntoDiagnosticArg for DebugArgPath<'_> {
 }
 
 #[derive(Diagnostic)]
+#[diag(codegen_ssa_binary_output_to_tty)]
+pub struct BinaryOutputToTty {
+    pub shorthand: &'static str,
+}
+
+#[derive(Diagnostic)]
 #[diag(codegen_ssa_ignoring_emit_path)]
 pub struct IgnoringEmitPath {
     pub extension: String,