Skip to content

Put attributes and enum variants on different lines #2396

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

Merged
merged 1 commit into from
Jan 28, 2018

Conversation

topecongiro
Copy link
Contributor

Closes #2389.

We still put attributes and fields on the same line inside variant (I hope I am using the right terminologies). For example,

// Attributes on the same line
pub enum Entry<'a, K: 'a, V: 'a> {
    Vacant(#[stable(feature = "rust1", since = "1.0.0")] VacantEntry<'a, K, V>),
    Occupied(#[stable(feature = "rust1", since = "1.0.0")] OccupiedEntry<'a, K, V>),
}

// Attributes on the different line
pub enum Entry<'a, K: 'a, V: 'a> {
    #[stable(feature = "rust1", since = "1.0.0")]
    Vacant(VacantEntry<'a, K, V>),
    #[stable(feature = "rust1", since = "1.0.0")]
    Occupied(OccupiedEntry<'a, K, V>),
}

@RReverser
Copy link
Contributor

Hmm these two examples have different semantics. Did you mean to put attributes outside of enum body in the first case?

@nrc nrc merged commit 4633786 into rust-lang:master Jan 28, 2018
@nrc
Copy link
Member

nrc commented Jan 28, 2018

Thanks!

@topecongiro topecongiro deleted the issue-2389 branch February 4, 2018 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants