about summary refs log tree commit diff
path: root/tests/ui/async-await/async-fn/macro-async-trait-bound-theoretical-regression.rs
blob: a13a255d536104e4c4098c3186d77de309392bd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Demonstrates and records a theoretical regressions / breaking changes caused by the
// introduction of async trait bounds.

// Setting the edition to >2015 since we didn't regress `demo! { dyn async }` in Rust 2015.
//@ edition:2018

macro_rules! demo {
    ($ty:ty) => { compile_error!("ty"); }; // KEEP THIS RULE FIRST AND AS IS!
    //~^ ERROR ty
    //~| ERROR ty

    // 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! */ };
}

demo! { impl async Trait } //~ ERROR `async` trait bounds are unstable

demo! { dyn async Trait } //~ ERROR `async` trait bounds are unstable

fn main() {}