Skip to content
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

Track bound types like bound regions #107486

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

compiler-errors
Copy link
Member

When we instantiate bound types into placeholder types, we throw away the names for some reason. These names are particularly useful for error reporting once we have for<T> binders.

r? types

@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 30, 2023
@@ -370,7 +370,7 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::Ty<RustInterner<'tcx>>> for Ty<'tcx> {
ty::Placeholder(_placeholder) => {
chalk_ir::TyKind::Placeholder(chalk_ir::PlaceholderIndex {
ui: chalk_ir::UniverseIndex { counter: _placeholder.universe.as_usize() },
idx: _placeholder.name.as_usize(),
idx: _placeholder.name.expect_anon() as usize,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure that due to canonicalization, this will never be triggered.

In any case, I'm happpy with not having chalk support for bound types 😬 -- we also treat RePlaceholder very strangely below (always giving it an idx: 0)

@oli-obk
Copy link
Contributor

oli-obk commented Jan 31, 2023

@bors r+ rollup

Except for the chalk use cases BoundVar may be better than just u32 within the Anon, but for now let's land this, it's very contained anyway

@bors
Copy link
Contributor

bors commented Jan 31, 2023

📌 Commit 0e98a16 has been approved by oli-obk

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 31, 2023
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 31, 2023
…, r=oli-obk

Track bound types like bound regions

When we instantiate bound types into placeholder types, we throw away the names for some reason. These names are particularly useful for error reporting once we have `for<T>` binders.

r? types
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 31, 2023
…, r=oli-obk

Track bound types like bound regions

When we instantiate bound types into placeholder types, we throw away the names for some reason. These names are particularly useful for error reporting once we have `for<T>` binders.

r? types
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 1, 2023
…llaumeGomez

Rollup of 12 pull requests

Successful merges:

 - rust-lang#106898 (Include both md and yaml ICE ticket templates)
 - rust-lang#107331 (Clean up eslint annotations and remove unused JS function)
 - rust-lang#107348 (small refactor to new projection code)
 - rust-lang#107354 (rustdoc: update Source Serif 4 from 4.004 to 4.005)
 - rust-lang#107412 (avoid needless checks)
 - rust-lang#107467 (Improve enum checks)
 - rust-lang#107486 (Track bound types like bound regions)
 - rust-lang#107491 (rustdoc: remove unused CSS from `.setting-check`)
 - rust-lang#107508 (`Edition` micro refactor)
 - rust-lang#107525 (PointeeInfo is advisory only)
 - rust-lang#107527 (rustdoc: stop making unstable items transparent)
 - rust-lang#107535 (Replace unwrap with ? in TcpListener doc)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d36bdf2 into rust-lang:master Feb 1, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 1, 2023
@compiler-errors compiler-errors deleted the bound-ty-keep-name branch August 11, 2023 19:56
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.

4 participants