Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmcm committed May 10, 2021
1 parent b7a6c4a commit bf0e34c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions library/alloc/src/lib.rs
Expand Up @@ -140,8 +140,8 @@
#![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_uninit_array)]
#![feature(alloc_layout_extra)]
#![feature(trusted_random_access)]
#![feature(try_trait)]
#![feature(try_trait_v2)]
#![cfg_attr(bootstrap, feature(try_trait))]
#![cfg_attr(not(bootstrap), feature(try_trait_v2))]
#![feature(min_type_alias_impl_trait)]
#![feature(associated_type_bounds)]
#![feature(slice_group_by)]
Expand Down
3 changes: 2 additions & 1 deletion library/core/src/iter/traits/iterator.rs
Expand Up @@ -2418,7 +2418,8 @@ pub trait Iterator {
Self: Sized,
F: FnMut(&Self::Item) -> R,
R: Try<Output = bool>,
// FIXME: This is a weird bound; the API should change
// FIXME: This bound is rather strange, but means minimal breakage on nightly.
// See #85115 for the issue tracking a holistic solution for this and try_map.
R: crate::ops::TryV2<Residual = Result<crate::convert::Infallible, E>>,
{
#[inline]
Expand Down
8 changes: 4 additions & 4 deletions src/test/codegen/try_identity.rs
Expand Up @@ -7,10 +7,10 @@

type R = Result<u64, i32>;

// This was written to the `?` from `try_trait`,
// but `try_trait_v2` uses a different structure,
// so the relevant desugar is copied inline
// in order to keep the test testing the same thing.
// This was written to the `?` from `try_trait`, but `try_trait_v2` uses a different structure,
// so the relevant desugar is copied inline in order to keep the test testing the same thing.
// FIXME: while this might be useful for `r#try!`, it would be nice to have a MIR optimization
// that picks up the `?` desugaring, as `SimplifyArmIdentity` does not. See #85133
#[no_mangle]
pub fn try_identity(x: R) -> R {
// CHECK: start:
Expand Down
8 changes: 4 additions & 4 deletions src/test/mir-opt/simplify-arm.rs
Expand Up @@ -28,10 +28,10 @@ fn from_error<T, E>(e: E) -> Result<T, E> {
Err(e)
}

// This was written to the `?` from `try_trait`,
// but `try_trait_v2` uses a different structure,
// so the relevant desugar is copied inline
// in order to keep the test testing the same thing.
// This was written to the `?` from `try_trait`, but `try_trait_v2` uses a different structure,
// so the relevant desugar is copied inline in order to keep the test testing the same thing.
// FIXME: while this might be useful for `r#try!`, it would be nice to have a MIR optimization
// that picks up the `?` desugaring, as `SimplifyArmIdentity` does not. See #85133
fn id_try(r: Result<u8, i32>) -> Result<u8, i32> {
let x = match into_result(r) {
Err(e) => return from_error(From::from(e)),
Expand Down
8 changes: 4 additions & 4 deletions src/test/mir-opt/simplify_try.rs
Expand Up @@ -13,10 +13,10 @@ fn from_error<T, E>(e: E) -> Result<T, E> {
Err(e)
}

// This was written to the `?` from `try_trait`,
// but `try_trait_v2` uses a different structure,
// so the relevant desugar is copied inline
// in order to keep the test testing the same thing.
// This was written to the `?` from `try_trait`, but `try_trait_v2` uses a different structure,
// so the relevant desugar is copied inline in order to keep the test testing the same thing.
// FIXME: while this might be useful for `r#try!`, it would be nice to have a MIR optimization
// that picks up the `?` desugaring, as `SimplifyArmIdentity` does not. See #85133
fn try_identity(x: Result<u32, i32>) -> Result<u32, i32> {
let y = match into_result(x) {
Err(e) => return from_error(From::from(e)),
Expand Down

0 comments on commit bf0e34c

Please sign in to comment.