rust/tests
bors 1e656d8d6d Auto merge of #10970 - y21:read_line_without_trim, r=giraffate
new lint: `read_line_without_trim`

This adds a new lint that checks for calls to `Stdin::read_line` with a reference to a string that is then attempted to parse into an integer type without first trimming it, which is always going to fail at runtime.
This is something that I've seen happen a lot to beginners, because it's easy to run into when following the example of chapter 2 in the book where it shows how to program a guessing game.
It would be nice if we could point beginners to clippy and tell them "let's see what clippy has to say" and have clippy explain to them why it fails 👀

I think this lint can later be "generalized" to work not just for `Stdin` but also any `BufRead` (which seems to be where the guarantee about the trailing newline comes from) and also, matching/comparing it to a string slice that doesn't end in a newline character (e.g. `input == "foo"` is always going to fail)

changelog: new lint: [`read_line_without_trim`]
2023-07-05 00:13:59 +00:00
..
test_utils
ui Auto merge of #10970 - y21:read_line_without_trim, r=giraffate 2023-07-05 00:13:59 +00:00
ui-cargo Update tests 2023-06-26 14:13:07 +00:00
ui-internal Merge remote-tracking branch 'upstream/master' into rustup 2023-06-30 16:09:06 +02:00
ui-toml change category and refactor 2023-06-27 05:16:40 -05:00
workspace_test
check-fmt.rs
clippy.toml
compile-test.rs Auto merge of #10920 - blyxyas:speedtest, r=llogiq 2023-07-02 15:48:50 +00:00
dogfood.rs
headers.rs
integration.rs
lint_message_convention.rs new lint needless_raw_string + refactor a bit 2023-06-27 05:12:00 -05:00
missing-test-files.rs Port clippy away from compiletest to ui_test 2023-06-26 14:13:07 +00:00
versioncheck.rs
workspace.rs