Rollup merge of #29028 - Seeker14491:patch-1, r=Manishearth
Having this code section hidden is misleading because it makes it look like implementing Circle for Foo automatically makes Foo implement Shape.
This commit is contained in:
commit
570756face
1 changed files with 5 additions and 5 deletions
|
|
@ -1435,11 +1435,11 @@ struct Foo;
|
|||
|
||||
trait Shape { fn area(&self) -> f64; }
|
||||
trait Circle : Shape { fn radius(&self) -> f64; }
|
||||
# impl Shape for Foo {
|
||||
# fn area(&self) -> f64 {
|
||||
# 0.0
|
||||
# }
|
||||
# }
|
||||
impl Shape for Foo {
|
||||
fn area(&self) -> f64 {
|
||||
0.0
|
||||
}
|
||||
}
|
||||
impl Circle for Foo {
|
||||
fn radius(&self) -> f64 {
|
||||
println!("calling area: {}", self.area());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue