diff options
| author | Ralf Jung <post@ralfj.de> | 2022-07-04 19:24:41 -0400 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-07-05 07:32:38 -0400 |
| commit | 2f6e99666218a2f4c0e6b958d710aac445ff85c0 (patch) | |
| tree | b87ddb0a449a0290d84794824824bb4f9a09027d /compiler/rustc_middle/src/mir | |
| parent | 6f01ff61b3d9d722031fdb39747283c911b97049 (diff) | |
| download | rust-2f6e99666218a2f4c0e6b958d710aac445ff85c0.tar.gz rust-2f6e99666218a2f4c0e6b958d710aac445ff85c0.zip | |
always check overflow in CheckedBinOp in CTFE
Diffstat (limited to 'compiler/rustc_middle/src/mir')
| -rw-r--r-- | compiler/rustc_middle/src/mir/syntax.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/mir/syntax.rs b/compiler/rustc_middle/src/mir/syntax.rs index 3b7eb820df8..2f4c0ae96b3 100644 --- a/compiler/rustc_middle/src/mir/syntax.rs +++ b/compiler/rustc_middle/src/mir/syntax.rs @@ -993,8 +993,9 @@ pub enum Rvalue<'tcx> { /// Same as `BinaryOp`, but yields `(T, bool)` with a `bool` indicating an error condition. /// - /// When overflow checking is disabled, the error condition is false. Otherwise, the error - /// condition is determined as described below. + /// When overflow checking is disabled and we are generating run-time code, the error condition + /// is false. Otherwise, and always during CTFE, the error condition is determined as described + /// below. /// /// For addition, subtraction, and multiplication on integers the error condition is set when /// the infinite precision result would be unequal to the actual result. |
