-
Notifications
You must be signed in to change notification settings - Fork 14k
Open
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.T-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
The following fails to compile:
trait Trait {}
fn takes_ref(t: &Trait) {}
fn takes_box(t: Box<Trait>) {
takes_ref(&t)
}
fn main() { }with
<anon>:5:15: 5:17 error: the trait `Trait` is not implemented for the type `Box<Trait>` [E0277]
<anon>:5 takes_ref(&t)
^~
despite the Deref implementation here.
I believe this should work based on the RFC.
jonas-schievink, yuttie, kornelski, Aetf and Zolyn
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.T-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.