rust/tests/ui/traits/object/macro-matcher.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
317 B
Rust
Raw Normal View History

2017-03-16 16:47:32 -05:00
// `ty` matcher accepts trait object types
macro_rules! m {
($t: ty) => ( let _: $t; )
}
fn main() {
2019-05-28 13:46:13 -05:00
m!(dyn Copy + Send + 'static);
//~^ ERROR the trait `Copy` cannot be made into an object
2019-05-28 13:46:13 -05:00
m!(dyn 'static + Send);
m!(dyn 'static +); //~ ERROR at least one trait is required for an object type
2017-03-16 16:47:32 -05:00
}