Skip to content

Commit bf0e34c

Browse files
committed
PR feedback
1 parent b7a6c4a commit bf0e34c

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

library/alloc/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@
140140
#![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_uninit_array)]
141141
#![feature(alloc_layout_extra)]
142142
#![feature(trusted_random_access)]
143-
#![feature(try_trait)]
144-
#![feature(try_trait_v2)]
143+
#![cfg_attr(bootstrap, feature(try_trait))]
144+
#![cfg_attr(not(bootstrap), feature(try_trait_v2))]
145145
#![feature(min_type_alias_impl_trait)]
146146
#![feature(associated_type_bounds)]
147147
#![feature(slice_group_by)]

library/core/src/iter/traits/iterator.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2418,7 +2418,8 @@ pub trait Iterator {
24182418
Self: Sized,
24192419
F: FnMut(&Self::Item) -> R,
24202420
R: Try<Output = bool>,
2421-
// FIXME: This is a weird bound; the API should change
2421+
// FIXME: This bound is rather strange, but means minimal breakage on nightly.
2422+
// See #85115 for the issue tracking a holistic solution for this and try_map.
24222423
R: crate::ops::TryV2<Residual = Result<crate::convert::Infallible, E>>,
24232424
{
24242425
#[inline]

src/test/codegen/try_identity.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
type R = Result<u64, i32>;
99

10-
// This was written to the `?` from `try_trait`,
11-
// but `try_trait_v2` uses a different structure,
12-
// so the relevant desugar is copied inline
13-
// in order to keep the test testing the same thing.
10+
// This was written to the `?` from `try_trait`, but `try_trait_v2` uses a different structure,
11+
// so the relevant desugar is copied inline in order to keep the test testing the same thing.
12+
// FIXME: while this might be useful for `r#try!`, it would be nice to have a MIR optimization
13+
// that picks up the `?` desugaring, as `SimplifyArmIdentity` does not. See #85133
1414
#[no_mangle]
1515
pub fn try_identity(x: R) -> R {
1616
// CHECK: start:

src/test/mir-opt/simplify-arm.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ fn from_error<T, E>(e: E) -> Result<T, E> {
2828
Err(e)
2929
}
3030

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

src/test/mir-opt/simplify_try.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ fn from_error<T, E>(e: E) -> Result<T, E> {
1313
Err(e)
1414
}
1515

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

0 commit comments

Comments
 (0)