diff --git a/ices/84399.rs b/ices/84399.rs new file mode 100644 index 00000000..c9c7896d --- /dev/null +++ b/ices/84399.rs @@ -0,0 +1,50 @@ +#![crate_type = "lib"] + +use std::marker::PhantomData; +pub trait Allocator { + type Buffer; +} +pub struct DefaultAllocator; +impl Allocator for DefaultAllocator { + type Buffer = (); +} +pub type Owned = >::Buffer; +pub type MatrixMN = Matrix>; +pub type Matrix4 = Matrix; +pub struct Matrix { + pub data: S, + _phantoms: PhantomData, +} +pub fn set_object_transform(matrix: &Matrix4<()>) { + matrix.js_buffer_view(); +} +pub trait Storable { + type Cell; + fn slice_to_items(_buffer: &()) -> &[Self::Cell] { + unimplemented!() + } +} +pub type Cell = ::Cell; +impl Storable for MatrixMN +where + DefaultAllocator: Allocator, +{ + type Cell = (); +} +pub trait JsBufferView { + fn js_buffer_view(&self) -> usize { + unimplemented!() + } +} +impl JsBufferView for [MatrixMN] +where + DefaultAllocator: Allocator, + MatrixMN: Storable, + [Cell>]: JsBufferView, +{ + fn js_buffer_view(&self) -> usize { + as Storable>::slice_to_items(&()).js_buffer_view() + } +} +impl JsBufferView for [()] {} +impl JsBufferView for MatrixMN where DefaultAllocator: Allocator {} diff --git a/ices/84408.rs b/ices/84408.rs new file mode 100644 index 00000000..4ca5292a --- /dev/null +++ b/ices/84408.rs @@ -0,0 +1,31 @@ +#![feature(const_generics, const_evaluatable_checked)] +#![allow(incomplete_features)] + +trait Melon { + fn new(arr: [i32; X]) -> Self; + fn change>(self) -> T; +} + +struct Foo([i32; 5]); +struct Bar([i32; A + B]) +where [(); A + B]: ; + +impl Melon<5> for Foo { + fn new(arr: [i32; 5]) -> Self { + Foo(arr) + } + fn change>(self) -> T { + T::new(self.0) + } +} + +impl Melon<{A + B}> for Bar +where [(); A + B]: , +{ + fn new(arr: [i32; A + B]) -> Self { + Bar(arr) + } + fn change>(self) -> T { + T::new(self.0) + } +} diff --git a/ices/84434.rs b/ices/84434.rs new file mode 100644 index 00000000..5a7dd08c --- /dev/null +++ b/ices/84434.rs @@ -0,0 +1,14 @@ +#![crate_type = "lib"] +use std::path::Path; +struct A { + pub func: fn(check: bool, a: &Path, b: Option<&Path>), +} +const MY_A: A = A { + func: |check, a, b| { + if check { + let _ = (); + } else if let Some(parent) = b.and_then(|p| p.parent()) { + let _ = (); + } + }, +};