-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 special case for Box<ZST> in trans #38574
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@@ -144,7 +144,8 @@ unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 { | |||
} | |||
|
|||
#[cfg(not(test))] | |||
#[lang = "exchange_free"] | |||
#[cfg_attr(stage0, lang = "exchange_free")] | |||
#[cfg_attr(not(stage0), allow(unused))] |
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.
You can add just #[cfg(stage0)]
so it simply doesn't exist after that.
bcx | ||
} | ||
let ptr = MaybeSizedValue::sized(bcx.load(ptr.value)); | ||
drop_ty(&bcx, ptr, content_ty); |
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.
You can move this call out of the if/else.
r? @eddyb |
3e8eb34
to
0761aa0
Compare
Okay, this should be ready to go now. Smoke tests passed locally, but we can wait for Travis. |
Travis failed, but it looks spurious; I can't see any problems in the build log. |
Restarting Travis just in case. |
assert!(bcx.ccx.shared().type_is_sized(content_ty)); | ||
let sizing_type = sizing_type_of(bcx.ccx, content_ty); | ||
let content_size = llsize_of_alloc(bcx.ccx, sizing_type); | ||
ptr.value = bcx.pointercast(ptr.value, Type::i8p(bcx.ccx)); |
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.
This doesn't feel right. Isn't the function written to take *mut T
? Wouldn't, then, this cast trigger a LLVM assertion?
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.
Huh, odd. Tests passed locally both with and without, but since I agree it's odd to have it, I've removed it. Code is cleaner that way too.
0761aa0
to
b4a3d22
Compare
@bors r+ |
📌 Commit b4a3d22 has been approved by |
@@ -725,18 +727,13 @@ fn find_drop_glue_neighbors<'a, 'tcx>(scx: &SharedCrateContext<'a, 'tcx>, | |||
|
|||
// Make sure the exchange_free_fn() lang-item gets translated if |
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.
outdated comment here?
b3ef574
to
adf7b50
Compare
@bors r+ |
📌 Commit adf7b50 has been approved by |
Trans used to insert code equivalent to box_free in a wrapper around exchange_free, and that code is now removed from trans.
adf7b50
to
ca115dd
Compare
@bors r+ |
📌 Commit ca115dd has been approved by |
Remove special case for Box<ZST> in trans Remove extra lang item, `exchange_free`; use `box_free` instead. Trans used to insert code equivalent to `box_free` in a wrapper around `exchange_free`, and that code is now removed from trans. Fixes #37710.
☀️ Test successful - status-appveyor, status-travis |
Remove extra lang item,
exchange_free
; usebox_free
instead.Trans used to insert code equivalent to
box_free
in a wrapper aroundexchange_free
, and that code is now removed from trans.Fixes #37710.