Associate an allocator to boxes#55139
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
This turns `Box<T>` into `Box<T, A: Alloc = Global>`. This is a minimalist change to achieve this, not touching anything that could have backwards incompatible consequences like requiring type annotations in places where they currently aren't required, per rust-lang#50822 (comment)
|
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 |
|
As expected #52694 is still a problem. There is no way around it, short of requiring LLVM 7 for system LLVM builds. One problem here being that there isn't even a llvm-7-tools package for any version of Ubuntu (and travis builds are using 16.04, which doesn't even have LLVM 6) |
|
This PR introduces some new |
| if size != 0 { | ||
| let layout = Layout::from_size_align_unchecked(size, align); | ||
| dealloc(ptr as *mut u8, layout); | ||
| a.dealloc(NonNull::new_unchecked(ptr).cast(), layout); |
There was a problem hiding this comment.
impl<T> From<Unique<T>> for NonNull<T> is safe and can be used here.
|
Ping from triage! Is there a way to work around the LLVM issues, short of requiring at least LLVM 7.0? Raising the minimum LLVM version would probably involve some kind of team RFC, but I'm not sure which team would be most appropriate. |
|
☔ The latest upstream changes (presumably #55316) made this pull request unmergeable. Please resolve the merge conflicts. |
This turns
Box<T>intoBox<T, A: Alloc = Global>. This is aminimalist change to achieve this, not touching anything that could have
backwards incompatible consequences like requiring type annotations in
places where they currently aren't required,
per #50822 (comment)
This is a rebased version of #50882, meant primarily to get CI results and see if #52694 is still a problem.
Cc: @SimonSapin