Uh oh!
There was an error while loading. Please reload this page.
Make the structural_match error diagnostic for const generics clearer - #70845
Conversation
JohnTitor
commented
Apr 19, 2020
Ping from triage: @estebank could you review this? |
estebank
left a comment
There was a problem hiding this comment.
Sorry, this fell through the cracks of my notifications.
It looks good. Left a nitpick, but r=me if you don't wish to fix it.
There was a problem hiding this comment.
It'd be nice if we could detect that T is a type param and instead of suggesting the annotation we suggested binding it with PartialEq + Eq.
There was a problem hiding this comment.
Ah, actually we ought to emit a specific error for this case: we don't currently accept using generic parameters as the types of const generics yet.
1e51940 to
f8b796bComparevarkor
commented
Apr 20, 2020
@estebank: I've added a specific message for the case you highlighted. |
estebank
commented
Apr 23, 2020
@bors r+ rollup |
bors
commented
Apr 23, 2020
📌 Commit f8b796b has been approved by |
…gnostic, r=estebank Make the `structural_match` error diagnostic for const generics clearer The previous diagnostic caused confusion (rust-lang#70790), so this changes the message to be closer to the message for using non-`structural_match` constants in patterns, explicitly mentioning `#[derive(PartialEq, Eq)]`. Fixesrust-lang#70790. r? @estebank
Rollup of 6 pull requests Successful merges: - rust-lang#70845 (Make the `structural_match` error diagnostic for const generics clearer) - rust-lang#71063 (Document unsafety in core::{option, hash}) - rust-lang#71068 (Stabilize UNICODE_VERSION (feature unicode_version)) - rust-lang#71426 (fix error code in E0751.md) - rust-lang#71459 (Add leading 0x to offset in Debug fmt of Pointer) - rust-lang#71492 (Document unsafety in core::{panicking, alloc::layout, hint, iter::adapters::zip}) Failed merges: r? @ghost
The previous diagnostic caused confusion (#70790), so this changes the message to be closer to the message for using non-
structural_matchconstants in patterns, explicitly mentioning#[derive(PartialEq, Eq)].Fixes#70790.
r? @estebank