-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add #[track_caller]
to the "From implies Into" impl
#119807
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
This is a tiny but huge change, so probably needs a perf run if this ever is accepted, as mentioned earlier. |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…to, r=<try> Add `#[track_caller]` to the "From implies Into" impl This pr implements what was mentioned in rust-lang#77474 (comment) This follows from my URLO https://users.rust-lang.org/t/104497 ```rust #![allow(warnings)] fn main() { // Gives a good location let _: Result<(), Loc> = dbg!(Err::<(), _>(()).map_err(|e| e.into())); // still doesn't work, gives location of `FnOnce::call_once()` let _: Result<(), Loc> = dbg!(Err::<(), _>(()).map_err(Into::into)); } #[derive(Debug)] pub struct Loc { pub l: &'static std::panic::Location<'static>, } impl From<()> for Loc { #[track_caller] fn from(_: ()) -> Self { Loc { l: std::panic::Location::caller(), } } } ```
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (902a98b): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 666.26s -> 665.429s (-0.12%) |
Is that enough to validate this atleast? Don't know how many calls that are affected are hit in the runs, would it maybe be possible/needed to crater + perf instruction count? |
We will almost certainly get inlining here in one direction, either inlining |
☀️ Test successful - checks-actions |
Finished benchmarking commit (d9d89fd): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 663.269s -> 662.236s (-0.16%) |
Hey, I just got bitten by the:
Is there a tracking issue for this? |
I don't believe there is. |
This pr implements what was mentioned in #77474 (comment)
This follows from my URLO https://users.rust-lang.org/t/104497