Commit Graph

870 Commits

Author SHA1 Message Date
bors
12799ad60c Auto merge of #74899 - sajattack:libc_0.2.74_bump, r=jonas-schievink
bump libc version to 0.2.74
2020-08-02 07:23:14 +00:00
Aaron Hill
70ba491b78
Update elasticlunr-rs and ammonia transitive deps
This removes all dependencies on pre-1.0 proc-macro ecosystem crates
(syn, quote, and proc-macro2)
2020-08-01 21:15:53 -04:00
Aaron Hill
183947f6ba
Move 'probably equal' methods to librustc_parse
This is preparation for PR #73084
2020-08-01 21:12:49 -04:00
Oliver Scherer
c7290379be Remove chrono feature from tracing 2020-08-01 16:24:52 +02:00
Oliver Scherer
358e21ee78 Disable log support 2020-07-31 22:42:09 +02:00
Oliver Scherer
ec7230fea2 Move from log to tracing 2020-07-31 22:38:20 +02:00
bors
c058a8b8dc Auto merge of #74682 - alexcrichton:backtrace-gimli-round-2, r=Mark-Simulacrum
std: Switch from libbacktrace to gimli (take 2)

This is the second attempt to land https://github.com/rust-lang/rust/pull/73441 after being reverted in https://github.com/rust-lang/rust/pull/74613. Will be gathering precise perf numbers here in this take.

Closes #71060
2020-07-30 23:22:09 +00:00
bors
6e50a225fd Auto merge of #74923 - ehuss:update-cargo, r=Mark-Simulacrum
Update cargo

