about summary refs log tree commit diff
path: root/src/librustc_driver/lib.rs
AgeCommit message (Collapse)AuthorLines
2017-08-11Actually make rustc_driver compile without llvmbjorn3-2/+23
2017-08-11Make librustc_driver work without librustc_transbjorn3-2/+47
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-10driver: factor out `continue_parse_after_error` so it can be controlled via ↵Nick Cameron-0/+1
driver API
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-01Fixed all unnecessary muts in language coreIsaac van Bakel-1/+1
2017-07-30librustc_driver: Remove -Z option from usage on stable compilerDaiki Mizukami-5/+9
2017-07-24Make keep_ast configurable by driver clientsNick Cameron-0/+2
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-06Auto merge of #42727 - alexcrichton:allocators-new, r=eddybbors-0/+1
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/+1
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-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/+8
2017-07-03use unwrap_or_else to prevent unnecessary allocCengiz Can-3/+2
2017-07-03do not append an extra newline charCengiz Can-1/+1
2017-07-03use PAGER to view --explain output #32665Cengiz Can-3/+43
2017-07-02report the total number of errors on compilation failureAriel Ben-Yehuda-26/+23
Prior to this PR, when we aborted because a "critical pass" failed, we displayed the number of errors from that critical pass. While that's the number of errors that caused compilation to abort in *that place*, that's not what people really want to know. Instead, always report the total number of errors, and don't bother to track the number of errors from the last pass that failed. This changes the compiler driver API to handle errors more smoothly, and therefore is a compiler-api-[breaking-change]. Fixes #42793.
2017-07-02Revert "Change error count messages"Ariel Ben-Yehuda-1/+2
This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.
2017-06-23Modify --explain to handle hidden code (`# ...`) and indented code blocks.kennytm-6/+13
2017-06-20Switch to the crates.io `getopts` crateAlex Crichton-10/+10
This commit deletes the in-tree `getopts` crate in favor of the crates.io-based `getopts` crate. The main difference here is with a new builder-style API, but otherwise everything else remains relatively standard.
2017-06-19Bump version and stage0 compilerAlex Crichton-5/+0
2017-06-17Auto merge of #42650 - nrc:save-slim, r=eddybbors-3/+0
save-analysis: remove a lot of stuff This commits us to the JSON format and the more general def/ref style of output, rather than also supporting different data formats for different data structures. This does not affect the RLS at all, but will break any clients of the CSV form - AFAIK there are none (beyond a few of my own toy projects) - DXR stopped working long ago. r? @eddyb
2017-06-14suppress trait errors that are implied by other errorsAriel Ben-Yehuda-1/+4
Instead of suppressing only trait errors that are "exact duplicates", display only the "most high-level" error when there are multiple trait errors with the same span that imply each-other. e.g. when there are both `[closure]: Fn` and `[closure]: FnOnce`, omit displaying the `[closure]: FnOnce` bound.
2017-06-14Remove CSV format of save-analysis dataNick Cameron-3/+0
2017-05-24Rollup merge of #42150 - citizen428:feature/error-count-messages, ↵Mark Simulacrum-2/+1
r=Mark-Simulacrum Change error count messages See #33525 for details. r? @Mark-Simulacrum
2017-05-24Change error count messagesMichael Kohl-2/+1
See #33525 for details.
2017-05-23Rollup merge of #42016 - pietroalbini:stabilize/loop_break_value, r=nikomatsakisCorey Farwell-1/+1
Stabilize the loop_break_value feature Tracking issue: #37339. Documentation PRs already sent to the various repositories.
2017-05-18Give a nicer error for non-Unicode arguments to rustc and rustdocJosh Stone-1/+10
Previously, any non-Unicode argument would panic rustc: ``` $ rustc $'foo\x80bar' error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: "foo�bar"', /checkout/src/libcore/result.rs:859 note: Run with `RUST_BACKTRACE=1` for a backtrace. ``` Now it gives a clean error: ``` $ rustc $'foo\x80bar' error: Argument 1 is not valid Unicode: "foo�bar" ``` Maybe fixes #15890, although we still can't *compile* arbitrary file names.
2017-05-17Stabilize the loop_break_value featurePietro Albini-1/+1
2017-05-15Remove (direct) rustc_llvm dependency from rustc_driverRobin Kruppe-18/+7
This does not actually improve build times, since it still depends on rustc_trans, but is better layering and fits the multi-backend future slightly better.
2017-05-15Remove rustc_llvm dependency from librustcRobin Kruppe-0/+2
Consequently, session creation can no longer initialize LLVM. The few places that use the compiler without going through rustc_driver/CompilerCalls thus need to be careful to manually initialize LLVM (via rustc_trans!) immediately after session creation. This means librustc is not rebuilt when LLVM changes.
2017-05-14Remove rustc_llvm dependency from rustc_metadataRobin Kruppe-3/+7
Move the code for loading metadata from rlibs and dylibs from rustc_metadata into rustc_trans, and introduce a trait to avoid introducing a direct dependency on rustc_trans. This means rustc_metadata is no longer rebuilt when LLVM changes.
2017-05-13Auto merge of #41847 - alexcrichton:less-unstable-annotations, r=eddybbors-3/+4
rustc: Add a new `-Z force-unstable-if-unmarked` flag This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
2017-05-11rustc: Remove #![unstable] annotationAlex Crichton-3/+4
These are now no longer necessary with `-Z force-unstable-if-unmarked`
2017-05-04rustc: Stabilize `-C target-feature=+crt-static`Alex Crichton-3/+16
This commit stabilizes the `crt-static` feature accepted by the compiler. Note that this does not stabilize the `#[cfg]` attribute for `crt-static` as that's going to be covered by #29717. This only stabilizes a few small pieces: * The `crt-static` feature as accepted by the `-C target-feature` flag, and its connection with the platform-specific definition of `crt-static`. * The semantics of `--print cfg` printing out activated `crt-static` feature, if available. This should be enough to get the benefits of `crt-static` on stable Rust with MSVC and with musl, but sidsteps the issue of stabilizing #29717 first. Closes #37406
2017-05-02Removal pass for anonymous parametersest31-1/+1
Removes occurences of anonymous parameters from the rustc codebase, as they are to be deprecated. See issue #41686 and RFC 1685.
2017-04-26Implement a file-path remapping feature in support of debuginfo and ↵Michael Woerister-1/+1
reproducible builds.
2017-04-11Fix some nitsSimonas Kazlauskas-1/+3
2017-04-11Initial attempt at implementing optimization fuel and re-enabling struct ↵Austin Hicks-0/+8
field reordering.
2017-03-27Rollup merge of #40751 - nrc:save-callback, r=eddybAlex Crichton-2/+4
save-analysis: allow clients to get data directly without writing to a file.
2017-03-27Fix various useless derefs and slicingsOliver Schneider-5/+5
2017-03-23Remove internal liblogAlex Crichton-0/+2
This commit deletes the internal liblog in favor of the implementation that lives on crates.io. Similarly it's also setting a convention for adding crates to the compiler. The main restriction right now is that we want compiler implementation details to be unreachable from normal Rust code (e.g. requires a feature), and by default everything in the sysroot is reachable via `extern crate`. The proposal here is to require that crates pulled in have these lines in their `src/lib.rs`: #![cfg_attr(rustbuild, feature(staged_api, rustc_private))] #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))] This'll mean that by default they're not using these attributes but when compiled as part of the compiler they do a few things: * Mark themselves as entirely unstable via the `staged_api` feature and the `#![unstable]` attribute. * Allow usage of other unstable crates via `feature(rustc_private)` which is required if the crate relies on any other crates to compile (other than std).
2017-03-23save-analysis: allow clients to get data directly without writing to a fileNick Cameron-2/+4
2017-03-12Improve wording in the -{W,A,F,D} optionsTobias Schottdorf-1/+1
Fixes #28708.
2017-02-28remove special-case code for statics and just use `borrowck_fn`Niko Matsakis-0/+1
Fixes #38520
2017-01-26rustc: don't call the HIR AST.Eduard-Mihai Burtescu-1/+1
2017-01-22better comment wordingking6cong-1/+1