-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Remove header field from clean::Function #95096
Conversation
Some changes occurred in cc @camelid |
Forgot to run the perf check. @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 460442576cda0a8e3f6a36023cbfc96d15e1124a with merge adc3dafa0f99c69b5c77712a174931437f4701a3... |
☀️ Try build successful - checks-actions |
Queued adc3dafa0f99c69b5c77712a174931437f4701a3 with parent 3153584, future comparison URL. |
4604425
to
e1dc7ed
Compare
Applied suggestions. |
Finished benchmarking commit (adc3dafa0f99c69b5c77712a174931437f4701a3): comparison url. Summary: This benchmark run shows 39 relevant improvements 🎉 to instruction counts.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 led to changes in compiler perf. @bors rollup=never |
Nice improvements overall! For the rss usage, we have -0.93% on primary benchmarks and -1.16% on secondary benchmarks. I also added a test which reexports a foreign function from a dependency to be sure there is no issue with the |
98cefd8
to
d135230
Compare
b0798bd
to
8ce764c
Compare
Updated! |
@@ -795,13 +792,6 @@ fn clean_fn_or_proc_macro( | |||
} | |||
None => { | |||
let mut func = clean_function(cx, sig, generics, body_id); | |||
let def_id = item.def_id.to_def_id(); | |||
func.header.constness = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed several places where the constness is overrided like this. I don't quite understand why this code existed. Does the new, on-demand computation account for the old overriding behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, some places used is_const_fn_raw
while others used is_const_fn
. Is this handled properly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was more or less the same code done by different functions. We have a lot of rustdoc tests for functions and methods to ensure their signature is as expected (I know it because I broke a lot of them while working on this PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, seems good to me then. It's good to know the tests worked as intended and failed with previous versions of the code :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with the following comments addressed
Thanks for this refactor!
@@ -795,13 +792,6 @@ fn clean_fn_or_proc_macro( | |||
} | |||
None => { | |||
let mut func = clean_function(cx, sig, generics, body_id); | |||
let def_id = item.def_id.to_def_id(); | |||
func.header.constness = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, seems good to me then. It's good to know the tests worked as intended and failed with previous versions of the code :)
…temKind::MethodItem in fn_header function
8ce764c
to
8071332
Compare
@bors: r=camelid rollup=never |
📌 Commit 8071332 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (11909e3): comparison url. Summary: This benchmark run shows 30 relevant improvements 🎉 to instruction counts.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
…g, r=notriddle Remove unneeded `to_string` call Fixes a confusion I made when reading `@camelid's` comment [here](rust-lang#95096 (comment)). r? `@notriddle`
Fixes #89673.
This is another take on #89673 (compared to #91217) but very different on the approach: I moved the header call in one place but still require to have the
clean::Item
so I can use theDefId
to get what is missing.cc @jyn514 (you reviewed the original so maybe you want to take a look?)
r? @camelid