about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-08-12 05:15:16 +0000
committerbors <bors@rust-lang.org>2019-08-12 05:15:16 +0000
commite255f36afe431eaba1fff15855e1536596ed2ab9 (patch)
tree6ef28d8d4df27fbd9c941f926156d72db58d925f /src/test/incremental/thinlto
parented1de3d3775630b233790e41f0c7064a7d4ec495 (diff)
parentd55315808d88b2020068002995c83ac735cd777c (diff)
downloadrust-e255f36afe431eaba1fff15855e1536596ed2ab9.tar.gz
rust-e255f36afe431eaba1fff15855e1536596ed2ab9.zip
Auto merge of #4365 - lukas-code:async_new_ret_no_self, r=flip1995
new_ret_no_self: allow Self in inner type for impl Trait return types

Check the inner types of associated types of a trait when checking for Self in the return type of a `new` method. This means that the following will no longer warn:
```rust
trait Trait {
    type Inner;
}

struct S;

impl S {
    fn new() -> impl Trait<Inner = Option<Self>> {
        struct TraitImpl;

        impl Trait for TraitImpl {
            type Inner = Option<S>;
        }

        TraitImpl
    }
}
```
```rust
#![feature(async_await)]

struct Connection;

impl Connection {
    async fn new() -> Result<Self, ()> {
        Ok(S)
    }
}
```
closes #4359

changelog: fix `new_ret_no_self` lint for async `new` functions.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions