summary refs log tree commit diff
path: root/compiler/rustc_interface/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_interface/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_interface/src/errors.rs')
-rw-r--r--compiler/rustc_interface/src/errors.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/errors.rs b/compiler/rustc_interface/src/errors.rs
index 0eedee25026..a9ab2720d89 100644
--- a/compiler/rustc_interface/src/errors.rs
+++ b/compiler/rustc_interface/src/errors.rs
@@ -108,3 +108,7 @@ pub struct IgnoringExtraFilename;
 #[derive(Diagnostic)]
 #[diag(interface_ignoring_out_dir)]
 pub struct IgnoringOutDir;
+
+#[derive(Diagnostic)]
+#[diag(interface_multiple_output_types_to_stdout)]
+pub struct MultipleOutputTypesToStdout;