rust/tests/ui/traits/opaque-trait-size-error-5883.rs
2025-08-27 00:23:26 -04:00

15 lines
267 B
Rust

// https://github.com/rust-lang/rust/issues/5883
trait A {}
struct Struct {
r: dyn A + 'static
}
fn new_struct(
r: dyn A + 'static //~ ERROR the size for values of type
) -> Struct { //~ ERROR the size for values of type
Struct { r: r }
}
fn main() {}