-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Clean up E0741 error explanation #74977
Conversation
@@ -9,12 +10,15 @@ struct A; | |||
struct B<const X: A>; // error! | |||
``` | |||
|
|||
To fix this example, we derive `PartialEq` and `Eq`. | |||
Only structural-match types (that is, types that derive `PartialEq` and `Eq`) | |||
may be used as the types of const generic parameters. |
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.
may be used as the types of const generic parameters. | |
may be used as the type of const generic parameters. |
Is using type
here more correct?
Or maybe we can change the wording a bit.
Const generic parameters must be structural-match types (types that derive
PartialEq
andEq
).
Not sure if must be
is the right wording. Or maybe must be structural matchable (...)
?
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.
I *think* the current wording is correct. It's actually hard to phrase it haha.
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.
Looks weird to me.
@bors: r=pickfire rollup |
📌 Commit 1a6730e has been approved by |
…arth Rollup of 6 pull requests Successful merges: - rust-lang#74977 (Clean up E0741 error explanation) - rust-lang#74981 (Some fixes for `plugin.md` in unstable-book) - rust-lang#74983 (Replace a recursive algorithm with an iterative one and a stack.) - rust-lang#74995 (Update the WASI libc build to LLVM 10.) - rust-lang#74996 (submodules: update cargo from 974eb438d to 2d5c2381e) - rust-lang#75007 (Clean up E0743 explanation) Failed merges: r? @ghost
r? @Dylan-DPC