2015-01-10 22:19:39 -06:00
|
|
|
// ignore-tidy-linelength
|
|
|
|
|
2019-10-25 00:19:07 -05:00
|
|
|
#![feature(rustc_attrs)]
|
2015-01-11 09:23:24 -06:00
|
|
|
|
|
|
|
#![allow(unused)]
|
2015-01-10 22:19:39 -06:00
|
|
|
|
2015-01-11 06:58:06 -06:00
|
|
|
#[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}`"]
|
2015-02-12 09:29:52 -06:00
|
|
|
trait Foo<Bar, Baz, Quux>
|
|
|
|
{}
|
2015-01-10 22:19:39 -06:00
|
|
|
|
2015-01-11 06:58:06 -06:00
|
|
|
#[rustc_on_unimplemented="a collection of type `{Self}` cannot be built from an iterator over elements of type `{A}`"]
|
2015-01-10 22:19:39 -06:00
|
|
|
trait MyFromIterator<A> {
|
2019-02-09 15:23:30 -06:00
|
|
|
/// Builds a container with elements from an external iterator.
|
2015-01-10 22:19:39 -06:00
|
|
|
fn my_from_iter<T: Iterator<Item=A>>(iterator: T) -> Self;
|
|
|
|
}
|
|
|
|
|
2019-01-01 17:21:05 -06:00
|
|
|
#[rustc_on_unimplemented]
|
2019-05-21 19:47:23 -05:00
|
|
|
//~^ ERROR malformed `rustc_on_unimplemented` attribute
|
2015-02-12 09:29:52 -06:00
|
|
|
trait BadAnnotation1
|
|
|
|
{}
|
2015-01-10 22:19:39 -06:00
|
|
|
|
2015-01-11 06:58:06 -06:00
|
|
|
#[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{C}>`"]
|
2018-08-12 14:26:38 -05:00
|
|
|
//~^ ERROR there is no parameter `C` on trait `BadAnnotation2`
|
2015-02-12 09:29:52 -06:00
|
|
|
trait BadAnnotation2<A,B>
|
|
|
|
{}
|
2015-01-10 22:19:39 -06:00
|
|
|
|
2015-01-11 14:05:16 -06:00
|
|
|
#[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{}>`"]
|
|
|
|
//~^ only named substitution parameters are allowed
|
2015-02-12 09:29:52 -06:00
|
|
|
trait BadAnnotation3<A,B>
|
|
|
|
{}
|
2015-01-10 22:19:39 -06:00
|
|
|
|
2017-08-30 15:40:43 -05:00
|
|
|
#[rustc_on_unimplemented(lorem="")]
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ this attribute must have a valid
|
2017-08-30 15:40:43 -05:00
|
|
|
trait BadAnnotation4 {}
|
|
|
|
|
|
|
|
#[rustc_on_unimplemented(lorem(ipsum(dolor)))]
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ this attribute must have a valid
|
2017-08-30 15:40:43 -05:00
|
|
|
trait BadAnnotation5 {}
|
|
|
|
|
|
|
|
#[rustc_on_unimplemented(message="x", message="y")]
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ this attribute must have a valid
|
2017-08-30 15:40:43 -05:00
|
|
|
trait BadAnnotation6 {}
|
|
|
|
|
|
|
|
#[rustc_on_unimplemented(message="x", on(desugared, message="y"))]
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ this attribute must have a valid
|
2017-08-30 15:40:43 -05:00
|
|
|
trait BadAnnotation7 {}
|
|
|
|
|
|
|
|
#[rustc_on_unimplemented(on(), message="y")]
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ empty `on`-clause
|
2017-08-30 15:40:43 -05:00
|
|
|
trait BadAnnotation8 {}
|
|
|
|
|
|
|
|
#[rustc_on_unimplemented(on="x", message="y")]
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ this attribute must have a valid
|
2017-08-30 15:40:43 -05:00
|
|
|
trait BadAnnotation9 {}
|
|
|
|
|
|
|
|
#[rustc_on_unimplemented(on(x="y"), message="y")]
|
|
|
|
trait BadAnnotation10 {}
|
|
|
|
|
|
|
|
#[rustc_on_unimplemented(on(desugared, on(desugared, message="x")), message="y")]
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ this attribute must have a valid
|
2017-08-30 15:40:43 -05:00
|
|
|
trait BadAnnotation11 {}
|
|
|
|
|
2015-01-10 22:19:39 -06:00
|
|
|
pub fn main() {
|
|
|
|
}
|