diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-03-25 09:30:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-25 09:30:29 -0700 |
| commit | 2673b03d65f1d784fc7d72f3af11321362c04786 (patch) | |
| tree | cf64074f48af4de6fef66f75137ae2ed51c0a527 /src/rustllvm/RustWrapper.cpp | |
| parent | f43c336e7453ff8216671f44328841d9a3828d2b (diff) | |
| parent | e7949d0013bb8b45c884b173ca22c20e6899d612 (diff) | |
| download | rust-2673b03d65f1d784fc7d72f3af11321362c04786.tar.gz rust-2673b03d65f1d784fc7d72f3af11321362c04786.zip | |
Rollup merge of #40734 - adamransom:fix/40661, r=jseyfried
Add warning for use of lifetime parameter with 'static bound
Previously a `'static` lifetime bound would result in an `undeclared lifetime` error when compiling, even though it could be considered valid.
However, it is unnecessary to use it as a lifetime bound so we present the user with a warning instead and suggest using the `'static` lifetime directly, in place of the lifetime parameter. We can change this to an error (or warning with lint) if that's decided to be more appropriate.
Example output:
```
warning: unnecessary lifetime parameter `'a`
--> ../static-lifetime-bound.rs:3:10
|
3 | fn f<'a: 'static>(val: &'a i32) {
| ^^^^^^^^^^^
|
= help: you can use the `'static` lifetime directly, in place `'a`
```
Fixes #40661
r? @jseyfried
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
