-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Doc comment custom MIR debuginfo. #117015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -249,6 +249,29 @@ | |||||||||||||||||||
//! - [`Call`] has an associated function as well. The third argument of this function is a normal | ||||||||||||||||||||
//! function call expression, for example `my_other_function(a, 5)`. | ||||||||||||||||||||
//! | ||||||||||||||||||||
//! #### Debuginfo | ||||||||||||||||||||
//! | ||||||||||||||||||||
//! - A debuginfo name can be given to a local using `debug my_name => contents;`. | ||||||||||||||||||||
//! For `contents`, we use the same syntax as operands, to support both places and constants. | ||||||||||||||||||||
Comment on lines
+254
to
+255
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
//! | ||||||||||||||||||||
//! ```rust | ||||||||||||||||||||
//! #![allow(internal_features)] | ||||||||||||||||||||
//! #![feature(core_intrinsics, custom_mir)] | ||||||||||||||||||||
//! | ||||||||||||||||||||
//! use core::intrinsics::mir::*; | ||||||||||||||||||||
//! | ||||||||||||||||||||
//! #[custom_mir(dialect = "built")] | ||||||||||||||||||||
//! fn debuginfo(option: Option<&i32>) { | ||||||||||||||||||||
//! mir!( | ||||||||||||||||||||
//! debug option => option; | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
? |
||||||||||||||||||||
//! debug projection => *Field::<&i32>(Variant(option, 1), 0); | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So what does this mean? There's no local "projection" so I'm confused by both the left-hand side and the right-hand side. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This mean debuginfo name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And what does that mean?^^ What's a "debuginfo name"? If the intention is that this is only understandable for people that know our debuginfo system internals, then I guess it's fine. But as someone who has no idea at all about debuginfo, your explanation tells me nothing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know the better terminology. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah so it's meant to be the name of the variable in the original source code? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I like that. |
||||||||||||||||||||
//! debug constant => 5_usize; | ||||||||||||||||||||
//! { | ||||||||||||||||||||
//! Return() | ||||||||||||||||||||
//! } | ||||||||||||||||||||
//! ) | ||||||||||||||||||||
//! } | ||||||||||||||||||||
//! ``` | ||||||||||||||||||||
|
||||||||||||||||||||
#![unstable( | ||||||||||||||||||||
feature = "custom_mir", | ||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// MIR for `constant` after built | ||
|
||
fn constant() -> () { | ||
debug scalar => const 5_usize; | ||
let mut _0: (); | ||
|
||
bb0: { | ||
return; | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.