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

Binoculars show even when they have no effect on the visualization #71

Open
diegorodriguezv opened this issue Apr 11, 2023 · 2 comments
Labels

Comments

@diegorodriguezv
Copy link

  • [ x ] I have checked the latest main branch to see if this has already been fixed
  • [ x ] I have searched existing issues and pull requests for duplicates

URL to the section(s) of the book with this problem:
https://rust-book.cs.brown.edu/ch04-01-what-is-ownership.html

Description of the problem:

The binocular button on some examples do not work. If you click the button it will change color but nothing happens. I assumed the button was a decorative item until I reached this part:

Note: you may wonder how we are executing this Rust program that doesn't compile. We use special tools to simulate Rust...

I followed the link and found that aquascope has the same binoculars button but it works correctly displaying the types of the values.
Then I went back and checked that the button doesn't work on some examples but it works in others, including the examples in the already answered first quiz.

Examples where the binoculars button doesn't work:

I'll write the first line of the paragraph above the example with the error:

  • Here's a program like the one you saw in Section 3.3 that ...
  • When an expression reads a variable, the variable's value ...
  • However, copying data can take up a lot of ...

By looking at the ch04-01-what-is-ownership.md code, I can't really tell what is the problem.

Suggested fix:

The binoculars button should work in these examples the same as in the other examples and the aquascope site or they should be removed.

@willcrichton
Copy link
Collaborator

Thanks for the report. The binoculars have no effect for traces that have no expandable data types, like boxes. I'll make a note to hide the button when it's not applicable to a particular trace.

@diegorodriguezv
Copy link
Author

Thanks @willcrichton.
I feel partially embarrassed now that I finished the chapter and understand a little more the rust memory paradigm. I also understand now that the button shows the type and contents for a pointer but not variables. But anyway this behavior is something that can appear confusing for a beginner.

@willcrichton willcrichton transferred this issue from cognitive-engineering-lab/rust-book Apr 24, 2023
@willcrichton willcrichton changed the title Some binoculars buttons don't work Binoculars show even when they have no effect on the visualization Apr 24, 2023
@willcrichton willcrichton added the good first issue Good for newcomers label May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants