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