2024-02-20 16:09:03 +00:00
|
|
|
// Demonstrates and records a theoretical regressions / breaking changes caused by the
|
|
|
|
|
// introduction of async trait bounds.
|
|
|
|
|
|
2025-09-10 21:40:24 +02:00
|
|
|
// Setting the edition to >2015 since we didn't regress `demo! { dyn async }` in Rust 2015.
|
2024-02-20 16:09:03 +00:00
|
|
|
//@ edition:2018
|
|
|
|
|
|
|
|
|
|
macro_rules! demo {
|
2025-09-10 21:40:24 +02:00
|
|
|
($ty:ty) => { compile_error!("ty"); }; // KEEP THIS RULE FIRST AND AS IS!
|
2024-02-20 16:09:03 +00:00
|
|
|
//~^ ERROR ty
|
|
|
|
|
//~| ERROR ty
|
2025-09-10 21:40:24 +02:00
|
|
|
|
|
|
|
|
// DON'T MODIFY THE MATCHERS BELOW UNLESS THE ASYNC TRAIT MODIFIER SYNTAX CHANGES!
|
|
|
|
|
|
|
|
|
|
(impl $c:ident Trait) => { /* KEEP THIS EMPTY! */ };
|
|
|
|
|
(dyn $c:ident Trait) => { /* KEEP THIS EMPTY! */ };
|
2024-02-20 16:09:03 +00:00
|
|
|
}
|
|
|
|
|
|
2025-09-10 21:40:24 +02:00
|
|
|
demo! { impl async Trait } //~ ERROR `async` trait bounds are unstable
|
2024-02-20 16:09:03 +00:00
|
|
|
|
2025-09-10 21:40:24 +02:00
|
|
|
demo! { dyn async Trait } //~ ERROR `async` trait bounds are unstable
|
2024-02-20 16:09:03 +00:00
|
|
|
|
|
|
|
|
fn main() {}
|