-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deref coercion not working for Box<Trait>
#22194
Comments
Bump! |
Triage: today, this complains about a lack of |
I also encountered this bug while trying to iterate over boxed trait objects and posted to the user forum. |
This came up again today. Based on my reading, the unsize cooersion is only applying to the first level when it should pass through Deref cooersion as well. |
Triage: no change |
This version seems to compile trait Trait {}
fn takes_ref(t: &dyn Trait) {}
fn takes_box(t: Box<dyn Trait>) {
takes_ref(&*t)
} |
@nielsle the problem is that |
The following fails to compile:
with
despite the
Deref
implementation here.I believe this should work based on the RFC.
The text was updated successfully, but these errors were encountered: