-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Error when passing reference to Allocator impl to Box::new_in #92054
Labels
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
pjht
added
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Dec 18, 2021
pjht
changed the title
Error when passing reference to Allocator impl with fields to Box::new_in
Error when passing reference to Allocator impl to Box::new_in
Dec 18, 2021
CodeI think this is the same bug. Playground repro. #![feature(allocator_api)]
use std::alloc::{Allocator, Global, Layout};
fn main() {
let layout: Layout = None.unwrap();
let ptr: *mut u8 = Global.allocate(layout).unwrap().as_ptr() as _;
// let box_ = unsafe { Box::from_raw_in(ptr, &Global) }; // ICE 1
let slice: &mut [u8] = unsafe { std::slice::from_raw_parts_mut(ptr, 0) };
let box_ = unsafe { Box::from_raw_in(slice, &Global) }; // ICE 2
box_.len();
} Meta
Error output
Backtrace
|
BGR360
added a commit
to BGR360/glacier
that referenced
this issue
Dec 27, 2021
rust-lang/rust#92054 Kudos to @mwerschy for reducing.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 17, 2022
Fix ICE when using Box<T, A> with pointer sized A Fixes rust-lang#78459 Note that using `Box<T, A>` with a more than pointer sized `A` or using a pointer sized `A` with a Box of a DST will produce a different ICE (rust-lang#92054) which is not fixed by this PR.
This is a duplicate of #81270 |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 28, 2022
Fix ICE when using Box<T, A> with large A A sequel to rust-lang#94043 that fixes rust-lang#81270 and rust-lang#92054 (duplicate).
This was not closed by #94414 @jonas-schievink can you please close this? :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Could not isolate, but I think it was caused by passing a reference to a custom impl of Allocator to Box::new_zeroed_slice_in.
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: