use mockers::Scenario; use mockers_derive::mocked; #[mocked(debug)] trait A { fn get_ref(&self) -> &usize; } #[test] fn local_refs() { let scenario = Scenario::new(); let (mock, handle) = scenario.create_mock_for::(); let call_match = handle.get_ref(); let val = 2; let expectation = call_match.and_return(&val); scenario.expect(expectation); assert_eq!(mock.get_ref() as *const usize, &val as *const usize); }