]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #93313 - tmiasko:uninhabited, r=tmandry
Dylan DPC [Wed, 20 Apr 2022 16:26:01 +0000 (18:26 +0200)]
Rollup merge of #93313 - tmiasko:uninhabited, r=tmandry

Check if call return type is visibly uninhabited when building MIR

The main motivation behind the change is to expose information about diverging
calls to the generator transform and match the precision of drop range tracking
which already understands that call expressions with visibly uninhabited types
diverges.

This change should also accept strictly more programs than before. That is
programs that were previously rejected due to errors raised by control-flow
sensitive checks in a code that is no longer considered reachable.

Fixes #93161.

2 years agoAuto merge of #96135 - petrochenkov:doclink6, r=GuillaumeGomez
bors [Wed, 20 Apr 2022 13:34:48 +0000 (13:34 +0000)]
Auto merge of #96135 - petrochenkov:doclink6, r=GuillaumeGomez

rustdoc: Optimize and refactor doc link resolution

One more subset of https://github.com/rust-lang/rust/pull/94857 that should bring perf improvements rather than regressions + a couple more optimizations on top of it.
It's better to read individual commits and their descriptions to understand the changes.
The `may_have_doc_links` optimization is not *very* useful here, but it's much more important for https://github.com/rust-lang/rust/pull/94857.

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

2 years agoAuto merge of #96022 - martingms:inline-const-getters, r=nnethercote
bors [Wed, 20 Apr 2022 11:12:55 +0000 (11:12 +0000)]
Auto merge of #96022 - martingms:inline-const-getters, r=nnethercote

Inline `ty::Const::ty()` and `ty::Const::val()` getters

These were not inlined into `super_relate_consts`, which is one of the hottest functions in a callgrind profile of compiling `bitmaps-3.1.0`.

Yields some small speedups across various benchmarks locally:

#### Primary benchmarks

Benchmark | Profile | Scenario | % Change | Significance Factor?
-- | -- | -- | -- | --
unicode-normalization-0.1.19 | check | full | -0.56% | 2.78x
unicode-normalization-0.1.19 | check | incr-full | -0.43% | 2.15x
unicode-normalization-0.1.19 | opt | full | -0.35% | 1.77x
unicode-normalization-0.1.19 | debug | incr-full | -0.31% | 1.56x
unicode-normalization-0.1.19 | debug | full | -0.30% | 1.51x

#### Secondary benchmarks

Benchmark | Profile | Scenario | % Change | Significance Factor?
-- | -- | -- | -- | --
bitmaps-3.1.0 | check | full | -1.88% | 9.39x
bitmaps-3.1.0 | debug | full | -1.79% | 8.96x
bitmaps-3.1.0 | opt | full | -1.69% | 8.43x
bitmaps-3.1.0 | check | incr-full | -1.54% | 7.68x
bitmaps-3.1.0 | debug | incr-full | -1.45% | 7.27x
bitmaps-3.1.0 | opt | incr-full | -1.39% | 6.96x
tt-muncher | opt | full | 1.28% | 6.38x
nalgebra-0.30.1 | check | full | -0.96% | 4.81x
nalgebra-0.30.1 | debug | full | -0.91% | 4.54x
nalgebra-0.30.1 | opt | full | -0.90% | 4.52x
nalgebra-0.30.1 | check | incr-full | -0.77% | 3.86x
nalgebra-0.30.1 | opt | incr-full | -0.76% | 3.79x
nalgebra-0.30.1 | debug | incr-full | -0.74% | 3.72x
hex-0.4.3 | check | full | -0.70% | 3.50x
hex-0.4.3 | debug | full | -0.59% | 2.95x
hex-0.4.3 | check | incr-full | -0.56% | 2.80x
hex-0.4.3 | opt | full | -0.56% | 2.78x
wf-projection-stress-65510 | opt | full | -0.48% | 2.42x
hex-0.4.3 | opt | incr-full | -0.48% | 2.40x
hex-0.4.3 | debug | incr-full | -0.45% | 2.24x
wf-projection-stress-65510 | check | full | -0.44% | 2.18x
wf-projection-stress-65510 | debug | full | -0.42% | 2.08x
wf-projection-stress-65510 | check | incr-full | -0.40% | 2.01x
deep-vector | debug | incr-patched: add vec item | -0.38% | 1.88x
wf-projection-stress-65510 | debug | incr-full | -0.37% | 1.86x
wf-projection-stress-65510 | opt | incr-full | -0.36% | 1.81x
deep-vector | debug | incr-patched: println | 0.33% | 1.63x

r? `@nnethercote`

2 years agoAuto merge of #96082 - michaelwoerister:less_impl_stable_hash_via_hash, r=compiler...
bors [Wed, 20 Apr 2022 03:51:09 +0000 (03:51 +0000)]
Auto merge of #96082 - michaelwoerister:less_impl_stable_hash_via_hash, r=compiler-errors

incr. comp.: Don't export impl_stable_hash_via_hash!() and warn about using it.

Fixes https://github.com/rust-lang/rust/issues/96013.

2 years agoAuto merge of #96224 - Dylan-DPC:rollup-h2h3j93, r=Dylan-DPC
bors [Wed, 20 Apr 2022 01:34:43 +0000 (01:34 +0000)]
Auto merge of #96224 - Dylan-DPC:rollup-h2h3j93, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #95740 (asm: Add a kreg0 register class on x86 which includes k0)
 - #95813 (Remove extra space before a where clause)
 - #96029 (Refactor loop into iterator; simplify negation logic.)
 - #96162 (interpret: Fix writing uninit to an allocation)
 - #96165 (Miri provenance cleanup)
 - #96205 (Use futex locks on emscripten.)

Failed merges:

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

2 years agoRollup merge of #96205 - m-ou-se:emscripten-futex-locks, r=thomcc
Dylan DPC [Tue, 19 Apr 2022 20:57:44 +0000 (22:57 +0200)]
Rollup merge of #96205 - m-ou-se:emscripten-futex-locks, r=thomcc

Use futex locks on emscripten.

This switches Emscripten to the futex-based lock implementations, away from pthread.

Tracking issue: https://github.com/rust-lang/rust/issues/93740

2 years agoRollup merge of #96165 - RalfJung:miri-provenance-cleanup, r=oli-obk
Dylan DPC [Tue, 19 Apr 2022 20:57:43 +0000 (22:57 +0200)]
Rollup merge of #96165 - RalfJung:miri-provenance-cleanup, r=oli-obk

Miri provenance cleanup

Reviewing https://github.com/rust-lang/rust/pull/95826 by ``@carbotaniuman`` made me realize that we could clean things up a little here.

``@carbotaniuman`` please let me know if you're okay with landing this (it will create a lot of conflicts with your PR), or if you'd prefer incorporating the ideas from this PR into yours. I think we want to end up in a situation where the function you called `ptr_reify_alloc` returns just two things, a concrete tag and an offset. Getting an `AllocId` from a concrete tag should be infallible like now. However a concrete tag and `Tag` don't have to be the same type.

r? ``@oli-obk``

2 years agoRollup merge of #96162 - RalfJung:mark-uninit, r=oli-obk
Dylan DPC [Tue, 19 Apr 2022 20:57:42 +0000 (22:57 +0200)]
Rollup merge of #96162 - RalfJung:mark-uninit, r=oli-obk

interpret: Fix writing uninit to an allocation

When calling `mark_init`, we need to also be mindful of what happens with the relocations! Specifically, when we de-init memory, we need to clear relocations in that range as well or else strange things will happen (and printing will not show the de-init, since relocations take precedence there).

Fixes https://github.com/rust-lang/miri/issues/2068.

Here's the Miri testcase that this fixes (requires `-Zmiri-disable-validation`):
```rust
use std::mem::MaybeUninit;

fn main() { unsafe {
    let mut x = MaybeUninit::<i64>::uninit();
    // Put in a ptr.
    x.as_mut_ptr().cast::<&i32>().write_unaligned(&0);
    // Overwrite parts of that pointer with 'uninit' through a Scalar.
    let ptr = x.as_mut_ptr().cast::<i32>();
    *ptr = MaybeUninit::uninit().assume_init();
    // Reading this back should hence work fine.
    let _c = *ptr;
} }
```
Previously this failed with
```
error: unsupported operation: unable to turn pointer into raw bytes
  --> ../miri/uninit.rs:11:14
   |
11 |     let _c = *ptr;
   |              ^^^^ unable to turn pointer into raw bytes
   |
   = help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support

   = note: inside `main` at ../miri/uninit.rs:11:14
```

2 years agoRollup merge of #96029 - IsakNyberg:error-messages-fix, r=Dylan-DPC
Dylan DPC [Tue, 19 Apr 2022 20:57:41 +0000 (22:57 +0200)]
Rollup merge of #96029 - IsakNyberg:error-messages-fix, r=Dylan-DPC

Refactor loop into iterator; simplify negation logic.

is_dummy should return when a non-dummy is found, but instead is iterated until completion. With some inspiration from line 323 this was refactored to a single line that returns once a single counterexample is found.

2 years agoRollup merge of #95813 - Urgau:rustdoc-where-clause-space, r=GuillaumeGomez
Dylan DPC [Tue, 19 Apr 2022 20:57:40 +0000 (22:57 +0200)]
Rollup merge of #95813 - Urgau:rustdoc-where-clause-space, r=GuillaumeGomez

Remove extra space before a where clause

Remove extra space before where clause in the generated documentation.

The fix is to move the space before the break-line so that it doesn't appear visually but is still here. Removing it completely would create things like this `impl<D> Delta<D>where D: MyTrait` (missing a space before the where) which I don't think we want.

Added two regression test, first one test that the `<br>` is after the space and the second check that the `<br>` is before the spaces.

Before:
![image](https://user-images.githubusercontent.com/3616612/162475212-d4bb6727-ed66-4a55-a4a2-4f55189bf8bd.png)

After:
![image](https://user-images.githubusercontent.com/3616612/162475467-508fd082-60a7-4a8c-b693-8b188e8843e6.png)

r? ``@GuillaumeGomez``

2 years agoRollup merge of #95740 - Amanieu:kreg0, r=nagisa
Dylan DPC [Tue, 19 Apr 2022 20:57:39 +0000 (22:57 +0200)]
Rollup merge of #95740 - Amanieu:kreg0, r=nagisa

asm: Add a kreg0 register class on x86 which includes k0

Previously we only exposed a kreg register class which excludes the k0
register since it can't be used in many instructions. However k0 is a
valid register and we need to have a way of marking it as clobbered for
clobber_abi.

Fixes #94977

2 years agoAdd regression test for #96079
Guillaume Gomez [Tue, 19 Apr 2022 14:08:22 +0000 (16:08 +0200)]
Add regression test for #96079

2 years agorustdoc: Sligthly optimize `Attributes` construction and processing before doc link...
Vadim Petrochenkov [Sat, 16 Apr 2022 23:01:46 +0000 (02:01 +0300)]
rustdoc: Sligthly optimize `Attributes` construction and processing before doc link resolution

2 years agorustdoc: Cache preprocessed markdown links
Vadim Petrochenkov [Sat, 16 Apr 2022 20:59:21 +0000 (23:59 +0300)]
rustdoc: Cache preprocessed markdown links

2 years agorustdoc: Optimize and refactor doc link resolution
Vadim Petrochenkov [Sat, 16 Apr 2022 20:53:13 +0000 (23:53 +0300)]
rustdoc: Optimize and refactor doc link resolution

- Cache doc link resolutions obtained early
- Cache markdown links retrieved from doc strings early
- Rename and restructure the code in early doc link resolution to be closer to #94857

2 years agorustc_metadata: Store a flag telling whether an item may have doc links in its attributes
Vadim Petrochenkov [Sat, 16 Apr 2022 20:49:37 +0000 (23:49 +0300)]
rustc_metadata: Store a flag telling whether an item may have doc links in its attributes

This should be cheap on rustc side, but it's significant optimization for rustdoc that won't need to decode and process attributes unnecessarily

2 years agoproc_macro: Add a workaround for rustdoc
Vadim Petrochenkov [Tue, 1 Feb 2022 12:30:32 +0000 (20:30 +0800)]
proc_macro: Add a workaround for rustdoc

2 years agoasm: Add a kreg0 register class on x86 which includes k0
Amanieu d'Antras [Wed, 6 Apr 2022 19:41:12 +0000 (20:41 +0100)]
asm: Add a kreg0 register class on x86 which includes k0

Previously we only exposed a kreg register class which excludes the k0
register since it can't be used in many instructions. However k0 is a
valid register and we need to have a way of marking it as clobbered for
clobber_abi.

Fixes #94977

2 years agoAuto merge of #96214 - Dylan-DPC:rollup-a5b4fow, r=Dylan-DPC
bors [Tue, 19 Apr 2022 13:10:12 +0000 (13:10 +0000)]
Auto merge of #96214 - Dylan-DPC:rollup-a5b4fow, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #94493 (Improved diagnostic on failure to meet send bound on future in a foreign crate)
 - #95809 (Fix typo in bootstrap.py)
 - #96086 (Remove `--extern-location` and all associated code)
 - #96089 (`alloc`: make `vec!` unavailable under `no_global_oom_handling`)
 - #96122 (Fix an invalid error for a suggestion to add a slice in pattern-matching)
 - #96142 (Stop using CRATE_DEF_INDEX outside of metadata encoding.)

Failed merges:

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

2 years agoRollup merge of #96142 - cjgillot:no-crate-def-index, r=petrochenkov
Dylan DPC [Tue, 19 Apr 2022 12:43:21 +0000 (14:43 +0200)]
Rollup merge of #96142 - cjgillot:no-crate-def-index, r=petrochenkov

Stop using CRATE_DEF_INDEX outside of metadata encoding.

`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.  We should not manipulate raw `DefIndex` outside of metadata encoding.

2 years agoRollup merge of #96122 - TaKO8Ki:fix-invalid-error-for-suggestion-to-add-slice-in...
Dylan DPC [Tue, 19 Apr 2022 12:43:20 +0000 (14:43 +0200)]
Rollup merge of #96122 - TaKO8Ki:fix-invalid-error-for-suggestion-to-add-slice-in-pattern-matching, r=nagisa

Fix an invalid error for a suggestion to add a slice in pattern-matching

closes #96103

2 years agoRollup merge of #96089 - ojeda:no-vec-no_global_oom_handling, r=Mark-Simulacrum
Dylan DPC [Tue, 19 Apr 2022 12:43:19 +0000 (14:43 +0200)]
Rollup merge of #96089 - ojeda:no-vec-no_global_oom_handling, r=Mark-Simulacrum

`alloc`: make `vec!` unavailable under `no_global_oom_handling`

`alloc`: make `vec!` unavailable under `no_global_oom_handling`

The `vec!` macro has 3 rules, but two are not usable under
`no_global_oom_handling` builds of the standard library
(even with a zero size):

```rust
let _ = vec![42];    // Error: requires `exchange_malloc` lang_item.
let _ = vec![42; 0]; // Error: cannot find function `from_elem`.
```

Thus those two rules should not be available to begin with.

The remaining one, with an empty matcher, is just a shorthand for
`new()` and may not make as much sense to have alone, since the
idea behind `vec!` is to enable `Vec`s to be defined with the same
syntax as array expressions. Furthermore, the documentation can be
confusing since it shows the other rules.

Thus perhaps it is better and simpler to disable `vec!` entirely
under `no_global_oom_handling` environments, and let users call
`new()` instead:

```rust
let _: Vec<i32> = vec![];
let _: Vec<i32> = Vec::new();
```

Notwithstanding this, a `try_vec!` macro would be useful, such as
the one introduced in https://github.com/rust-lang/rust/pull/95051.

If the shorthand for `new()` is deemed worth keeping on its own,
then it may be interesting to have a separate `vec!` macro with
a single rule and different, simpler documentation.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2 years agoRollup merge of #96086 - jsgf:remove-extern-location, r=davidtwco
Dylan DPC [Tue, 19 Apr 2022 12:43:17 +0000 (14:43 +0200)]
Rollup merge of #96086 - jsgf:remove-extern-location, r=davidtwco

Remove `--extern-location` and all associated code

`--extern-location` was an experiment to investigate the best way to
generate useful diagnostics for unused dependency warnings by enabling a
build system to identify the corresponding build config.

While I did successfully use this, I've since been convinced the
alternative `--json unused-externs` mechanism is the way to go, and
there's no point in having two mechanisms with basically the same
functionality.

This effectively reverts https://github.com/rust-lang/rust/pull/72603

2 years agoRollup merge of #95809 - ytmimi:llvm_stamp_typo, r=Mark-Simulacrum
Dylan DPC [Tue, 19 Apr 2022 12:43:15 +0000 (14:43 +0200)]
Rollup merge of #95809 - ytmimi:llvm_stamp_typo, r=Mark-Simulacrum

Fix typo in bootstrap.py

2 years agoRollup merge of #94493 - oribenshir:feature/ISSUE-78543_async_fn_in_foreign_crate_dia...
Dylan DPC [Tue, 19 Apr 2022 12:43:15 +0000 (14:43 +0200)]
Rollup merge of #94493 - oribenshir:feature/ISSUE-78543_async_fn_in_foreign_crate_diag_2, r=davidtwco

Improved diagnostic on failure to meet send bound on future in a foreign crate

Provide a better diagnostic on failure to meet send bound on futures in a foreign crate.

fixes #78543

2 years agoAuto merge of #96020 - martingms:optimize-relate_substs, r=nnethercote
bors [Tue, 19 Apr 2022 10:53:53 +0000 (10:53 +0000)]
Auto merge of #96020 - martingms:optimize-relate_substs, r=nnethercote

Micro-optimize `ty::relate::relate_substs` by avoiding `match`

Was a top-20 hot function in a callgrind profile of compiling `bitmaps-3.1.0`.

Yields some small speedups on that crate and some others according to local benching:

Benchmark | Profile | Scenario | % Change | Significance Factor?
-- | -- | -- | -- | --
bitmaps-3.1.0 | check | full | -1.88% | 9.42x
bitmaps-3.1.0 | debug | full | -1.80% | 8.99x
bitmaps-3.1.0 | opt | full | -1.70% | 8.49x
bitmaps-3.1.0 | check | incr-full | -1.54% | 7.68x
deep-vector | debug | full | 1.52% | 7.61x
bitmaps-3.1.0 | debug | incr-full | -1.45% | 7.26x
bitmaps-3.1.0 | opt | incr-full | -1.39% | 6.95x
nalgebra-0.30.1 | check | full | -0.68% | 3.42x
nalgebra-0.30.1 | debug | full | -0.64% | 3.22x
nalgebra-0.30.1 | opt | full | -0.64% | 3.20x
projection-caching | check | full | -0.61% | 3.05x
nalgebra-0.30.1 | check | incr-full | -0.56% | 2.78x
nalgebra-0.30.1 | opt | incr-full | -0.54% | 2.72x
nalgebra-0.30.1 | debug | incr-full | -0.54% | 2.69x
projection-caching | check | incr-full | -0.50% | 2.51x
tt-muncher | opt | full | -0.48% | 2.42x
projection-caching | opt | full | -0.47% | 2.37x
projection-caching | debug | full | -0.47% | 2.35x
projection-caching | opt | incr-full | -0.44% | 2.21x
projection-caching | debug | incr-full | -0.42% | 2.08x
deeply-nested-multi | check | incr-full | 0.37% | 1.87x
wf-projection-stress-65510 | opt | full | -0.37% | 1.84x
deep-vector | debug | incr-patched: add vec item | -0.32% | 1.61x
projection-caching | debug | incr-unchanged | -0.32% | 1.60x
wf-projection-stress-65510 | check | full | -0.31% | 1.55x
projection-caching | opt | incr-unchanged | -0.31% | 1.53x
wf-projection-stress-65510 | debug | incr-full | -0.30% | 1.51x
wf-projection-stress-65510 | opt | incr-full | -0.30% | 1.51x

r? `@nnethercote`

2 years agoincr. comp.: Don't export impl_stable_hash_via_hash!() and warn about using it.
Michael Woerister [Tue, 19 Apr 2022 08:43:09 +0000 (10:43 +0200)]
incr. comp.: Don't export impl_stable_hash_via_hash!() and warn about using it.

2 years agoUse futex locks on emscripten.
Mara Bos [Tue, 19 Apr 2022 07:20:06 +0000 (09:20 +0200)]
Use futex locks on emscripten.

2 years agoMake std::sys::unix::futex consistent on emscripten.
Mara Bos [Tue, 19 Apr 2022 07:19:29 +0000 (09:19 +0200)]
Make std::sys::unix::futex consistent on emscripten.

2 years agoAuto merge of #95379 - icewind1991:suggest-associated-type-more, r=jackh726
bors [Tue, 19 Apr 2022 01:59:35 +0000 (01:59 +0000)]
Auto merge of #95379 - icewind1991:suggest-associated-type-more, r=jackh726

show suggestion to replace generic bounds with associated types in more cases

Moves the hint to replace generic parameters with associated type bounds from the "not all associated type bounds are specified"(`E0191`) to "to many generic type parameters provided"(`E0107`).

Since `E0191` is only emitted in places where all associated types must be specified (when creating `dyn` types), the suggesting is currently not shown for other generic type uses (such as in generic type bounds). With this change the suggesting is always emitted when the number of excess generic parameters matches the number of unbound associated types.

Main motivation for the change was a lack of useful suggesting when doing

```rust
fn foo<I: Iterator<usize>>(i: I) {}
```

2 years agoAuto merge of #92287 - JulianKnodt:slice_remainder, r=yaahc
bors [Mon, 18 Apr 2022 23:34:24 +0000 (23:34 +0000)]
Auto merge of #92287 - JulianKnodt:slice_remainder, r=yaahc

Add slice::remainder

This adds a remainder function to the Slice iterator, so that a caller can access unused
elements if iteration stops.

Addresses #91733

2 years agoAuto merge of #96171 - nikic:llvm-update-2, r=cuviper
bors [Mon, 18 Apr 2022 20:53:42 +0000 (20:53 +0000)]
Auto merge of #96171 - nikic:llvm-update-2, r=cuviper

Update LLVM submodule

Merge upstream release/14.x branch.

Fixes #94762.

2 years agoAuto merge of #96178 - Dylan-DPC:rollup-6z8pcob, r=Dylan-DPC
bors [Mon, 18 Apr 2022 18:29:46 +0000 (18:29 +0000)]
Auto merge of #96178 - Dylan-DPC:rollup-6z8pcob, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #96032 (Update books)
 - #96136 (Reword clarification on lifetime for ptr->ref safety docs)
 - #96143 (Fix snapshot --bless not working anymore in htmldocck)
 - #96148 (Use revisions instead of nll compare mode for `/self/` ui tests)
 - #96156 (Replace u8to64_le macro with u64::from_le_bytes)

Failed merges:

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

2 years agoremove an unnecessary use of loc_place.ptr.into_pointer_or_addr
Ralf Jung [Mon, 18 Apr 2022 16:47:38 +0000 (12:47 -0400)]
remove an unnecessary use of loc_place.ptr.into_pointer_or_addr

2 years agoavoid an unnecessary call to Pointer::into_parts, and caution against into_pointer_or...
Ralf Jung [Mon, 18 Apr 2022 15:48:09 +0000 (11:48 -0400)]
avoid an unnecessary call to Pointer::into_parts, and caution against into_pointer_or_addr

2 years agoadd method to get absolute address of a pointer (useful only for Miri)
Ralf Jung [Mon, 18 Apr 2022 15:43:13 +0000 (11:43 -0400)]
add method to get absolute address of a pointer (useful only for Miri)

2 years agoRollup merge of #96156 - est31:use_from_le_bytes, r=Dylan-DPC
Dylan DPC [Mon, 18 Apr 2022 16:22:07 +0000 (18:22 +0200)]
Rollup merge of #96156 - est31:use_from_le_bytes, r=Dylan-DPC

Replace u8to64_le macro with u64::from_le_bytes

The macro was a reimplementation of the function.

2 years agoRollup merge of #96148 - marmeladema:nll-revisions-self, r=jackh726
Dylan DPC [Mon, 18 Apr 2022 16:22:06 +0000 (18:22 +0200)]
Rollup merge of #96148 - marmeladema:nll-revisions-self, r=jackh726

Use revisions instead of nll compare mode for `/self/` ui tests

r? ``@jackh726``

2 years agoRollup merge of #96143 - Urgau:rustdoc-fix-snapshot-bless, r=GuillaumeGomez
Dylan DPC [Mon, 18 Apr 2022 16:22:05 +0000 (18:22 +0200)]
Rollup merge of #96143 - Urgau:rustdoc-fix-snapshot-bless, r=GuillaumeGomez

Fix snapshot --bless not working anymore in htmldocck

I broke it in https://github.com/rust-lang/rust/pull/95933

r? ```@GuillaumeGomez```

2 years agoRollup merge of #96136 - thomcc:lifetime-wording, r=RalfJung
Dylan DPC [Mon, 18 Apr 2022 16:22:04 +0000 (18:22 +0200)]
Rollup merge of #96136 - thomcc:lifetime-wording, r=RalfJung

Reword clarification on lifetime for ptr->ref safety docs

I believe the current wording of the safety comment is somewhat misleading, and that this is more accurate. Suggested by `@CAD97` in this thread on the topic https://rust-lang.zulipchat.com/#narrow/stream/136281-t-lang.2Fwg-unsafe-code-guidelines/topic/Lifetime.20of.20reference.20pointer.20docs.20issue

Just to check that this is correct, CC `@RalfJung.`

I suppose it's open for interpretation as to whether or not this is more clear. I think it is.

2 years agoRollup merge of #96032 - ehuss:update-books, r=ehuss
Dylan DPC [Mon, 18 Apr 2022 16:22:04 +0000 (18:22 +0200)]
Rollup merge of #96032 - ehuss:update-books, r=ehuss

Update books

## nomicon

1 commits in 11f1165e8a2f5840467e748c8108dc53c948ee9a..c7d8467ca9158da58ef295ae65dbf00a308752d9
2022-03-19 16:02:00 -0400 to 2022-04-06 14:26:54 +0900
- Change "writers" to "readers" for Deref. (rust-lang/nomicon#346)

## reference

7 commits in c97d14fa6fed0baa9255432b8a93cb70614f80e3..b5f6c2362baf932db9440fbfcb509b309237ee85
2022-03-19 18:18:10 -0700 to 2022-04-10 19:19:51 -0700
- Fix typo: `?` should be inside `&lt;sup&gt;` tags (rust-lang/reference#1190)
- Update aarch64 to use neon as fp (rust-lang/reference#1184)
- Boolean literal expressions (rust-lang/reference#1189)
- Document that unary negation of a signed integer literal cannot cause an overflow error (rust-lang/reference#1188)
- Document compatibility between declarative and procedural macro tokens (rust-lang/reference#1169)
- Document native library modifier syntax and the `whole-archive` modifier specifically (rust-lang/reference#1170)
- Numeric literal expressions and literal suffixes (rust-lang/reference#1177)

## book

8 commits in ea90bbaf53ba64ef4e2da9ac2352b298aec6bec8..765318b844569a642ceef7bf1adab9639cbf6af3
2022-03-28 21:59:34 -0400 to 2022-04-12 21:14:47 -0400
- Propagate nostarch edits to src
- Propagate updated test example code to nostarch snapshot
- Edits to nostarch edits
- edits from nostarch
- Fix error message for the example code
- update ch13-02 to reflect changes in rust-lang/book#2797
- Update to 1.59
- Edits to chapter 2 after tech review

## rust-by-example

4 commits in ec954f35eedf592cd173b21c05a7f80a65b61d8a..c2a98d9fc5d29c481d42052fbeccfde15ed03116
2022-03-22 11:09:06 -0300 to 2022-04-08 06:44:18 -0300
- Code highlight a variable (rust-lang/rust-by-example#1530)
- Add a comment to note that warnings may not be shown in a browser in the Variable Bindings section (rust-lang/rust-by-example#1529)
- Make all new types have UpperCamelCase names in code example in the Aliasing section (rust-lang/rust-by-example#1528)
- Replace `C` with C/C++ (rust-lang/rust-by-example#1527)

## rustc-dev-guide

6 commits in 155126b1d2e2cb01ddb1d7ba9489b90d7cd173ad..eeb5a83c15b6ae60df3e4f19207376b22c6fbc4c
2022-03-22 14:34:21 +0100 to 2022-04-11 23:29:48 +0900
- method-lookup.md improvements (rust-lang/rustc-dev-guide#1296)
- Consolidate crates.io convention section (rust-lang/rustc-dev-guide#1326)
- Update examples with 1.61.0-nightly (latest version) (rust-lang/rustc-dev-guide#1330)
- r-a: Use `python3 x.py` instead of `./x.py` (rust-lang/rustc-dev-guide#1335)
- Update miri.md: correct a minor typo (rust-lang/rustc-dev-guide#1334)
- Add example how lints can be feature gated

2 years agoAuto merge of #95906 - jyn514:enforce-valid-paths, r=Mark-Simulacrum
bors [Mon, 18 Apr 2022 16:06:44 +0000 (16:06 +0000)]
Auto merge of #95906 - jyn514:enforce-valid-paths, r=Mark-Simulacrum

Require all paths passed to `ShouldRun::paths` to exist on disk

This has two benefits:
1. There is a clearer mental model of how bootstrap works. Steps correspond to paths on disk unless it's strictly impossible for them to do so (e.g. dist components).
2. Bootstrap has better checks for internal consistency. This caught several issues:
  - `src/sanitizers` doesn't exist; I changed it to just be a `sanitizers` alias.
  - `src/tools/lld` doesn't exist; I removed it, since `lld` alone already works.
  - `src/llvm` doesn't exist; removed it since `llvm` and `src/llvm-project` both work.
  - `src/lldb_batchmode.py` doesn't exist, it was moved to `src/etc`.
  - `install` was still using `src/librustc` instead of `compiler/rustc`.
  - None of the tools in `dist` / `install` allowed using `src/tools/X` to build them. This might be intentional - I can change them to aliases if you like.

Builds on https://github.com/rust-lang/rust/pull/95901 and should not be merged before.

2 years agoavoid pairing up AllocId and PointerTag, which is redundant
Ralf Jung [Mon, 18 Apr 2022 14:00:42 +0000 (10:00 -0400)]
avoid pairing up AllocId and PointerTag, which is redundant

2 years agoAuto merge of #96042 - m-ou-se:one-reentrant-mutex, r=Amanieu
bors [Mon, 18 Apr 2022 12:15:39 +0000 (12:15 +0000)]
Auto merge of #96042 - m-ou-se:one-reentrant-mutex, r=Amanieu

Use a single ReentrantMutex implementation on all platforms.

This replaces all platform specific ReentrantMutex implementations by the one I added in #95727 for Linux, since that one does not depend on any platform specific details.

r? `@Amanieu`

2 years agoRemove forgotten reexport of ReentrantMutex in sys::unsupported.
Mara Bos [Mon, 18 Apr 2022 11:10:36 +0000 (13:10 +0200)]
Remove forgotten reexport of ReentrantMutex in sys::unsupported.

2 years agoAuto merge of #96080 - nikic:ranlib, r=Mark-Simulacrum
bors [Mon, 18 Apr 2022 09:58:22 +0000 (09:58 +0000)]
Auto merge of #96080 - nikic:ranlib, r=Mark-Simulacrum

Respect ranlib specified for target during LLVM build

The ranlib specified for the target was never actually transferred
into the builder configuration. In the dist-x86_64-linux build we
ended up using ranlib instead of llvm-ranlib.

Found this investigating a build failure in #94214.

2 years agoUpdate LLVM submodule
Nikita Popov [Mon, 18 Apr 2022 08:16:56 +0000 (10:16 +0200)]
Update LLVM submodule

2 years agoAuto merge of #96113 - mixi:libressl-3.4.x, r=Mark-Simulacrum
bors [Mon, 18 Apr 2022 07:24:55 +0000 (07:24 +0000)]
Auto merge of #96113 - mixi:libressl-3.4.x, r=Mark-Simulacrum

Add support for LibreSSL 3.4.x

This updates the `openssl` and `openssl-sys` crates to support building
the toolchain with system libraries up to LibreSSL 3.4.x.

LibreSSL 3.4.0 has been supported since `openssl-sys` version 0.9.67,
LibreSSL 3.4.x since `openssl-sys` 0.9.72.

2 years agoAuto merge of #96000 - jyn514:faster-doctests, r=Mark-Simulacrum
bors [Mon, 18 Apr 2022 04:15:26 +0000 (04:15 +0000)]
Auto merge of #96000 - jyn514:faster-doctests, r=Mark-Simulacrum

Make `x test --stage 2 compiler/rustc_XXX` faster to run

Previously, bootstrap unconditionally rebuilt the stage 2 compiler,
even if it had previously built stage 1. This changes it to reuse stage 1 if possible.
In particular, it no longer runs the following step:
```
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) -> x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu))
```

2 years agoimplement `Deref` for `Bar`
Takayuki Maeda [Mon, 18 Apr 2022 04:08:23 +0000 (13:08 +0900)]
implement `Deref` for `Bar`

2 years agostop using `Autoderef`
Takayuki Maeda [Mon, 18 Apr 2022 03:51:12 +0000 (12:51 +0900)]
stop using `Autoderef`

2 years agoptr_get_alloc_id: don't return an actual Pointer
Ralf Jung [Mon, 18 Apr 2022 02:27:14 +0000 (22:27 -0400)]
ptr_get_alloc_id: don't return an actual Pointer

2 years agoAuto merge of #95695 - the8472:vec-codegen-tests, r=Mark-Simulacrum
bors [Mon, 18 Apr 2022 02:04:12 +0000 (02:04 +0000)]
Auto merge of #95695 - the8472:vec-codegen-tests, r=Mark-Simulacrum

Add codegen tests for additional cases where noop iterators get optimized away

Optimizations have improved over time and now LLVM manages to optimize more in-place-collect noop-iterators to O(1) functions. This updates the codegen test to match.

Many but not all cases reported in #79308 work now.

2 years agocheck Allocation invariant during printing
Ralf Jung [Mon, 18 Apr 2022 01:08:58 +0000 (21:08 -0400)]
check Allocation invariant during printing

2 years agoexplain why prepare_relocation_copy works the way it does
Ralf Jung [Sun, 17 Apr 2022 23:43:02 +0000 (19:43 -0400)]
explain why prepare_relocation_copy works the way it does

2 years agoadd caution to some comments
Ralf Jung [Sun, 17 Apr 2022 23:27:41 +0000 (19:27 -0400)]
add caution to some comments

2 years agowhen writing uninit to an allocation, also clear relocations like other writes do
Ralf Jung [Sun, 17 Apr 2022 23:16:54 +0000 (19:16 -0400)]
when writing uninit to an allocation, also clear relocations like other writes do

2 years agoAuto merge of #93530 - anonion0:pthread_sigmask_fix, r=JohnTitor
bors [Sun, 17 Apr 2022 22:54:55 +0000 (22:54 +0000)]
Auto merge of #93530 - anonion0:pthread_sigmask_fix, r=JohnTitor

fix error handling for pthread_sigmask(3)

Errors from `pthread_sigmask(3)` were handled using `cvt()`, which expects a return value of `-1` on error and uses `errno`.
However, `pthread_sigmask(3)` returns `0` on success and an error number otherwise.

Fix it by replacing `cvt()` with `cvt_nz()`.

2 years agoReplace u8to64_le macro with u64::from_le_bytes
est31 [Sun, 17 Apr 2022 20:51:13 +0000 (22:51 +0200)]
Replace u8to64_le macro with u64::from_le_bytes

The macro was a reimplementation of the function.

2 years agoAuto merge of #96139 - erikdesjardins:revertinl2, r=Mark-Simulacrum
bors [Sun, 17 Apr 2022 20:32:08 +0000 (20:32 +0000)]
Auto merge of #96139 - erikdesjardins:revertinl2, r=Mark-Simulacrum

Revert: Make TLS __getit #[inline(always)] on non-Windows

re #96132

r? `@Mark-Simulacrum`

2 years agoAuto merge of #96091 - GuillaumeGomez:duplicated-blanket-impls, r=notriddle
bors [Sun, 17 Apr 2022 18:14:16 +0000 (18:14 +0000)]
Auto merge of #96091 - GuillaumeGomez:duplicated-blanket-impls, r=notriddle

Fix rustdoc duplicated blanket impls

Fixes #96036.

I think it'll not be great performance-wise but I couldn't find another way to prevent that unfortunately...

r? `@notriddle`

2 years agoAdd slice::remainder
kadmin [Sun, 26 Dec 2021 08:45:33 +0000 (08:45 +0000)]
Add slice::remainder

This adds a remainder function to the Slice iterator, so that a caller can access unused
elements if iteration stops.

2 years agoAdd regression test for rustdoc duplicated blanket impls
Guillaume Gomez [Fri, 15 Apr 2022 19:53:02 +0000 (21:53 +0200)]
Add regression test for rustdoc duplicated blanket impls

2 years agoFix rustdoc duplicated blanket impls issue
Guillaume Gomez [Fri, 15 Apr 2022 19:52:43 +0000 (21:52 +0200)]
Fix rustdoc duplicated blanket impls issue

2 years agoUse revisions instead of nll compare mode for `/self/` ui tests
marmeladema [Sun, 17 Apr 2022 13:39:25 +0000 (15:39 +0200)]
Use revisions instead of nll compare mode for `/self/` ui tests

2 years agoAuto merge of #95779 - cjgillot:ast-lifetimes-undeclared, r=petrochenkov
bors [Sun, 17 Apr 2022 12:56:19 +0000 (12:56 +0000)]
Auto merge of #95779 - cjgillot:ast-lifetimes-undeclared, r=petrochenkov

Report undeclared lifetimes during late resolution.

First step in https://github.com/rust-lang/rust/pull/91557

We reuse the rib design of the current resolution framework. Specific `LifetimeRib` and `LifetimeRibKind` types are introduced. The most important variant is `LifetimeRibKind::Generics`, which happens each time we encounter something which may introduce generic lifetime parameters. It can be an item or a `for<...>` binder. The `LifetimeBinderKind` specifies how this rib behaves with respect to in-band lifetimes.

r? `@petrochenkov`

2 years agoFix --bless not working anymore in htmldocck
Loïc BRANSTETT [Sun, 17 Apr 2022 10:36:33 +0000 (12:36 +0200)]
Fix --bless not working anymore in htmldocck

2 years agoBless nll test.
Camille GILLOT [Sun, 17 Apr 2022 10:41:49 +0000 (12:41 +0200)]
Bless nll test.

2 years agoAuto merge of #96016 - Aaron1011:hash-name-cleanup, r=cjgillot
bors [Sun, 17 Apr 2022 10:31:52 +0000 (10:31 +0000)]
Auto merge of #96016 - Aaron1011:hash-name-cleanup, r=cjgillot

Remove last vestiges of skippng ident span hashing

This removes a comment that no longer applies, and properly hashes
the full ident for path segments.

2 years agoStop using CRATE_DEF_INDEX.
Camille GILLOT [Fri, 15 Apr 2022 17:27:53 +0000 (19:27 +0200)]
Stop using CRATE_DEF_INDEX.

`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.

2 years agoRemove extra space before a where clause in the documentation
Loïc BRANSTETT [Fri, 8 Apr 2022 15:33:40 +0000 (17:33 +0200)]
Remove extra space before a where clause in the documentation

2 years agoSplit relate_substs into two functions
Martin Gammelsæter [Sun, 17 Apr 2022 09:04:58 +0000 (11:04 +0200)]
Split relate_substs into two functions

One for the case with variances, and one without.
All callers use an explicit Option for the variable anyway.

2 years agoBless clippy.
Camille GILLOT [Fri, 1 Apr 2022 17:18:10 +0000 (19:18 +0200)]
Bless clippy.

2 years agoLint elided lifetimes in path on the AST.
Camille GILLOT [Thu, 10 Mar 2022 22:12:35 +0000 (23:12 +0100)]
Lint elided lifetimes in path on the AST.

2 years agoBless tests.
Camille GILLOT [Sun, 6 Mar 2022 14:44:48 +0000 (15:44 +0100)]
Bless tests.

2 years agoReport undeclared lifetimes on AST.
Camille GILLOT [Sun, 6 Mar 2022 11:02:13 +0000 (12:02 +0100)]
Report undeclared lifetimes on AST.

2 years agoRemove is_in_fn_syntax.
Camille GILLOT [Fri, 11 Mar 2022 11:01:20 +0000 (12:01 +0100)]
Remove is_in_fn_syntax.

