-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Trait methods can return &T types without lifetimes #8841
Comments
Compare with issue #8309; |
Also a dup of #2478 I suspect |
Triage bump Still an issue and the example in the report is still valid. |
This is now an error or expected with lifetime elision, so closing. |
xFrednet
pushed a commit
to xFrednet/rust
that referenced
this issue
May 21, 2022
Remove code block from `pub_enum_variant_names` changelog: none Just noticed this empty code block that no other lint has 😄. ![old](https://user-images.githubusercontent.com/69764315/169314573-098ce938-8a4c-4451-afd7-7b082823a0de.png) r? `@xFrednet`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It doesn't seem to matter whether or not an abstract trait method returns a
&T
type without a region:Compiles fine. However, once
impl A for B
is uncommented, it properly errors with:What's interesting is that the impl cannot correct for the error in the trait. Changing it to this:
Results in this error:
I feel we should error out on the trait method or else we risk someone creating an unimplementable trait.
The text was updated successfully, but these errors were encountered: