-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve selection errors for ~const
trait bounds
#92256
Improve selection errors for ~const
trait bounds
#92256
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
r? @oli-obk |
@@ -1,19 +1,19 @@ | |||
error[E0277]: cannot add `NonConstAdd` to `NonConstAdd` | |||
error[E0277]: the trait bound `NonConstAdd: ~const Add` is not satisfied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to keep the previous message and just append in const contexts
. The trait bound message appears again below anyway, so that would seem easier to read by humans
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way to approach this might be adding a flag to the rustc_on_unimplemented directive that allows appending in const contexts
instead of falling back to the generic message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. I was hoping we could patch rustc_on_unimplemented to just append this, but I forgot that the messages are entirely custom and could make the wording weird or nonsensical.
So... a required field for rustc_on_unimplemented with an append snippet or just an entirely new message?
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
2c8dbe0
to
6fe7ae6
Compare
This comment has been minimized.
This comment has been minimized.
6fe7ae6
to
f4522db
Compare
Good enough for now ^^ r=me with the Option::filter nit |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #93173) made this pull request unmergeable. Please resolve the merge conflicts. |
f4522db
to
8b76cad
Compare
That nit is obsolete when you made that comment. Feel free to r- and review it again. @bors r=oli-obk |
📌 Commit 8b76cad has been approved by |
…askrgr Rollup of 7 pull requests Successful merges: - rust-lang#90247 (Improve Duration::try_from_secs_f32/64 accuracy by directly processing exponent and mantissa) - rust-lang#91861 (Replace iterator-based construction of collections by `Into<T>`) - rust-lang#92098 (add OpenBSD platform-support page) - rust-lang#92134 (Add x86_64-pc-windows-msvc linker-plugin-lto instructions) - rust-lang#92256 (Improve selection errors for `~const` trait bounds) - rust-lang#92778 (fs: Use readdir() instead of readdir_r() on Linux and Android) - rust-lang#93338 (Update minifier crate version to 0.0.42) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
No description provided.