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

Misleading error message for remove explicit elided lifetime #127585

Open
UkoeHB opened this issue Jul 10, 2024 · 0 comments
Open

Misleading error message for remove explicit elided lifetime #127585

UkoeHB opened this issue Jul 10, 2024 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@UkoeHB
Copy link

UkoeHB commented Jul 10, 2024

Code

This branch has a compile error: https://github.com/UkoeHB/bevy_cobweb_ui/tree/elided_lifetime

Current output

return type references an anonymous lifetime, which is not constrained by the fn input types
lifetimes appearing in an associated or opaque type are not considered constrained
consider introducing a named lifetime parameter

Desired output

It should point to the `Reader<'_>` and tell me to remove `<'_>`.

Rationale and extra context

This is the Bevy PR that caused the issue: bevyengine/bevy#14082 . See bevyengine/bevy#14082 (comment) .
The only change relevant here was &mut Reader -> &mut dyn Reader.

Other cases

No response

Rust Version

rustc 1.79.0 (129f3b996 2024-06-10)
binary: rustc
commit-hash: 129f3b9964af4d4a709d1383930ade12dfe7c081
commit-date: 2024-06-10
host: aarch64-apple-darwin
release: 1.79.0
LLVM version: 18.1.7

Anything else?

No response

@UkoeHB UkoeHB added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 10, 2024
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 T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

1 participant