Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
878a796
Add missing safety descriptions to Arc's 'from_raw','increment_strong…
DiuDiu777 Dec 19, 2024
c89f0dc
Adjust syntax
c410-f3r Dec 22, 2024
be23697
Detect overflow when the literal is larger than i128::MAX
s-cerevisiae Jan 8, 2025
330be17
Detect overflow when the literal is negative
s-cerevisiae Jan 8, 2025
1517a41
Add test cases and test for `HELP`
s-cerevisiae Jan 8, 2025
c04e65d
Extract integer conversion into a function
s-cerevisiae Jan 8, 2025
c994637
Only treat plain literal patterns as short
oli-obk Jan 8, 2025
4a85755
Minor simplification
s-cerevisiae Jan 11, 2025
f52724c
Add comment on case to mark the original issue
s-cerevisiae Jan 12, 2025
74e2e8b
Suggest the smallest fitting type instead
s-cerevisiae Jan 12, 2025
c4a5e12
Clarify note in `std::sync::LazyLock` example
Jan 15, 2025
bbeb5e3
Update `compiler-builtins` to 0.1.144
tgross35 Jan 16, 2025
48e671e
fix typo in library/alloc/src/sync.rs
DiuDiu777 Jan 16, 2025
79a1658
Rollup merge of #133720 - c410-f3r:cfg-match-foo-bar-baz, r=joshtriplett
matthiaskrgr Jan 16, 2025
663b35b
Rollup merge of #134496 - DiuDiu777:fix-doc, r=ibraheemdev
matthiaskrgr Jan 16, 2025
13c3759
Rollup merge of #135249 - s-cerevisiae:fix-overflowing-literals-help,…
matthiaskrgr Jan 16, 2025
2760486
Rollup merge of #135251 - oli-obk:push-lmpyvvyrtplk, r=ytmimi
matthiaskrgr Jan 16, 2025
b898de4
Rollup merge of #135556 - AeonSolstice:patch-1, r=tgross35
matthiaskrgr Jan 16, 2025
4dcc3f3
Rollup merge of #135560 - tgross35:update-builtins, r=tgross35
matthiaskrgr Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor simplification
Apply eta-reduction on map to simplify code and make the style more
consistent
  • Loading branch information
s-cerevisiae committed Jan 11, 2025
commit 4a857557563a06a70c1c7533cf4220f42b37198a
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/types/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fn get_type_suggestion(t: Ty<'_>, val: u128, negative: bool) -> Option<&'static
ty::Uint(ty::UintTy::Usize) | ty::Int(ty::IntTy::Isize) => None,
ty::Uint(_) => Some(Integer::fit_unsigned(val).uint_ty_str()),
ty::Int(int) => {
let signed = literal_to_i128(val, negative).map(|v| Integer::fit_signed(v));
let signed = literal_to_i128(val, negative).map(Integer::fit_signed);
if negative {
signed.map(Integer::int_ty_str)
} else {
Expand Down
Loading