Skip to content

Conversation

steveklabnik
Copy link
Contributor

Fixes #16439

@@ -1535,7 +1535,7 @@ Likewise, supertrait methods may also be called on trait objects.
# impl Shape for int { fn area(&self) -> f64 { 0.0 } }
# impl Circle for int { fn radius(&self) -> f64 { 0.0 } }
# let mycircle = 0;
let mycircle: Circle = ~mycircle as ~Circle;
let mycircle = box mycircle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is trying to demonstrate something about trait objects? ("likewise supertrait methods may also be called on trait objects")

Maybe it could be let mycircle = box mycircle as Box<Circle>;?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. You are correct that the cast is needed to do the right thing here.

@bors bors closed this Aug 14, 2014
@bors bors merged commit 5eb4e1a into rust-lang:master Aug 14, 2014
@steveklabnik steveklabnik deleted the fix_boxes_in_manual branch October 25, 2017 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

manual, still a reference with ~ operator
4 participants