Closed
Description
select
considers the trait object type Foo+Copy
to implement the trait Copy
, and therefore its supertraits Clone
and Sized
. This is totally bogus, as the trait object type is not Sized.
For example:
use std::{fmt, mem};
fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }
fn main() {
println!("{}", size_of_copy::<fmt::Debug+Copy>());
}
This obviously should not compile, but it does (and prints 16, because of the size_of
unsized hack).