-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Remove ty_to_def_id
#52381
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
Remove ty_to_def_id
#52381
Changes from 2 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 |
---|---|---|
|
@@ -399,6 +399,9 @@ impl CodegenContext { | |
} | ||
|
||
struct DiagnosticHandlers<'a> { | ||
#[allow(dead_code)] | ||
// This value is not actually dead, llcx has pointers to it and needs these pointers to be alive | ||
// until Drop is executed on this object | ||
inner: Box<(&'a CodegenContext, &'a Handler)>, | ||
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. Do you mean the heap allocation itself? This is really confusing, maybe a raw pointer should be kept instead, with a manual 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. Also maybe the comment should be phrased to be about the callback having a copy of the pointer or something. It's not really "self-referential" insofar as much as it is scoping a resource for the duration C++ needs it. |
||
llcx: ContextRef, | ||
} | ||
|
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.
Heh, are the only two lang item types,
PhantomData
andBox
?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.
Ugh. I don't see why Box should be special. Depending on the
lang_item
nes of a type seems rather fragile.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.
I agree it shouldn't be, but once upon a time there were many lang items, one for each of "{co,contra,in}variant {lifetime,type}" (so 6 at least), so maybe that's where it's leftover from.
I'm just amused only two types are left and the
Box
case actually hides some warnings!