Fix false positive with new_ret_no_self when returning Self with different generic arguments

This commit is contained in:
Jason Newcomb 2021-03-22 21:38:14 -04:00
parent 917b538c68
commit 99b8a67198
No known key found for this signature in database
GPG key ID: DA59E8643A37ED06
3 changed files with 31 additions and 4 deletions

View file

@ -340,3 +340,13 @@ mod issue5435 {
}
}
}
// issue #1724
struct RetOtherSelf<T>(T);
struct RetOtherSelfWrapper<T>(T);
impl RetOtherSelf<T> {
fn new(t: T) -> RetOtherSelf<RetOtherSelfWrapper<T>> {
RetOtherSelf(RetOtherSelfWrapper(t))
}
}