mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
14 lines
265 B
Rust
14 lines
265 B
Rust
use std::cell::RefCell;
|
|
|
|
struct HasAssocMethod;
|
|
|
|
impl HasAssocMethod {
|
|
fn hello() {}
|
|
}
|
|
fn main() {
|
|
let shared_state = RefCell::new(HasAssocMethod);
|
|
let state = shared_state.borrow_mut();
|
|
state.hello();
|
|
//~^ ERROR no method named `hello` found
|
|
}
|