Auto merge of #91549 - fee1-dead:const_env, r=spastorino

Eliminate ConstnessAnd again

Closes #91489.
Closes #89432.

Reverts #91491.
Reverts #89450.

r? `@spastorino`
This commit is contained in:
bors
2021-12-12 22:15:32 +00:00
69 changed files with 622 additions and 458 deletions

View File

@@ -534,9 +534,10 @@ where
// From implies Into
#[stable(feature = "rust1", since = "1.0.0")]
impl<T, U> Into<U> for T
#[rustc_const_unstable(feature = "const_convert", issue = "88674")]
impl<T, U> const Into<U> for T
where
U: From<T>,
U: ~const From<T>,
{
fn into(self) -> U {
U::from(self)

View File

@@ -112,6 +112,7 @@
#![feature(const_float_classify)]
#![feature(const_fmt_arguments_new)]
#![feature(const_heap)]
#![feature(const_convert)]
#![feature(const_inherent_unchecked_arith)]
#![feature(const_int_unchecked_arith)]
#![feature(const_intrinsic_copy)]

View File

@@ -2077,7 +2077,8 @@ impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> {
}
#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<T> ops::Try for Option<T> {
#[rustc_const_unstable(feature = "const_convert", issue = "88674")]
impl<T> const ops::Try for Option<T> {
type Output = T;
type Residual = Option<convert::Infallible>;
@@ -2096,6 +2097,7 @@ impl<T> ops::Try for Option<T> {
}
#[unstable(feature = "try_trait_v2", issue = "84277")]
#[rustc_const_unstable(feature = "const_convert", issue = "88674")]
impl<T> const ops::FromResidual for Option<T> {
#[inline]
fn from_residual(residual: Option<convert::Infallible>) -> Self {

View File

@@ -1945,7 +1945,8 @@ impl<A, E, V: FromIterator<A>> FromIterator<Result<A, E>> for Result<V, E> {
}
#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<T, E> ops::Try for Result<T, E> {
#[rustc_const_unstable(feature = "const_convert", issue = "88674")]
impl<T, E> const ops::Try for Result<T, E> {
type Output = T;
type Residual = Result<convert::Infallible, E>;
@@ -1964,7 +1965,10 @@ impl<T, E> ops::Try for Result<T, E> {
}
#[unstable(feature = "try_trait_v2", issue = "84277")]
impl<T, E, F: From<E>> ops::FromResidual<Result<convert::Infallible, E>> for Result<T, F> {
#[rustc_const_unstable(feature = "const_convert", issue = "88674")]
impl<T, E, F: ~const From<E>> const ops::FromResidual<Result<convert::Infallible, E>>
for Result<T, F>
{
#[inline]
fn from_residual(residual: Result<convert::Infallible, E>) -> Self {
match residual {