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

Add missing examples for NonNull #87547

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

GuillaumeGomez
Copy link
Member

No description provided.

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

r? @kennytm

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 28, 2021
@GuillaumeGomez
Copy link
Member Author

Updated!

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

@bors: r=kennytm rollup

@bors
Copy link
Contributor

bors commented Jul 30, 2021

📌 Commit 1bbe618 has been approved by kennytm

@bors bors 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
…kennytm

Add missing examples for NonNull
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:master Jul 30, 2021
@rustbot rustbot 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
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
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
Member Author

Choose a reason for hiding this comment

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

Noted!

@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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant 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