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

First code example regarding stdin emits a warning #99654

Closed
dexygen opened this issue Jul 23, 2022 · 1 comment · Fixed by #99657
Closed

First code example regarding stdin emits a warning #99654

dexygen opened this issue Jul 23, 2022 · 1 comment · Fixed by #99657
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@dexygen
Copy link

dexygen commented Jul 23, 2022

What needs to be fixed?

The very first code example on the page in the docs regarding stdin is confusing because, using Rust 1.6.2, when executing the line with the comment // We get Stdin here appended, the warning "variable does not need to be mutable" is emitted.

Page(s) Affected

https://doc.rust-lang.org/std/io/struct.Stdin.html

Suggested Improvement

If the need for a mutable became unnecessasry as of a particular Rust version, perhaps add a comment to that effect

@dexygen dexygen added A-Content C-bug Category: This is a bug. labels Jul 23, 2022
@Manishearth Manishearth transferred this issue from rust-lang/www.rust-lang.org Jul 24, 2022
@ChrisDenton ChrisDenton added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 24, 2022
@ghost
Copy link

ghost commented Jul 24, 2022

If the need for a mutable became unnecessasry as of a particular Rust version, perhaps add a comment to that effect

Yes, this mut was definitely required in an older version... I don't know which one, if it matters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants