-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
ch07-03-paths-for-referring-to-an-item-in-the-module-tree: field is never read: seasonal_fruit
note: #[warn(dead_code)]
on by default
#3087
Comments
Listing 7-9 should be prepended with |
Hi, please search existing issues before filing new issues. If you had searched
|
@carols10cents Thank you for all your wonderful work! Would you welcome a single pull request prepending relevant I feel it would improve the readers' experience to prevent all these warnings. Please let me know! |
No, I think it would be distracting. |
The emitted warnings would be better addressed by mdBook—I found a relevant issue. |
Hi, The problem is not with the "dead" code and elimination of it. The problem is that the compiler emits, in my opion, an error error that is not true, due to that the field of the struct is used later in the code. Maybe, this wasn't the right forum to discuss this issue in...? |
Above issue is now reported in: rust-lang/rust#95105 Thank you for your response. |
URL to the section(s) of the book with this problem:
https://doc.rust-lang.org/book/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html
Description of the problem:
Listing 7-9 cannot compile, even though you create a main function calling the function eat_at_restaurant, due to the compiler complaints about the
seasonal_fruit
field of Breakfast:Complete code:
Suggested fix:
The text was updated successfully, but these errors were encountered: