Skip to content

Commit 84dd229

Browse files
committed
Include rustc and cranelift version in debuginfo
1 parent b7180ae commit 84dd229

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/debuginfo/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ impl<'tcx> DebugContext<'tcx> {
6161

6262
let mut dwarf = DwarfUnit::new(encoding);
6363

64-
// FIXME: how to get version when building out of tree?
65-
// Normally this would use option_env!("CFG_VERSION").
66-
let producer = format!("cg_clif (rustc {})", "unknown version");
64+
let producer = format!(
65+
"cg_clif (rustc {}, cranelift {})",
66+
rustc_interface::util::version_str().unwrap_or("unknown version"),
67+
cranelift_codegen::VERSION,
68+
);
6769
let comp_dir = tcx.sess.working_dir.to_string_lossy(false).into_owned();
6870
let (name, file_info) = match tcx.sess.local_crate_source_file.clone() {
6971
Some(path) => {

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ extern crate rustc_fs_util;
1414
extern crate rustc_hir;
1515
extern crate rustc_incremental;
1616
extern crate rustc_index;
17+
extern crate rustc_interface;
1718
extern crate rustc_session;
1819
extern crate rustc_span;
1920
extern crate rustc_target;

0 commit comments

Comments
 (0)