Skip to content

Conversation

compiler-errors
Copy link
Member

  1. Stop using the InstantiatedPredicates struct for hybrid_preds in compare_impl_item.rs, since we never actually push anything into the spans part of it.
  2. Remove redundant impl args and don't do useless identity substitution, prefer calling instantiate_identity.

@rustbot
Copy link
Collaborator

rustbot commented Oct 20, 2024

r? @estebank

rustbot has assigned @estebank.
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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Oct 20, 2024
@compiler-errors compiler-errors changed the title Compare pred entail Minor tweaks to compare_impl_item.rs Oct 20, 2024
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

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

6/7 suggestions are for preexisting warts. Would be cool if you could incorporate them in this PR but it's not a must :^).

otherwise r=me

let trait_to_placeholder_args =
impl_to_placeholder_args.rebase_onto(tcx, impl_m.container_id(tcx), trait_to_impl_args);
debug!("compare_impl_method: trait_to_placeholder_args={:?}", trait_to_placeholder_args);
let trait_to_impl_args = GenericArgs::identity_for_item(tcx, impl_m.def_id).rebase_onto(
Copy link
Member

Choose a reason for hiding this comment

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

(preexisting) wouldn't impl_m_args or impl_item_args be a better fit over trait_to_impl_args? the trait args aren't actually involved

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that would be confusing because after this renaming, we'd be instantiating impl_m_predicates with identity args, and trait_m_predicates with impl_m_args...

Copy link
Member Author

Choose a reason for hiding this comment

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

I frankly think that trait_to_impl args is the right name; it's the set of arguments being used to map things parameterized over the trait method's args to the impl method.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough, makes sense

@fmease fmease assigned fmease and unassigned estebank Oct 22, 2024
@fmease fmease 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 Oct 22, 2024
@compiler-errors
Copy link
Member Author

I don't agree with the name change, so I haven't addressed it. I changed a bunch of debugs with their more tracing-native variants.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 23, 2024
@fmease
Copy link
Member

fmease commented Oct 23, 2024

Makes sense, thanks!
@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 23, 2024

📌 Commit 21d95fb has been approved by fmease

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 Oct 23, 2024
fmease added a commit to fmease/rust that referenced this pull request Oct 23, 2024
…l, r=fmease

Minor tweaks to `compare_impl_item.rs`

1. Stop using the `InstantiatedPredicates` struct for `hybrid_preds` in `compare_impl_item.rs`, since we never actually push anything into the `spans` part of it.
2. Remove redundant impl args and don't do useless identity substitution, prefer calling `instantiate_identity`.
fmease added a commit to fmease/rust that referenced this pull request Oct 23, 2024
…l, r=fmease

Minor tweaks to `compare_impl_item.rs`

1. Stop using the `InstantiatedPredicates` struct for `hybrid_preds` in `compare_impl_item.rs`, since we never actually push anything into the `spans` part of it.
2. Remove redundant impl args and don't do useless identity substitution, prefer calling `instantiate_identity`.
fmease added a commit to fmease/rust that referenced this pull request Oct 23, 2024
…l, r=fmease

Minor tweaks to `compare_impl_item.rs`

1. Stop using the `InstantiatedPredicates` struct for `hybrid_preds` in `compare_impl_item.rs`, since we never actually push anything into the `spans` part of it.
2. Remove redundant impl args and don't do useless identity substitution, prefer calling `instantiate_identity`.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 23, 2024
Rollup of 9 pull requests

Successful merges:

 - rust-lang#130991 (Vectorized SliceContains)
 - rust-lang#131928 (rustdoc: Document `markdown` module.)
 - rust-lang#131955 (Set `signext` or `zeroext` for integer arguments on RISC-V and LoongArch64)
 - rust-lang#131979 (Minor tweaks to `compare_impl_item.rs`)
 - rust-lang#132036 (Add a test case for rust-lang#131164)
 - rust-lang#132039 (Specialize `read_exact` and `read_buf_exact` for `VecDeque`)
 - rust-lang#132060 ("innermost", "outermost", "leftmost", and "rightmost" don't need hyphens)
 - rust-lang#132065 (Clarify documentation of `ptr::dangling()` function)
 - rust-lang#132066 (Fix a typo in documentation of `pointer::sub_ptr()`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6b70ff4 into rust-lang:master Oct 24, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 24, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 24, 2024
Rollup merge of rust-lang#131979 - compiler-errors:compare-pred-entail, r=fmease

Minor tweaks to `compare_impl_item.rs`

1. Stop using the `InstantiatedPredicates` struct for `hybrid_preds` in `compare_impl_item.rs`, since we never actually push anything into the `spans` part of it.
2. Remove redundant impl args and don't do useless identity substitution, prefer calling `instantiate_identity`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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