mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
20 lines
412 B
Rust
20 lines
412 B
Rust
//@ check-pass
|
|
|
|
// related to #113916, check that using RPITs in functions with lifetime params
|
|
// which are constrained to be equal compiles.
|
|
|
|
trait Trait<'a, 'b> {}
|
|
impl Trait<'_, '_> for () {}
|
|
fn pass<'a: 'b, 'b: 'a>() -> impl Trait<'a, 'b> {
|
|
(|| {})()
|
|
}
|
|
|
|
struct Foo<'a>(&'a ());
|
|
impl<'a> Foo<'a> {
|
|
fn bar<'b: 'a>(&'b self) -> impl Trait<'a, 'b> {
|
|
let _: &'a &'b &'a ();
|
|
}
|
|
}
|
|
|
|
fn main() {}
|