12
12
//!
13
13
//! Typical usage will look like this:
14
14
//!
15
- //! ```rust
15
+ #![ cfg_attr( bootstrap, doc = "```rust,ignore" ) ]
16
+ #![ cfg_attr( not( bootstrap) , doc = "```rust" ) ]
16
17
//! #![feature(core_intrinsics, custom_mir)]
17
18
//! #![allow(internal_features)]
18
19
//!
62
63
//!
63
64
//! # Examples
64
65
//!
65
- //! ```rust
66
+ #![ cfg_attr( bootstrap, doc = "```rust,ignore" ) ]
67
+ #![ cfg_attr( not( bootstrap) , doc = "```rust" ) ]
66
68
//! #![feature(core_intrinsics, custom_mir)]
67
69
//! #![allow(internal_features)]
68
70
//!
@@ -317,7 +319,8 @@ define!(
317
319
///
318
320
/// # Examples
319
321
///
320
- /// ```rust
322
+ #[ cfg_attr( bootstrap, doc = "```rust,ignore" ) ]
323
+ #[ cfg_attr( not( bootstrap) , doc = "```rust" ) ]
321
324
/// #![allow(internal_features)]
322
325
/// #![feature(custom_mir, core_intrinsics)]
323
326
///
@@ -361,6 +364,11 @@ define!(
361
364
#[ doc( hidden) ]
362
365
fn __internal_make_place<T >( place: T ) -> * mut T
363
366
) ;
367
+ define ! (
368
+ "mir_debuginfo" ,
369
+ #[ doc( hidden) ]
370
+ fn __debuginfo<T >( name: & ' static str , s: T )
371
+ ) ;
364
372
365
373
/// Macro for generating custom MIR.
366
374
///
@@ -371,6 +379,7 @@ pub macro mir {
371
379
(
372
380
$( type RET = $ret_ty: ty ; ) ?
373
381
$( let $local_decl: ident $( : $local_decl_ty: ty) ? ; ) *
382
+ $( debug $dbg_name: ident => $dbg_data: expr ; ) *
374
383
375
384
{
376
385
$( $entry: tt) *
@@ -394,26 +403,32 @@ pub macro mir {
394
403
$(
395
404
let $local_decl $( : $local_decl_ty) ? ;
396
405
) *
397
-
398
406
:: core:: intrinsics:: mir:: __internal_extract_let!( $( $entry) * ) ;
399
407
$(
400
408
:: core:: intrinsics:: mir:: __internal_extract_let!( $( $block) * ) ;
401
409
) *
402
410
403
411
{
404
- // Finally, the contents of the basic blocks
405
- :: core:: intrinsics:: mir:: __internal_remove_let!( {
406
- { }
407
- { $( $entry) * }
408
- } ) ;
412
+ // Now debuginfo
409
413
$(
414
+ __debuginfo ( stringify ! ( $dbg_name) , $dbg_data) ;
415
+ ) *
416
+
417
+ {
418
+ // Finally, the contents of the basic blocks
410
419
:: core:: intrinsics:: mir:: __internal_remove_let!( {
411
420
{ }
412
- { $( $block ) * }
421
+ { $( $entry ) * }
413
422
} ) ;
414
- ) *
423
+ $(
424
+ :: core:: intrinsics:: mir:: __internal_remove_let!( {
425
+ { }
426
+ { $( $block) * }
427
+ } ) ;
428
+ ) *
415
429
416
- RET
430
+ RET
431
+ }
417
432
}
418
433
}
419
434
} }
0 commit comments