rust/tests
Matthias Krüger 980bf1979e
Rollup merge of #106859 - tialaramex:master, r=Nilstrieb
Suggestion for type mismatch when we need a u8 but the programmer wrote a char literal

Today Rust just points out that we have a char and we need a u8, but if I wrote 'A' then I could fix this by just writing b'A' instead. This code should detect the case where we're about to report a type mismatch of this kind, and the programmer wrote a char literal, and the char they wrote is ASCII, so therefore just prefixing b to make a byte literal will do what they meant.

I have definitely written this mistake more than once, it's not difficult to figure out what to do, but the compiler might as well tell us anyway.

I provided a test with two simple examples where the suggestion is appropriate, and one where it is not because the char literal is not ASCII, showing that the suggestion is only triggered in the former cases.

I have contributed only a small typo doc fix before, so this is my first substantive rustc change.
2023-01-15 01:01:36 +01:00
..
assembly Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
codegen Stabilize abi_efiapi feature 2023-01-11 20:42:13 -05:00
codegen-units Move /src/test to /tests 2023-01-11 09:32:08 +00:00
debuginfo Move /src/test to /tests 2023-01-11 09:32:08 +00:00
incremental Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir-opt Fix mir-opt tests for big-endian platforms 2023-01-12 18:05:30 +01:00
pretty Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
run-make Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
run-make-fulldeps Auto merge of #106092 - asquared31415:start_lang_item_checks, r=davidtwco 2023-01-13 07:45:34 +00:00
run-pass-valgrind Move /src/test to /tests 2023-01-11 09:32:08 +00:00
rustdoc Rollup merge of #106828 - notriddle:notriddle/notable-trait-docblock, r=GuillaumeGomez 2023-01-14 18:45:27 +01:00
rustdoc-gui Rollup merge of #106819 - notriddle:notriddle/rm-h1-fqn, r=GuillaumeGomez 2023-01-14 12:04:37 +09:00
rustdoc-js Move /src/test to /tests 2023-01-11 09:32:08 +00:00
rustdoc-js-std Move /src/test to /tests 2023-01-11 09:32:08 +00:00
rustdoc-json Move /src/test to /tests 2023-01-11 09:32:08 +00:00
rustdoc-ui Rollup merge of #106566 - clubby789:contiguous-weird-unicode, r=cjgillot 2023-01-14 13:04:24 +01:00
ui Rollup merge of #106859 - tialaramex:master, r=Nilstrieb 2023-01-15 01:01:36 +01:00
ui-fulldeps Auto merge of #106004 - fee1-dead-contrib:const-closures, r=oli-obk 2023-01-13 05:04:48 +00:00
COMPILER_TESTS.md Move /src/test to /tests 2023-01-11 09:32:08 +00:00