minor wording tweak to slice::{as_ptr, as_mut_ptr} by QuietMisdreavus · Pull Request #40603 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation6 Commits1 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Per #37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
@@ -437,8 +437,8 @@ impl [T] { |
---|
/// The caller must ensure that the slice outlives the pointer this |
/// function returns, or else it will end up pointing to garbage. |
/// |
/// Modifying the slice may cause its buffer to be reallocated, which |
/// would also make any pointers to it invalid. |
/// Modifying the container this slice references may cause its buffer |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer: "Modifying the container referenced by this slice may.."
@@ -463,8 +463,8 @@ impl [T] { |
---|
/// The caller must ensure that the slice outlives the pointer this |
/// function returns, or else it will end up pointing to garbage. |
/// |
/// Modifying the slice may cause its buffer to be reallocated, which |
/// would also make any pointers to it invalid. |
/// Modifying the container this slice references may cause its buffer |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
📌 Commit 963d4df has been approved by GuillaumeGomez
@@ -437,8 +437,8 @@ impl [T] { |
---|
/// The caller must ensure that the slice outlives the pointer this |
/// function returns, or else it will end up pointing to garbage. |
/// |
/// Modifying the slice may cause its buffer to be reallocated, which |
/// would also make any pointers to it invalid. |
/// Modifying the container this slice references may cause its buffer |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I wonder if "container" is the right word here, is an array a "container"? we don't really use it as a standard term, idk
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was hoping to have it be a generalized term, even though it's not "standard" per se. In this context, I'd call an array a "container", given that it's what holds the ownership of its items. Could go either way, what with the heap-allocated variable-length things being in "lib_collections_". :/
frewsxcv added a commit to frewsxcv/rust that referenced this pull request
…uillaumeGomez
minor wording tweak to slice::{as_ptr, as_mut_ptr}
Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request
…uillaumeGomez
minor wording tweak to slice::{as_ptr, as_mut_ptr}
Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request
…uillaumeGomez
minor wording tweak to slice::{as_ptr, as_mut_ptr}
Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request
…uillaumeGomez
minor wording tweak to slice::{as_ptr, as_mut_ptr}
Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request
…uillaumeGomez
minor wording tweak to slice::{as_ptr, as_mut_ptr}
Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request
…uillaumeGomez
minor wording tweak to slice::{as_ptr, as_mut_ptr}
Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request
…uillaumeGomez
minor wording tweak to slice::{as_ptr, as_mut_ptr}
Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request
…uillaumeGomez
minor wording tweak to slice::{as_ptr, as_mut_ptr}
Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
arielb1 pushed a commit to arielb1/rust that referenced this pull request
…uillaumeGomez
minor wording tweak to slice::{as_ptr, as_mut_ptr}
Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
bors added a commit that referenced this pull request
Rollup of 22 pull requests
- Successful merges: #40241, #40346, #40348, #40377, #40398, #40409, #40441, #40445, #40509, #40521, #40523, #40532, #40538, #40564, #40581, #40583, #40588, #40589, #40590, #40603, #40611, #40621
- Failed merges: #40501, #40541
arielb1 pushed a commit to arielb1/rust that referenced this pull request
…uillaumeGomez
minor wording tweak to slice::{as_ptr, as_mut_ptr}
Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request
…uillaumeGomez
minor wording tweak to slice::{as_ptr, as_mut_ptr}
Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request
…uillaumeGomez
minor wording tweak to slice::{as_ptr, as_mut_ptr}
Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the slice itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the collection that could cause the buffer to be reallocated.
bors added a commit that referenced this pull request
Rollup of 13 pull requests