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

small normalization improvement #127570

Merged
merged 1 commit into from
Jul 10, 2024
Merged

small normalization improvement #127570

merged 1 commit into from
Jul 10, 2024

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Jul 10, 2024

@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 Jul 10, 2024
@@ -81,7 +81,7 @@ bitflags::bitflags! {
/// Does this have `Alias` or `ConstKind::Unevaluated`?
///
/// Rephrased, could this term be normalized further?
const HAS_ALIASES = TypeFlags::HAS_TY_PROJECTION.bits()
const HAS_ALIAS = TypeFlags::HAS_TY_PROJECTION.bits()
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -230,7 +230,7 @@ pub trait TypeVisitableExt<I: Interner>: TypeVisitable<I> {
}

fn has_aliases(&self) -> bool {
Copy link
Member

@fmease fmease Jul 10, 2024

Choose a reason for hiding this comment

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

Suggested change
fn has_aliases(&self) -> bool {
fn has_alias(&self) -> bool {

too (my bad)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

interstingly, we do use the plural for the functions, e.g. we have has_inherent_projections and has_opaque_types even though the type flag is HAS_TY_OPAQUE

Copy link
Member

Choose a reason for hiding this comment

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

let's leave this one

match reveal {
Reveal::UserFacing => {}
Reveal::All => flags |= ty::TypeFlags::HAS_TY_OPAQUE,
Reveal::UserFacing => flags ^= ty::TypeFlags::HAS_TY_OPAQUE,
Copy link
Member

Choose a reason for hiding this comment

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

is it possible to & with the complement here? xor feels confusing to reason about

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there's fn remove 👍

@lcnr lcnr force-pushed the normalize-cool branch from 507f3e9 to e00fd78 Compare July 10, 2024 13:56
@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 10, 2024

📌 Commit e00fd78 has been approved by compiler-errors

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 Jul 10, 2024
Comment on lines -120 to +118
Reveal::UserFacing => {}
Reveal::All => flags |= ty::TypeFlags::HAS_TY_OPAQUE,
Reveal::UserFacing => flags.remove(ty::TypeFlags::HAS_TY_OPAQUE),
Reveal::All => {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Logic here now inverted, is it ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, HAS_TY_OPAQUE wasn't in flags before.

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 10, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#126476 (Fix running bootstrap tests with a local Rust toolchain as the stage0)
 - rust-lang#127094 (E0191 suggestion correction, inserts turbofish)
 - rust-lang#127554 ( do not run test where it cannot run)
 - rust-lang#127564 (Temporarily remove me from review rotation.)
 - rust-lang#127568 (instantiate higher ranked goals in candidate selection again)
 - rust-lang#127569 (Fix local download of Docker caches from CI)
 - rust-lang#127570 ( small normalization improvement)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 22df186 into rust-lang:master Jul 10, 2024
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 10, 2024
Rollup merge of rust-lang#127570 - lcnr:normalize-cool, r=compiler-errors

 small normalization improvement

r? `@compiler-errors`
@rustbot rustbot added this to the 1.81.0 milestone Jul 10, 2024
@lcnr lcnr deleted the normalize-cool branch July 11, 2024 07:40
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.

6 participants