diff options
| author | bors <bors@rust-lang.org> | 2019-08-12 05:15:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-08-12 05:15:16 +0000 |
| commit | e255f36afe431eaba1fff15855e1536596ed2ab9 (patch) | |
| tree | 6ef28d8d4df27fbd9c941f926156d72db58d925f /src/test/incremental/thinlto | |
| parent | ed1de3d3775630b233790e41f0c7064a7d4ec495 (diff) | |
| parent | d55315808d88b2020068002995c83ac735cd777c (diff) | |
| download | rust-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
