Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions tests/compile/recursive_types.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Compiler:

// `Set` reaches itself by value through `*mut Root`, so a backend that emits `Root`'s
// fields with the still-incomplete `Set` type fails to compile this.

#![crate_type = "lib"]

#[repr(C)]
pub struct Set {
pub root: *mut Root,
pub first: usize,
pub second: usize,
}

#[repr(C)]
pub struct Root {
pub default_set: Set,
}

pub fn identity(set: Set) -> Set {
set
}
Loading