mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +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