Skip to content

Account for incorrect where T::Assoc = Ty bound #91208

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 27, 2021

Conversation

estebank
Copy link
Contributor

Provide suggestoin to constrain trait bound for associated type.
Revert incorrect changes to missing-bounds test.

Address part of #20041.

@rust-highfive
Copy link
Contributor

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 25, 2021
Provide suggestoin to constrain trait bound for associated type.
Revert incorrect changes to `missing-bounds` test.

Address part of rust-lang#20041.
@camelid camelid added A-associated-items Area: Associated items (types, constants & functions) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 25, 2021
@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 27, 2021

📌 Commit 4954389 has been approved by cjgillot

@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 Nov 27, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 27, 2021
…askrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#83791 (Weaken guarantee around advancing underlying iterators in zip)
 - rust-lang#90995 (Document non-guarantees for Hash)
 - rust-lang#91057 (Expand `available_parallelism` docs in anticipation of cgroup quota support)
 - rust-lang#91062 (rustdoc: Consolidate static-file replacement mechanism)
 - rust-lang#91208 (Account for incorrect `where T::Assoc = Ty` bound)
 - rust-lang#91266 (Use non-generic inner function for pointer formatting)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7c5bcd5 into rust-lang:master Nov 27, 2021
@rustbot rustbot added this to the 1.59.0 milestone Nov 27, 2021
@finalchild
Copy link
Contributor

@estebank
I'm reading your code while migrating rustc_ast_passes to SessionDiagnostics. Can you help me understand which assumption I can make?

  • I'm confused about the use of if-let inside the for loop. Can there be multiple matches of param.ident == potential_param.ident?
  • Is pprust::path_to_string(&ast::Path::from_ident(potential_assoc.ident,)) necessary? Can't we use potential_assoc.ident.to_string()? They have similar behavior with raw identifiers at least.

@estebank
Copy link
Contributor Author

I'm confused about the use of if-let inside the for loop. Can there be multiple matches of param.ident == potential_param.ident?

There can potentially be more than one, but I guess it might be ok to only account for one.

Is pprust::path_to_string(&ast::Path::from_ident(potential_assoc.ident,)) necessary? Can't we use potential_assoc.ident.to_string()? They have similar behavior with raw identifiers at least.

I believe we used not to have to_string() for idents (or I just got confused back then).

@estebank estebank deleted the eq-constraint branch November 9, 2023 05:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-associated-items Area: Associated items (types, constants & functions) 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.

7 participants