Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/89682-1.rs: fixed with no errors #1152

Merged
merged 1 commit into from
Mar 1, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Mar 1, 2022

Issue: rust-lang/rust#89682

#![feature(allocator_api)]

use core::alloc::{AllocError, Allocator, Layout};
use core::ptr::NonNull;

struct AwfulAllocator<const N: usize>([u64; N]);

unsafe impl<const N: usize> Allocator for AwfulAllocator<N> {
    fn allocate(&self, _layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
        todo!()
    }
    unsafe fn deallocate(&self, _ptr: NonNull<u8>, _layout: Layout) {
        todo!()
    }
}

fn main() {
    let f = AwfulAllocator([0; 128]);
    let _x = Box::<i32, AwfulAllocator<128>>::new_in(43, f);
}
=== stdout ===
=== stderr ===
==============

=== stdout ===
=== stderr ===
==============
@Alexendoo Alexendoo merged commit ccb583c into master Mar 1, 2022
@Alexendoo Alexendoo deleted the autofix/ices/89682-1.rs branch March 1, 2022 14:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants