-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
54 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters