about summary refs log tree commit diff
path: root/tests/ui/async-await/async-fn/macro-async-trait-bound-theoretical-regression.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-06 16:56:16 +0000
committerbors <bors@rust-lang.org>2025-07-06 16:56:16 +0000
commitde031bbcb161b0b7fc0eb16f77b02ce9fbdf4c9e (patch)
tree2f67f39a59825f5628e9f511f3c7e1fa6f847ab5 /tests/ui/async-await/async-fn/macro-async-trait-bound-theoretical-regression.rs
parent3c95364c4afc3f15749f5a511d599af086f5456e (diff)
parentbff79a75172b5f8200b4f30264e5fc9d36f8080e (diff)
downloadrust-de031bbcb161b0b7fc0eb16f77b02ce9fbdf4c9e.tar.gz
rust-de031bbcb161b0b7fc0eb16f77b02ce9fbdf4c9e.zip
Auto merge of #143526 - matthiaskrgr:rollup-pm69g5v, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#143252 (Rewrite empty attribute lint for new attribute parser)
 - rust-lang/rust#143492 (Use `object` crate from crates.io to fix windows build error)
 - rust-lang/rust#143514 (Organize macro tests a bit more)
 - rust-lang/rust#143518 (rustc_builtin_macros: Make sure registered attributes stay sorted)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui/async-await/async-fn/macro-async-trait-bound-theoretical-regression.rs')
-rw-r--r--tests/ui/async-await/async-fn/macro-async-trait-bound-theoretical-regression.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/async-await/async-fn/macro-async-trait-bound-theoretical-regression.rs b/tests/ui/async-await/async-fn/macro-async-trait-bound-theoretical-regression.rs
new file mode 100644
index 00000000000..ea67831b68e
--- /dev/null
+++ b/tests/ui/async-await/async-fn/macro-async-trait-bound-theoretical-regression.rs
@@ -0,0 +1,21 @@
+// Demonstrates and records a theoretical regressions / breaking changes caused by the
+// introduction of async trait bounds.
+
+// Setting the edition to 2018 since we don't regress `demo! { dyn async }` in Rust <2018.
+//@ edition:2018
+
+macro_rules! demo {
+    ($ty:ty) => { compile_error!("ty"); };
+    //~^ ERROR ty
+    //~| ERROR ty
+    (impl $c:ident Trait) => {};
+    (dyn $c:ident Trait) => {};
+}
+
+demo! { impl async Trait }
+//~^ ERROR `async` trait bounds are unstable
+
+demo! { dyn async Trait }
+//~^ ERROR `async` trait bounds are unstable
+
+fn main() {}