2 years agoVisit generics inside visit_fn.
Camille GILLOT [Fri, 19 Nov 2021 21:03:43 +0000 (22:03 +0100)]
Visit generics inside visit_fn.

2 years agoCount number of lifetime parameters in a separate pass.
Camille GILLOT [Thu, 18 Nov 2021 18:59:26 +0000 (19:59 +0100)]
Count number of lifetime parameters in a separate pass.

2 years agoAuto merge of #95655 - kckeiks:create-hir-crate-items-query, r=cjgillot
bors [Sun, 17 Apr 2022 08:06:53 +0000 (08:06 +0000)]
Auto merge of #95655 - kckeiks:create-hir-crate-items-query, r=cjgillot

Refactor HIR item-like traversal (part 1)

Issue  #95004

- Create hir_crate_items query which traverses tcx.hir_crate(()).owners to return a hir::ModuleItems
- use tcx.hir_crate_items in tcx.hir().items() to return an iterator of hir::ItemId
- use tcx.hir_crate_items to introduce a tcx.hir().par_items(impl Fn(hir::ItemId)) to traverse all items in parallel;

Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
cc `@cjgillot`

2 years agomove import to fix warning with emscripten target
Ralf Sager [Sun, 17 Apr 2022 07:42:15 +0000 (09:42 +0200)]
move import to fix warning with emscripten target

2 years agoRevert "Auto merge of #94373 - erikdesjardins:getitinl, r=Mark-Simulacrum"
Erik Desjardins [Sun, 17 Apr 2022 06:15:45 +0000 (02:15 -0400)]
Revert "Auto merge of #94373 - erikdesjardins:getitinl, r=Mark-Simulacrum"

This reverts commit 035a717ee8bf548868fb50b5c7ca562fc4a657a7, reversing
changes made to 761e8884858759b21f3374ad610494e68c087a38.

2 years agoAuto merge of #96010 - eduardosm:Unique-on-top-of-NonNull, r=m-ou-se,tmiasko
bors [Sun, 17 Apr 2022 05:26:08 +0000 (05:26 +0000)]
Auto merge of #96010 - eduardosm:Unique-on-top-of-NonNull, r=m-ou-se,tmiasko

Implement `core::ptr::Unique` on top of `NonNull`

Removes the use `rustc_layout_scalar_valid_range_start` and some `unsafe` blocks.

2 years agoReword clarification on lifetime for ptr->ref safety docs
Thom Chiovoloni [Sun, 17 Apr 2022 04:37:42 +0000 (21:37 -0700)]
Reword clarification on lifetime for ptr->ref safety docs

2 years agoAuto merge of #96002 - nnethercote:speed-up-Vec-clear-2, r=m-ou-se
bors [Sun, 17 Apr 2022 03:08:45 +0000 (03:08 +0000)]
Auto merge of #96002 - nnethercote:speed-up-Vec-clear-2, r=m-ou-se

