rust/tests/ui/resolve/suggest-path-for-tuple-struct.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
571 B
Rust
Raw Normal View History

2021-09-27 07:28:38 +00:00
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`
}