]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs
Rollup merge of #107325 - petrochenkov:hiddoc2, r=GuillaumeGomez
[rust.git] / tests / ui / type-alias-impl-trait / different_lifetimes_defining_uses.rs
1 #![feature(type_alias_impl_trait)]
2 #![allow(dead_code)]
3
4 pub trait Captures<'a> {}
5
6 impl<'a, T: ?Sized> Captures<'a> for T {}
7
8 type OneLifetime<'a, 'b> = impl std::fmt::Debug + Captures<'a> + Captures<'b>;
9
10 fn foo<'a, 'b>(a: &'a u32, b: &'b u32) -> OneLifetime<'a, 'b> {
11     a
12 }
13
14 fn bar<'a, 'b>(a: &'a u32, b: &'b u32) -> OneLifetime<'a, 'b> {
15     b
16     //~^ ERROR: concrete type differs from previous defining opaque type use
17 }
18
19 fn main() {}