mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
27 lines
571 B
Rust
27 lines
571 B
Rust
mod module {
|
|
pub struct SomeTupleStruct(u8);
|
|
pub struct SomeRegularStruct {
|
|
foo: u8
|
|
}
|
|
|
|
impl SomeTupleStruct {
|
|
pub fn new() -> Self {
|
|
Self(0)
|
|
}
|
|
}
|
|
impl SomeRegularStruct {
|
|
pub fn new() -> Self {
|
|
Self { foo: 0 }
|
|
}
|
|
}
|
|
}
|
|
|
|
use module::{SomeTupleStruct, SomeRegularStruct};
|
|
|
|
fn main() {
|
|
let _ = SomeTupleStruct.new();
|
|
//~^ ERROR expected value, found struct `SomeTupleStruct`
|
|
let _ = SomeRegularStruct.new();
|
|
//~^ ERROR expected value, found struct `SomeRegularStruct`
|
|
}
|