]>
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 | ||
ff7c6d11 | 26 | #[rustc_on_unimplemented] //~ ERROR `#[rustc_on_unimplemented]` requires a value |
85aaf69f | 27 | trait BadAnnotation1 |
85aaf69f SL |
28 | {} |
29 | ||
30 | #[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{C}>`"] | |
94b46f34 | 31 | //~^ ERROR there is no parameter C on trait BadAnnotation2 |
85aaf69f | 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 | ||
ea8adc8c | 40 | #[rustc_on_unimplemented(lorem="")] |
ff7c6d11 | 41 | //~^ this attribute must have a valid |
ea8adc8c XL |
42 | trait BadAnnotation4 {} |
43 | ||
44 | #[rustc_on_unimplemented(lorem(ipsum(dolor)))] | |
ff7c6d11 | 45 | //~^ this attribute must have a valid |
ea8adc8c XL |
46 | trait BadAnnotation5 {} |
47 | ||
48 | #[rustc_on_unimplemented(message="x", message="y")] | |
ff7c6d11 | 49 | //~^ this attribute must have a valid |
ea8adc8c XL |
50 | trait BadAnnotation6 {} |
51 | ||
52 | #[rustc_on_unimplemented(message="x", on(desugared, message="y"))] | |
ff7c6d11 | 53 | //~^ this attribute must have a valid |
ea8adc8c XL |
54 | trait BadAnnotation7 {} |
55 | ||
56 | #[rustc_on_unimplemented(on(), message="y")] | |
ff7c6d11 | 57 | //~^ empty `on`-clause |
ea8adc8c XL |
58 | trait BadAnnotation8 {} |
59 | ||
60 | #[rustc_on_unimplemented(on="x", message="y")] | |
ff7c6d11 | 61 | //~^ this attribute must have a valid |
ea8adc8c XL |
62 | trait BadAnnotation9 {} |
63 | ||
64 | #[rustc_on_unimplemented(on(x="y"), message="y")] | |
65 | trait BadAnnotation10 {} | |
66 | ||
67 | #[rustc_on_unimplemented(on(desugared, on(desugared, message="x")), message="y")] | |
ff7c6d11 | 68 | //~^ this attribute must have a valid |
ea8adc8c XL |
69 | trait BadAnnotation11 {} |
70 | ||
85aaf69f SL |
71 | pub fn main() { |
72 | } |