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

Describe #[repr(align(x))] semantics on enums #619

Merged
merged 1 commit into from
Jun 17, 2019
Merged

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Jun 10, 2019

@ehuss
Copy link
Contributor

ehuss commented Jun 13, 2019

Can you explain why this is described with a level of indirection by wrapping in a newtype struct?

Why can't it just say something like "align may be applied on an enum to specify the alignment of the enum's values"?

@Centril
Copy link
Contributor Author

Centril commented Jun 13, 2019

Can you explain why this is described with a level of indirection by wrapping in a newtype struct?

This gives an unambiguous definition for the semantics... I guess I can "unwrap" the indirection and describe it in more native terms.

Why can't it just say something like "align may be applied on an enum to specify the alignment of the enum's values"?

That doesn't seem like a specification...

@ehuss
Copy link
Contributor

ehuss commented Jun 17, 2019

Ok, makes sense. I was just feeling like it was trying to say something more, or that enums are somehow special. But I guess any other way would end up being wordy and duplicating. If you want to "unwrap" it to make it more direct, go ahead. Otherwise, click the merge button if you're happy. It can always be updated later if someone feels compelled to.

@Centril
Copy link
Contributor Author

Centril commented Jun 17, 2019

Thanks. :)

I'll merge for now cause I don't want to devote too much time to it and it feels serviceable in the interim but I do think it should/can be improved.

@Centril Centril merged commit 95cb608 into master Jun 17, 2019
@Centril Centril deleted the repr-align-enum-docs branch June 17, 2019 18:17
bors added a commit to rust-lang/rust that referenced this pull request Jun 21, 2019
Update mdbook

This updates to mdbook 0.3.0. This release includes the following changes:
https://github.com/rust-lang-nursery/mdBook/blob/master/CHANGELOG.md#mdbook-030
One of the biggest changes is the update to pulldown-cmark.

This also bumps the submodules (except the nomicon which has some broken links).

## reference

6 commits in f8ae436..08ae27a
2019-05-31 14:59:12 +0200 to 2019-06-17 11:24:13 -0700
- Document `underscore_const_names` (rust-lang/reference#620)
- Describe `#[repr(align(x))]` semantics on `enum`s (rust-lang/reference#619)
- Fix typo in lazy_static example. (rust-lang/reference#622)
- Rust 2015 supports Kleene ? macro operator (rust-lang/reference#617)
- Bitrig support has been removed (rust-lang/reference#615)
- Fix spell error in attributes/diagnostics.md (rust-lang/reference#614)

## book

8 commits in 62a8c6f25fbd981c80a046f3b04be9684749af3b..9aacfcc4c5b102c8cda195932addefd32fe955d2
2019-05-28 15:48:23 -0400 to 2019-06-16 21:27:26 -0400
- Add a script to help diff rendered books
- Update mdbook links (rust-lang/book#1989)
- Update for markdown changes. (rust-lang/book#1984)
- Make all mentions of crates.io consistent
- Propagate corrections made in layout
- Add link to Swedish translation
- Propagate small edits made in layout
- Remove snapshot files that have been checked with layout

## rust-by-example

3 commits in d8eec1dd65470b9a68e80ac1cba8fad0daac4916..b27472962986e85c94f4183b1a6d2207660d3ed6
2019-06-08 10:15:22 -0300 to 2019-06-17 15:52:07 -0300
- Update `macro_rules!` formatting. (rust-lang/rust-by-example#1205)
- Add Cargo comment to the `try!` macro example. (rust-lang/rust-by-example#1203)
- Fix typo (rust-lang/rust-by-example#1204)

## rustc-guide

15 commits in 3ac9cfc9c9ab2e366feebf18718112737f572352..f55e97c145cf37fd664db2e0e2f2d05df328bf4f
2019-06-02 19:36:58 -0500 to 2019-06-15 17:29:12 -0500
- fix typos
- Update for TyCtxt<'a, 'gcx, 'tcx> -> TyCtxt<'tcx>.
- fix ci failures, typos, broken links
- Some edits to address review comments
- Notes about closure de-sugaring
- add note about rebuilding llvm
- Changes to config.toml require a clean
- Fix a few typos in type inference chapter
- Add triagebot (rust-lang/rustc-dev-guide#337)
- Update how-to-build-and-run.md
- Update how-to-build-and-run.md
- Update compiler-debugging.md
- use debug instead of debuginfo-level
- Replaced tabs with spaces
- correct indentation

## edition-guide

4 commits in 581c6cccfaf995394ea9dcac362dc8e731c18558..f8072acde5ce29c7570d7986180bbded2d22e287
2019-05-06 12:47:44 -0700 to 2019-06-14 23:27:05 +0200
- Small fixes (rust-lang/edition-guide#179)
- Cleanup unused NLL link (rust-lang/edition-guide#167)
- Part 2: Rust 2015 now supports ? macro rep op (rust-lang/edition-guide#163)
- Part 1: Rust 2015 now supports ? macro rep op (rust-lang/edition-guide#162)

## embedded-book

1 commits in f0c75b75f9c18537b78f5d17c1015247e9a49c86..ef27b517dcd0b990c888c0d7caeff52a5a115619
2019-06-03 10:49:02 +0000 to 2019-06-18 22:59:47 +0000
- Fix link for more strict commonmark interpretation.  (rust-embedded/book#194)
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.

Tracking issue for #[repr(align(x))] on enums
2 participants