about summary refs log tree commit diff
path: root/library/core/src/ops/arith.rs
AgeCommit message (Collapse)AuthorLines
2025-09-06clean up some old const trait impl syntaxNathaniel McCallum-22/+11
2025-08-10Constify remaining operatorsltdk-19/+50
2025-08-10Let forward_ref_* macros accept multiple attributes, and require attributes ↵ltdk-13/+26
explicitly
2025-07-11fix const_ops tracking issueRalf Jung-12/+12
2025-07-04Make Rem const for floatsKurt Heiritz (pseudo)-1/+1
2025-06-25Add Sub, Mul, Div, Rem as const_traitsKurt Heiritz (pseudo)-5/+19
2025-05-17Switch library rustc_unimplemented to use `Self` and `This`mejrs-2/+2
2025-02-27require trait impls to have matching const stabilities as the traitsDeadbeef-0/+1
2025-01-14Enforce syntactical stability of const traits in HIRMichael Goulet-0/+1
2025-01-08update cfg(bootstrap)Pietro Albini-13/+1
2024-11-21constify `Add`Deadbeef-0/+13
2024-06-21Remove `feature(effects)` from the standard libraryDeadbeef-3/+1
2024-04-10Add basic library support for `f16` and `f128`Trevor Gross-11/+11
Implement basic operation traits that get lowered to intrinsics. This includes codegen tests for implemented operations.
2024-02-04Reconstify `Add`Deadbeef-1/+3
2024-01-05Replace some usage of `#[rustc_on_unimplemented]` withGeorg Semmler-8/+8
`#[diagnostic::on_unimplemented]` This commit replaces those `#[rustc_on_unimplemented]` attributes with their equivalent `#[diagnostic::on_unimplemented]` where this is supported (So no filter or any extended option)
2023-11-24add track_caller for arith opsbohan-0/+10
2023-05-07enable `rust_2018_idioms` for doctestsozkanonur-1/+1
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-04-16rm const traits in libcoreDeadbeef-50/+26
2023-02-04Fix #103320, add explanatory message for [#must_use]yukang-6/+12
2023-01-30Improved wording of error messages of missing remainder implementationsMatthias Kaak-2/+2
2023-01-27Fixed confusement between mod and remainderMatthias Kaak-2/+2
2022-09-16append_const_msg for std traitsDeadbeef-31/+8
2022-09-16Add more `const_trait` annotationsDeadbeef-0/+9
2022-09-16Add `const_trait`sDeadbeef-0/+2
2022-01-26Add a minimal working `append_const_msg` argumentDeadbeef-5/+30
2021-10-22Added const versions of common numeric operationsAlexApps99-26/+39
# Conflicts: # library/core/src/lib.rs
2021-03-01Document panicking cases for integer remainderJim Turner-3/+10
The panic when the right operand is `0` is expected, but the overflow-related panic (which occurs only for `MIN % -1`) is somewhat surprising for two reasons: a return value of `0` would be reasonable in this case, and, for most arithmetic operations, overflow results in panic only when `debug_assertions` is enabled. As a result, it's helpful to document this behavior.
2021-03-01Document panicking cases for integer divisionJim Turner-3/+10
The panic on division by zero is expected, but the panic on overflow is somewhat surprising (since most arithmetic operations panic on overflow only when `debug_assertions` is enabled). As a result, it's helpful to document this behavior.
2020-10-17Improve wording of "cannot multiply" type errorCamelid-2/+2
For example, if you had this code: fn foo(x: i32, y: f32) -> f32 { x * y } You would get this error: error[E0277]: cannot multiply `f32` to `i32` --> src/lib.rs:2:7 | 2 | x * y | ^ no implementation for `i32 * f32` | = help: the trait `Mul<f32>` is not implemented for `i32` However, that's not usually how people describe multiplication. People usually describe multiplication like how the division error words it: error[E0277]: cannot divide `i32` by `f32` --> src/lib.rs:2:7 | 2 | x / y | ^ no implementation for `i32 / f32` | = help: the trait `Div<f32>` is not implemented for `i32` So that's what this change does. It changes this: error[E0277]: cannot multiply `f32` to `i32` --> src/lib.rs:2:7 | 2 | x * y | ^ no implementation for `i32 * f32` | = help: the trait `Mul<f32>` is not implemented for `i32` To this: error[E0277]: cannot multiply `i32` by `f32` --> src/lib.rs:2:7 | 2 | x * y | ^ no implementation for `i32 * f32` | = help: the trait `Mul<f32>` is not implemented for `i32`
2020-09-23Use Self more in core in doc when possibleAlexis Bourget-11/+11
2020-09-10Add missing examples on core traits' methodGuillaume Gomez-0/+77
2020-07-27mv std libs to library/mark-0/+900