summaryrefslogtreecommitdiffstats
path: root/library/core/src/intrinsics
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /library/core/src/intrinsics
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/core/src/intrinsics')
-rw-r--r--library/core/src/intrinsics/mir.rs45
1 files changed, 30 insertions, 15 deletions
diff --git a/library/core/src/intrinsics/mir.rs b/library/core/src/intrinsics/mir.rs
index ef0a2fd4e..cab195dad 100644
--- a/library/core/src/intrinsics/mir.rs
+++ b/library/core/src/intrinsics/mir.rs
@@ -12,9 +12,10 @@
//!
//! Typical usage will look like this:
//!
-//! ```rust
+#![cfg_attr(bootstrap, doc = "```rust,ignore")]
+#![cfg_attr(not(bootstrap), doc = "```rust")]
//! #![feature(core_intrinsics, custom_mir)]
-#![cfg_attr(not(bootstrap), doc = "#![allow(internal_features)]")]
+//! #![allow(internal_features)]
//!
//! use core::intrinsics::mir::*;
//!
@@ -62,9 +63,10 @@
//!
//! # Examples
//!
-//! ```rust
+#![cfg_attr(bootstrap, doc = "```rust,ignore")]
+#![cfg_attr(not(bootstrap), doc = "```rust")]
//! #![feature(core_intrinsics, custom_mir)]
-#![cfg_attr(not(bootstrap), doc = "#![allow(internal_features)]")]
+//! #![allow(internal_features)]
//!
//! use core::intrinsics::mir::*;
//!
@@ -317,8 +319,9 @@ define!(
///
/// # Examples
///
- /// ```rust
- #[cfg_attr(not(bootstrap), doc = "#![allow(internal_features)]")]
+ #[cfg_attr(bootstrap, doc = "```rust,ignore")]
+ #[cfg_attr(not(bootstrap), doc = "```rust")]
+ /// #![allow(internal_features)]
/// #![feature(custom_mir, core_intrinsics)]
///
/// use core::intrinsics::mir::*;
@@ -361,6 +364,11 @@ define!(
#[doc(hidden)]
fn __internal_make_place<T>(place: T) -> *mut T
);
+define!(
+ "mir_debuginfo",
+ #[doc(hidden)]
+ fn __debuginfo<T>(name: &'static str, s: T)
+);
/// Macro for generating custom MIR.
///
@@ -371,6 +379,7 @@ pub macro mir {
(
$(type RET = $ret_ty:ty ;)?
$(let $local_decl:ident $(: $local_decl_ty:ty)? ;)*
+ $(debug $dbg_name:ident => $dbg_data:expr ;)*
{
$($entry:tt)*
@@ -394,26 +403,32 @@ pub macro mir {
$(
let $local_decl $(: $local_decl_ty)? ;
)*
-
::core::intrinsics::mir::__internal_extract_let!($($entry)*);
$(
::core::intrinsics::mir::__internal_extract_let!($($block)*);
)*
{
- // Finally, the contents of the basic blocks
- ::core::intrinsics::mir::__internal_remove_let!({
- {}
- { $($entry)* }
- });
+ // Now debuginfo
$(
+ __debuginfo(stringify!($dbg_name), $dbg_data);
+ )*
+
+ {
+ // Finally, the contents of the basic blocks
::core::intrinsics::mir::__internal_remove_let!({
{}
- { $($block)* }
+ { $($entry)* }
});
- )*
+ $(
+ ::core::intrinsics::mir::__internal_remove_let!({
+ {}
+ { $($block)* }
+ });
+ )*
- RET
+ RET
+ }
}
}
}}