You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The trait object Foo+Copy implements the trait Copy #32963
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};fnsize_of_copy<T:Copy+?Sized>() -> usize{ mem::size_of::<T>()}fnmain(){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).
Activity
arielb1 commentedon Apr 14, 2016
cc @nikomatsakis
nikomatsakis commentedon Apr 15, 2016
@arielb1 indeed.
nikomatsakis commentedon Apr 15, 2016
triage: P-high
arielb1 commentedon Apr 16, 2016
I am working on a fix.
Rollup merge of rust-lang#33039 - bluss:trait-obj-error, r=arielb1
nikomatsakis commentedon Apr 18, 2016
@arielb1 saw your ping on IRC; it seems like we simply should consider
Copyto be object-unsafe. Ideally with a warning period.nikomatsakis commentedon Apr 18, 2016
(I've always thought that unsized types would be move-only.)
Auto merge of #33138 - arielb1:sized-shortcut, r=nikomatsakis