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

Rename some FulfillmentErrorCode/ObligationCauseCode variants to be less redundant #124952

Merged
merged 5 commits into from
May 10, 2024

Conversation

compiler-errors
Copy link
Member

  1. Rename some FulfillmentErrorCode variants.
  2. Always use ObligationCauseCode:: to prefix a code, rather than using a glob import and naming them through traits::.
  3. Rename some ObligationCauseCode variants -- I wasn't particularly thorough with thinking of a new names for these, so could workshop them if necessary.
  4. Misc stuff from renaming.

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 May 10, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 10, 2024

Some changes occurred to the core trait solver

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

changes to the core type system

cc @compiler-errors, @lcnr

@compiler-errors compiler-errors changed the title No error Rename some FulfillmentErrorCode/ObligationCauseCode variants to be less redundant May 10, 2024
@@ -256,20 +249,20 @@ pub enum ObligationCauseCode<'tcx> {

/// Must satisfy all of the where-clause predicates of the
/// given item.
ItemObligation(DefId),
MiscItem(DefId),
Copy link
Member Author

Choose a reason for hiding this comment

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

Alternative could be WhereClause, and then SpannedWhereClause, etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, I actually like WhereClause better

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.

same suggestons, otherwise r=me

Comment on lines +252 to +256
WhereClause(DefId),

/// Like `ItemObligation`, but carries the span of the
/// Like `WhereClause`, but carries the span of the
/// predicate when it can be identified.
BindingObligation(DefId, Span),
SpannedWhereClause(DefId, Span),
Copy link
Contributor

Choose a reason for hiding this comment

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

could you instead change this to WhereClause(DefId, Option<Span>)? and change the matches to WhereClause(whatever, Some(span))?

Comment on lines +262 to +265
WhereClauseInExpr(DefId, HirId, usize),

/// Combines `ExprItemObligation` and `BindingObligation`.
ExprBindingObligation(DefId, Span, HirId, usize),
/// Combines `SpannedWhereClause` and `WhereClauseInExpr`.
SpannedWhereClauseInExpr(DefId, Span, HirId, usize),
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@bors
Copy link
Contributor

bors commented May 10, 2024

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

@compiler-errors
Copy link
Member Author

@bors r=lcnr rollup p=1 (bitrotty)

@bors
Copy link
Contributor

bors commented May 10, 2024

📌 Commit 6f77bfe 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 10, 2024
@bors
Copy link
Contributor

bors commented May 10, 2024

⌛ Testing commit 6f77bfe with merge 2cce088...

@bors
Copy link
Contributor

bors commented May 10, 2024

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

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

Finished benchmarking commit (2cce088): 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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.9% [-3.9%, -3.9%] 1
All ❌✅ (primary) - - 0

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

Binary size

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

Bootstrap: 676.223s -> 673.906s (-0.34%)
Artifact size: 315.83 MiB -> 315.77 MiB (-0.02%)

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.

5 participants