Skip to content

Add missing examples for NonNull - #87547

Merged
bors merged 1 commit into
rust-lang:masterfrom
GuillaumeGomez:nonnull-examples
Jul 30, 2021
Merged

Add missing examples for NonNull#87547
bors merged 1 commit into
rust-lang:masterfrom
GuillaumeGomez:nonnull-examples

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

No description provided.

@GuillaumeGomezGuillaumeGomez added A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 28, 2021
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @kennytm

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 28, 2021
Comment threadlibrary/core/src/ptr/non_null.rs Outdated
@GuillaumeGomez

Copy link
Copy Markdown
MemberAuthor

Updated!

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez

Copy link
Copy Markdown
MemberAuthor

@bors: r=kennytm rollup

@bors

bors commented Jul 30, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit 1bbe618 has been approved by kennytm

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 30, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jul 30, 2021
This was referenced Jul 30, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 30, 2021
Rollup of 9 pull requests
Successful merges:
- rust-lang#86072 (Cross compiling rustc_llvm on Darwin requires zlib.)
- rust-lang#87385 (Make `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` warn by default)
- rust-lang#87547 (Add missing examples for NonNull)
- rust-lang#87557 (Fix issue with autofix for ambiguous associated function from Rust 2021 prelude when struct is generic)
- rust-lang#87559 (Tweak borrowing suggestion in `for` loop)
- rust-lang#87596 (Add warning when whitespace is not skipped after an escaped newline)
- rust-lang#87606 (Add some TAIT-related regression tests)
- rust-lang#87609 (Add docs about performance and `Iterator::map` to `[T; N]::map`)
- rust-lang#87616 (Fix missing word in rustdoc book)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit f7a2a22 into rust-lang:masterJul 30, 2021
@rustbotrustbot added this to the 1.56.0 milestone Jul 30, 2021
/// let ptr = unsafe { NonNull::new_unchecked(&mut x as *mut _) };
///
/// // NEVER DO THAT!!!
/// let ptr = unsafe { NonNull::<u32>::new_unchecked(std::ptr::null_mut()) };

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please mark testcases that cause UB as no_run (see e.g. the MaybeUninit docs).
Otherwise, https://github.com/rust-lang/miri-test-libstd/ will fail.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See #87653

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Noted!

@RalfJungRalfJung mentioned this pull request Jul 31, 2021
@GuillaumeGomez
GuillaumeGomez deleted the nonnull-examples branch July 31, 2021 10:30
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Aug 2, 2021
mark a UB doctest as no_run
See rust-lang#87547 (comment)
Cc `@GuillaumeGomez` `@kennytm`
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libsRelevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@GuillaumeGomez@rust-highfive@rust-log-analyzer@bors@kennytm@RalfJung@rustbot