1
Fork 0

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.
This commit is contained in:
Jing Peng 2023-02-26 15:27:27 -05:00
parent 1221e43bdf
commit 9b1a1e1d95
32 changed files with 456 additions and 101 deletions

View file

@ -14,7 +14,7 @@ use rustc_middle::{bug, ty};
use rustc_parse::maybe_new_parser_from_source_str;
use rustc_query_impl::QueryCtxt;
use rustc_query_system::query::print_query_stack;
use rustc_session::config::{self, ErrorOutputType, Input, OutputFilenames};
use rustc_session::config::{self, ErrorOutputType, Input, OutFileName, OutputFilenames};
use rustc_session::config::{CheckCfg, ExpectedValues};
use rustc_session::lint;
use rustc_session::parse::{CrateConfig, ParseSess};
@ -252,7 +252,7 @@ pub struct Config {
pub input: Input,
pub output_dir: Option<PathBuf>,
pub output_file: Option<PathBuf>,
pub output_file: Option<OutFileName>,
pub file_loader: Option<Box<dyn FileLoader + Send + Sync>>,
pub locale_resources: &'static [&'static str],