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

Commit c048d45

Browse files
authored
add 2 ices (#1315)
1 parent 6550e6b commit c048d45

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

ices/98322.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#![feature(generic_const_exprs)]
2+
3+
// Main function seems irrelevant
4+
fn main() {}
5+
6+
// Constant must be provided via an associated constant in a trait
7+
pub trait ConstTrait {
8+
const ASSOC_CONST: usize;
9+
}
10+
11+
// For some reason I find it's necessary to have an implementation of this trait that recurses
12+
pub trait OtherTrait
13+
{
14+
fn comm(self);
15+
}
16+
17+
// There must be a blanket impl here
18+
impl<T> OtherTrait for T where
19+
T: ConstTrait,
20+
[();T::ASSOC_CONST]: Sized,
21+
{
22+
fn comm(self) {
23+
todo!()
24+
}
25+
}
26+
27+
// The struct must be recursive
28+
pub struct RecursiveStruct(Box<RecursiveStruct>);
29+
30+
// This implementation must exist, and it must recurse into its child
31+
impl OtherTrait for RecursiveStruct {
32+
fn comm(self) {
33+
(self.0).comm();
34+
}
35+
}
36+

ices/98372.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#![feature(
2+
no_core, lang_items, intrinsics, unboxed_closures, type_ascription, extern_types,
3+
untagged_unions, decl_macro, rustc_attrs, transparent_unions, auto_traits,
4+
thread_local
5+
)]
6+
#![no_core]
7+
8+
#[lang = "sized"]
9+
pub trait Sized {}
10+
11+
#[lang = "unsize"]
12+
pub trait Unsize<T: ?Sized> {}
13+
14+
#[lang = "coerce_unsized"]
15+
pub trait CoerceUnsized<T> {}
16+
17+
#[lang = "copy"]
18+
pub trait Copy {}
19+
20+
#[lang = "sync"]
21+
pub unsafe trait Sync {}
22+
23+
unsafe impl Sync for [u8; 16] {}
24+
25+
pub trait Allocator {
26+
}
27+
28+
pub struct Global;
29+
30+
impl Allocator for Global {}
31+
32+
#[lang = "owned_box"]
33+
pub struct Box<
34+
T: ?Sized,
35+
A: Allocator = Global,
36+
>(*mut T, A);
37+
38+
pub fn main() {}

0 commit comments

Comments
 (0)