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:10:19
3
3
|
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
+ | ^^^^^^^^^^^^^^^^^^^^
6
6
...
7
7
LL | demo! { impl const Trait }
8
- | --------------------------
9
- | | |
10
- | | const because of this
11
- | in this macro invocation
8
+ | -------------------------- in this macro invocation
12
9
|
13
- = note: only trait implementations may be annotated with `const`
14
10
= note: this error originates in the macro `demo` (in Nightly builds, run with -Z macro-backtrace for more info)
15
11
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:10:19
18
14
|
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
+ | ^^^^^^^^^^^^^^^^^ ^^^
21
17
...
22
18
LL | demo! { dyn const Trait }
23
- | ------------------------- caused by the macro expansion here
19
+ | ------------------------- in this macro invocation
24
20
|
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:10: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:10: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)
26
44
27
45
error[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:23 :14
29
47
|
30
48
LL | demo! { impl const Trait }
31
49
| ^^^^^
@@ -34,24 +52,36 @@ LL | demo! { impl const Trait }
34
52
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
35
53
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
36
54
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:24:13
39
57
|
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
+ | ^^^^^
45
60
|
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:26: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:27:13
51
77
|
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
54
84
55
- error: aborting due to 3 previous errors; 1 warning emitted
85
+ error: aborting due to 8 previous errors
56
86
57
87
For more information about this error, try `rustc --explain E0658`.
0 commit comments