Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#[cfg(bootstrap)] out NoneError and other v1 try_trait stuff #85482

Merged
merged 1 commit into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions library/core/src/ops/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pub enum ControlFlow<B, C = ()> {
}

#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
#[cfg(bootstrap)]
impl<B, C> ops::TryV1 for ControlFlow<B, C> {
type Output = C;
type Error = B;
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ mod function;
mod generator;
mod index;
mod range;
#[cfg(bootstrap)]
mod r#try;
mod try_trait;
mod unsize;
Expand Down Expand Up @@ -187,6 +188,7 @@ pub use self::range::{Bound, RangeBounds, RangeInclusive, RangeToInclusive};
pub use self::r#try::Try;

#[unstable(feature = "try_trait_transition", reason = "for bootstrap", issue = "none")]
#[cfg(bootstrap)]
pub(crate) use self::r#try::Try as TryV1;

#[unstable(feature = "try_trait_v2", issue = "84277")]
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1641,9 +1641,11 @@ impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> {
#[rustc_diagnostic_item = "none_error"]
#[unstable(feature = "try_trait", issue = "42327")]
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
#[cfg(bootstrap)]
pub struct NoneError;

#[unstable(feature = "try_trait", issue = "42327")]
#[cfg(bootstrap)]
impl<T> ops::TryV1 for Option<T> {
type Output = T;
type Error = NoneError;
Expand Down
1 change: 1 addition & 0 deletions library/core/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1627,6 +1627,7 @@ impl<A, E, V: FromIterator<A>> FromIterator<Result<A, E>> for Result<V, E> {
}

#[unstable(feature = "try_trait", issue = "42327")]
#[cfg(bootstrap)]
impl<T, E> ops::TryV1 for Result<T, E> {
type Output = T;
type Error = E;
Expand Down
2 changes: 2 additions & 0 deletions library/core/src/task/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ impl<T> From<T> for Poll<T> {
}

#[stable(feature = "futures_api", since = "1.36.0")]
#[cfg(bootstrap)]
impl<T, E> ops::TryV1 for Poll<Result<T, E>> {
type Output = Poll<T>;
type Error = E;
Expand Down Expand Up @@ -184,6 +185,7 @@ impl<T, E, F: From<E>> ops::FromResidual<Result<convert::Infallible, E>> for Pol
}

#[stable(feature = "futures_api", since = "1.36.0")]
#[cfg(bootstrap)]
impl<T, E> ops::TryV1 for Poll<Option<Result<T, E>>> {
type Output = Poll<Option<T>>;
type Error = E;
Expand Down
1 change: 0 additions & 1 deletion library/core/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#![feature(str_internals)]
#![feature(test)]
#![feature(trusted_len)]
#![feature(try_trait)]
#![feature(try_trait_v2)]
#![feature(slice_internals)]
#![feature(slice_partition_dedup)]
Expand Down