rust/tests/ui/trait-bounds/suggest-maybe-sized-bound.rs
OdenShirataki 4ac90e286b Fix suggestion span for ?Sized
when param type has default
and type in trait is generic.
2024-02-12 11:33:11 +09:00

21 lines
487 B
Rust

// issue: 120878
fn main() {
struct StructA<A, B = A> {
_marker: std::marker::PhantomData<fn() -> (A, B)>,
}
struct StructB {
a: StructA<isize, [u8]>,
//~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time [E0277]
}
trait Trait {
type P<X>;
}
impl Trait for () {
type P<X> = [u8];
//~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time [E0277]
}
}