summary refs log tree commit diff
path: root/src/librustc_driver/lib.rs
AgeCommit message (Collapse)AuthorLines
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
2017-01-22Remove unused `extern crate`s.Jeffrey Seyfried-1/+0
2017-01-22Warn on unused `#[macro_use]` imports.Jeffrey Seyfried-1/+0
2017-01-17run rustdoc tests in the same sort of thread rustc runs inNiko Matsakis-16/+28
2017-01-08Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrcbors-1/+1
Remove not(stage0) from deny(warnings) Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-31Split CtxtArenas into GlobalArenas and CtxtInterners.Mark Simulacrum-0/+1
CtxtInterners contains a single DroplessArena, while GlobalArenas contains the TypedArenas still required for the remaining Drop-containing types.
2016-12-29Remove not(stage0) from deny(warnings)Alex Crichton-1/+1
Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-29Change --crate-type metadata to --emit=metadataNick Cameron-1/+2
2016-12-02rustc: add --print target-spec optionDoug Goldstein-0/+3
This option provides the user the ability to dump the configuration that is in use by rustc for the target they are building for. Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-11-30Update the bootstrap compilerAlex Crichton-2/+0
Now that we've got a beta build, let's use it!
2016-11-20Move `MetaItemKind`'s `Name` to a field of `MetaItem`.Jeffrey Seyfried-1/+2
2016-11-20Refactor `CrateConfig`.Jeffrey Seyfried-45/+19