Commit Graph

105247 Commits

Author SHA1 Message Date
John Kåre Alsaker
f3ce14479c Run codegen unit partitioning and assert_symbols_are_distinct in parallel 2020-01-11 00:33:27 +01:00
varkor
799efd3615 Fix issue with using self module via indirection 2020-01-10 23:30:13 +00:00
bors
e621797264 Auto merge of #65241 - tmiasko:no-std-san, r=alexcrichton
build-std compatible sanitizer support

### Motivation

When using `-Z sanitizer=*` feature it is essential that both user code and
standard library is instrumented. Otherwise the utility of sanitizer will be
limited, or its use will be impractical like in the case of memory sanitizer.

The recently introduced cargo feature build-std makes it possible to rebuild
standard library with arbitrary rustc flags. Unfortunately, those changes alone
do not make it easy to rebuild standard library with sanitizers, since runtimes
are dependencies of std that have to be build in specific environment,
generally not available outside rustbuild process. Additionally rebuilding them
requires presence of llvm-config and compiler-rt sources.

The goal of changes proposed here is to make it possible to avoid rebuilding
sanitizer runtimes when rebuilding the std, thus making it possible to
instrument standard library for use with sanitizer with simple, although
verbose command:

```
env CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=-Zsanitizer=thread cargo test -Zbuild-std --target x86_64-unknown-linux-gnu
```

### Implementation

* Sanitizer runtimes are no long packed into crates. Instead, libraries build
  from compiler-rt are used as is, after renaming them into `librusc_rt.*`.
* rustc obtains runtimes from target libdir for default sysroot, so that
  they are not required in custom build sysroots created with build-std.
* The runtimes are only linked-in into executables to address issue #64629.
  (in previous design it was hard to avoid linking runtimes into static
  libraries produced by rustc as demonstrated by sanitizer-staticlib-link
  test, which still passes despite changes made in #64780).

cc @kennytm, @japaric, @firstyear, @choller
2020-01-10 23:26:21 +00:00
bors
1756313117 Auto merge of #68101 - JohnTitor:rollup-mvmjukr, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #66045 (Add method Result::into_ok)
 - #67258 (Introduce `X..`, `..X`, and `..=X` range patterns)
 - #68014 (Unify output of "variant not found" errors)
 - #68019 (Build compiletest with in-tree libtest)
 - #68039 (remove explicit strip-hidden pass from compiler doc generation)
 - #68050 (Canonicalize rustc_error imports)
 - #68059 (Allow specifying LLVM args in target specifications)
 - #68075 (rustbuild: Cleanup book generation)

Failed merges:

 - #68089 (Unstabilize `Vec::remove_item`)

r? @ghost
2020-01-10 20:08:58 +00:00
Yuki Okushi
bcfb380634
Rollup merge of #68075 - ollie27:rustbuild_books, r=Mark-Simulacrum
rustbuild: Cleanup book generation

The Cargo book can be generated the same way as the other books.
2020-01-11 04:50:56 +09:00
Yuki Okushi
1af7524d20
Rollup merge of #68059 - jethrogb:jb/target-llvm-args, r=alexcrichton
Allow specifying LLVM args in target specifications
2020-01-11 04:50:54 +09:00
Yuki Okushi
7ae0618e0a
Rollup merge of #68050 - Centril:canon-error, r=Mark-Simulacrum
Canonicalize rustc_error imports

r? @Mark-Simulacrum
2020-01-11 04:50:53 +09:00
Yuki Okushi
93f0ba970f
Rollup merge of #68039 - euclio:remove-strip-hidden, r=dtolnay
remove explicit strip-hidden pass from compiler doc generation

`strip-hidden` is now implied by `--document-private-items` with #67875, so there's no need to specify it anymore.
2020-01-11 04:50:51 +09:00
Yuki Okushi
a74c790758
Rollup merge of #68019 - cuviper:in-tree-compiletest, r=Mark-Simulacrum
Build compiletest with in-tree libtest

This updates compiletest to build in `Mode::ToolStd`, using the locally-built crates for `std` and especially `test`. This way we're immune to unstable differences in the bootstrap compiler crates, whether that's a prior-release stage0 or a current release local rebuild. Fixes #59264.

As a minor cleanup, this also removes the unused `llvm_tools` flag.
2020-01-11 04:50:49 +09:00
Yuki Okushi
a491100aa3
Rollup merge of #68014 - estebank:unify-e0599, r=cramertj
Unify output of "variant not found" errors

Fix #49566.
2020-01-11 04:50:48 +09:00
Yuki Okushi
793b1be6df
Rollup merge of #67258 - Centril:open-ended-ranges, r=oli-obk
Introduce `X..`, `..X`, and `..=X` range patterns

Tracking issue: https://github.com/rust-lang/rust/issues/67264
Feature gate: `#![feature(half_open_range_patterns)]`

---------------------------

In this PR, we introduce range-from (`X..`), range-to (`..X`), and range-to-inclusive (`..=X`) patterns.
These correspond to the `RangeFrom`, `RangeTo`, and `RangeToInclusive` expression forms introduced with the same syntaxes. The correspondence is both syntactic and semantic (in the sense that e.g. a `X..` pattern matching on a scrutinee `s` holds exactly when `(X..).contains(&s)` holds).

---------------------------

Noteworthy:

- The compiler complexity added with this PR is around 10 lines (discounting new tests, which account for the large PR size).

- `...X` is accepted syntactically with the same meaning as `..=X`. This is done primarily to simplify and unify the implementation & spec. If-and-when we decide to make `X...Y` a hard error on a new edition, we can do the same for `...X` patterns as well.

- `X...` and `X..=` is rejected syntactically just like it is for the expression equivalents. We should perhaps make these into semantic restrictions (cc @petrochenkov).

- In HAIR, these half-open ranges are represented by inserting the max/min values for the approprate types. That is, `X..` where `X: u8` would become `X..=u8::MAX` in HAIR (note the `..=` since `RangeFrom` includes the end).

- Exhaustive integer / char matching does not (yet) allow for e.g. exhaustive matching on `0usize..` or `..5usize | 5..` (same idea for `isize`). This would be a substantially more invasive change, and could be added in some other PR.

- The issues with slice pattern syntax has been resolved as we decided to use `..` to mean a "rest-pattern" and `[xs @ ..]` to bind the rest to a name in a slice pattern.

- Like with https://github.com/rust-lang/rust/pull/35712, which provided `X..Y` range patterns, this is not yet backed up by an RFC. I'm providing this experimental implementation now to have something concrete to discuss. I would be happy to provide an RFC for this PR as well as for #35712 to finalize and confirm the ideas with the larger community.

Closes https://github.com/rust-lang/rfcs/issues/947.

---------------------------

r? @varkor cc @matthewjasper @oli-obk

I would recommend reviewing this (in particular HAIR-lowering and pattern parsing changes) with whitespace changes ignored.
2020-01-11 04:50:46 +09:00
Yuki Okushi
2dbcf0841a
Rollup merge of #66045 - mzabaluev:unwrap-infallible, r=dtolnay
Add method Result::into_ok

Implementation of https://github.com/rust-lang/rfcs/pull/2799

Tracking issue #61695
2020-01-11 04:50:45 +09:00
Esteban Küber
38a3506c45 Ignore platforms that can't point to std 2020-01-10 11:40:30 -08:00
Esteban Küber
6d97718886 ./x.py fmt 2020-01-10 11:40:29 -08:00
Esteban Küber
8eb7ac561e Use def_span to minimize definition span to first line when possible 2020-01-10 11:40:29 -08:00
Esteban Küber
39c96a0f53 Point at the span for the definition of crate foreign ADTs 2020-01-10 11:40:29 -08:00
Lzu Tao
5f3f1a3606 inline impl From<String> for Box<dyn Error + Send + Sync> 2020-01-10 19:27:02 +00:00
Esteban Küber
f6e9fd037a Add ICE regression tests 2020-01-10 11:24:05 -08:00
Esteban Küber
b93ef68245 Change next_point when shrink_to_hi is more appropriate 2020-01-10 11:23:59 -08:00
Lzu Tao
76e698fc56 inline impl AsRef<Path> for PathBuf 2020-01-10 19:18:17 +00:00
Lzu Tao
cd5ab97480 inline impl AsRef<OsStr> for OsString 2020-01-10 19:06:18 +00:00
Esteban Küber
d558f6a570 Fix invalid bounding box 2020-01-10 11:03:26 -08:00
Esteban Küber
3250057da9 Fix next_point to be unicode aware 2020-01-10 11:02:47 -08:00
Lzu Tao
bf1d20c4b6 Inline impl From<OsString> for PathBuf 2020-01-10 19:02:14 +00:00
Lzu Tao
ea6bb7fe17 Inline AsRef<Path> for str 2020-01-10 18:56:30 +00:00
Lzu Tao
eca1e8bd9b Inline PathBuf::deref to make it zero cost 2020-01-10 18:48:15 +00:00
Dylan DPC
4fadb507f4
Update E0185.md 2020-01-10 23:56:00 +05:30
Lzu Tao
137a31d692 Inline to make OsStr::is_empty zero cost 2020-01-10 18:20:40 +00:00
bors
ac6eb0db01 Auto merge of #67996 - JohnTitor:clippy-up, r=JohnTitor
Update Clippy

Fixes #67994

r? @ghost
2020-01-10 16:53:17 +00:00
varkor
8ca55641fd Clarify suggestion for E0013 2020-01-10 13:31:36 +00:00
Lzu Tao
cd9a73d2ea make use of pointer::is_null 2020-01-10 12:52:00 +00:00
bors
f795e8a216 Auto merge of #67397 - michaelwoerister:query-keys-in-self-profiling, r=wesleywiser
self-profiling: Support recording query keys

This PR makes self-profiling able to record query keys. The implementation is not as efficient as it could be yet (all query keys except for `DefId`s cause string data to be duplicated) and the rendered strings could be nicer too. But the implementation is functional and introduces the basic framework for emitting per-query-invocation event data.

I tried to add proper documentation on how everything works. Let me know if more documentation is needed.

r? @wesleywiser

@Mark-Simulacrum, heads up: This updates `measureme` to 0.7.0 which means that `summarize` on perf.rlo needs to be update accordingly once this is merged.
2020-01-10 12:18:46 +00:00
Matthew Healy
7e50b599bf Prefer llvm-skip-rebuild flag value over config.toml 2020-01-10 11:13:49 +01:00
Matthew Healy
0bbbd5d418 Match llvm-skip-rebuild flag 2020-01-10 11:13:49 +01:00
Michael Woerister
ad65e3e6bc Fix some rebasing fallout. 2020-01-10 10:57:36 +01:00
Michael Woerister
11e4844480 Update measureme to 0.7.1 in order to fix compilation error on big-endian platforms. 2020-01-10 10:19:40 +01:00
Michael Woerister
83e921d770 Run 'x.py fmt'. 2020-01-10 10:19:39 +01:00
Michael Woerister
6848ed2d65 self-profile: Fix issue with handling query blocking. 2020-01-10 10:19:39 +01:00
Michael Woerister
b8ead417a6 Initial support for recording query keys in self-profiling data. 2020-01-10 10:19:39 +01:00
Michael Woerister
996511a456 Use 'relaxed' memory ordering for simple atomic counters in dep-graph. 2020-01-10 10:18:21 +01:00
Michael Woerister
a62c040929 self-profile: Switch to new approach for event_id generation that enables query-invocation-specific event_ids. 2020-01-10 10:18:21 +01:00
Guillaume Gomez
c899f67673
Improve E0185 wording 2020-01-10 10:05:49 +01:00
Jethro Beekman
afced94155 Allow specifying LLVM args in target specifications 2020-01-10 08:12:55 +01:00
Mazdak Farrokhzad
8bd3d240e3 nix syntax::errors & prefer rustc_errors over errors 2020-01-10 07:41:30 +01:00
Mazdak Farrokhzad
d5598aa7a0 Introduce #![feature(half_open_range_patterns)].
This feature adds `X..`, `..X`, and `..=X` patterns.
2020-01-10 07:29:04 +01:00
Esteban Küber
fcd850fc5d Do not ICE on unicode next point
Use `shrink_to_hi` instead of `next_point`
Fix #68000.
2020-01-09 22:10:18 -08:00
bors
2d8d559bbe Auto merge of #68078 - Centril:rollup-qvq052k, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #66463 (Point at opaque and closure type definitions in type errors)
 - #67501 (Reduce special treatment for zsts)
 - #67820 (Parse the syntax described in RFC 2632)
 - #67922 (rustc_ast_lowering: misc cleanup & rustc dep reductions)
 - #68071 (Extend support of `_` in type parameters)
 - #68073 (expect `fn` after `const unsafe` / `const extern`)

Failed merges:

r? @ghost
2020-01-10 02:09:41 +00:00
Mazdak Farrokhzad
6f3f1c537b
Rollup merge of #68073 - Centril:fix-68062, r=estebank
expect `fn` after `const unsafe` / `const extern`

Fixes #68062

r? @estebank @petrochenkov
cc @Aaron1011
2020-01-10 02:47:36 +01:00
Mazdak Farrokhzad
2307f0c4ea
Rollup merge of #68071 - estebank:ice-67995, r=Centril
Extend support of `_` in type parameters

 - Account for `impl Trait<_>`.
 - Provide a reasonable `Span` for empty `Generics` in `impl`s.
 - Account for `fn foo<_>(_: _) {}` to suggest `fn foo<T>(_: T) {}`.
 - Fix #67995. Follow up to #67597.
2020-01-10 02:47:34 +01:00
Mazdak Farrokhzad
3bfa28c3a8
Rollup merge of #67922 - Centril:lowering-cleanup, r=petrochenkov
rustc_ast_lowering: misc cleanup & rustc dep reductions

- The first two commits do some code simplification.
- The next three do some file splitting (getting `lib.rs` below the 3kloc tidy lint).
- The remaining commits reduce the number of `rustc::` imports. This works towards making lowering independent of the `rustc` crate.

r? @oli-obk cc @Zoxc
2020-01-10 02:47:33 +01:00