Skip to content

Commit

Permalink
fix hygiene for test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jbclements committed Jul 8, 2014
1 parent 19e718b commit 4c312b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/test/run-pass/issue-7911.rs
Expand Up @@ -27,19 +27,19 @@ trait Test {
fn get_mut<'r>(&'r mut self) -> &'r mut FooBar;
}

macro_rules! generate_test(($type_:path, $field:expr) => (
macro_rules! generate_test(($type_:path, $slf:ident, $field:expr) => (
impl Test for $type_ {
fn get_immut<'r>(&'r self) -> &'r FooBar {
fn get_immut<'r>(&'r $slf) -> &'r FooBar {
&$field as &FooBar
}

fn get_mut<'r>(&'r mut self) -> &'r mut FooBar {
fn get_mut<'r>(&'r mut $slf) -> &'r mut FooBar {
&mut $field as &mut FooBar
}
}
))

generate_test!(Foo, self.bar)
generate_test!(Foo, self, self.bar)

pub fn main() {
let mut foo: Foo = Foo { bar: Bar(42) };
Expand Down

6 comments on commit 4c312b6

@bors
Copy link
Contributor

@bors bors commented on 4c312b6 Jul 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from pcwalton
at jbclements@4c312b6

@bors
Copy link
Contributor

@bors bors commented on 4c312b6 Jul 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging jbclements/rust/hygiene-for-methods = 4c312b6 into auto

@bors
Copy link
Contributor

@bors bors commented on 4c312b6 Jul 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jbclements/rust/hygiene-for-methods = 4c312b6 merged ok, testing candidate = 5716abe

@bors
Copy link
Contributor

@bors bors commented on 4c312b6 Jul 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 5716abe

Please sign in to comment.