@@ -78,6 +78,16 @@ LL | default trait foo = Ord;
7878 |
7979 = note: only associated `fn`, `const`, and `type` items can be `default`
8080
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+
8191error: an item macro invocation cannot be `default`
8292 --> $DIR/default-on-wrong-item-kind.rs:25:5
8393 |
@@ -275,6 +285,16 @@ LL | default trait foo = Ord;
275285 |
276286 = help: consider moving the trait alias out to a nearby module scope
277287
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+
278298error: implementation is not supported in `extern` blocks
279299 --> $DIR/default-on-wrong-item-kind.rs:56:5
280300 |
@@ -489,6 +509,16 @@ LL | default trait foo = Ord;
489509 |
490510 = help: consider moving the trait alias out to a nearby module scope
491511
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+
492522error: implementation is not supported in `trait`s or `impl`s
493523 --> $DIR/default-on-wrong-item-kind.rs:93:5
494524 |
@@ -703,6 +733,16 @@ LL | default trait foo = Ord;
703733 |
704734 = help: consider moving the trait alias out to a nearby module scope
705735
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+
706746error: implementation is not supported in `trait`s or `impl`s
707747 --> $DIR/default-on-wrong-item-kind.rs:130:5
708748 |
@@ -759,5 +799,5 @@ LL | default macro_rules! foo {}
759799 |
760800 = help: consider moving the macro definition out to a nearby module scope
761801
762- error: aborting due to 95 previous errors
802+ error: aborting due to 99 previous errors
763803
0 commit comments