Add more information to impl Trait error#92806
Merged
bors merged 2 commits intorust-lang:masterfrom Feb 19, 2022
Merged
Conversation
Contributor
Author
|
Alternatively we can disambiguate #92458 by just adding that word "inherent", without adding these |
Collaborator
|
☔ The latest upstream changes (presumably #92007) made this pull request unmergeable. Please resolve the merge conflicts. |
estebank
approved these changes
Feb 17, 2022
Contributor
estebank
left a comment
There was a problem hiding this comment.
Couple of nitpicks, r=me after rebasing
Comment on lines
1403
to
1406
Contributor
There was a problem hiding this comment.
I'm concerned about "inherent" in this wording not being too clear. "associated functions" doesn't communicate the same meaning, sadly. Either way, I would likely change this to be
Suggested change
| "`impl Trait` not allowed outside of \ | |
| function and inherent method return types", | |
| ); | |
| err.note(&format!("found `impl Trait` in {}", position)); | |
| "`impl Trait` only allowed in function and inherent method return types, not in {}", position | |
| ); |
Contributor
There was a problem hiding this comment.
Suggested change
| ImplTraitPosition::Variable => "variable", | |
| ImplTraitPosition::Variable => "variable binding", |
81916d6 to
207fb5f
Compare
Contributor
Author
|
Rebased and addressed comments, ready for r+ |
Contributor
Author
|
@rustbot ready |
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit 207fb5f has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 19, 2022
…askrgr Rollup of 10 pull requests Successful merges: - rust-lang#89892 (Suggest `impl Trait` return type when incorrectly using a generic return type) - rust-lang#91675 (Add MemTagSanitizer Support) - rust-lang#92806 (Add more information to `impl Trait` error) - rust-lang#93497 (Pass `--test` flag through rustdoc to rustc so `#[test]` functions can be scraped) - rust-lang#93814 (mips64-openwrt-linux-musl: correct soft-foat) - rust-lang#93847 (kmc-solid: Use the filesystem thread-safety wrapper) - rust-lang#93877 (asm: Allow the use of r8-r14 as clobbers on Thumb1) - rust-lang#93892 (Only mark projection as ambiguous if GAT substs are constrained) - rust-lang#93915 (Implement --check-cfg option (RFC 3013), take 2) - rust-lang#93953 (Add the `known-bug` test directive, use it, and do some cleanup) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #92458
Let me know if I went overboard here, or if the suggestions could use some refinement.
r? @estebank
Feel free to reassign to someone else