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 }})

QuietMisdreavus

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.

r? @steveklabnik

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.

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.

@QuietMisdreavus

GuillaumeGomez

@GuillaumeGomez

@bors

📌 Commit 963d4df has been approved by GuillaumeGomez

steveklabnik

@@ -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

Mar 17, 2017

@frewsxcv

…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.

r? @steveklabnik

frewsxcv added a commit to frewsxcv/rust that referenced this pull request

Mar 17, 2017

@frewsxcv

…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.

r? @steveklabnik

frewsxcv added a commit to frewsxcv/rust that referenced this pull request

Mar 17, 2017

@frewsxcv

…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.

r? @steveklabnik

frewsxcv added a commit to frewsxcv/rust that referenced this pull request

Mar 18, 2017

@frewsxcv

…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.

r? @steveklabnik

frewsxcv added a commit to frewsxcv/rust that referenced this pull request

Mar 18, 2017

@frewsxcv

…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.

r? @steveklabnik

frewsxcv added a commit to frewsxcv/rust that referenced this pull request

Mar 18, 2017

@frewsxcv

…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.

r? @steveklabnik

frewsxcv added a commit to frewsxcv/rust that referenced this pull request

Mar 18, 2017

@frewsxcv

…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.

r? @steveklabnik

frewsxcv added a commit to frewsxcv/rust that referenced this pull request

Mar 18, 2017

@frewsxcv

…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.

r? @steveklabnik

arielb1 pushed a commit to arielb1/rust that referenced this pull request

Mar 18, 2017

…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.

r? @steveklabnik

bors added a commit that referenced this pull request

Mar 18, 2017

@bors

Rollup of 22 pull requests

arielb1 pushed a commit to arielb1/rust that referenced this pull request

Mar 19, 2017

…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.

r? @steveklabnik

frewsxcv added a commit to frewsxcv/rust that referenced this pull request

Mar 19, 2017

@frewsxcv

…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.

r? @steveklabnik

frewsxcv added a commit to frewsxcv/rust that referenced this pull request

Mar 19, 2017

@frewsxcv

…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.

r? @steveklabnik

bors added a commit that referenced this pull request

Mar 19, 2017

@bors

Rollup of 13 pull requests