-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix reachability analysis for const methods #97716
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
67d63c8
to
dfc9294
Compare
dfc9294
to
15cccb9
Compare
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.
Looks good to me! I like this approach better than the initial one and the results for should_codegen_locally
and should_encode_mir
look correct to me.
Thanks @compiler-errors! @bors r+ |
📌 Commit 15cccb9 has been approved by |
Yeah the first approach was kinda wonky. It only later realized to me that we should be using |
…eywiser Fix reachability analysis for const methods Use `method_might_be_inlined` directly for `ImplItemKind::Fn` instead of duplicating the logic in `def_id_represents_local_inlined_item`. This is parallel to how we use `item_might_be_inlined` for `ItemKind::Fn` in that same body. Fixes rust-lang#97708
Rollup of 5 pull requests Successful merges: - rust-lang#96642 (Avoid zero-sized allocs in ThinBox if T and H are both ZSTs.) - rust-lang#97647 (Lazily allocate and initialize pthread locks.) - rust-lang#97715 (Support the `#[expect]` attribute on fn parameters (RFC-2383)) - rust-lang#97716 (Fix reachability analysis for const methods) - rust-lang#97722 (Tighten spans for bad fields in struct deriving `Copy`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Hm, i had hoped that this would also fix #96857 but it seems it didn't :/ :sweat_smile: |
Use
method_might_be_inlined
directly forImplItemKind::Fn
instead of duplicating the logic indef_id_represents_local_inlined_item
.This is parallel to how we use
item_might_be_inlined
forItemKind::Fn
in that same body.Fixes #97708