Skip to content

#[derive(Default)] on enums with a #[default] attribute#3107

Merged
pnkfelix merged 1 commit intorust-lang:masterfrom
jhpratt:derive-enum-default
Jul 27, 2021
Merged

#[derive(Default)] on enums with a #[default] attribute#3107
pnkfelix merged 1 commit intorust-lang:masterfrom
jhpratt:derive-enum-default

Conversation

@jhpratt
Copy link
Member

@jhpratt jhpratt commented Apr 12, 2021

Pre-RFC on IRLO

TLDR allow this:

#[derive(Default)]
enum Option<T> {
    #[default]
    None,
    Some(T),
}

Rendered

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-derive Deriving related proposals & ideas A-enum Enum related proposals & ideas disposition-merge This RFC is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this RFC. T-lang Relevant to the language team, which will review and decide on the RFC. T-libs-api Relevant to the library API team, which will review and decide on the RFC. to-announce

Projects

None yet

Development

Successfully merging this pull request may close these issues.