-
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
Internal compiler error when implementing local allocator and box. #90911
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
adsnaider
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
Nov 14, 2021
I realized that the compiler still panics when the #![no_std]
#![feature(allocator_api)]
#![feature(new_uninit)]
extern crate alloc;
use alloc::boxed::Box;
use core::{
alloc::{AllocError, Allocator, Layout},
ptr::NonNull,
};
pub struct Foo {}
unsafe impl Allocator for Foo {
fn allocate(&self, _layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
panic!();
}
unsafe fn deallocate(&self, _ptr: NonNull<u8>, _layout: Layout) {
panic!();
}
}
impl Foo {
pub fn foo(&self) {
let _bar = Box::new_in(20, self);
}
} |
I get a different error, probably due to a newer compiler version:
Backtrace
|
JohnTitor
added
the
requires-nightly
This issue requires a nightly compiler in some way.
label
Nov 16, 2021
this is because the value you pass as the allocator is a duplicate of #78459 |
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.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: