]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #37481 - estebank:lifetime-help-removal-for-impl, r=eddyb
authorEduard-Mihai Burtescu <edy.burt@gmail.com>
Sat, 12 Nov 2016 08:38:37 +0000 (10:38 +0200)
committerGitHub <noreply@github.com>
Sat, 12 Nov 2016 08:38:37 +0000 (10:38 +0200)
Don't provide hint to add lifetime on impl items

``` rust
use std::str::FromStr;

pub struct Foo<'a> {
    field: &'a str,
}

impl<'a> FromStr for Foo<'a> {
    type Err = ();
    fn from_str(path: &str) -> Result<Self, ()> {
        Ok(Foo { field: path })
    }
}
```

would give the following hint:

``` nocode
help: consider using an explicit lifetime parameter as shown: fn from_str(path: &'a str) -> Result<Self, ()>
  --> <anon>:9:5
   |
9  |     fn from_str(path: &str) -> Result<Self, ()> {
   |     ^
```

which is never correct, since then there will be a lifetime mismatch between the `impl` and the trait.

Remove this hint for all `impl` items.

Re: #37363.


Trivial merge