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

Tweak std::mem docs (#29362) #36357

Merged
merged 1 commit into from
Sep 13, 2016
Merged

Conversation

kmcallister
Copy link
Contributor

@GuillaumeGomez
Copy link
Member

Thanks for the PR! However:

Linkcheck stage2 (x86_64-unknown-linux-gnu)
core/mem/fn.size_of_val.html:54: broken link - core/primitive.slice.html
core/mem/fn.forget.html:63: broken link - core/rc/struct.Rc.html
core/mem/fn.forget.html:64: broken link - core/process/fn.exit.html
core/mem/fn.forget.html:229: broken link - core/boxed/struct.Box.html
core/mem/fn.forget.html:229: broken link - core/boxed/struct.Box.html
core/mem/fn.uninitialized.html:69: broken link - core/ptr/fn.copy.html
core/mem/fn.uninitialized.html:69: broken link - core/ptr/fn.copy_nonoverlapping.html

/// [box]: ../boxed/struct.Box.html
/// [into_raw]: ../boxed/struct.Box.html#method.into_raw
/// [ub]: ../../reference.html#behavior-considered-undefined
/// ```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this "```" is too much.

@GuillaumeGomez
Copy link
Member

I don't know if there are other missing urls but could add urls to all types/traits please? (Like Drop.)

/// Returns the ABI-required minimum alignment of a type
/// Returns the [ABI][]-required minimum alignment of a type.
///
/// Every valid address of a value of the type `T` must be a multiple of this number.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: while current version is not wrong IMO “Every valid address to a value of the type” reads better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really? I think "pointer to" is fine but "address to" sounds weird to me. I chose "address" because it focuses on the numerical value of the pointer, rather than the pointer itself, which is a more abstract type.

@kmcallister
Copy link
Contributor Author

Thanks for the review! I've addressed your comments.

@GuillaumeGomez
Copy link
Member

Now please squash your commits. If you don't know how to do, take a look here.

@kmcallister
Copy link
Contributor Author

Squashed and rebased to master.

///
/// This effectively does nothing for
/// [types which implement `Copy`](../../book/ownership.html#copy-types),
/// e.g. integers. Such values are copied and _then_ moved into the function,
/// so the value persists after this function call.
///
/// This function is not magic; it is literally defined as
///
/// ```rust,ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be rust,no_run instead of rust,ignore?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just no_run actually. :p

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually runnable; I was thinking the name clash with the prelude would be a problem, but it just shadows I think.

@frewsxcv
Copy link
Member

frewsxcv commented Sep 9, 2016

These changes are great! Thanks @kmcallister!

@kmcallister
Copy link
Contributor Author

I made that last no_run change. I think this is ready to go now?

/// Rust drops it automatically, like at the end of a scope or after a panic.
/// Running the destructor on an uninitialized value would be [undefined behavior][ub].
///
/// ```rust
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for rust.

@GuillaumeGomez
Copy link
Member

Thanks!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Sep 10, 2016

📌 Commit 72e103f has been approved by GuillaumeGomez

@bors
Copy link
Contributor

bors commented Sep 11, 2016

⌛ Testing commit 72e103f with merge 89752d1...

@bors
Copy link
Contributor

bors commented Sep 11, 2016

💔 Test failed - auto-mac-64-opt-rustbuild

@alexcrichton
Copy link
Member

@bors: retry

On Sat, Sep 10, 2016 at 6:00 PM, bors notifications@github.com wrote:

💔 Test failed - auto-mac-64-opt-rustbuild
https://buildbot.rust-lang.org/builders/auto-mac-64-opt-rustbuild/builds/2432


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#36357 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAD95IUncF-0OSBznm79owr7Y05eS8oQks5qo1KbgaJpZM4J4q1C
.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 13, 2016
bors added a commit that referenced this pull request Sep 13, 2016
Rollup of 5 pull requests

- Successful merges: #36357, #36380, #36389, #36397, #36402
- Failed merges:
@bors bors merged commit 72e103f into rust-lang:master Sep 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants