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

Add def path data variant #104648

Closed

Conversation

spastorino
Copy link
Member

This one should be merged after #104615

r? @compiler-errors

@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 20, 2022
@spastorino
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

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

bors commented Nov 20, 2022

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout add-def-path-data-variant (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self add-def-path-data-variant --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging compiler/rustc_trait_selection/src/traits/project.rs
Auto-merging compiler/rustc_trait_selection/src/traits/object_safety.rs
CONFLICT (content): Merge conflict in compiler/rustc_trait_selection/src/traits/object_safety.rs
Auto-merging compiler/rustc_resolve/src/def_collector.rs
Auto-merging compiler/rustc_passes/src/check_attr.rs
Auto-merging compiler/rustc_middle/src/ty/print/pretty.rs
Auto-merging compiler/rustc_middle/src/ty/mod.rs
Auto-merging compiler/rustc_middle/src/ty/error.rs
Auto-merging compiler/rustc_hir_analysis/src/check/compare_method.rs
Auto-merging compiler/rustc_hir_analysis/src/check/check.rs
Auto-merging compiler/rustc_hir_analysis/src/astconv/mod.rs
Auto-merging compiler/rustc_ast_lowering/src/lib.rs
Automatic merge failed; fix conflicts and then commit the result.

@spastorino
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@bors
Copy link
Contributor

bors commented Nov 20, 2022

⌛ Trying commit 4c65464ed1c5a2bfb507ac05929ba0aecb34102b with merge e8579d4778471621b7779a36e65222948cbbaa63...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 20, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 20, 2022
Copy link
Contributor

@cjgillot cjgillot left a comment

Choose a reason for hiding this comment

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

I'm not sure what the motivation is. Could you elaborate on what this helps with? Why isn't a DefKind variant not enough?

/// An `impl Trait` type node inside a `trait` or inside an `impl` of a `trait`.
/// On a `trait` the value is `(trait_fn_def_id, None)`.
/// On an `impl` the value is `(impl_fn_def_id, Some(trait_rpit_def_id))`.
ImplTraitInTrait(DefId, Option<DefId>),
Copy link
Contributor

Choose a reason for hiding this comment

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

This may cause issues with incremental compilation. DefPathData is hashed using Hash and not StableHasher. This means that we may change the DefPathHash when DefIndices are re-numbered, which is what DefPathHash is supposed to avoid.

&& let DefPathData::ImplTraitInTrait(fn_def_id, of_trait) =
def_path_data.data
{
Some((fn_def_id, of_trait))
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be implemented by walking self.parent until we find a ValueNs? As for of_trait I haven't seen it used anywhere, could it be computed from fn_def_id?

@cjgillot cjgillot self-assigned this Nov 20, 2022
@spastorino
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@bors
Copy link
Contributor

bors commented Nov 21, 2022

⌛ Trying commit 41ef0554d171a62e0bf13d4f8156109f4f755de9 with merge ce79ba7e68d9b7fa6b693bc310d989b1099eb019...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 21, 2022

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

@spastorino
Copy link
Member Author

We don't need to use this hack anymore as #104940 was r+ed.

@spastorino spastorino closed this Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-perf Status: Waiting on a perf run to be completed. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants