-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add bidirectional where clauses on RPITIT synthesized GATs #112682
Conversation
}; | ||
|
||
for (arg, dup_def) in bidir_outlives { | ||
let orig_region = icx.astconv().ast_region_to_region(arg, None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@compiler-errors you told me that this could be done using named_region
or something like that. I was reusing this idea https://github.com/rust-lang/rust/pull/112682/files#diff-6d9f47a8bce6ee31fd3e867514607c8503a11cf91616ce418393ba9304a22c16R435. In case Github doesn't take you there line 435 on the right side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you meant named_bound_var
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's fine. I think using named_bound_var
might be easier but I guess it doesn't matter.
This comment has been minimized.
This comment has been minimized.
078cd4d
to
6a23bc7
Compare
This comment has been minimized.
This comment has been minimized.
6a23bc7
to
c4673ad
Compare
This comment has been minimized.
This comment has been minimized.
2b477dd
to
8861526
Compare
This comment has been minimized.
This comment has been minimized.
8861526
to
daa9d3a
Compare
compiler/rustc_hir/src/hir.rs
Outdated
static_assert_size!(Item<'_>, 80); | ||
static_assert_size!(ItemKind<'_>, 48); | ||
static_assert_size!(Item<'_>, 88); | ||
static_assert_size!(ItemKind<'_>, 56); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@compiler-errors this is ungreat :). Unsure how bad would be the impact, we should probably move bidir_outlives
out from the OpaqueTy
variant or came up with better ideas to improve the size of ItemKind
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could intern the use of OpaqueTy
in https://github.com/rust-lang/rust/blob/b425640d7552a352bb8a10f766c437204ba28b60/compiler/rustc_hir/src/hir.rs#L3314 (make it &'hir OpaqueTy<'hir>
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is the best way of doing it.
This comment has been minimized.
This comment has been minimized.
…nd-region-debug, r=compiler-errors Print def_id on EarlyBoundRegion debug It's not the first time that I can't make sense out of the default debug print on `EarlyBoundRegion`. As I was working on rust-lang#112682 I needed this. I was doing some git archeology and found that we used to print everything https://github.com/spastorino/rust/blob/dfbc9608ce5c9655a36b63f6cc9694f5e4ad9890/src/librustc/util/ppaux.rs#L425-L430 but we lost the ability in some refactor midway.
Finished benchmarking commit (0c07919285caf69c4888d889cd23b4f62578282f): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 663.81s -> 660.746s (-0.46%) |
@compiler-errors now I think this is ready to merge. Perf is back to normal. |
I still need to review this for correctness, but yeah, I saw the perf results. |
cffa606
to
781cb3f
Compare
Rebased ☝️ after conflicts on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename bidir_outlives
in the hir::OpaqueTy
to something like lifetime_mapping
, and add a doc comment that explains what it is, and note that it's only populated if in_trait
is true (because it's unneeded for other opaques)?
r=me after that and the nits below
781cb3f
to
6f4a51e
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (3307274): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 660.993s -> 662.146s (0.17%) |
…-errors Replace RPITIT current impl with new strategy that lowers as a GAT This PR replaces the current implementation of RPITITs with the new implementation that we had under -Zlower-impl-trait-in-trait-to-assoc-ty flag that lowers the RPIT as a GAT on the trait and on the impls that implement that trait. Opening this PR as a draft because this goes after rust-lang#112682, ~rust-lang#112981~ and ~rust-lang#112983~. As soon as those are merged, I can rebase and we should run perf, crater and test a lot. r? `@compiler-errors`
Given the following:
We need the desugaring to be:
This PR adds the where clauses for the
MyFn
generated GATs.This is a draft with a very ugly solution so we can make comments over concrete code.
r? @compiler-errors