]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-45731.rs
Enable full revision in const generics ui tests
[rust.git] / src / test / ui / issues / issue-45731.rs
1 // run-pass
2 #![allow(unused_variables)]
3 // compile-flags:--test -g
4 // ignore-asmjs wasm2js does not support source maps yet
5
6 #[cfg(target_os = "macos")]
7 #[test]
8 fn simple_test() {
9     use std::{env, panic, fs};
10
11     // Find our dSYM and replace the DWARF binary with an empty file
12     let mut dsym_path = env::current_exe().unwrap();
13     let executable_name = dsym_path.file_name().unwrap().to_str().unwrap().to_string();
14     assert!(dsym_path.pop()); // Pop executable
15     dsym_path.push(format!("{}.dSYM/Contents/Resources/DWARF/{0}", executable_name));
16     {
17         let file = fs::OpenOptions::new().read(false).write(true).truncate(true).create(false)
18             .open(&dsym_path).unwrap();
19     }
20
21     env::set_var("RUST_BACKTRACE", "1");
22
23     // We don't need to die of panic, just trigger a backtrace
24     let _ = panic::catch_unwind(|| {
25         assert!(false);
26     });
27 }