rust/src
Alex Crichton 0374e6aab7 rustc: Rearchitect lints to be emitted more eagerly
In preparation for incremental compilation this commit refactors the lint
handling infrastructure in the compiler to be more "eager" and overall more
incremental-friendly. Many passes of the compiler can emit lints at various
points but before this commit all lints were buffered in a table to be emitted
at the very end of compilation. This commit changes these lints to be emitted
immediately during compilation using pre-calculated lint level-related data
structures.

Linting today is split into two phases, one set of "early" lints run on the
`syntax::ast` and a "late" set of lints run on the HIR. This commit moves the
"early" lints to running as late as possible in compilation, just before HIR
lowering. This notably means that we're catching resolve-related lints just
before HIR lowering. The early linting remains a pass very similar to how it was
before, maintaining context of the current lint level as it walks the tree.

Post-HIR, however, linting is structured as a method on the `TyCtxt` which
transitively executes a query to calculate lint levels. Each request to lint on
a `TyCtxt` will query the entire crate's 'lint level data structure' and then go
from there about whether the lint should be emitted or not.

The query depends on the entire HIR crate but should be very quick to calculate
(just a quick walk of the HIR) and the red-green system should notice that the
lint level data structure rarely changes, and should hopefully preserve
incrementality.

Overall this resulted in a pretty big change to the test suite now that lints
are emitted much earlier in compilation (on-demand vs only at the end). This in
turn necessitated the addition of many `#![allow(warnings)]` directives
throughout the compile-fail test suite and a number of updates to the UI test
suite.
2017-08-09 09:13:51 -07:00
..
bootstrap pass rustc_libdir instead of sysroot_libdir() for running rustdoc from rustbuild 2017-08-08 06:37:40 +02:00
build_helper rustbuild: Replace create_dir_racy with create_dir_all 2017-08-07 16:04:46 +01:00
ci rustbuild: Remove --enable-llvm-clean-rebuild 2017-07-30 13:50:19 -07:00
doc Bump 'src/doc/book' git submodule. 2017-08-05 16:29:10 -04:00
etc Add support for Vector Average on PowerPC 2017-08-07 07:44:27 +00:00
grammar
jemalloc@11bfb0dcf8
liballoc Indicate how to turn byte slices back into a string slice. 2017-08-05 08:27:25 -04:00
liballoc_jemalloc Bump master to 1.21.0 2017-07-25 07:03:19 -07:00
liballoc_system Bump master to 1.21.0 2017-07-25 07:03:19 -07:00
libarena
libbacktrace
libcollections
libcompiler_builtins@5e49856003
libcore Auto merge of #43728 - zackmdavis:fnused, r=eddyb 2017-08-09 04:03:49 +00:00
libfmt_macros
libgetopts
libgraphviz
liblibc@2a5b50b7f7 addrinfo hint in lookup_host() needs clean initialization on all platforms 2017-08-07 09:07:26 -07:00
libpanic_abort
libpanic_unwind
libproc_macro syntax: Capture a TokenStream when parsing items 2017-07-28 10:47:01 -07:00
libprofiler_builtins Bump master to 1.21.0 2017-07-25 07:03:19 -07:00
librand
librustc rustc: Rearchitect lints to be emitted more eagerly 2017-08-09 09:13:51 -07:00
librustc_allocator
librustc_apfloat rustc_apfloat: complete the IEEE & PPC implementations. 2017-08-02 03:45:03 +03:00
librustc_asan Bump master to 1.21.0 2017-07-25 07:03:19 -07:00
librustc_back Add L4Re Support in librustc_back 2017-08-04 08:59:01 +02:00
librustc_bitflags Bump master to 1.21.0 2017-07-25 07:03:19 -07:00
librustc_borrowck Auto merge of #43547 - arielb1:no-borrow-no-check, r=nikomatsakis 2017-07-31 23:21:24 +00:00
librustc_const_eval rustc: Rearchitect lints to be emitted more eagerly 2017-08-09 09:13:51 -07:00
librustc_const_math rustc_const_math: use apfloat::ieee::{Single,Double} in ConstFloat. 2017-08-02 17:28:11 +03:00
librustc_data_structures Auto merge of #43713 - arielb1:legacy-dataflow, r=eddyb 2017-08-07 15:42:35 +00:00
librustc_driver rustc: Rearchitect lints to be emitted more eagerly 2017-08-09 09:13:51 -07:00
librustc_errors fix -Z treat-err-as-bug 2017-07-31 18:09:02 +03:00
librustc_incremental async-llvm(18): Instantiate OngoingCrateTranslation before starting translation. 2017-07-31 15:15:09 +02:00
librustc_lint rustc: Rearchitect lints to be emitted more eagerly 2017-08-09 09:13:51 -07:00
librustc_llvm Auto merge of #43554 - eddyb:apfloat, r=nikomatsakis 2017-08-05 13:12:56 +00:00
librustc_lsan Bump master to 1.21.0 2017-07-25 07:03:19 -07:00
librustc_metadata async-llvm(18): Instantiate OngoingCrateTranslation before starting translation. 2017-07-31 15:15:09 +02:00
librustc_mir make for_all_relevant_impls O(1) again 2017-08-08 11:18:12 +03:00
librustc_msan Bump master to 1.21.0 2017-07-25 07:03:19 -07:00
librustc_passes rustc: Rearchitect lints to be emitted more eagerly 2017-08-09 09:13:51 -07:00
librustc_platform_intrinsics Add support for Vector Average on PowerPC 2017-08-07 07:44:27 +00:00
librustc_plugin de-orphan extended information 2017-08-06 21:29:05 -07:00
librustc_privacy rustc: Rearchitect lints to be emitted more eagerly 2017-08-09 09:13:51 -07:00
librustc_resolve rustc: Rearchitect lints to be emitted more eagerly 2017-08-09 09:13:51 -07:00
librustc_save_analysis Appease tidy and fix save-analysis config for dist builds 2017-08-03 16:31:25 +12:00
librustc_trans Auto merge of #43488 - Florob:repeat-opt, r=arielb1 2017-08-06 08:09:59 +00:00
librustc_tsan
librustc_typeck rustc: Rearchitect lints to be emitted more eagerly 2017-08-09 09:13:51 -07:00
librustdoc Auto merge of #43691 - GuillaumeGomez:fix-rustdoc, r=QuietMisdreavus 2017-08-08 22:14:12 +00:00
libserialize Fix some doc/comment typos. 2017-07-23 22:48:01 +07:00
libstd Auto merge of #43588 - dns2utf8:wrapping_add, r=sfackler 2017-08-09 11:10:23 +00:00
libstd_unicode Auto merge of #42998 - behnam:uni-ver-type, r=sfackler 2017-08-08 06:48:45 +00:00
libsyntax Auto merge of #43698 - MaloJaffre:confusables, r=eddyb 2017-08-08 14:39:27 +00:00
libsyntax_ext Auto merge of #43533 - nrc:macro-save, r=jseyfried, 2017-08-01 03:52:14 +00:00
libsyntax_pos Auto merge of #43584 - arielb1:unused-reads, r=eddyb 2017-08-02 05:56:06 +00:00
libterm
libtest
libunwind
llvm@d9e7d2696e Fix LLVM assertion when a weak symbol is defined in global_asm. 2017-07-18 16:52:00 +03:00
rt
rtstartup
rustc Build rustdoc on-demand. 2017-07-27 05:51:22 -06:00
rustllvm Gate LLVMRustHasFeature on LLVM_RUSTLLVM 2017-07-31 18:10:01 -07:00
test rustc: Rearchitect lints to be emitted more eagerly 2017-08-09 09:13:51 -07:00
tools rustc: Rearchitect lints to be emitted more eagerly 2017-08-09 09:13:51 -07:00
Cargo.lock Update libc to 0.2.29 2017-08-07 15:42:30 -07:00
Cargo.toml Build rustdoc on-demand. 2017-07-27 05:51:22 -06:00
stage0.txt Bump master to 1.21.0 2017-07-25 07:03:19 -07:00