-
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
properly handle anonymous regions appearing in return type - anon-anon conflicts #44018
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Comments
@nikomatsakis this is the output I get
How do we want this? |
@nikomatsakis @arielb1 @estebank @GuillaumeGomez I needed some help to extract the span of the return type. I was thinking of getting it from the fndecl.output.span. Is there a better way? |
There isn't. |
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this issue
Sep 29, 2017
adding E0623 for return types - both parameters are anonymous This is a fix for rust-lang#44018 ``` error[E0621]: explicit lifetime required in the type of `self` --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:17:5 | 16 | fn foo<'a>(&self, x: &i32) -> &i32 { | ---- ---- | | | this parameter and the return type are declared with different lifetimes... 17 | x | ^ ...but data from `x` is returned here error: aborting due to previous error ``` It also works for the below case where we have self as anonymous ``` error[E0623]: lifetime mismatch --> src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs:17:19 | 16 | fn foo<'a>(&self, x: &Foo) -> &Foo { | ---- ---- | | | this parameter and the return type are declared with different lifetimes... 17 | if true { x } else { self } | ^ ...but data from `x` is returned here error: aborting due to previous error ``` r? @nikomatsakis Currently, I have enabled E0621 where return type and self are anonymous, hence WIP.
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-enhancement
Category: An issue proposing an enhancement or a PR with one.
For the following example, currently
E0623
is disabled right now. This is how the error message will now look like.cc @nikomatsakis
The text was updated successfully, but these errors were encountered: