Skip to content

Commit

Permalink
Fix failing backtrace ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yaahc committed Feb 12, 2020
1 parent d2b08c7 commit 090a157
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/libstd/sys_common/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/std-backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ use std::str;
fn main() {
let args: Vec<String> = 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");
Expand Down

0 comments on commit 090a157

Please sign in to comment.