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

Uplift TypeVisitableExt into rustc_type_ir #120498

Merged
merged 3 commits into from
Feb 14, 2024

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jan 30, 2024

This uplifts TypeVisitableExt into rustc_type_ir so it can be used in an interner-agnostic way. It also moves some TypeSuperVisitable bounds onto Interner since we don't expect to support libraries that have types which aren't foldable by default.

This restores a couple of asserts in the canonicalizer code we uplifted, and also makes it so that we can use type-flags-based helpers in the solver code, which I'm interested in uplifting.

r? lcnr

@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, 2024
@@ -63,11 +73,13 @@ impl<'tcx> Const<'tcx> {
self.0.kind
}

// FIXME(compiler-errors): Think about removing this.
#[inline]
pub fn flags(self) -> TypeFlags {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you remove them in the same PR?

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 not certain that it's cleaner to remove these or not...

Copy link
Member Author

Choose a reason for hiding this comment

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

Some callsites cannot be removed, but it's kind of ugly to have to import a trait from rustc_type_ir.

@lcnr
Copy link
Contributor

lcnr commented Feb 6, 2024

r=me after rebase and moving bounds to the Interner trait

@bors
Copy link
Contributor

bors commented Feb 12, 2024

☔ The latest upstream changes (presumably #120980) made this pull request unmergeable. Please resolve the merge conflicts.

@lcnr
Copy link
Contributor

lcnr commented Feb 13, 2024

also pls update description

@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Feb 13, 2024

📌 Commit 7e80867 has been approved by lcnr

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 Feb 13, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 14, 2024
Rollup of 13 pull requests

Successful merges:

 - rust-lang#116387 (Additional doc links and explanation of `Wake`.)
 - rust-lang#118738 (Netbsd10 update)
 - rust-lang#118890 (Clarify the lifetimes of allocations returned by the `Allocator` trait)
 - rust-lang#120498 (Uplift `TypeVisitableExt` into `rustc_type_ir`)
 - rust-lang#120530 (Be less confident when `dyn` suggestion is not checked for object safety)
 - rust-lang#120915 (Fix suggestion span for `?Sized` when param type has default)
 - rust-lang#121015 (Optimize `delayed_bug` handling.)
 - rust-lang#121024 (implement `Default` for `AsciiChar`)
 - rust-lang#121039 (Correctly compute adjustment casts in GVN)
 - rust-lang#121045 (Fix two UI tests with incorrect directive / invalid revision)
 - rust-lang#121049 (Do not point at `#[allow(_)]` as the reason for compat lint triggering)
 - rust-lang#121071 (Use fewer delayed bugs.)
 - rust-lang#121073 (Fix typos in `OneLock` doc)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cc54612 into rust-lang:master Feb 14, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 14, 2024
Rollup merge of rust-lang#120498 - compiler-errors:type-flags, r=lcnr

Uplift `TypeVisitableExt` into `rustc_type_ir`

This uplifts `TypeVisitableExt` into `rustc_type_ir` so it can be used in an interner-agnostic way. It also moves some `TypeSuperVisitable` bounds onto `Interner` since we don't expect to support libraries that have types which aren't foldable by default.

This restores a couple of asserts in the canonicalizer code we uplifted, and also makes it so that we can use type-flags-based helpers in the solver code, which I'm interested in uplifting.

r? lcnr
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