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

ices/101964.rs: fixed with errors #1610

Merged
merged 1 commit into from
Jun 24, 2023
Merged

ices/101964.rs: fixed with errors #1610

merged 1 commit into from
Jun 24, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#101964

#![crate_type = "lib"]
#![feature(lang_items)]
#![no_std]

struct NonNull<T: ?Sized>(*mut T);

struct Unique<T: ?Sized>(NonNull<T>);

#[lang = "owned_box"]
pub struct Box<T: ?Sized>(Unique<T>);

impl<T: ?Sized> Drop for Box<T> {
    fn drop(&mut self) {}
}

#[lang = "box_free"]
#[inline(always)]
unsafe fn box_free<T: ?Sized>(ptr: Unique<T>) {
    dealloc(ptr.0.0)
}

#[inline(never)]
fn dealloc<T: ?Sized>(_: *mut T) {}

pub struct Foo<T>(T);

pub fn foo(a: Option<Box<Foo<usize>>>) -> usize {
    let f = match a {
        None => Foo(0),
        Some(vec) => *vec,
    };
    f.0
}
=== stdout ===
=== stderr ===
error[E0522]: definition of an unknown language item: `box_free`
  --> /home/runner/work/glacier/glacier/ices/101964.rs:16:1
   |
16 | #[lang = "box_free"]
   | ^^^^^^^^^^^^^^^^^^^^ definition of unknown language item `box_free`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0522`.
==============

=== stdout ===
=== stderr ===
error[E0522]: definition of an unknown language item: `box_free`
  --> /home/runner/work/glacier/glacier/ices/101964.rs:16:1
   |
16 | #[lang = "box_free"]
   | ^^^^^^^^^^^^^^^^^^^^ definition of unknown language item `box_free`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0522`.
==============
@JohnTitor JohnTitor merged commit 86bf54d into master Jun 24, 2023
@JohnTitor JohnTitor deleted the autofix/ices/101964.rs branch June 24, 2023 05:21
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