Uh oh!
There was an error while loading. Please reload this page.
fix E0371 description - #156752
Conversation
rustbot
commented
May 19, 2026
r? @oli-obk rustbot has assigned @oli-obk. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| impl Bar for dyn Baz { } // error, `Baz` implements `Bar` by definition | ||
| impl Foo for dyn Baz { } // error, `Baz` implements `Bar` which implements `Foo` | ||
| impl Baz for dyn Baz { } // error, `Baz` (trivially) implements `Baz` | ||
| impl Baz for dyn Bar { } // Note: This is OK |
There was a problem hiding this comment.
If you pull this last one out into a separate block that is not compile_error, we make sure it actually doesn't error.
You can render it nicely by putting # in front of the duplicated definition lines (you'll need to duplicate the trait defs into the new block)
There was a problem hiding this comment.
(Mostly for future reference,) that should catch the (in this case only warnings IIRC) that were emitted as well in the success case I assume?
11bd32a to
173bad7Compare…=oli-obk
fix E0371 description
This changes the `impl`s to be `impl {Trait} for dyn {Trait}` instead of just `impl {Trait} for {Trait}` in the description of E0371.
(While this was not part of "Crafting errors like rustc" workshop at RustWeek by @jdonszelmann and @estebank, I found this while going through all errors Rust emits to pick a favourite)…uwer Rollup of 9 pull requests Successful merges: - #156959 (stdarch subtree update) - #156541 (delegation: remove method call generation) - #156161 (rustc_on_unimplemented: introduce format specifiers) - #156752 (fix E0371 description) - #156761 (tidy: remove duplicate entry and alphabetize OS constants list) - #156872 (Drop skip_move_check_fns query.) - #156899 (fix breakpoint callback registration in `lldb_batchmode`) - #156927 (Reorganize `tests/ui/issues` [1/N]) - #156947 (Update mdbook to 0.5.3)
Uh oh!
There was an error while loading. Please reload this page.
…uwer Rollup of 9 pull requests Successful merges: - rust-lang/rust#156959 (stdarch subtree update) - rust-lang/rust#156541 (delegation: remove method call generation) - rust-lang/rust#156161 (rustc_on_unimplemented: introduce format specifiers) - rust-lang/rust#156752 (fix E0371 description) - rust-lang/rust#156761 (tidy: remove duplicate entry and alphabetize OS constants list) - rust-lang/rust#156872 (Drop skip_move_check_fns query.) - rust-lang/rust#156899 (fix breakpoint callback registration in `lldb_batchmode`) - rust-lang/rust#156927 (Reorganize `tests/ui/issues` [1/N]) - rust-lang/rust#156947 (Update mdbook to 0.5.3)
…uwer Rollup of 9 pull requests Successful merges: - rust-lang/rust#156959 (stdarch subtree update) - rust-lang/rust#156541 (delegation: remove method call generation) - rust-lang/rust#156161 (rustc_on_unimplemented: introduce format specifiers) - rust-lang/rust#156752 (fix E0371 description) - rust-lang/rust#156761 (tidy: remove duplicate entry and alphabetize OS constants list) - rust-lang/rust#156872 (Drop skip_move_check_fns query.) - rust-lang/rust#156899 (fix breakpoint callback registration in `lldb_batchmode`) - rust-lang/rust#156927 (Reorganize `tests/ui/issues` [1/N]) - rust-lang/rust#156947 (Update mdbook to 0.5.3)
This changes the
impls to beimpl {Trait} for dyn {Trait}instead of justimpl {Trait} for {Trait}in the description of E0371.(While this was not part of "Crafting errors like rustc" workshop at RustWeek by @jdonszelmann and @estebank, I found this while going through all errors Rust emits to pick a favourite)