Skip to content

Conversation

compiler-errors
Copy link
Member

Getting closer to being able to uplift the whole solver 🙏

Each commit should be self-justifying.

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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jun 14, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jun 14, 2024

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

@compiler-errors compiler-errors changed the title More uplifting More preparation for new trait solver uplifting Jun 14, 2024
#[cfg_attr(feature = "nightly", derive(HashStable_NoContext))]
pub struct ExternalConstraintsData<I: Interner> {
pub region_constraints: Vec<ty::OutlivesPredicate<I, I::GenericArg>>,
pub opaque_types: Vec<(I::LocalDefId, I::GenericArgs, I::Ty)>,
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only debatable thing -- I destructured OpaqueTypeKey into I::LocalDefId and I::GenericArgs. I could uplift OpaqueTypeKey I guess, but it seemed like an implementation detail.

Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I dislike it :< 😅 tuples with 3 elements are questionable

I would prefer uplifting OpaqueTypeKey though I feel like maybe we should rename it to LocalOpaqueTy or even LocalAliasTy?

Copy link
Member Author

Choose a reason for hiding this comment

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

Okie

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.

happy with this PR except for the OpaqueTypeKey removal 🤔 unless uplifting it is annoying, I would prefer doing that

@rust-log-analyzer

This comment has been minimized.

}

impl<I: Interner> OpaqueTypeKey<I> {
pub fn iter_captured_args(self, tcx: I) -> impl Iterator<Item = (usize, I::GenericArg)> {
Copy link
Member Author

@compiler-errors compiler-errors Jun 15, 2024

Choose a reason for hiding this comment

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

That + IntoIterator<Item: Deref<Target = ty::Variance>> bound is required for VariancesOf because we can't return an RPIT that borrows from a local, which it does if we were to call <[_]>::iter().

I think I'd like to eventually make a trait that's like IntoIterator but which consolidates ty::List and &[_] with a single into_iter() function, and always returns the copied version of the data. Like something to turn &[Ty] into an iterator of Ty not Ty.

@bors
Copy link
Collaborator

bors commented Jun 16, 2024

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

@lcnr
Copy link
Contributor

lcnr commented Jun 17, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 17, 2024

📌 Commit ff154c7 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 Jun 17, 2024
@bors
Copy link
Collaborator

bors commented Jun 17, 2024

⌛ Testing commit ff154c7 with merge e23ae72...

@bors
Copy link
Collaborator

bors commented Jun 17, 2024

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 17, 2024
@bors bors merged commit e23ae72 into rust-lang:master Jun 17, 2024
@rustbot rustbot added this to the 1.81.0 milestone Jun 17, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e23ae72): 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 (primary 3.5%, secondary 6.6%)

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

Cycles

Results (secondary 4.2%)

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)
4.2% [3.3%, 5.9%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 671.506s -> 671.588s (0.01%)
Artifact size: 320.50 MiB -> 319.89 MiB (-0.19%)

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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants