-
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
Fix an ICE on #96738 #96746
Fix an ICE on #96738 #96746
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
I don't think this code should need a local ID, it should be rewritten to be able to handle non-local definitions. |
Though it's more of an enhancement thing rather than bugfix, I guess. |
I also think it would be better to support this for extern ids. |
Hmm, I may be misunderstanding your suggestion. let suggest = if let ty::FnDef(def_id, _) = rcvr_ty.kind()
&& let DefKind::Ctor(of, _) = tcx.def_kind(def_id)
{
let parent_def_id = tcx.parent(*def_id);
Some((tcx.associated_item_def_ids(parent_def_id).len(), of))
} else {
None
}; causes panic on |
Sigh, looks like the local version of |
Added the implementation. |
This also fixes #96583, which is the same issue |
@bors r+ |
📌 Commit 35d77c1 has been approved by |
Fix an ICE on rust-lang#96738 In the block we don't know if the method actually exists thus `expect_local` panics. Fixes rust-lang#96738
…piler-errors Rollup of 8 pull requests Successful merges: - rust-lang#96660 ([bootstrap] Give a better error when trying to run a path with no registered step) - rust-lang#96701 (update `jemallocator` example to use 2018 edition import syntax) - rust-lang#96746 (Fix an ICE on rust-lang#96738) - rust-lang#96758 (bootstrap: bsd platform flags for split debuginfo) - rust-lang#96778 (Remove closures on `expect_local` to apply `#[track_caller]`) - rust-lang#96781 (Fix an incorrect link in The Unstable Book) - rust-lang#96783 (Link to correct issue in issue-95034 known-bug) - rust-lang#96801 (Add regression test for rust-lang#96319) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
PR rust-lang#96746 fixed a very similar bug, so the same logic is used in a different place.
…er-errors Actually fix ICE from rust-lang#96583 PR rust-lang#96746 fixed a very similar bug, so the same logic is used in a different place. I originally concluded that the two issues (rust-lang#96583 and rust-lang#96738) were identical by comparing the backtrace, but I didn't look close enough.
In the block we don't know if the method actually exists thus
expect_local
panics.Fixes #96738
Fixes #96583