We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19e718b commit 4c312b6Copy full SHA for 4c312b6
src/test/run-pass/issue-7911.rs
@@ -27,19 +27,19 @@ trait Test {
27
fn get_mut<'r>(&'r mut self) -> &'r mut FooBar;
28
}
29
30
-macro_rules! generate_test(($type_:path, $field:expr) => (
+macro_rules! generate_test(($type_:path, $slf:ident, $field:expr) => (
31
impl Test for $type_ {
32
- fn get_immut<'r>(&'r self) -> &'r FooBar {
+ fn get_immut<'r>(&'r $slf) -> &'r FooBar {
33
&$field as &FooBar
34
35
36
- fn get_mut<'r>(&'r mut self) -> &'r mut FooBar {
+ fn get_mut<'r>(&'r mut $slf) -> &'r mut FooBar {
37
&mut $field as &mut FooBar
38
39
40
))
41
42
-generate_test!(Foo, self.bar)
+generate_test!(Foo, self, self.bar)
43
44
pub fn main() {
45
let mut foo: Foo = Foo { bar: Bar(42) };
0 commit comments