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

05_ticket_v2/05_nullability code example does not compile/run #132

Open
michaelkebe opened this issue Aug 15, 2024 · 2 comments
Open

05_ticket_v2/05_nullability code example does not compile/run #132

michaelkebe opened this issue Aug 15, 2024 · 2 comments

Comments

@michaelkebe
Copy link

michaelkebe commented Aug 15, 2024

Chapter 5.5 Nullability

https://rust-exercises.com/100-exercises/05_ticket_v2/05_nullability#tuples

Clicking the run icon produces:

   Compiling playground v0.0.1 (/playground)
error[E0425]: cannot find value `second` in this scope
 --> src/main.rs:3:12
  |
3 | assert_eq!(second.0, -42);
  |            ^^^^^^ not found in this scope

error[E0425]: cannot find value `second` in this scope
 --> src/main.rs:4:12
  |
4 | assert_eq!(second.1, 3);
  |            ^^^^^^ not found in this scope

error[E0425]: cannot find value `second` in this scope
 --> src/main.rs:5:12
  |
5 | assert_eq!(second.2, 8);
  |            ^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `playground` (bin "playground") due to 3 previous errors

The code right above is not included in the snippet. It should be included, but hidden.

@hdoordt
Copy link
Member

hdoordt commented Aug 16, 2024

This is an issue with multiple other code snippets, too. For now, I'd suggest disabling running the incomplete code examples. In a later stage, I agree it would be good to include and hide the setup code in the examples

@LukeMathWalker
Copy link
Collaborator

It was never the intention for code samples to be runnable as-is, that's a side-effect of using mdbook and failing to annotate all snippets 😅 I agree the solution is to mark them as no-run.

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

No branches or pull requests

3 participants