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 15 pull requests #78838

Closed
wants to merge 40 commits into from
Closed

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Nov 7, 2020

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

CDirkx and others added 30 commits September 2, 2020 02:35
Insta-stabilize the methods `is_ready` and `is_pending` of `Poll`.

Possible because of the recent stabilization of const control flow.

Also adds a test for these methods in a const context.
POSIX leaves it implementation-defined whether `link` follows symlinks.
In practice, for example, on Linux it does not and on FreeBSD it does.
So, switch to `linkat`, so that we can pick a behavior rather than
depending on OS defaults.

Pick the option to not follow symlinks. This is somewhat arbitrary, but
seems the less surprising choice because hard linking is a very
low-level feature which requires the source and destination to be on
the same mounted filesystem, and following a symbolic link could end
up in a different mounted filesystem.
Due to the recent release of 1.47.0, this PR will be stabilized in 1.49.0 instead of 1.48.0.
Also mention that where possible, `hard_link` does not follow symlinks.
According to [the bionic status page], `linkat` has only been available
since API level 21. Since Android is based on Linux and Linux's `link`
doesn't follow symlinks, just use `link` on Android.

[the bionic status page]: https://android.googlesource.com/platform/bionic/+/master/docs/status.md
This adds a binary called `x` in `src/tools/x`. All it does is check the
current directory and its ancestors for a file called `x.py`, and if it
finds one, runs it.

By installing x, you can easily `x.py` from any subdirectory.

It can be installed globally with `cargo install --path src/tools/x`
Also includes:
- Cell::into_inner
- RefCell::into_inner
- Atomic*::into_inner
Previously, trying to allow this would give another error!

```
warning: unknown lint: `private_intra_doc_links`
 --> private.rs:1:10
  |
1 | #![allow(private_intra_doc_links)]
  |          ^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `broken_intra_doc_links`
  |
  = note: `#[warn(unknown_lints)]` on by default

warning: public documentation for `DocMe` links to private item `DontDocMe`
 --> private.rs:2:11
  |
2 | /// docs [DontDocMe]
  |           ^^^^^^^^^ this item is private
  |
  = note: `#[warn(private_intra_doc_links)]` on by default
  = note: this link will resolve properly if you pass `--document-private-items`
```
This is really starting to get out of hand. Rustdoc should instead allow
all lints in the rustdoc lint group.
Partially fix rust-lang#55002, deprecate in another release

Co-authored-by: Ashley Mannix <kodraus@hey.com>

Update stable version for stabilize_spin_loop

Co-authored-by: Joshua Nelson <joshua@yottadb.com>

Use better example for spinlock

As suggested by KodrAus

Remove renamed_spin_loop already available in master

Fix spin loop example
Includes:
- io::Cursor::new
- io::Cursor::get_ref
- io::Cursor::position
- io::empty
- io::repeat
- io::sink
…rAus

Stabilize hint::spin_loop

Partially fix rust-lang#55002, deprecate in another release

r? ``@KodrAus``
Stabilize `Poll::is_ready` and `is_pending` as const

Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198).

Possible because of the recent stabilization of const control flow.

Part of rust-lang#76225.
…olnay

Define `fs::hard_link` to not follow symlinks.

POSIX leaves it [implementation-defined] whether `link` follows symlinks.
In practice, for example, on Linux it does not and on FreeBSD it does.
So, switch to `linkat`, so that we can pick a behavior rather than
depending on OS defaults.

Pick the option to not follow symlinks. This is somewhat arbitrary, but
seems the less surprising choice because hard linking is a very
low-level feature which requires the source and destination to be on
the same mounted filesystem, and following a symbolic link could end
up in a different mounted filesystem.

[implementation-defined]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html
make concurrency helper more pleasant to read
Recognize `private_intra_doc_links` as a lint

Previously, trying to allow this would give another error!

```
warning: unknown lint: `private_intra_doc_links`
 --> private.rs:1:10
  |
