Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sloppy wording in 4.3 #1862

Closed
mulkieran opened this issue Mar 13, 2019 · 5 comments
Closed

Sloppy wording in 4.3 #1862

mulkieran opened this issue Mar 13, 2019 · 5 comments

Comments

@mulkieran
Copy link
Contributor

mulkieran commented Mar 13, 2019

Recall from the borrowing rules that if we have an immutable reference to something, we cannot also take a mutable reference. Because clear needs to truncate the String, it tries to take a mutable reference, which fails. Not only has Rust made our API easier to use, but it has also eliminated an entire class of errors at compile time!

"it tries to take a mutable reference, which fails" sounds dynamic. But the whole point is that this is statically checked.

@L0uisc
Copy link
Contributor

L0uisc commented Apr 8, 2019

I don't think this is really such a big problem. The compiler is in fact trying to validate a mutable reference, which fails. The next sentence makes it clear that this trying and failing happened at compile time.

@mulkieran
Copy link
Contributor Author

If I wasn't sure I understood what was going on, the sentence that follows would just look like a bewildering non-sequitur.

@L0uisc
Copy link
Contributor

L0uisc commented Apr 9, 2019

How about "...it needs to get a mutable reference, which the compiler disallows" ?

@mulkieran
Copy link
Contributor Author

Yes, that would be much better.

@carols10cents
Copy link
Member

Fixed by #1907!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants