Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::ops::Deref;
- struct Foo {
- }
- impl Deref for Foo {
- type Target = i32;
- fn deref(&self) -> &Self::Target {
- unimplemented!()
- }
- }
- impl DerefMut for Foo {
- fn deref_mut(&mut self) -> &mut Self::Target {
- unimplemented!()
- }
- }
- fn main() {
- let f = Foo{};
- *f = 3;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement