From 4cf0365b19ddf852375175a9679572f1e0de4eda Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Mon, 10 Feb 2020 14:20:21 -0800 Subject: [PATCH 1/3] Bump version to backtrace without the header --- src/libstd/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml index c9ff93eac0295..b147aa55b2a61 100644 --- a/src/libstd/Cargo.toml +++ b/src/libstd/Cargo.toml @@ -27,7 +27,7 @@ hashbrown = { version = "0.6.2", default-features = false, features = ['rustc-de [dependencies.backtrace_rs] package = "backtrace" -version = "0.3.37" +version = "0.3.44" default-features = false # without the libstd `backtrace` feature, stub out everything features = [ "rustc-dep-of-std" ] # enable build support for integrating into libstd From d2b08c7e93f68099f273743a8c7bad0d8ee28de0 Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Tue, 11 Feb 2020 12:51:23 -0800 Subject: [PATCH 2/3] Update Cargo.lock --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bbfda0fa2c846..018ad3e6f98b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,9 +121,9 @@ checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" [[package]] name = "backtrace" -version = "0.3.40" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" +checksum = "e4036b9bf40f3cf16aba72a3d65e8a520fc4bafcdc7079aea8f848c58c5b5536" dependencies = [ "backtrace-sys", "cfg-if", From 090a1571d8c489588e2947ddb61b79f78b5b11b3 Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Tue, 11 Feb 2020 16:57:22 -0800 Subject: [PATCH 3/3] Fix failing backtrace ui tests --- src/libstd/sys_common/backtrace.rs | 1 + src/test/ui/std-backtrace.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libstd/sys_common/backtrace.rs b/src/libstd/sys_common/backtrace.rs index 191add2c31b3e..289ee07babfcf 100644 --- a/src/libstd/sys_common/backtrace.rs +++ b/src/libstd/sys_common/backtrace.rs @@ -70,6 +70,7 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt:: let mut print_path = move |fmt: &mut fmt::Formatter<'_>, bows: BytesOrWideString<'_>| { output_filename(fmt, bows, print_fmt, cwd.as_ref()) }; + write!(fmt, "stack backtrace:\n")?; let mut bt_fmt = BacktraceFmt::new(fmt, print_fmt, &mut print_path); bt_fmt.add_context()?; let mut idx = 0; diff --git a/src/test/ui/std-backtrace.rs b/src/test/ui/std-backtrace.rs index d84c493d53523..902a2b6f5a0e9 100644 --- a/src/test/ui/std-backtrace.rs +++ b/src/test/ui/std-backtrace.rs @@ -16,9 +16,9 @@ use std::str; fn main() { let args: Vec = env::args().collect(); if args.len() >= 2 && args[1] == "force" { - println!("{}", std::backtrace::Backtrace::force_capture()); + println!("stack backtrace:\n{}", std::backtrace::Backtrace::force_capture()); } else if args.len() >= 2 { - println!("{}", std::backtrace::Backtrace::capture()); + println!("stack backtrace:\n{}", std::backtrace::Backtrace::capture()); } else { runtest(&args[0]); println!("test ok");