]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #96081 - eduardosm:masks_usize_size_agnostic, r=yaahc
Dylan DPC [Sat, 16 Apr 2022 12:26:01 +0000 (14:26 +0200)]
Rollup merge of #96081 - eduardosm:masks_usize_size_agnostic, r=yaahc

Make some `usize`-typed masks definitions agnostic to the size of `usize`

Some masks where defined as
```rust
const NONASCII_MASK: usize = 0x80808080_80808080u64 as usize;
```
where it was assumed that `usize` is never wider than 64, which is currently true.

To make those constants valid in a hypothetical 128-bit target, these constants have been redefined in an `usize`-width-agnostic way
```rust
const NONASCII_MASK: usize = usize::from_ne_bytes([0x80; size_of::<usize>()]);
```

There are already some cases where Rust anticipates the possibility of supporting 128-bit targets, such as not implementing `From<usize>` for `u64`.

2 years agoRollup merge of #96059 - euclio:doc-cfg, r=manishearth,guillaumegomez
Dylan DPC [Sat, 16 Apr 2022 12:26:00 +0000 (14:26 +0200)]
Rollup merge of #96059 - euclio:doc-cfg, r=manishearth,guillaumegomez

clarify doc(cfg) wording

The current "This is supported" wording implies that it's possible to
still use the item on other configurations, but in an unsupported way.
Changing this to "Available" removes this ambiguity.

2 years agoRollup merge of #96047 - lnicola:rust-analyzer-2022-04-14, r=lnicola
Dylan DPC [Sat, 16 Apr 2022 12:25:59 +0000 (14:25 +0200)]
Rollup merge of #96047 - lnicola:rust-analyzer-2022-04-14, r=lnicola

:arrow_up: rust-analyzer

r? ``@ghost``

2 years agoRollup merge of #96038 - beyarkay:patch-1, r=m-ou-se
Dylan DPC [Sat, 16 Apr 2022 12:25:58 +0000 (14:25 +0200)]
Rollup merge of #96038 - beyarkay:patch-1, r=m-ou-se

docs: add link from zip to unzip

The docs for `Iterator::unzip` explain that it is kind of an inverse operation to `Iterator::zip` and guide the reader to the `zip` docs, but the `zip` docs don't let the user know that they can undo the `zip` operation with `unzip`. This change modifies the docs to help the user find `unzip`.

2 years agoRollup merge of #96035 - Gumichocopengin8:feature/update-github-action-version, r...
Dylan DPC [Sat, 16 Apr 2022 12:25:57 +0000 (14:25 +0200)]
Rollup merge of #96035 - Gumichocopengin8:feature/update-github-action-version, r=pietroalbini

Update GitHub Actions actions/checkout Version v2 -> v3

Update `actions/checkout@v2` to `actions/checkout@v3` because of Node12 will be out of life after Aril 30, 2022 [[Reference](https://nodejs.org/en/about/releases/)].
`actions/xxxx@v3` use Node16 whose support lasts until April 30, 2024.

2 years agoRollup merge of #96023 - matthiaskrgr:clippyper1304, r=lcnr
Dylan DPC [Sat, 16 Apr 2022 12:25:56 +0000 (14:25 +0200)]
Rollup merge of #96023 - matthiaskrgr:clippyper1304, r=lcnr

couple of clippy::perf fixes

2 years agoRollup merge of #95887 - petrochenkov:doclink5, r=cjgillot
Dylan DPC [Sat, 16 Apr 2022 12:25:55 +0000 (14:25 +0200)]
Rollup merge of #95887 - petrochenkov:doclink5, r=cjgillot

resolve: Create dummy bindings for all unresolved imports

Apparently such bindings weren't previously created for all unresolved imports, causing issues like https://github.com/rust-lang/rust/issues/95879.
In this PR I'm trying to create such dummy bindings in a more centralized way by calling `import_dummy_binding` once for all imports in `finalize_imports`.

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

2 years agoAuto merge of #96108 - Dylan-DPC:rollup-t5f2fc9, r=Dylan-DPC
bors [Sat, 16 Apr 2022 09:19:26 +0000 (09:19 +0000)]
Auto merge of #96108 - Dylan-DPC:rollup-t5f2fc9, r=Dylan-DPC

Rollup of 9 pull requests

Successful merges:

 - #93969 (Only add codegen backend to dep info if -Zbinary-dep-depinfo is used)
 - #94605 (Add missing links in platform support docs)
 - #95372 (make unaligned_references lint deny-by-default)
 - #95859 (Improve diagnostics for unterminated nested block comment)
 - #95961 (implement SIMD gather/scatter via vector getelementptr)
 - #96004 (Consider lifetimes when comparing types for equality in MIR validator)
 - #96050 (Remove some now-dead code that was only relevant before deaggregation.)
 - #96070 ([test] Add test cases for untested functions for BTreeMap)
 - #96099 (MaybeUninit array cleanup)

Failed merges:

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

2 years agoAuto merge of #92364 - jackh726:Quantumplation/65853/param-heuristics, r=estebank
bors [Sat, 16 Apr 2022 06:55:28 +0000 (06:55 +0000)]
Auto merge of #92364 - jackh726:Quantumplation/65853/param-heuristics, r=estebank

Better method call error messages

Rebase/continuation of #71827

~Based on #92360~
~Based on #93118~

There's a decent description in #71827 that I won't copy here (for now at least)

In addition to rebasing, I've tried to restore most of the original suggestions for invalid arguments. Unfortunately, this does make some of the errors a bit verbose. To fix this will require a bit of refactoring to some of the generalized error suggestion functions, and I just don't have the time to go into it right now.

I think this is in a state that the error messages are overall better than before without a reduction in the suggestions given.

~I've tried to split out some of the easier and self-contained changes into separate commits (mostly in #92360, but also one here). There might be more than can be done here, but again just lacking time.~

r? `@estebank` as the original reviewer of #71827

2 years agoImplementation for 65853
Jack Huey [Sat, 22 Jan 2022 04:50:54 +0000 (23:50 -0500)]
Implementation for 65853

This attempts to bring better error messages to invalid method calls, by applying some heuristics to identify common mistakes.

The algorithm is inspired by Levenshtein distance and longest common sub-sequence.   In essence, we treat the types of the function, and the types of the arguments you provided as two "words" and compute the edits to get from one to the other.

We then modify that algorithm to detect 4 cases:

 - A function input is missing
 - An extra argument was provided
 - The type of an argument is straight up invalid
 - Two arguments have been swapped
 - A subset of the arguments have been shuffled

(We detect the last two as separate cases so that we can detect two swaps, instead of 4 parameters permuted.)

It helps to understand this argument by paying special attention to terminology: "inputs" refers to the inputs being *expected* by the function, and "arguments" refers to what has been provided at the call site.

The basic sketch of the algorithm is as follows:

 - Construct a boolean grid, with a row for each argument, and a column for each input.  The cell [i, j] is true if the i'th argument could satisfy the j'th input.
 - If we find an argument that could satisfy no inputs, provided for an input that can't be satisfied by any other argument, we consider this an "invalid type".
 - Extra arguments are those that can't satisfy any input, provided for an input that *could* be satisfied by another argument.
 - Missing inputs are inputs that can't be satisfied by any argument, where the provided argument could satisfy another input
 - Swapped / Permuted arguments are identified with a cycle detection algorithm.

As each issue is found, we remove the relevant inputs / arguments and check for more issues.  If we find no issues, we match up any "valid" arguments, and start again.

Note that there's a lot of extra complexity:
 - We try to stay efficient on the happy path, only computing the diagonal until we find a problem, and then filling in the rest of the matrix.
 - Closure arguments are wrapped in a tuple and need to be unwrapped
 - We need to resolve closure types after the rest, to allow the most specific type constraints
 - We need to handle imported C functions that might be variadic in their inputs.

I tried to document a lot of this in comments in the code and keep the naming clear.

2 years agoRollup merge of #96099 - clarfonthey:maybeuninit_array_cleanup, r=dtolnay
Dylan DPC [Sat, 16 Apr 2022 05:12:49 +0000 (07:12 +0200)]
Rollup merge of #96099 - clarfonthey:maybeuninit_array_cleanup, r=dtolnay

MaybeUninit array cleanup

* Links `MaybeUninit::uninit_array` to meta-tracking issue
* Links `MaybeUninit::array_assume_init` to meta-tracking issue
* Unstably constifies `MaybeUninit::array_assume_init`

Another thing worth mentioning: this splits the const feature flag for `maybe_uninit_uninit_array` into `const_maybe_uninit_uninit_array` to avoid weird cases where only one gets stabilised.

Note that it may be desired to keep the `array_assume_init` method linked to its dedicated issue, but at least for now, I decided to link to the meta-tracking issue so that all of the methods lead users to the same place. But I can revert that bit if desired.

The meta-tracking issue that I filed is #96097.

2 years agoRollup merge of #96070 - Gumichocopengin8:test/btree-map, r=thomcc
Dylan DPC [Sat, 16 Apr 2022 05:12:48 +0000 (07:12 +0200)]
Rollup merge of #96070 - Gumichocopengin8:test/btree-map, r=thomcc

[test] Add test cases for untested functions for BTreeMap

- add `pop_first()`, `pop_last()`, `get_key_value()` and `try_insert()` test cases

2 years agoRollup merge of #96050 - oli-obk:deaggregator_cleanup, r=RalfJung
Dylan DPC [Sat, 16 Apr 2022 05:12:47 +0000 (07:12 +0200)]
Rollup merge of #96050 - oli-obk:deaggregator_cleanup, r=RalfJung

Remove some now-dead code that was only relevant before deaggregation.

The code was broken anyway, if the deaggregator is disabled, it would have ICEd on any non-enum Adt

r? ```@RalfJung```

2 years agoRollup merge of #96004 - JakobDegen:fix-validator-ice, r=petrochenkov
Dylan DPC [Sat, 16 Apr 2022 05:12:46 +0000 (07:12 +0200)]
Rollup merge of #96004 - JakobDegen:fix-validator-ice, r=petrochenkov

Consider lifetimes when comparing types for equality in MIR validator

Closes #95978 .

2 years agoRollup merge of #95961 - RalfJung:gather-scatter, r=workingjubilee
Dylan DPC [Sat, 16 Apr 2022 05:12:45 +0000 (07:12 +0200)]
Rollup merge of #95961 - RalfJung:gather-scatter, r=workingjubilee

implement SIMD gather/scatter via vector getelementptr

Fixes https://github.com/rust-lang/portable-simd/issues/271

However, I don't *really* know what I am doing here... Cc ``@workingjubilee`` ``@calebzulawski``

I didn't do anything for cranelift -- ``@bjorn3`` not sure if it's okay for that backend to temporarily break. I'm happy to cherry-pick a patch that adds cranelift support. :)

2 years agoRollup merge of #95859 - rainy-me:unterminated-nested-block-comment, r=petrochenkov
Dylan DPC [Sat, 16 Apr 2022 05:12:44 +0000 (07:12 +0200)]
Rollup merge of #95859 - rainy-me:unterminated-nested-block-comment, r=petrochenkov

Improve diagnostics for unterminated nested block comment

close #95283

(This is my first time try to messing around with rust compiler and might get a lot of things wrong... :bow: )

2 years agoRollup merge of #95372 - RalfJung:unaligned_references, r=oli-obk
Dylan DPC [Sat, 16 Apr 2022 05:12:43 +0000 (07:12 +0200)]
Rollup merge of #95372 - RalfJung:unaligned_references, r=oli-obk

make unaligned_references lint deny-by-default

This lint has been warn-by-default for a year now (since https://github.com/rust-lang/rust/pull/82525), so I think it is time to crank it up a bit. Code that triggers the lint causes UB (without `unsafe`) when executed, so we really don't want people to write code like this.

2 years agoRollup merge of #94605 - Michcioperz:patch-1, r=pnkfelix
Dylan DPC [Sat, 16 Apr 2022 05:12:42 +0000 (07:12 +0200)]
Rollup merge of #94605 - Michcioperz:patch-1, r=pnkfelix

Add missing links in platform support docs

I was looking at m68k support and saw that https://doc.rust-lang.org/rustc/platform-support.html and the sidebar there were missing some links to target documentation

2 years agoRollup merge of #93969 - bjorn3:codegen_backend_dep_info, r=pnkfelix
Dylan DPC [Sat, 16 Apr 2022 05:12:42 +0000 (07:12 +0200)]
Rollup merge of #93969 - bjorn3:codegen_backend_dep_info, r=pnkfelix

Only add codegen backend to dep info if -Zbinary-dep-depinfo is used

I am currently migrating the cg_clif build system from using a binary linked to the codegen backend as rustc replacement to passing `-Zcodegen-backend` instead. Without this PR this would force cargo to rebuild the sysroot on any change to the codegen backend even if I explicitly specify that I want it to be preserved, which would make development of cg_clif a lot slower. If you still want to have changes to the codegen backend invalidate the cargo build cache you can explicitly specify `-Zbinary-dep-depinfo`.

cc ``@eddyb`` as the codegen backend was initially added to the depinfo for rust-gpu.

2 years agoAuto merge of #94468 - Amanieu:global_asm_sym, r=nagisa
bors [Sat, 16 Apr 2022 04:46:01 +0000 (04:46 +0000)]
Auto merge of #94468 - Amanieu:global_asm_sym, r=nagisa

Implement sym operands for global_asm!

Tracking issue: #93333

This PR is pretty much a complete rewrite of `sym` operand support for inline assembly so that the same implementation can be shared by `asm!` and `global_asm!`. The main changes are:
- At the AST level, `sym` is represented as a special `InlineAsmSym` AST node containing a path instead of an `Expr`.
- At the HIR level, `sym` is split into `SymStatic` and `SymFn` depending on whether the path resolves to a static during AST lowering (defaults to `SynFn` if `get_early_res` fails).
  - `SymFn` is just an `AnonConst`. It runs through typeck and we just collect the resulting type at the end. An error is emitted if the type is not a `FnDef`.
  - `SymStatic` directly holds a path and the `DefId` of the `static` that it is pointing to.
- The representation at the MIR level is mostly unchanged. There is a minor change to THIR where `SymFn` is a constant instead of an expression.
- At the codegen level we need to apply the target's symbol mangling to the result of `tcx.symbol_name()` depending on the target. This is done by calling the LLVM name mangler, which handles all of the details.
  - On Mach-O, all symbols have a leading underscore.
  - On x86 Windows, different mangling is used for cdecl, stdcall, fastcall and vectorcall.
  - No mangling is needed on other platforms.

r? `@nagisa`
cc `@eddyb`

2 years agoUpdate tests for sym support in global_asm!
Amanieu d'Antras [Tue, 1 Mar 2022 00:54:28 +0000 (00:54 +0000)]
Update tests for sym support in global_asm!

2 years agoAuto merge of #95450 - jyn514:faster-doc, r=Mark-Simulacrum
bors [Sat, 16 Apr 2022 01:57:54 +0000 (01:57 +0000)]
Auto merge of #95450 - jyn514:faster-doc, r=Mark-Simulacrum

Only check the compiler and standard library before documenting them (take 2)

Trying https://github.com/rust-lang/rust/pull/88675 again.

2 years agoMaybeUninit array cleanup
ltdk [Sat, 16 Apr 2022 00:53:50 +0000 (20:53 -0400)]
MaybeUninit array cleanup

* Links MaybeUninit::uninit_array to meta-tracking issue
* Links MaybeUninit::array_assume_init to meta-tracking issue
* Unstably constifies MaybeUninit::array_assume_init

2 years agoAuto merge of #95224 - mjbshaw:patch-1, r=yaahc
bors [Fri, 15 Apr 2022 23:15:51 +0000 (23:15 +0000)]
Auto merge of #95224 - mjbshaw:patch-1, r=yaahc

Optimize RcInnerPtr::inc_strong()/inc_weak() instruction count

Inspired by this internals thread: https://internals.rust-lang.org/t/rc-optimization-on-64-bit-targets/16362

[The generated assembly is a bit smaller](https://rust.godbolt.org/z/TeTnf6144) and is a more efficient usage of the CPU's instruction cache. `unlikely` doesn't impact any of the small artificial tests I've done, but I've included it in case it might help more complex scenarios when this is inlined.

2 years agoadd codegen smoke test
Ralf Jung [Wed, 13 Apr 2022 02:25:52 +0000 (22:25 -0400)]
add codegen smoke test

2 years agoAuto merge of #96087 - Dylan-DPC:rollup-k6yzk55, r=Dylan-DPC
bors [Fri, 15 Apr 2022 18:51:40 +0000 (18:51 +0000)]
Auto merge of #96087 - Dylan-DPC:rollup-k6yzk55, r=Dylan-DPC

Rollup of 11 pull requests

Successful merges:

 - #94457 (Stabilize `derive_default_enum`)
 - #94461 (Create (unstable) 2024 edition)
 - #94849 (Check var scope if it exist)
 - #95194 (remove find_use_placement)
 - #95749 (only downgrade selection Error -> Ambiguous if type error is in predicate)
 - #96026 (couple of clippy::complexity fixes)
 - #96027 (remove function parameters only used in recursion)
 - #96034 ([test] Add test cases of untested functions for BTreeSet )
 - #96040 (Use u32 instead of i32 for futexes.)
 - #96062 (docs: Update tests chapter for Termination stabilization)
 - #96065 (Refactor: Use `format-args-capture` and remove unnecessary nested blocks in rustc_typeck)

Failed merges:

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

2 years agoRollup merge of #96065 - TaKO8Ki:use-`format-args-capture`-and-remove-unnecessary...
Dylan DPC [Fri, 15 Apr 2022 18:50:52 +0000 (20:50 +0200)]
Rollup merge of #96065 - TaKO8Ki:use-`format-args-capture`-and-remove-unnecessary-nested-blocks, r=compiler-errors

Refactor: Use `format-args-capture` and remove unnecessary nested blocks in rustc_typeck

2 years agoRollup merge of #96062 - ehuss:test-termination, r=Dylan-DPC
Dylan DPC [Fri, 15 Apr 2022 18:50:51 +0000 (20:50 +0200)]
Rollup merge of #96062 - ehuss:test-termination, r=Dylan-DPC

docs: Update tests chapter for Termination stabilization

A small update for the docs of `#[test]` functions as a result of the `Termination` stabilization in #93840.

2 years agoRollup merge of #96040 - m-ou-se:futex-u32, r=Amanieu
Dylan DPC [Fri, 15 Apr 2022 18:50:50 +0000 (20:50 +0200)]
Rollup merge of #96040 - m-ou-se:futex-u32, r=Amanieu

Use u32 instead of i32 for futexes.

This changes futexes from i32 to u32. The [Linux man page](https://man7.org/linux/man-pages/man2/futex.2.html) uses `uint32_t` for them, so I'm not sure why I used i32 for them. Maybe because I first used them for thread parkers, where I used -1, 0, and 1 as the states.

(Wasm's `memory.atomic.wait32` does use `i32`, because wasm doesn't support `u32`.)

It doesn't matter much, but using the unsigned type probably results in fewer surprises when shifting bits around or using comparison operators.

r? ```@Amanieu```

2 years agoRollup merge of #96034 - Gumichocopengin8:test/btree-set, r=Dylan-DPC
Dylan DPC [Fri, 15 Apr 2022 18:50:49 +0000 (20:50 +0200)]
Rollup merge of #96034 - Gumichocopengin8:test/btree-set, r=Dylan-DPC

[test] Add test cases of untested functions for BTreeSet

- add [`is_superset()`](https://doc.rust-lang.org/std/collections/struct.BTreeSet.html#method.is_superset) and [`remove()`](https://doc.rust-lang.org/std/collections/struct.BTreeSet.html#method.remove) test cases for BTreeSet since these functions has no test cases.

2 years agoRollup merge of #96027 - matthiaskrgr:clippy_rec, r=fee1-dead
Dylan DPC [Fri, 15 Apr 2022 18:50:48 +0000 (20:50 +0200)]
Rollup merge of #96027 - matthiaskrgr:clippy_rec, r=fee1-dead

remove function parameters only used in recursion

2 years agoRollup merge of #96026 - matthiaskrgr:clippy_compl_1304, r=Dylan-DPC
Dylan DPC [Fri, 15 Apr 2022 18:50:47 +0000 (20:50 +0200)]
Rollup merge of #96026 - matthiaskrgr:clippy_compl_1304, r=Dylan-DPC

couple of clippy::complexity fixes

2 years agoRollup merge of #95749 - compiler-errors:ambig, r=oli-obk
Dylan DPC [Fri, 15 Apr 2022 18:50:46 +0000 (20:50 +0200)]
Rollup merge of #95749 - compiler-errors:ambig, r=oli-obk

only downgrade selection Error -> Ambiguous if type error is in predicate

That is, we don't care if there's a TypeError type in the ParamEnv.

Fixes #95408

2 years agoRollup merge of #95194 - kckeiks:update-algo-in-find-use-placement, r=pnkfelix
Dylan DPC [Fri, 15 Apr 2022 18:50:45 +0000 (20:50 +0200)]
Rollup merge of #95194 - kckeiks:update-algo-in-find-use-placement, r=pnkfelix

remove find_use_placement

A more robust solution to finding where to place use suggestions was added in #94584.
The algorithm uses the AST to find the span for the suggestion so we pass this span
down to the HIR during lowering and use it instead of calling `find_use_placement`

Fixes #94941

2 years agoRollup merge of #94849 - ouz-a:master4, r=oli-obk
Dylan DPC [Fri, 15 Apr 2022 18:50:44 +0000 (20:50 +0200)]
Rollup merge of #94849 - ouz-a:master4, r=oli-obk

Check var scope if it exist

Fixes #92893.

Added helper function to check the scope of a variable, if it doesn't have a scope call delay_span_bug, which avoids us trying to get a block/scope that doesn't exist.

Had to increase `ROOT_ENTRY_LIMIT` was getting tidy error

2 years agoRollup merge of #94461 - jhpratt:2024-edition, r=pnkfelix
Dylan DPC [Fri, 15 Apr 2022 18:50:43 +0000 (20:50 +0200)]
Rollup merge of #94461 - jhpratt:2024-edition, r=pnkfelix

Create (unstable) 2024 edition

[On Zulip](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Deprecating.20macro.20scoping.20shenanigans/near/272860652), there was a small aside regarding creating the 2024 edition now as opposed to later. There was a reasonable amount of support and no stated opposition.

This change creates the 2024 edition in the compiler and creates a prelude for the 2024 edition. There is no current difference between the 2021 and 2024 editions. Cargo and other tools will need to be updated separately, as it's not in the same repository. This change permits the vast majority of work towards the next edition to proceed _now_ instead of waiting until 2024.

For sanity purposes, I've merged the "hello" UI tests into a single file with multiple revisions. Otherwise we'd end up with a file per edition, despite them being essentially identical.

````@rustbot```` label +T-lang +S-waiting-on-review

Not sure on the relevant team, to be honest.

2 years agoRollup merge of #94457 - jhpratt:stabilize-derive_default_enum, r=davidtwco
Dylan DPC [Fri, 15 Apr 2022 18:50:43 +0000 (20:50 +0200)]
Rollup merge of #94457 - jhpratt:stabilize-derive_default_enum, r=davidtwco

Stabilize `derive_default_enum`

This stabilizes `#![feature(derive_default_enum)]`, as proposed in [RFC 3107](https://github.com/rust-lang/rfcs/pull/3107) and tracked in #87517. In short, it permits you to `#[derive(Default)]` on `enum`s, indicating what the default should be by placing a `#[default]` attribute on the desired variant (which must be a unit variant in the interest of forward compatibility).

```````@rustbot``````` label +S-waiting-on-review +T-lang

2 years agoAuto merge of #94079 - petrochenkov:cstr, r=joshtriplett
bors [Fri, 15 Apr 2022 15:47:17 +0000 (15:47 +0000)]
Auto merge of #94079 - petrochenkov:cstr, r=joshtriplett

library: Move `CStr` to libcore, and `CString` to liballoc

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

Interesting points:
- Stability:
    - To make `CStr(ing)` from libcore/liballoc unusable without enabling features I had to make these structures unstable, and reexport them from libstd using stable type aliases instead of `pub use` reexports. (Because stability of `use` items is not checked.)
- Relying on target ABI in libcore is ok:
    - https://github.com/rust-lang/rust/pull/94079#issuecomment-1044263371
- `trait CStrExt` (UPDATE: used only in `cfg(bootstrap)` mode, otherwise lang items are used instead)
    - https://github.com/rust-lang/rust/pull/94079#issuecomment-1047863450
- `strlen`
    - https://github.com/rust-lang/rust/pull/94079#issuecomment-1047863450

Otherwise it's just a code move + some minor hackery usual for liballoc in `cfg(test)` mode.

2 years agoMake some `usize`-typed masks definition agnostic to the size of `usize`
Eduardo Sánchez Muñoz [Fri, 15 Apr 2022 14:59:40 +0000 (16:59 +0200)]
Make some `usize`-typed masks definition agnostic to the size of `usize`

Some masks where defined as
```rust
const NONASCII_MASK: usize = 0x80808080_80808080u64 as usize;
```
where it was assumed that `usize` is never wider than 64, which is currently true.

To make those constants valid in a hypothetical 128-bit target, these constants have been redefined in an `usize`-width-agnostic way
```rust
const NONASCII_MASK: usize = usize::from_ne_bytes([0x80; size_of::<usize>()]);
```

There are already some cases where Rust anticipates the possibility of supporting 128-bit targets, such as not implementing `From<usize>` for `u64`.

2 years agoclippy: Update full path to `CString`
Vadim Petrochenkov [Fri, 15 Apr 2022 13:52:58 +0000 (16:52 +0300)]
clippy: Update full path to `CString`

2 years agoAdd codegen for global_asm! sym operands
Amanieu d'Antras [Tue, 1 Mar 2022 00:53:25 +0000 (00:53 +0000)]
Add codegen for global_asm! sym operands

2 years agoAuto merge of #95841 - ChrisDenton:pipe-server, r=m-ou-se
bors [Fri, 15 Apr 2022 13:19:25 +0000 (13:19 +0000)]
Auto merge of #95841 - ChrisDenton:pipe-server, r=m-ou-se

Windows: Use a pipe relay for chaining pipes

Fixes #95759

This fixes the issue by chaining pipes synchronously and manually pumping messages between them. It's not ideal but it has the advantage of not costing anything if pipes are not chained ("don't pay for what you don't use") and it also avoids breaking existing code that rely on our end of the pipe being asynchronous (which includes rustc's own testing framework).

Libraries can avoid needing this by using their own pipes to chain commands.

2 years agochore: formatting
Keita Nonaka [Fri, 15 Apr 2022 08:30:05 +0000 (01:30 -0700)]
chore: formatting

2 years agotest: add try_insert() test cases for BTreeSet
Keita Nonaka [Fri, 15 Apr 2022 08:12:00 +0000 (01:12 -0700)]
test: add try_insert() test cases for BTreeSet

2 years agotest: add get_key_value() test cases for BTreeSet
Keita Nonaka [Fri, 15 Apr 2022 07:04:03 +0000 (00:04 -0700)]
test: add get_key_value() test cases for BTreeSet

2 years agouse `format-args-capture` and remove unnecessary nested block
Takayuki Maeda [Fri, 15 Apr 2022 06:56:32 +0000 (15:56 +0900)]
use `format-args-capture` and remove unnecessary nested block

2 years agotest: add pop_first() pop_last() test cases for BTreeSet
Keita Nonaka [Fri, 15 Apr 2022 06:40:05 +0000 (23:40 -0700)]
test: add pop_first() pop_last() test cases for BTreeSet

2 years agomake unaligned_reference warning visible in future compat report
Ralf Jung [Fri, 15 Apr 2022 01:18:19 +0000 (21:18 -0400)]
make unaligned_reference warning visible in future compat report

2 years agomake unaligned_references lint deny-by-default
Ralf Jung [Sun, 27 Mar 2022 16:42:19 +0000 (12:42 -0400)]
make unaligned_references lint deny-by-default

2 years agoclarify doc(cfg) wording
Andy Russell [Thu, 14 Apr 2022 23:03:56 +0000 (19:03 -0400)]
clarify doc(cfg) wording

The current "This is supported" wording implies that it's possible to
still use the item on other configurations, but in an unsupported way.
Changing this to "Available" removes this ambiguity.

2 years agoDon't build the library and standard library before documenting them
Joshua Nelson [Sun, 5 Sep 2021 20:07:57 +0000 (20:07 +0000)]
Don't build the library and standard library before documenting them

Rustdoc doesn't require the build artifacts to generate the docs, and
especially in the case of rustc, it greatly increases the time needed to
run the build.

- Statically ensure that only the top_stage of a tool is documented

If another part of rustbuild tried to document a different stage, it
would run into errors because `check::Rustc` unconditionally uses the
top stage.

- Try building rustc instead of checking to avoid duplicate artifacts

Tries to workaround the following error:
```
error[E0464]: multiple matching crates for `rustc_ast`
  --> src/librustdoc/lib.rs:40:1
   |
40 | extern crate rustc_ast;
   | ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: candidates:
           crate `rustc_ast`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_ast-6d7c193782263d89.rlib
           crate `rustc_ast`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_ast-e5d09eda5beb759c.rmeta
```

2 years agodocs: Update tests chapter for Termination stabilization
Eric Huss [Thu, 14 Apr 2022 23:42:49 +0000 (16:42 -0700)]
docs: Update tests chapter for Termination stabilization

2 years agoUpdate issue-92893.stderr
ouz-a [Thu, 14 Apr 2022 20:42:15 +0000 (23:42 +0300)]
Update issue-92893.stderr

2 years agoupdate: actions/checkout@v2 to actions/checkout@v3
Keita Nonaka [Thu, 14 Apr 2022 05:37:41 +0000 (22:37 -0700)]
update: actions/checkout@v2 to actions/checkout@v3

update: actions/checkout@v2 to actions/checkout@v3 for all yaml files

Revert "update: actions/checkout@v2 to actions/checkout@v3 for all yaml files"

This reverts commit 7445e582b900f0f56f5f2bd9036aacab97ef28e9.

change GitHub Actions version v2 to v3

change GitHub Actions

2 years agolibrary: Remove definitions and reexports of `strlen` from libstd
Vadim Petrochenkov [Thu, 14 Apr 2022 11:38:39 +0000 (14:38 +0300)]
library: Remove definitions and reexports of `strlen` from libstd

2 years agoFix targets not supporting `target_has_atomic = "ptr"`
Vadim Petrochenkov [Wed, 13 Apr 2022 13:35:40 +0000 (16:35 +0300)]
Fix targets not supporting `target_has_atomic = "ptr"`

2 years agolibrary: Use type aliases to make `CStr(ing)` in libcore/liballoc unstable
Vadim Petrochenkov [Wed, 6 Apr 2022 14:04:18 +0000 (17:04 +0300)]
library: Use type aliases to make `CStr(ing)` in libcore/liballoc unstable

2 years agolibrary: Move `CStr` to libcore, and `CString` to liballoc
Vadim Petrochenkov [Wed, 16 Feb 2022 11:23:37 +0000 (19:23 +0800)]
library: Move `CStr` to libcore, and `CString` to liballoc

2 years agoAuto merge of #95315 - compiler-errors:pointee-fix, r=pnkfelix
bors [Thu, 14 Apr 2022 14:37:34 +0000 (14:37 +0000)]
Auto merge of #95315 - compiler-errors:pointee-fix, r=pnkfelix

when checking pointee metadata, canonicalize the `Sized` check

Use `infcx.predicate_must_hold_modulo_regions` with a `Sized` obligation instead of just calling `ty.is_sized`, because the latter does not canonicalize region and type vars (and in the test case I added in this PR, there's a region var in the `ParamEnv`).

Fixes #95311

2 years agoReimplement lowering of sym operands for asm! so that it also works with global_asm!
Amanieu d'Antras [Tue, 1 Mar 2022 00:50:56 +0000 (00:50 +0000)]
Reimplement lowering of sym operands for asm! so that it also works with global_asm!

2 years agoRemove some now-dead code that was only relevant before deaggregation.
Oli Scherer [Thu, 14 Apr 2022 13:31:21 +0000 (13:31 +0000)]
Remove some now-dead code that was only relevant before deaggregation.

The code was broken anyway, if the deaggregator is disabled, it would have ICE on any non-enum Adt

2 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Thu, 14 Apr 2022 12:42:13 +0000 (15:42 +0300)]
:arrow_up: rust-analyzer

2 years agorefactor: change to use peekable
rainy-me [Thu, 14 Apr 2022 12:18:27 +0000 (21:18 +0900)]
refactor: change to use peekable

2 years agoAuto merge of #96031 - ehuss:update-cargo, r=ehuss
bors [Thu, 14 Apr 2022 11:04:26 +0000 (11:04 +0000)]
Auto merge of #96031 - ehuss:update-cargo, r=ehuss

Update cargo

11 commits in e2e2dddebe66dfc1403a312653557e332445308b..dba5baf4345858c591517b24801902a062c399f8
2022-04-05 17:04:53 +0000 to 2022-04-13 21:58:27 +0000
- Part 6 of RFC2906 - Switch the inheritance source from `workspace` to… (rust-lang/cargo#10564)
- Part 5 of RFC2906 - Add support for inheriting `rust-version` (rust-lang/cargo#10563)
- Add support for rustc --check-cfg well known names and values (rust-lang/cargo#10486)
- Reserve filename `Cargo.toml.orig` in `cargo package` (rust-lang/cargo#10551)
- Retry command invocation with argfile (rust-lang/cargo#10546)
- Add a progress indicator for `cargo clean` (rust-lang/cargo#10236)
- Ensure host units don't depend on Docscrape units, fixes rust-lang/cargo#10545 (rust-lang/cargo#10549)
- Fix docs: Bindeps env vars are passed to build script at runtime (rust-lang/cargo#10550)
- Part 4 of RFC2906 - Add support for inheriting `readme` (rust-lang/cargo#10548)
- Part 3 of RFC2906 - Add support for inheriting `license-path`, and `depednency.path` (rust-lang/cargo#10538)
- Bump to 0.63.0, update changelog (rust-lang/cargo#10544)

2 years agoremove redundant function param in check_for_self_assign_helper()
Matthias Krüger [Wed, 13 Apr 2022 21:07:20 +0000 (23:07 +0200)]
remove redundant function param in check_for_self_assign_helper()

2 years agoremove reudndant function param in check_matcher_core()
Matthias Krüger [Wed, 13 Apr 2022 21:03:11 +0000 (23:03 +0200)]
remove reudndant function param in check_matcher_core()

2 years agoremove function param that is only used in recursive of fn inner()
Matthias Krüger [Wed, 13 Apr 2022 20:59:45 +0000 (22:59 +0200)]
remove function param that is only used in recursive of fn inner()

2 years agoUse u32 instead of i32 for futexes.
Mara Bos [Thu, 14 Apr 2022 07:51:25 +0000 (09:51 +0200)]
Use u32 instead of i32 for futexes.

2 years agoRemove trailing whitespace
Boyd Kane [Thu, 14 Apr 2022 09:19:49 +0000 (11:19 +0200)]
Remove trailing whitespace

Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
2 years agodocs: add link from zip to unzip
Boyd Kane [Thu, 14 Apr 2022 07:51:47 +0000 (09:51 +0200)]
docs: add link from zip to unzip

The docs for `Iterator::unzip` explain that it is kind of an inverse operation to `Iterator::zip` and guide the reader to the `zip` docs, but the `zip` docs don't let the user know that they can undo the `zip` operation with `unzip`. This change modifies the docs to help the user find `unzip`.

2 years agoAuto merge of #95928 - nnethercote:rm-TokenTree-Clone, r=petrochenkov
bors [Thu, 14 Apr 2022 06:36:04 +0000 (06:36 +0000)]
Auto merge of #95928 - nnethercote:rm-TokenTree-Clone, r=petrochenkov

Remove `<mbe::TokenTree as Clone>`

`mbe::TokenTree` doesn't really need to implement `Clone`, and getting rid of that impl leads to some speed-ups.

r? `@petrochenkov`

2 years agotest: add remove() test cases for BTreeSet
Keita Nonaka [Thu, 14 Apr 2022 05:19:08 +0000 (22:19 -0700)]
test: add remove() test cases for BTreeSet

2 years agotest: add is_superset test cases for BTreeSet
Keita Nonaka [Thu, 14 Apr 2022 05:09:03 +0000 (22:09 -0700)]
test: add is_superset test cases for BTreeSet

2 years agoUpdate cargo
Eric Huss [Thu, 14 Apr 2022 01:02:32 +0000 (18:02 -0700)]
Update cargo

2 years agoAuto merge of #95981 - martingms:invert-line-offset-parsing, r=nnethercote
bors [Wed, 13 Apr 2022 23:18:33 +0000 (23:18 +0000)]
Auto merge of #95981 - martingms:invert-line-offset-parsing, r=nnethercote

Optimize `<SourceFile as Decodable>::decode`

It showed up as a hot-ish function in a callgrind profile of the `await-call-tree` benchmark crate.

Provides some moderate speedups to compilation of some of the smaller benchmarks:

#### Primary benchmarks

Benchmark | Profile | Scenario | % Change | Significance Factor?
-- | -- | -- | -- | --
helloworld | check | full | -1.81% | 9.03x
helloworld | check | incr-unchanged | -1.80% | 8.99x
helloworld | check | incr-full | -1.59% | 7.97x
helloworld | check | incr-patched: println | -1.57% | 7.86x

#### Secondary benchmarks
<div class="category-title"></div>

Benchmark | Profile | Scenario | % Change | Significance Factor?
-- | -- | -- | -- | --
unify-linearly | check | incr-unchanged | -1.55% | 7.74x
unify-linearly | check | incr-patched: dummy fn | -1.42% | 7.08x
await-call-tree | check | incr-unchanged | -1.27% | 6.35x
await-call-tree | debug | incr-unchanged | -1.19% | 5.95x
await-call-tree | opt | incr-unchanged | -1.19% | 5.94x
issue-46449 | check | incr-unchanged | -1.08% | 5.39x
issue-46449 | check | incr-patched: u8 3072 | -1.00% | 5.00x
structopt-0.3.26 | check | incr-unchanged | -0.94% | 4.72x
structopt-0.3.26 | opt | incr-unchanged | -0.92% | 4.60x
structopt-0.3.26 | debug | incr-unchanged | -0.92% | 4.59x
issue-46449 | check | full | -0.89% | 4.46x
structopt-0.3.26 | check | full | -0.83% | 4.17x
structopt-0.3.26 | debug | full | -0.78% | 3.88x
structopt-0.3.26 | opt | full | -0.76% | 3.81x
unify-linearly | check | full | -0.75% | 3.74x
projection-caching | check | incr-unchanged | -0.74% | 3.70x
issue-46449 | check | incr-patched: u32 3072 | -0.70% | 3.50x
issue-46449 | check | incr-patched: empty 3072 | -0.68% | 3.41x
structopt-0.3.26 | check | incr-full | -0.68% | 3.40x
wf-projection-stress-65510 | check | incr-unchanged | -0.68% | 3.39x
issue-46449 | check | incr-patched: static str 6144 | -0.67% | 3.37x
wf-projection-stress-65510 | debug | incr-unchanged | -0.67% | 3.33x
wf-projection-stress-65510 | opt | incr-unchanged | -0.66% | 3.31x
issue-46449 | check | incr-patched: io error 6144 | -0.66% | 3.29x
unify-linearly | check | incr-full | -0.65% | 3.26x
issue-46449 | check | incr-full | -0.65% | 3.25x
structopt-0.3.26 | debug | incr-full | -0.64% | 3.18x
structopt-0.3.26 | opt | incr-full | -0.63% | 3.17x
issue-46449 | debug | incr-unchanged | -0.61% | 3.06x
issue-46449 | opt | incr-unchanged | -0.61% | 3.03x
await-call-tree | check | full | -0.60% | 2.99x
issue-88862 | check | incr-unchanged | -0.58% | 2.91x
deep-vector | debug | full | 0.57% | 2.83x
await-call-tree | check | incr-full | -0.52% | 2.59x
tt-muncher | opt | full | -0.52% | 2.58x
issue-58319 | check | incr-unchanged | -0.50% | 2.52x
await-call-tree | debug | full | -0.50% | 2.49x
await-call-tree | opt | full | -0.49% | 2.45x
deep-vector | debug | incr-patched: println | 0.47% | 2.37x
await-call-tree | debug | incr-full | -0.45% | 2.26x
await-call-tree | opt | incr-full | -0.44% | 2.18x
issue-88862 | check | full | -0.41% | 2.06x
mockall-0.11.0 | check | incr-unchanged | -0.38% | 1.90x
regression-31157 | check | incr-unchanged | -0.37% | 1.86x
wf-projection-stress-65510 | opt | full | -0.36% | 1.80x
deunicode-1.3.1 | check | incr-unchanged | -0.35% | 1.76x
unify-linearly | debug | incr-patched: dummy fn | -0.35% | 1.74x
mockall-0.11.0 | check | full | -0.35% | 1.73x
unify-linearly | debug | incr-unchanged | -0.34% | 1.69x
deunicode-1.3.1 | check | full | -0.33% | 1.63x
token-stream-stress | check | full | -0.32% | 1.62x
token-stream-stress | check | incr-full | -0.32% | 1.59x
token-stream-stress | check | incr-unchanged | -0.32% | 1.59x
regression-31157 | check | incr-patched: println | -0.31% | 1.57x
wf-projection-stress-65510 | check | full | -0.31% | 1.54x
deeply-nested-multi | check | incr-unchanged | -0.31% | 1.53x
mockall-0.11.0 | opt | incr-unchanged | -0.30% | 1.50x

r? `@nnethercote`

2 years ago`mbe::TokenTree`: remove `Lrc` around `Delimited` and `SequenceRepetition`.
Nicholas Nethercote [Mon, 11 Apr 2022 06:27:19 +0000 (16:27 +1000)]
`mbe::TokenTree`: remove `Lrc` around `Delimited` and `SequenceRepetition`.

2 years agoIntroduce `TtHandle` and use it in `TokenSet`.
Nicholas Nethercote [Mon, 11 Apr 2022 00:55:49 +0000 (10:55 +1000)]
Introduce `TtHandle` and use it in `TokenSet`.

This removes the last use of `<mbe::TokenTree as Clone>`. It also
removes two trivial methods on `Delimited`.

2 years agoAuto merge of #95968 - davidtwco:translation-lazy-fallback, r=oli-obk
bors [Wed, 13 Apr 2022 21:04:19 +0000 (21:04 +0000)]
Auto merge of #95968 - davidtwco:translation-lazy-fallback, r=oli-obk

errors: lazily load fallback fluent bundle

Addresses (hopefully) https://github.com/rust-lang/rust/pull/95667#issuecomment-1094794087.

Loading the fallback bundle in compilation sessions that won't go on to emit any errors unnecessarily degrades compile time performance, so lazily create the Fluent bundle when it is first required.

r? `@ghost` (just for perf initially)

2 years agocouple of clippy::complexity fixes
Matthias Krüger [Wed, 13 Apr 2022 20:51:34 +0000 (22:51 +0200)]
couple of clippy::complexity fixes

2 years agocouple of clippy::perf fixes
Matthias Krüger [Wed, 13 Apr 2022 20:18:28 +0000 (22:18 +0200)]
couple of clippy::perf fixes

2 years agoAuto merge of #95958 - jhpratt:bump-stdarch, r=Dylan-DPC
bors [Wed, 13 Apr 2022 18:44:35 +0000 (18:44 +0000)]
Auto merge of #95958 - jhpratt:bump-stdarch, r=Dylan-DPC

Update stdarch

library/stdarch bcbe0106...d215afe9 (7):
  - Add the rdm target feature to the sqrdmlsh intrinsic. (rust-lang/stdarch#1285)
  - Remove use of `#[rustc_deprecated]`
  - Remove feature gates for stabilized features
  - Change remaining _undefined_ functions to zero-init
  - Use SPDX license format and update packed_simd crate link (rust-lang/stdarch#1297)
  - Fix broken links (rust-lang/stdarch#1294)
  - Import the asm macro in std_detect (rust-lang/stdarch#1290)

2 years agoimprove diagnostics for unterminated nested block comment
rainy-me [Wed, 13 Apr 2022 18:22:02 +0000 (03:22 +0900)]
improve diagnostics for unterminated nested block comment

2 years agoAuto merge of #96015 - Dylan-DPC:rollup-vhdprid, r=Dylan-DPC
bors [Wed, 13 Apr 2022 16:04:06 +0000 (16:04 +0000)]
Auto merge of #96015 - Dylan-DPC:rollup-vhdprid, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #93217 (Improve Rustdoc UI for scraped examples with multiline arguments, fix overflow in line numbers)
 - #95885 (Improve error message in case of missing checksum)
 - #95962 (Document that DirEntry holds the directory open)
 - #95991 (fix: wrong trait import suggestion for T:)
 - #96005 (Add missing article to fix "few" to "a few".)
 - #96006 (Add a missing article)

Failed merges:

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

2 years agoRollup merge of #96006 - hkBst:patch-2, r=Dylan-DPC
Dylan DPC [Wed, 13 Apr 2022 15:35:37 +0000 (17:35 +0200)]
Rollup merge of #96006 - hkBst:patch-2, r=Dylan-DPC

Add a missing article

Add a missing article

2 years agoRollup merge of #96005 - hkBst:patch-1, r=Dylan-DPC
Dylan DPC [Wed, 13 Apr 2022 15:35:35 +0000 (17:35 +0200)]
Rollup merge of #96005 - hkBst:patch-1, r=Dylan-DPC

Add missing article to fix "few" to "a few".

Add missing article to fix "few" (not many) to "a few" (some).

2 years agoRollup merge of #95991 - PoorlyDefinedBehaviour:fix/issue_95898, r=fee1-dead
Dylan DPC [Wed, 13 Apr 2022 15:35:34 +0000 (17:35 +0200)]
Rollup merge of #95991 - PoorlyDefinedBehaviour:fix/issue_95898, r=fee1-dead

fix: wrong trait import suggestion for T:

The suggestion to bound `T` had an extra `:`.

```rust
fn foo<T:>(t: T) {
  t.clone();
}
```

```
error[E0599]: no method named `clone` found for type parameter `T` in the current scope
 --> src/lib.rs:2:7
  |
2 |     t.clone();
  |       ^^^^^ method not found in `T`
  |
  = help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `clone`, perhaps you need to restrict type parameter `T` with it:
  |
1 | fn foo<T: Clone:>(t: T) {
  |        ~~~~~~~~
 ```

Fixes: #95898
2 years agoRollup merge of #95962 - sourcefrog:doc-direntry, r=Dylan-DPC
Dylan DPC [Wed, 13 Apr 2022 15:35:33 +0000 (17:35 +0200)]
Rollup merge of #95962 - sourcefrog:doc-direntry, r=Dylan-DPC

Document that DirEntry holds the directory open

I had a bug where holding onto DirEntry structs caused file descriptor exhaustion, and thought it would be good to document this.

2 years agoRollup merge of #95885 - gimbles:patch-1, r=Mark-Simulacrum
Dylan DPC [Wed, 13 Apr 2022 15:35:32 +0000 (17:35 +0200)]
Rollup merge of #95885 - gimbles:patch-1, r=Mark-Simulacrum

Improve error message in case of missing checksum

# Fixes
#94217

2 years agoRollup merge of #93217 - willcrichton:example-analyzer, r=GuillaumeGomez
Dylan DPC [Wed, 13 Apr 2022 15:35:32 +0000 (17:35 +0200)]
Rollup merge of #93217 - willcrichton:example-analyzer, r=GuillaumeGomez

Improve Rustdoc UI for scraped examples with multiline arguments, fix overflow in line numbers

This PR improves a few aspects of the scrape examples feature in Rustdoc.
* Only function names and not the full call expression are highlighted.
* For call-sites with multiline arguments, the minimized code viewer will scroll to the top of the call-site rather than the middle if the argument is larger than the viewer size, ensuring that the function name is visible.
* This fixes an issue where the line numbers column had a visible x-scroll bar.

r? `@GuillaumeGomez`

2 years agofix: wrong trait import suggestion for T:
Bruno Felipe Francisco [Wed, 13 Apr 2022 14:02:01 +0000 (11:02 -0300)]
fix: wrong trait import suggestion for T:

2 years agoAuto merge of #95727 - m-ou-se:futex-reentrantmutex, r=Amanieu
bors [Wed, 13 Apr 2022 13:42:19 +0000 (13:42 +0000)]
Auto merge of #95727 - m-ou-se:futex-reentrantmutex, r=Amanieu

Replace ReentrantMutex by a futex-based one on Linux.

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

r? `@Amanieu`

2 years agoAdd a missing article
Marijn Schouten [Wed, 13 Apr 2022 11:33:09 +0000 (13:33 +0200)]
Add a missing article

Add a missing article

2 years agoAuto merge of #95656 - cjgillot:no-id-hashing-mode, r=Aaron1011
bors [Wed, 13 Apr 2022 11:27:17 +0000 (11:27 +0000)]
Auto merge of #95656 - cjgillot:no-id-hashing-mode, r=Aaron1011

Remove NodeIdHashingMode.

r? `@ghost`

2 years agoAdd missing article to fix "few" to "a few".
Marijn Schouten [Wed, 13 Apr 2022 11:24:28 +0000 (13:24 +0200)]
Add missing article to fix "few" to "a few".

Add missing article to fix "few" (not many) to "a few" (some).

2 years agoConsider lifetimes when comparing types for equality in MIR validator
Jakob Degen [Wed, 13 Apr 2022 09:42:28 +0000 (05:42 -0400)]
Consider lifetimes when comparing types for equality in MIR validator

2 years agoImprove error message when there's no checksum
gimbles [Wed, 13 Apr 2022 08:24:22 +0000 (13:54 +0530)]
Improve error message when there's no checksum

2 years agoAuto merge of #94255 - b-naber:use-mir-constant-in-thir, r=oli-obk
bors [Wed, 13 Apr 2022 07:50:56 +0000 (07:50 +0000)]
Auto merge of #94255 - b-naber:use-mir-constant-in-thir, r=oli-obk

Use mir constant in thir instead of ty::Const

This is blocked on https://github.com/rust-lang/rust/pull/94059 (does include its changes, the first two commits in this PR correspond to those changes) and https://github.com/rust-lang/rust/pull/93800 being reinstated (which had to be reverted). Mainly opening since `@lcnr` offered to give some feedback and maybe also for a perf-run (if necessary).

This currently contains a lot of duplication since some of the logic of `ty::Const` had to be copied to `mir::ConstantKind`, but with the introduction of valtrees a lot of that functionality will disappear from `ty::Const`.

Only the last commit contains changes that need to be reviewed here. Did leave some `FIXME` comments regarding future implementation decisions and some things that might be incorrectly implemented.

r? `@oli-obk`

2 years agoUse .extend(..) instead of push()-ing in loop
Martin Gammelsæter [Wed, 13 Apr 2022 06:44:20 +0000 (08:44 +0200)]
Use .extend(..) instead of push()-ing in loop

A bit less readable but more compact, and maybe faster? We'll see.

2 years agoAuto merge of #95999 - Dylan-DPC:rollup-k2r3k11, r=Dylan-DPC
bors [Wed, 13 Apr 2022 05:36:26 +0000 (05:36 +0000)]
Auto merge of #95999 - Dylan-DPC:rollup-k2r3k11, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #95441 (Always use system `python3` on MacOS)
 - #95954 (Fix broken link in coverage tools docs)
 - #95984 (Fix spelling in docs for `can_not_overflow`)
 - #95989 (diagnostics: regression test for spurrious "help: store this in the heap")

Failed merges:

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

2 years agoRollup merge of #95989 - rust-lang:notriddle/issue-82446, r=compiler-errors
Dylan DPC [Wed, 13 Apr 2022 03:54:13 +0000 (05:54 +0200)]
Rollup merge of #95989 - rust-lang:notriddle/issue-82446, r=compiler-errors

diagnostics: regression test for spurrious "help: store this in the heap"

Closes #82446