Skip to content

No unions3 #318

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 5 commits into from
Jul 19, 2019
Merged

No unions3 #318

merged 5 commits into from
Jul 19, 2019

Conversation

burrbull
Copy link
Member

Implemented by @wez this PR replace untagged unions with functions for access to alternate registers.

Closes #230, #218, stm32-rs/stm32-rs#149 .

cc @therealprof

wez added 5 commits July 19, 2019 15:12
This removes any observable side effect of the --nightly switch by
removing the use of unions and the untagged_unions feature gate.
Unions are replaced with accessor functions that return the appropriate
register block reference.

Here's a playground link that shows that the pointer calculation looks
reasonable:

https://play.integer32.com/?version=stable&mode=debug&edition=2018&gist=cd56444abc03e6781e526bbddc7082bc

This commit is a breaking change.

This is based on this WIP PR branch:
rust-embedded#256

It implements the easiest standalone portion of this issue:
rust-embedded#218

and also makes accessing the unions "safe" too, which is requested here:
rust-embedded#230
@burrbull burrbull requested a review from a team as a code owner July 19, 2019 12:34
@rust-highfive
Copy link

r? @Emilgardis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-tools labels Jul 19, 2019
@burrbull
Copy link
Member Author

изображение
изображение

@therealprof
Copy link
Contributor

bors try

bors bot added a commit that referenced this pull request Jul 19, 2019
@bors
Copy link
Contributor

bors bot commented Jul 19, 2019

try

Build succeeded

Copy link
Contributor

@therealprof therealprof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@therealprof
Copy link
Contributor

bors r+

bors bot added a commit that referenced this pull request Jul 19, 2019
318: No unions3 r=therealprof a=burrbull

Implemented by @wez this PR replace untagged unions with functions for access to alternate registers.

Closes #230, #218, stm32-rs/stm32-rs#149 .

cc @therealprof

Co-authored-by: Wez Furlong <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jul 19, 2019

Build succeeded

@bors bors bot merged commit 36a661e into rust-embedded:master Jul 19, 2019
@burrbull burrbull mentioned this pull request Jul 19, 2019
@burrbull burrbull deleted the no_unions3 branch July 20, 2019 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

save access to unions
5 participants