about summary refs log tree commit diff
path: root/tests/ui/recursion/issue-26548-recursion-via-normalize.rs
blob: 14bc74f57f61d71725a8d41f26a7ee8908e2e9a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//~ ERROR cycle detected when computing layout (naive) of `core::option::Option<S>`
//~| NOTE see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
//~| NOTE ...which requires computing layout (naive) of `S`...
//~| NOTE ...which requires computing layout (naive) of `core::option::Option<<S as Mirror>::It>`...
//~| NOTE ...which again requires computing layout (naive) of `core::option::Option<S>`, completing the cycle
//~| NOTE cycle used when computing layout (naive) of `core::option::Option<<S as Mirror>::It>`

trait Mirror {
    type It: ?Sized;
}
impl<T: ?Sized> Mirror for T {
    type It = Self;
}
struct S(Option<<S as Mirror>::It>);

fn main() {
    let _s = S(None);
}