]>
Commit | Line | Data |
---|---|---|
85aaf69f SL |
1 | // Copyright 2014 The Rust Project Developers. See the COPYRIGHT |
2 | // file at the top-level directory of this distribution and at | |
3 | // http://rust-lang.org/COPYRIGHT. | |
4 | // | |
5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
8 | // option. This file may not be copied, modified, or distributed | |
9 | // except according to those terms. | |
10 | // ignore-tidy-linelength | |
11 | ||
12 | #![feature(on_unimplemented)] | |
13 | ||
14 | #![allow(unused)] | |
15 | ||
85aaf69f SL |
16 | #[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}`"] |
17 | trait Foo<Bar, Baz, Quux> | |
85aaf69f SL |
18 | {} |
19 | ||
20 | #[rustc_on_unimplemented="a collection of type `{Self}` cannot be built from an iterator over elements of type `{A}`"] | |
21 | trait MyFromIterator<A> { | |
22 | /// Build a container with elements from an external iterator. | |
23 | fn my_from_iter<T: Iterator<Item=A>>(iterator: T) -> Self; | |
24 | } | |
25 | ||
26 | #[rustc_on_unimplemented] //~ ERROR this attribute must have a value | |
27 | trait BadAnnotation1 | |
85aaf69f SL |
28 | {} |
29 | ||
30 | #[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{C}>`"] | |
31 | //~^ ERROR there is no type parameter C on trait BadAnnotation2 | |
32 | trait BadAnnotation2<A,B> | |
85aaf69f SL |
33 | {} |
34 | ||
35 | #[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{}>`"] | |
36 | //~^ only named substitution parameters are allowed | |
37 | trait BadAnnotation3<A,B> | |
85aaf69f SL |
38 | {} |
39 | ||
40 | pub fn main() { | |
41 | } |