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

Give more details in Display for hir::Target #95108

Merged
merged 1 commit into from
Mar 20, 2022

Conversation

scottmcm
Copy link
Member

@scottmcm scottmcm commented Mar 19, 2022

Made because I was making a code change and got a very confusing "should be applied to a method, not a method" error.

error[E0718]: `into_try_type` language item must be applied to a method
   --> library\core\src\ops\try_trait.rs:352:32
    |
352 |     #[cfg_attr(not(bootstrap), lang = "into_try_type")]
    |                                ^^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a method, not a method

With this change the error is more actionable

error[E0718]: `into_try_type` language item must be applied to a required trait method
   --> library\core\src\ops\try_trait.rs:352:32
    |
352 |     #[cfg_attr(not(bootstrap), lang = "into_try_type")]
    |                                ^^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a required trait method, not a provided trait method

Made because I was making a code change and got a very confusing "should be applied to a method, not a method" error.

```
error[E0718]: `into_try_type` language item must be applied to a method
   --> library\core\src\ops\try_trait.rs:352:32
    |
352 |     #[cfg_attr(not(bootstrap), lang = "into_try_type")]
    |                                ^^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a method, not a method
```
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 19, 2022
@rust-highfive
Copy link
Collaborator

r? @wesleywiser

(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 Mar 19, 2022
@Dylan-DPC
Copy link
Member

r? @Dylan-DPC

@Dylan-DPC
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 19, 2022

📌 Commit 1338a45 has been approved by Dylan-DPC

@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 Mar 19, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Mar 19, 2022
…Dylan-DPC

Give more details in `Display` for `hir::Target`

Made because I was making a code change and got a very confusing "should be applied to a method, not a method" error.

```
error[E0718]: `into_try_type` language item must be applied to a method
   --> library\core\src\ops\try_trait.rs:352:32
    |
352 |     #[cfg_attr(not(bootstrap), lang = "into_try_type")]
    |                                ^^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a method, not a method
```

With this change the error is more actionable

```
error[E0718]: `into_try_type` language item must be applied to a required trait method
   --> library\core\src\ops\try_trait.rs:352:32
    |
352 |     #[cfg_attr(not(bootstrap), lang = "into_try_type")]
    |                                ^^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a required trait method, not a provided trait method
```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 19, 2022
…Dylan-DPC

Give more details in `Display` for `hir::Target`

Made because I was making a code change and got a very confusing "should be applied to a method, not a method" error.

```
error[E0718]: `into_try_type` language item must be applied to a method
   --> library\core\src\ops\try_trait.rs:352:32
    |
352 |     #[cfg_attr(not(bootstrap), lang = "into_try_type")]
    |                                ^^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a method, not a method
```

With this change the error is more actionable

```
error[E0718]: `into_try_type` language item must be applied to a required trait method
   --> library\core\src\ops\try_trait.rs:352:32
    |
352 |     #[cfg_attr(not(bootstrap), lang = "into_try_type")]
    |                                ^^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a required trait method, not a provided trait method
```
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 20, 2022
…askrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#94749 (remove_dir_all: use fallback implementation on Miri)
 - rust-lang#94948 (Fix diagnostics for `#![feature(deprecated_suggestion)]`)
 - rust-lang#94989 (Add Stream alias for AsyncIterator)
 - rust-lang#95108 (Give more details in `Display` for `hir::Target`)
 - rust-lang#95110 (Provide more useful documentation of conversion methods)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 355d878 into rust-lang:master Mar 20, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 20, 2022
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants