-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Unsafe Deep Dive - Beta Content (WIP) #2999
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
base: main
Are you sure you want to change the base?
Conversation
| 1. _Creating_ APIs with safety considerations | ||
|
|
||
| unsafe functions: `unsafe fn get_unchecked(&self) { ... }` unsafe traits: | ||
| `unsafe trait Send {}` |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 . |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.” |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| “Now let’s define our own unsafe trait.” |
Repetition from the next slide.
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.