Files
rust/tests/ui/structs/invalid-self-constructor-56835.rs

11 lines
303 B
Rust
Raw Normal View History

2025-08-20 14:02:50 -04:00
// https://github.com/rust-lang/rust/issues/56835
2018-12-15 04:33:54 +00:00
pub struct Foo {}
impl Foo {
fn bar(Self(foo): Self) {}
2018-12-15 17:31:46 +00:00
//~^ ERROR the `Self` constructor can only be used with tuple or unit structs
//~^^ ERROR expected tuple struct or tuple variant, found self constructor `Self` [E0164]
2018-12-15 04:33:54 +00:00
}
fn main() {}