Skip to content
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

Merged
merged 2 commits into from
Jan 27, 2022

Conversation

fee1-dead
Copy link
Member

No description provided.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 24, 2021
@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 24, 2021
@fee1-dead
Copy link
Member Author

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
Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Contributor

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?

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Jan 15, 2022

Good enough for now ^^

r=me with the Option::filter nit

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jan 22, 2022

☔ The latest upstream changes (presumably #93173) made this pull request unmergeable. Please resolve the merge conflicts.

@fee1-dead fee1-dead added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 22, 2022
@fee1-dead
Copy link
Member Author

That nit is obsolete when you made that comment.

Feel free to r- and review it again.

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Jan 26, 2022

📌 Commit 8b76cad has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 26, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 26, 2022
…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
@bors bors merged commit e2b2bfe into rust-lang:master Jan 27, 2022
@rustbot rustbot added this to the 1.60.0 milestone Jan 27, 2022
@fee1-dead fee1-dead deleted the improve-selection-err branch January 27, 2022 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants