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

ices/92054-2.rs: fixed with no errors #1153

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#92054

#![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 slice: &mut [u8] = unsafe { std::slice::from_raw_parts_mut(ptr, 0) };
    let box_ = unsafe { Box::from_raw_in(slice, &Global) };
    box_.len();
}
=== stdout ===
=== stderr ===
==============

=== stdout ===
=== stderr ===
==============
@Alexendoo Alexendoo merged commit 64e17eb into master Mar 1, 2022
@Alexendoo Alexendoo deleted the autofix/ices/92054-2.rs branch March 1, 2022 14:50
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