Skip to content

Add an example of accessing Union elements (unsafe) - #2027

Merged
marioidival merged 1 commit into
rust-lang:masterfrom
nleonh:master
Sep 15, 2026
Merged

marioidival merged 1 commit into
rust-lang:masterfrom
nleonh:master

Conversation

@nleonh

@nleonh nleonh commented Jul 23, 2026

Copy link
Copy Markdown

Hello,
this is my first contribution to Rust.
I really like the Rust by Example book and want to help improving it.

I added an example of using Unions to the Unsafe Rust chapter.

@rustbot

rustbot commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @marioidival (or someone else) some time within the next two weeks.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @marioidival

@marioidival
marioidival merged commit 2c173cb into rust-lang:master Sep 15, 2026
1 check passed
jhpratt added a commit to jhpratt/rust that referenced this pull request Sep 26, 2026
Update books

## rust-lang/reference

2 commits in e24eecf97b0c9a6dbac67191098204dc8a190aaa..4245282b97496585e73862b966d639cbb553bd6c
2026-09-15 19:41:20 UTC to 2026-09-15 17:32:28 UTC

- Glossary: add entry and examples for `n-zst` (rust-lang/reference#2357)
- Document RISC-V d and f extensions (rust-lang/reference#2355)

## rust-lang/rust-by-example

4 commits in 15308f3e951814ef3475d2b58f48276e6b17b9af..af5ef7024e88587aa3be244422f6365e86c50e85
2026-09-15 14:15:08 UTC to 2026-09-15 14:13:27 UTC

- Better formatting (rust-lang/rust-by-example#2024)
- Add an example of accessing Union elements (unsafe) (rust-lang/rust-by-example#2027)
- Improve linked list example (rust-lang/rust-by-example#2022)
- Fix typo in TRANSLATING.md (rust-lang/rust-by-example#2028)
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Sep 27, 2026
Rollup merge of #163122 - rustbot:docs-update, r=traviscross

Update books

## rust-lang/reference

2 commits in e24eecf97b0c9a6dbac67191098204dc8a190aaa..4245282b97496585e73862b966d639cbb553bd6c
2026-09-15 19:41:20 UTC to 2026-09-15 17:32:28 UTC

- Glossary: add entry and examples for `n-zst` (rust-lang/reference#2357)
- Document RISC-V d and f extensions (rust-lang/reference#2355)

## rust-lang/rust-by-example

4 commits in 15308f3e951814ef3475d2b58f48276e6b17b9af..af5ef7024e88587aa3be244422f6365e86c50e85
2026-09-15 14:15:08 UTC to 2026-09-15 14:13:27 UTC

- Better formatting (rust-lang/rust-by-example#2024)
- Add an example of accessing Union elements (unsafe) (rust-lang/rust-by-example#2027)
- Improve linked list example (rust-lang/rust-by-example#2022)
- Fix typo in TRANSLATING.md (rust-lang/rust-by-example#2028)
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