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