1 | #![allow(private_intra_doc_links)]
  |          ^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `broken_intra_doc_links`
  |
  = note: `#[warn(unknown_lints)]` on by default

warning: public documentation for `DocMe` links to private item `DontDocMe`
 --> private.rs:2:11
  |
2 | /// docs [DontDocMe]
  |           ^^^^^^^^^ this item is private
  |
  = note: `#[warn(private_intra_doc_links)]` on by default
  = note: this link will resolve properly if you pass `--document-private-items`
```

Fixes the issue found in rust-lang#77249 (comment).

r? ```@Manishearth```

Does anyone know why this additional step is necessary? It seems weird this has to be declared in 3 different places.
… r=Mark-Simulacrum

BTreeMap: stop mistaking node for an orderly place

A second mistake in rust-lang#77612 was to ignore the node module's rightful comment "this module doesn't care whether the entries are sorted". And there's a much simpler way to visit the keys in order, if you check this separately from a single pass checking everything.

r? ```@Mark-Simulacrum```
…crum

fix some incorrect aliasing in the BTree

This line is wrong:
```
ptr::copy(slice.as_ptr().add(idx), slice.as_mut_ptr().add(idx + 1), slice.len() - idx);
```
When `slice.as_mut_ptr()` is called, that creates a mutable reference to the entire slice, which invalidates the raw pointer previously returned by `slice.as_ptr()`. (Miri currently misses this because raw pointers are not tracked properly.)

Cc ```@ssomers```
…-size, r=jyn514

Remove FIXME comment in print_type_sizes ui test suite

## Overview
Helps with rust-lang#62277

> The type sizes are likely only printed when the actual layout is computed. For generic types, this only happens during codegen.

ref: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Codegen.20process.20question/near/215836807

Some tests like `multiple_types.rs` are passed even if using `check-pass`. But tests should be agnostic to when the actual layout is computed. The `build-pass` is intentionally used for them. I remove FIXME comments.
Use SOCK_CLOEXEC and accept4() on more platforms.

This PR enables the use of `SOCK_CLOEXEC` and `accept4` on more platforms.

-----

Android uses the linux kernel, so it should also support it.

DragonflyBSD introduced them in 4.4 (December 2015):
https://www.dragonflybsd.org/release44/

FreeBSD introduced them in 10.0 (January 2014):
https://wiki.freebsd.org/AtomicCloseOnExec

Illumos introduced them in a commit in April 2013, not sure when it was released. It is quite possible that is has always been in Illumos:
illumos/illumos-gate@5dbfd19
https://illumos.org/man/3socket/socket
https://illumos.org/man/3socket/accept4

NetBSD introduced them in 6.0 (Oktober 2012) and 8.0 (July 2018):
https://man.netbsd.org/NetBSD-6.0/socket.2
https://man.netbsd.org/NetBSD-8.0/accept.2

OpenBSD introduced them in 5.7 (May 2015):
https://man.openbsd.org/socket https://man.openbsd.org/accept
Add a tool to run `x.py` from any subdirectory

This adds a binary called `x` in `src/tools/x`. All it does is check the current directory and its ancestors for a file called `x.py`, and if it finds one, runs it.

By installing x, you can easily run `x.py` from any subdirectory, and only need to type `x`.

It can be installed with `cargo install --path src/tools/x`

This is a copy of a [binary I've been using myself when working on rust](https://github.com/casey/bootstrap), currently published to crates.io as `bootstrap`.

It could be changed to avoid indirecting through `x.py`, and instead call the bootstrap module directly. However, this seemed like the simplest thing possible, and won't break if the details of how the bootstrap module is invoked change.
…=Mark-Simulacrum

Fix run-make tests running when LLVM is disabled

The `--cc`, `--cxx`, `--cflags` and `--ar` flags were only passed to compiletest when `builder.config.llvm_enabled()` returned true. This is preventing me from running the tests on cg_clif.
…lnay

Constantify `UnsafeCell::into_inner` and related

Tracking issue: rust-lang#78729

This PR constantifies:
- `UnsafeCell::into_inner`
- `Cell::into_inner`
- `RefCell::into_inner`
- `Atomic*::into_inner`

r? ``@dtolnay``
Correct unsigned equivalent of isize to be usize

See [rust-lang#74913 (comment)](rust-lang#74913 (comment)) for why this matters. Apparently it hasn't been used anywhere else, though CI will tell for sure.
Make some std::io functions `const`

Tracking issue: rust-lang#78812

Make the following functions `const`:
- `io::Cursor::new`
- `io::Cursor::get_ref`
- `io::Cursor::position`
- `io::empty`
- `io::repeat`
- `io::sink`

r? ``@dtolnay``
use single char patterns for split() (clippy::single_char_pattern)
@rustbot rustbot added the rollup A PR which is a rollup label Nov 7, 2020
@m-ou-se
Copy link
Member Author

m-ou-se commented Nov 7, 2020

@bors r+ p=15 rollup=never

@bors
Copy link
Contributor

bors commented Nov 7, 2020

📌 Commit 43f2d70 has been approved by m-ou-se

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

bors commented Nov 7, 2020

⌛ Testing commit 43f2d70 with merge c5765371250b855f20075334e18485ae7e217e8b...

@rust-log-analyzer
Copy link
Collaborator

Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
##[debug]Evaluating job defaults
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v2'
##[debug]Download 'https://api.github.com/repos/actions/checkout/tarball/5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f' to '/home/runner/work/_actions/_temp_5ba9f228-14e0-47c6-91e8-23c545d69291/c6f8c45f-9a50-4373-b727-46118571b2a8.tar.gz'
##[debug]Unwrap 'actions-checkout-5a4ac90' to '/home/runner/work/_actions/actions/checkout/v2'
##[debug]Archive '/home/runner/work/_actions/_temp_5ba9f228-14e0-47c6-91e8-23c545d69291/c6f8c45f-9a50-4373-b727-46118571b2a8.tar.gz' has been unzipped into '/home/runner/work/_actions/actions/checkout/v2'.
Download action repository 'rust-lang/simpleinfra@master'
##[debug]Download 'https://api.github.com/repos/rust-lang/simpleinfra/tarball/825b781f5ce1c08493fb921b0d847d3bf6bc7d91' to '/home/runner/work/_actions/_temp_41f93e60-8b91-42b4-9327-43a4dcd5eb94/42d5334c-168a-491f-b53d-36db23cf4dad.tar.gz'
##[debug]Unwrap 'rust-lang-simpleinfra-825b781' to '/home/runner/work/_actions/rust-lang/simpleinfra/master'
##[debug]Archive '/home/runner/work/_actions/_temp_41f93e60-8b91-42b4-9327-43a4dcd5eb94/42d5334c-168a-491f-b53d-36db23cf4dad.tar.gz' has been unzipped into '/home/runner/work/_actions/rust-lang/simpleinfra/master'.
##[debug]action.yml for action: '/home/runner/work/_actions/rust-lang/simpleinfra/master/github-actions/cancel-outdated-builds/action.yml'.
##[debug]Set step 'run1' display name to: 'disable git crlf conversion'
##[debug]Set step 'actionscheckout' display name to: 'checkout the source code'
##[debug]Set step 'run2' display name to: 'configure the PR in which the error message will be posted'
---
::endgroup::
##[endgroup]
::group::Fetching the repository
##[group]Fetching the repository
[command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=2 origin +c5765371250b855f20075334e18485ae7e217e8b:refs/remotes/origin/auto

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@m-ou-se
Copy link
Member Author

m-ou-se commented Nov 7, 2020

src/ci/scripts/install-awscli.sh: line 32:  4457 Segmentation fault      sudo apt-get install -y python3-setuptools

👀

@m-ou-se m-ou-se closed this Nov 7, 2020
@m-ou-se m-ou-se deleted the rollup-ldxphut branch November 7, 2020 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.