]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoadd test for where clauses mentioning const params
Bastian Kauschke [Tue, 10 Nov 2020 09:38:36 +0000 (10:38 +0100)]
add test for where clauses mentioning const params

3 years agoconst param in async
Bastian Kauschke [Tue, 10 Nov 2020 09:31:33 +0000 (10:31 +0100)]
const param in async

3 years agotry referencing outer params
Bastian Kauschke [Tue, 10 Nov 2020 09:21:11 +0000 (10:21 +0100)]
try referencing outer params

3 years agoexhaustively enumerate all values of a const param
Bastian Kauschke [Tue, 10 Nov 2020 09:08:51 +0000 (10:08 +0100)]
exhaustively enumerate all values of a const param

3 years agoadd associated type bounds test
Bastian Kauschke [Tue, 10 Nov 2020 09:02:19 +0000 (10:02 +0100)]
add associated type bounds test

3 years agoadd macro_rules test regarding braces
Bastian Kauschke [Tue, 10 Nov 2020 08:48:04 +0000 (09:48 +0100)]
add macro_rules test regarding braces

3 years agoadd generic param mismatch test
Bastian Kauschke [Tue, 10 Nov 2020 08:35:02 +0000 (09:35 +0100)]
add generic param mismatch test

3 years agoconst param macro test
Bastian Kauschke [Tue, 10 Nov 2020 08:29:27 +0000 (09:29 +0100)]
const param macro test

3 years agoAuto merge of #78201 - joshtriplett:rustc-tls-model, r=Mark-Simulacrum
bors [Mon, 9 Nov 2020 11:08:07 +0000 (11:08 +0000)]
Auto merge of #78201 - joshtriplett:rustc-tls-model, r=Mark-Simulacrum

Compile rustc crates with the initial-exec TLS model

This should produce more efficient code, with fewer calls to
__tls_get_addr. The tradeoff is that libraries using it won't work with
dlopen, but that shouldn't be a problem for rustc's internal libraries.

3 years agoAuto merge of #78889 - Dylan-DPC:rollup-6zjhahf, r=Dylan-DPC
bors [Mon, 9 Nov 2020 00:36:58 +0000 (00:36 +0000)]
Auto merge of #78889 - Dylan-DPC:rollup-6zjhahf, r=Dylan-DPC

Rollup of 12 pull requests

Successful merges:

 - #77640 (Refactor IntErrorKind to avoid "underflow" terminology)
 - #78026 (Define `fs::hard_link` to not follow symlinks.)
 - #78114 (Recognize `private_intra_doc_links` as a lint)
 - #78228 (Promote aarch64-unknown-linux-gnu to Tier 1)
 - #78345 (Fix handling of item names for HIR)
 - #78437 (BTreeMap: stop mistaking node for an orderly place)
 - #78476 (fix some incorrect aliasing in the BTree)
 - #78674 (inliner: Use substs_for_mir_body)
 - #78748 (Implement destructuring assignment for tuples)
 - #78868 (Fix tab focus on restyled switches)
 - #78878 (Avoid overlapping cfg attributes when both macOS and aarch64)
 - #78882 (Nicer hunk headers for rust files)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #78882 - bjorn3:nicer_hunk_headers, r=Mark-Simulacrum
Dylan DPC [Mon, 9 Nov 2020 00:13:50 +0000 (01:13 +0100)]
Rollup merge of #78882 - bjorn3:nicer_hunk_headers, r=Mark-Simulacrum

Nicer hunk headers for rust files

I found this trick at <https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more>

Before the hunk headers for changes in methods would refer to the impl:

```diff
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..fa4264d729b 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
``@@`` -678,7 +678,7 ``@@`` impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
             ref closure_captures,
             ref generator_interior_types,
         } = *self;
-
+        // foo
         hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
             type_dependent_defs.hash_stable(hcx, hasher);
             field_indices.hash_stable(hcx, hasher);
```

After the hunk headers refer to the actual function signature:

```diff
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..fa4264d729b 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
``@@`` -678,7 +678,7 ``@@`` fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHas
             ref closure_captures,
             ref generator_interior_types,
         } = *self;
-
+        // foo
         hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
             type_dependent_defs.hash_stable(hcx, hasher);
             field_indices.hash_stable(hcx, hasher);
```

When the function signature is visible, it will use the function
signature of the previous method as hunk header:

```diff
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..63058dfc837 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
``@@`` -992,6 +992,7 ``@@`` pub fn typeck_opt_const_arg(
     }

     pub fn alloc_steal_mir(self, mir: Body<'tcx>) -> &'tcx Steal<Body<'tcx>> {
+        // foo
         self.arena.alloc(Steal::new(mir))
     }
```

3 years agoRollup merge of #78878 - shepmaster:intersecting-ignores, r=Mark-Simulacrum
Dylan DPC [Mon, 9 Nov 2020 00:13:48 +0000 (01:13 +0100)]
Rollup merge of #78878 - shepmaster:intersecting-ignores, r=Mark-Simulacrum

Avoid overlapping cfg attributes when both macOS and aarch64

r? ``@Mark-Simulacrum``

3 years agoRollup merge of #78868 - notriddle:master, r=GuillaumeGomez
Dylan DPC [Mon, 9 Nov 2020 00:13:46 +0000 (01:13 +0100)]
Rollup merge of #78868 - notriddle:master, r=GuillaumeGomez

Fix tab focus on restyled switches

Setting a checkbox to `display:none` makes it impossible to tab onto it, which makes the rustdoc settings page completely keyboard inaccessible.

3 years agoRollup merge of #78748 - fanzier:tuple-assignment, r=petrochenkov
Dylan DPC [Mon, 9 Nov 2020 00:13:44 +0000 (01:13 +0100)]
Rollup merge of #78748 - fanzier:tuple-assignment, r=petrochenkov

Implement destructuring assignment for tuples

