Skip to content

Commit ad60b6c

Browse files
author
benwu25
committed
init: merge daikon-rustc changes into rustc master
Merged into 99ca0ae of rustc, HEAD as of Sat Oct 4 14:57:32 2025 +0000.
1 parent 99ca0ae commit ad60b6c

File tree

18 files changed

+5018
-4
lines changed

18 files changed

+5018
-4
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,13 @@ dependencies = [
10001000
"syn 2.0.106",
10011001
]
10021002

1003+
[[package]]
1004+
name = "daikon-tests"
1005+
version = "0.1.0"
1006+
dependencies = [
1007+
"colored 3.0.0",
1008+
]
1009+
10031010
[[package]]
10041011
name = "darling"
10051012
version = "0.20.11"

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
resolver = "2"
33
members = [
44
# tidy-alphabetical-start
5-
"compiler/rustc",
5+
"compiler/rustc", "daikon-tests",
66
"src/build_helper",
77
"src/rustc-std-workspace/rustc-std-workspace-alloc",
88
"src/rustc-std-workspace/rustc-std-workspace-core",

compiler/rustc_ast/src/mut_visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ macro_rules! generate_flat_map_visitor_fns {
278278
}
279279
}
280280

281-
fn $name<V: MutVisitor>(
281+
pub fn $name<V: MutVisitor>(
282282
vis: &mut V,
283283
values: &mut ThinVec<$Ty>,
284284
$(

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#![feature(try_blocks)]
1717
// tidy-alphabetical-end
1818

19+
use rustc_parse::parser::item::{OUTPUT_NAME, jot_output_name};
20+
1921
use std::cmp::max;
2022
use std::collections::{BTreeMap, BTreeSet};
2123
use std::ffi::OsString;
@@ -280,6 +282,31 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
280282
let sess = &compiler.sess;
281283
let codegen_backend = &*compiler.codegen_backend;
282284

285+
// get output name for decls, dtrace, and pp
286+
// try input/output file names first. Prefer output to input.
287+
match &sess.io.output_file {
288+
None => match &sess.io.input {
289+
Input::File(path) => {
290+
jot_output_name(String::from(path.to_str().unwrap()));
291+
}
292+
_ => {}
293+
},
294+
Some(ofile) => match &ofile {
295+
OutFileName::Real(path) => {
296+
*OUTPUT_NAME.lock().unwrap() = String::from(path.to_str().unwrap());
297+
}
298+
_ => {}
299+
},
300+
}
301+
302+
// this is the expected path for builds with cargo
303+
match &sess.opts.crate_name {
304+
Some(name) => {
305+
*OUTPUT_NAME.lock().unwrap() = String::from(name);
306+
}
307+
_ => {}
308+
}
309+
283310
// This is used for early exits unrelated to errors. E.g. when just
284311
// printing some information without compiling, or exiting immediately
285312
// after parsing, etc.

0 commit comments

Comments
 (0)