2024-03-22 13:06:46 -05:00
|
|
|
// #98842 stack overflow in trait inference
|
2024-03-22 13:21:50 -05:00
|
|
|
// issue: rust-lang/rust#98842
|
2024-03-22 13:06:46 -05:00
|
|
|
//@ check-fail
|
|
|
|
//@ edition:2021
|
2024-03-22 13:21:50 -05:00
|
|
|
//@ stderr-per-bitwidth
|
2024-07-02 08:28:16 -05:00
|
|
|
//~^^^^^ ERROR cycle detected when computing layout of `Foo`
|
2024-03-22 13:06:46 -05:00
|
|
|
|
|
|
|
// If the inner `Foo` is named through an associated type,
|
|
|
|
// the "infinite size" error does not occur.
|
|
|
|
struct Foo(<&'static Foo as ::core::ops::Deref>::Target);
|
|
|
|
// But Rust will be unable to know whether `Foo` is sized or not,
|
|
|
|
// and it will infinitely recurse somewhere trying to figure out the
|
|
|
|
// size of this pointer (is my guess):
|
|
|
|
const _: *const Foo = 0 as _;
|
2024-06-22 09:26:30 -05:00
|
|
|
//~^ ERROR evaluation of constant value failed
|
2024-03-22 13:06:46 -05:00
|
|
|
|
|
|
|
pub fn main() {}
|