Speed up Vec::clear().

Currently it just calls `truncate(0)`. `truncate()` is (a) not marked as
`#[inline]`, and (b) more general than needed for `clear()`.

This commit changes `clear()` to do the work itself. This modest change
was first proposed in rust-lang#74172, where the reviewer rejected it because
there was insufficient evidence that `Vec::clear()`'s performance
mattered enough to justify the change. Recent changes within rustc have
made `Vec::clear()` hot within `macro_parser.rs`, so the change is now
clearly worthwhile.

Although it doesn't show wins on CI perf runs, this seems to be because they
use PGO. But not all platforms currently use PGO. Also, local builds don't use
PGO, and `truncate` sometimes shows up in an over-represented fashion in local
profiles. So local profiling will be made easier by this change.

Note that this will also benefit `String::clear()`, because it just
calls `Vec::clear()`.

Finally, the commit removes the `vec-clear.rs` codegen test. It was
added in #52908. From before then until now, `Vec::clear()` just called
`Vec::truncate()` with a zero length. The body of Vec::truncate() has
changed a lot since then. Now that `Vec::clear()` is doing actual work
itself, and not just calling `Vec::truncate()`, it's not surprising that
its generated code includes a load and an icmp. I think it's reasonable
to remove this test.

r? `@m-ou-se`

2 years agoAuto merge of #96134 - Dylan-DPC:rollup-ejug3yq, r=Dylan-DPC
bors [Sun, 17 Apr 2022 00:44:53 +0000 (00:44 +0000)]
Auto merge of #96134 - Dylan-DPC:rollup-ejug3yq, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #95346 (Stablize `const_extern_fn` for "Rust" and "C")
 - #95933 (htmldocck: Compare HTML tree instead of plain text html)
 - #96105 (Make the debug output for `TargetSelection` less verbose)
 - #96112 (Strict provenance lint diagnostics improvements)
 - #96119 (update Miri)
 - #96124 (to_digit tweak)

Failed merges:

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

2 years agoshow suggestion to replace generic bounds with associated types in more cases
Robin Appelman [Sun, 27 Mar 2022 18:45:08 +0000 (20:45 +0200)]
show suggestion to replace generic bounds with associated types in more cases

2 years agoRollup merge of #96124 - gilescope:to_digit_speedup4, r=thomcc
Dylan DPC [Sat, 16 Apr 2022 22:07:28 +0000 (00:07 +0200)]
Rollup merge of #96124 - gilescope:to_digit_speedup4, r=thomcc

to_digit tweak

No need to check the assert all the time.

