From da8597fc49dcf822fbd8df35a17abbdcda4a4d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Fri, 29 Mar 2024 19:39:47 +0100 Subject: [PATCH] add .rs crashes from https://github.com/rust-lang/glacier --- tests/crashes/100041.rs | 17 ++++++++++++ tests/crashes/101962.rs | 11 ++++++++ tests/crashes/102047.rs | 45 +++++++++++++++++++++++++++++++ tests/crashes/102252.rs | 14 ++++++++++ tests/crashes/103899.rs | 27 +++++++++++++++++++ tests/crashes/105238-1.rs | 31 +++++++++++++++++++++ tests/crashes/105238-2.rs | 31 +++++++++++++++++++++ tests/crashes/105488.rs | 39 +++++++++++++++++++++++++++ tests/crashes/108814.rs | 9 +++++++ tests/crashes/109681.rs | 9 +++++++ tests/crashes/110378.rs | 15 +++++++++++ tests/crashes/110630.rs | 28 +++++++++++++++++++ tests/crashes/111742.rs | 12 +++++++++ tests/crashes/112201.rs | 19 +++++++++++++ tests/crashes/113280.rs | 15 +++++++++++ tests/crashes/113379.rs | 7 +++++ tests/crashes/122909.rs | 2 +- tests/crashes/34127.rs | 6 +++++ tests/crashes/54888.rs | 21 +++++++++++++++ tests/crashes/57276.rs | 11 ++++++++ tests/crashes/74299.rs | 24 +++++++++++++++++ tests/crashes/74451.rs | 42 +++++++++++++++++++++++++++++ tests/crashes/79409.rs | 16 +++++++++++ tests/crashes/79590.rs | 19 +++++++++++++ tests/crashes/87577.rs | 4 +++ tests/crashes/88296.rs | 27 +++++++++++++++++++ tests/crashes/90110.rs | 57 +++++++++++++++++++++++++++++++++++++++ tests/crashes/91985.rs | 42 +++++++++++++++++++++++++++++ tests/crashes/96304.rs | 6 +++++ tests/crashes/97501.rs | 22 +++++++++++++++ tests/crashes/98322.rs | 37 +++++++++++++++++++++++++ 31 files changed, 664 insertions(+), 1 deletion(-) create mode 100644 tests/crashes/100041.rs create mode 100644 tests/crashes/101962.rs create mode 100644 tests/crashes/102047.rs create mode 100644 tests/crashes/102252.rs create mode 100644 tests/crashes/103899.rs create mode 100644 tests/crashes/105238-1.rs create mode 100644 tests/crashes/105238-2.rs create mode 100644 tests/crashes/105488.rs create mode 100644 tests/crashes/108814.rs create mode 100644 tests/crashes/109681.rs create mode 100644 tests/crashes/110378.rs create mode 100644 tests/crashes/110630.rs create mode 100644 tests/crashes/111742.rs create mode 100644 tests/crashes/112201.rs create mode 100644 tests/crashes/113280.rs create mode 100644 tests/crashes/113379.rs create mode 100644 tests/crashes/34127.rs create mode 100644 tests/crashes/54888.rs create mode 100644 tests/crashes/57276.rs create mode 100644 tests/crashes/74299.rs create mode 100644 tests/crashes/74451.rs create mode 100644 tests/crashes/79409.rs create mode 100644 tests/crashes/79590.rs create mode 100644 tests/crashes/87577.rs create mode 100644 tests/crashes/88296.rs create mode 100644 tests/crashes/90110.rs create mode 100644 tests/crashes/91985.rs create mode 100644 tests/crashes/96304.rs create mode 100644 tests/crashes/97501.rs create mode 100644 tests/crashes/98322.rs diff --git a/tests/crashes/100041.rs b/tests/crashes/100041.rs new file mode 100644 index 0000000000000..4d113cbe9ed4f --- /dev/null +++ b/tests/crashes/100041.rs @@ -0,0 +1,17 @@ +//@ known-bug: #100041 + +pub trait WellUnformed { + type RequestNormalize; +} + +impl WellUnformed for T { + type RequestNormalize = (); +} + +pub fn latent(_: &[<[[()]] as WellUnformed>::RequestNormalize; 0]) {} + +pub fn bang() { + latent(&[]); +} + +fn main() {} diff --git a/tests/crashes/101962.rs b/tests/crashes/101962.rs new file mode 100644 index 0000000000000..b6a78ce053af0 --- /dev/null +++ b/tests/crashes/101962.rs @@ -0,0 +1,11 @@ +//@ known-bug: #101962 + +#![feature(core_intrinsics)] + +pub fn wrapping(a: T, b: T) { + let _z = core::intrinsics::wrapping_mul(a, b); +} + +fn main() { + wrapping(1,2); +} diff --git a/tests/crashes/102047.rs b/tests/crashes/102047.rs new file mode 100644 index 0000000000000..61976f51273fc --- /dev/null +++ b/tests/crashes/102047.rs @@ -0,0 +1,45 @@ +//@ known-bug: #102047 + +struct Ty1; +struct Ty2; + +pub trait Trait {} + +pub trait WithAssoc1<'a> { + type Assoc; +} +pub trait WithAssoc2<'a> { + type Assoc; +} + +impl Trait fn(>::Assoc, >::Assoc)> for (T, U) +where + T: for<'a> WithAssoc1<'a> + for<'a> WithAssoc2<'a, Assoc = i32>, + U: for<'a> WithAssoc2<'a>, +{ +} + +impl WithAssoc1<'_> for Ty1 { + type Assoc = (); +} +impl WithAssoc2<'_> for Ty1 { + type Assoc = i32; +} +impl WithAssoc1<'_> for Ty2 { + type Assoc = (); +} +impl WithAssoc2<'_> for Ty2 { + type Assoc = u32; +} + +fn foo() +where + T: for<'a> WithAssoc1<'a>, + U: for<'a> WithAssoc2<'a>, + (T, U): Trait, +{ +} + +fn main() { + foo::(); +} diff --git a/tests/crashes/102252.rs b/tests/crashes/102252.rs new file mode 100644 index 0000000000000..200782f95c861 --- /dev/null +++ b/tests/crashes/102252.rs @@ -0,0 +1,14 @@ +//@ known-bug: #102252 + +#![feature(min_specialization, rustc_attrs)] + +#[rustc_specialization_trait] +pub trait Trait {} + +struct Struct +where + Self: Iterator::Item>, {} + +impl Trait for Struct {} + +fn main() {} diff --git a/tests/crashes/103899.rs b/tests/crashes/103899.rs new file mode 100644 index 0000000000000..39c2d72bd357c --- /dev/null +++ b/tests/crashes/103899.rs @@ -0,0 +1,27 @@ +//@ known-bug: #103899 + +trait BaseWithAssoc { + type Assoc; +} + +trait WrapperWithAssoc { + type BaseAssoc: BaseWithAssoc; +} + +struct Wrapper { + inner: B, +} + +struct ProjectToBase { + data_type_h: T::Assoc, +} + +struct DoubleProject { + buffer: Wrapper>, +} + +fn trigger>() -> DoubleProject { + loop {} +} + +fn main() {} diff --git a/tests/crashes/105238-1.rs b/tests/crashes/105238-1.rs new file mode 100644 index 0000000000000..dd44a0f1d775c --- /dev/null +++ b/tests/crashes/105238-1.rs @@ -0,0 +1,31 @@ +//@ known-bug: #105238 + +#![allow(incomplete_features)] +#![feature(generic_const_exprs)] + +trait Ret { + type R; +} + +struct Cond(std::marker::PhantomData, std::marker::PhantomData); + +impl Ret for Cond { + type R = U; +} + +impl Ret for Cond { + type R = V; +} + +struct RobinHashTable> +where + CellIdx: Ret, +{ + _idx: CellIdx::R, +} + +fn main() { + use std::mem::size_of; + println!("{}", size_of::>()); + println!("{}", size_of::>()); +} diff --git a/tests/crashes/105238-2.rs b/tests/crashes/105238-2.rs new file mode 100644 index 0000000000000..368595c6a2acb --- /dev/null +++ b/tests/crashes/105238-2.rs @@ -0,0 +1,31 @@ +//@ known-bug: #105238 + +#![allow(incomplete_features)] +#![feature(generic_const_exprs)] + +trait Ret { + type R; +} + +struct Cond(std::marker::PhantomData, std::marker::PhantomData); + +impl Ret for Cond { + type R = U; +} + +impl Ret for Cond { + type R = V; +} + +struct RobinHashTable< + const MAX_LENGTH: usize, + CellIdx = as Ret>::R, +> { + _idx: CellIdx, +} + +fn main() { + use std::mem::size_of; + println!("{}", size_of::>()); + println!("{}", size_of::>()); +} diff --git a/tests/crashes/105488.rs b/tests/crashes/105488.rs new file mode 100644 index 0000000000000..75fe899f173b6 --- /dev/null +++ b/tests/crashes/105488.rs @@ -0,0 +1,39 @@ +//@ known-bug: #105488 + +pub trait MyFnOnce { + type Output; + + fn call_my_fn_once(self) -> Self::Output; +} + +pub struct WrapFnOnce(F); + +impl D, D: MyFnOnce> MyFnOnce for WrapFnOnce { + type Output = D::Output; + + fn call_my_fn_once(self) -> Self::Output { + D::call_my_fn_once(self.0()) + } +} + +impl D, D: MyFnOnce> MyFnOnce for F { + type Output = D::Output; + + fn call_my_fn_once(self) -> Self::Output { + D::call_my_fn_once(self()) + } +} + +pub fn my_fn_1() -> impl MyFnOnce { + my_fn_2 +} + +pub fn my_fn_2() -> impl MyFnOnce { + WrapFnOnce(my_fn_1) +} + +fn main() { + let v = my_fn_1(); + + let _ = v.call_my_fn_once(); +} diff --git a/tests/crashes/108814.rs b/tests/crashes/108814.rs new file mode 100644 index 0000000000000..c8db848f2e188 --- /dev/null +++ b/tests/crashes/108814.rs @@ -0,0 +1,9 @@ +//@ known-bug: #108814 + +#![feature(non_lifetime_binders)] + +fn take(_: impl for FnOnce(T) -> T) {} + +fn main() { + take(|x| x) +} diff --git a/tests/crashes/109681.rs b/tests/crashes/109681.rs new file mode 100644 index 0000000000000..73ff10070943f --- /dev/null +++ b/tests/crashes/109681.rs @@ -0,0 +1,9 @@ +//@ known-bug: #109681 + +#![crate_type="lib"] +#![feature(linkage)] + +#[linkage = "common"] +pub static TEST3: bool = true; + +fn main() {} diff --git a/tests/crashes/110378.rs b/tests/crashes/110378.rs new file mode 100644 index 0000000000000..93de62d413909 --- /dev/null +++ b/tests/crashes/110378.rs @@ -0,0 +1,15 @@ +//@ known-bug: #110378 +// ignore-tidy-linelength + +#![feature(generic_const_exprs)] + +fn foo(_a: [u8; L], _b: [u8; L]) -> [u8; L + 1] { + [0_u8; L + 1] +} + +fn main() { + let baz = [[0_u8; 1]; 8]; + + let _: [u8; 4] = foo(foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])), foo(foo(baz[4], baz[5]), foo(baz[6], baz[7]))); + //let _: [u8; 3] = foo(foo(baz[0], baz[1]), foo(baz[2], baz[3])); +} diff --git a/tests/crashes/110630.rs b/tests/crashes/110630.rs new file mode 100644 index 0000000000000..f17f6f0781f39 --- /dev/null +++ b/tests/crashes/110630.rs @@ -0,0 +1,28 @@ +//@ known-bug: #110630 + +#![feature(generic_const_exprs)] + +use std::ops::Mul; + +pub trait Indices { + const NUM_ELEMS: usize = I::NUM_ELEMS * N; +} + +pub trait Concat { + type Output; +} + +pub struct Tensor, const N: usize> +where + [u8; I::NUM_ELEMS]: Sized, {} + +impl, J: Indices, const N: usize> Mul> for Tensor +where + I: Concat, + >::Output: Indices, + [u8; I::NUM_ELEMS]: Sized, + [u8; J::NUM_ELEMS]: Sized, + [u8; >::Output::NUM_ELEMS]: Sized, +{ + type Output = Tensor<>::Output, N>; +} diff --git a/tests/crashes/111742.rs b/tests/crashes/111742.rs new file mode 100644 index 0000000000000..fda2a96836f68 --- /dev/null +++ b/tests/crashes/111742.rs @@ -0,0 +1,12 @@ +//@ known-bug: #111742 +// ignore-tidy-linelength + +#![allow(incomplete_features)] +#![feature(generic_const_exprs)] + +const CONST: u32 = 0; +struct Test where [(); N as usize]: , ([u32; N as usize]); + +fn main() { + let _: Test<1>; +} diff --git a/tests/crashes/112201.rs b/tests/crashes/112201.rs new file mode 100644 index 0000000000000..5d363403b8acb --- /dev/null +++ b/tests/crashes/112201.rs @@ -0,0 +1,19 @@ +//@ known-bug: #112201 + +pub fn compose( + f1: impl FnOnce(f64) -> f64 + Clone, + f2: impl FnOnce(f64) -> f64 + Clone, +) -> impl FnOnce(f64) -> f64 + Clone { + move |x| f1(f2(x)) +} + +fn repeat_helper( + f: impl FnOnce(f64) -> f64 + Clone, + res: impl FnOnce(f64) -> f64 + Clone, + times: usize, +) -> impl FnOnce(f64) -> f64 + Clone { + return res; + repeat_helper(f.clone(), compose(f, res), times - 1) +} + +fn main() {} diff --git a/tests/crashes/113280.rs b/tests/crashes/113280.rs new file mode 100644 index 0000000000000..6a04b50c0c8d9 --- /dev/null +++ b/tests/crashes/113280.rs @@ -0,0 +1,15 @@ +//@ known-bug: #113280 + +#![feature(dyn_star, pointer_like_trait)] +#![allow(incomplete_features)] + +use std::fmt::Debug; +use std::marker::PointerLike; + +fn make_dyn_star<'a>(t: impl PointerLike + Debug + 'a) -> dyn* Debug + 'a { + f32::from_bits(0x1) as f64 +} + +fn main() { + println!("{:?}", make_dyn_star(Box::new(1i32))); +} diff --git a/tests/crashes/113379.rs b/tests/crashes/113379.rs new file mode 100644 index 0000000000000..7163cbc39342d --- /dev/null +++ b/tests/crashes/113379.rs @@ -0,0 +1,7 @@ +//@ known-bug: #113379 + +async fn f999() -> Vec { + 'b: { + continue 'b; + } +} diff --git a/tests/crashes/122909.rs b/tests/crashes/122909.rs index 344fcd8801096..90bba772b915e 100644 --- a/tests/crashes/122909.rs +++ b/tests/crashes/122909.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes -//@ known-bug: #12345 +//@ known-bug: #122909 use std::sync::{Arc, Context, Weak}; diff --git a/tests/crashes/34127.rs b/tests/crashes/34127.rs new file mode 100644 index 0000000000000..82504486be56c --- /dev/null +++ b/tests/crashes/34127.rs @@ -0,0 +1,6 @@ +//@ compile-flags: -g -Copt-level=0 +//@ known-bug: #34127 + +pub fn main() { +let _a = [(); 1 << 63]; +} diff --git a/tests/crashes/54888.rs b/tests/crashes/54888.rs new file mode 100644 index 0000000000000..2c87d7ee9e4c8 --- /dev/null +++ b/tests/crashes/54888.rs @@ -0,0 +1,21 @@ +//@ known-bug: #54888 + +#![feature(unsize, coerce_unsized)] + +use std::{ + ops::CoerceUnsized, + marker::Unsize, +}; + +#[repr(C)] +struct Ptr(Box); + +impl CoerceUnsized> for Ptr +where + T: Unsize, +{} + + +fn main() { + let foo = Ptr(Box::new(5)) as Ptr; +} diff --git a/tests/crashes/57276.rs b/tests/crashes/57276.rs new file mode 100644 index 0000000000000..f70be4fba6d8b --- /dev/null +++ b/tests/crashes/57276.rs @@ -0,0 +1,11 @@ +//@ known-bug: #57276 + +#![feature(arbitrary_self_types, dispatch_from_dyn)] + +use std::ops::{Deref, DispatchFromDyn}; + +trait Trait + DispatchFromDyn> { + fn foo(self: T) -> dyn Trait; +} + +fn main() {} diff --git a/tests/crashes/74299.rs b/tests/crashes/74299.rs new file mode 100644 index 0000000000000..0e2ddce1c5b11 --- /dev/null +++ b/tests/crashes/74299.rs @@ -0,0 +1,24 @@ +//@ known-bug: #74299 +#![feature(specialization)] + +trait X { + type U; + fn f(&self) -> Self::U { + loop {} + } +} + +impl X for T { + default type U = (); +} + +trait Y { + fn g(&self) {} +} + +impl Y for <() as X>::U {} +impl Y for ::U {} + +fn main() { + ().f().g(); +} diff --git a/tests/crashes/74451.rs b/tests/crashes/74451.rs new file mode 100644 index 0000000000000..8f93699467896 --- /dev/null +++ b/tests/crashes/74451.rs @@ -0,0 +1,42 @@ +//@ known-bug: #74451 +//@ compile-flags: -Copt-level=0 + +#![feature(specialization)] +#![feature(unsize, coerce_unsized)] +#![allow(incomplete_features)] +#![crate_type = "lib"] + +use std::ops::CoerceUnsized; + +pub struct SmartassPtr(A::Data); + +pub trait Smartass { + type Data; + type Data2: CoerceUnsized<*const [u8]>; +} + +pub trait MaybeObjectSafe {} + +impl MaybeObjectSafe for () {} + +impl Smartass for T { + type Data = ::Data2; + default type Data2 = *const [u8; 0]; +} + +impl Smartass for () { + type Data2 = *const [u8; 1]; +} + +impl Smartass for dyn MaybeObjectSafe { + type Data = *const [u8]; + type Data2 = *const [u8; 0]; +} + +impl CoerceUnsized> for SmartassPtr + where ::Data: std::ops::CoerceUnsized<::Data> +{} + +pub fn conv(s: SmartassPtr<()>) -> SmartassPtr { + s // This shouldn't coerce +} diff --git a/tests/crashes/79409.rs b/tests/crashes/79409.rs new file mode 100644 index 0000000000000..98b5f60633627 --- /dev/null +++ b/tests/crashes/79409.rs @@ -0,0 +1,16 @@ +//@ known-bug: #79409 + +#![feature(extern_types)] +#![feature(unsized_locals)] + +extern { + type Device; +} + +unsafe fn make_device() -> Box { + Box::from_raw(0 as *mut _) +} + +fn main() { + let d: Device = unsafe { *make_device() }; +} diff --git a/tests/crashes/79590.rs b/tests/crashes/79590.rs new file mode 100644 index 0000000000000..b73864cce2349 --- /dev/null +++ b/tests/crashes/79590.rs @@ -0,0 +1,19 @@ +//@ known-bug: #79590 + +trait Database: Restriction {} + +trait Restriction { + type Inner; +} + +struct Test {} + +impl Database for Test {} +impl Restriction for Test { + type Inner = u32; +} + +fn main() { + let t = Test {}; + let x: &dyn Database = &t; +} diff --git a/tests/crashes/87577.rs b/tests/crashes/87577.rs new file mode 100644 index 0000000000000..5b381739b6b6d --- /dev/null +++ b/tests/crashes/87577.rs @@ -0,0 +1,4 @@ +//@ known-bug: #877577 + +#[derive(Debug)] +struct S<#[cfg(feature = "alloc")] N: A> {} diff --git a/tests/crashes/88296.rs b/tests/crashes/88296.rs new file mode 100644 index 0000000000000..999834f5bdecd --- /dev/null +++ b/tests/crashes/88296.rs @@ -0,0 +1,27 @@ +//@ known-bug: #88296 + +#![feature(specialization)] + +trait Foo { + type Bar; +} + +impl Foo for T { + default type Bar = u32; +} + +impl Foo for i32 { + type Bar = i32; +} + +extern "C" { + #[allow(unused)] + // OK as Foo::Bar is explicitly defined for i32 + static OK: ::Bar; + + #[allow(unused)] + // ICE in the improper_ctypes lint + // as Foo::Bar is only default implemented for () + static ICE: <() as Foo>::Bar; +} +pub fn main() {} diff --git a/tests/crashes/90110.rs b/tests/crashes/90110.rs new file mode 100644 index 0000000000000..a27a1f42b7af3 --- /dev/null +++ b/tests/crashes/90110.rs @@ -0,0 +1,57 @@ +//@ known-bug: #90110 + +use std::fs::File; +use std::io::{BufReader, BufRead}; +use std::str::Split; +use std::path::Path; + +pub trait Parser +where dyn Parser: Sized +{ + fn new(split_header: Split<&str>) -> Self where Self: Sized; + fn parse_line(&self, split_line: &Split<&str>) -> D; +} + + +pub struct CsvReader { + parser: Box>, + + reader: BufReader, + buf: String, // Buffer we will read into. Avoids re-allocation on each line. + path: String, // Record this so we can return more informative error messages. + line: usize, // Same motivation for this. +} + +impl CsvReader +where dyn Parser: Sized +{ + fn new(path: &str, make_parser: F) -> CsvReader + where F: Fn(Split) -> dyn Parser { + let file = match File::open(Path::new(path)) { + Err(err) => panic!("Couldn't read {}: {}", path, err), + Ok(file) => file, + }; + + let mut reader = BufReader::new(file); + + let mut buf = String::new(); + + let parser = Box::new(match reader.read_line(&mut buf) { + Err(err) => panic!("Failed to read the header line from {}: {}", path, err), + Ok(_) => { + let split_header = buf.split(','); + make_parser(split_header) + }, + }); + + CsvReader { + parser: parser, + reader, + buf, + path: path.to_string(), + line: 2, + } + } +} + +pub fn main() {} diff --git a/tests/crashes/91985.rs b/tests/crashes/91985.rs new file mode 100644 index 0000000000000..338550430e1f8 --- /dev/null +++ b/tests/crashes/91985.rs @@ -0,0 +1,42 @@ +//@ known-bug: #91985 + +#![feature(generic_associated_types)] + +pub trait Trait1 { + type Associated: Ord; +} + +pub trait Trait2 { + type Associated: Clone; +} + +pub trait GatTrait { + type Gat; +} + +pub struct GatStruct; + +impl GatTrait for GatStruct { + type Gat = Box; +} + +pub struct OuterStruct { + inner: InnerStruct, + t1: T1, +} + +pub struct InnerStruct { + pub gat: G::Gat, +} + +impl OuterStruct +where + T1: Trait1, + T2: Trait2, +{ + pub fn new() -> Self { + todo!() + } +} + +pub fn main() {} diff --git a/tests/crashes/96304.rs b/tests/crashes/96304.rs new file mode 100644 index 0000000000000..637012f45858f --- /dev/null +++ b/tests/crashes/96304.rs @@ -0,0 +1,6 @@ +//@ known-bug: #96304 + +#![feature(asm_sym)] +core::arch::global_asm!("/* {} */", sym<&'static ()>::clone); + +pub fn main() {} diff --git a/tests/crashes/97501.rs b/tests/crashes/97501.rs new file mode 100644 index 0000000000000..51a83d8be169d --- /dev/null +++ b/tests/crashes/97501.rs @@ -0,0 +1,22 @@ +//@ known-bug: #97501 + +#![feature(core_intrinsics)] +use std::intrinsics::wrapping_add; + +#[derive(Clone, Copy)] +struct WrapInt8 { + value: u8 +} + +impl std::ops::Add for WrapInt8 { + type Output = WrapInt8; + fn add(self, other: WrapInt8) -> WrapInt8 { + wrapping_add(self, other) + } +} + +fn main() { + let p = WrapInt8 { value: 123 }; + let q = WrapInt8 { value: 234 }; + println!("{}", (p + q).value); +} diff --git a/tests/crashes/98322.rs b/tests/crashes/98322.rs new file mode 100644 index 0000000000000..57b349160294b --- /dev/null +++ b/tests/crashes/98322.rs @@ -0,0 +1,37 @@ +//@ known-bug: #98322 + +#![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 OtherTrait for T where + T: ConstTrait, + [();T::ASSOC_CONST]: Sized, +{ + fn comm(self) { + todo!() + } +} + +// The struct must be recursive +pub struct RecursiveStruct(Box); + +// This implementation must exist, and it must recurse into its child +impl OtherTrait for RecursiveStruct { + fn comm(self) { + (self.0).comm(); + } +}