-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Improve diagnostic output of non_local_definitions
lint
#125089
Conversation
This comment has been minimized.
This comment has been minimized.
0c69265
to
2819950
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feel free to "nah actually" I am just trying to throw a couple wording ideas at the wall.
I pushed several more commits that tries to improve the clarity the message were are trying to pass, mainly by moving the "move help message" to a separate span with some labels.
|
9a5bb1f
to
a39cf37
Compare
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
I continued to improved the diagnostic output by adding labels that points to Self type and Trait to better put emphasis on the fact that they are non-local for the lint. With the example in #125068 (comment), it now gives:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's quite a bit of code that I need to continue reviewing, but I have some nitpicks based on the output.
abefe35
to
5044fb6
Compare
All the review comments have been addressed or have been replied to. @rustbot ready |
☔ The latest upstream changes (presumably #124417) made this pull request unmergeable. Please resolve the merge conflicts. |
5044fb6
to
7236f18
Compare
@estebank could you give this PR another review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick in wording, beyond that this is ready to land.
- Restrict const-anon exception diag to relevant places - Invoke bounds (and type-inference) in non_local_defs - Specialize diagnostic for impl without Trait
7236f18
to
c7d3004
Compare
@bors r+ |
…=estebank Improve diagnostic output the `non_local_definitions` lint This PR improves (or at least tries to improve) the diagnostic output the `non_local_definitions` lint, by simplifying the wording, by adding a "sort of" explanation of bounds interaction that leak the impl... This PR is best reviewed commit by commit and is voluntarily made a bit vague as to have a starting point to improve on. Related to https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/non_local_defs.20wording.20improvements Fixes rust-lang#125068 Fixes rust-lang#124396 cc `@workingjubilee` r? `@estebank`
…=estebank Improve diagnostic output the `non_local_definitions` lint This PR improves (or at least tries to improve) the diagnostic output the `non_local_definitions` lint, by simplifying the wording, by adding a "sort of" explanation of bounds interaction that leak the impl... This PR is best reviewed commit by commit and is voluntarily made a bit vague as to have a starting point to improve on. Related to https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/non_local_defs.20wording.20improvements Fixes rust-lang#125068 Fixes rust-lang#124396 cc ``@workingjubilee`` r? ``@estebank``
…kingjubilee Rollup of 4 pull requests Successful merges: - rust-lang#125089 (Improve diagnostic output the `non_local_definitions` lint) - rust-lang#125343 (`-Znext-solver`: eagerly normalize when adding goals) - rust-lang#125411 (check host's libstdc++ version when using ci llvm) - rust-lang#125551 (Stabilise `IpvNAddr::{BITS, to_bits, from_bits}` (`ip_bits`)) r? `@ghost` `@rustbot` modify labels: rollup
non_local_definitions
lintnon_local_definitions
lint
…kingjubilee Rollup of 5 pull requests Successful merges: - rust-lang#125089 (Improve diagnostic output the `non_local_definitions` lint) - rust-lang#125343 (`-Znext-solver`: eagerly normalize when adding goals) - rust-lang#125551 (Stabilise `IpvNAddr::{BITS, to_bits, from_bits}` (`ip_bits`)) - rust-lang#125640 (Don't suggest turning non-char-literal exprs of ty `char` into string literals) - rust-lang#125647 (update tracking issue for lazy_cell_consume) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#125089 - Urgau:non_local_def-suggestions, r=estebank Improve diagnostic output the `non_local_definitions` lint This PR improves (or at least tries to improve) the diagnostic output the `non_local_definitions` lint, by simplifying the wording, by adding a "sort of" explanation of bounds interaction that leak the impl... This PR is best reviewed commit by commit and is voluntarily made a bit vague as to have a starting point to improve on. Related to https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/non_local_defs.20wording.20improvements Fixes rust-lang#125068 Fixes rust-lang#124396 cc ```@workingjubilee``` r? ```@estebank```
…ge, r=estebank Indicate in `non_local_defs` lint that the macro needs to change This PR adds a note to indicate that the macro needs to change in the `non_local_definitions` lint output. Address rust-lang#125089 (comment) Fixes rust-lang#125681 r? `@estebank`
…ge, r=estebank Indicate in `non_local_defs` lint that the macro needs to change This PR adds a note to indicate that the macro needs to change in the `non_local_definitions` lint output. Address rust-lang#125089 (comment) Fixes rust-lang#125681 r? ``@estebank``
…ge, r=estebank Indicate in `non_local_defs` lint that the macro needs to change This PR adds a note to indicate that the macro needs to change in the `non_local_definitions` lint output. Address rust-lang#125089 (comment) Fixes rust-lang#125681 r? ```@estebank```
…ge, r=estebank Indicate in `non_local_defs` lint that the macro needs to change This PR adds a note to indicate that the macro needs to change in the `non_local_definitions` lint output. Address rust-lang#125089 (comment) Fixes rust-lang#125681 r? ````@estebank````
…ge, r=estebank Indicate in `non_local_defs` lint that the macro needs to change This PR adds a note to indicate that the macro needs to change in the `non_local_definitions` lint output. Address rust-lang#125089 (comment) Fixes rust-lang#125681 r? `````@estebank`````
…ge, r=estebank Indicate in `non_local_defs` lint that the macro needs to change This PR adds a note to indicate that the macro needs to change in the `non_local_definitions` lint output. Address rust-lang#125089 (comment) Fixes rust-lang#125681 r? ``````@estebank``````
…, r=estebank Indicate in `non_local_defs` lint that the macro needs to change This PR adds a note to indicate that the macro needs to change in the `non_local_definitions` lint output. Address rust-lang#125089 (comment) Fixes rust-lang#125681 r? `@estebank`
Indicate in `non_local_defs` lint that the macro needs to change This PR adds a note to indicate that the macro needs to change in the `non_local_definitions` lint output. Address rust-lang/rust#125089 (comment) Fixes #125681 r? `@estebank`
Indicate in `non_local_defs` lint that the macro needs to change This PR adds a note to indicate that the macro needs to change in the `non_local_definitions` lint output. Address rust-lang/rust#125089 (comment) Fixes #125681 r? `@estebank`
Indicate in `non_local_defs` lint that the macro needs to change This PR adds a note to indicate that the macro needs to change in the `non_local_definitions` lint output. Address rust-lang/rust#125089 (comment) Fixes #125681 r? `@estebank`
This PR improves (or at least tries to improve) the diagnostic output of
non_local_definitions
lint, by simplifying the wording, by adding a "sort of" explanation of bounds interaction that leak the impl...This PR is best reviewed commit by commit and is voluntarily made a bit vague as to have a starting point to improve on.
Related to https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/non_local_defs.20wording.20improvements
Fixes #125068
Fixes #124396
cc @workingjubilee
r? @estebank