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

add 2 ices #1315

Merged
merged 2 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions ices/98322.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#![feature(generic_const_exprs)]

// Main function seems irrelevant
fn main() {}

// Constant must be provided via an associated constant in a trait
pub trait ConstTrait {
const ASSOC_CONST: usize;
}

// For some reason I find it's necessary to have an implementation of this trait that recurses
pub trait OtherTrait
{
fn comm(self);
}

// There must be a blanket impl here
impl<T> OtherTrait for T where
T: ConstTrait,
[();T::ASSOC_CONST]: Sized,
{
fn comm(self) {
todo!()
}
}

// The struct must be recursive
pub struct RecursiveStruct(Box<RecursiveStruct>);

// This implementation must exist, and it must recurse into its child
impl OtherTrait for RecursiveStruct {
fn comm(self) {
(self.0).comm();
}
}

38 changes: 38 additions & 0 deletions ices/98372.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#![feature(
no_core, lang_items, intrinsics, unboxed_closures, type_ascription, extern_types,
untagged_unions, decl_macro, rustc_attrs, transparent_unions, auto_traits,
thread_local
)]
#![no_core]

#[lang = "sized"]
pub trait Sized {}

#[lang = "unsize"]
pub trait Unsize<T: ?Sized> {}

#[lang = "coerce_unsized"]
pub trait CoerceUnsized<T> {}

#[lang = "copy"]
pub trait Copy {}

#[lang = "sync"]
pub unsafe trait Sync {}

unsafe impl Sync for [u8; 16] {}

pub trait Allocator {
}

pub struct Global;

impl Allocator for Global {}

#[lang = "owned_box"]
pub struct Box<
T: ?Sized,
A: Allocator = Global,
>(*mut T, A);

pub fn main() {}