Change:
Symbol names are not properly supported yet on msvc, so backtraces are generally unhelpful. As a result, is currently disabled. This issue can be closed when it's been reenabled.

Discussion:
2) } <ins> // Indicate that we want CodeView debug information on MSVC if cx.sess().target.target.options.is_like_msvc { llvm::LLVMRustAddModuleFlag(cx.llmod(), "CodeView0".as_ptr() as *const _, 1) } </ins> // Prevent bitcode readers from deleting the debug info. let ptr = "Debug Info Version0".as_ptr(); llvm::LLVMRustAddModuleFlag(cx.llmod(), ptr as *const _,

// seemingly completely unrelated change. // Unfortunately, LLVM has no "disable" option for this, so we have to set // "enable" to 0 instead. // compile-flags:-g -Cllvm-args=-enable-tail-merge=0 // ignore-pretty as this critically relies on line numbers

() => ((file!(), line!())) } <del> #[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android"), not(all(target_os = "linux", target_arch = "arm"))))] </del> macro_rules! dump_and_die { ($($pos:expr),*) => ({ // FIXME(#18285): we cannot include the current position because // the macro span takes over the last frame's file/line. <del> dump_filelines(&[$($pos),*]); panic!(); </del> <ins> if cfg!(target_os = "macos") || cfg!(target_os = "ios") || cfg!(target_os = "android") || cfg!(all(target_os = "linux", target_arch = "arm")) || cfg!(all(windows, target_env = "gnu")) { // skip these platforms as this support isn't implemented yet. } else { dump_filelines(&[$($pos),*]); panic!(); } </ins> }) } <del> // this does not work on Windows, Android, OSX or iOS #[cfg(not(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android"), not(all(target_os = "linux", target_arch = "arm")))))] macro_rules! dump_and_die { ($($pos:expr),*) => ({ let _ = [$($pos),*]; }) } </del> // we can't use a function as it will alter the backtrace macro_rules! check { ($counter:expr; $($pos:expr),*) => ({

// no-pretty-expanded FIXME #15189 // ignore-android FIXME #17520 <del> // ignore-msvc FIXME #28133 </del> <ins> // compile-flags:-g </ins> use std::env; use std::process::{Command, Stdio}; use std::str; <del> use std::ops::{Drop, FnMut, FnOnce}; </del> #[inline(never)] fn foo() {

let out = p.wait_with_output().unwrap(); assert!(!out.status.success()); let s = str::from_utf8(&out.stderr).unwrap(); <del> assert!(s.contains("stack backtrace") && s.contains("foo::h"), </del> <ins> assert!(s.contains("stack backtrace") && s.contains(" - foo"), </ins> "bad output: {}", s); // Make sure the stack trace is *not* printed

let out = p.wait_with_output().unwrap(); assert!(!out.status.success()); let s = str::from_utf8(&out.stderr).unwrap(); <del> assert!(!s.contains("stack backtrace") && !s.contains("foo::h"), </del> <ins> assert!(!s.contains("stack backtrace") && !s.contains(" - foo"), </ins> "bad output2: {}", s); // Make sure a stack trace is printed

let s = str::from_utf8(&out.stderr).unwrap(); // loosened the following from double::h to double:: due to // spurious failures on mac, 32bit, optimized <del> assert!(s.contains("stack backtrace") && s.contains("double::"), </del> <ins> assert!(s.contains("stack backtrace") && s.contains(" - double"), </ins> "bad output3: {}", s); // Make sure a stack trace isn't printed too many times

"bad output4: {}", s); } <del> #[cfg(not(all(windows, target_arch = "x86")))] </del> fn main() { <ins> if cfg!(windows) && cfg!(target_arch = "x86") && cfg!(target_env = "gnu") { return } </ins> let args: Vec<String> = env::args().collect(); if args.len() >= 2 && args[1] == "fail" { foo();

runtest(&args[0]); } } <del> // See issue 28218 #[cfg(all(windows, target_arch = "x86"))] fn main() {} </del>