diff options
Diffstat (limited to 'tests/ui/rfcs/rfc-2632-const-trait-impl/mbe-const-trait-bound-theoretical-regression.rs')
| -rw-r--r-- | tests/ui/rfcs/rfc-2632-const-trait-impl/mbe-const-trait-bound-theoretical-regression.rs | 20 | 
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/mbe-const-trait-bound-theoretical-regression.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/mbe-const-trait-bound-theoretical-regression.rs new file mode 100644 index 00000000000..9105cb6b043 --- /dev/null +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/mbe-const-trait-bound-theoretical-regression.rs @@ -0,0 +1,20 @@ +// Demonstrates and records a theoretical regressions / breaking changes caused by the +// introduction of const trait bounds. + +// Setting the edition to 2018 since we don't regress `demo! { dyn const }` in Rust <2018. +// edition:2018 + +macro_rules! demo { + ($ty:ty) => { compile_error!("ty"); }; + (impl $c:ident) => {}; + (dyn $c:ident) => {}; +} + +demo! { impl const } +//~^ ERROR expected identifier, found `<eof>` + +demo! { dyn const } +//~^ ERROR const trait impls are experimental +//~| ERROR expected identifier, found `<eof>` + +fn main() {}  | 
