about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-06-30 22:44:43 +0200
committerGitHub <noreply@github.com>2017-06-30 22:44:43 +0200
commitfc0fb0328b8d38e7e6d7f719555c990e0842820d (patch)
tree2e09a2cf1abe76f311aa9056714e3c1e58c739a7 /src/rustllvm/PassWrapper.cpp
parente72580cf091190c6258648e4cfbca083f20ece3d (diff)
parent37a88f478dd80404b7b8c3890db96f5850ecd7bf (diff)
downloadrust-fc0fb0328b8d38e7e6d7f719555c990e0842820d.tar.gz
rust-fc0fb0328b8d38e7e6d7f719555c990e0842820d.zip
Rollup merge of #42669 - gaurikholkar:master, r=nikomatsakis
Adding diagnostic code 0611 for lifetime errors with one named, one anonymous lifetime parameter

This is a fix for #42517
Note that this only handles the above case for **function declarations** and **traits**.
`impl items` and `closures` will be handled in a later PR.
Example
```
fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
    if x > y { x } else { y }
}
```
now displays the following error message. ui tests have been added for the same.
```
error[E0611]: explicit lifetime required in the type of `x`
11 | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
   |                     ^ consider changing the type of `x` to `&'a i32`
12 |     if x > y { x } else { y }
   |                  - lifetime `'a` required
```
#42516
r? @nikomatsakis
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions