Commit Graph

490 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
f58db20362 move rustc::lint::{context, passes} to rustc_lint.
Also do some cleanup of the interface.
2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
8c12c424e2 {rustc::lint -> rustc_lint}::internal 2020-01-11 07:42:26 +01:00
Mazdak Farrokhzad
9634e1f7d9
Rollup merge of #67806 - Centril:splitsynmore, r=petrochenkov
Extract `rustc_ast_passes`, move gating, & refactor linting

Based on https://github.com/rust-lang/rust/pull/67770.

This PR extracts a crate `rustc_ast_passes`:

- `ast_validation.rs`, which is contributed by `rustc_passes` (now only has HIR based passes) -- the goal here is to improve recompilation of the parser,
- `feature_gate.rs`, which is contributed by `syntax` and performs post-expansion-gating & final erroring for pre-expansion gating,
- `show_span`, which is contributed by `syntax`.

To facilitate this, we first have to also:

- Move `{leveled_}feature_err{_err}` from `syntax::feature_gate::check` into `rustc_session::parse`.
- Move `get_features` into `rustc_parse::config`, the only place it is used.
- Move some some lint datatypes and traits, e.g. `LintBuffer`, `BufferedEarlyLint`, `BuiltinLintDiagnostics`, `LintPass`, and `LintArray` into `rustc_session::lint`.
- Move all the hard-wired lint `static`s into `rustc_session::lint::builtin`.
2020-01-11 04:02:22 +01:00
Mazdak Farrokhzad
7d6548a14a rustc_passes: remove unused rustc_parse dep 2020-01-11 03:30:20 +01:00
Mazdak Farrokhzad
6cbcb83022 {syntax -> rustc_ast_passes}::feature_gate 2020-01-11 03:30:20 +01:00
Mazdak Farrokhzad
ed69fbbc44 ast_validation -> new crate rustc_ast_passes 2020-01-11 03:27:39 +01:00
Mazdak Farrokhzad
f361b71a7d nix syntax::early_buffered_lints 2020-01-11 03:26:16 +01:00
Mazdak Farrokhzad
7dbccf5b55 buffered lint infra -> rustc_session 2020-01-11 03:21:34 +01:00
Mazdak Farrokhzad
fff5ef68b0 canonicalize rustc::session import 2020-01-11 03:19:50 +01:00
Mazdak Farrokhzad
6007641d21 gating diagnostics -> rustc_session::parse 2020-01-11 03:15:32 +01: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
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
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
b8ead417a6 Initial support for recording query keys in self-profiling data. 2020-01-10 10:19:39 +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
Mazdak Farrokhzad
8bd3d240e3 nix syntax::errors & prefer rustc_errors over errors 2020-01-10 07:41:30 +01:00
Yuki Okushi
a366aa6249
Rollup merge of #68040 - sinkuu:unused, r=petrochenkov
Cleanup
2020-01-10 04:18:42 +09:00
Tomasz Miąsko
78e7eeeaa1 Remove sanitizer runtime crates 2020-01-09 07:54:02 +01:00
Shotaro Yamada
f443ae68c2 Remove unused dependencies 2020-01-09 11:52:03 +09:00
Mazdak Farrokhzad
2c3e5d3de0 - remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}
- remove syntax::{help!, span_help!, span_note!}
- remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!}
- lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints
- inline syntax::{struct_span_warn!, diagnostic_used!}
- stringify_error_code! -> error_code! & use it more.
- find_plugin_registrar: de-fatalize an error
- de-fatalize metadata errors
- move type_error_struct! to rustc_typeck
- struct_span_err! -> rustc_errors
2020-01-08 04:25:33 +01:00
bors
ef92009c1d Auto merge of #66899 - msizanoen1:riscv-std, r=alexcrichton
Standard library support for riscv64gc-unknown-linux-gnu

Add std support for RISC-V 64-bit GNU/Linux and update libc for RISC-V support.

r? @alexcrichton
2020-01-06 19:07:42 +00:00
msizanoen1
d61e193cd0 Update cc crate 2020-01-06 22:44:57 +07:00
Mazdak Farrokhzad
ebfd8673a7 Remove rustc_hir reexports in rustc::hir. 2020-01-05 12:49:22 +01:00
Mazdak Farrokhzad
937c76bfb2 cleanup librustc_hir/Cargo.toml 2020-01-04 19:03:27 +01:00
Mazdak Farrokhzad
7a14073875 move def_id to new rustc_hir crate 2020-01-04 19:01:42 +01:00
Mazdak Farrokhzad
5ccc1e45bd move Node{Map,Set} -> rustc_session::node_id 2020-01-04 18:59:28 +01:00
Charles Lew
485e98aae2 Implement uncommon_codepoints lint. 2020-01-03 08:20:12 +08:00
bors
1ed41b0720 Auto merge of #67729 - mati865:deps, r=nikomatsakis
Bump smallvec
2020-01-01 15:10:48 +00:00
Mazdak Farrokhzad
7b6ef2b369 librustc_ast_lowering: cargo changes. 2019-12-31 17:33:10 +01:00
Vadim Petrochenkov
b9a9c5b4fd Make things build again 2019-12-30 19:18:16 +03:00
Mateusz Mikuła
d452f89206 Bump smallvec 2019-12-30 13:50:23 +01:00
Yuki Okushi
f541e91a7a Update Cargo.lock 2019-12-29 17:03:07 +09:00
Oliver Scherer
31fd966647
Rollup merge of #67594 - oxalica:update-libc, r=Dylan-DPC
Update libc to 0.2.66

cc @gnzlbg @alexcrichton
2019-12-28 00:36:02 +01:00
Charles Lew
27e7a1baed Add unicode-normalization to whitelist. 2019-12-26 14:16:36 +08:00
Charles Lew
0bcddfe23a Normalize identifiers in librustc_parse. 2019-12-26 13:12:58 +08:00
oxalica
ac31c71698
Update libc to 0.2.66 2019-12-25 01:51:05 +08:00
Ohad Ravid
811bdeee00 Show value for consts in the documentation 2019-12-24 10:10:36 +01:00
Mark Rousskov
dddd872427 Implement rustfmt running manually using ignore crate
This replaces cargo-fmt with rustfmt with --skip-children which should
allow us to format code without running into rust-lang/rustfmt#3930.

This also bumps up the version of rustfmt used to a more recent one.
2019-12-21 20:23:55 -05:00
bors
5535c25314 Auto merge of #67495 - Centril:rollup-6aer3xg, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #67160 (Make GATs less ICE-prone.)
 - #67333 ([mir-opt] Fix `Inline` pass to handle inlining into `box` expressions)
 - #67420 (use _val to ignore parameter of any::type_name_of_val)
 - #67469 (Remove rustc-dev from the default nightly components)
 - #67489 (Drop petgraph dependency from bootstrap)
 - #67490 (Document privacy of RangeInclusive fields)
 - #67491 (use Result::map_or for bootstrap)

Failed merges:

r? @ghost
2019-12-21 20:59:22 +00:00
bors
fc5deca214 Auto merge of #67206 - ehuss:update-cargo-books, r=dtolnay
Update cargo, books

Update nomicon, cargo, reference, book, rust-by-example, embedded-book

## nomicon

2 commits in 041c46e692a2592853aeca132c8dfe8eb5a79a9e..8be35b201f9cf0a4c3fcc96c83ac21671dcf3112
2019-11-20 16:46:45 +0100 to 2019-12-01 13:02:12 -0500
- Update unwinding.md
- ci: remove needless rust-docs component

## cargo

15 commits in 626f0f40efd32e6b3dbade50cd53fdfaa08446ba..5a139f7e6d67fd8a416a3f19d8e01581d24c0333
2019-12-03 16:53:04 +0000 to 2019-12-10 20:17:50 +0000
- Bump cargo-platform version. (rust-lang/cargo#7693)
- Add a test for `cargo locate-project` (rust-lang/cargo#7690)
- Emit error on [target.'cfg(debug_assertions)'.dependencies] and similar (rust-lang/cargo#7660)
- Update the layout of `Cargo Commands` in doc (rust-lang/cargo#7687)
- Features and dependencies can't have the same name (rust-lang/cargo#7682)
- Fix some typos in doc (rust-lang/cargo#7672)
- Add test for `NAME` environment variable when `cargo new` (rust-lang/cargo#7667)
- Add test for `GIT_COMMITTER_EMAIL` when `cargo new` (rust-lang/cargo#7666)
- document support for Bitbucket Pipelines badges (rust-lang/cargo#7663)
- Add cargo-vendor to the list of cargo commands in doc (rust-lang/cargo#7659)
- Fix typo in section 'Caching the Cargo home in CI' (rust-lang/cargo#7661)
- Docs: Add an appendix on git authentication. (rust-lang/cargo#7658)
- Remove --offline empty index error. (rust-lang/cargo#7655)
- Change the link destination of cargo book contribution (rust-lang/cargo#7657)
- Add a --offline hint. (rust-lang/cargo#7654)

## reference

2 commits in 9e843aeb4df083522c7277179bbaa25d0507731c..787e8d84034a4a0ae17084bbae25474152144b9a
2019-11-24 17:44:04 +0100 to 2019-12-10 10:01:29 -0800
- Update for visibility syntax changes. (rust-lang-nursery/reference#722)
- document `bind_by_move_pattern_guards` (rust-lang-nursery/reference#720)

## book

2 commits in 81ebaa2a3f88d4d106516c489682e64cacba4f60..ef8bb568035ded8ddfa30a9309026638cc3c8136
2019-11-15 08:30:04 -0800 to 2019-11-28 11:00:04 -0600
- Remove optional commas from match arms in ch18-03 (rust-lang/book#2176)
- Remove call_box() from ch20-03 (rust-lang/book#2177)

## rust-by-example

1 commits in 4835e025826729827a94fdeb7cb85fed288d08bb..b7ac1bc76b7d02a43c83b3a931d226f708aa1ff4
2019-11-14 09:20:43 -0300 to 2019-12-02 11:38:43 -0300
- Make TryFrom & TryInto example editable (rust-lang/rust-by-example#1297)

## embedded-book

1 commits in 5ca585c4a7552efb546e7681c3de0712f4ae4fdc..c26234930282210849256e4ecab925f0f2daf3be
2019-08-27 13:39:14 +0000 to 2019-12-07 17:25:11 +0000
- Fix `impl Gpio` -> `impl GpioConfig`  (rust-embedded/book#216)
2019-12-21 17:52:47 +00:00
Mark Rousskov
28af652793 Drop petgraph dependency from bootstrap
It was essentially unused, likely leftover from a previous refactoring
iteration.
2019-12-21 10:54:15 -05:00
Eric Huss
e5d39ee842
Update cargo, books 2019-12-14 17:33:08 -08:00
Mateusz Mikuła
2d8d8136fa Update tokio crates to latest versions 2019-12-13 20:51:31 +01:00
bors
703c82e531 Auto merge of #62359 - euclio:remove-serialize, r=Dylan-DPC
replace serialize with serde in rustdoc

This is a slightly less aggressive version of #61028.

r? @GuillaumeGomez
2019-12-13 16:14:47 +00:00
Andy Russell
94630d4c8b
replace serialize with serde in rustdoc 2019-12-12 16:33:25 -05:00
Aaron Hill
47e932b96e
Fix weird implicit dependency between rustllvm and rustc_codegen_llvm
rustllvm relies on the `LLVMRustStringWriteImpl` symbol existing, but
this symbol was previously defined in a *downstream* crate
(rustc_codegen_llvm, which depends on rustc_llvm.

While this somehow worked under the old 'separate bootstrap step for
codegen' scheme, it meant that rustc_llvm could not actually be built by
itself, since it relied linking to the downstream rustc_codegen_llvm
crate.

Now that librustc_codegen_llvm is just a normal crate, we actually try
to build a standalone rustc_llvm when we run tests. This commit moves
`LLVMRustStringWriteImpl` into rustc_llvm (technically the rustllvm
directory, which has its contents built by rustc_llvm). This ensures
that we can build each crate in the graph by itself, without requiring
that any downstream crates be linked in as well.
2019-12-12 10:51:19 -05:00
Aaron Hill
150d328d2e
Update Cargo.lock 2019-12-11 09:50:46 -05:00
Aaron Hill
fca192cca2
Fix fallout from rebase 2019-12-11 09:50:12 -05:00
Alex Crichton
7f23e6e8d7
rustc: Link LLVM directly into rustc again
This commit builds on #65501 continue to simplify the build system and
compiler now that we no longer have multiple LLVM backends to ship by
default. Here this switches the compiler back to what it once was long
long ago, which is linking LLVM directly to the compiler rather than
dynamically loading it at runtime. The `codegen-backends` directory of
the sysroot no longer exists and all relevant support in the build
system is removed. Note that `rustc` still supports a dynamically loaded
codegen backend as it did previously, it just no longer supports
dynamically loaded codegen backends in its own sysroot.

Additionally as part of this the `librustc_codegen_llvm` crate now once
again explicitly depends on all of its crates instead of implicitly
loading them through the sysroot. This involved filling out its
`Cargo.toml` and deleting all the now-unnecessary `extern crate`
annotations in the header of the crate. (this in turn required adding a
number of imports for names of macros too).

The end results of this change are:

* Rustbuild's build process for the compiler as all the "oh don't forget
  the codegen backend" checks can be easily removed.
* Building `rustc_codegen_llvm` is much simpler since it's simply
  another compiler crate.
* Managing the dependencies of `rustc_codegen_llvm` is much simpler since
  it's "just another `Cargo.toml` to edit"
* The build process should be a smidge faster because there's more
  parallelism in the main rustc build step rather than splitting
  `librustc_codegen_llvm` out to its own step.
* The compiler is expected to be slightly faster by default because the
  codegen backend does not need to be dynamically loaded.
* Disabling LLVM as part of rustbuild is still supported, supporting
  multiple codegen backends is still supported, and dynamic loading of a
  codegen backend is still supported.
2019-12-11 09:50:11 -05:00