PR feedback
This commit is contained in:
parent
b7a6c4a905
commit
bf0e34c001
5 changed files with 16 additions and 15 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)),
|
||||
|
|
|
|||
|
|
@ -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)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue