-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Help for missing trait method suggests unstable code #98562
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Noratrieb
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Apr 5, 2023
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 28, 2023
fix(suggestion): insert projection to associated types Fixes rust-lang#98562 This PR has fixed some help suggestions for unsupported syntax, such as `fn f<T>(_:T) where T: IntoIterator, std::iter::IntoIterator::Item = () {}` to `fn f<T: IntoIterator<Item = ()>>(_T) {}`.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 29, 2023
Rollup merge of rust-lang#112123 - bvanjoi:fix-98562, r=compiler-errors fix(suggestion): insert projection to associated types Fixes rust-lang#98562 This PR has fixed some help suggestions for unsupported syntax, such as `fn f<T>(_:T) where T: IntoIterator, std::iter::IntoIterator::Item = () {}` to `fn f<T: IntoIterator<Item = ()>>(_T) {}`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
Playground
I expected to see this happen: an error which either just shows the error itself or the compilable sugestion for change.
Instead, this happened: the error is like following:
Now, if I add the code from the
help
block into the trait, I'll get another error:The first one is the one I'm worried about, since it shows that the suggest was using a nightly-only feature on stable.
Noting also that rust-analyzer seems to do this correctly - it creates an intention to insert
fn sum<I: Iterator<Item = i32>>(_: I) { todo!(); }
, which compiles immediately.The text was updated successfully, but these errors were encountered: