Skip to content
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

Require stability annotations on fields of tuple variants #30898

Merged
merged 1 commit into from
Jan 15, 2016

Conversation

petrochenkov
Copy link
Contributor

This wasn't done in #29083 because attributes weren't parsed on fields of tuple variant back then.

r? @alexcrichton

@alexcrichton
Copy link
Member

Oh dear those attributes, that's quite the line to give to the compiler! Maybe we should just stop stabilizing enums :P

@bors: r+ 8ea7b88

Thanks!

@petrochenkov
Copy link
Contributor Author

Hopefully it will be better in 2017, after the next snapshot

bors added a commit that referenced this pull request Jan 15, 2016
bors added a commit that referenced this pull request Jan 15, 2016
This wasn't done in #29083 because attributes weren't parsed on fields of tuple variant back then.

r? @alexcrichton
@bors
Copy link
Contributor

bors commented Jan 15, 2016

⌛ Testing commit 8ea7b88 with merge e51661b...

@bors bors merged commit 8ea7b88 into rust-lang:master Jan 15, 2016
@durka
Copy link
Contributor

durka commented Mar 5, 2016

How about fields of struct-like variants?

@petrochenkov
Copy link
Contributor Author

How about fields of struct-like variants?

They required annotations already.

@durka
Copy link
Contributor

durka commented Mar 5, 2016

I figured, but I didn't get any errors when I forgot to include them in
#30884.

On Fri, Mar 4, 2016 at 7:18 PM, Vadim Petrochenkov <notifications@github.com

wrote:

How about fields of struct-like variants?

They required annotations already.


Reply to this email directly or view it on GitHub
#30898 (comment).

@durka
Copy link
Contributor

durka commented Mar 5, 2016

@petrochenkov see durka@003120a (but it compiled before that commit too)

@petrochenkov
Copy link
Contributor Author

@petrochenkov see durka/rust@003120a (but it compiled before that commit too)

It compiled because unstable annotations are automatically inherited from parent items.

@durka
Copy link
Contributor

durka commented Mar 5, 2016

Oh, I see. Makes sense.

On Fri, Mar 4, 2016 at 7:43 PM, Vadim Petrochenkov <notifications@github.com

wrote:

@petrochenkov https://github.com/petrochenkov see durka/rust@003120a
durka@003120a (but it compiled before
that commit too)

It compiled because unstable annotations are automatically inherited from
parent items.


Reply to this email directly or view it on GitHub
#30898 (comment).

@petrochenkov
Copy link
Contributor Author

Unfortunately, annotations on variant fields are not checked properly yet, so the fields in durka@003120a may be insta-stable (AFAIK, it's the first occurrence of named variant fields in the staged API).

@durka
Copy link
Contributor

durka commented Mar 5, 2016

How could you name them without using the unstable variants and the unstable enum itself?

@petrochenkov
Copy link
Contributor Author

You probably couldn't. This is a concern for (hypothetical) stable variants with unstable fields.

@petrochenkov petrochenkov deleted the tvarfstab branch September 21, 2016 19:46
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.

4 participants