rust/library/core/tests
Yuki Okushi 9f2ad0a061
Rollup merge of #90009 - woppopo:const_from_more, r=dtolnay
Make more `From` impls `const` (libcore)

Adding `const` to `From` implementations in the core. `rustc_const_unstable` attribute is not added to unstable implementations.

Tracking issue: #88674

<details>
<summary>Done</summary><div>

- `T` from `T`
- `T` from `!`
- `Option<T>` from `T`
- `Option<&T>` from `&Option<T>`
- `Option<&mut T>` from `&mut Option<T>`
- `Cell<T>` from `T`
- `RefCell<T>` from `T`
- `UnsafeCell<T>` from `T`
- `OnceCell<T>` from `T`
- `Poll<T>` from `T`
- `u32` from `char`
- `u64` from `char`
- `u128` from `char`
- `char` from `u8`
- `AtomicBool` from `bool`
- `AtomicPtr<T>` from `*mut T`
- `AtomicI(bits)` from `i(bits)`
- `AtomicU(bits)` from `u(bits)`
- `i(bits)` from `NonZeroI(bits)`
- `u(bits)` from `NonZeroU(bits)`
- `NonNull<T>` from `Unique<T>`
- `NonNull<T>` from `&T`
- `NonNull<T>` from `&mut T`
- `Unique<T>` from `&mut T`
- `Infallible` from `!`
- `TryIntError` from `!`
- `TryIntError` from `Infallible`
- `TryFromSliceError` from `Infallible`
- `FromResidual for Option<T>`
</div></details>

<details>
<summary>Remaining</summary><dev>

- `NonZero` from `NonZero`
These can't be made const at this time because these use Into::into.
https://github.com/rust-lang/rust/blob/master/library/core/src/convert/num.rs#L393

- `std`, `alloc`
There may still be many implementations that can be made `const`.
</div></details>
2021-10-20 04:35:15 +09:00
..
fmt Rollup merge of #86479 - exphp-forks:float-debug-exponential, r=yaahc 2021-10-20 04:35:10 +09:00
hash move object safety test to library/core 2021-08-15 13:00:25 -04:00
iter implement advance_(back_)_by on more iterators 2021-09-30 21:23:28 +02:00
num Auto merge of #88788 - falk-hueffner:speedup-int-log10-branchless, r=joshtriplett 2021-10-12 03:18:54 +00:00
ops Expand the docs for ops::ControlFlow a bit 2021-02-06 22:36:05 -08:00
alloc.rs
any.rs Add test for issue 84666. 2021-06-03 16:13:45 +02:00
array.rs Also cfg flag auxiliar function 2021-10-08 06:40:24 -03:00
ascii.rs
atomic.rs Make more From impls const 2021-10-18 19:19:28 +09:00
bool.rs
cell.rs Make more From impls const 2021-10-18 19:19:28 +09:00
char.rs Make more From impls const 2021-10-18 19:19:28 +09:00
clone.rs Fix borrow and deref 2021-03-03 11:23:29 +01:00
cmp.rs
const_ptr.rs Revert "Revert tests added by PR 81167." 2021-06-27 12:05:17 +02:00
intrinsics.rs
lazy.rs Make more From impls const 2021-10-18 19:19:28 +09:00
lib.rs Make more From impls const 2021-10-18 19:19:28 +09:00
macros.rs Allow leading pipe in matches!() patterns. 2021-07-15 22:05:45 +03:00
manually_drop.rs Test ManuallyDrop::clone_from. 2021-07-05 11:55:45 +00:00
mem.rs Remove the deprecated core::raw and std::raw module. 2021-07-03 14:03:27 +08:00
nonzero.rs Make more From impls const 2021-10-18 19:19:28 +09:00
ops.rs Expand the docs for ops::ControlFlow a bit 2021-02-06 22:36:05 -08:00
option.rs Make more From impls const 2021-10-18 19:19:28 +09:00
pattern.rs
pin.rs
ptr.rs Bump cfgs 2021-04-04 14:57:05 -04:00
result.rs Make Result::as_mut const 2021-10-17 18:39:54 +09:00
slice.rs add slice::swap tests 2021-10-11 16:16:20 -04:00
str.rs
str_lossy.rs
task.rs
time.rs Make Duration's Debug format pad to width 2021-09-16 03:09:31 +02:00
tuple.rs
unicode.rs