about summary refs log tree commit diff
path: root/src/librustc/middle/dependency_format.rs
AgeCommit message (Collapse)AuthorLines
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-28/+0
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-1/+1
2020-01-23Add `-Z no-link` flagVictor Ding-1/+1
Adds a compiler option to allow rustc compile a crate without linking. With this flag, rustc serializes codegen_results into a .rlink file.
2019-09-23rustc: Convert `dependency_formats` to a queryAlex Crichton-372/+6
This commit converts a field of `Session`, `dependency_formats`, into a query of `TyCtxt`. This information then also needed to be threaded through to other remaining portions of the linker, but it's relatively straightforward. The only change here is that instead of `HashMap<CrateType, T>` the data structure changed to `Vec<(CrateType, T)>` to make it easier to deal with in queries.
2019-07-03Remove needless lifetimesJeremy Stucki-4/+4
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-5/+5
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-7/+7
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-5/+5
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-4/+4
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-4/+4
2019-02-05move librustc to 2018Mark Mansi-6/+6
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-2/+2
2018-11-30Statically link proc_macro into proc macros.Eduard-Mihai Burtescu-3/+2
2018-11-11rustc: Clean up allocator injection logicAlex Crichton-15/+0
This commit cleans up allocator injection logic found in the compiler around selecting the global allocator. It turns out that now that jemalloc is gone the compiler never actually injects anything! This means that basically everything around loading crates here and there can be easily pruned. This also removes the `exe_allocation_crate` option from custom target specs as it's no longer used by the compiler anywhere.
2018-10-29Improve a few cases of collecting to an FxHash(Map/Set)ljedrz-4/+3
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-2/+2
2018-10-06rustc/middle: whitespace & formatting fixesljedrz-2/+2
2018-10-06rustc/middle: improve some patternsljedrz-1/+1
2018-09-29don't elide lifetimes in paths in librustc/Zack M. Davis-1/+1
This seemed like a good way to kick the tires on the elided-lifetimes-in-paths lint (#52069)—seems to work! This was also pretty tedious—it sure would be nice if `cargo fix` worked on this codebase (#53896)!
2018-08-04Normalize variants of CrateType to standard styleMark Rousskov-10/+10
This is a clippy-breaking change.
2018-05-17Rename trans to codegen everywhere.Irina Popa-1/+1
2018-04-26Rename rustc_back::target to rustc_target::spec.Irina Popa-1/+1
2018-04-26rustc_back: move LinkerFlavor, PanicStrategy, and RelroLevel to target.Irina Popa-1/+1
2018-04-10Make Session.injected_panic_runtime thread-safeJohn Kåre Alsaker-2/+2
2018-04-10Make Session.dependency_formats thread-safeJohn Kåre Alsaker-1/+2
2018-03-02Run Rustfix on librustcManish Goregaokar-1/+1
2017-09-19Adjust dependency-resolution errors to be more consistentSamuel Holland-5/+5
2017-09-18Require rlibs for dependent crates when linking static executablesSamuel Holland-34/+42
This handles the case for `CrateTypeExecutable` and `+crt_static`. I reworked the match block to avoid duplicating the `attempt_static` and error checking code again (this case would have been a copy of the `CrateTypeCdylib`/`CrateTypeStaticlib` case). On `linux-musl` targets where `std` was built with `crt_static = false` in `config.toml`, this change brings the test suite from entirely failing to mostly passing. This change should not affect behavior for other crate types, or for targets which do not respect `+crt_static`.
2017-09-07rustc: Remove `CrateStore::crates` as a methodAlex Crichton-5/+5
This commit moves the `crates` method to a query and then migrates all callers to use a query instead of the now-renamed `crates_untracked` method where possible. Closes #41417
2017-09-05rustc: Remove `CrateStore::used_crate*`Alex Crichton-6/+6
This commit removes the `use_crates` and `used_crate_source` methods in favor of a mix of queries and helper methods being used now instead.
2017-09-05rustc: Flag some CrateStore methods as "untracked"Alex Crichton-20/+19
The main use of `CrateStore` *before* the `TyCtxt` is created is during resolution, but we want to be sure that any methods used before resolution are not used after the `TyCtxt` is created. This commit starts moving the methods used by resolve to all be named `{name}_untracked` where the rest of the compiler uses just `{name}` as a query. During this transition a number of new queries were added to account for post-resolve usage of these methods.
2017-09-05rustc: Move a few more cstore methods to queriesAlex Crichton-7/+7
This comit applies the following changes: * Deletes the `is_allocator` query as it's no longer used * Moves the `is_sanitizer_runtime` method to a query * Moves the `is_profiler_runtime` method to a query * Moves the `panic_strategy` method to a query * Moves the `is_no_builtins` method to a query * Deletes the cstore method of `is_compiler_builtins`. The query was added in #42588 but the `CrateStore` method was not deleted A good bit of these methods were used late in linking during trans so a new dedicated structure was created to ship a calculated form of this information over to the linker rather than having to ship the whole of `TyCtxt` over to linking.
2017-07-16Compile `compiler_builtins` with `abort` panic strategyVadim Petrochenkov-1/+2
2017-07-05rustc: Implement the #[global_allocator] attributeAlex Crichton-15/+14
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-06-14Switch CrateNum queries to DefIdTaylor Cramer-7/+7
2017-06-14On-demandify is_allocator and is_panic_runtimeTaylor Cramer-12/+14
2017-06-14on-demand dylib dependency formatsTaylor Cramer-6/+11
2016-12-29Support --emit=foo,metadataNick Cameron-1/+1
2016-12-29Change --crate-type metadata to --emit=metadataNick Cameron-1/+5
2016-11-28Avoid loading needless proc-macro dependencies.Jeffrey Seyfried-2/+2
2016-11-21Read in rmeta cratesNick Cameron-1/+1
2016-11-21Add --crate-type metadataNick Cameron-1/+1
With the same semantics as -Zno-trans
2016-11-10Register and stability check `#[no_link]` crates.Jeffrey Seyfried-0/+2
2016-11-10Refactor `explicitly_linked: bool` -> `dep_kind: DepKind`.Jeffrey Seyfried-2/+3
2016-11-08Replace FnvHasher use with FxHasher.Nicholas Nethercote-4/+4
This speeds up compilation by 3--6% across most of rustc-benchmarks.
2016-10-06rustc: Rename rustc_macro to proc_macroAlex Crichton-3/+3
This commit blanket renames the `rustc_macro` infrastructure to `proc_macro`, which reflects the general consensus of #35900. A follow up PR to Cargo will be required to purge the `rustc-macro` name as well.
2016-09-27add a panic-strategy field to the target specificationJorge Aparicio-2/+3
Now a target can define its panic strategy in its specification. If a user doesn't specify a panic strategy via the command line, i.e. '-C panic', then the compiler will use the panic strategy defined by the target specification. Custom targets can pick their panic strategy via the "panic-strategy" field of their target specification JSON file. If omitted in the specification, the strategy defaults to "unwind". closes #36647
2016-09-20rustc_metadata: go only through rustc_serialize in astencode.Eduard Burtescu-15/+15
2016-09-02rustc: Implement custom derive (macros 1.1)Alex Crichton-2/+7
This commit is an implementation of [RFC 1681] which adds support to the compiler for first-class user-define custom `#[derive]` modes with a far more stable API than plugins have today. [RFC 1681]: https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md The main features added by this commit are: * A new `rustc-macro` crate-type. This crate type represents one which will provide custom `derive` implementations and perhaps eventually flower into the implementation of macros 2.0 as well. * A new `rustc_macro` crate in the standard distribution. This crate will provide the runtime interface between macro crates and the compiler. The API here is particularly conservative right now but has quite a bit of room to expand into any manner of APIs required by macro authors. * The ability to load new derive modes through the `#[macro_use]` annotations on other crates. All support added here is gated behind the `rustc_macro` feature gate, both for the library support (the `rustc_macro` crate) as well as the language features. There are a few minor differences from the implementation outlined in the RFC, such as the `rustc_macro` crate being available as a dylib and all symbols are `dlsym`'d directly instead of having a shim compiled. These should only affect the implementation, however, not the public interface. This commit also ended up touching a lot of code related to `#[derive]`, making a few notable changes: * Recognized derive attributes are no longer desugared to `derive_Foo`. Wasn't sure how to keep this behavior and *not* expose it to custom derive. * Derive attributes no longer have access to unstable features by default, they have to opt in on a granular level. * The `derive(Copy,Clone)` optimization is now done through another "obscure attribute" which is just intended to ferry along in the compiler that such an optimization is possible. The `derive(PartialEq,Eq)` optimization was also updated to do something similar. --- One part of this PR which needs to be improved before stabilizing are the errors and exact interfaces here. The error messages are relatively poor quality and there are surprising spects of this such as `#[derive(PartialEq, Eq, MyTrait)]` not working by default. The custom attributes added by the compiler end up becoming unstable again when going through a custom impl. Hopefully though this is enough to start allowing experimentation on crates.io! syntax-[breaking-change]