Commit 1d9ab77
authored
Rollup merge of rust-lang#92382 - clarfonthey:const_convert, r=scottmcm
Extend const_convert to rest of blanket core::convert impls
This adds constness to all the blanket impls in `core::convert` under the existing `const_convert` feature, tracked by rust-lang#88674.
Existing impls under that feature:
```rust
impl<T> const From<T> for T;
impl<T, U> const Into<U> for T where U: ~const From<T>;
impl<T> const ops::Try for Option<T>;
impl<T> const ops::FromResidual for Option<T>;
impl<T, E> const ops::Try for Result<T, E>;
impl<T, E, F> const ops::FromResidual<Result<convert::Infallible, E>> for Result<T, F> where F: ~const From<E>;
```
Additional impls:
```rust
impl<T: ?Sized, U: ?Sized> const AsRef<U> for &T where T: ~const AsRef<U>;
impl<T: ?Sized, U: ?Sized> const AsRef<U> for &mut T where T: ~const AsRef<U>;
impl<T: ?Sized, U: ?Sized> const AsMut<U> for &mut T where T: ~const AsMut<U>;
impl<T, U> const TryInto<U> for T where U: ~const TryFrom<T>;
impl<T, U> const TryFrom<U> for T where U: ~const Into<T>;
```1 file changed
+15
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
| 484 | + | |
| 485 | + | |
485 | 486 | | |
486 | | - | |
| 487 | + | |
487 | 488 | | |
488 | 489 | | |
489 | 490 | | |
| |||
492 | 493 | | |
493 | 494 | | |
494 | 495 | | |
495 | | - | |
| 496 | + | |
| 497 | + | |
496 | 498 | | |
497 | | - | |
| 499 | + | |
498 | 500 | | |
499 | 501 | | |
500 | 502 | | |
| |||
511 | 513 | | |
512 | 514 | | |
513 | 515 | | |
514 | | - | |
| 516 | + | |
| 517 | + | |
515 | 518 | | |
516 | | - | |
| 519 | + | |
517 | 520 | | |
518 | 521 | | |
519 | 522 | | |
| |||
567 | 570 | | |
568 | 571 | | |
569 | 572 | | |
570 | | - | |
| 573 | + | |
| 574 | + | |
571 | 575 | | |
572 | | - | |
| 576 | + | |
573 | 577 | | |
574 | 578 | | |
575 | 579 | | |
| |||
581 | 585 | | |
582 | 586 | | |
583 | 587 | | |
584 | | - | |
| 588 | + | |
| 589 | + | |
585 | 590 | | |
586 | | - | |
| 591 | + | |
587 | 592 | | |
588 | 593 | | |
589 | 594 | | |
| |||
0 commit comments