rust/tests
Trevor Gross 86721a4c90
Rollup merge of #124941 - Skgland:stabilize-const-int-from-str, r=dtolnay
Stabilize const `{integer}::from_str_radix` i.e. `const_int_from_str`

This PR stabilizes the feature `const_int_from_str`.

- ACP Issue: rust-lang/libs-team#74
- Implementation PR: rust-lang/rust#99322
- Part of Tracking Issue: rust-lang/rust#59133

API Change Diff:

```diff
impl {integer} {
- pub       fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>;
+ pub const fn from_str_radix(src: &str, radix: u32) -> Result<Self, ParseIntError>;
}

impl ParseIntError {
- pub       fn kind(&self) -> &IntErrorKind;
+ pub const fn kind(&self) -> &IntErrorKind;
}
```
This makes it easier to parse integers at compile-time, e.g.
the example from the Tracking Issue:

```rust
env!("SOMETHING").parse::<usize>().unwrap()
```

could now be achived  with

```rust
match usize::from_str_radix(env!("SOMETHING"), 10) {
  Ok(val) => val,
  Err(err) => panic!("Invalid value for SOMETHING environment variable."),
}
```

rather than having to depend on a library that implements or manually implement the parsing at compile-time.

---

Checklist based on [Libs Stabilization Guide - When there's const involved](https://std-dev-guide.rust-lang.org/development/stabilization.html#when-theres-const-involved)

I am treating this as a [partial stabilization](https://std-dev-guide.rust-lang.org/development/stabilization.html#partial-stabilizations) as it shares a tracking issue (and is rather small), so directly opening the partial stabilization PR for the subset (feature `const_int_from_str`) being stabilized.

- [x] ping Constant Evaluation WG
- [x] no unsafe involved
- [x] no `#[allow_internal_unstable]`
- [ ] usage of `intrinsic::const_eval_select` rust-lang/rust#124625 in `from_str_radix_assert` to change the error message between compile-time and run-time
- [ ] [rust-labg/libs-api FCP](https://github.com/rust-lang/rust/pull/124941#issuecomment-2207021921)
2024-07-26 19:03:04 -04:00
..
assembly Auto merge of #128165 - saethlin:optimize-clone-shims, r=compiler-errors 2024-07-26 13:13:04 +00:00
auxiliary
codegen Let InstCombine remove Clone shims inside Clone shims 2024-07-25 15:14:42 -04:00
codegen-units Avoid MIR bloat in inlining 2024-07-01 05:17:13 -07:00
coverage Bless coverage. 2024-07-13 12:02:12 +00:00
coverage-run-rustdoc coverage: Extract hole spans from HIR instead of MIR 2024-07-08 21:22:56 +10:00
crashes Rollup merge of #128173 - compiler-errors:misused-intrinsics, r=oli-obk 2024-07-25 16:48:22 +02:00
debuginfo Add Natvis visualiser and debuginfo tests for f16 2024-07-09 03:47:50 +01:00
incremental Auto merge of #126409 - pacak:incr-uplorry, r=michaelwoerister 2024-06-20 09:06:16 +00:00
mir-opt Auto merge of #127722 - BoxyUwU:new_adt_const_params_limitations, r=compiler-errors 2024-07-21 05:36:21 +00:00
pretty Mark format! with must_use hint 2024-07-06 14:24:20 +02:00
run-make rewrite export-executable-symbols to rmake 2024-07-26 10:17:39 -04:00
run-pass-valgrind
rustdoc Auto merge of #120812 - compiler-errors:impl-sorting, r=lcnr 2024-07-21 22:43:47 +00:00
rustdoc-gui Add regression test for items list size (#128023) 2024-07-22 11:33:03 +02:00
rustdoc-js
rustdoc-js-std
rustdoc-json Update all rustdoc-json/ tests to use the new style 2024-07-19 16:54:42 +02:00
rustdoc-ui Rollup merge of #128111 - estebank:no-question, r=fmease 2024-07-25 04:43:20 +02:00
ui Rollup merge of #124941 - Skgland:stabilize-const-int-from-str, r=dtolnay 2024-07-26 19:03:04 -04:00
ui-fulldeps Auto merge of #126963 - runtimeverification:smir_serde_derive, r=celinval 2024-07-25 20:27:51 +00:00
COMPILER_TESTS.md