-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Remove ty_to_def_id
#52381
Conversation
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
!field.is_positional() | ||
&& !self.symbol_is_live(field.id, None) | ||
&& !is_marker_field | ||
&& !field_type.is_phantom_data() |
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
and Box
?
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!
@@ -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 comment
The 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 Drop
impl that uses Box::from_raw
.
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.
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.
@bors r+ |
📌 Commit ecab96f has been approved by |
☀️ Test successful - status-appveyor, status-travis |
fixes #52341
The uses were mostly convenience and generally "too powerful" (would also have worked for types that weren't interesting at the use site)
r? @eddyb