Fixed an error in tutorial.md#11494
Fixed an error in tutorial.md#11494dannycoates wants to merge 1 commit intorust-lang:masterfrom dannycoates:patch-1
Conversation
The freezing reference section described lending an *immutable* pointer but the example and logic suggest it should be a *mutable* pointer.
|
The example just below that piece of text is showing an immutable reference; a mutable reference would be created with In any case, while it's true that taking a mutable reference (e.g. |
|
Closing, I agree with @huonw that the text is correct as-is. A mutable reference is indeed allowed to mutate the object, while taking an immutable reference does indeed freeze the object and prevent all mutation of the object. |
|
Though after reading your explanation makes it clear, the text is confusing as is. I believe the language, "Lending an immutable pointer" isn't clear to someone unfamiliar with Rust, like me, who is just learning the terminology, whereas "Taking an immutable reference" as @alexcrichton describes here is perfectly clear to me, and probably others coming from a C perspective. Just my 2 cents :) |
…affects_lint, r=Centri3 fix enum_variant_names depending lint depending on order changelog: [`enum_variant_names`]: fix single word variants preventing lint of later variant pre/postfixed with the enum name fixes rust-lang#11494 Single word variants prevented checking the `check_enum_start` and `check_enum_end` for being run on later variants
The freezing reference section described lending an immutable pointer but the example and logic suggest it should be a mutable pointer.