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

Rollup of 8 pull requests #75653

Merged
merged 20 commits into from
Aug 18, 2020
Merged

Rollup of 8 pull requests #75653

merged 20 commits into from
Aug 18, 2020

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

poliorcetics and others added 20 commits August 12, 2020 22:58
When a user tries to use a method as if it returned a new value of the
same type as its receiver, we will emit a type error. Try to detect this
and provide extra explanation that the method modifies the receiver
in-place.

This has confused people in the wild, like in
https://users.rust-lang.org/t/newbie-why-the-commented-line-stops-the-snippet-from-compiling/47322
Change `UnsafetyViolationKind::General` to `UnsafetyViolationKind::GeneralAndConstFn` in check_unsafety.rs

Remove unsafe in min_const_fn_unsafe_bad.rs

Bless min_const_fn

Add the test case from issue 75340

Co-authored-by: lzutao <taolzu@gmail.com>
… of `as_ref` methods

Fix example in `NonNull::as_uninit_slice`


Rename feature gate to "ptr_as_uninit"


Make methods more consistent with already stable methods


Make `pointer::as_uninit_slice` return an `Option`


Fix placement for `// SAFETY` section


Add `as_uninit_ref` and `as_uninit_mut` to pointers


Fix doctest


Update tracking issue


Fix doc links


Apply suggestions from review


Make wording about counterparts consistent


Fix doc links


Improve documentation

Fix doc-tests


Fix doc links ... again


Apply suggestions from review


Apply suggestions from Review


Apply suggestion from review to all affected files


Add missing words in safety sections in `as_uninit_slice_mut`


Fix safety-comment in `NonNull::as_uninit_slice_mut`
attempt to improve span_label docs

I was still confused by the `span_label` docs, so I did some more digging. However, this needs careful checking as I have no idea if any of this is correct.
…r=RalfJung

Add `as_uninit`-like methods to pointer types and unify documentation of `as_ref` methods

This adds a convenient method to retrieve a `&(mut) [MaybeUninit<T>]` from slice pointers (`*const [T]`, `*mut [T]`, `NonNull<[T]>`). See also rust-lang/wg-allocators#66 (comment).

~I'll add a tracking issue as soon as it's reviewed and CI passed.~
Tracking Issue: rust-lang#75402

r? @RalfJung
…ascii, r=jyn514

Move to intra doc links for ascii.rs and panic.rs

Helps with rust-lang#75080.

@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc

I also updated the doc to fix the wording in `AsciiExt` since it is now deprecated.
The two file are small changes so I bundled them together.

Some links could not be changed to make them work, I believe those are known issues with primitive types.
Allowing raw ptr dereference in const fn

Reflect on issue rust-lang#75340
Discussion in previous PR  rust-lang#75425

## Updates
Change `UnsafetyViolationKind::General` to `UnsafetyViolationKind::GeneralAndConstFn` in check_unsafety.rs

Remove `unsafe` in min_const_fn_unsafe_bad.rs

Bless min_const_fn

Add the test case from issue 75340
***
Sorry for the chaos. I messed up and ended up deleting the repo in the last PR. I have to create a new PR for the new repo. I will make a feature branch next time. I will edit the old PR once I receive the commends.

@RalfJung Thank you all for your replies. They are helpful!

r? @oli-obk
…ochenkov

Add explanation for `&mut self` method call when expecting `-> Self`

When a user tries to use a method as if it returned a new value of the
same type as its receiver, we will emit a type error. Try to detect this
and provide extra explanation that the method modifies the receiver
in-place.

This has confused people in the wild, like in
https://users.rust-lang.org/t/newbie-why-the-commented-line-stops-the-snippet-from-compiling/47322
…jyn514

Use intra-doc links in `std::env`, `std::alloc` and `std::error`

This is partial fixes for rust-lang#75080.
Mark x86_64-linux-kernel as *

This should fix rust-lang#75581.

This is my first contribution to the Rust organization. Please, feel free to tell me if I did anything wrong :)
@JohnTitor
Copy link
Member Author

@bors r+ p=5 rollup=never
@rustbot modify labels: +rollup

@bors
Copy link
Contributor

bors commented Aug 18, 2020

📌 Commit 51154d8 has been approved by JohnTitor

@rustbot rustbot added the rollup A PR which is a rollup label Aug 18, 2020
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 18, 2020
@bors
Copy link
Contributor

bors commented Aug 18, 2020

⌛ Testing commit 51154d8 with merge d7dcae0...

@bors
Copy link
Contributor

bors commented Aug 18, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: JohnTitor
Pushing d7dcae0 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 18, 2020
@bors bors merged commit d7dcae0 into rust-lang:master Aug 18, 2020
@JohnTitor JohnTitor deleted the rollup-0ejtdfo branch August 18, 2020 03:35
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.