-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Stable MonoItem
#116465
Stable MonoItem
#116465
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod body; | ||
pub mod mono; | ||
|
||
pub use body::*; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use crate::{ty::Instance, DefId, Opaque}; | ||
|
||
#[derive(Clone, Debug)] | ||
pub enum MonoItem { | ||
Fn(Instance), | ||
Static(DefId), | ||
GlobalAsm(Opaque), | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -565,3 +565,24 @@ pub enum ImplPolarity { | |
Negative, | ||
Reservation, | ||
} | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct Instance { | ||
pub def: InstanceDef, | ||
pub args: GenericArgs, | ||
} | ||
|
||
#[derive(Clone, Debug)] | ||
pub enum InstanceDef { | ||
Item(DefId), | ||
Intrinsic(DefId), | ||
VTableShim(DefId), | ||
ReifyShim(DefId), | ||
FnPtrShim(DefId, Ty), | ||
Virtual(DefId, usize), | ||
ClosureOnceShim { call_once: DefId, track_caller: bool }, | ||
ThreadLocalShim(DefId), | ||
DropGlue(DefId, Option<Ty>), | ||
CloneShim(DefId, Ty), | ||
FnPtrAddrShim(DefId, Ty), | ||
} | ||
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 think this should expose all the kinds of shims rustc has. This list changes occasionally. Instead I think you should have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe merge this into the
InstanceDef
variants? For shims this duplicates information with theTy
and having it get out of sync could potentially crash the compiler and if it doesn't crash would likely misbehave.