about summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2017-08-12Fix some typosBastien Orivel-1/+1
2017-08-12Less cfg'sbjorn3-16/+21
2017-08-12Auto merge of #43794 - Eijebong:fix_typos, r=lukaramu,steveklanik,imperiobors-1/+1
Fix some typos I wrote a really naive script and found those typos in the documentation.
2017-08-12Merge branch 'master' of https://github.com/rust-lang/rust into genJohn Kåre Alsaker-34/+165
# Conflicts: # src/librustc_mir/build/scope.rs
2017-08-11Merge remote-tracking branch 'origin/master' into genAlex Crichton-7/+6
2017-08-11Auto merge of #42932 - bjorn3:no_llvm_try2, r=eddybbors-34/+165
Support compiling rustc without LLVM (try 2) Now doesn't change rustc_driver. Supersedes #42752
2017-08-11Auto merge of #43748 - RalfJung:mir-validate2, r=arielb1bors-5/+6
AddValidation: handle Call terminators into blocks that have multiple incoming edges The old code was just wrong: It would add validation on paths that don't even come from the call, and it would add multiple validations if multiple calls end return to the same block.
2017-08-11It now completely compiles without LLVM!!!bjorn3-18/+53
2017-08-11Actually make rustc_driver compile without llvmbjorn3-28/+74
2017-08-11Improve validation of TypeckTables keys.Michael Woerister-2/+1
2017-08-11Make TypeckTables::type_dependent_defs use ItemLocalId instead of NodeId.Michael Woerister-1/+2
2017-08-11Make librustc_driver work without librustc_transbjorn3-4/+54
2017-08-11Fix some more typos, this time words that are duplicated.Bastien Orivel-1/+1
2017-08-10Merge remote-tracking branch 'origin/master' into genAlex Crichton-36/+51
2017-08-10Auto merge of #43522 - alexcrichton:rewrite-lints, r=michaelwoeristerbors-11/+11
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. Closes https://github.com/rust-lang/rust/issues/42511
2017-08-10Auto merge of #43582 - ivanbakel:unused_mut_ref, r=arielb1bors-1/+1
Fixed mutable vars being marked used when they weren't #### NB : bootstrapping is slow on my machine, even with `keep-stage` - fixes for occurances in the current codebase are <s>in the pipeline</s> done. This PR is being put up for review of the fix of the issue. Fixes #43526, Fixes #30280, Fixes #25049 ### Issue Whenever the compiler detected a mutable deref being used mutably, it marked an associated value as being used mutably as well. In the case of derefencing local variables which were mutable references, this incorrectly marked the reference itself being used mutably, instead of its contents - with the consequence of making the following code emit no warnings ``` fn do_thing<T>(mut arg : &mut T) { ... // don't touch arg - just deref it to access the T } ``` ### Fix Make dereferences not be counted as a mutable use, but only when they're on borrows on local variables. #### Why not on things other than local variables? * Whenever you capture a variable in a closure, it gets turned into a hidden reference - when you use it in the closure, it gets dereferenced. If the closure uses the variable mutably, that is actually a mutable use of the thing being dereffed to, so it has to be counted. * If you deref a mutable `Box` to access the contents mutably, you are using the `Box` mutably - so it has to be counted.
2017-08-10Strip out function implementation when documenting.kennytm-30/+32
This prevents compilation failure we want to document a platform-specific module. Every function is replaced by `loop {}` using the same construct as `--unpretty everybody_loops`. Note also a workaround to #43636 is included: `const fn` will retain their bodies, since the standard library has quite a number of them.
2017-08-10driver: factor out `continue_parse_after_error` so it can be controlled via ↵Nick Cameron-9/+19
driver API
2017-08-09run AddCallGuards for *all* call edges before running AddValidationRalf Jung-5/+6
2017-08-09Merge remote-tracking branch 'origin/master' into genAlex Crichton-63/+38
2017-08-09rustc: Rearchitect lints to be emitted more eagerlyAlex Crichton-11/+11
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-08driver: factor out a helper and make another helper publicNick Cameron-15/+20
2017-08-06de-orphan extended informationZack M. Davis-0/+4
Bizarrely, librustc_passes, librustc_plugin, librustc_mir, and libsyntax weren't getting their error explanations registered. Resolves #35284.
2017-08-04Auto merge of #43403 - RalfJung:mir-validate, r=nikomatsakisbors-6/+13
Add MIR Validate statement This adds statements to MIR that express when types are to be validated (following [Types as Contracts](https://internals.rust-lang.org/t/types-as-contracts/5562)). Obviously nothing is stabilized, and in fact a `-Z` flag has to be passed for behavior to even change at all. This is meant to make experimentation with Types as Contracts in miri possible. The design is definitely not final. Cc @nikomatsakis @aturon
2017-08-01Fixed all unnecessary muts in language coreIsaac van Bakel-1/+1
2017-07-31async-llvm(18): Instantiate OngoingCrateTranslation before starting translation.Michael Woerister-3/+3
2017-07-31async-llvm(13): Submit LLVM work packages from base::trans_crate().Michael Woerister-4/+3
2017-07-31async-llvm(9): Move OngoingCrateTranslation into back::write.Michael Woerister-2/+2
2017-07-31async-llvm(8): Clean up resource management and drop LLVM modules ASAP.Michael Woerister-2/+0
2017-07-31async-llvm(1): Run LLVM already in trans_crate().Michael Woerister-47/+10
2017-07-30librustc_driver: Remove -Z option from usage on stable compilerDaiki Mizukami-5/+9
2017-07-30Reorder passes so that AddValidation can run after ElaborateDropsRalf Jung-10/+13
2017-07-30add a pass for validation commands; for now just emit the initial AcquireValidRalf Jung-0/+4
2017-07-28Generator literal supportJohn Kåre Alsaker-0/+4
2017-07-24Rollup merge of #43421 - alexcrichton:add-some-build-scripts, r=Mark-SimulacrumMark Simulacrum-0/+17
rustc: Add some build scripts for librustc crates This commit adds some "boilerplate" build scripts to librustc/libsyntax crates to declare dependencies on various environment variables that are configured throughout the build. Cargo recently gained the ability to depend on environment variables in build scripts which can help trigger recompilation of a crate. This should fix weird bugs where after you make a commit or a few days later you'll get weird "not built with the same compiler" errors hopefully.
2017-07-24Make keep_ast configurable by driver clientsNick Cameron-4/+6
2017-07-22rustc: Add some build scripts for librustc cratesAlex Crichton-0/+17
This commit adds some "boilerplate" build scripts to librustc/libsyntax crates to declare dependencies on various environment variables that are configured throughout the build. Cargo recently gained the ability to depend on environment variables in build scripts which can help trigger recompilation of a crate. This should fix weird bugs where after you make a commit or a few days later you'll get weird "not built with the same compiler" errors hopefully.
2017-07-22Use config::pub_only rather than a spearate api modeNick Cameron-14/+2
2017-07-22Use a config file with save-analysisNick Cameron-0/+1
Replaces the output path env var. Can be passed to save-analysis via a function call or env var.
2017-07-19Add empty MIR pass for non-lexical lifetimesPaul Faria-0/+1
2017-07-11Refactor call_with_pp functions to not take a payload.Mark Simulacrum-21/+17
This is needless noise; the closure we take is FnOnce, so move || {} is fine to pass other parameters necessary.
2017-07-11Refactor methods onto Printer struct.Mark Simulacrum-20/+20
No (intentional) changes to behavior. This is intended to avoid the anti-pattern of having to import individual methods throughout code.
2017-07-06Auto merge of #42727 - alexcrichton:allocators-new, r=eddybbors-0/+10
rustc: Implement the #[global_allocator] attribute This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/1974 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-05rustc: Implement the #[global_allocator] attributeAlex Crichton-0/+10
This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-05Merge remote-tracking branch 'origin/master' into proc_macro_apiAlex Crichton-49/+110
2017-07-03remove isatty dependencyCengiz Can-1/+0
2017-07-03use single line commentsCengiz Can-7/+3
2017-07-03use embedded implementation instead of istty crateCengiz Can-3/+29
2017-07-03do not spawn pager if not ttyCengiz Can-1/+9
2017-07-03use unwrap_or_else to prevent unnecessary allocCengiz Can-3/+2