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

Encode implied predicates for traits #122891

Merged

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Mar 22, 2024

In #112629, we decided to make associated type bounds in the "supertrait" AST position implied even though they're not supertraits themselves.

This means that the super_predicates and implied_predicates queries now differ for regular traits. The assumption that they didn't differ was hard-coded in #107614, so in cross-crate positions this means that we forget the implied predicates from associated type bounds.

This isn't unsound, just kind of annoying. This should be backported since associated type bounds are slated to stabilize for 1.78 -- either that, or associated type bounds can be reverted on beta and re-shipped in 1.79 with this patch.

Fixes #122859

With associated type bounds enabled, the implied_predicates and super_predicates
queries may differ for traits, since associated type bounds are also
implied but are not counted as super predicates.
@rustbot
Copy link
Collaborator

rustbot commented Mar 22, 2024

r? @Nadrieril

rustbot has assigned @Nadrieril.
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 Mar 22, 2024
@compiler-errors
Copy link
Member Author

r? @oli-obk

@rustbot rustbot assigned oli-obk and unassigned Nadrieril Mar 22, 2024
@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

if this ends up being a lot of work, I can make it so that we only encode implied predicates if they differ from super predicates.

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 22, 2024
@bors
Copy link
Contributor

bors commented Mar 22, 2024

⌛ Trying commit 3361488 with merge b350b0b...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 22, 2024
…cates-always, r=<try>

Encode implied predicates for traits

In rust-lang#112629, we decided to make associated type bounds in the "supertrait" AST position *implied* even though they're not supertraits themselves.

This means that the `super_predicates` and `implied_predicates` queries now differ for regular traits. The assumption that they didn't differ was hard-coded in rust-lang#107614, so in cross-crate positions this means that we forget the implied predicates from associated type bounds.

This isn't unsound, just kind of annoying. This should be backported since associated type bounds are slated to stabilize for 1.78 -- either that, or associated type bounds can be reverted on beta and re-shipped in 1.79 with this patch.

Fixes rust-lang#122859
@compiler-errors compiler-errors added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Mar 22, 2024
@bors
Copy link
Contributor

bors commented Mar 22, 2024

☀️ Try build successful - checks-actions
Build commit: b350b0b (b350b0bacc17017632f1c6ffe90c01021245b1b8)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b350b0b): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking 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
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.5% [1.5%, 1.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

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

Cycles

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.8% [-6.8%, -6.8%] 1
All ❌✅ (primary) - - 0

Binary size

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)
0.1% [0.0%, 0.5%] 97
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.5%] 97

Bootstrap: 669.525s -> 671.037s (0.23%)
Artifact size: 314.91 MiB -> 315.07 MiB (0.05%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 22, 2024
@slanterns
Copy link
Contributor

slanterns commented Mar 23, 2024

associated type bounds are slated to stabilize for 1.78

I think the merge of ATB happens after the beta-cutoff, and it does not get into 1.78 beta?

@oli-obk
Copy link
Contributor

oli-obk commented Mar 23, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Mar 23, 2024

📌 Commit 3361488 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 Mar 23, 2024
@bors
Copy link
Contributor

bors commented Mar 24, 2024

⌛ Testing commit 3361488 with merge 6a92312...

@bors
Copy link
Contributor

bors commented Mar 24, 2024

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 6a92312 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 24, 2024
@bors bors merged commit 6a92312 into rust-lang:master Mar 24, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Mar 24, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6a92312): 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)

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

Cycles

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)
0.8% [0.8%, 0.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.8% [0.8%, 0.8%] 1

Binary size

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)
0.1% [0.0%, 0.5%] 97
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.5%] 97

Bootstrap: 669.922s -> 670.64s (0.11%)
Artifact size: 315.00 MiB -> 315.10 MiB (0.03%)

RenjiSann pushed a commit to RenjiSann/rust that referenced this pull request Mar 25, 2024
…cates-always, r=oli-obk

Encode implied predicates for traits

In rust-lang#112629, we decided to make associated type bounds in the "supertrait" AST position *implied* even though they're not supertraits themselves.

This means that the `super_predicates` and `implied_predicates` queries now differ for regular traits. The assumption that they didn't differ was hard-coded in rust-lang#107614, so in cross-crate positions this means that we forget the implied predicates from associated type bounds.

This isn't unsound, just kind of annoying. This should be backported since associated type bounds are slated to stabilize for 1.78 -- either that, or associated type bounds can be reverted on beta and re-shipped in 1.79 with this patch.

Fixes rust-lang#122859
@apiraino
Copy link
Contributor

apiraino commented Apr 4, 2024

Beta backport accepted as per compiler team on Zulip. A backport PR will be authored by the release team at the end of the current development cycle.

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Apr 4, 2024
@cuviper
Copy link
Member

cuviper commented Apr 4, 2024

This should be backported since associated type bounds are slated to stabilize for 1.78

The backported test fails, error[E0658]: associated type bounds are unstable -- I think it's only in 1.79 per #122055. Should we cancel this backport? or just add #![feature(associated_type_bounds)] to the backported test?

@cuviper
Copy link
Member

cuviper commented Apr 4, 2024

Removing the backport after the followup on zulip.

@rustbot label -beta-nominated -beta-accepted

@rustbot rustbot removed beta-nominated Nominated for backporting to the compiler in the beta channel. beta-accepted Accepted for backporting to the compiler in the beta channel. labels Apr 4, 2024
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. 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.

Implied bound not implied across crates
9 participants