IssueRaiser

> If a function you call returns an &mut you have no way > to tell Indeed, but also consider that a function can't return a `&mut` un...

> If a function you call returns an &mut you have no way > to tell Indeed, but also consider that a function can't return a `&mut` unless a `&mut` was passed in to it somehow. This means that the only way to implicitly introduce a `&mut` is via a method call like `foo.bar()` that takes `&mut self`, but also consider that it would be impossible to call the method here unless `foo` were explicitly declared as mutable to begin with. Given that mutable variables in Rust are relatively rare, these factors conspire to broadcast any mutable references quite clearly.

Posted by kibwen on Jun 6, 2015, 8:28 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.6,000 issues0 comments

hackernews (Other)

> If a function you call returns an &mut you have no way > to tell Indeed, but also consider that a function can't return a `&mut` un...

kibwenJun 6, 2015, 8:28 AM

> If a function you call returns an &mut you have no way > to tell Indeed, but also consider that a function can't return a `&mut` unless a `&mut` was passed in to it somehow. This means that the only way to implicitly introduce a `&mut` is via a method call like `foo.bar()` that takes `&mut self`, but also consider that it would be impossible to call the method here unless `foo` were explicitly declared as mutable to begin with. Given that mutable variables in Rust are relatively rare, these factors conspire to broadcast any mutable references quite clearly.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue