Dylan DPC
36125c43da
Rollup merge of #111096 - AngelicosPhosphoros:overflow_checks_issue_91130, r=petrochenkov
...
Add support for `cfg(overflow_checks)`
This PR adds support for detecting if overflow checks are enabled in similar fashion as `debug_assertions` are detected. Possible use-case of this, for example, if we want to use checked integer casts in builds with overflow checks, e.g.
```rust
pub fn cast(val: usize)->u16 {
if cfg!(overflow_checks) {
val.try_into().unwrap()
}
else{
vas as _
}
}
```
Resolves #91130 .
2023-05-13 11:05:33 +05:30
..
2023-03-11 10:53:47 -06:00
2023-05-05 16:30:32 -07:00
2023-04-28 21:00:54 -07:00
2023-05-09 20:49:32 +02:00
2023-05-12 10:24:03 +00:00
2023-05-05 21:44:48 +02:00
2023-05-05 21:44:13 +02:00
2023-05-05 13:06:48 +02:00
2023-05-02 10:45:16 -07:00
2023-05-13 11:05:32 +05:30
2023-05-12 12:04:32 +00:00
2023-05-06 22:32:39 -06:00
2023-05-07 12:38:47 +01:00
2023-05-11 17:43:07 -07:00
2023-05-12 07:11:12 +02:00
2023-05-06 22:32:39 -06:00
2023-05-12 07:11:12 +02:00
2023-05-09 18:20:13 +03:00
2023-05-09 20:49:32 +02:00
2023-05-03 16:42:50 -07:00
2023-05-09 18:20:13 +03:00
2023-05-05 18:40:33 +05:30
2023-05-11 18:06:31 +04:00
2023-04-22 22:03:33 +01:00
2023-03-16 21:50:23 +01:00
2023-05-07 00:12:29 +03:00
2023-05-12 10:24:03 +00:00
2023-05-12 10:25:34 +00:00
2023-05-01 16:15:13 +08:00
2023-05-12 10:26:50 +00:00
2023-05-04 08:09:04 +02:00
2023-04-24 13:53:37 +00:00
2023-05-13 11:05:32 +05:30
2023-05-11 07:05:27 +02:00
2023-05-02 10:32:07 +00:00
2023-05-12 12:04:32 +00:00
2023-05-08 04:50:28 +00:00
2023-05-09 18:43:12 +10:00
2023-04-10 17:24:23 +09:00
2023-05-09 12:33:46 +05:30
2023-05-12 10:24:03 +00:00
2023-05-13 11:05:32 +05:30
2023-05-11 07:05:26 +02:00
2023-05-10 20:54:31 +00:00
2023-05-12 07:11:13 +02:00
2023-05-06 22:32:39 -06:00
2023-05-09 12:33:46 +05:30
2023-04-10 22:02:52 +02:00
2023-05-04 20:49:23 +00:00
2023-04-18 18:56:22 +00:00
2023-05-09 15:16:17 +00:00
2023-04-26 07:46:13 +02:00
2023-05-03 08:44:39 +10:00
2023-05-11 17:43:09 -07:00
2023-05-04 13:52:14 +10:00
2023-05-13 11:05:33 +05:30
2023-05-08 14:23:19 +00:00
2023-05-11 18:06:31 +04:00
2023-05-09 20:04:19 +00:00
2023-05-11 17:43:07 -07:00
2023-05-11 08:43:38 +00:00
2023-05-04 16:59:10 +02:00
2023-04-26 15:19:50 +10:00
2023-05-12 10:26:50 +00:00
2023-05-11 17:43:07 -07:00