@@ -78,6 +78,16 @@ LL | default trait foo = Ord;
78
78
|
79
79
= note: only associated `fn`, `const`, and `type` items can be `default`
80
80
81
+ error: inherent impls cannot be `default`
82
+ --> $DIR/default-on-wrong-item-kind.rs:22:18
83
+ |
84
+ LL | default impl foo {}
85
+ | ------- ^^^ inherent impl for this type
86
+ | |
87
+ | `default` because of this
88
+ |
89
+ = note: only trait implementations may be annotated with `default`
90
+
81
91
error: an item macro invocation cannot be `default`
82
92
--> $DIR/default-on-wrong-item-kind.rs:25:5
83
93
|
@@ -275,6 +285,16 @@ LL | default trait foo = Ord;
275
285
|
276
286
= help: consider moving the trait alias out to a nearby module scope
277
287
288
+ error: inherent impls cannot be `default`
289
+ --> $DIR/default-on-wrong-item-kind.rs:56:18
290
+ |
291
+ LL | default impl foo {}
292
+ | ------- ^^^ inherent impl for this type
293
+ | |
294
+ | `default` because of this
295
+ |
296
+ = note: only trait implementations may be annotated with `default`
297
+
278
298
error: implementation is not supported in `extern` blocks
279
299
--> $DIR/default-on-wrong-item-kind.rs:56:5
280
300
|
@@ -489,6 +509,16 @@ LL | default trait foo = Ord;
489
509
|
490
510
= help: consider moving the trait alias out to a nearby module scope
491
511
512
+ error: inherent impls cannot be `default`
513
+ --> $DIR/default-on-wrong-item-kind.rs:93:18
514
+ |
515
+ LL | default impl foo {}
516
+ | ------- ^^^ inherent impl for this type
517
+ | |
518
+ | `default` because of this
519
+ |
520
+ = note: only trait implementations may be annotated with `default`
521
+
492
522
error: implementation is not supported in `trait`s or `impl`s
493
523
--> $DIR/default-on-wrong-item-kind.rs:93:5
494
524
|
@@ -703,6 +733,16 @@ LL | default trait foo = Ord;
703
733
|
704
734
= help: consider moving the trait alias out to a nearby module scope
705
735
736
+ error: inherent impls cannot be `default`
737
+ --> $DIR/default-on-wrong-item-kind.rs:130:18
738
+ |
739
+ LL | default impl foo {}
740
+ | ------- ^^^ inherent impl for this type
741
+ | |
742
+ | `default` because of this
743
+ |
744
+ = note: only trait implementations may be annotated with `default`
745
+
706
746
error: implementation is not supported in `trait`s or `impl`s
707
747
--> $DIR/default-on-wrong-item-kind.rs:130:5
708
748
|
@@ -759,5 +799,5 @@ LL | default macro_rules! foo {}
759
799
|
760
800
= help: consider moving the macro definition out to a nearby module scope
761
801
762
- error: aborting due to 95 previous errors
802
+ error: aborting due to 99 previous errors
763
803
0 commit comments