This is the first step towards implementing destructuring assignment (RFC: https://github.com/rust-lang/rfcs/pull/2909, tracking issue: #71126). This PR is the first part of #71156, which was split up to allow for easier review.

Quick summary: This change allows destructuring the LHS of an assignment if it's a (possibly nested) tuple.
It is implemented via a desugaring (AST -> HIR lowering) as follows:
```rust
(a,b) = (1,2)
```
... becomes ...
```rust
{
  let (lhs0,lhs1) = (1,2);
  a = lhs0;
  b = lhs1;
}
```

Thanks to `@varkor` who helped with the implementation, particularly around default binding modes.

r? `@petrochenkov`

3 years agoRollup merge of #78674 - tmiasko:inline-substs-for-mir-body, r=oli-obk
Dylan DPC [Mon, 9 Nov 2020 00:13:42 +0000 (01:13 +0100)]
Rollup merge of #78674 - tmiasko:inline-substs-for-mir-body, r=oli-obk

inliner: Use substs_for_mir_body

Changes from 68965 extended the kind of instances that are being
inlined. For some of those, the `instance_mir` returns a MIR body that
is already expressed in terms of the types found in substitution array,
and doesn't need further substitution.

Use `substs_for_mir_body` to take that into account.

Resolves #78529.
Resolves #78560.

3 years agoRollup merge of #78476 - RalfJung:btree-alias, r=Mark-Simulacrum
Dylan DPC [Mon, 9 Nov 2020 00:13:40 +0000 (01:13 +0100)]
Rollup merge of #78476 - RalfJung:btree-alias, r=Mark-Simulacrum

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

3 years agoRollup merge of #78437 - ssomers:btree_no_ord_at_node_level, r=Mark-Simulacrum
Dylan DPC [Mon, 9 Nov 2020 00:13:38 +0000 (01:13 +0100)]
Rollup merge of #78437 - ssomers:btree_no_ord_at_node_level, r=Mark-Simulacrum

BTreeMap: stop mistaking node for an orderly place

A second mistake in #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````````

3 years agoRollup merge of #78345 - jyn514:proper-names, r=varkor
Dylan DPC [Mon, 9 Nov 2020 00:13:35 +0000 (01:13 +0100)]
Rollup merge of #78345 - jyn514:proper-names, r=varkor

Fix handling of item names for HIR

- Handle variants, fields, macros in `Node::ident()`
- Handle the crate root in `opt_item_name`
- Rewrite `item_name` in terms of `opt_item_name`

I need this for both https://github.com/rust-lang/rust/pull/77820 and https://github.com/rust-lang/rust/pull/78082, so splitting it out into a separate PR so it can land early.

3 years agoRollup merge of #78228 - pietroalbini:finally, r=Mark-Simulacrum
Dylan DPC [Mon, 9 Nov 2020 00:13:33 +0000 (01:13 +0100)]
Rollup merge of #78228 - pietroalbini:finally, r=Mark-Simulacrum

Promote aarch64-unknown-linux-gnu to Tier 1

This PR promotes the `aarch64-unknown-linux-gnu` target to Tier 1, as proposed by [RFC 2959]:

* The `aarch64-gnu` CI job is moved from `auto-fallible` to `auto`.
* The platform support documentation is updated, uplifting the target to Tiert 1 with a note about missing stack probes support.
* Building the documentation is enabled for the target, as we produce the `rust-docs` component for all Tier 1 platforms.

[RFC 2959]: https://github.com/rust-lang/rfcs/pull/2959

3 years agoRollup merge of #78114 - jyn514:private, r=oli-obk
Dylan DPC [Mon, 9 Nov 2020 00:13:31 +0000 (01:13 +0100)]
Rollup merge of #78114 - jyn514:private, r=oli-obk

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 https://github.com/rust-lang/rust/pull/77249#issuecomment-712339227.

r? ````````@Manishearth````````

Does anyone know why this additional step is necessary? It seems weird this has to be declared in 3 different places.

3 years agoRollup merge of #78026 - sunfishcode:symlink-hard-link, r=dtolnay
Dylan DPC [Mon, 9 Nov 2020 00:13:28 +0000 (01:13 +0100)]
Rollup merge of #78026 - sunfishcode:symlink-hard-link, r=dtolnay

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

3 years agoRollup merge of #77640 - ethanboxx:int_error_matching_attempt_2, r=KodrAus
Dylan DPC [Mon, 9 Nov 2020 00:13:25 +0000 (01:13 +0100)]
Rollup merge of #77640 - ethanboxx:int_error_matching_attempt_2, r=KodrAus

Refactor IntErrorKind to avoid "underflow" terminology

This PR is a continuation of #76455

# Changes

- `Overflow` renamed to `PosOverflow` and `Underflow` renamed to `NegOverflow` after discussion in #76455
- Changed some of the parsing code to return `InvalidDigit` rather than `Empty` for strings "+" and "-". https://users.rust-lang.org/t/misleading-error-in-str-parse-for-int-types/49178
- Carry the problem `char` with the `InvalidDigit` variant.
- Necessary changes were made to the compiler as it depends on `int_error_matching`.
- Redid tests to match on specific errors.

r? ```@KodrAus```

3 years agoAuto merge of #78712 - petrochenkov:visitok, r=Aaron1011
bors [Sun, 8 Nov 2020 20:00:51 +0000 (20:00 +0000)]
Auto merge of #78712 - petrochenkov:visitok, r=Aaron1011

rustc_ast: Visit tokens stored in AST nodes in mutable visitor

After #77271 token visiting is enabled only for one visitor in `rustc_expand\src\mbe\transcribe.rs` which applies hygiene marks to tokens produced by declarative macros (`macro_rules` or `macro`), so this change doesn't affect anything else.

When a macro has some interpolated token from an outer macro in its output
```rust
macro inner() {
    $interpolated
}
```
we can use the usual interpretation of interpolated tokens in token-based model - a None-delimited group - to write this macro in an equivalent form
```rust
macro inner() {
    ⟪ a b c d ⟫
}
```

When we are expanding the macro `inner` we need to apply hygiene marks to all tokens produced by it, including the tokens inside the group.

Before this PR we did this by visiting the AST piece inside the interpolated token and applying marks to all spans in it.
I'm not sure this is 100% correct (ideally we should apply the marks to tokens and then re-parse the AST from tokens), but it's a very good approximation at least.
We didn't however apply the marks to actual tokens stored in the nonterminal, so if we used the nonterminal as a token rather than as an AST piece (e.g. passed it to a proc macro), then we got hygiene bugs.
This PR applies the marks to tokens in addition to the AST pieces thus fixing the issue.

r? `@Aaron1011`

3 years agoNicer hunk headers for rust files
bjorn3 [Sun, 8 Nov 2020 15:40:00 +0000 (16:40 +0100)]
Nicer hunk headers for rust files

I found this trick at
<https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more>

Before the hunk headers for changes in methods would refer to the impl:

```diff
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..fa4264d729b 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -678,7 +678,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
             ref closure_captures,
             ref generator_interior_types,
         } = *self;
-
+        // foo
         hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
             type_dependent_defs.hash_stable(hcx, hasher);
             field_indices.hash_stable(hcx, hasher);
```

After the hunk headers refer to the actual function signature:

```diff
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..fa4264d729b 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -678,7 +678,7 @@ fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHas
             ref closure_captures,
             ref generator_interior_types,
         } = *self;
-
+        // foo
         hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
             type_dependent_defs.hash_stable(hcx, hasher);
             field_indices.hash_stable(hcx, hasher);
```

When the function signature is visible, it will use the function
signature of the previous method as hunk header:

```diff
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 1c6937e685c..63058dfc837 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -992,6 +992,7 @@ pub fn typeck_opt_const_arg(
     }

     pub fn alloc_steal_mir(self, mir: Body<'tcx>) -> &'tcx Steal<Body<'tcx>> {
+        // foo
         self.arena.alloc(Steal::new(mir))
     }
```

3 years agoAvoid overlapping cfg attributes when both macOS and aarch64
Jake Goulding [Sun, 8 Nov 2020 14:43:51 +0000 (09:43 -0500)]
Avoid overlapping cfg attributes when both macOS and aarch64

3 years agoAuto merge of #78874 - m-ou-se:rollup-3jp1ijj, r=m-ou-se
bors [Sun, 8 Nov 2020 13:49:17 +0000 (13:49 +0000)]
Auto merge of #78874 - m-ou-se:rollup-3jp1ijj, r=m-ou-se

Rollup of 19 pull requests

Successful merges:

 - #76097 (Stabilize hint::spin_loop)
 - #76227 (Stabilize `Poll::is_ready` and `is_pending` as const)
 - #78065 (make concurrency helper more pleasant to read)
 - #78570 (Remove FIXME comment in print_type_sizes ui test suite)
 - #78572 (Use SOCK_CLOEXEC and accept4() on more platforms.)
 - #78658 (Add a tool to run `x.py` from any subdirectory)
 - #78706 (Fix run-make tests running when LLVM is disabled)
 - #78728 (Constantify `UnsafeCell::into_inner` and related)
 - #78775 (Bump Rustfmt and RLS)
 - #78788 (Correct unsigned equivalent of isize to be usize)
 - #78811 (Make some std::io functions `const`)
 - #78828 (use single char patterns for split() (clippy::single_char_pattern))
 - #78841 (Small cleanup in `TypeFoldable` derive macro)
 - #78842 (Honor the rustfmt setting in config.toml)
 - #78843 (Less verbose debug logging from inlining integrator)
 - #78852 (Convert a bunch of intra-doc links)
 - #78860 (rustc_resolve: Use `#![feature(format_args_capture)]`)
 - #78861 (typo and formatting)
 - #78865 (Don't fire `CONST_ITEM_MUTATION` lint when borrowing a deref)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #78865 - Aaron1011:fix/const-item-mut-reborrow, r=varkor
Mara Bos [Sun, 8 Nov 2020 12:36:33 +0000 (13:36 +0100)]
Rollup merge of #78865 - Aaron1011:fix/const-item-mut-reborrow, r=varkor

Don't fire `CONST_ITEM_MUTATION` lint when borrowing a deref

Fixes #78819

This extends the check for dereferences added in PR #77324
to cover mutable borrows, as well as direct writes. If we're operating
on a dereference of a `const` item, we shouldn't be firing the lint.

3 years agoRollup merge of #78861 - o752d:patch-1, r=jonas-schievink
Mara Bos [Sun, 8 Nov 2020 12:36:32 +0000 (13:36 +0100)]
Rollup merge of #78861 - o752d:patch-1, r=jonas-schievink

typo and formatting

fixed a typo and modified some line formatting justification while I'm here :)

3 years agoRollup merge of #78860 - petrochenkov:resolvefmt, r=Mark-Simulacrum
Mara Bos [Sun, 8 Nov 2020 12:36:30 +0000 (13:36 +0100)]
Rollup merge of #78860 - petrochenkov:resolvefmt, r=Mark-Simulacrum

rustc_resolve: Use `#![feature(format_args_capture)]`

This is the best new sugar for quite some time.

(I only changed places that already used named arguments.)

3 years agoRollup merge of #78852 - camelid:intra-doc-bonanza, r=jyn514
Mara Bos [Sun, 8 Nov 2020 12:36:28 +0000 (13:36 +0100)]
Rollup merge of #78852 - camelid:intra-doc-bonanza, r=jyn514

Convert a bunch of intra-doc links

An intra-doc link bonanza!

This was accomplished using a bunch of trial-and-error with sed.

3 years agoRollup merge of #78843 - tmiasko:inline-trace, r=wesleywiser
Mara Bos [Sun, 8 Nov 2020 12:36:26 +0000 (13:36 +0100)]
Rollup merge of #78843 - tmiasko:inline-trace, r=wesleywiser

Less verbose debug logging from inlining integrator

The inlining integrator produces relatively verbose and uninteresting
logs.  Move them from a debug log level to a trace level, so that they
can be easily isolated from others.

3 years agoRollup merge of #78842 - shepmaster:bootstrap-rustfmt, r=Mark-Simulacrum
Mara Bos [Sun, 8 Nov 2020 12:36:25 +0000 (13:36 +0100)]
Rollup merge of #78842 - shepmaster:bootstrap-rustfmt, r=Mark-Simulacrum

Honor the rustfmt setting in config.toml

Prior to this, setting the rustfmt configuration was ignored:

```
% mkdir example

% cd example

% ../configure --set build.rustfmt=/usr/bin/true

% ../x.py fmt
./x.py fmt is not supported on this channel
failed to run: /Users/shep/Projects/rust/example/build/bootstrap/debug/bootstrap fmt
Build completed unsuccessfully in 0:00:01
```

And after:

```
% ../x.py fmt
Build completed successfully in 0:00:11
```

r? `@Mark-Simulacrum`

3 years agoRollup merge of #78841 - LeSeulArtichaut:foldable-derive, r=lcnr
Mara Bos [Sun, 8 Nov 2020 12:36:23 +0000 (13:36 +0100)]
Rollup merge of #78841 - LeSeulArtichaut:foldable-derive, r=lcnr

Small cleanup in `TypeFoldable` derive macro

r? ```@lcnr```

3 years agoRollup merge of #78828 - matthiaskrgr:sing_chr, r=lcnr
Mara Bos [Sun, 8 Nov 2020 12:36:21 +0000 (13:36 +0100)]
Rollup merge of #78828 - matthiaskrgr:sing_chr, r=lcnr

use single char patterns for split() (clippy::single_char_pattern)

3 years agoRollup merge of #78811 - a1phyr:const_io_structs, r=dtolnay
Mara Bos [Sun, 8 Nov 2020 12:36:19 +0000 (13:36 +0100)]
Rollup merge of #78811 - a1phyr:const_io_structs, r=dtolnay

Make some std::io functions `const`

Tracking issue: #78812

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

r? `````@dtolnay`````

3 years agoRollup merge of #78788 - jhpratt:isize-impl-fix, r=m-ou-se
Mara Bos [Sun, 8 Nov 2020 12:36:18 +0000 (13:36 +0100)]
Rollup merge of #78788 - jhpratt:isize-impl-fix, r=m-ou-se

Correct unsigned equivalent of isize to be usize

See [#74913 (comment)](https://github.com/rust-lang/rust/issues/74913#issuecomment-722334456) for why this matters. Apparently it hasn't been used anywhere else, though CI will tell for sure.

3 years agoRollup merge of #78775 - ghedo:bump-rustfmt-rls, r=Mark-Simulacrum
Mara Bos [Sun, 8 Nov 2020 12:36:16 +0000 (13:36 +0100)]
Rollup merge of #78775 - ghedo:bump-rustfmt-rls, r=Mark-Simulacrum

Bump Rustfmt and RLS

Should hopefully fix #78341 and fix #78340.

3 years agoRollup merge of #78728 - a1phyr:const_cell_into_inner, r=dtolnay
Mara Bos [Sun, 8 Nov 2020 12:36:14 +0000 (13:36 +0100)]
Rollup merge of #78728 - a1phyr:const_cell_into_inner, r=dtolnay

Constantify `UnsafeCell::into_inner` and related

Tracking issue: #78729

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

r? `````@dtolnay`````

3 years agoRollup merge of #78706 - bjorn3:fix_run_make_without_llvm, r=Mark-Simulacrum
Mara Bos [Sun, 8 Nov 2020 12:36:12 +0000 (13:36 +0100)]
Rollup merge of #78706 - bjorn3:fix_run_make_without_llvm, r=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.

3 years agoRollup merge of #78658 - casey:x, r=Mark-Simulacrum
Mara Bos [Sun, 8 Nov 2020 12:36:09 +0000 (13:36 +0100)]
Rollup merge of #78658 - casey:x, r=Mark-Simulacrum

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.

3 years agoRollup merge of #78572 - de-vri-es:bsd-cloexec, r=m-ou-se
Mara Bos [Sun, 8 Nov 2020 12:36:07 +0000 (13:36 +0100)]
Rollup merge of #78572 - de-vri-es:bsd-cloexec, r=m-ou-se

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:
https://github.com/illumos/illumos-gate/commit/5dbfd19ad5fcc2b779f40f80fa05c1bd28fd0b4e
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

3 years agoRollup merge of #78570 - sasurau4:test/check-pass-print-type-size, r=jyn514
Mara Bos [Sun, 8 Nov 2020 12:36:05 +0000 (13:36 +0100)]
Rollup merge of #78570 - sasurau4:test/check-pass-print-type-size, r=jyn514

Remove FIXME comment in print_type_sizes ui test suite

## Overview
Helps with #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.

3 years agoRollup merge of #78065 - tshepang:nits, r=dtolnay
Mara Bos [Sun, 8 Nov 2020 12:36:01 +0000 (13:36 +0100)]
Rollup merge of #78065 - tshepang:nits, r=dtolnay

make concurrency helper more pleasant to read

3 years agoRollup merge of #76227 - CDirkx:const-poll, r=KodrAus
Mara Bos [Sun, 8 Nov 2020 12:35:58 +0000 (13:35 +0100)]
Rollup merge of #76227 - CDirkx:const-poll, 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](https://github.com/rust-lang/rust/pull/76198).

Possible because of the recent stabilization of const control flow.

Part of #76225.

3 years agoRollup merge of #76097 - pickfire:stabilize-spin-loop, r=KodrAus
Mara Bos [Sun, 8 Nov 2020 12:35:54 +0000 (13:35 +0100)]
Rollup merge of #76097 - pickfire:stabilize-spin-loop, r=KodrAus

Stabilize hint::spin_loop

Partially fix #55002, deprecate in another release

r? ``````@KodrAus``````

3 years agoAuto merge of #78410 - lcnr:revert75443, r=nikomatsakis
bors [Sun, 8 Nov 2020 11:27:06 +0000 (11:27 +0000)]
Auto merge of #78410 - lcnr:revert75443, r=nikomatsakis

revert #75443, update mir validator

This PR reverts rust-lang#75443 to fix rust-lang#75992 and instead uses rust-lang#75419 to fix rust-lang#75313.

Adapts rust-lang#75419 to correctly deal with unevaluated constants as otherwise some `feature(const_evaluatable_checked)` tests would ICE.

Note that rust-lang#72793 was also fixed by rust-lang#75443, but as that issue only concerns `feature(type_alias_impl_trait)` I deleted that test case for now and would reopen that issue.

rust-lang#75443 may have also allowed some other code to now successfully compile which would make this revert a breaking change after 2 stable versions, but I hope that this is a purely theoretical concern.

See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/generator.20upvars/near/214617274 for more reasoning about this.

r? `@nikomatsakis` `@eddyb` `@RalfJung`

3 years agoAuto merge of #77729 - petrochenkov:mergetarg, r=Mark-Simulacrum
bors [Sun, 8 Nov 2020 02:21:55 +0000 (02:21 +0000)]
Auto merge of #77729 - petrochenkov:mergetarg, r=Mark-Simulacrum

rustc_target: Move some target options from `Target` to `TargetOptions`

The only reason for `Target` to `TargetOptions` to be separate structures is that options in `TargetOptions` have reasonable defaults and options in `Target` don't.
(Otherwise all the options logically belong to a single `Target` struct.)

This PR moves a number of options with reasonable defaults from `Target` to `TargetOptions`, so they no longer needs to be specified explicitly for majority of the targets.
The move also allows to inherit the options from `rustc_target/src/spec/*_base.rs` files in a nicer way.
I didn't change any specific option values here.

The moved options are `target_c_int_width` (defaults to `"32"`), `target_endian` (defaults to `"little"`), `target_os` (defaults to `"none"`), `target_env` (defaults to `""`), `target_vendor` (defaults to `"unknown"`) and `linker_flavor` (defaults to `LinkerFlavor::Gcc`).

Next steps (in later PRs):
- Find a way to merge `TargetOptions` into `Target`
- If not, always access `TargetOptions` fields through `Deref` making it a part of `Target` at least logically (`session.target.target.options.foo` -> `session.target.target.foo`)
- ~Eliminate `session::config::Config` and use `Target` instead (`session.target.target.foo` -> `session.target.foo`)~ Done in https://github.com/rust-lang/rust/pull/77943.
- Avoid tautologies in option names (`target.target_os` -> `target.os`)
- Resolve _ https://github.com/rust-lang/rust/issues/77730 (rustc_target: The differences between `target_os = "none"` and `target_os = "unknown"`, and `target_vendor = "unknown"` and `target_vendor = ""` are unclear) noticed during implementation of this PR.

3 years agoFix tab focus on restyled switches
Michael Howell [Sun, 8 Nov 2020 02:01:06 +0000 (19:01 -0700)]
Fix tab focus on restyled switches

Setting a checkbox to `display:none` makes it impossible to tab onto it,
which makes the rustdoc settings page completely keyboard inaccessible.

3 years agoUse a semicolon instead of a dash in lint note
Aaron Hill [Sun, 8 Nov 2020 01:39:35 +0000 (20:39 -0500)]
Use a semicolon instead of a dash in lint note

3 years agoDon't fire `CONST_ITEM_MUTATION` lint when borrowing a deref
Aaron Hill [Sun, 8 Nov 2020 01:11:53 +0000 (20:11 -0500)]
Don't fire `CONST_ITEM_MUTATION` lint when borrowing a deref

Fixes #78819

This extends the check for dereferences added in PR #77324
to cover mutable borrows, as well as direct writes. If we're operating
on a dereference of a `const` item, we shouldn't be firing the lint.

3 years agotypo and formatting
o752d [Sat, 7 Nov 2020 23:25:10 +0000 (23:25 +0000)]
typo and formatting

fixed a typo and modified some line formatting justification while I'm here :)

3 years agorustc_resolve: Use `#![feature(format_args_capture)]`
Vadim Petrochenkov [Sat, 7 Nov 2020 22:38:11 +0000 (01:38 +0300)]
rustc_resolve: Use `#![feature(format_args_capture)]`

3 years agoAuto merge of #78784 - Mark-Simulacrum:revert-77421, r=petrochenkov
bors [Sat, 7 Nov 2020 21:57:02 +0000 (21:57 +0000)]
Auto merge of #78784 - Mark-Simulacrum:revert-77421, r=petrochenkov

Revert "Revert "resolve: Avoid "self-confirming" import resolutions in one more case""

Specifically, this reverts commit b20bce8ce54ea9d47c2e3eb0b17cbb6baf916ae2 from #77421 to fix #77586.

The lang team has decided that for the time being we want to avoid the breakage here (perhaps for a future edition; though almost certainly not the upcoming one), though a future PR may want to add a lint around this case (and perhaps others) which are unlikely to be readable code.

r? `@petrochenkov` to confirm this is the right way to fix #77586.

3 years agoConvert a bunch of intra-doc links
Camelid [Sat, 7 Nov 2020 20:22:24 +0000 (12:22 -0800)]
Convert a bunch of intra-doc links

3 years agoLess verbose debug logging from inlining integrator
Tomasz Miąsko [Sat, 7 Nov 2020 00:00:00 +0000 (00:00 +0000)]
Less verbose debug logging from inlining integrator

The inlining integrator produces relatively verbose and uninteresting
logs.  Move them from a debug log level to a trace level, so that they
can be easily isolated from others.

3 years agoHonor the rustfmt setting in config.toml
Jake Goulding [Sat, 7 Nov 2020 18:26:42 +0000 (13:26 -0500)]
Honor the rustfmt setting in config.toml

Prior to this, setting the rustfmt configuration was ignored:

```
% mkdir example

% cd example

% ../configure --set build.rustfmt=/usr/bin/true

% ../x.py fmt
./x.py fmt is not supported on this channel
failed to run: /Users/shep/Projects/rust/example/build/bootstrap/debug/bootstrap fmt
Build completed unsuccessfully in 0:00:01
```

And after:

```
% ../x.py fmt
Build completed successfully in 0:00:11
```

3 years agoSmall cleanup in `TypeFoldable` derive macro
LeSeulArtichaut [Sat, 7 Nov 2020 17:20:42 +0000 (18:20 +0100)]
Small cleanup in `TypeFoldable` derive macro

3 years agoAuto merge of #75199 - Mark-Simulacrum:debug-asserts, r=pietroalbini
bors [Sat, 7 Nov 2020 16:54:23 +0000 (16:54 +0000)]
Auto merge of #75199 - Mark-Simulacrum:debug-asserts, r=pietroalbini

Re-enable debug and LLVM assertions

Historically we've disabled these assertions on a number of platforms with the
goal of speeding up CI. Now, though, having migrated to GitHub actions, CI is
already pretty fast, and these debug assertions do bring us some value.

This does leave in some debug assertions that are performance-related: macOS
currently hovers at just under 2 hours.

There are also some other builders which have debug and LLVM assertions
disabled:

llvm-8, PR builder:

In one view, this builder tests our support for older LLVMs. But in reality, a
lot of our tests already disable themselves on older LLVMs, and I think our
general stance is that we really only support the in-tree LLVM. Plus, we really
want CI times on this builder to be really low, as it's run on *every* PR --
that's a lot of CI time.

test-various:

This disables debug asserts still -- as noted in the Dockerfile, we test code
size, and we need debug asserts off for that to work well.

Helps with #59637 -- but doesn't close it, macOS still has asserts off.

r? `@pietroalbini`

3 years agoRemove unused `from_hir` call
Joshua Nelson [Sat, 7 Nov 2020 15:34:00 +0000 (10:34 -0500)]
Remove unused `from_hir` call

3 years agoFix handling of item names for HIR
Joshua Nelson [Thu, 22 Oct 2020 02:00:32 +0000 (22:00 -0400)]
Fix handling of item names for HIR

- Handle variants, fields, macros in `Node::ident()`
- Handle the crate root in `opt_item_name`
- Factor out `item_name_from_def_id` to reduce duplication
- Look at HIR before the DefId for `opt_item_name`

  This gives accurate spans, which are not available from serialized
  metadata.

- Don't panic on the crate root in `opt_item_name`
- Add comments

3 years agoImplement destructuring assignment for tuples
Fabian Zaiser [Wed, 4 Nov 2020 16:32:52 +0000 (16:32 +0000)]
Implement destructuring assignment for tuples

Co-authored-by: varkor <github@varkor.com>
3 years agoremove FIXME comment of #62277 in print_type_sizez ui tests
Daiki Ihara [Sat, 7 Nov 2020 12:34:40 +0000 (21:34 +0900)]
remove FIXME comment of #62277 in print_type_sizez ui tests

3 years agoUpdate recently added targets
Vadim Petrochenkov [Sat, 7 Nov 2020 11:34:44 +0000 (14:34 +0300)]
Update recently added targets

3 years agorustc_target: Move `linker_flavor` from `Target` to `TargetOptions`
Vadim Petrochenkov [Thu, 8 Oct 2020 19:22:28 +0000 (22:22 +0300)]
rustc_target: Move `linker_flavor` from `Target` to `TargetOptions`

3 years agorustc_target: Move `target_vendor` from `Target` to `TargetOptions`
Vadim Petrochenkov [Thu, 8 Oct 2020 19:10:13 +0000 (22:10 +0300)]
rustc_target: Move `target_vendor` from `Target` to `TargetOptions`

3 years agorustc_target: Move `target_env` from `Target` to `TargetOptions`
Vadim Petrochenkov [Thu, 8 Oct 2020 18:47:22 +0000 (21:47 +0300)]
rustc_target: Move `target_env` from `Target` to `TargetOptions`

3 years agorustc_target: Move `target_os` from `Target` to `TargetOptions`
Vadim Petrochenkov [Thu, 8 Oct 2020 17:54:45 +0000 (20:54 +0300)]
rustc_target: Move `target_os` from `Target` to `TargetOptions`

3 years agorustc_target: Move `target_endian` from `Target` to `TargetOptions`
Vadim Petrochenkov [Thu, 8 Oct 2020 16:57:41 +0000 (19:57 +0300)]
rustc_target: Move `target_endian` from `Target` to `TargetOptions`

3 years agorustc_target: Move `target_c_int_width` from `Target` to `TargetOptions`
Vadim Petrochenkov [Thu, 8 Oct 2020 16:36:11 +0000 (19:36 +0300)]
rustc_target: Move `target_c_int_width` from `Target` to `TargetOptions`

3 years agoAuto merge of #78817 - RalfJung:miri, r=RalfJung
bors [Sat, 7 Nov 2020 08:40:56 +0000 (08:40 +0000)]
Auto merge of #78817 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/78741
Cc `@rust-lang/miri` r? `@ghost`

3 years agouse single char patterns for split() (clippy::single_char_pattern)
Matthias Krüger [Sat, 7 Nov 2020 00:23:02 +0000 (01:23 +0100)]
use single char patterns for split() (clippy::single_char_pattern)

3 years agoCompile tools and internal libraries with the initial-exec TLS model
Josh Triplett [Mon, 26 Oct 2020 05:11:20 +0000 (22:11 -0700)]
Compile tools and internal libraries with the initial-exec TLS model

This should produce more efficient code, with fewer calls to
__tls_get_addr. The tradeoff is that libraries using it won't work with
dlopen, but that shouldn't be a problem for tools or for our own
internal libraries.

Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
3 years agoimprove fixme
Bastian Kauschke [Fri, 6 Nov 2020 18:21:17 +0000 (19:21 +0100)]
improve fixme

3 years agoupdate Miri
Ralf Jung [Fri, 6 Nov 2020 20:46:07 +0000 (21:46 +0100)]
update Miri

3 years agoAdd debug asserts to PR builder
Mark Rousskov [Wed, 5 Aug 2020 21:43:59 +0000 (17:43 -0400)]
Add debug asserts to PR builder

This is helpful to catch slightly more bugs before things hit main CI, and
doesn't cost too much extra CI time.

3 years agoRe-enable debug and LLVM assertions
Mark Rousskov [Wed, 5 Aug 2020 20:17:18 +0000 (16:17 -0400)]
Re-enable debug and LLVM assertions

Historically we've disabled these assertions on a number of platforms with the
goal of speeding up CI. Now, though, having migrated to GitHub actions, CI is
already pretty fast, and these debug assertions do bring us some value.

This does leave in some debug assertions that are performance-related: macOS
currently hovers at just under 2 hours.

There are also some other builders which have debug and LLVM assertions
disabled:

llvm-8, PR builder:

In one view, this builder tests our support for older LLVMs. But in reality, a
lot of our tests already disable themselves on older LLVMs, and I think our
general stance is that we really only support the in-tree LLVM. Plus, we really
want CI times on this builder to be really low, as it's run on *every* PR --
that's a lot of CI time.

test-various:

This disables debug asserts still -- as noted in the Dockerfile, we test code
size, and we need debug asserts off for that to work well.

3 years agoAuto merge of #75778 - AndyGauge:75521-rustdoc-book-improvements, r=jyn514
bors [Fri, 6 Nov 2020 19:01:10 +0000 (19:01 +0000)]
Auto merge of #75778 - AndyGauge:75521-rustdoc-book-improvements, r=jyn514

75521 rustdoc book improvements

Added some guidelines about documenting with rustdoc
Fixes #75521

3 years agoBump Rustfmt and RLS
Alessandro Ghedini [Thu, 5 Nov 2020 15:58:23 +0000 (15:58 +0000)]
Bump Rustfmt and RLS

Should hopefully fix #78341 and #78340.

3 years agoAdd tracking issue
Benoît du Garreau [Fri, 6 Nov 2020 17:04:52 +0000 (18:04 +0100)]
Add tracking issue

3 years agoMake some std::io functions `const`
Benoît du Garreau [Fri, 6 Nov 2020 16:46:56 +0000 (17:46 +0100)]
Make some std::io functions `const`

Includes:
- io::Cursor::new
- io::Cursor::get_ref
- io::Cursor::position
- io::empty
- io::repeat
- io::sink

3 years agoRevert "Revert "resolve: Avoid "self-confirming" import resolutions in one more case""
Mark Rousskov [Thu, 5 Nov 2020 20:16:12 +0000 (15:16 -0500)]
Revert "Revert "resolve: Avoid "self-confirming" import resolutions in one more case""

This reverts commit b20bce8ce54ea9d47c2e3eb0b17cbb6baf916ae2.

It retains the test added in that commit as a check-pass test, intended to
prevent future (unintentional) regressions.

3 years agoAuto merge of #78810 - JohnTitor:rollup-8fhtvxu, r=JohnTitor
bors [Fri, 6 Nov 2020 16:12:13 +0000 (16:12 +0000)]
Auto merge of #78810 - JohnTitor:rollup-8fhtvxu, r=JohnTitor

Rollup of 15 pull requests

Successful merges:

 - #74979 (`#![deny(unsafe_op_in_unsafe_fn)]` in sys/hermit)
 - #78006 (Use Intra-doc links for std::io::buffered)
 - #78167 (Fix unreachable sub-branch detection in or-patterns)
 - #78514 (Allow using 1/2/3/4 for `x.py setup` options)
 - #78538 (BTreeMap: document a curious assumption in test cases)
 - #78559 (Add LLVM upgrades from 7 to 10 to RELEASES.md)
 - #78666 (Fix shellcheck error)
 - #78705 (Print a summary of which test suite failed)
 - #78726 (Add link to rust website)
 - #78730 (Expand explanation of reverse_bits)
 - #78760 (`deny(invalid_codeblock_attributes)` for rustc_error_codes)
 - #78771 (inliner: Copy unevaluated constants only after successful inlining)
 - #78794 (rustc_expand: use collect_bang helper instead of manual reimplementation)
 - #78795 (The renumber pass is long gone)
 - #78798 (Fixing Spelling Typos)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #78798 - ankushduacodes:fixing-typo, r=jonas-schievink
Yuki Okushi [Fri, 6 Nov 2020 16:02:30 +0000 (01:02 +0900)]
Rollup merge of #78798 - ankushduacodes:fixing-typo, r=jonas-schievink

Fixing Spelling Typos

Fixing #78787

3 years agoRollup merge of #78795 - est31:node_id_assignment_doc_fix, r=oli-obk
Yuki Okushi [Fri, 6 Nov 2020 16:02:28 +0000 (01:02 +0900)]
Rollup merge of #78795 - est31:node_id_assignment_doc_fix, r=oli-obk

The renumber pass is long gone

Originally, there has been a dedicated pass for renumbering
AST NodeIds to have actual values. This pass had been added by
commit a5ad4c379466519a0bf977864a5cdc50a7ade385.

Then, later, this step was moved to where it resides now,
macro expansion. See commit c86c8d41a26b2037e80c9fd028a59313a78b3a66
or PR #36438.

The comment snippet, added by the original commit, has
survived the times without any change, becoming outdated
at removal of the dedicated pass.

Nowadays, grepping for the next_node_id function will show up
multiple places in the compiler that call it, but the main
rewriting that the comment talks about is still done in the
expansion step, inside an innocious looking visit_id function
that's called during macro invocation collection.

3 years agoRollup merge of #78794 - est31:collect_bang, r=oli-obk
Yuki Okushi [Fri, 6 Nov 2020 16:02:26 +0000 (01:02 +0900)]
Rollup merge of #78794 - est31:collect_bang, r=oli-obk

rustc_expand: use collect_bang helper instead of manual reimplementation

3 years agoRollup merge of #78771 - tmiasko:inline-consts, r=oli-obk
Yuki Okushi [Fri, 6 Nov 2020 16:02:24 +0000 (01:02 +0900)]
Rollup merge of #78771 - tmiasko:inline-consts, r=oli-obk

inliner: Copy unevaluated constants only after successful inlining

Inliner copies the unevaluated constants from the callee body to the
caller at the point where decision to inline is yet to be made. The
constants will be unnecessary if inlining were to fail.

Organize the code moving items from callee to the caller together in one
place to avoid the issue.

3 years agoRollup merge of #78760 - jyn514:deny-invalid-codeblocks, r=GuillaumeGomez
Yuki Okushi [Fri, 6 Nov 2020 16:02:22 +0000 (01:02 +0900)]
Rollup merge of #78760 - jyn514:deny-invalid-codeblocks, r=GuillaumeGomez

`deny(invalid_codeblock_attributes)` for rustc_error_codes

Closes https://github.com/rust-lang/rust/issues/71478.

r? ``@GuillaumeGomez``

3 years agoRollup merge of #78730 - kornelski:not-inverse, r=Dylan-DPC
Yuki Okushi [Fri, 6 Nov 2020 16:02:20 +0000 (01:02 +0900)]
Rollup merge of #78730 - kornelski:not-inverse, r=Dylan-DPC

Expand explanation of reverse_bits

Original documentation only rephrased the function name

3 years agoRollup merge of #78726 - GuillaumeGomez:back-link-to-main-website, r=steveklabnik
Yuki Okushi [Fri, 6 Nov 2020 16:02:18 +0000 (01:02 +0900)]
Rollup merge of #78726 - GuillaumeGomez:back-link-to-main-website, r=steveklabnik

Add link to rust website

Fixes #30838

This doesn't fix the issue as suggested but it at least adds a link to allow to go back to the rust website.

r? `@steveklabnik`

3 years agoRollup merge of #78705 - Mark-Simulacrum:nicer-failure-compiletest, r=jyn514
Yuki Okushi [Fri, 6 Nov 2020 16:02:16 +0000 (01:02 +0900)]
Rollup merge of #78705 - Mark-Simulacrum:nicer-failure-compiletest, r=jyn514

Print a summary of which test suite failed

Especially on CI, where cross-compiling is common and single builder may end up
with multiple hosts and multiple targets, it can be annoying to scroll back to
the nearest start of test marker. This prints out a summary of the test suite
being run directly in compiletest.

For example, on a mir-opt failure, this would show something like this:

```
failures:
    [mir-opt] mir-opt/while-storage.rs

test result: FAILED. 140 passed; 1 failed; 2 ignored; 0 measured; 0 filtered out

Some tests failed in compiletest suite=mir-opt mode=mir-opt host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
```

Fixes #78517

3 years agoRollup merge of #78666 - sasurau4:fix/shellcheck-error, r=jyn514
Yuki Okushi [Fri, 6 Nov 2020 16:02:14 +0000 (01:02 +0900)]
Rollup merge of #78666 - sasurau4:fix/shellcheck-error, r=jyn514

Fix shellcheck error

## Overview

Helps with #77290

This pr fix only errors of shellcheck, the result of `git ls-files '*.sh' | xargs shellcheck --severity=error`.

Fixing error are following.

- https://github.com/koalaman/shellcheck/wiki/SC2148
- https://github.com/koalaman/shellcheck/wiki/SC1008

Disable error following.
- https://github.com/koalaman/shellcheck/wiki/SC2068

3 years agoRollup merge of #78559 - glandium:release-notes, r=Mark-Simulacrum
Yuki Okushi [Fri, 6 Nov 2020 16:02:12 +0000 (01:02 +0900)]
Rollup merge of #78559 - glandium:release-notes, r=Mark-Simulacrum

Add LLVM upgrades from 7 to 10 to RELEASES.md

Fixes #78464

3 years agoRollup merge of #78538 - ssomers:btree_testing_rng, r=Mark-Simulacrum
Yuki Okushi [Fri, 6 Nov 2020 16:02:09 +0000 (01:02 +0900)]
Rollup merge of #78538 - ssomers:btree_testing_rng, r=Mark-Simulacrum

BTreeMap: document a curious assumption in test cases

r? ```@Mark-Simulacrum```

3 years agoRollup merge of #78514 - jyn514:setup-number, r=Mark-Simulacrum
Yuki Okushi [Fri, 6 Nov 2020 16:02:07 +0000 (01:02 +0900)]
Rollup merge of #78514 - jyn514:setup-number, r=Mark-Simulacrum

Allow using 1/2/3/4 for `x.py setup` options

This undocumented feature allows you to typo 'a' as '1'.

r? ```@Mark-Simulacrum```
cc ```@Lokathor```

3 years agoRollup merge of #78167 - Nadrieril:fix-76836_, r=varkor
Yuki Okushi [Fri, 6 Nov 2020 16:02:05 +0000 (01:02 +0900)]
Rollup merge of #78167 - Nadrieril:fix-76836_, r=varkor

Fix unreachable sub-branch detection in or-patterns

The previous implementation was too eager to avoid unnecessary "unreachable pattern" warnings. I feel more confident about this implementation than I felt about the previous one.
Fixes https://github.com/rust-lang/rust/issues/76836.

``@rustbot`` modify labels: +A-exhaustiveness-checking

3 years agoRollup merge of #78006 - pitaj:master, r=jyn514
Yuki Okushi [Fri, 6 Nov 2020 16:02:03 +0000 (01:02 +0900)]
Rollup merge of #78006 - pitaj:master, r=jyn514

Use Intra-doc links for std::io::buffered

Helps with #75080. I used the implicit link style for intrinsics, as that was what `minnumf32` and others already had.

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

r? ``@jyn514``

3 years agoRollup merge of #74979 - maekawatoshiki:fix, r=Mark-Simulacrum
Yuki Okushi [Fri, 6 Nov 2020 16:01:59 +0000 (01:01 +0900)]
Rollup merge of #74979 - maekawatoshiki:fix, r=Mark-Simulacrum

`#![deny(unsafe_op_in_unsafe_fn)]` in sys/hermit

Partial fix of #73904.

This encloses ``unsafe`` operations in ``unsafe fn`` in ``sys/hermit``.
Some unsafe blocks are not well documented because some system-based functions lack documents.

3 years agoStabilize hint::spin_loop
Ivan Tham [Sun, 30 Aug 2020 02:35:50 +0000 (10:35 +0800)]
Stabilize hint::spin_loop

Partially fix #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

3 years agoDisable accept4 on Android.
Maarten de Vries [Sat, 31 Oct 2020 13:20:18 +0000 (14:20 +0100)]
Disable accept4 on Android.

3 years agoignore shellcheck error SC2068
Daiki Ihara [Tue, 3 Nov 2020 13:57:56 +0000 (22:57 +0900)]
ignore shellcheck error SC2068