librustc: Allow trait bounds on structures and enumerations, and check

them during kind checking.

This implements RFC #11.

Closes #15759.
This commit is contained in:
Patrick Walton
2014-08-11 17:12:01 -07:00
parent cb9c1e0e70
commit 086a5ca7d2
26 changed files with 622 additions and 43 deletions

View File

@@ -15,4 +15,5 @@
trait Foo {}
fn take_foo<F:Foo>(f: F) {}
fn take_object(f: Box<Foo>) { take_foo(f); } //~ ERROR failed to find an implementation of trait
//~^ ERROR failed to find an implementation
fn main() {}