forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#117371 - compiler-errors:unique-params, r=oli-obk Ignore RPIT duplicated lifetimes in `opaque_types_defined_by` An RPIT's or TAIT's own generics are kinda useless -- so just ignore them. For TAITs, they will always be empty, and for RPITs, they're always duplicated lifetimes. Fixes rust-lang#115013.
- Loading branch information
Showing
4 changed files
with
37 additions
and
2 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
13 changes: 13 additions & 0 deletions
13
tests/ui/type-alias-impl-trait/duplicate-lifetimes-from-rpit-containing-tait.rs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// check-pass | ||
|
||
#![feature(type_alias_impl_trait)] | ||
|
||
type Opaque<'lt> = impl Sized + 'lt; | ||
|
||
fn test<'a>( | ||
arg: impl Iterator<Item = &'a u8>, | ||
) -> impl Iterator<Item = Opaque<'a>> { | ||
arg | ||
} | ||
|
||
fn main() {} |
15 changes: 15 additions & 0 deletions
15
tests/ui/type-alias-impl-trait/duplicate-lifetimes-from-rpit-containing-tait2.rs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// check-pass | ||
// edition: 2021 | ||
|
||
#![feature(type_alias_impl_trait)] | ||
|
||
struct Foo<'a>(&'a ()); | ||
|
||
impl<'a> Foo<'a> { | ||
async fn new() -> () { | ||
type T = impl Sized; | ||
let _: T = (); | ||
} | ||
} | ||
|
||
fn main() {} |