Skip to content

Instantly share code, notes, and snippets.

@jFransham
Created October 3, 2015 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jFransham/b4a5cd38cb87019bec86 to your computer and use it in GitHub Desktop.
Save jFransham/b4a5cd38cb87019bec86 to your computer and use it in GitHub Desktop.
struct A<T: Test> {
a: T,
}
impl<T: Test> A<T> {
fn new<U: Test>(t: T) -> A<T> {
A { a: t }
}
}
trait Test {
fn t() -> () { }
}
struct A0;
impl Test for A0 { }
fn main() -> () {
let a: A<A0> = A::new(A0);
}
@jFransham
Copy link
Author

fn main() -> () {
    let a: A<A0> = A::new(A0);
    //     ^~~~~~~~~~~~~ complains here
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment