]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-92096.rs
Rollup merge of #93672 - lcnr:const-param-defaults-xx, r=matthewjasper
[rust.git] / src / test / ui / generic-associated-types / issue-92096.rs
1 // edition:2018
2 // [nll] check-pass
3 // revisions: migrate nll
4 // Explicitly testing nll with revision, so ignore compare-mode=nll
5 // ignore-compare-mode-nll
6
7 #![cfg_attr(nll, feature(nll))]
8 #![feature(generic_associated_types)]
9
10 use std::future::Future;
11
12 trait Client {
13     type Connecting<'a>: Future + Send
14     where
15         Self: 'a;
16
17     fn connect(&'_ self) -> Self::Connecting<'_>;
18 }
19
20 fn call_connect<C>(c: &'_ C) -> impl '_ + Future + Send
21 where
22     C: Client + Send + Sync,
23 {
24     async move { c.connect().await }
25     //[migrate]~^ ERROR the parameter
26     //[migrate]~| ERROR the parameter
27 }
28
29 fn main() {}