14 commits in aa6872140ab0fa10f641ab0b981d5330d419e927..974eb438da8ced6e3becda2bbf63d9b643eacdeb
2020-07-23 13:46:27 +0000 to 2020-07-29 16:15:05 +0000
- Fix O0 build scripts by default without `[profile.release]` (rust-lang/cargo#8560)
- Emphasize git dependency version locking behavior. (rust-lang/cargo#8561)
- Update lock file encodings on changes (rust-lang/cargo#8554)
- Fix sporadic lto test failures. (rust-lang/cargo#8559)
- build-std: Fix libraries paths following upstream (rust-lang/cargo#8558)
- Flag git http errors as maybe spurious (rust-lang/cargo#8553)
- Display builtin aliases with `cargo --list` (rust-lang/cargo#8542)
- Check manifest for requiring nonexistent features (rust-lang/cargo#7950)
- Clarify test name filter usage (rust-lang/cargo#8552)
- Revert Cargo Book changes for default edition (rust-lang/cargo#8551)
- Prepare for not defaulting to master branch for git deps (rust-lang/cargo#8522)
- Include `+` for crates.io feature requirements in the Cargo Book section on features (rust-lang/cargo#8547)
- Update termcolor and fwdansi versions (rust-lang/cargo#8540)
- Cargo book nitpick in Manifest section (rust-lang/cargo#8543)
2020-07-30 02:05:48 +00:00
Eric Huss
89d7906acd Update cargo 2020-07-29 11:02:05 -07:00
Xavier Denis
f07607f47a Move mir-opt tests to toplevel 2020-07-29 17:36:03 +02:00
Paul Sajna
7baa87fccf bump libc version to 0.2.74 2020-07-29 01:10:57 -07:00
Alex Crichton
06d565c967 std: Switch from libbacktrace to gimli
This commit is a proof-of-concept for switching the standard library's
backtrace symbolication mechanism on most platforms from libbacktrace to
gimli. The standard library's support for `RUST_BACKTRACE=1` requires
in-process parsing of object files and DWARF debug information to
interpret it and print the filename/line number of stack frames as part
of a backtrace.

Historically this support in the standard library has come from a
library called "libbacktrace". The libbacktrace library seems to have
been extracted from gcc at some point and is written in C. We've had a
lot of issues with libbacktrace over time, unfortunately, though. The
library does not appear to be actively maintained since we've had
patches sit for months-to-years without comments. We have discovered a
good number of soundness issues with the library itself, both when
parsing valid DWARF as well as invalid DWARF. This is enough of an issue
that the libs team has previously decided that we cannot feed untrusted
inputs to libbacktrace. This also doesn't take into account the
portability of libbacktrace which has been difficult to manage and
maintain over time. While possible there are lots of exceptions and it's
the main C dependency of the standard library right now.

For years it's been the desire to switch over to a Rust-based solution
for symbolicating backtraces. It's been assumed that we'll be using the
Gimli family of crates for this purpose, which are targeted at safely
and efficiently parsing DWARF debug information. I've been working
recently to shore up the Gimli support in the `backtrace` crate. As of a
few weeks ago the `backtrace` crate, by default, uses Gimli when loaded
from crates.io. This transition has gone well enough that I figured it
was time to start talking seriously about this change to the standard
library.

This commit is a preview of what's probably the best way to integrate
the `backtrace` crate into the standard library with the Gimli feature
turned on. While today it's used as a crates.io dependency, this commit
switches the `backtrace` crate to a submodule of this repository which
will need to be updated manually. This is not done lightly, but is
thought to be the best solution. The primary reason for this is that the
`backtrace` crate needs to do some pretty nontrivial filesystem
interactions to locate debug information. Working without `std::fs` is
not an option, and while it might be possible to do some sort of
trait-based solution when prototyped it was found to be too unergonomic.
Using a submodule allows the `backtrace` crate to build as a submodule
of the `std` crate itself, enabling it to use `std::fs` and such.

Otherwise this adds new dependencies to the standard library. This step
requires extra attention because this means that these crates are now
going to be included with all Rust programs by default. It's important
to note, however, that we're already shipping libbacktrace with all Rust
programs by default and it has a bunch of C code implementing all of
this internally anyway, so we're basically already switching
already-shipping functionality to Rust from C.

* `object` - this crate is used to parse object file headers and
  contents. Very low-level support is used from this crate and almost
  all of it is disabled. Largely we're just using struct definitions as
  well as convenience methods internally to read bytes and such.

* `addr2line` - this is the main meat of the implementation for
  symbolication. This crate depends on `gimli` for DWARF parsing and
  then provides interfaces needed by the `backtrace` crate to turn an
  address into a filename / line number. This crate is actually pretty
  small (fits in a single file almost!) and mirrors most of what
  `dwarf.c` does for libbacktrace.

* `miniz_oxide` - the libbacktrace crate transparently handles
  compressed debug information which is compressed with zlib. This crate
  is used to decompress compressed debug sections.

* `gimli` - not actually used directly, but a dependency of `addr2line`.

* `adler32`- not used directly either, but a dependency of
  `miniz_oxide`.

The goal of this change is to improve the safety of backtrace
symbolication in the standard library, especially in the face of
possibly malformed DWARF debug information. Even to this day we're still
seeing segfaults in libbacktrace which could possibly become security
vulnerabilities. This change should almost entirely eliminate this
possibility whilc also paving the way forward to adding more features
like split debug information.

Some references for those interested are:

* Original addition of libbacktrace - #12602
* OOM with libbacktrace - #24231
* Backtrace failure due to use of uninitialized value - #28447
* Possibility to feed untrusted data to libbacktrace - #21889
* Soundness fix for libbacktrace - #33729
* Crash in libbacktrace - #39468
* Support for macOS, never merged - ianlancetaylor/libbacktrace#2
* Performance issues with libbacktrace - #29293, #37477
* Update procedure is quite complicated due to how many patches we
  need to carry - #50955
* Libbacktrace doesn't work on MinGW with dynamic libs - #71060
* Segfault in libbacktrace on macOS - #71397

Switching to Rust will not make us immune to all of these issues. The
crashes are expected to go away, but correctness and performance may
still have bugs arise. The gimli and `backtrace` crates, however, are
actively maintained unlike libbacktrace, so this should enable us to at
least efficiently apply fixes as situations come up.
2020-07-28 16:34:01 -07:00
Tyler Mandry
e193cb1fde Update Cargo.lock 2020-07-25 14:26:31 -07:00
Manish Goregaokar
dfedb84462
Rollup merge of #72954 - hermitcore:rwlock, r=dtolnay
revise RwLock for HermitCore

- current version is derived from the wasm implementation
- increasing the readability of `Condvar`
- simplify the interface to the libos
2020-07-24 10:01:28 -07:00
Eric Huss
76103f1d15 Update cargo 2020-07-23 08:28:50 -07:00
bors
371917ab21 Auto merge of #74613 - Mark-Simulacrum:revert-gimli, r=nnethercote
Revert libbacktrace -> gimli

This reverts 4cbd265c11 028f8d7b85 13db3cc1e8 d7a36d8964 (and technically 79673d3009 but it's made empty by previous reverts).

The current plan is to land this PR as a temporary change, so that we can get a better handle on the regressions introduced by it. Trying to fix/examine them in master is difficult, and we want to be better able to evaluate them without impact to other PRs being landed in the mean time.

That said, it is currently *my* belief that gimli, in one form or another, will need to land sometime soon. I think it's quite likely that it may slip a week or two, but I would personally push for re-landing it then "regardless" of the regressions. We should try to focus efforts on understanding and removing as much of the performance impact as possible, as everyone pretty much agrees that it should be quite minimal (and entirely in the linker, basically).

r? @nnethercote
2020-07-23 11:14:48 +00:00
Mark Rousskov
cc4f547cf4 Revert "std: Switch from libbacktrace to gimli"
This reverts commit 13db3cc1e8.
2020-07-22 07:16:45 -04:00
Jake Goulding
804241ea06 Update dependencies that have knowledge about aarch64-apple-darwin 2020-07-20 20:45:52 -04:00
bors
47ea6d90b0 Auto merge of #74091 - richkadel:llvm-coverage-map-gen-4, r=tmandry
Generating the coverage map

@tmandry @wesleywiser

rustc now generates the coverage map and can support (limited)
coverage report generation, at the function level.

Example commands to generate a coverage report:
```shell
$ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu
$ $BUILD/stage1/bin/rustc -Zinstrument-coverage \
$HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs
$ LLVM_PROFILE_FILE="main.profraw" ./main
called
$ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata
$ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main
```
![rust coverage report only 20200706](https://user-images.githubusercontent.com/3827298/86697299-1cbe8f80-bfc3-11ea-8955-451b48626991.png)

r? @wesleywiser

Rust compiler MCP rust-lang/compiler-team#278
Relevant issue: #34701 - Implement support for LLVMs code coverage instrumentation
2020-07-19 07:25:18 +00:00
bors
1fa54ad968 Auto merge of #73441 - alexcrichton:backtrace-gimli, r=Mark-Simulacrum
std: Switch from libbacktrace to gimli

This commit is a proof-of-concept for switching the standard library's
backtrace symbolication mechanism on most platforms from libbacktrace to
gimli. The standard library's support for `RUST_BACKTRACE=1` requires
in-process parsing of object files and DWARF debug information to
interpret it and print the filename/line number of stack frames as part
of a backtrace.

Historically this support in the standard library has come from a
library called "libbacktrace". The libbacktrace library seems to have
been extracted from gcc at some point and is written in C. We've had a
lot of issues with libbacktrace over time, unfortunately, though. The
library does not appear to be actively maintained since we've had
patches sit for months-to-years without comments. We have discovered a
good number of soundness issues with the library itself, both when
parsing valid DWARF as well as invalid DWARF. This is enough of an issue
that the libs team has previously decided that we cannot feed untrusted
inputs to libbacktrace. This also doesn't take into account the
portability of libbacktrace which has been difficult to manage and
maintain over time. While possible there are lots of exceptions and it's
the main C dependency of the standard library right now.

For years it's been the desire to switch over to a Rust-based solution
for symbolicating backtraces. It's been assumed that we'll be using the
Gimli family of crates for this purpose, which are targeted at safely
and efficiently parsing DWARF debug information. I've been working
recently to shore up the Gimli support in the `backtrace` crate. As of a
few weeks ago the `backtrace` crate, by default, uses Gimli when loaded
from crates.io. This transition has gone well enough that I figured it
was time to start talking seriously about this change to the standard
library.

This commit is a preview of what's probably the best way to integrate
the `backtrace` crate into the standard library with the Gimli feature
turned on. While today it's used as a crates.io dependency, this commit
switches the `backtrace` crate to a submodule of this repository which
will need to be updated manually. This is not done lightly, but is
thought to be the best solution. The primary reason for this is that the
`backtrace` crate needs to do some pretty nontrivial filesystem
interactions to locate debug information. Working without `std::fs` is
not an option, and while it might be possible to do some sort of
trait-based solution when prototyped it was found to be too unergonomic.
Using a submodule allows the `backtrace` crate to build as a submodule
of the `std` crate itself, enabling it to use `std::fs` and such.

Otherwise this adds new dependencies to the standard library. This step
requires extra attention because this means that these crates are now
going to be included with all Rust programs by default. It's important
to note, however, that we're already shipping libbacktrace with all Rust
programs by default and it has a bunch of C code implementing all of
this internally anyway, so we're basically already switching
already-shipping functionality to Rust from C.

* `object` - this crate is used to parse object file headers and
  contents. Very low-level support is used from this crate and almost
  all of it is disabled. Largely we're just using struct definitions as
  well as convenience methods internally to read bytes and such.

* `addr2line` - this is the main meat of the implementation for
  symbolication. This crate depends on `gimli` for DWARF parsing and
  then provides interfaces needed by the `backtrace` crate to turn an
  address into a filename / line number. This crate is actually pretty
  small (fits in a single file almost!) and mirrors most of what
  `dwarf.c` does for libbacktrace.

* `miniz_oxide` - the libbacktrace crate transparently handles
  compressed debug information which is compressed with zlib. This crate
  is used to decompress compressed debug sections.

* `gimli` - not actually used directly, but a dependency of `addr2line`.

* `adler32`- not used directly either, but a dependency of
  `miniz_oxide`.

The goal of this change is to improve the safety of backtrace
symbolication in the standard library, especially in the face of
possibly malformed DWARF debug information. Even to this day we're still
seeing segfaults in libbacktrace which could possibly become security
vulnerabilities. This change should almost entirely eliminate this
possibility whilc also paving the way forward to adding more features
like split debug information.

Some references for those interested are:

* Original addition of libbacktrace - #12602
* OOM with libbacktrace - #24231
* Backtrace failure due to use of uninitialized value - #28447
* Possibility to feed untrusted data to libbacktrace - #21889
* Soundness fix for libbacktrace - #33729
* Crash in libbacktrace - #39468
* Support for macOS, never merged - ianlancetaylor/libbacktrace#2
* Performance issues with libbacktrace - #29293, #37477
* Update procedure is quite complicated due to how many patches we
  need to carry - #50955
* Libbacktrace doesn't work on MinGW with dynamic libs - #71060
* Segfault in libbacktrace on macOS - #71397

Switching to Rust will not make us immune to all of these issues. The
crashes are expected to go away, but correctness and performance may
still have bugs arise. The gimli and `backtrace` crates, however, are
actively maintained unlike libbacktrace, so this should enable us to at
least efficiently apply fixes as situations come up.

---

I want to note that my purpose for creating a PR here is to start a conversation about this. I think that all the various pieces are in place that this is compelling enough that I think this transition should be talked about seriously. There are a number of items which still need to be addressed before actually merging this PR, however:

* [ ] `gimli` needs to be published to crates.io
* [ ] `addr2line` needs a publish
* [ ] `miniz_oxide` needs a publish
* [ ] Tests probably shouldn't recommend the `gimli` crate's traits for implementing
* [ ] The `backtrace` crate's branch changes need to be merged to the master branch (https://github.com/rust-lang/backtrace-rs/pull/349)
* [ ] The support for `libbacktrace` on some platforms needs to be audited to see if we should support more strategies in the gimli implementation - https://github.com/rust-lang/backtrace-rs/issues/325, https://github.com/rust-lang/backtrace-rs/issues/326, https://github.com/rust-lang/backtrace-rs/issues/350, https://github.com/rust-lang/backtrace-rs/issues/351

Most of the merging/publishing I'm not actively pushing on right now. It's a bit wonky for crates to support libstd so I'm holding off on pulling the trigger everywhere until there's a bit more discussion about how to go through with this. Namely https://github.com/rust-lang/backtrace-rs/pull/349 I'm going to hold off merging until we decide to go through with the submodule strategy.

In any case this is a pretty major change, so I suspect that the compiler team is likely going to be interested in this. I don't mean to force changes by dumping a bunch of code by any means. Integration of external crates into the standard library is so difficult I wanted to have a proof-of-concept to review while talking about whether to do this at all (hence the PR), but I'm more than happy to follow any processes needed to merge this. I must admit though that I'm not entirely sure myself at this time what the process would be to decide to merge this, so I'm hoping others can help me figure that out!
2020-07-18 16:08:23 +00:00
Federico Ponzi
4b6a0278fe
fixes #67108 by using the external crate 2020-07-18 00:01:27 +02:00
Alex Crichton
13db3cc1e8 std: Switch from libbacktrace to gimli
This commit is a proof-of-concept for switching the standard library's
backtrace symbolication mechanism on most platforms from libbacktrace to
gimli. The standard library's support for `RUST_BACKTRACE=1` requires
in-process parsing of object files and DWARF debug information to
interpret it and print the filename/line number of stack frames as part
of a backtrace.

Historically this support in the standard library has come from a
library called "libbacktrace". The libbacktrace library seems to have
been extracted from gcc at some point and is written in C. We've had a
lot of issues with libbacktrace over time, unfortunately, though. The
library does not appear to be actively maintained since we've had
patches sit for months-to-years without comments. We have discovered a
good number of soundness issues with the library itself, both when
parsing valid DWARF as well as invalid DWARF. This is enough of an issue
that the libs team has previously decided that we cannot feed untrusted
inputs to libbacktrace. This also doesn't take into account the
portability of libbacktrace which has been difficult to manage and
maintain over time. While possible there are lots of exceptions and it's
the main C dependency of the standard library right now.

For years it's been the desire to switch over to a Rust-based solution
for symbolicating backtraces. It's been assumed that we'll be using the
Gimli family of crates for this purpose, which are targeted at safely
and efficiently parsing DWARF debug information. I've been working
recently to shore up the Gimli support in the `backtrace` crate. As of a
few weeks ago the `backtrace` crate, by default, uses Gimli when loaded
from crates.io. This transition has gone well enough that I figured it
was time to start talking seriously about this change to the standard
library.

This commit is a preview of what's probably the best way to integrate
the `backtrace` crate into the standard library with the Gimli feature
turned on. While today it's used as a crates.io dependency, this commit
switches the `backtrace` crate to a submodule of this repository which
will need to be updated manually. This is not done lightly, but is
thought to be the best solution. The primary reason for this is that the
`backtrace` crate needs to do some pretty nontrivial filesystem
interactions to locate debug information. Working without `std::fs` is
not an option, and while it might be possible to do some sort of
trait-based solution when prototyped it was found to be too unergonomic.
Using a submodule allows the `backtrace` crate to build as a submodule
of the `std` crate itself, enabling it to use `std::fs` and such.

Otherwise this adds new dependencies to the standard library. This step
requires extra attention because this means that these crates are now
going to be included with all Rust programs by default. It's important
to note, however, that we're already shipping libbacktrace with all Rust
programs by default and it has a bunch of C code implementing all of
this internally anyway, so we're basically already switching
already-shipping functionality to Rust from C.

* `object` - this crate is used to parse object file headers and
  contents. Very low-level support is used from this crate and almost
  all of it is disabled. Largely we're just using struct definitions as
  well as convenience methods internally to read bytes and such.

* `addr2line` - this is the main meat of the implementation for
  symbolication. This crate depends on `gimli` for DWARF parsing and
  then provides interfaces needed by the `backtrace` crate to turn an
  address into a filename / line number. This crate is actually pretty
  small (fits in a single file almost!) and mirrors most of what
  `dwarf.c` does for libbacktrace.

* `miniz_oxide` - the libbacktrace crate transparently handles
  compressed debug information which is compressed with zlib. This crate
  is used to decompress compressed debug sections.

* `gimli` - not actually used directly, but a dependency of `addr2line`.

* `adler32`- not used directly either, but a dependency of
  `miniz_oxide`.

The goal of this change is to improve the safety of backtrace
symbolication in the standard library, especially in the face of
possibly malformed DWARF debug information. Even to this day we're still
seeing segfaults in libbacktrace which could possibly become security
vulnerabilities. This change should almost entirely eliminate this
possibility whilc also paving the way forward to adding more features
like split debug information.

Some references for those interested are:

* Original addition of libbacktrace - #12602
* OOM with libbacktrace - #24231
* Backtrace failure due to use of uninitialized value - #28447
* Possibility to feed untrusted data to libbacktrace - #21889
* Soundness fix for libbacktrace - #33729
* Crash in libbacktrace - #39468
* Support for macOS, never merged - ianlancetaylor/libbacktrace#2
* Performance issues with libbacktrace - #29293, #37477
* Update procedure is quite complicated due to how many patches we
  need to carry - #50955
* Libbacktrace doesn't work on MinGW with dynamic libs - #71060
* Segfault in libbacktrace on macOS - #71397

Switching to Rust will not make us immune to all of these issues. The
crashes are expected to go away, but correctness and performance may
still have bugs arise. The gimli and `backtrace` crates, however, are
actively maintained unlike libbacktrace, so this should enable us to at
least efficiently apply fixes as situations come up.
2020-07-17 14:32:18 -07:00
Rich Kadel
a6f8b8a211 Generating the coverage map
rustc now generates the coverage map and can support (limited)
coverage report generation, at the function level.

Example:

$ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu
$ $BUILD/stage1/bin/rustc -Zinstrument-coverage \
$HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs
$ LLVM_PROFILE_FILE="main.profraw" ./main
called
$ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata
$ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main
    1|      1|pub fn will_be_called() {
    2|      1|    println!("called");
    3|      1|}
    4|       |
    5|      0|pub fn will_not_be_called() {
    6|      0|    println!("should not have been called");
    7|      0|}
    8|       |
    9|      1|fn main() {
   10|      1|    let less = 1;
   11|      1|    let more = 100;
   12|      1|
   13|      1|    if less < more {
   14|      1|        will_be_called();
   15|      1|    } else {
   16|      1|        will_not_be_called();
   17|      1|    }
   18|      1|}
2020-07-17 11:49:35 -07:00
Eric Huss
9e58908e27 Use cfg_if in libpanic_abort.
This allows setting a default abort using the core intrinsic.
2020-07-15 08:38:11 -07:00
Eric Huss
432b4c14aa Use cfg_if in libtest.
Simplifies some of the expressions, and provides a default.
2020-07-15 08:38:11 -07:00
Manish Goregaokar
99c0b9764a
Rollup merge of #74310 - nnethercote:use-ArrayVec-in-SparseBitSet, r=eddyb
Use `ArrayVec` in `SparseBitSet`.

Instead of `SmallVec`, because the maximum size is known.

r? @eddyb
2020-07-14 07:39:15 -07:00
Manish Goregaokar
b9a0f5803e
Rollup merge of #74173 - estebank:struct-pat-as-enum, r=petrochenkov
Detect tuple struct incorrectly used as struct pat

Subpart of #74005.

r? @petrochenkov
2020-07-14 07:39:02 -07:00
Nicholas Nethercote
c492ca40a2 Use ArrayVec in SparseBitSet.
Instead of `SmallVec`, because the maximum size is known.
2020-07-14 10:31:54 +10:00
Esteban Küber
5daedea3db Detect tuple struct incorrectly used as struct pat 2020-07-12 10:34:48 -07:00
Manish Goregaokar
9614238314
Rollup merge of #74116 - arlosi:aarch64build, r=pietroalbini
Fix cross compilation of LLVM to aarch64 Windows targets

When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build.

This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built.

If compiling with clang-cl, adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for each cross-compilation target.

Related issue: #72881
Requires LLVM change: rust-lang/llvm-project#67
2020-07-11 08:53:18 -07:00
Arlo Siemsen
59f979fa06 Fix cross-compilation of LLVM to aarch64 Windows targets
When cross-compiling, the LLVM build system recurses to build tools
that need to run on the host system. However, since we pass cmake defines
to set the compiler and target, LLVM still compiles these tools for the
target system, rather than the host. The tools then fail to execute
during the LLVM build.

This change sets defines for the tools that need to run on the
host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build
does not attempt to build them, and instead relies on the tools already built.

If compiling with clang-cl, this change also adds the `--target` option
to specify the target triple. MSVC compilers do not require this, since there
is a separate compiler binary for cross-compilation.
2020-07-08 08:19:50 -07:00
Michael Forney
32025fd76a Update rust-installer to latest version
This pulls in a fix for the install script on some tr(1) implementations,
as well as an update to use `anyhow` instead of `failure` for error
handling.
2020-07-07 14:15:51 -07:00
Stefan Lankes
6925ebdd60 use latest version of hermit-abi 2020-07-06 20:43:51 +02:00
bors
f844ea1e56 Auto merge of #73897 - ehuss:update-cargo, r=ehuss
Update cargo, rls

## cargo
14 commits in c26576f9adddd254b3dd63aecba176434290a9f6..fede83ccf973457de319ba6fa0e36ead454d2e20
2020-06-23 16:21:21 +0000 to 2020-07-02 21:51:34 +0000
- Fix overflow error on 32-bit. (rust-lang/cargo#8446)
- Exclude the target directory from backups using CACHEDIR.TAG (rust-lang/cargo#8378)
- CONTRIBUTING.md: Link to Zulip rather than Discord (rust-lang/cargo#8436)
- Update built-in help for features (rust-lang/cargo#8433)
- Update core-foundation requirement from 0.7.0 to 0.9.0 (rust-lang/cargo#8432)
- Parse `# env-dep` directives in dep-info files (rust-lang/cargo#8421)
- Move string interning to util (rust-lang/cargo#8419)
- Expose built cdylib artifacts in the Compilation structure (rust-lang/cargo#8418)
- Remove unused serde_derive dependency from the crates.io crate (rust-lang/cargo#8416)
- Remove unused remove_dir_all dependency (rust-lang/cargo#8412)
- Improve git error messages a bit (rust-lang/cargo#8409)
- Improve the description of Config.home_path (rust-lang/cargo#8408)
- Improve support for non-`master` main branches (rust-lang/cargo#8364)
- Document that OUT_DIR in JSON messages is an absolute path (rust-lang/cargo#8403)

## rls
2020-06-19 15:36:00 +0200 to 2020-06-30 23:34:52 +0200
- Update cargo (rust-lang-nursery/rls#1686)
2020-07-03 07:09:45 +00:00
Eric Huss
f3206bceff Update cargo 2020-07-02 15:58:27 -07:00
Manish Goregaokar
7ad8ed96f2
Rollup merge of #73781 - nagisa:psm-up, r=Mark-Simulacrum
Update psm version

This new version includes a fix for building on aarch64 windows.

cc #72881
2020-07-02 15:55:57 -07:00
Simonas Kazlauskas
df88972f8c Update psm version
This new version includes a fix for building on aarch64 windows.
2020-06-27 01:16:23 +03:00
Eric Huss
6bcbc426c9 Update mdbook. 2020-06-26 07:47:19 -07:00
Eric Huss
6654c5852f Remove mdbook-linkcheck. 2020-06-26 07:45:28 -07:00
Manish Goregaokar
1755e3b05c
Rollup merge of #73681 - jackh726:chalk-0.14, r=nikomatsakis
Update Chalk to 0.14

Not a ton here. Notable changes:
- Update to `0.14.0`
  - New dependency on `tracing`, in `librustc_traits` only
  - `FnAbi` from Chalk is `rustc_target::spec::abi::Abi`
  - `Dynamic` actually lowers region
  - Actually lower closures, with some tests. This doesn't 100% work, but can't confirm that's *only* because of closure lowering.
- Use `FxIndexSet` instead of `FxHashSet` in `chalk_fulfill`, which seems to have fixed the non-deterministic test error ordering. Guess we'll see on CI
- Actually implement `opaque_ty_data`, though I don't think this is sufficient for tests for them (I haven't added any)
- Uncomment some of the chalk tests that now work

r? @nikomatsakis
2020-06-26 00:39:12 -07:00
Manish Goregaokar
23c9ac6b73
Rollup merge of #72770 - crlf0710:mixed_script_confusable, r=Manishearth
Implement mixed script confusable lint.

This implements the mixed script confusable lint defined in RFC 2457.
This is blocked on #72069 and https://github.com/unicode-rs/unicode-security/pull/13, and will need a Cargo.toml version bump after those are resolved.

The lint message warning is sub-optimal for now. We'll need a mechanism to properly output  `AugmentScriptSet` to screen, this is to be added in `unicode-security` crate.

r? @Manishearth
2020-06-25 18:00:05 -07:00
Charles Lew
25e864e198 Implement mixed script confusable lint. 2020-06-26 01:39:31 +08:00
Jack Huey
ecb8b9f9f7 Update Chalk 2020-06-24 00:48:33 -04:00
Manish Goregaokar
045761c8d0
Rollup merge of #73587 - marmeladema:hir-id-ification-final, r=petrochenkov
Move remaining `NodeId` APIs from `Definitions` to `Resolver`

Implements https://github.com/rust-lang/rust/pull/73291#issuecomment-643515557

TL;DR: it moves all fields that are only needed during name resolution passes into the `Resolver` and keep the rest in `Definitions`. This effectively enforces that all references to `NodeId`s are gone once HIR lowering is completed.

After this, the only remaining work for #50928 should be to adjust the dev guide.

r? @petrochenkov
2020-06-23 13:10:09 -07:00
Aaron Hill
e2ab98df08
Stop using old version of syn in rustc-workspace-hack
None of the tools seem to need syn 0.15.35, so we can just build syn
1.0.

This was causing an issue with clippy's `compile-test` program: since
multiple versions of `syn` would exist in the build directory, we would
non-deterministically pick one based on filesystem iteration order. If
the pre-1.0 version of `syn` was picked, a strange build error would
occur (see
https://github.com/rust-lang/rust/pull/73594#issuecomment-647671463)

To prevent this kind of issue from happening again, we now panic if we
find multiple versions of a crate in the build directly, instead of
silently picking the first version we find.
2020-06-22 13:29:39 -04:00
marmeladema
f60513ec8d Move remaining NodeId APIs from Definitions to Resolver 2020-06-21 23:13:31 +01:00
bors
a8cf399117 Auto merge of #72936 - jackh726:chalk-more, r=nikomatsakis
Upgrade Chalk

Things done in this PR:
- Upgrade Chalk to `0.11.0`
- Added compare-mode=chalk
- Bump rustc-hash in `librustc_data_structures` to `1.1.0` to match Chalk
- Removed `RustDefId` since the builtin type support is there
- Add a few more `FIXME(chalk)`s for problem spots I hit when running all tests with chalk
- Added some more implementation code for some newer builtin Chalk types (e.g. `FnDef`, `Array`)
- Lower `RegionOutlives` and `ObjectSafe` predicates
- Lower `Dyn` without the region
- Handle `Int`/`Float` `CanonicalVarKind`s
- Uncomment some Chalk tests that actually work now
- Remove the revisions in `src/test/ui/coherence/coherence-subtyping.rs` since they aren't doing anything different

r? @nikomatsakis
2020-06-21 17:10:09 +00:00
Manish Goregaokar
3e40cca65a
Rollup merge of #73506 - Xanewok:update-rls, r=Xanewok
Bump Rustfmt and RLS

Fixes #73406
Fixes #73199
Fixes #73407
Fixes #73200

cc @calebcartwright @topecongiro

r? @ghost

Let's see what CI says first
2020-06-19 19:43:13 -07:00
Manish Goregaokar
17b80d947d
Rollup merge of #73347 - tmiasko:incompatible-sanitizers, r=nikic
Diagnose use of incompatible sanitizers

Emit an error when incompatible sanitizer are configured through command
line options. Previously the last one configured prevailed and others
were silently ignored.

Additionally use a set to represent configured sanitizers, making it
possible to enable multiple sanitizers at once. At least in principle,
since currently all of them are considered to be incompatible with
others.
2020-06-19 19:42:55 -07:00
Jack
b5d5994a4a Update chalk to 0.11.0 2020-06-19 14:05:14 -04:00
Jack Huey
a1c769bfd2 Fix building 2020-06-19 14:05:14 -04:00
Jack Huey
64c486b6f4 Update chalk and add LifetimeOutlives and ObjectSafe lowering 2020-06-19 14:05:14 -04:00
Jack Huey
90e01ee208 Update Chalk 2020-06-19 14:05:14 -04:00
Jack Huey
a42e5a14c4 Implement fn_def_datum 2020-06-19 14:05:14 -04:00
Jack Huey
6aa2e9d978 Update chalk 2020-06-19 14:04:30 -04:00
Jack Huey
16dd584e11 Update chalk 2020-06-19 14:04:30 -04:00
Igor Matuszewski
f4b2a205ad Bump Rustfmt and RLS 2020-06-19 15:38:14 +02:00
Tomasz Miąsko
0a65f280c8 Diagnose use of incompatible sanitizers
Emit an error when incompatible sanitizer are configured through command
line options. Previously the last one configured prevailed and others
were silently ignored.

Additionally use a set to represent configured sanitizers, making it
possible to enable multiple sanitizers at once. At least in principle,
since currently all of them are considered to be incompatible with
others.
2020-06-14 18:14:10 +02:00
Stefan Lankes
fd86a84720 use latest interface to HermitCore 2020-06-14 00:39:14 +02:00
Eric Huss
fdeed85355 Update cargo 2020-06-09 19:55:04 -07:00
bors
fd4b177aab Auto merge of #72655 - jethrogb:sgx-lvi-hardening, r=petrochenkov
Enable LVI hardening for x86_64-fortanix-unknown-sgx

This implements mitigations for the Load Value Injection vulnerability (CVE-2020-0551) for the `x86_64-fortanix-unknown-sgx` target by enabling new LLVM passes. More information about LVI and mitigations may be found at https://software.intel.com/security-software-guidance/insights/deep-dive-load-value-injection.

This PR unconditionally enables the mitigations for `x86_64-fortanix-unknown-sgx` since there is no available hardware that doesn't require the mitigations. This may be reconsidered in the future.

* [x] This depends on https://github.com/rust-lang/compiler-builtins/pull/359/
2020-06-08 20:10:07 +00:00
Ralf Jung
8484b9935c
Rollup merge of #72026 - botika:master, r=estebank
Update annotate-snippets-rs to 0.8.0

#59346
I made major changes to this library. In the previous version we worked with owned while in the current one with borrowed.

I have adapted it without changing the behavior.
I have modified the coverage since the previous one did not return correctly the index of the character in the line.
2020-06-08 09:55:18 +02:00
Jethro Beekman
ea48f2e4da Enable LVI hardening for x86_64-fortanix-unknown-sgx 2020-06-07 12:12:30 +02:00
bors
118b50524b Auto merge of #72927 - petrochenkov:rustc, r=Mark-Simulacrum
Rename all remaining compiler crates to use the `rustc_foo` pattern

libarena -> librustc_arena
libfmt_macros -> librustc_parse_format
libgraphviz -> librustc_graphviz
libserialize -> librustc_serialize

Closes https://github.com/rust-lang/rust/issues/71177 in particular.
2020-06-06 09:00:51 +00:00
Paul Sajna
8439e582a5 Bump libc dependency to latest version (0.2.71) 2020-06-03 16:21:16 -07:00
Vadim Petrochenkov
11d951492c Make things build again 2020-06-02 20:38:24 +03:00
Ralf Jung
759e495bbf bump Miri, update for cargo-miri being a separate project 2020-06-01 20:17:26 +02:00
bors
4b1f86adbe Auto merge of #72759 - alexcrichton:update-compiler-builtins, r=Mark-Simulacrum
Update compiler-builtins

Pulls in a fix for #72758, more details on the linked issue.

[Crate changes included here][changes]

[changes]: https://github.com/rust-lang/compiler-builtins/compare/0.1.28...0.1.31

Closes #72758
2020-05-31 09:54:44 +00:00
Yuki Okushi
047b3bd4df
Rollup merge of #72724 - Aaron1011:revert-tokenstream-expand, r=petrochenkov
Revert recursive `TokenKind::Interpolated` expansion for now

The crater run https://github.com/rust-lang/rust/issues/72622 revealed many root regressions, at least one of which is going to take some time to fix.

For now, let's revert https://github.com/rust-lang/rust/pull/72388 to allow the 709 affected crates to continue building on the latest nightly.
2020-05-30 12:39:19 +09:00
Alex Crichton
16469a123e Update compiler-builtins
Pulls in a fix for #72758, more details on the linked issue.

[Crate changes included here][changes]

[changes]: https://github.com/rust-lang/compiler-builtins/compare/0.1.28...0.1.31
2020-05-29 13:44:40 -07:00
Aaron Hill
ed503acb46
Revert "Fix rebase fallout"
This reverts commit 5685e4dd90.
2020-05-29 00:19:06 -04:00
flip1995
f20fa1b1bb
Update Cargo.lock 2020-05-28 15:47:54 +02:00
Igor Matuszewski
84eae777c1
submodules: Update RLS and Rustfmt 2020-05-28 15:46:52 +02:00
bors
2873165725 Auto merge of #72601 - JohnTitor:deps, r=Mark-Simulacrum
Update transitive dependencies to remove some deps

Similar to #71919, this removes some (duplicate) dependencies.
2020-05-27 14:48:33 +00:00
Yuki Okushi
9f8628b38c
cargo update -p atty --aggressive
Updating atty v0.2.11 -> v0.2.14
    Removing c2-chacha v0.2.3
    Updating cc v1.0.52 -> v1.0.54
    Updating ppv-lite86 v0.2.6 -> v0.2.8
    Updating rand_chacha v0.2.1 -> v0.2.2
    Removing redox_termios v0.1.1
    Removing termion v1.5.1
2020-05-26 13:35:21 +09:00
Yuki Okushi
a6e58ae3ce
cargo update -p rls-analysis
Removing itertools v0.7.8
    Updating rls-analysis v0.18.0 -> v0.18.1
    Updating rls-span v0.5.1 -> v0.5.2
2020-05-26 13:33:06 +09:00
Yuki Okushi
b4b76b8206
cargo update -p regex --aggressive
Updating aho-corasick v0.7.3 -> v0.7.10
    Updating memchr v2.3.2 -> v2.3.3
    Updating regex v1.1.6 -> v1.3.7
    Updating regex-syntax v0.6.6 -> v0.6.17
    Removing thread_local v0.3.6
    Removing ucd-util v0.1.3
    Removing utf8-ranges v1.0.2
2020-05-26 13:06:07 +09:00
Yuki Okushi
1f0a395079
cargo update -p colored
Updating colored v1.6.0 -> v1.9.3
    Removing lazy_static v0.2.11
2020-05-26 13:05:49 +09:00
Eric Huss
a0431e26fe Update cargo 2020-05-25 17:56:32 -07:00
Ralf Jung
fb848a6b7d
Rollup merge of #72388 - Aaron1011:fix/deep-tokenstream-equality, r=petrochenkov
Recursively expand `TokenKind::Interpolated` in `probably_equal_for_proc_macro`

Fixes #68430

When comparing the captured and re-parsed `TokenStream` for a `TokenKind::Interpolated`, we currently treat any nested `TokenKind::Interpolated` tokens as unequal. If a `TokenKind::Interpolated` token shows up in the captured `TokenStream` due to a `macro_rules!` expansion, we will throw away the captured `TokenStream`, losing span information.

This PR recursively invokes `nt_to_tokenstream` on nested `TokenKind::Interpolated` tokens, effectively flattening the stream into a sequence of non-interpolated tokens. This allows it to compare equal with the re-parsed stream, allowing us to keep the original captured `TokenStream` (with span information).

This requires all of the `probably_equal_for_proc_macro` methods to be moved from `librustc_ast` to `librustc_parse` so that they can call `nt_to_tokenstream`.
2020-05-24 09:30:31 +02:00
bors
75b0a68f35 Auto merge of #72478 - Dylan-DPC:rollup-vval8du, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #71289 (Allow using `Self::` in doc)
 - #72375 (Improve E0599 explanation)
 - #72385 (Add some teams to prioritization exclude_labels)
 - #72395 (Allow rust-highfive to label issues it creates.)
 - #72453 (Add flag to open docs:  x.py doc --open)
 - #72459 (Add core::future::IntoFuture)
 - #72461 (Clean up E0600 explanation)

Failed merges:

r? @ghost
2020-05-23 07:18:17 +00:00
Dylan MacKenzie
c282c1c654 Use OnceCell instead of Once 2020-05-22 13:31:02 -07:00
Dylan MacKenzie
9f82785c81 Replace rustc_data_structures::sync::Once with OnceCell 2020-05-22 13:26:39 -07:00
Aaron Hill
5685e4dd90
Fix rebase fallout 2020-05-22 15:12:11 -04:00
David Tolnay
6a3aae8aea
Add flag to open docs: x.py doc --open
Tested with:

       # opens doc/index.html
    x.py doc --stage 0 --open
    x.py doc --stage 0 --open src/doc

       # opens doc/book/index.html
    x.py doc --stage 0 --open src/doc/book

       # opens doc/std/index.html
    x.py doc --stage 0 --open src/libstd

       # opens doc/proc_macro/index.html
    x.py doc --stage 0 --open src/libproc_macro

       # opens both
    x.py doc --stage 0 --open src/libstd src/libproc_macro
2020-05-21 21:42:38 -07:00
Dylan DPC
c93ddbf811
Rollup merge of #72364 - jsgf:remove-unused-deps, r=Mark-Simulacrum
Remove unused dependencies

Remove some unused dependencies found while while working on https://github.com/rust-lang/rust/pull/72342.
2020-05-20 14:21:11 +02:00
bors
692a26e8d7 Auto merge of #72339 - ehuss:update-cargo, r=ehuss
Update cargo

9 commits in cb06cb2696df2567ce06d1a39b1b40612a29f853..500b2bd01c958f5a33b6aa3f080bea015877b83c
2020-05-08 21:57:44 +0000 to 2020-05-18 17:12:54 +0000
- Handle LTO with an rlib/cdylib crate type (rust-lang/cargo#8254)
- Gracefully handle errors during a build. (rust-lang/cargo#8247)
- Update `im-rc` to 15.0.0 (rust-lang/cargo#8255)
- Fix `cargo update` with unused patch. (rust-lang/cargo#8243)
- Rephrased error message for disallowed sections in virtual workspace (rust-lang/cargo#8200)
- Ignore broken console output in some situations. (rust-lang/cargo#8236)
- Expand error message to explain that a string was found (rust-lang/cargo#8235)
- Add context to some fs errors. (rust-lang/cargo#8232)
- Move SipHasher to an isolated module. (rust-lang/cargo#8233)
2020-05-20 02:22:44 +00:00
Jeremy Fitzhardinge
508e3f2bdc Remove unused dependencies 2020-05-19 14:34:23 -07:00
Amanieu d'Antras
1cfdc7ed0c Update dlmalloc dependency to 0.1.4 2020-05-19 18:25:41 +01:00
Eric Huss
c8443bb33a Update cargo 2020-05-18 15:41:57 -07:00
Amanieu d'Antras
5a20f39672 Update compiler_builtins to 0.1.28 2020-05-18 14:41:35 +01:00
Amanieu d'Antras
a656349b55 Move InlineAsmTemplatePiece and InlineAsmOptions to librustc_ast 2020-05-18 14:41:33 +01:00
Amanieu d'Antras
813a9fc4f1 Add asm! to AST 2020-05-18 14:39:54 +01:00
Stefan Lankes
06d692febd use new interface to initialize Condvar
HermitCore introduce a new interface to intialize conditional variables.
Consequently, minor changes are required to support this interface.
2020-05-17 23:49:18 +02:00
Dylan DPC
9dd7ad3ed2
Rollup merge of #71919 - Xanewok:bump-syn-1, r=Xanewok
Update transitive dependency to work towards removing syn <1.0 dep

This bumps a couple of transitive dependencies in hopes of eventually not transitively depending on syn <1.0 and friends. The only upstream changes that this is blocked on seems to be https://github.com/mattico/elasticlunr-rs/pull/27 and https://github.com/rust-lang/mdBook/pull/1210.

While working on https://github.com/rust-lang/rust/pull/71875 I noticed we still use syn 0.15 here and there so this is a drive-by PR which aims to help with things a bit.
2020-05-16 12:42:59 +02:00
bors
8453936049 Auto merge of #72079 - semarie:openbsd-stacker, r=Mark-Simulacrum
update stacker to 0.1.9 to unbreak build on OpenBSD

the version 0.1.8 of stacker (what is currently pinned in Cargo.lock) doesn't build on OpenBSD (see https://github.com/rust-lang/stacker/pull/34).

update the version to 0.1.9
2020-05-16 03:55:49 +00:00
flip1995
10f3cd9bea
Update Cargo.lock 2020-05-11 21:18:42 +02:00
Igor Matuszewski
e26f35d343 rustbook: Bump mdbook dependency 2020-05-11 14:43:41 +02:00
Igor Matuszewski
3bdacedfd9 cargo update -p derive-new 2020-05-11 14:43:41 +02:00
Igor Matuszewski
8c6e568141 cargo update -p pest_generator 2020-05-11 14:43:41 +02:00
Igor Matuszewski
403a9d0867 cargo update -p failure_derive 2020-05-11 14:43:41 +02:00
Igor Matuszewski
5e354932fe cargo update -p serde_derive 2020-05-11 14:40:52 +02:00
Sébastien Marie
a26335b2a0 update stacker to 0.1.9 to unbreak build on OpenBSD 2020-05-10 10:23:13 +00:00
Ralf Jung
37a9192826
Rollup merge of #71882 - alexcrichton:update-cc, r=Mark-Simulacrum
Update the `cc` crate

Pulls in updated MSVC detection logic landed in alexcrichton/cc-rs#488
2020-05-10 11:34:32 +02:00
Ralf Jung
366c1786e6
Rollup merge of #71555 - cjgillot:nameless, r=matthewjasper
Remove ast::{Ident, Name} reexports.

The reexport of `Symbol` into `Name` confused me.
2020-05-09 13:36:39 +02:00
Juan Aguilar Santillana
e9c78db086 Update annotate-snippets-rs to 0.8.0 2020-05-08 22:48:26 +02:00
Camille GILLOT
d4e143ed2f Remove ast::{Ident, Name} reexports. 2020-05-08 13:13:15 +02:00
Jack Huey
5fa4c63be0 Fix nit and cargo.lock 2020-05-07 17:46:31 -04:00
Jack Huey
a24df5b3cd Reintegrate chalk using chalk-solve 2020-05-07 17:35:58 -04:00
bors
97f3eeec82 Auto merge of #55617 - oli-obk:stacker, r=nagisa,oli-obk
Prevent compiler stack overflow for deeply recursive code

I was unable to write a test that

1. runs in under 1s
2. overflows on my machine without this patch

The following reproduces the issue, but I don't think it's sensible to include a test that takes 30s to compile. We can now easily squash newly appearing overflows by the strategic insertion of calls to `ensure_sufficient_stack`.

```rust
// compile-pass

#![recursion_limit="1000000"]

macro_rules! chain {
    (EE $e:expr) => {$e.sin()};
    (RECURSE $i:ident $e:expr) => {chain!($i chain!($i chain!($i chain!($i $e))))};
    (Z $e:expr) => {chain!(RECURSE EE $e)};
    (Y $e:expr) => {chain!(RECURSE Z $e)};
    (X $e:expr) => {chain!(RECURSE Y $e)};
    (A $e:expr) => {chain!(RECURSE X $e)};
    (B $e:expr) => {chain!(RECURSE A $e)};
    (C $e:expr) => {chain!(RECURSE B $e)};
    // causes overflow on x86_64 linux
    // less than 1 second until overflow on test machine
    // after overflow has been fixed, takes 30s to compile :/
    (D $e:expr) => {chain!(RECURSE C $e)};
    (E $e:expr) => {chain!(RECURSE D $e)};
    (F $e:expr) => {chain!(RECURSE E $e)};
    // more than 10 seconds
    (G $e:expr) => {chain!(RECURSE F $e)};
    (H $e:expr) => {chain!(RECURSE G $e)};
    (I $e:expr) => {chain!(RECURSE H $e)};
    (J $e:expr) => {chain!(RECURSE I $e)};
    (K $e:expr) => {chain!(RECURSE J $e)};
    (L $e:expr) => {chain!(RECURSE L $e)};
}

fn main() {
    let x = chain!(D 42.0_f32);
}
```

fixes #55471
fixes #41884
fixes #40161
fixes #34844
fixes #32594

cc @alexcrichton @rust-lang/compiler

I looked at all code that checks the recursion limit and inserted stack growth calls where appropriate.
2020-05-07 00:03:23 +00:00
Dylan DPC
a6a7c755fa
Rollup merge of #71591 - hermitcore:thread_create, r=hanna-kruppe
use new interface to create threads on HermitCore

- the new interface allows to define the stack size
- increase the default stack size to 1 MByte
2020-05-06 16:58:53 +02:00
Mateusz Mikuła
935a05f1be Update stacker and psm to 0.1.8 2020-05-06 11:37:18 +02:00
bors
8da5869fb7 Auto merge of #69464 - Marwes:detach_undo_log, r=nikomatsakis
perf: Unify the undo log of all snapshot types

Extracted from #69218 and extended to all the current snapshot types.

Since snapshotting is such a frequent action in the compiler and many of the scopes execute so little work, the act of creating the snapshot and rolling back empty/small snapshots end up showing in perf. By unifying all the logs into one the creation of snapshots becomes significantly cheaper at the cost of some complexity when combining the log with the specific data structures that are being mutated.

Depends on https://github.com/rust-lang-nursery/ena/pull/29
2020-05-06 07:03:31 +00:00
Igor Matuszewski
b512b1c7af Unify some syn 1.0 et al. features for tools 2020-05-05 15:29:15 +02:00
Igor Matuszewski
1dd0e3c38f Update RLS
In addition to fixing the toolstate, this also changes the default
compilation model to the out-of-process one, which should hopefully
target considerable memory usage for long-running instances of the RLS.
2020-05-05 14:16:26 +02:00
Markus Westerlind
bc7f7b2d4d refactor: Rename Logs to InferCtxtUndoLogs 2020-05-05 11:24:36 +02:00
Markus Westerlind
0c5d833812 Move projection_cache into the combined undo log 2020-05-05 11:24:23 +02:00
Markus Westerlind
caacdd2024 Move region_constraint to the unified undo log 2020-05-05 11:23:54 +02:00
Markus Westerlind
1506b1fc6a perf: Reduce snapshot/rollback overhead
By merging the undo_log of all structures part of the snapshot the cost
of creating a snapshot becomes much cheaper. Since snapshots with no or
few changes are so frequent this ends up mattering more than the slight
overhead of dispatching on the variants that map to each field.
2020-05-05 10:03:13 +02:00
Alex Crichton
3318187ebc Update the cc crate
Pulls in updated MSVC detection logic landed in alexcrichton/cc-rs#488
2020-05-04 08:35:45 -07:00
Dylan DPC
24e101c418
Rollup merge of #71542 - crlf0710:confusable_idents, r=petrochenkov
Implement `confusable_idents` lint.

This collects all identifier symbols into `ParseSession` and examines them within the non-ascii-idents lint.

The skeleton generation part needs to be added to `unicode-security` crate. Will update this PR when the crate is updated.

r? @petrochenkov

EDIT: also included the `concat_idents` part.
2020-05-03 14:18:02 +05:30
mibac138
90aa62a1bf Implement RFC 2523, #[cfg(version(..))] 2020-05-03 02:42:07 +02:00
Charles Lew
c05961c2db Implement confusable_idents lint. 2020-05-03 02:30:50 +08:00
Simonas Kazlauskas
a569f2970a Update psm and stacker to 0.1.7 2020-05-02 16:47:56 +02:00
Simonas Kazlauskas
a5c5365031 Move ensure_sufficient_stack to data_structures
We anticipate this to have uses in all sorts of crates and keeping it in
`rustc_data_structures` enables access to it from more locations without
necessarily pulling in the large `librustc` crate.
2020-05-02 16:47:52 +02:00
Oliver Scherer
26edcee093 Prevent stack overflow for deeply recursive code 2020-05-02 16:37:57 +02:00
Ralf Jung
cd824a5232
Rollup merge of #71712 - RalfJung:error-backtrace, r=oli-obk
Miri: port error backtraces to std::backtrace

No need to pull in an external dependency if libstd already includes this feature (using the same dependency internally, but... still).

r? @oli-obk
2020-05-02 12:08:03 +02:00
bors
e94eaa6dce Auto merge of #70674 - cjgillot:query-arena-all, r=matthewjasper
Have the per-query caches store the results on arenas

This PR leverages the cache for each query to serve as storage area for the query results.

It introduces a new cache `ArenaCache`, which moves the result to an arena,
and only stores the reference in the hash map.
This allows to remove a sizeable part of the usage of the global `TyCtxt` arena.

I only migrated queries that already used arenas before.
2020-05-01 01:38:05 +00:00
Tyler Mandry
59abc2afd8
Rollup merge of #71719 - tmandry:update-backtrace-sys, r=Mark-Simulacrum
Update backtrace-sys

Diff:

- Don't look for old RUSTC_DEBUGINFO vars (rust-lang/backtrace-rs#313)

This fixes an issue of libbacktrace never being built with debuginfo.

r? @Mark-Simulacrum
cc @alexcrichton
2020-04-30 15:23:20 -07:00
Tyler Mandry
8192cb6ea3
Rollup merge of #71682 - ehuss:bump-pulldown-cmark, r=Dylan-DPC
Bump pulldown-cmark

Pulls in 0.7.1 with the following fixes:

- Update html5ever to 0.25
- Fix hang on unclosed html element

Closes #70871
2020-04-30 15:23:15 -07:00
Tyler Mandry
2bafb1b1d7 Update backtrace-sys
Diff:

- Don't look for old RUSTC_DEBUGINFO vars (rust-lang/backtrace-rs#313)
2020-04-30 12:32:53 -07:00
Dylan DPC
5e53f80d6e
Rollup merge of #71449 - ecstatic-morse:free-region-cleanup, r=Mark-Simulacrum
Move `{Free,}RegionRelations` and `FreeRegionMap` to `rustc_infer`

...and out of `rustc_middle`. This is to further #65031, albeit in a very minor way

r? @Mark-Simulacrum
2020-04-30 20:15:24 +02:00
Ralf Jung
30b32c6570 Miri: port error backtraces to std::backtrace 2020-04-30 18:26:51 +02:00
Eric Huss
1776de948c Bump pulldown-cmark 2020-04-29 09:30:16 -07:00
bors
d9312a8db3 Auto merge of #71577 - tmiasko:backtrace-sys, r=Dylan-DPC
Update backtrace-sys crate to 0.1.36

* Fix an off-by-one error in backtrace-sys
* Only explicitly configure debuginfo in rustc-dep-of-std

https://github.com/rust-lang/backtrace-rs/compare/0.3.46...backtrace-sys-0.1.36

Fixes #71397.
2020-04-29 07:32:52 +00:00
Eric Huss
f23db015ad Update cargo 2020-04-28 08:34:58 -07:00
Camille GILLOT
bd42ef6e4f Introduce ArenaStorage. 2020-04-28 11:24:53 +02:00
Stefan Lankes
4d3cf5bd9b use new interface to create threads on HermitCore
- the new interface allows to define the stack size
2020-04-26 19:47:46 +02:00
Tomasz Miąsko
f22dd92b00 Update backtrace-sys crate to 0.1.36
* Fix an off-by-one error in backtrace-sys
* Only explicitly configure debuginfo in rustc-dep-of-std
2020-04-26 13:19:18 +02:00
bors
3360cc3a0e Auto merge of #71430 - pietroalbini:bump-openssl-src, r=Mark-Simulacrum
Update openssl-src to 1.1.1g

Fixes CVE-2020-1967.

r? @Mark-Simulacrum
2020-04-24 15:38:40 +00:00
Dylan MacKenzie
46154f28bd Move {Free,}RegionRelations and FreeRegionMap out of rustc_middle 2020-04-22 15:54:10 -07:00
Pietro Albini
940ce9465f
update openssl-src to 1.1.1g
Fixes CVE-2020-1967.
2020-04-22 16:21:54 +02:00
Dylan DPC
707004c552
Rollup merge of #70970 - eddyb:trait-vs-impl-mismatch, r=oli-obk
Detect mistyped associated consts in `Instance::resolve`.

*Based on #71049 to prevent redundant/misleading downstream errors.*

Fixes #70942 by refusing to resolve an associated `const` if it doesn't have the same type in the `impl` that it does in the `trait` (which we assume had errored, and `delay_span_bug` guards against bugs).
2020-04-22 12:18:31 +02:00
bors
2dc5b602ee Auto merge of #71410 - JohnTitor:rollup-vh6dut5, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #70998 (Suggest `-> impl Trait` and `-> Box<dyn Trait>` on fn that doesn't return)
 - #71236 (Remove unused rustc_serialize::hex module)
 - #71366 (Use assoc int consts3)
 - #71372 (Fix #! (shebang) stripping account space issue)
 - #71384 (Fix stage0.txt version number comment)
 - #71390 (Fix incorrect description of E0690)
 - #71399 (Clean up E0554 explanation)

Failed merges:

r? @ghost
2020-04-22 03:50:02 +00:00
Eric Huss
da2eb65d01 Update cargo, rls 2020-04-21 14:11:30 -07:00
Shotaro Yamada
33905adc5f Remove unused dependencies 2020-04-20 17:59:27 +09:00
bors
9b2f8dbba3 Auto merge of #71007 - Amanieu:deprecate_asm, r=Mark-Simulacrum
Deprecate the asm! macro in favor of llvm_asm!

Since we will be changing the syntax of `asm!` soon, deprecate it and encourage people to use `llvm_asm!` instead (which preserves the old syntax). This will avoid breakage when `asm!` is changed.

RFC: https://github.com/rust-lang/rfcs/pull/2843
2020-04-20 02:18:00 +00:00
bors
a0e52b1e82 Auto merge of #71102 - tmiasko:compiler-builtins, r=Mark-Simulacrum
Update compiler_builtins to 0.1.27

* aarch64: Exclude FP intrinsics on +nofp or +nosimd
* Place intrinsics in individual object files

https://github.com/rust-lang/compiler-builtins/compare/0.1.25...0.1.27
2020-04-19 02:16:13 +00:00
Eduard-Mihai Burtescu
289f46a7f5 Detect mistyped associated consts in Instance::resolve. 2020-04-18 18:39:59 +03:00
bors
534a41a329 Auto merge of #71173 - RalfJung:miri, r=RalfJung
bump Miri

Fixes https://github.com/rust-lang/rust/issues/71110
r? @ghost Cc @rust-lang/miri
2020-04-16 05:47:24 +00:00