Skip to content

Conversation

@timClicks
Copy link
Contributor

@timClicks timClicks commented Dec 18, 2025

This PR adds material relating to Unsafe Rust. It has a special emphasis on safety preconditions and providing opportunities for practicing code review, both collaboratively and individually.

The content is designed to be highly adaptable by instructors, but also includes extensive guidance.

I have not removed the "beta" warning from the content.

@timClicks timClicks marked this pull request as ready for review December 19, 2025 11:25
1. _Creating_ APIs with safety considerations

unsafe functions: `unsafe fn get_unchecked(&self) { ... }` unsafe traits:
`unsafe trait Send {}`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please fix formatting.

- “There’s also a deeper way to think of traits: as sets of requirements. This
emphasizes the shared semantics of the implementing types.

“Can anyone explain what the `Send` and `Sync` traits are? They have
Copy link
Collaborator

Choose a reason for hiding this comment

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

Incomplete sentence

traits are able to be shared by reference.
- There are many rules to follow to ensure that it’s safe to share data across
thread boundaries. Those rules cannot be checked by the compiler, and
therefore .
Copy link
Collaborator

Choose a reason for hiding this comment

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

Incomplete sentence


“Now let’s define our own unsafe trait.”

Transition to next slide.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Transition to next slide.

Unnecessary instruction.

“whole” from Ancient Greek, rather than the contemporary English sense of
“tiny particle”.

“Now let’s define our own unsafe trait.”
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
“Now let’s define our own unsafe trait.”

Repetition from the next slide.

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.

2 participants