rust/tests/ui/layout/post-mono-layout-cycle.rs
Rémy Rakic bd8477b562 Revert "Emit error when calling/declaring functions with unavailable vectors."
This reverts commit 5af56cac38fa48e4228e5e123d060e85eb1acbf7.
2024-10-25 20:42:09 +00:00

26 lines
403 B
Rust

//@ build-fail
//~^ cycle detected when computing layout of `Wrapper<()>`
trait Trait {
type Assoc;
}
impl Trait for () {
type Assoc = Wrapper<()>;
}
struct Wrapper<T: Trait> {
_x: <T as Trait>::Assoc,
}
fn abi<T: Trait>(_: Option<Wrapper<T>>) {}
//~^ ERROR a cycle occurred during layout computation
fn indirect<T: Trait>() {
abi::<T>(None);
}
fn main() {
indirect::<()>();
}