-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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).
Metadata
Metadata
Assignees
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.