rust/src/test
bors 67776ba3da auto merge of #15325 : pcwalton/rust/trait-impl-bound-mismatch, r=pnkfelix
with the corresponding trait parameter bounds.

This is a version of the patch in PR #12611 by Florian Hahn, modified to
address Niko's feedback.

It does not address the issue of duplicate type parameter bounds, nor
does it address the issue of implementation-defined methods that contain
*fewer* bounds than the trait, because Niko's review indicates that this
should not be necessary (and indeed I believe it is not). A test has
been added to ensure that this works.

This will break code like:

    trait Foo {
        fn bar<T:Baz>();
    }

    impl Foo for Boo {
        fn bar<T:Baz + Quux>() { ... }
        //             ^~~~ ERROR
    }

This will be rejected because the implementation requires *more* bounds
than the trait. It can be fixed by either adding the missing bound to
the trait:

    trait Foo {
        fn bar<T:Baz + Quux>();
        //             ^~~~
    }

    impl Foo for Boo {
        fn bar<T:Baz + Quux>() { ... }  // OK
    }

Or by removing the bound from the impl:

    trait Foo {
        fn bar<T:Baz>();
    }

    impl Foo for Boo {
        fn bar<T:Baz>() { ... }  // OK
        //       ^ remove Quux
    }

This patch imports the relevant tests from #2687, as well as the test
case in #5886, which is fixed as well by this patch.

Closes #2687.
Closes #5886.

[breaking-change]

r? @pnkfelix
2014-07-03 01:06:38 +00:00
..
auxiliary librustc: Remove the fallback to int for integers and f64 for 2014-06-29 11:47:58 -07:00
bench auto merge of #15085 : brson/rust/stridx, r=alexcrichton 2014-07-02 05:41:30 +00:00
codegen Add pub to all the codegen tests 2013-10-10 06:00:51 -07:00
compile-fail auto merge of #15325 : pcwalton/rust/trait-impl-bound-mismatch, r=pnkfelix 2014-07-03 01:06:38 +00:00
compile-fail-fulldeps Test lint plugins 2014-06-24 11:36:28 -07:00
debuginfo librustc: Remove the fallback to int for integers and f64 for 2014-06-29 11:47:58 -07:00
pretty librustc: Remove the fallback to int for integers and f64 for 2014-06-29 11:47:58 -07:00
run-fail rustc: Remove &str indexing from the language. 2014-07-01 19:12:29 -07:00
run-make librustc: Remove the fallback to int for integers and f64 for 2014-06-29 11:47:58 -07:00
run-pass auto merge of #15325 : pcwalton/rust/trait-impl-bound-mismatch, r=pnkfelix 2014-07-03 01:06:38 +00:00
run-pass-fulldeps librustc: Remove the fallback to int from typechecking. 2014-06-24 17:18:48 -07:00