(Checked the TODO and it's not time to get rid of it yet)

2 years agoRollup merge of #96119 - RalfJung:miri, r=RalfJung
Dylan DPC [Sat, 16 Apr 2022 22:07:27 +0000 (00:07 +0200)]
Rollup merge of #96119 - RalfJung:miri, r=RalfJung

update Miri

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

2 years agoRollup merge of #96112 - niluxv:strict-provenance-lint-improvements, r=nagisa
Dylan DPC [Sat, 16 Apr 2022 22:07:26 +0000 (00:07 +0200)]
Rollup merge of #96112 - niluxv:strict-provenance-lint-improvements, r=nagisa

Strict provenance lint diagnostics improvements

Use `multipart_suggestion` instead of `span_suggestion` and getting a snippet for the expression. Also don't suggest unnecessary parenthesis in `lossy_provenance_casts`.
cc ``@estebank``
``@rustbot`` label A-diagnostics

2 years agoRollup merge of #96105 - jyn514:less-verbose-logging, r=Mark-Simulacrum
Dylan DPC [Sat, 16 Apr 2022 22:07:25 +0000 (00:07 +0200)]
Rollup merge of #96105 - jyn514:less-verbose-logging, r=Mark-Simulacrum

Make the debug output for `TargetSelection` less verbose

In particular, this makes the output of `x build -vv` easier to read.
Before:

```
    c Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } }
```

After:
```
    c Sysroot { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu } }
```

2 years agoRollup merge of #95933 - Urgau:rustdoc-htmldocck-tree-compare, r=GuillaumeGomez
Dylan DPC [Sat, 16 Apr 2022 22:07:24 +0000 (00:07 +0200)]
Rollup merge of #95933 - Urgau:rustdoc-htmldocck-tree-compare, r=GuillaumeGomez

htmldocck: Compare HTML tree instead of plain text html

This PR improves `htmldocck` by comparing HTML trees instead of plain text html in the case of doing a ```@snapshot``` test.

This fix the [CI issue](https://github.com/rust-lang-ci/rust/runs/5964305020?check_suite_focus=true) encounter in https://github.com/rust-lang/rust/pull/95813 where for some unknown reason one of the attributes is not always at the same place.

The code is largely based on https://github.com/formencode/formencode/blob/3a1ba9de2fdd494dd945510a4568a3afeddb0b2e/formencode/doctest_xml_compare.py#L72-L120 which is behind MIT License. The comparison function is straightforward except for the `text_compare` function which does some weird stuff that we may want to simply reduce to a plain old comparison.

r? ``@GuillaumeGomez``

2 years agoRollup merge of #95346 - Aaron1011:stablize-const-extern-fn, r=pnkfelix
Dylan DPC [Sat, 16 Apr 2022 22:07:23 +0000 (00:07 +0200)]
Rollup merge of #95346 - Aaron1011:stablize-const-extern-fn, r=pnkfelix

Stablize `const_extern_fn` for "Rust" and "C"

All other ABIs are left unstable for now.

cc #64926

2 years agoAuto merge of #95899 - petrochenkov:modchild2, r=cjgillot
bors [Sat, 16 Apr 2022 22:04:10 +0000 (22:04 +0000)]
Auto merge of #95899 - petrochenkov:modchild2, r=cjgillot

rustc_metadata: Do not encode unnecessary module children

This should remove the syntax context shift and the special case for `ExternCrate` in decoder in https://github.com/rust-lang/rust/pull/95880.

This PR also shifts some work from decoding to encoding, which is typically useful for performance (but probably not much in this case).
r? `@cjgillot`

2 years agoUpdate compiler/rustc_error_messages/src/lib.rs
Isak Nyberg [Sat, 16 Apr 2022 21:52:18 +0000 (23:52 +0200)]
Update compiler/rustc_error_messages/src/lib.rs

Co-authored-by: Janusz Marcinkiewicz <virrages@gmail.com>
2 years agoAuto merge of #96123 - Dylan-DPC:rollup-qjog6n1, r=Dylan-DPC
bors [Sat, 16 Apr 2022 19:15:02 +0000 (19:15 +0000)]
Auto merge of #96123 - Dylan-DPC:rollup-qjog6n1, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #94985 (Parse inner attributes on inline const block)
 - #95006 (Reject `#[thread_local]` attribute on non-static items)
 - #95426 (Include Refs in Valtree Creation)
 - #95908 (Inline `shallow_resolve_ty` into `ShallowResolver`)
 - #96058 (separate flock implementations into separate modules)
 - #96088 (Update mdbook)
 - #96118 (rustdoc: Rename `def_id` into `item_id` when the type is `ItemId` for readability)

Failed merges:

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

2 years agoNo need to check the assert all the time.
Giles Cope [Sat, 16 Apr 2022 18:30:23 +0000 (19:30 +0100)]
No need to check the assert all the time.

2 years agoRequire all paths passed to `ShouldRun::paths` to exist on disk
Joshua Nelson [Sun, 10 Apr 2022 22:09:56 +0000 (17:09 -0500)]
Require all paths passed to `ShouldRun::paths` to exist on disk

This has two benefits:
1. There is a clearer mental model of how bootstrap works. Steps correspond to paths on disk unless it's strictly impossible for them to do so (e.g. dist components).
2. Bootstrap has better checks for internal consistency. This caught several issues:
  - `src/sanitizers` doesn't exist; I changed it to just be a `sanitizers` alias.
  - `src/tools/lld` doesn't exist; I removed it, since `lld` alone already works.
  - `src/llvm` doesn't exist; removed it since `llvm` and `src/llvm-project` both work.
  - `src/lldb_batchmode.py` doesn't exist, it was moved to `src/etc`.
  - `install` was still using `src/librustc` instead of `compiler/rustc`.
  - None of the tools in `dist` / `install` allowed using `src/tools/X` to build them. This might be intentional - I can change them to aliases if you like.

2 years agoRollup merge of #96118 - GuillaumeGomez:cleanup-def-id-item-id, r=notriddle
Dylan DPC [Sat, 16 Apr 2022 17:42:07 +0000 (19:42 +0200)]
Rollup merge of #96118 - GuillaumeGomez:cleanup-def-id-item-id, r=notriddle

rustdoc: Rename `def_id` into `item_id` when the type is `ItemId` for readability

As `@notriddle` mentioned in https://github.com/rust-lang/rust/pull/96091, the field name is inaccurate. This PR fixes it by renaming it accordingly to its real type.

r? `@notriddle`

2 years agoRollup merge of #96088 - ehuss:update-mdbook, r=Mark-Simulacrum
Dylan DPC [Sat, 16 Apr 2022 17:42:06 +0000 (19:42 +0200)]
Rollup merge of #96088 - ehuss:update-mdbook, r=Mark-Simulacrum

Update mdbook

This just brings in a few small fixes, particularly a rendering fix for chapter names with markdown in them (like the https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html page).  There's also a minor fix for the search index for duplicate headings.

Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0418