rust/tests
Matthias Krüger 8f9ccc5d1b
Rollup merge of #135249 - s-cerevisiae:fix-overflowing-literals-help, r=chenyukang
Fix overflows in the implementation of `overflowing_literals` lint's help

This PR fixes two overflow problems that cause the `overflowing_literals` lint to behave incorrectly in some edge cases.

1. When an integer literal is between `i128::MAX` and `u128::MAX`, an overflowing `as` cast can cause the suggested type to be overly small. It's fixed by using checked type conversion and returning `u128` when it's the only choice. (Fixes #135248)
2. When an integer literal is `i128::MIN` but is of a smaller type, an overflowing negation cause the compiler to panic in debug build. Fixed by checking the number size beforehand and `wrapping_neg`. (Fixes #131849)

Edit: extracted the type conversion part into a standalone function to separate the concern of overflowing.
2025-01-16 17:00:46 +01:00
..
assembly llvm: Allow sized-word rather than ymmword in tests 2025-01-13 20:50:57 +00:00
auxiliary tests/assembly/asm: Remove uses of rustc_attrs and lang_items features by using minicore 2024-12-18 02:59:07 +09:00
codegen Auto merge of #135204 - RalfJung:win64-zst, r=SparrowLii 2025-01-13 13:05:53 +00:00
codegen-units Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for structs 2025-01-15 04:20:25 +00:00
coverage add comment to test 2025-01-09 13:55:50 +01:00
coverage-run-rustdoc coverage: Restrict empty-span expansion to only cover { and } 2024-11-08 20:43:08 +11:00
crashes fix ICE with references to infinite structs in consts 2025-01-14 01:22:04 +01:00
debuginfo Revert "Remove the Arc rt::init allocation for thread info" 2025-01-14 13:37:25 +01:00
incremental add test for issue 135514 2025-01-15 08:26:23 +00:00
mir-opt Less unsafe in dangling/without_provenance 2025-01-15 22:17:57 -08:00
pretty Update tests to use new proc-macro header 2024-11-27 07:18:25 -08:00
run-make Auto merge of #135458 - jieyouxu:migrate-extern-fn-reachable, r=lqd 2025-01-16 02:31:22 +00:00
rustdoc Rollup merge of #134216 - GuillaumeGomez:jump-to-def-pats, r=fmease 2025-01-14 19:25:04 +01:00
rustdoc-gui Add GUI test for #135499 2025-01-15 16:31:20 +01:00
rustdoc-js Rollup merge of #134277 - notriddle:notriddle/inline-into, r=GuillaumeGomez 2024-12-16 20:00:20 +01:00
rustdoc-js-std for purely return-type based searches, deprioritize clone-like functions 2025-01-13 12:22:34 -06:00
rustdoc-json Rollup merge of #134880 - as1100k-forks:fix-rustdoc-json-path-name, r=aDotInTheVoid 2025-01-14 19:25:05 +01:00
rustdoc-ui Remove some empty expected files to fix blessing 2025-01-12 12:49:24 +02:00
ui Rollup merge of #135249 - s-cerevisiae:fix-overflowing-literals-help, r=chenyukang 2025-01-16 17:00:46 +01:00
ui-fulldeps Rollup merge of #134834 - dtolnay:unnamedcall, r=compiler-errors 2024-12-27 18:43:05 -08:00
COMPILER_TESTS.md