summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2019-02-18Fix a transposition in driver.rs.Benjamin Peterson-1/+1
2019-02-16Rollup merge of #58074 - scottmcm:stabilize-sort_by_cached_key, r=SimonSapinkennytm-1/+0
Stabilize slice_sort_by_cached_key I was going to ask on the tracking issue (https://github.com/rust-lang/rust/issues/34447), but decided to just send this and hope for an FCP here. The method was added last March by https://github.com/rust-lang/rust/pull/48639. Signature: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_by_cached_key ```rust impl [T] { pub fn sort_by_cached_key<K, F>(&mut self, f: F) where F: FnMut(&T) -> K, K: Ord; } ``` That's an identical signature to the existing `sort_by_key`, so I think the questions are just naming, implementation, and the usual "do we want this?". The implementation seems to have proven its use in rustc at least, which many uses: https://github.com/rust-lang/rust/search?l=Rust&q=sort_by_cached_key (I'm asking because it's exactly what I just needed the other day: ```rust all_positions.sort_by_cached_key(|&n| data::CITIES.iter() .map(|x| *metric_closure.get_edge(n, x.pos).unwrap()) .sum::<usize>() ); ``` since caching that key is a pretty obviously good idea.) Closes #34447
2019-02-13Rollup merge of #58400 - gnzlbg:fix_driver, r=oli-obkMazdak Farrokhzad-0/+5
Fix rustc_driver swallowing errors when compilation is stopped r? @oli-obk
2019-02-12Stabilize slice_sort_by_cached_keyScott McMurray-1/+0
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-12/+12
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12Fix rustc_driver swallowing errors when compilation is stoppedgnzlbg-0/+5
2019-02-10rustc: doc commentsAlexander Regueiro-12/+12
2019-02-10Rollup merge of #58345 - RalfJung:2nd-filename, r=matthewjasperGuillaume Gomez-1/+9
When there are multiple filenames, print what got interpreted as filenames I have written code that crafts command lines for rustc, and when I get "multiple input filenames provided" it can be quite hard to figure out where in this long list of arguments the mistake is hiding. Probably I passed an argument to a flag that does not expect an argument, but which flag would that be? This changes the error message to print the first two filenames, to make it easier to debug what is going on.
2019-02-10when there are multiple filenames, print what got interpreted as 2nd filenameRalf Jung-1/+9
2019-02-07Rollup merge of #58185 - GuillaumeGomez:images-url, r=SimonSapinGuillaume Gomez-3/+1
Remove images' url to make it work even without internet connection Needed for local std docs mainly. cc @SimonSapin r? @QuietMisdreavus
2019-02-07Remove images' url to make it work even without internet connectionGuillaume Gomez-3/+1
2019-02-07Auto merge of #58010 - Zoxc:parallel-passes, r=michaelwoeristerbors-44/+59
Move privacy checking later in the pipeline and make some passes run in parallel r? @michaelwoerister
2019-02-06Overhaul `syntax::fold::Folder`.Nicholas Nethercote-32/+31
This commit changes `syntax::fold::Folder` from a functional style (where most methods take a `T` and produce a new `T`) to a more imperative style (where most methods take and modify a `&mut T`), and renames it `syntax::mut_visit::MutVisitor`. The first benefit is speed. The functional style does not require any reallocations, due to the use of `P::map` and `MoveMap::move_{,flat_}map`. However, every field in the AST must be overwritten; even those fields that are unchanged are overwritten with the same value. This causes a lot of unnecessary memory writes. The imperative style reduces instruction counts by 1--3% across a wide range of workloads, particularly incremental workloads. The second benefit is conciseness; the imperative style is usually more concise. E.g. compare the old functional style: ``` fn fold_abc(&mut self, abc: ABC) { ABC { a: fold_a(abc.a), b: fold_b(abc.b), c: abc.c, } } ``` with the imperative style: ``` fn visit_abc(&mut self, ABC { a, b, c: _ }: &mut ABC) { visit_a(a); visit_b(b); } ``` (The reductions get larger in more complex examples.) Overall, the patch removes over 200 lines of code -- even though the new code has more comments -- and a lot of the remaining lines have fewer characters. Some notes: - The old style used methods called `fold_*`. The new style mostly uses methods called `visit_*`, but there are a few methods that map a `T` to something other than a `T`, which are called `flat_map_*` (`T` maps to multiple `T`s) or `filter_map_*` (`T` maps to 0 or 1 `T`s). - `move_map.rs`/`MoveMap`/`move_map`/`move_flat_map` are renamed `map_in_place.rs`/`MapInPlace`/`map_in_place`/`flat_map_in_place` to reflect their slightly changed signatures. - Although this commit renames the `fold` module as `mut_visit`, it keeps it in the `fold.rs` file, so as not to confuse git. The next commit will rename the file.
2019-01-31Use ensure for mir_borrowckJohn Kåre Alsaker-1/+1
2019-01-30Move privacy checking later in the pipeline and make some passes run in parallelJohn Kåre Alsaker-44/+59
2019-01-28Use multiple threads by default. Limits tests to one thread. Do some renaming.John Kåre Alsaker-3/+3
2019-01-28Conditionally skip two passes if their related attributes were not foundJohn Kåre Alsaker-14/+17
2019-01-27Auto merge of #57765 - Mark-Simulacrum:bootstrap-bump, r=alexcrichtonbors-2/+2
Bump bootstrap compiler to 1.33 beta r? @alexcrichton or @pietroalbini cc @rust-lang/release
2019-01-26Replace deprecated ATOMIC_INIT constsMark Rousskov-2/+2
2019-01-26Auto merge of #57726 - Zoxc:combine-early-lints, r=estebankbors-3/+7
Combine all builtin early lints This also adds a -Z no-interleave-lints option to allow benchmarking lints. r? @estebank
2019-01-25distinguish "no data" from "heterogeneous" for ABI purposesNiko Matsakis-1/+4
Also, add a testing infrastructure and tests that lets us dump layout.
2019-01-24Remove quote_*! macros and associated APIsMark Simulacrum-2/+1
2019-01-19Rollup merge of #57598 - h-michael:unpretty-help, r=oli-obkMazdak Farrokhzad-1/+2
Add missing unpretty option help message There are some missing help messages that is printed `ructc -Zunpretty help` and receiving invalid option. related with #16419, #45721, #21085, #31916
2019-01-19Auto merge of #57752 - Centril:rollup, r=Centrilbors-40/+13
Rollup of 10 pull requests Successful merges: - #57268 (Add a target option "merge-functions", and a corresponding -Z flag (works around #57356)) - #57476 (Move glob map use to query and get rid of CrateAnalysis) - #57501 (High priority resolutions for associated variants) - #57573 (Querify `entry_fn`) - #57610 (Fix nested `?` matchers) - #57634 (Remove an unused function argument) - #57653 (Make the contribution doc reference the guide more) - #57666 (Generalize `huge-enum.rs` test and expected stderr for more cross platform cases) - #57698 (Fix typo bug in DepGraph::try_mark_green().) - #57746 (Update README.md) Failed merges: r? @ghost
2019-01-19Rollup merge of #57573 - Xanewok:querify-entry-fn, r=ZoxcMazdak Farrokhzad-4/+5
Querify `entry_fn` Analogous to https://github.com/rust-lang/rust/pull/57570 but this will also require few fixups in Miri so I decided to separate that (and it seems [CI doesn't let us break tools anymore](https://github.com/rust-lang/rust/pull/57392#issuecomment-453801540)? Or was that because it was a rollup PR?) r? @nikomatsakis
2019-01-19Auto merge of #57253 - Zoxc:incr-passes2, r=michaelwoeristerbors-0/+2
Make privacy checking, intrinsic checking and liveness checking incremental Blocked on https://github.com/rust-lang/rust/pull/51487 r? @michaelwoerister
2019-01-19Combine all builtin early lints and use a separate walk for plugin lints. ↵John Kåre Alsaker-3/+7
Add a -Z no-interleave-lints option to allow benchmarking lints
2019-01-17Querify glob map usage (last use of CrateAnalysis)Igor Matuszewski-36/+8
2019-01-16Auto merge of #57392 - Xanewok:always-calc-glob-map, r=petrochenkovbors-17/+2
Always calculate glob map but only for glob uses Previously calculating glob map was *opt-in*, however it did record node id -> ident use for every use directive. This aims to see if we can unconditionally calculate the glob map and not regress performance. Main motivation is to get rid of some of the moving pieces and simplify the compilation interface - this would allow us to entirely remove `CrateAnalysis`. Later, we could easily expose a relevant query, similar to the likes of `maybe_unused_trait_import` (so using precomputed data from the resolver, but which could be rewritten to be on-demand). r? @nikomatsakis Local perf run showed mostly noise (except `ctfe-stress-*`) but I'd appreciate if we could do a perf run run here and double-check that this won't regress performance.
2019-01-16Auto merge of #57321 - petrochenkov:atokens, r=nikomatsakisbors-16/+10
Implement basic input validation for built-in attributes Correct top-level shape (`#[attr]` vs `#[attr(...)]` vs `#[attr = ...]`) is enforced for built-in attributes, built-in attributes must also fit into the "meta-item" syntax (aka the "classic attribute syntax"). For some subset of attributes (found by crater run), errors are lowered to deprecation warnings. NOTE: This PR previously included https://github.com/rust-lang/rust/pull/57367 as well.
2019-01-15Querify entry_fnIgor Matuszewski-4/+5
2019-01-15Add missing unpretty option help messageHirokazu Hata-1/+2
2019-01-15Make privacy checking, intrinsic checking and liveness checking incrementalJohn Kåre Alsaker-0/+2
2019-01-13Retain original pass orderIgor Matuszewski-2/+2
It shouldn't matter, but hey - better safe than sorry!
2019-01-13Querify local plugin_registrar_fnIgor Matuszewski-5/+5
2019-01-13Querify local proc_macro_decls_staticIgor Matuszewski-7/+26
2019-01-13Implement basic input validation for built-in attributesVadim Petrochenkov-16/+10
2019-01-13Always calculate glob map but only for glob usesIgor Matuszewski-17/+2
Previously calculating glob map was *opt-in*, however it did record node id -> ident use for every use directive. This aims to see if we can unconditionally calculate the glob map and not regress performance.
2019-01-11Make more passes incrementalJohn Kåre Alsaker-3/+4
2019-01-09Auto merge of #56614 - Zoxc:query-perf2, r=michaelwoeristerbors-2/+3
Replace LockCell with atomic types Split from https://github.com/rust-lang/rust/pull/56509 r? @michaelwoerister
2019-01-07Auto merge of #57303 - matthiaskrgr:clippy_submodule_upd, r=oli-obkbors-19/+21
submodules: update clippy and rls Fixes clippy toolstate Changes: ```` Update to latest compiletest-rs release add testcase for #3462 deps: bump rustc_tools_util version from 0.1.0 to 0.1.1 just in case... rustc_tool_utils: fix failure to create proper non-repo version string when used in crates on crates.io, bump version UI test cleanup: Extract ifs_same_cond tests UI test cleanup: Extract for_kv_map lint tests Fix test for rust-lang/rust#57250 Limit infinite_iter collect() check to known types Some improvements to util documentation Use hashset for name blacklist Reformat random_state tests Use node_id_to_type_opt instead of node_it_to_type in random_state Check pattern equality while checking declaration equality random_state lint Use an FxHashSet for valid idents in documentation lint Fix suggestion for unnecessary_ref lint Update CONTRIBUTING.md for rustfix tests Update .fixed files via update-references.sh Run rustfix on first UI test Use WIP branch for compiletest_rs ```` Also updates RLS and removes the patching of rustc_tool_utils from cargo.toml RLS changes: ```` update clippy hash and rustc_tools_util and use rustc_tools_util from crates.io Work around https://github.com/rust-lang/rust/pull/55937 Update Clippy... again Update Clippy Update clippy ```` r? @oli-obk
2019-01-07Revert "Auto merge of #57101 - o01eg:fix-57014, r=alexcrichton"Matthias Krüger-19/+21
This reverts commit 68614265d312fc2cbe8a696f7dabb9416eb6f221, reversing changes made to cae623c5ce12df8f237264d8f2c31fdaa664c382. Should fix tools on windows. Reopens #57014
2019-01-07Rollup merge of #57308 - Zoxc:controller-sync, r=michaelwoeristerPietro Albini-3/+4
Make CompileController thread-safe
2019-01-06Make sure feature gate errors are recoverable (take 2)Vadim Petrochenkov-13/+10
2019-01-06Auto merge of #57286 - alexcrichton:less-thin-2-2, r=nikomatsakisbors-8/+1
bootstrap: Link LLVM as a dylib with ThinLTO (take 2) When building a distributed compiler on Linux where we use ThinLTO to create the LLVM shared object this commit switches the compiler to dynamically linking that LLVM artifact instead of statically linking to LLVM. The primary goal here is to reduce CI compile times, avoiding two+ ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll reuse the one ThinLTO step done by LLVM's build itself. Lots of discussion about this change can be found [here] and down. A perf run will show whether this is worth it or not! [here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334 --- This PR previously landed in https://github.com/rust-lang/rust/pull/56944, caused https://github.com/rust-lang/rust/issues/57111, and was reverted in https://github.com/rust-lang/rust/pull/57116. I've added one more commit here which should fix the breakage that we saw.
2019-01-05Rollup merge of #57343 - Xanewok:querify-access-levels, r=nikomatsakiskennytm-7/+5
Calculate privacy access only via query Initially converted to query in https://github.com/rust-lang/rust/commit/a9f6babcda1479f4e5566d1aadbf9a0d99aa3182 and then changed to respect dependencies https://github.com/rust-lang/rust/commit/8281e883dd12260f00ce650aa8824507d9c447af. I did this as an effort to prune `CrateAnalysis` from librustc_save_analysis, with the only thing remaining being the glob map (`name` is unused, existing `crate_name` is exposed in the compiler passes, instead). Since calculating the glob map is opt-in, it'd be great if we could calculate that on-demand. However, it seems that it'd require converting resolution to queries, which I'm not sure how to do yet. In an effort to get rid of `CrateAnalysis` altogether, could we try unconditionally calculating the glob_map in the resolver, thus completely removing `CrateAnalysis` struct, and doing a perf run? r? @nikomatsakis cc @petrochenkov do you have any idea how/if at all could we querify the resolver? I've stumbled upon a comment that's ~3? years old at the moment, so I'm guessing things might have changed and it actually may be feasible now. https://github.com/rust-lang/rust/blob/fe0c10019d7ee96909cc42cc265ef999a6b5dd70/src/librustc_driver/driver.rs#L589-L593
2019-01-05Auto merge of #57101 - o01eg:fix-57014, r=alexcrichtonbors-21/+19
Search codegen backends based on target libdir instead of sysroot Fixes #57014 Fixes cases with custom libdir when it consists of two or more parts.
2019-01-04Remove unused name from CrateAnalysisIgor Matuszewski-1/+0
2019-01-04Replace CrateAnalysis::access_levels with queryIgor Matuszewski-6/+5
2019-01-03Make CompileController thread-safeJohn Kåre Alsaker-3/+4