2016-07-28 10:27:11 -05:00
|
|
|
use std::cell::Cell;
|
|
|
|
use std::rc::Rc;
|
|
|
|
|
|
|
|
fn send<T: Send>(_: T) {}
|
|
|
|
|
2023-07-04 06:16:44 -05:00
|
|
|
fn main() {}
|
2016-07-28 10:27:11 -05:00
|
|
|
|
|
|
|
// Cycles should work as the deferred obligations are
|
|
|
|
// independently resolved and only require the concrete
|
|
|
|
// return type, which can't depend on the obligation.
|
|
|
|
fn cycle1() -> impl Clone {
|
2018-04-15 16:21:00 -05:00
|
|
|
//~^ ERROR cycle detected
|
2023-07-04 06:16:44 -05:00
|
|
|
//~| ERROR cycle detected
|
2016-07-28 10:27:11 -05:00
|
|
|
send(cycle2().clone());
|
2023-07-04 06:16:44 -05:00
|
|
|
//~^ ERROR: cannot check whether the hidden type of opaque type satisfies auto traits
|
2016-07-28 10:27:11 -05:00
|
|
|
|
|
|
|
Rc::new(Cell::new(5))
|
|
|
|
}
|
|
|
|
|
|
|
|
fn cycle2() -> impl Clone {
|
|
|
|
send(cycle1().clone());
|
2023-07-04 06:16:44 -05:00
|
|
|
//~^ ERROR: cannot check whether the hidden type of opaque type satisfies auto traits
|
2016-07-28 10:27:11 -05:00
|
|
|
|
|
|
|
Rc::new(String::from("foo"))
|
|
|
|
}
|