Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,13 @@ dependencies = [
"syn 2.0.106",
]

[[package]]
name = "daikon-tests"
version = "0.1.0"
dependencies = [
"colored 3.0.0",
]

[[package]]
name = "darling"
version = "0.20.11"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
resolver = "2"
members = [
# tidy-alphabetical-start
"compiler/rustc",
"compiler/rustc", "daikon-tests",
"src/build_helper",
"src/rustc-std-workspace/rustc-std-workspace-alloc",
"src/rustc-std-workspace/rustc-std-workspace-core",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/mut_visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ macro_rules! generate_flat_map_visitor_fns {
}
}

fn $name<V: MutVisitor>(
pub fn $name<V: MutVisitor>(
vis: &mut V,
values: &mut ThinVec<$Ty>,
$(
Expand Down
27 changes: 27 additions & 0 deletions compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#![feature(try_blocks)]
// tidy-alphabetical-end

use rustc_parse::parser::item::{OUTPUT_NAME, jot_output_name};

use std::cmp::max;
use std::collections::{BTreeMap, BTreeSet};
use std::ffi::OsString;
Expand Down Expand Up @@ -280,6 +282,31 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
let sess = &compiler.sess;
let codegen_backend = &*compiler.codegen_backend;

// get output name for decls, dtrace, and pp
// try input/output file names first. Prefer output to input.
match &sess.io.output_file {
None => match &sess.io.input {
Input::File(path) => {
jot_output_name(String::from(path.to_str().unwrap()));
}
_ => {}
},
Some(ofile) => match &ofile {
OutFileName::Real(path) => {
*OUTPUT_NAME.lock().unwrap() = String::from(path.to_str().unwrap());
}
_ => {}
},
}

// this is the expected path for builds with cargo
match &sess.opts.crate_name {
Some(name) => {
*OUTPUT_NAME.lock().unwrap() = String::from(name);
}
_ => {}
}

// This is used for early exits unrelated to errors. E.g. when just
// printing some information without compiling, or exiting immediately
// after parsing, etc.
Expand Down
Loading
Loading