Skip to content
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

Spell out other trait diagnostic #126127

Merged
merged 1 commit into from
Jun 16, 2024
Merged

Conversation

Alexendoo
Copy link
Member

I recently saw somebody confused about the diagnostic thinking it was suggesting to add an as cast. This change is longer but I think it's clearer

@rustbot
Copy link
Collaborator

rustbot commented Jun 7, 2024

r? @pnkfelix

rustbot has assigned @pnkfelix.
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 Jun 7, 2024
@pnkfelix
Copy link
Member

I think the diagnostic output here is meant to be indicative of the UFCS form: https://doc.rust-lang.org/reference/expressions/call-expr.html#disambiguating-function-calls

I'd be hestitant to rewrite this output without weighing that tradeoff

@Alexendoo
Copy link
Member Author

TraitRef is used elsewhere to construct qualified paths in other diagnostics, but here it feels a bit misleading. The message says it's listing types but on its own these are not valid types

@pnkfelix
Copy link
Member

fair enough

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 11, 2024

📌 Commit 79dd1ca has been approved by pnkfelix

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 11, 2024
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 12, 2024
…elix

Spell out other trait diagnostic

I recently saw somebody confused about the diagnostic thinking it was suggesting to add an `as` cast. This change is longer but I think it's clearer
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 12, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#123374 (DOC: Add FFI example for slice::from_raw_parts())
 - rust-lang#126127 (Spell out other trait diagnostic)
 - rust-lang#126228 (Provide correct parent for nested anon const)
 - rust-lang#126249 (Simplify `[T; N]::try_map` signature)
 - rust-lang#126256 (Add {{target}} substitution to compiletest)
 - rust-lang#126263 (Make issue-122805.rs big endian compatible)

r? `@ghost`
`@rustbot` modify labels: rollup
@workingjubilee
Copy link
Member

failed in #126297 (comment) it seems

@bors r-

@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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 12, 2024
@rust-log-analyzer

This comment has been minimized.

@Alexendoo
Copy link
Member Author

Rebased to cover the new test cases

@workingjubilee
Copy link
Member

@bors r=pnkfelix

@bors
Copy link
Contributor

bors commented Jun 15, 2024

📌 Commit d0112c6 has been approved by pnkfelix

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 15, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 16, 2024
Rollup of 4 pull requests

Successful merges:

 - rust-lang#125112 (Document behavior of `create_dir_all` wrt. empty path)
 - rust-lang#126127 (Spell out other trait diagnostic)
 - rust-lang#126309 (unify git command preperation)
 - rust-lang#126539 (Update `Arc::try_unwrap()` docs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 936d760 into rust-lang:master Jun 16, 2024
12 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 16, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 16, 2024
Rollup merge of rust-lang#126127 - Alexendoo:other-trait-diag, r=pnkfelix

Spell out other trait diagnostic

I recently saw somebody confused about the diagnostic thinking it was suggesting to add an `as` cast. This change is longer but I think it's clearer
@Alexendoo Alexendoo deleted the other-trait-diag branch June 16, 2024 12:52
# for free to join this conversation on GitHub. Already have an account? # 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