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

Confusing speaker notes for 9.1 - Shared references #2656

Closed
ColinPitrat opened this issue Feb 25, 2025 · 2 comments · Fixed by #2659
Closed

Confusing speaker notes for 9.1 - Shared references #2656

ColinPitrat opened this issue Feb 25, 2025 · 2 comments · Fixed by #2659

Comments

@ColinPitrat
Copy link
Contributor

ColinPitrat commented Feb 25, 2025

There's a confusing bullet point in Day 1 afternoon, 9.1 Shared references:

Rust is tracking the lifetimes of all references to ensure they live long enough.
Dangling references cannot occur in safe Rust.
x_axis would return a reference to point, but point will be deallocated when the function returns, so this will not compile.

The code in the slide doesn't contain x_axis nor point.

@ColinPitrat
Copy link
Contributor Author

ColinPitrat commented Feb 25, 2025

Progressing to 9.2 it seems this point probably belongs there! There's still no x_axis but there's a point and a x_coord.

@djmitche
Copy link
Collaborator

Good spot! I think that was just a leftover from when this slide was more complicated. We get to dangling references in later days. I'll make a PR shortly.

djmitche added a commit that referenced this issue Feb 26, 2025
Dangling references are discussed later in the "Borrowing" segment.

Fixes #2656
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 a pull request may close this issue.

2 participants