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 12 pull requests #76265

Merged
merged 36 commits into from
Sep 3, 2020
Merged

Rollup of 12 pull requests #76265

merged 36 commits into from
Sep 3, 2020

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

LukasKalbertodt and others added 30 commits August 30, 2020 21:08
These methods are like the ones on `std::array::FixedSizeArray`
and in the crate `arraytools`.
Constify the following methods of `std::net::Ipv4Addr`:
 - `octets`
 - `is_loopback`
 - `is_private`
 - `is_link_local`
 - `is_shared`
 - `is_ietf_protocol_assignment`
 - `is_benchmarking`
 - `is_multicast`
 - `is_documentation`

Also insta-stabilizes these methods as const.

Possible because of the stabilization of const integer arithmetic and control flow.
Makes the following methods of `std::net::Ipv4Addr` unstable const under the `const_ipv4` feature:
 - `is_global`
 - `is_reserved`
 - `is_broadcast`
 - `to_ipv6_compatible`
 - `to_ipv6_mapped`

This results in all methods of `Ipv4Addr` being const.

Also adds tests for these methods in a const context.
The HIR Id trick is insufficient to prevent query cycles when optimizing
generators, since merely requesting a layout of a generator also
computes its `optimized_mir`.

Make no attempts to inline functions into generators within the same
crate to avoid query cycles.
`try_reserve` and `try_reserve_exact` docs refer to calling `reserve` and `reserve_exact`.
`try_reserve_exact` example uses `try_reserve` method instead of `try_reserve_exact`.
…le, r=LukasKalbertodt

Add a note for Ipv4Addr::to_ipv6_compatible

Previous discussion: rust-lang#75019

> I think adding a comment saying "This isn't typically the method you want; these addresses don't typically function on modern systems. Use `to_ipv6_mapped` instead." would be a good first step, whether this method gets marked as deprecated or not.

_Originally posted by @joshtriplett in rust-lang#75150 (comment)
…-to-array, r=Mark-Simulacrum

Add `[T; N]::as_[mut_]slice`

Part of me trying to populate arrays with a couple of basic useful methods, like slices already have. The ability to add methods to arrays were added in rust-lang#75212.  Tracking issue: rust-lang#76118

This adds:

```rust
impl<T, const N: usize> [T; N] {
    pub fn as_slice(&self) -> &[T];
    pub fn as_mut_slice(&mut self) -> &mut [T];
}
```

These methods are like the ones on `std::array::FixedSizeArray` and in the crate `arraytools`.
Make all methods of `std::net::Ipv4Addr` const

Make the following methods of `std::net::Ipv4Addr` unstable const under the `const_ipv4` feature:
 - `octets`
 - `is_loopback`
 - `is_private`
 - `is_link_local`
 - `is_global` (unstable)
 - `is_shared` (unstable)
 - `is_ietf_protocol_assignment` (unstable)
 - `is_benchmarking` (unstable)
 - `is_reserved` (unstable)
 - `is_multicast`
 - `is_broadcast`
 - `is_documentation`
 - `to_ipv6_compatible`
 - `to_ipv6_mapped`

This would make all methods of `Ipv6Addr` const.

Of these methods, `is_global`, `is_broadcast`, `to_ipv6_compatible`, and `to_ipv6_mapped` require a change in implementation.

Part of rust-lang#76205
…tic, r=petrochenkov

Replace MinGW library hack with heuristic controlling link mode

Depends on rust-lang#76158
Closes rust-lang#68887
…=scottmcm

Rename and expose LoopState as ControlFlow

Basic PR for rust-lang#75744. Addresses everything there except for documentation; lots of examples are probably a good idea.
…terator, r=jyn514

Move to intra-doc links for library/core/src/iter/traits/iterator.rs

Helps with rust-lang#75080.

@jyn514 We're almost finished with this issue. Thanks for mentoring. If you have other topics to work on just let me know, I will be around in Discord.

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

Known issues:

* Link from `core` to `std` (rust-lang#74481):

    [`OsStr`]
    [`String`]
    [`VecDeque<T>`]
Fix typos in vec try_reserve(_exact) docs

`try_reserve` and `try_reserve_exact` docs refer to calling `reserve` and `reserve_exact`.
`try_reserve_exact` example uses `try_reserve` method instead of `try_reserve_exact`.
…ic-morse

inliner: Avoid query cycles when optimizing generators

The HIR Id trick is insufficient to prevent query cycles when optimizing
generators, since merely requesting a layout of a generator also
computes its `optimized_mir`.

Make no attempts to inline functions into generators within the same
crate to avoid query cycles.

Fixes rust-lang#76181.
Update books

## reference

4 commits in 1b6c4b0afab97c0230433466c97167bbbe8445f6..25391dba46262f882fa846beefaff54a966a8fa5
2020-08-18 17:04:28 -0700 to 2020-09-02 07:22:55 -0700
- clarify when reading uninititalized memory is allowed (rust-lang/reference#852)
- Update patterns chapter, add rest patterns. (rust-lang/reference#876)
- Improve Type-Coersion Documentation (rust-lang/reference#843)
- Added variable back into example. (rust-lang/reference#880)

## book

3 commits in c0a6a61b8205da14ac955425f74258ffd8ee065d..e5ed97128302d5fa45dbac0e64426bc7649a558c
2020-08-14 14:21:49 -0500 to 2020-08-31 12:53:40 -0500
- Fix type mismatch in listing 10-5 (rust-lang/book#2441)
- Update ppendix-06-translation.md (rust-lang/book#2437)
- Correct no-listing-10-result-in-tests: Take tests module out of the main function (rust-lang/book#2430)

## rust-by-example

3 commits in 80a10e22140e28392b99d24ed02f4c6d8cb770a0..19f0a0372af497b34369cf182d9d16156cab2969
2020-08-08 09:56:46 -0300 to 2020-08-26 09:38:48 -0300
- prefer `length` over `size` when talking about number of elements vs. bytesize (rust-lang/rust-by-example#1372)
- Split out variable shadowing into a separate example (rust-lang/rust-by-example#1370)
- Update extern crate related sections (rust-lang/rust-by-example#1369)

## edition-guide

1 commits in bd6e4a9f59c5c1545f572266af77f5c7a5bad6d1..81f16863014de60b53de401d71ff904d163ee030
2020-07-12 17:37:08 -0500 to 2020-08-27 13:56:31 -0700
- Fix a small typo. (rust-lang/edition-guide#218)
…rker, r=jyn514

Use intra-doc links in `core::marker`

Part of rust-lang#75080.

Also cleaned up a few things.

---

@rustbot modify labels: A-intra-doc-links T-doc
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Sep 3, 2020

📌 Commit af331a2 has been approved by Dylan-DPC

@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 Sep 3, 2020
@bors
Copy link
Contributor

bors commented Sep 3, 2020

⌛ Testing commit af331a2 with merge 4f66117...

@bors
Copy link
Contributor

bors commented Sep 3, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: Dylan-DPC
Pushing 4f66117 to master...

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