]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs
Auto merge of #106503 - cjgillot:remap-nofilter, r=oli-obk
[rust.git] / tests / ui / type-alias-impl-trait / multiple-def-uses-in-one-fn-pass.rs
1 // check-pass
2 #![feature(type_alias_impl_trait)]
3
4 type X<A: ToString + Clone, B: ToString + Clone> = impl ToString;
5
6 fn f<A: ToString + Clone, B: ToString + Clone>(a: A, b: B) -> (X<A, B>, X<A, B>) {
7     (a.clone(), a)
8 }
9
10 pub trait Captures<'a> {}
11
12 impl<'a, T: ?Sized> Captures<'a> for T {}
13
14 type Foo<'a, 'b> = impl std::fmt::Debug + Captures<'a> + Captures<'b>;
15
16 fn foo<'x, 'y>(i: &'x i32, j: &'y i32) -> (Foo<'x, 'y>, Foo<'y, 'x>) {
17     (i, j)
18 }
19
20 fn main() {
21     println!("{}", <X<_, _> as ToString>::to_string(&f(42_i32, String::new()).1));
22     let meh = 42;
23     let muh = 69;
24     println!("{:?}", foo(&meh, &muh));
25 }