Closed
Description
https://doc.rust-lang.org/book/ufcs.html#angle-bracket-form gives an example that uses <Bar as Clone>::clone(self);
, where using Clone::clone(self);
works just as well (tested: rustc 1.6.0-nightly (2e07996 2015-10-29)). And therefore I have no idea why and where I'd need the longer form.
I tested
trait Foo {
fn clone(&self);
}
#[derive(Clone)]
struct Bar;
impl Foo for Bar {
fn clone(&self) {
println!("Making a clone of Bar");
//<Bar as Clone>::clone(self);
Clone::clone(self);
}
}
fn main() {
let b = Bar;
Foo::clone(&b);
}
Metadata
Metadata
Assignees
Labels
No labels