1- error: inherent impls cannot be const 
2-   --> $DIR/macro-const-trait-bound-theoretical-regression.rs:10:40 
1+ error: ty 
2+   --> $DIR/macro-const-trait-bound-theoretical-regression.rs:11:19 
33   |
4- LL |     (impl $c:ident Trait ) => { impl $c Trait {} }; 
5-    |                                         ^^^^^ inherent impl for this type 
4+ LL |     ($ty:ty ) => { compile_error!("ty"); }; // KEEP THIS RULE FIRST AND AS IS! 
5+    |                   ^^^^^^^^^^^^^^^^^^^^ 
66...
77LL | demo! { impl const Trait }
8-    | --------------------------
9-    | |            |
10-    | |            const because of this
11-    | in this macro invocation
8+    | -------------------------- in this macro invocation
129   |
13-    = note: only trait implementations may be annotated with `const`
1410   = note: this error originates in the macro `demo` (in Nightly builds, run with -Z macro-backtrace for more info)
1511
16- error: macro expansion ignores keyword `dyn` and any tokens following 
17-   --> $DIR/macro-const-trait-bound-theoretical-regression.rs:14:31 
12+ error: ty 
13+   --> $DIR/macro-const-trait-bound-theoretical-regression.rs:11:19 
1814   |
19- LL |     (dyn $c:ident Trait ) => { dyn $c Trait {} }; 
20-    |                                ^^^
15+ LL |     ($ty:ty ) => { compile_error!("ty"); }; // KEEP THIS RULE FIRST AND AS IS! 
16+    |                   ^^^^^^^^^^^^^^^^^ ^^^
2117...
2218LL | demo! { dyn const Trait }
23-    | ------------------------- caused by the  macro expansion here 
19+    | ------------------------- in this  macro invocation 
2420   |
25-    = note: the usage of `demo!` is likely invalid in item context
21+    = note: this error originates in the macro `demo` (in Nightly builds, run with -Z macro-backtrace for more info)
22+ 
23+ error: ty
24+   --> $DIR/macro-const-trait-bound-theoretical-regression.rs:11:19
25+    |
26+ LL |     ($ty:ty) => { compile_error!("ty"); }; // KEEP THIS RULE FIRST AND AS IS!
27+    |                   ^^^^^^^^^^^^^^^^^^^^
28+ ...
29+ LL | demo! { impl [const] Trait }
30+    | ---------------------------- in this macro invocation
31+    |
32+    = note: this error originates in the macro `demo` (in Nightly builds, run with -Z macro-backtrace for more info)
33+ 
34+ error: ty
35+   --> $DIR/macro-const-trait-bound-theoretical-regression.rs:11:19
36+    |
37+ LL |     ($ty:ty) => { compile_error!("ty"); }; // KEEP THIS RULE FIRST AND AS IS!
38+    |                   ^^^^^^^^^^^^^^^^^^^^
39+ ...
40+ LL | demo! { dyn [const] Trait }
41+    | --------------------------- in this macro invocation
42+    |
43+    = note: this error originates in the macro `demo` (in Nightly builds, run with -Z macro-backtrace for more info)
2644
2745error[E0658]: const trait impls are experimental
28-   --> $DIR/macro-const-trait-bound-theoretical-regression.rs:17 :14
46+   --> $DIR/macro-const-trait-bound-theoretical-regression.rs:26 :14
2947   |
3048LL | demo! { impl const Trait }
3149   |              ^^^^^
@@ -34,24 +52,36 @@ LL | demo! { impl const Trait }
3452   = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
3553   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3654
37- warning:  trait objects without an explicit `dyn`  are deprecated 
38-   --> $DIR/macro-const-trait-bound-theoretical-regression.rs:10:40 
55+ error[E0658]: const  trait impls  are experimental 
56+   --> $DIR/macro-const-trait-bound-theoretical-regression.rs:27:13 
3957   |
40- LL |     (impl $c:ident Trait) => { impl $c Trait {} };
41-    |                                        ^^^^^
42- ...
43- LL | demo! { impl const Trait }
44-    | -------------------------- in this macro invocation
58+ LL | demo! { dyn const Trait }
59+    |             ^^^^^
4560   |
46-    = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
47-    = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html>
48-    = note: `#[warn(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default
49-    = note: this warning originates in the macro `demo` (in Nightly builds, run with -Z macro-backtrace for more info)
50- help: you might have intended to implement this trait for a given type
61+    = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
62+    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
63+    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
64+ 
65+ error[E0658]: const trait impls are experimental
66+   --> $DIR/macro-const-trait-bound-theoretical-regression.rs:29:14
67+    |
68+ LL | demo! { impl [const] Trait }
69+    |              ^^^^^^^
70+    |
71+    = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
72+    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
73+    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
74+ 
75+ error[E0658]: const trait impls are experimental
76+   --> $DIR/macro-const-trait-bound-theoretical-regression.rs:30:13
5177   |
52- LL |     (impl $c:ident Trait) => { impl $c Trait for /* Type */ {} };
53-    |                                              ++++++++++++++
78+ LL | demo! { dyn [const] Trait }
79+    |             ^^^^^^^
80+    |
81+    = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
82+    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
83+    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
5484
55- error: aborting due to 3  previous errors; 1 warning emitted 
85+ error: aborting due to 8  previous errors
5686
5787For more information about this error, try `rustc --explain E0658`.
0 commit comments