Suggest #[derive(Default)] to enums with #[default]#98873
Merged
bors merged 1 commit intorust-lang:masterfrom Jul 5, 2022
Merged
Conversation
Contributor
|
r? @fee1-dead (rust-highfive has picked a reviewer for you, use r? to override) |
fee1-dead
reviewed
Jul 4, 2022
compiler/rustc_resolve/src/macros.rs
Outdated
Comment on lines
776
to
779
Member
There was a problem hiding this comment.
This should ideally be span_suggestion using span_to_snippet on the source map.
Member
There was a problem hiding this comment.
We should also suggest changing the attribute to derive(Default) if they meant it by annotating a struct or enum with #[default], although this does not need to be in this PR. could be a followup.
464e4aa to
eb80407
Compare
fee1-dead
approved these changes
Jul 4, 2022
Member
fee1-dead
left a comment
There was a problem hiding this comment.
LGTM, I will prepare a follow-up.
Member
|
@bors r+ |
Collaborator
|
📌 Commit eb80407 has been approved by |
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Jul 4, 2022
…num-with-default-attribute, r=fee1-dead Suggest `#[derive(Default)]` to enums with `#[default]` fixes rust-lang#95226
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 5, 2022
Rollup of 6 pull requests Successful merges: - rust-lang#97300 (Implement `FusedIterator` for `std::net::[Into]Incoming`) - rust-lang#98761 (more `need_type_info` improvements) - rust-lang#98811 (Interpret: AllocRange Debug impl, and use it more consistently) - rust-lang#98847 (fix interpreter validity check on Box) - rust-lang#98854 (clean up the borrowing in rustc_hir_pretty) - rust-lang#98873 (Suggest `#[derive(Default)]` to enums with `#[default]`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jul 7, 2022
…chaelwoerister suggest adding a derive for #[default] applied to variants cc `@TaKO8Ki` as followup to rust-lang#98873.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jul 7, 2022
…chaelwoerister suggest adding a derive for #[default] applied to variants cc ``@TaKO8Ki`` as followup to rust-lang#98873.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #95226