rust/src/test/ui/recursion/issue-26548-recursion-via-normalize.rs

20 lines
544 B
Rust
Raw Normal View History

//~ ERROR cycle detected when computing layout of `S`
//~| NOTE ...which requires computing layout of `core::option::Option<<S as Mirror>::It>`...
//~| NOTE ...which requires computing layout of `core::option::Option<S>`...
//~| NOTE ...which again requires computing layout of `S`, completing the cycle
// build-fail
2020-05-31 15:11:51 +00:00
trait Mirror {
type It: ?Sized;
}
impl<T: ?Sized> Mirror for T {
type It = Self;
}
struct S(Option<<S as Mirror>::It>);
2020-05-31 15:11:51 +00:00
fn main() {
//~^ NOTE cycle used when elaborating drops for `main`
let _s = S(None);
}