mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
Add test for private method inference fallback
This commit is contained in:
parent
5d54c550e7
commit
1d782a9095
@ -1896,3 +1896,24 @@ impl dyn Error + Send {
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fallback_private_methods() {
|
||||
check(
|
||||
r#"
|
||||
mod module {
|
||||
pub struct Struct;
|
||||
|
||||
impl Struct {
|
||||
fn func(&self) {}
|
||||
}
|
||||
}
|
||||
|
||||
fn foo() {
|
||||
let s = module::Struct;
|
||||
s.func();
|
||||
//^^^^^^^^ type: ()
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user