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

Do not hint to use elided '_ lifetimes in errors #52743

Closed
Mark-Simulacrum opened this issue Jul 26, 2018 · 1 comment
Closed

Do not hint to use elided '_ lifetimes in errors #52743

Mark-Simulacrum opened this issue Jul 26, 2018 · 1 comment
Assignees
Labels
NLL-diagnostics Working towards the "diagnostic parity" goal

Comments

@Mark-Simulacrum
Copy link
Member

https://play.rust-lang.org/?gist=96fc205e5162ae48cb27063a22ea4518&version=nightly&mode=debug&edition=2015

#![feature(nll)]
#![feature(in_band_lifetimes)]

struct Foo<'a, 'b> {
    x: &'a u32,
    y: &'b u32,
}

struct Bar<'b> {
    z: &'b u32
}

impl Foo<'_, '_> {
    fn take_bar(&mut self, b: Bar<'_>) {
        self.y = b.z
    }
}

fn main() { }
error[E0621]: explicit lifetime required in the type of `b`
  --> src/main.rs:15:9
   |
14 |     fn take_bar(&mut self, b: Bar<'_>) {
   |                            - consider changing the type of `b` to `Bar<'_>`
15 |         self.y = b.z
   |         ^^^^^^^^^^^^ lifetime `'_` required

error: aborting due to previous error

cc @davidtwco

@Mark-Simulacrum Mark-Simulacrum added the NLL-diagnostics Working towards the "diagnostic parity" goal label Jul 26, 2018
@estebank
Copy link
Contributor

Closing as dupe of #52742.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NLL-diagnostics Working towards the "diagnostic parity" goal
Projects
None yet
Development

No branches or pull requests

3 participants