-
Notifications
You must be signed in to change notification settings - Fork 13.4k
make ty::Ty: Debug
not call the Display
impl
#107084
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
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
586a25a
make `Ty: Debug` be useful for debugging
BoxyUwU 32e3232
make type layout use display
BoxyUwU 3e4dfc8
normalize stderr
BoxyUwU 2440e80
mir printing changes
BoxyUwU ea96099
dont use `escape` with `Ty` debug formatting
BoxyUwU 6f011f1
format `layout_of({ty})` without `Debug`
BoxyUwU 9bdf7ca
special case `TyAndLayout` debug impl
BoxyUwU 31b3373
rebase
BoxyUwU File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -458,12 +458,18 @@ impl<'a, Ty> TyAndLayout<'a, Ty> { | |
|
||
/// Information about how to pass an argument to, | ||
/// or return a value from, a function, under some ABI. | ||
#[derive(PartialEq, Eq, Hash, Debug, HashStable_Generic)] | ||
#[derive(PartialEq, Eq, Hash, HashStable_Generic)] | ||
pub struct ArgAbi<'a, Ty> { | ||
pub layout: TyAndLayout<'a, Ty>, | ||
pub mode: PassMode, | ||
} | ||
|
||
impl<'a, Ty: fmt::Debug + fmt::Display> fmt::Debug for ArgAbi<'a, Ty> { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
f.debug_struct("ArgAbi").field("layout", &self.layout).field("mode", &self.mode).finish() | ||
} | ||
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. Why does this become necessary? EDIT: Oh I see, it's the new trait bounds on the TyAndLayout debug impl. That's unfortunate... but still, this seems like the best option then. |
||
} | ||
|
||
impl<'a, Ty> ArgAbi<'a, Ty> { | ||
pub fn new( | ||
cx: &impl HasDataLayout, | ||
|
@@ -605,7 +611,7 @@ pub enum Conv { | |
/// | ||
/// I will do my best to describe this structure, but these | ||
/// comments are reverse-engineered and may be inaccurate. -NDM | ||
#[derive(PartialEq, Eq, Hash, Debug, HashStable_Generic)] | ||
#[derive(PartialEq, Eq, Hash, HashStable_Generic)] | ||
pub struct FnAbi<'a, Ty> { | ||
/// The LLVM types of each argument. | ||
pub args: Box<[ArgAbi<'a, Ty>]>, | ||
|
@@ -626,6 +632,19 @@ pub struct FnAbi<'a, Ty> { | |
pub can_unwind: bool, | ||
} | ||
|
||
impl<'a, Ty: fmt::Debug + fmt::Display> fmt::Debug for FnAbi<'a, Ty> { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
f.debug_struct("FnAbi") | ||
.field("args", &self.args) | ||
.field("ret", &self.ret) | ||
.field("c_variadic", &self.c_variadic) | ||
.field("fixed_count", &self.fixed_count) | ||
.field("conv", &self.conv) | ||
.field("can_unwind", &self.can_unwind) | ||
.finish() | ||
} | ||
} | ||
|
||
/// Error produced by attempting to adjust a `FnAbi`, for a "foreign" ABI. | ||
#[derive(Copy, Clone, Debug, HashStable_Generic)] | ||
pub enum AdjustForForeignAbiError { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.