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 various *Predicate types into rustc_type_ir #125001

Merged
merged 6 commits into from May 12, 2024

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented May 11, 2024

Uplifts ProjectionPredicate, ExistentialTraitRef, ExistentialProjection, TraitPredicate, NormalizesTo, CoercePredicate, and SubtypePredicate.

Adds rustc_type_ir_macros, which semi-duplicates the derive for TypeVisitable, TypeFoldable, and Lift, but in a way that is interner-agnostic.

Moves rustc_type_ir::trait_ref to rustc_type_ir::predicate. The specific placement of all these structs doesn't matter b/c of glob imports, tho.

@compiler-errors
Copy link
Member Author

r? lcnr

@rustbot
Copy link
Collaborator

rustbot commented May 11, 2024

r? @davidtwco

rustbot has assigned @davidtwco.
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 May 11, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@compiler-errors compiler-errors marked this pull request as ready for review May 11, 2024 19:39
@rustbot
Copy link
Collaborator

rustbot commented May 11, 2024

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

r=me with or without nit applied

Comment on lines 5 to 14
use rustc_type_ir::ClauseKind as IrClauseKind;
use rustc_type_ir::CoercePredicate as IrCoercePredicate;
use rustc_type_ir::ExistentialProjection as IrExistentialProjection;
use rustc_type_ir::ExistentialTraitRef as IrExistentialTraitRef;
use rustc_type_ir::NormalizesTo as IrNormalizesTo;
use rustc_type_ir::PredicateKind as IrPredicateKind;
use rustc_type_ir::ProjectionPredicate as IrProjectionPredicate;
use rustc_type_ir::SubtypePredicate as IrSubtypePredicate;
use rustc_type_ir::TraitPredicate as IrTraitPredicate;
use rustc_type_ir::TraitRef as IrTraitRef;
Copy link
Contributor

Choose a reason for hiding this comment

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

use rustc_type_ir as ir;

and then use ir::ClauseKind in the type defs 🤔

+ Hash
+ Eq
+ IntoIterator<Item = I::GenericArg>
+ Deref<Target: Deref<Target = [I::GenericArg]>>
Copy link
Contributor

Choose a reason for hiding this comment

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

:/ Deref<Target: Deref<Target = [I::GenericArg]>> is not ideal 🤔 don't have any immediate better ideas though

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it extremely sucks and also is likely not going to work for r-a, but we should fix it later (either adapt the callsites that rely on this to do something else, or something idk).

@lcnr
Copy link
Contributor

lcnr commented May 11, 2024

please also update PR name

@rustbot rustbot added the PG-exploit-mitigations Project group: Exploit mitigations label May 11, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 11, 2024

changes to the core type system

cc @compiler-errors, @lcnr

HIR ty lowering was modified

cc @fmease

Some changes occurred in compiler/rustc_sanitizers

cc @rust-lang/project-exploit-mitigations, @rcvalle

@compiler-errors compiler-errors changed the title Uplift TraitPredicate Uplift various *Predicate types into rustc_type_ir May 11, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@lcnr
Copy link
Contributor

lcnr commented May 12, 2024

@bors r+ rollup=iffyy

@bors
Copy link
Contributor

bors commented May 12, 2024

📌 Commit d13e5c4 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 May 12, 2024
@lcnr
Copy link
Contributor

lcnr commented May 12, 2024

@bors rollup=iffy

@bors
Copy link
Contributor

bors commented May 12, 2024

⌛ Testing commit d13e5c4 with merge ee97564...

@bors
Copy link
Contributor

bors commented May 12, 2024

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing ee97564 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 12, 2024
@bors bors merged commit ee97564 into rust-lang:master May 12, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 12, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ee97564): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.9% [3.9%, 3.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.3% [-4.3%, -4.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-4.3%, 3.9%] 2

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 676.399s -> 675.636s (-0.11%)
Artifact size: 315.85 MiB -> 315.95 MiB (0.03%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. PG-exploit-mitigations Project group: Exploit mitigations 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.

None yet

7 participants