File tree Expand file tree Collapse file tree 2 files changed +33
-32
lines changed Expand file tree Collapse file tree 2 files changed +33
-32
lines changed Original file line number Diff line number Diff line change
1
+ // Copied from https://github.com/rust-lang/rust/blob/2cb0b8582ebbf9784db9cec06fff517badbf4553/src/test/ui/issues/issue-45731.rs
2
+ // This needs to go in its own file, since it modifies the dSYM
3
+ // for the entire test
4
+ #[ test]
5
+ #[ cfg( target_os = "macos" ) ]
6
+ fn simple_test ( ) {
7
+ use std:: { env, fs, panic} ;
8
+
9
+ // Find our dSYM and replace the DWARF binary with an empty file
10
+ let mut dsym_path = env:: current_exe ( ) . unwrap ( ) ;
11
+ let executable_name = dsym_path. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ;
12
+ assert ! ( dsym_path. pop( ) ) ; // Pop executable
13
+ dsym_path. push ( format ! (
14
+ "{}.dSYM/Contents/Resources/DWARF/{0}" ,
15
+ executable_name
16
+ ) ) ;
17
+ {
18
+ let _ = fs:: OpenOptions :: new ( )
19
+ . read ( false )
20
+ . write ( true )
21
+ . truncate ( true )
22
+ . create ( false )
23
+ . open ( & dsym_path)
24
+ . unwrap ( ) ;
25
+ }
26
+
27
+ env:: set_var ( "RUST_BACKTRACE" , "1" ) ;
28
+
29
+ // We don't need to die of panic, just trigger a backtrace
30
+ let _ = panic:: catch_unwind ( || {
31
+ assert ! ( false ) ;
32
+ } ) ;
33
+ }
Original file line number Diff line number Diff line change @@ -248,35 +248,3 @@ fn is_serde() {
248
248
is_serialize :: < backtrace:: Backtrace > ( ) ;
249
249
is_deserialize :: < backtrace:: Backtrace > ( ) ;
250
250
}
251
-
252
- // Copied from https://github.com/rust-lang/rust/blob/2cb0b8582ebbf9784db9cec06fff517badbf4553/src/test/ui/issues/issue-45731.rs
253
- #[ test]
254
- #[ cfg( target_os = "macos" ) ]
255
- fn simple_test ( ) {
256
- use std:: { env, fs, panic} ;
257
-
258
- // Find our dSYM and replace the DWARF binary with an empty file
259
- let mut dsym_path = env:: current_exe ( ) . unwrap ( ) ;
260
- let executable_name = dsym_path. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ;
261
- assert ! ( dsym_path. pop( ) ) ; // Pop executable
262
- dsym_path. push ( format ! (
263
- "{}.dSYM/Contents/Resources/DWARF/{0}" ,
264
- executable_name
265
- ) ) ;
266
- {
267
- let _ = fs:: OpenOptions :: new ( )
268
- . read ( false )
269
- . write ( true )
270
- . truncate ( true )
271
- . create ( false )
272
- . open ( & dsym_path)
273
- . unwrap ( ) ;
274
- }
275
-
276
- env:: set_var ( "RUST_BACKTRACE" , "1" ) ;
277
-
278
- // We don't need to die of panic, just trigger a backtrace
279
- let _ = panic:: catch_unwind ( || {
280
- assert ! ( false ) ;
281
- } ) ;
282
- }
You can’t perform that action at this time.
0 commit comments