Skip to content

Commit

Permalink
rand: Fix infinite recursion
Browse files Browse the repository at this point in the history
`self` has type `&@Rand`, so `*self` will be of type `@Rand` which causes
this same impl to be called again.
  • Loading branch information
Blei committed Apr 28, 2013
1 parent 5f7947a commit 8627fc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ pub fn task_rng() -> @IsaacRng {

// Allow direct chaining with `task_rng`
impl<R: Rng> Rng for @R {
fn next(&self) -> u32 { (*self).next() }
fn next(&self) -> u32 { (**self).next() }
}

/**
Expand Down

5 comments on commit 8627fc9

@bors
Copy link
Contributor

@bors bors commented on 8627fc9 Apr 28, 2013

Choose a reason for hiding this comment

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

@bors
Copy link
Contributor

@bors bors commented on 8627fc9 Apr 28, 2013

Choose a reason for hiding this comment

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

merging Blei/rust/fix-rand = 8627fc9 into auto

@bors
Copy link
Contributor

@bors bors commented on 8627fc9 Apr 28, 2013

Choose a reason for hiding this comment

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

Blei/rust/fix-rand = 8627fc9 merged ok, testing candidate = cdd342b

@bors
Copy link
Contributor

@bors bors commented on 8627fc9 Apr 28, 2013

Choose a reason for hiding this comment

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

@bors
Copy link
Contributor

@bors bors commented on 8627fc9 Apr 28, 2013

Choose a reason for hiding this comment

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

fast-forwarding incoming to auto = cdd342b

Please sign in to comment.