]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agomir: use `FiniteBitSet<u32>` in polymorphization
David Wood [Tue, 4 Aug 2020 17:11:57 +0000 (18:11 +0100)]
mir: use `FiniteBitSet<u32>` in polymorphization

This commit changes polymorphization to return a `FiniteBitSet<u32>`
rather than a `FiniteBitSet<u64>` because most functions do not use
anywhere near sixty-four generic parameters so keeping a `u64` around is
unnecessary in most cases.

Signed-off-by: David Wood <david@davidtw.co>
3 years agoAuto merge of #74850 - TimDiekmann:remove-in-place-alloc, r=Amanieu
bors [Tue, 4 Aug 2020 11:22:45 +0000 (11:22 +0000)]
Auto merge of #74850 - TimDiekmann:remove-in-place-alloc, r=Amanieu

Remove in-place allocation and revert to separate methods for zeroed allocations

closes rust-lang/wg-allocators#58

3 years agoAuto merge of #75095 - pietroalbini:fallible-fast-fail, r=Mark-Simulacrum
bors [Tue, 4 Aug 2020 09:18:22 +0000 (09:18 +0000)]
Auto merge of #75095 - pietroalbini:fallible-fast-fail, r=Mark-Simulacrum

ci: disable fast-fail on auto-fallible

The purpose of the auto-fallible job is to run builders that are likely to fail on CI without gating on them. Having fast-fail enabled there kinda defeats the purpose, as if one of them fails we can't monitor the outcome of the other ones.

This was prompted by the aarch64-gnu builder consistently failing due to a broken test, preventing us from seeing if the macOS spurious failure is fixed.

r? @Mark-Simulacrum

3 years agoci: disable fail-fast on auto-fallible
Pietro Albini [Mon, 3 Aug 2020 08:32:47 +0000 (10:32 +0200)]
ci: disable fail-fast on auto-fallible

The purpose of the auto-fallible job is to run builders that are likely
to fail on CI without gating on them. Having fail-fast enabled there
kinda defeats the purpose, as if one of them fails we can't monitor the
outcome of the other ones.

This was prompted by the aarch64-gnu builder consistently failing due to
a broken test, preventing us from seeing if the macOS spurious failure
is fixed.

3 years agoAuto merge of #75111 - mati865:use-lld-option, r=Mark-Simulacrum
bors [Tue, 4 Aug 2020 05:37:44 +0000 (05:37 +0000)]
Auto merge of #75111 - mati865:use-lld-option, r=Mark-Simulacrum

Make rust.use-lld config option work with non MSVC targets

Builds fine and passes tests on Linux.
Not overriding `use-lld` by `linker` makes sense on those platforms since very old GCC versions don't understand `-fuse-ld=lld`. This allows pointing to newer GCC or Clang that will know how to call LLD.

3 years agoAuto merge of #75058 - ssomers:btree_cleanup_insert_2, r=Mark-Simulacrum
bors [Tue, 4 Aug 2020 03:48:48 +0000 (03:48 +0000)]
Auto merge of #75058 - ssomers:btree_cleanup_insert_2, r=Mark-Simulacrum

Clarify reuse of a BTreeMap insert support function and treat split support likewise

r? @Mark-Simulacrum

3 years agoAuto merge of #75126 - JohnTitor:rollup-aejluzx, r=JohnTitor
bors [Tue, 4 Aug 2020 01:48:32 +0000 (01:48 +0000)]
Auto merge of #75126 - JohnTitor:rollup-aejluzx, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #74759 (add `unsigned_abs` to signed integers)
 - #75043 (rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`)
 - #75056 (Lint path statements to suggest using drop when the type needs drop)
 - #75081 (Fix logging for rustdoc)
 - #75083 (Do not trigger `unused_braces` for `while let`)
 - #75084 (Stabilize Ident::new_raw)
 - #75103 (Disable building rust-analyzer on riscv64)
 - #75106 (Enable docs on in the x86_64-unknown-linux-musl manifest)

Failed merges:

r? @ghost

3 years agoRollup merge of #75106 - etherealist:docs_manifest, r=Mark-Simulacrum
Yuki Okushi [Tue, 4 Aug 2020 00:27:10 +0000 (09:27 +0900)]
Rollup merge of #75106 - etherealist:docs_manifest, r=Mark-Simulacrum

Enable docs on in the x86_64-unknown-linux-musl manifest

Add the rust-docs component to toolchain x86_64-unknown-linux-musl, which allows people using rustup on their musl-based linux distribution to download the rust-docs.

