-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)
Milestone
Description
Currently you must use UFCS form to invoke methods. Here is an example by @kinghajj:
#![feature(associated_types)]
trait Foo {
fn foo(&self) -> ();
}
trait Bar {
type F: Foo;
}
struct Wat<B: Bar> {
fs: Vec<B::F>,
}
impl<B: Bar> Wat<B> {
fn wat(&mut self) -> () {
self.fs.pop().unwrap().foo();
}
}
fn main() {
}Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)