Skip to content

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jan 14, 2025

When this code was written, there was no type_of implementation for closures. That has long since been changed.

In the UI test:

trait A where
    [(); (|| {}, 1).1]: Sized,
{
}

We tried to walk up the def path tree for the closure, from closure -> anon const -> trait. When we reached the trait, we tried to call type_of on it which obviously doesn't do the right thing and ICEs.

Fixes #135418

@rustbot
Copy link
Collaborator

rustbot commented Jan 14, 2025

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 14, 2025
@lqd
Copy link
Member

lqd commented Jan 14, 2025

nice, r? lqd, r=me when CI is green

@rustbot rustbot assigned lqd and unassigned fmease Jan 14, 2025
@compiler-errors
Copy link
Member Author

@bors r=lqd

@bors
Copy link
Collaborator

bors commented Jan 14, 2025

📌 Commit faafa5c has been approved by lqd

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 14, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 14, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#134216 (Enable "jump to def" feature on patterns)
 - rust-lang#134880 (Made `Path::name` only have item name rather than full name)
 - rust-lang#135466 (Leak check in `impossible_predicates` to avoid monomorphizing impossible instances)
 - rust-lang#135476 (Remove remnant of asmjs)
 - rust-lang#135479 (mir borrowck: cleanup late-bound region handling)
 - rust-lang#135493 (Fix legacy symbol mangling of closures)
 - rust-lang#135495 (Add missing closing backtick in commit hook message 🐸)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f9c2c12 into rust-lang:master Jan 14, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 14, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 14, 2025
Rollup merge of rust-lang#135493 - compiler-errors:legacy-mangle-closure, r=lqd

Fix legacy symbol mangling of closures

When this code was written, there was no `type_of` implementation for closures. That has long since been changed.

In the UI test:

```
trait A where
    [(); (|| {}, 1).1]: Sized,
{
}
```

We tried to walk up the def path tree for the closure, from closure -> anon const -> trait. When we reached the trait, we tried to call `type_of` on it which obviously doesn't do the right thing and ICEs.

Fixes rust-lang#135418
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: compute_type_of_item: unexpected item type: Trait
5 participants