about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2017-09-29 17:58:51 -0600
committerGitHub <noreply@github.com>2017-09-29 17:58:51 -0600
commitf407b2bf4aa8154cd398c7823474efee8be17213 (patch)
treee363a7b8f2a255bb7d8645ca94c461917fcc84c7 /src/test/incremental/thinlto
parent6f87d20a7cce70b8cc59a1adf3037d14bc83f237 (diff)
parent73543d53cd01899df38ce71b883ed820c5822fba (diff)
downloadrust-f407b2bf4aa8154cd398c7823474efee8be17213.tar.gz
rust-f407b2bf4aa8154cd398c7823474efee8be17213.zip
Rollup merge of #44124 - gaurikholkar:return_self, r=arielb1
adding E0623 for return types - both parameters are anonymous

This is a fix for #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.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions