mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
38 lines
605 B
Rust
38 lines
605 B
Rust
![]() |
//@ known-bug: #138707
|
||
|
//@edition:2024
|
||
|
//@compile-flags: --crate-type lib
|
||
|
use core::marker::PhantomData;
|
||
|
|
||
|
struct LeftReflector<S> {
|
||
|
_phantom: PhantomData<S>,
|
||
|
}
|
||
|
|
||
|
struct DefaultAllocator {}
|
||
|
|
||
|
trait Allocator<R> {
|
||
|
type Buffer;
|
||
|
}
|
||
|
|
||
|
struct U2 {}
|
||
|
|
||
|
impl Allocator<U2> for DefaultAllocator {
|
||
|
type Buffer = [u8; 2];
|
||
|
}
|
||
|
|
||
|
impl<R> From<R> for LeftReflector<<DefaultAllocator as Allocator<R>>::Buffer>
|
||
|
where
|
||
|
DefaultAllocator: Allocator<R>,
|
||
|
{
|
||
|
fn from(_: R) -> Self {
|
||
|
todo!()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn ice<D>(a: U2)
|
||
|
where
|
||
|
DefaultAllocator: Allocator<D>,
|
||
|
{
|
||
|
// ICE
|
||
|
let _ = LeftReflector::from(a);
|
||
|
}
|