-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Use ufcs in derive(Debug) #81294
Use ufcs in derive(Debug) #81294
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
There is one thing I was curious about: I used
|
3283d15
to
aa8fdad
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
(I'm seeing that failure locally too, but I'm at a loss for how what I did could have caused it...) |
(marking as S-waiting-on-author since it cannot land as is, but I still would welcome any hints as to what I might have done wrong.) |
I believe I have seen the opposite change recently. This may be a spuriously fluctuating diagnostic (or semi-spurious, depending on random but fixed things in the compiler, since I have not seen it happen randomly on CI). |
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 "spurious" test blessed. I'll open an issue about it
stmts.push(cx.stmt_let(span, true, builder, expr)); | ||
|
||
for field in fields { | ||
// Use double indirection to make sure this works for unsized types | ||
let field = cx.expr_addr_of(field.span, field.self_.clone()); | ||
let field = cx.expr_addr_of(field.span, field); | ||
|
||
let expr = cx.expr_method_call( |
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.
Maybe we should just remove the expr_method_call
function entirely (or perma-deprecate it so ppl searching for it get an explanation of why they should use ufcs)
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.
Yeah I considered this as well. Probably a good idea, especially if this is the last use of it. I'll try to look into that.
@bors r=oli-obk |
📌 Commit 24149d7 has been approved by |
@bors rollup=never potentially perf sensitive |
⌛ Testing commit 24149d7 with merge c27291b43e30556440e671568db27c2795cc8dae... |
@bors retry yielding |
⌛ Testing commit 24149d7 with merge 087a6a1947865c637bec869ed2217b4f5e5d6829... |
💔 Test failed - checks-actions |
@bors r- |
… method collisions I could imagine. The different impls are all guarded by cfg-flags, and the revisions could be used to cover the full power-set of combinations. (I only included 20 of the possible 32 cases here; the null-set is not interesting, and the remaining 11 all yielded ambiguous method resolution errors which did not mix well with this testing strategy; I'm not trying to check UI for the resolution diagnostics; I'm trying to create checkpoint of current resolution semantics when compilation succeeds.)
oh you've got to be kidding me, my local systems failure to test coverage is biting me again, just like in PR #81257? Okay, I guess its time to invest a little more effort in figuring out what is supposed to be running and why my system isn't running it... |
78409b0
to
1783c47
Compare
@bors r+ |
📌 Commit 1783c47 has been approved by |
☀️ Test successful - checks-actions |
Note: deeply-nested-async, match-stress-enum, regression-31157, (and some others) benchmarks doesn't have any derives. EDIT: The MIR is larger to due an extra reborrow for each method call. Opened #81760 to determine if this impacts perf. |
…=varkor Remove usages of `expr_method_call` in derive(Ord,PartialOrd,RustcEncode,RustcDecode) Preparing for deprecation of `expr_method_call` (rust-lang#81295), by removing the remaining usages not covered by (rust-lang#81294). I am not sure about the changes to `derive(RustcEncode,RustcDecode)`
The experiment from #81760, while produces smaller MIR, didn't help with regressions. The comparisons before & #81760 (insert extra caveats about the non-adjacent comparison ...) https://perf.rust-lang.org/compare.html?start=6ad11e2e25919b75ebbc36d7910f2a1126a7e873&end=d589fc7d554c7ecdab26eb7ae07fd6dc7e8280f7&stat=instructions%3Au There are additional queries for |
Oh... so UFCs always were less efficient than method calls in terms of compile-time or at least query invocation count. I wonder if we can adjust the relevant call sites to not use Not sure what changed in typeck, will need to dig into the code in order to figure that out |
Cc #81211.
(Arguably this is the fix for it.)