From 44756d8d96efb996d13affd8ba1ab80587fe461f Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Fri, 10 Dec 2021 09:17:55 -0800 Subject: [PATCH 1/2] Readd track_caller to Result::from_residual --- library/core/src/result.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/core/src/result.rs b/library/core/src/result.rs index e6b8c8ec3385a..ffed0c5612541 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -1953,6 +1953,7 @@ impl ops::Try for Result { #[unstable(feature = "try_trait_v2", issue = "84277")] impl> ops::FromResidual> for Result { #[inline] + #[track_caller] fn from_residual(residual: Result) -> Self { match residual { Err(e) => Err(From::from(e)), From 94307e271c3011f90bffa93fd30e0459748f7da3 Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Fri, 10 Dec 2021 12:19:47 -0800 Subject: [PATCH 2/2] bless new output on some mir-opt tests --- src/test/mir-opt/separate_const_switch.identity.ConstProp.diff | 2 +- .../mir-opt/separate_const_switch.identity.PreCodegen.after.mir | 2 +- .../separate_const_switch.identity.SeparateConstSwitch.diff | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/mir-opt/separate_const_switch.identity.ConstProp.diff b/src/test/mir-opt/separate_const_switch.identity.ConstProp.diff index d5190cdb0c7de..0a220e6e72c79 100644 --- a/src/test/mir-opt/separate_const_switch.identity.ConstProp.diff +++ b/src/test/mir-opt/separate_const_switch.identity.ConstProp.diff @@ -15,7 +15,7 @@ scope 1 { debug residual => _6; // in scope 1 at $DIR/separate_const_switch.rs:29:9: 29:10 scope 2 { - scope 8 (inlined as FromResidual>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10 + scope 8 (inlined #[track_caller] as FromResidual>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10 debug residual => _8; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10 let _16: i32; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10 let mut _17: i32; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10 diff --git a/src/test/mir-opt/separate_const_switch.identity.PreCodegen.after.mir b/src/test/mir-opt/separate_const_switch.identity.PreCodegen.after.mir index dee45c5840383..b09527e46af08 100644 --- a/src/test/mir-opt/separate_const_switch.identity.PreCodegen.after.mir +++ b/src/test/mir-opt/separate_const_switch.identity.PreCodegen.after.mir @@ -12,7 +12,7 @@ fn identity(_1: Result) -> Result { scope 1 { debug residual => _5; // in scope 1 at $DIR/separate_const_switch.rs:29:9: 29:10 scope 2 { - scope 8 (inlined as FromResidual>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10 + scope 8 (inlined #[track_caller] as FromResidual>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10 debug residual => _6; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10 let _14: i32; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10 let mut _15: i32; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10 diff --git a/src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff b/src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff index 69f3bec6fea25..bfc74aff20796 100644 --- a/src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff +++ b/src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff @@ -15,7 +15,7 @@ scope 1 { debug residual => _6; // in scope 1 at $DIR/separate_const_switch.rs:29:9: 29:10 scope 2 { - scope 8 (inlined as FromResidual>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10 + scope 8 (inlined #[track_caller] as FromResidual>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10 debug residual => _8; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10 let _16: i32; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10 let mut _17: i32; // in scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10