Use tcx.symbol_name when determining clashing extern declarations. - #80009
Conversation
There was a problem hiding this comment.
In theory this could just store &'tcx str without an issue, but the impl_lint_pass! macro does not support lints parametric over a lifetime T_T.
There was a problem hiding this comment.
could just store &'tcx str without an issue
Yeah, you're right -- that would let me avoid the allocation completely.
the impl_lint_pass! macro does not support lints parametric over a lifetime T_T
I don't think I'll address this in this PR -- I've just added a FIXME note for now, until impl_lint_pass! can take lifetimes.
|
Seems reasonable to me! |
a154be7 to
fa02a8e
Compare
|
This should be good for re-review once green. |
|
@bors: r+ Thanks! |
|
📌 Commit fa02a8ed6405d6cd2e4f5bd27cde9f0c2f59184b has been approved by |
|
⌛ Testing commit fa02a8ed6405d6cd2e4f5bd27cde9f0c2f59184b with merge a0f9320b9d4490efe6beace771710a58f1a3e44c... |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test failed - checks-actions |
fa02a8e to
4b740ac
Compare
|
Not sure why it failed the first time. @alexcrichton -- can you re-approve? |
|
@bors: retry |
|
Ah, @bors r=alexcrichton - the prior approval wouldn't have worked I expect since commits have been pushed since then. |
|
📌 Commit 4b740ac has been approved by |
|
☀️ Test successful - checks-actions |
|
@jumbatm @nagisa This was the cause of a minor perf regression. I wonder how much of it is the allocation of the symbol name string vs the call |
|
Thanks for the heads-up. I'll have a look into this. |
…nagisa clashing_extern_declarations: Use symbol interning to avoid string alloc. Use symbol interning as a hack to avoid allocating a string for every symbol name we store in the seen set. This hopefully addresses the minor perf regression described in rust-lang#80009 (comment). r? `@nagisa`
Fixes #79581.
r? @alexcrichton