Generating and uploading the docs was enabled in b5d143b (#74871).

In #75102 @Mark-Simulacrum found that we are uploading the docs, but the correct manifest is missing.

* The relevant call to build-manifest seems to be [in bootstrap](https://github.com/rust-lang/rust/blob/c058a8b8dc5dea0ed9b33e14da9e317e2749fcd7/src/bootstrap/dist.rs#L2334)

* The manifest is then used in [promote-release crontab](https://github.com/rust-lang/rust-central-station/blob/master/crontab)

3 years agoRollup merge of #75103 - Mark-Simulacrum:no-ra-for-riscv64, r=matklad
Yuki Okushi [Tue, 4 Aug 2020 00:27:08 +0000 (09:27 +0900)]
Rollup merge of #75103 - Mark-Simulacrum:no-ra-for-riscv64, r=matklad

Disable building rust-analyzer on riscv64

riscv64 has an LLVM bug that makes rust-analyzer not build. Should permit future rust-analyzer ups (e.g., https://github.com/rust-lang/rust/pull/74813) to land.

3 years agoRollup merge of #75084 - Aaron1011:stabilize/ident-new-raw, r=petrochenkov
Yuki Okushi [Tue, 4 Aug 2020 00:27:06 +0000 (09:27 +0900)]
Rollup merge of #75084 - Aaron1011:stabilize/ident-new-raw, r=petrochenkov

Stabilize Ident::new_raw

Tracking issue: #54723

This is a continuation of PR #59002

3 years agoRollup merge of #75083 - JohnTitor:follow-up-unused-braces, r=lcnr
Yuki Okushi [Tue, 4 Aug 2020 00:27:04 +0000 (09:27 +0900)]
Rollup merge of #75083 - JohnTitor:follow-up-unused-braces, r=lcnr

Do not trigger `unused_braces` for `while let`

Follow-up for #75031
r? @lcnr

3 years agoRollup merge of #75081 - jyn514:fix-logging, r=Mark-Simulacrum
Yuki Okushi [Tue, 4 Aug 2020 00:27:03 +0000 (09:27 +0900)]
Rollup merge of #75081 - jyn514:fix-logging, r=Mark-Simulacrum

Fix logging for rustdoc

https://github.com/rust-lang/rust/pull/74726#issuecomment-667765557

3 years agoRollup merge of #75056 - Veykril:path_statements_lint, r=oli-obk
Yuki Okushi [Tue, 4 Aug 2020 00:27:01 +0000 (09:27 +0900)]
Rollup merge of #75056 - Veykril:path_statements_lint, r=oli-obk

Lint path statements to suggest using drop when the type needs drop

Fixes #48852. With this change the current lint description doesn't really fit entirely anymore I think.

3 years agoRollup merge of #75043 - petrochenkov:hasname, r=nnethercote
Yuki Okushi [Tue, 4 Aug 2020 00:26:59 +0000 (09:26 +0900)]
Rollup merge of #75043 - petrochenkov:hasname, r=nnethercote

rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`

For consistency with `Attribute::has_name` which doesn't mark the attribute as used either.

Replace all uses of `check_name` with `has_name` outside of rustc, only rustc needs to mark attributes as used.

cc https://github.com/rust-lang/rust/pull/74932
r? @nnethercote

3 years agoRollup merge of #74759 - carbotaniuman:uabs, r=shepmaster
Yuki Okushi [Tue, 4 Aug 2020 00:26:58 +0000 (09:26 +0900)]
Rollup merge of #74759 - carbotaniuman:uabs, r=shepmaster

add `unsigned_abs` to signed integers

Mentioned on rust-lang/rfcs#2914

This PR simply adds an `unsigned_abs` to signed integers function which returns the correct absolute value as a unsigned integer.

3 years agoAuto merge of #74695 - alexcrichton:more-wasm-float-cast-fixes, r=nagisa
bors [Mon, 3 Aug 2020 23:57:50 +0000 (23:57 +0000)]
Auto merge of #74695 - alexcrichton:more-wasm-float-cast-fixes, r=nagisa

rustc: Improving safe wasm float->int casts

This commit improves code generation for WebAssembly targets when
translating floating to integer casts. This improvement is only relevant
when the `nontrapping-fptoint` feature is not enabled, but the feature
is not enabled by default right now. Additionally this improvement only
affects safe casts since unchecked casts were improved in #74659.

Some more background for this issue is present on #73591, but the
general gist of the issue is that in LLVM the `fptosi` and `fptoui`
instructions are defined to return an `undef` value if they execute on
out-of-bounds values; they notably do not trap. To implement these
instructions for WebAssembly the LLVM backend must therefore generate
quite a few instructions before executing `i32.trunc_f32_s` (for
example) because this WebAssembly instruction traps on out-of-bounds
values. This codegen into wasm instructions happens very late in the
code generator, so what ends up happening is that rustc inserts its own
codegen to implement Rust's saturating semantics, and then LLVM also
inserts its own codegen to make sure that the `fptosi` instruction
doesn't trap. Overall this means that a function like this:

    #[no_mangle]
    pub unsafe extern "C" fn cast(x: f64) -> u32 {
        x as u32
    }

will generate this WebAssembly today:

    (func $cast (type 0) (param f64) (result i32)
      (local i32 i32)
      local.get 0
      f64.const 0x1.fffffffep+31 (;=4.29497e+09;)
      f64.gt
      local.set 1
      block  ;; label = @1
        block  ;; label = @2
          local.get 0
          f64.const 0x0p+0 (;=0;)
          local.get 0
          f64.const 0x0p+0 (;=0;)
          f64.gt
          select
          local.tee 0
          f64.const 0x1p+32 (;=4.29497e+09;)
          f64.lt
          local.get 0
          f64.const 0x0p+0 (;=0;)
          f64.ge
          i32.and
          i32.eqz
          br_if 0 (;@2;)
          local.get 0
          i32.trunc_f64_u
          local.set 2
          br 1 (;@1;)
        end
        i32.const 0
        local.set 2
      end
      i32.const -1
      local.get 2
      local.get 1
      select)

This PR improves the situation by updating the code generation for
float-to-int conversions in rustc, specifically only for WebAssembly
targets and only for some situations (float-to-u8 still has not great
codegen). The fix here is to use basic blocks and control flow to avoid
speculatively executing `fptosi`, and instead LLVM's raw intrinsic for
the WebAssembly instruction is used instead. This effectively extends
the support added in #74659 to checked casts. After this commit the
codegen for the above Rust function looks like:

    (func $cast (type 0) (param f64) (result i32)
      (local i32)
      block  ;; label = @1
        local.get 0
        f64.const 0x0p+0 (;=0;)
        f64.ge
        local.tee 1
        i32.const 1
        i32.xor
        br_if 0 (;@1;)
        local.get 0
        f64.const 0x1.fffffffep+31 (;=4.29497e+09;)
        f64.le
        i32.eqz
        br_if 0 (;@1;)
        local.get 0
        i32.trunc_f64_u
        return
      end
      i32.const -1
      i32.const 0
      local.get 1
      select)

For reference, in Rust 1.44, which did not have saturating
float-to-integer casts, the codegen LLVM would emit is:

    (func $cast (type 0) (param f64) (result i32)
      block  ;; label = @1
        local.get 0
        f64.const 0x1p+32 (;=4.29497e+09;)
        f64.lt
        local.get 0
        f64.const 0x0p+0 (;=0;)
        f64.ge
        i32.and
        i32.eqz
        br_if 0 (;@1;)
        local.get 0
        i32.trunc_f64_u
        return
      end
      i32.const 0)

So we're relatively close to the original codegen, although it's
slightly different because the semantics of the function changed where
we're emulating the `i32.trunc_sat_f32_s` instruction rather than always
replacing out-of-bounds values with zero.

There is still work that could be done to improve casts such as `f32` to
`u8`. That form of cast still uses the `fptosi` instruction which
generates lots of branch-y code. This seems less important to tackle now
though. In the meantime this should take care of most use cases of
floating-point conversion and as a result I'm going to speculate that
this...

Closes #73591

3 years agoApply suggestions from code review
Tim Diekmann [Mon, 3 Aug 2020 22:21:05 +0000 (00:21 +0200)]
Apply suggestions from code review

Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
3 years agoAuto merge of #74526 - erikdesjardins:reftrack, r=Mark-Simulacrum
bors [Mon, 3 Aug 2020 21:43:27 +0000 (21:43 +0000)]
Auto merge of #74526 - erikdesjardins:reftrack, r=Mark-Simulacrum

Add track_caller to RefCell::{borrow, borrow_mut}

So panic messages point at the offending borrow.

Fixes #74472

3 years agorustc_ast: More detailed docs for `Attribute::check_name`
Vadim Petrochenkov [Mon, 3 Aug 2020 21:33:56 +0000 (00:33 +0300)]
rustc_ast: More detailed docs for `Attribute::check_name`

3 years agorustc_ast: `(Nested)MetaItem::check_name` -> `has_name`
Vadim Petrochenkov [Sun, 2 Aug 2020 10:17:20 +0000 (13:17 +0300)]
rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`

For consistency with `Attribute::has_name` which doesn't mark the attribute as used either.

Replace all uses of `check_name` with `has_name` outside of rustc

3 years agoStabilize Ident::new_raw
Aaron Hill [Mon, 3 Aug 2020 03:53:41 +0000 (23:53 -0400)]
Stabilize Ident::new_raw

Tracking issue: #54723

This is a continuation of PR #59002

3 years agoMake rust.use-lld config option work with non MSVC targets
Mateusz Mikuła [Mon, 3 Aug 2020 13:39:09 +0000 (15:39 +0200)]
Make rust.use-lld config option work with non MSVC targets

3 years agoAuto merge of #74827 - ssomers:btree_cleanup_insert, r=Mark-Simulacrum
bors [Mon, 3 Aug 2020 15:46:02 +0000 (15:46 +0000)]
Auto merge of #74827 - ssomers:btree_cleanup_insert, r=Mark-Simulacrum

Move bulk of BTreeMap::insert method down to new method on handle

Adjust the boundary between the map and node layers for insertion: do more in the node layer, keep root manipulation and pointer dereferencing separate. No change in undefined behaviour or performance.

r? @Mark-Simulacrum

3 years agoDisable building rust-analyzer on riscv64
Mark Rousskov [Mon, 3 Aug 2020 14:11:30 +0000 (10:11 -0400)]
Disable building rust-analyzer on riscv64

riscv64 has an LLVM bug that makes rust-analyzer not build.

3 years agoEnable docs on in the x86_64-unknown-linux-musl manifest
David Sonder [Mon, 3 Aug 2020 14:02:20 +0000 (16:02 +0200)]
Enable docs on in the x86_64-unknown-linux-musl manifest

Add the rust-docs component to toolchain x86_64-unknown-linux-musl, which allows
people using rustup on their musl-based linux distribution to download the
rust-docs.

Generating and uploading the docs was enabled in b5d143b.

3 years agoAuto merge of #75092 - kennytm:fix-75009, r=pietroalbini
bors [Mon, 3 Aug 2020 09:34:06 +0000 (09:34 +0000)]
Auto merge of #75092 - kennytm:fix-75009, r=pietroalbini

Fix broken git commit in stdarch

Follow-up on #75009, point to the real master commit.

3 years agofix broken git commit in stdarch
kennytm [Mon, 3 Aug 2020 07:52:30 +0000 (15:52 +0800)]
fix broken git commit in stdarch

3 years agoAuto merge of #75076 - tmiasko:simplify-goto, r=oli-obk
bors [Mon, 3 Aug 2020 07:20:21 +0000 (07:20 +0000)]
Auto merge of #75076 - tmiasko:simplify-goto, r=oli-obk

Fix change detection in CfgSimplifier::collapse_goto_chain

Check that the old target is different from the new collapsed one, before concluding that anything changed.

Fixes #75074
Fixes #75051

3 years agoAuto merge of #75068 - petrochenkov:ignore-debinfo, r=Mark-Simulacrum
bors [Mon, 3 Aug 2020 05:25:03 +0000 (05:25 +0000)]
Auto merge of #75068 - petrochenkov:ignore-debinfo, r=Mark-Simulacrum

tests: Ignore src/test/debuginfo/rc_arc.rs on Windows

It requires loading pretty-printers (`src\etc\gdb_load_rust_pretty_printers.py`), but GDB doesn't load them on Windows.

Not sure how this passes through CI, due to an old GDB version perhaps?

3 years agoAuto merge of #75055 - cjgillot:clean-cache, r=oli-obk
bors [Mon, 3 Aug 2020 03:37:33 +0000 (03:37 +0000)]
Auto merge of #75055 - cjgillot:clean-cache, r=oli-obk

Introduce an abstraction for EvaluationCache and SelectionCache

The small duplicated code has been moved to librustc_query_system.

The remaining changes are some cleanups of structural impls.

3 years agoDo not trigger `unused_braces` for `while let`
Yuki Okushi [Mon, 3 Aug 2020 03:18:10 +0000 (12:18 +0900)]
Do not trigger `unused_braces` for `while let`

3 years agoFix logging for rustdoc
Joshua Nelson [Mon, 3 Aug 2020 02:24:54 +0000 (22:24 -0400)]
Fix logging for rustdoc

3 years agoAuto merge of #74969 - nnethercote:rm-GCX_PTR, r=Mark-Simulacrum
bors [Mon, 3 Aug 2020 01:50:25 +0000 (01:50 +0000)]
Auto merge of #74969 - nnethercote:rm-GCX_PTR, r=Mark-Simulacrum

Remove `GCX_PTR`.

We store an `ImplicitCtxt` pointer in a thread-local value (TLV). This allows
implicit access to a `GlobalCtxt` and some other things.

We also store a `GlobalCtxt` pointer in `GCX_PTR`. This is always the same
`GlobalCtxt` as the one within the `ImplicitCtxt` pointer in TLV. `GCX_PTR`
is only used in the parallel compiler's `handle_deadlock()` function.

This commit does the following.
- It removes `GCX_PTR`.
- It also adds `ImplicitCtxt::new()`, which constructs an `ImplicitCtxt` from a
  `GlobalCtxt`. `ImplicitCtxt::new()` + `tls::enter_context()` is now
  equivalent to the old `tls::enter_global()`.
- Makes `tls::get_tlv()` public for the parallel compiler, because it's
  now used in `handle_deadlock()`.

r? @petrochenkov

3 years agoMerge branch 'master' into remove-in-place-alloc
Tim Diekmann [Mon, 3 Aug 2020 00:18:20 +0000 (02:18 +0200)]
Merge branch 'master' into remove-in-place-alloc

3 years agoAuto merge of #74948 - lzutao:stalize-result-as-deref, r=dtolnay
bors [Sun, 2 Aug 2020 23:55:12 +0000 (23:55 +0000)]
Auto merge of #74948 - lzutao:stalize-result-as-deref, r=dtolnay

Stabilize `Result::as_deref` and `as_deref_mut`

FCP completed in https://github.com/rust-lang/rust/issues/50264#issuecomment-645681400.

This PR stabilizes two new APIs for `std::result::Result`:
```rust
fn as_deref(&self) -> Result<&T::Target, &E> where T: Deref;
fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E> where T: DerefMut;
```

This PR also removes two rarely used unstable APIs from `Result`:
```rust
fn as_deref_err(&self) -> Result<&T, &E::Target> where E: Deref;
fn as_deref_mut_err(&mut self) -> Result<&mut T, &mut E::Target> where E: DerefMut;
```

Closes #50264

3 years agoUse more appropriate `tls::with_*` methods in some places.
Nicholas Nethercote [Fri, 31 Jul 2020 06:38:32 +0000 (16:38 +1000)]
Use more appropriate `tls::with_*` methods in some places.

3 years agoRemove `GCX_PTR`.
Nicholas Nethercote [Fri, 31 Jul 2020 03:01:29 +0000 (13:01 +1000)]
Remove `GCX_PTR`.

We store an `ImplicitCtxt` pointer in a thread-local value (TLV). This allows
implicit access to a `GlobalCtxt` and some other things.

We also store a `GlobalCtxt` pointer in `GCX_PTR`. This is always the same
`GlobalCtxt` as the one within the `ImplicitCtxt` pointer in TLV. `GCX_PTR`
is only used in the parallel compiler's `handle_deadlock()` function.

This commit does the following.
- It removes `GCX_PTR`.
- It also adds `ImplicitCtxt::new()`, which constructs an `ImplicitCtxt` from a
  `GlobalCtxt`. `ImplicitCtxt::new()` + `tls::enter_context()` is now
  equivalent to the old `tls::enter_global()`.
- Makes `tls::get_tlv()` public for the parallel compiler, because it's
  now used in `handle_deadlock()`.

3 years agoRemove redundant assignment from CfgSimplifier
Tomasz Miąsko [Mon, 3 Aug 2020 00:00:00 +0000 (00:00 +0000)]
Remove redundant assignment from CfgSimplifier

3 years agoFix change detection in CfgSimplifier::collapse_goto_chain
Tomasz Miąsko [Mon, 3 Aug 2020 00:00:00 +0000 (00:00 +0000)]
Fix change detection in CfgSimplifier::collapse_goto_chain

Check that the old target is different from the new collapsed one,
before concluding that anything changed.

3 years agoAuto merge of #75070 - Manishearth:rollup-2kgcaw5, r=Manishearth
bors [Sun, 2 Aug 2020 22:07:32 +0000 (22:07 +0000)]
Auto merge of #75070 - Manishearth:rollup-2kgcaw5, r=Manishearth

Rollup of 5 pull requests

Successful merges:

 - #74980 (pprust: adjust mixed comment printing and add regression test for #74745)
 - #75009 (Document the discrepancy in the mask type for _mm_shuffle_ps)
 - #75031 (Do not trigger `unused_{braces,parens}` lints with `yield`)
 - #75059 (fix typos)
 - #75064 (compiletest: Support ignoring tests requiring missing LLVM components)

Failed merges:

r? @ghost

3 years agoRollup merge of #75064 - petrochenkov:llvmtarg, r=Mark-Simulacrum
Manish Goregaokar [Sun, 2 Aug 2020 20:08:48 +0000 (13:08 -0700)]
Rollup merge of #75064 - petrochenkov:llvmtarg, r=Mark-Simulacrum

compiletest: Support ignoring tests requiring missing LLVM components

This PR implements a more principled solution to the problem described in https://github.com/rust-lang/rust/pull/66084.

Builds of LLVM backends take a lot of time and disk space.
So it usually makes sense to build rustc with
```toml
[llvm]
targets = "X86"
experimental-targets = ""
```
unless you are working on some target-specific tasks.

A few tests, however, require non-x86 backends to be built.
A new test directive `// needs-llvm-components: component1 component2 component3` makes such tests to be automatically ignored if one of the listed components is missing in the provided LLVM (this is determined through `llvm-config --components`).

As a result, the test suite now fully passes with LLVM built only with the x86 backend. The component list in this case is
```
aggressiveinstcombine all all-targets analysis asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mirparser native nativecodegen objcarcopts object objectyaml option orcerror orcjit passes profiledata remarks runtimedyld scalaropts selectiondag support symbolize tablegen target textapi transformutils vectorize windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray
```

(With the default target list it's much larger.)
```
aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcerror orcjit passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray
```

https://github.com/rust-lang/rust/pull/66084 is also reverted now.

r? @Mark-Simulacrum

3 years agoRollup merge of #75059 - shengsheng:typos, r=Dylan-DPC
Manish Goregaokar [Sun, 2 Aug 2020 20:08:47 +0000 (13:08 -0700)]
Rollup merge of #75059 - shengsheng:typos, r=Dylan-DPC

fix typos

Fix common misspellings with https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines

3 years agoRollup merge of #75031 - JohnTitor:unused-parens-braces-yield, r=lcnr
Manish Goregaokar [Sun, 2 Aug 2020 20:08:45 +0000 (13:08 -0700)]
Rollup merge of #75031 - JohnTitor:unused-parens-braces-yield, r=lcnr

Do not trigger `unused_{braces,parens}` lints with `yield`

Fixes #74883
r? @lcnr

3 years agoRollup merge of #75009 - georgio:master, r=kennytm
Manish Goregaokar [Sun, 2 Aug 2020 20:08:43 +0000 (13:08 -0700)]
Rollup merge of #75009 - georgio:master, r=kennytm

Document the discrepancy in the mask type for _mm_shuffle_ps

This Pull Request updates the `stdarch` submodule in order to resolve #62490

3 years agoRollup merge of #74980 - davidtwco:issue-74745-pprust-regression-test, r=petrochenkov
Manish Goregaokar [Sun, 2 Aug 2020 20:08:42 +0000 (13:08 -0700)]
Rollup merge of #74980 - davidtwco:issue-74745-pprust-regression-test, r=petrochenkov

pprust: adjust mixed comment printing and add regression test for #74745

Fixes #74745.

This PR adds a regression test for #74745. While a `ignore-tidy-trailing-lines` header is required, this doesn't stop the test from reproducing, so long as there is no newline at the end of the file.

However, adding the header comments made the test fail due to a bug in pprust - so this PR also  adjusts the pretty printing of mixed comments so that the initial zero-break isn't emitted at the beginning of the line. Through this, the `block-comment-wchar` test can have the `pp-exact` file removed, as it no longer converges from pretty printing of the source.

3 years agoAuto merge of #74826 - matklad:mbe-fragment, r=petrochenkov
bors [Sun, 2 Aug 2020 19:48:44 +0000 (19:48 +0000)]
Auto merge of #74826 - matklad:mbe-fragment, r=petrochenkov

Introduce NonterminalKind for more type-safe mbe parsing

It encapsulate the (part of) the interface between the parser and
macro by example (macro_rules) parser.

The second bit is somewhat more general `parse_ast_fragment`, which is
the reason why we keep some `parse_xxx` functions as public.

3 years agoSeparate off a leafy insert function instead of lying, and split split similarly
Stein Somers [Tue, 28 Jul 2020 12:25:30 +0000 (14:25 +0200)]
Separate off a leafy insert function instead of lying, and split split similarly

3 years agotests: Ignore src/test/debuginfo/rc_arc.rs on Windows
Vadim Petrochenkov [Sun, 2 Aug 2020 19:20:48 +0000 (22:20 +0300)]
tests: Ignore src/test/debuginfo/rc_arc.rs on Windows

It requires loading pretty-printers, but GDB doesn't load them on Windows

3 years agoLint path statements to use drop for drop types
Lukas Wirth [Sun, 2 Aug 2020 14:30:09 +0000 (16:30 +0200)]
Lint path statements to use drop for drop types

3 years agoMove bulk of BTreeMap::insert method down to new method on handle
Stein Somers [Wed, 22 Jul 2020 16:17:08 +0000 (18:17 +0200)]
Move bulk of BTreeMap::insert method down to new method on handle

3 years agoAuto merge of #74963 - JohnTitor:ptn-ice, r=petrochenkov
bors [Sun, 2 Aug 2020 18:01:27 +0000 (18:01 +0000)]
Auto merge of #74963 - JohnTitor:ptn-ice, r=petrochenkov

Fix ICEs with `@ ..` binding

This reverts #74557 and introduces an alternative fix while ensuring that #74954 is not broken.
The diagnostics are verbose though, it fixes three related issues.
cc #74954, #74539, and #74702

3 years agocompiletest: Support ignoring tests requiring missing LLVM components
Vadim Petrochenkov [Sun, 2 Aug 2020 15:23:49 +0000 (18:23 +0300)]
compiletest: Support ignoring tests requiring missing LLVM components

3 years agoRecover strictness for `yield`
Yuki Okushi [Sun, 2 Aug 2020 16:31:21 +0000 (01:31 +0900)]
Recover strictness for `yield`

3 years agoAuto merge of #75060 - JohnTitor:rollup-aq8sfxf, r=JohnTitor
bors [Sun, 2 Aug 2020 16:06:54 +0000 (16:06 +0000)]
Auto merge of #75060 - JohnTitor:rollup-aq8sfxf, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #74686 (BTreeMap: remove into_slices and its unsafe block)
 - #74762 (BTreeMap::drain_filter should not touch the root during iteration)
 - #74781 (Clean up E0733 explanation)
 - #74874 (BTreeMap: define forget_type only when relevant)
 - #74974 (Make tests faster in Miri)
 - #75010 (Update elasticlunr-rs and ammonia transitive deps)
 - #75041 (Replaced log with tracing crate)
 - #75044 (Clean up E0744 explanation)
 - #75054 (Rename rustc_middle::cstore::DepKind to CrateDepKind)
 - #75057 (Avoid dumping rustc invocations to stdout)

Failed merges:

 - #74827 (Move bulk of BTreeMap::insert method down to new method on handle)

r? @ghost

3 years agoRollup merge of #75057 - Mark-Simulacrum:avoid-long-print, r=alexcrichton
Yuki Okushi [Sun, 2 Aug 2020 16:05:28 +0000 (01:05 +0900)]
Rollup merge of #75057 - Mark-Simulacrum:avoid-long-print, r=alexcrichton

Avoid dumping rustc invocations to stdout

These are quite long, usually, and in most cases not interesting. On smaller
terminals they can take up more than a full page of output, hiding the error
diagnostics emitted.

3 years agoRollup merge of #75054 - cjgillot:rename-depkind, r=petrochenkov
Yuki Okushi [Sun, 2 Aug 2020 16:05:27 +0000 (01:05 +0900)]
Rollup merge of #75054 - cjgillot:rename-depkind, r=petrochenkov

Rename rustc_middle::cstore::DepKind to CrateDepKind

It is ambiguous with DepGraph's own DepKind.

3 years agoRollup merge of #75044 - GuillaumeGomez:cleanup-e0744, r=pickfire
Yuki Okushi [Sun, 2 Aug 2020 16:05:25 +0000 (01:05 +0900)]
Rollup merge of #75044 - GuillaumeGomez:cleanup-e0744, r=pickfire

Clean up E0744 explanation

r? @Dylan-DPC

3 years agoRollup merge of #75041 - pawanbisht62:feature/replace-log-with-tracing, r=oli-obk
Yuki Okushi [Sun, 2 Aug 2020 16:05:23 +0000 (01:05 +0900)]
Rollup merge of #75041 - pawanbisht62:feature/replace-log-with-tracing, r=oli-obk

Replaced log with tracing crate

Issue #74747

3 years agoRollup merge of #75010 - Aaron1011:feature/remove-old-deps, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:22 +0000 (01:05 +0900)]
Rollup merge of #75010 - Aaron1011:feature/remove-old-deps, r=Mark-Simulacrum

Update elasticlunr-rs and ammonia transitive deps

This removes all dependencies on pre-1.0 proc-macro ecosystem crates
(syn, quote, and proc-macro2)

3 years agoRollup merge of #74974 - RalfJung:miri-tests, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:20 +0000 (01:05 +0900)]
Rollup merge of #74974 - RalfJung:miri-tests, r=Mark-Simulacrum

Make tests faster in Miri

Reduce some test iteration counts in Miri.

3 years agoRollup merge of #74874 - ssomers:btree_cleanup_8, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:18 +0000 (01:05 +0900)]
Rollup merge of #74874 - ssomers:btree_cleanup_8, r=Mark-Simulacrum

BTreeMap: define forget_type only when relevant

Similar to `forget_node_type` for handles.
No effect on generated code, apart maybe from the superfluous calls that might not have been optimized away.

r? @Mark-Simulacrum

3 years agoRollup merge of #74781 - GuillaumeGomez:cleanup-e0733, r=jyn514
Yuki Okushi [Sun, 2 Aug 2020 16:05:15 +0000 (01:05 +0900)]
Rollup merge of #74781 - GuillaumeGomez:cleanup-e0733, r=jyn514

Clean up E0733 explanation

r? @Dylan-DPC

3 years agoRollup merge of #74762 - ssomers:btree_no_root_in_remove_kv_tracking, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:13 +0000 (01:05 +0900)]
Rollup merge of #74762 - ssomers:btree_no_root_in_remove_kv_tracking, r=Mark-Simulacrum

BTreeMap::drain_filter should not touch the root during iteration

Although Miri doesn't point it out, I believe there is undefined behaviour using `drain_filter` when draining the 11th-last element from a tree that was larger. When this happens, the last remaining child nodes are merged, the root becomes empty and is popped from the tree. That last step establishes a mutable reference to the node elected root and writes a pointer in `node::Root`, while iteration continues to visit the same node.

This is mostly code from #74437, slightly adapted.

3 years agoRollup merge of #74686 - ssomers:btree_cleanup_3, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:12 +0000 (01:05 +0900)]
Rollup merge of #74686 - ssomers:btree_cleanup_3, r=Mark-Simulacrum

BTreeMap: remove into_slices and its unsafe block

A small tweak to make BTreeMap code shorter and less unsafe.

r? @Mark-Simulacrum

3 years agoDocument the discrepancy in the mask type for _mm_shuffle_ps
Georgio Nicolas [Sun, 2 Aug 2020 15:22:26 +0000 (18:22 +0300)]
Document the discrepancy in the mask type for _mm_shuffle_ps

3 years agofix typos
liuzhenyu [Sun, 2 Aug 2020 15:20:00 +0000 (23:20 +0800)]
fix typos

3 years agoAvoid dumping rustc invocations to stdout
Mark Rousskov [Sun, 2 Aug 2020 14:54:13 +0000 (10:54 -0400)]
Avoid dumping rustc invocations to stdout

These are quite long, usually, and in most cases not interesting. On smaller
terminals they can take up more than a full page of output, hiding the error
diagnostics emitted.

3 years agocompiletest: print diff for pretty tests
David Wood [Sun, 2 Aug 2020 14:31:06 +0000 (15:31 +0100)]
compiletest: print diff for pretty tests

This commit modifies compiletest so that a diff of actual and expected
output is shown for pretty tests. This makes it far easier to work out
what has changed.

Signed-off-by: David Wood <david@davidtw.co>
3 years agotests: add regression test for #74745
David Wood [Fri, 31 Jul 2020 13:53:44 +0000 (14:53 +0100)]
tests: add regression test for #74745

This commit adds a regression test for #74745. While a
`ignore-tidy-trailing-lines` header is required, this doesn't stop the
test from reproducing, so long as there is no newline at the end of the
file.

However, adding the header comments made the test fail due to a bug in
pprust, fixed in the previous commit.

Signed-off-by: David Wood <david@davidtw.co>
3 years agopprust: adjust mixed comment printing
David Wood [Sun, 2 Aug 2020 14:27:03 +0000 (15:27 +0100)]
pprust: adjust mixed comment printing

This commit adjusts the pretty printing of mixed comments so that the
initial zero-break isn't emitted at the beginning of the line. Through
this, the `block-comment-wchar` test can have the `pp-exact` file
removed, as it no longer converges from pretty printing of the source.

Signed-off-by: David Wood <david@davidtw.co>
3 years agoRename rustc_middle::cstore::DepKind to DependencyKind.
Camille GILLOT [Sun, 2 Aug 2020 12:24:22 +0000 (14:24 +0200)]
Rename rustc_middle::cstore::DepKind to DependencyKind.

3 years agoAuto merge of #74675 - pietroalbini:aarch64-ci-fallible, r=Mark-Simulacrum
bors [Sun, 2 Aug 2020 14:08:48 +0000 (14:08 +0000)]
Auto merge of #74675 - pietroalbini:aarch64-ci-fallible, r=Mark-Simulacrum

Add fallible AArch64 CI builder

This adds the `aarch64-gnu` CI builder to the `auto-fallible` job, as a first step in the process of actually gating on it.

r? @Mark-Simulacrum

3 years agoUse Lift derive proc-macro in librustc_traits.
Camille GILLOT [Sun, 2 Aug 2020 13:42:08 +0000 (15:42 +0200)]
Use Lift derive proc-macro in librustc_traits.

3 years agoMove IntercrateAmbiguityCause to librustc_trait_selection.
Camille GILLOT [Sun, 2 Aug 2020 13:09:07 +0000 (15:09 +0200)]
Move IntercrateAmbiguityCause to librustc_trait_selection.

3 years agoIntroduce an abstraction for EvaluationCache and SelectionCache.
Camille GILLOT [Sun, 2 Aug 2020 13:03:47 +0000 (15:03 +0200)]
Introduce an abstraction for EvaluationCache and SelectionCache.

3 years agoAuto merge of #74210 - estebank:type-ascriptomatic, r=petrochenkov
bors [Sun, 2 Aug 2020 12:20:09 +0000 (12:20 +0000)]
Auto merge of #74210 - estebank:type-ascriptomatic, r=petrochenkov

Deduplicate `::` -> `:` typo errors

Deduplicate errors caused by the same type ascription typo, including
ones suggested during parsing that would get reported again during
resolve. Fix #70382.

3 years agoFormatting: don't mix mod and use
Aleksey Kladov [Sun, 2 Aug 2020 12:05:19 +0000 (14:05 +0200)]
Formatting: don't mix mod and use

Seems to be a fallout from rustfmt transition

3 years agoUse NonterminalKind for MetaVarDecl
Aleksey Kladov [Sat, 1 Aug 2020 15:45:17 +0000 (17:45 +0200)]
Use NonterminalKind for MetaVarDecl

This is more type safe and allows us to remove a few dead branches

3 years agoIntroduce NonterminalKind
Aleksey Kladov [Mon, 27 Jul 2020 12:04:54 +0000 (14:04 +0200)]
Introduce NonterminalKind

It encapsulate the (part of) the interface between the parser and
macro by example (macro_rules) parser.

The second bit is somewhat more general `parse_ast_fragment`, which is
the reason why we keep some `parse_xxx` functions as public.

3 years agoClean up E0744 explanation
Guillaume Gomez [Sun, 2 Aug 2020 11:26:02 +0000 (13:26 +0200)]
Clean up E0744 explanation

3 years agoClean up E0733 explanation
Guillaume Gomez [Sun, 26 Jul 2020 15:38:47 +0000 (17:38 +0200)]
Clean up E0733 explanation

3 years agoAuto merge of #74972 - second-state:wasi-right-fix, r=KodrAus
bors [Sun, 2 Aug 2020 09:41:17 +0000 (09:41 +0000)]
Auto merge of #74972 - second-state:wasi-right-fix, r=KodrAus

Fix std::fs::File::metadata permission on WASI target

Previously `std::fs::File::metadata` on wasm32-wasi would call `fd_filestat_get`
to get metadata associated with fd, but that fd is opened without
RIGHTS_FD_FILESTAT_GET right, so it will failed on correctly implemented WASI
environment.

This change instead to add the missing rights when opening an fd.

3 years agoReplace from log to tracing
bishtpawan [Sun, 2 Aug 2020 07:54:08 +0000 (13:24 +0530)]
Replace from log to tracing

3 years agoAuto merge of #74899 - sajattack:libc_0.2.74_bump, r=jonas-schievink
bors [Sun, 2 Aug 2020 07:23:14 +0000 (07:23 +0000)]
Auto merge of #74899 - sajattack:libc_0.2.74_bump, r=jonas-schievink

bump libc version to 0.2.74

3 years agoReplace from log to tracing in libsrustrustc_ast_lowering, librustc_ast_passes, libru...
bishtpawan [Sun, 2 Aug 2020 06:51:39 +0000 (12:21 +0530)]
Replace from log to tracing in libsrustrustc_ast_lowering, librustc_ast_passes, librustc_ast_pretty

3 years agoAuto merge of #75004 - Aaron1011:move-probably-equal, r=petrochenkov
bors [Sun, 2 Aug 2020 05:34:40 +0000 (05:34 +0000)]
Auto merge of #75004 - Aaron1011:move-probably-equal, r=petrochenkov

Move 'probably equal' methods to librustc_parse

This is preparation for PR #73084

3 years agoAuto merge of #74785 - euclio:deprecation-kinds, r=petrochenkov
bors [Sun, 2 Aug 2020 03:47:29 +0000 (03:47 +0000)]
Auto merge of #74785 - euclio:deprecation-kinds, r=petrochenkov

report kind of deprecated item in message

This is important for fields, which are incorrectly referred to as
"items".

3 years agoUpdate elasticlunr-rs and ammonia transitive deps
Aaron Hill [Sat, 1 Aug 2020 14:11:15 +0000 (10:11 -0400)]
Update elasticlunr-rs and ammonia transitive deps

This removes all dependencies on pre-1.0 proc-macro ecosystem crates
(syn, quote, and proc-macro2)

3 years agoMove 'probably equal' methods to librustc_parse
Aaron Hill [Sat, 1 Aug 2020 11:59:02 +0000 (07:59 -0400)]
Move 'probably equal' methods to librustc_parse

This is preparation for PR #73084

3 years agoAuto merge of #75033 - Manishearth:rollup-d8afil1, r=Manishearth
bors [Sun, 2 Aug 2020 01:04:54 +0000 (01:04 +0000)]
Auto merge of #75033 - Manishearth:rollup-d8afil1, r=Manishearth

Rollup of 5 pull requests

Successful merges:

 - #74602 (Clarify the doc for MaybeUninit::zeroed on incorrect use)
 - #74720 (Clean up E0728 explanation)
 - #74992 (fix rustdoc generic param order)
 - #75015 (Add Vec::spare_capacity_mut)
 - #75022 (Use a slice pattern instead of rchunks_exact(_).next())

Failed merges:

r? @ghost

3 years agoRollup merge of #75022 - cuviper:sliced-rchunk, r=lcnr
Manish Goregaokar [Sun, 2 Aug 2020 00:42:18 +0000 (17:42 -0700)]
Rollup merge of #75022 - cuviper:sliced-rchunk, r=lcnr

Use a slice pattern instead of rchunks_exact(_).next()

This is a minor cleanup, but trying a single-use `rchunks` iterator can
be more directly matched with a slice pattern, `[.., a, b]`.

3 years agoRollup merge of #75015 - Amanieu:vec_spare, r=sfackler
Manish Goregaokar [Sun, 2 Aug 2020 00:42:16 +0000 (17:42 -0700)]
Rollup merge of #75015 - Amanieu:vec_spare, r=sfackler

Add Vec::spare_capacity_mut

Returns the remaining spare capacity of the vector as a slice of `MaybeUninit<T>`.

As suggested by @sfackler in https://github.com/rust-lang/rust/pull/70967#issuecomment-612659006.

r? @sfackler

3 years agoRollup merge of #74992 - lcnr:fix-generic-param-order, r=GuillaumeGomez
Manish Goregaokar [Sun, 2 Aug 2020 00:42:15 +0000 (17:42 -0700)]
Rollup merge of #74992 - lcnr:fix-generic-param-order, r=GuillaumeGomez

fix rustdoc generic param order

fixes #61292

r? @varkor cc @GuillaumeGomez

3 years agoRollup merge of #74720 - GuillaumeGomez:cleanup-e0728, r=jyn514
Manish Goregaokar [Sun, 2 Aug 2020 00:42:13 +0000 (17:42 -0700)]
Rollup merge of #74720 - GuillaumeGomez:cleanup-e0728, r=jyn514

Clean up E0728 explanation

r? @Dylan-DPC

3 years agoRollup merge of #74602 - poliorcetics:maybe-uninit-zeroed-doc-clarification, r=jyn514
Manish Goregaokar [Sun, 2 Aug 2020 00:42:11 +0000 (17:42 -0700)]
Rollup merge of #74602 - poliorcetics:maybe-uninit-zeroed-doc-clarification, r=jyn514

Clarify the doc for MaybeUninit::zeroed on incorrect use

Fixes #74343.

@rustbot modify labels: C-enhancement, T-doc

3 years agoAuto merge of #74605 - rust-lang:vec-leak, r=Amanieu
bors [Sat, 1 Aug 2020 22:29:30 +0000 (22:29 +0000)]
Auto merge of #74605 - rust-lang:vec-leak, r=Amanieu

Stabilize Vec::leak as a method

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

The signature is changed to a method rather than an associated function:

```diff
-pub fn leak<'a>(vec: Vec<T>) -> &'a mut [T]
+pub fn leak<'a>(self) -> &'a mut [T]
```

The reason for `Box::leak` not to be a method (`Deref` to an arbitrary `T` which might have its own, different `leak` method) does not apply.

3 years agoDo not trigger `unused_{braces,parens}` lints with `yield`
Yuki Okushi [Sat, 1 Aug 2020 22:20:28 +0000 (07:20 +0900)]
Do not trigger `unused_{braces,parens}` lints with `yield`

3 years agoBTreeMap::drain_filter no longer touches the root during iteration
Stein Somers [Tue, 14 Jul 2020 09:32:50 +0000 (11:32 +0200)]
BTreeMap::drain_filter no longer touches the root during iteration

3 years agoAuto merge of #74726 - oli-obk:tracing, r=Mark-Simulacrum
bors [Sat, 1 Aug 2020 20:43:12 +0000 (20:43 +0000)]
Auto merge of #74726 - oli-obk:tracing, r=Mark-Simulacrum

Move from `log` to `tracing`

The only visible change is that we now get timestamps in our logs:

```
Jul 24 18:41:01.065 TRACE rustc_mir::transform::const_prop: skipping replace of Rvalue::Use(const () because it is already a const
Jul 24 18:41:01.065 TRACE rustc_mir::transform::const_prop: propagated into _2
Jul 24 18:41:01.065 TRACE rustc_mir::transform::const_prop: visit_constant: const ()
```

This PR was explicitly designed to be as low-impact as possible. We can now move to using the name `tracing` insteads of `log` on a crate-by-crate basis and use any of the other tracing features where desirable.

As far as I can tell this will allow tools to seamlessly keep working (since they are using `rustc_driver::init_log...`).

This is the first half of step 1 of the accepted `tracing` MCP (https://github.com/rust-lang/compiler-team/issues/331)

3 years agoRemove a trailing whitespace
Tim Diekmann [Sat, 1 Aug 2020 19:53:00 +0000 (21:53 +0200)]
Remove a trailing whitespace