summary refs log tree commit diff
path: root/src/librustc_metadata/encoder.rs
AgeCommit message (Collapse)AuthorLines
2017-07-06Auto merge of #42727 - alexcrichton:allocators-new, r=eddybbors-0/+5
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/+5
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-8/+46
2017-06-27rustc_typeck: support functions in variance computation.Eduard-Mihai Burtescu-6/+25
2017-06-27rustc: move the PolyFnSig out of TyFnDef.Eduard-Mihai Burtescu-1/+20
2017-06-27rustc: rename closure_type to fn_sig.Eduard-Mihai Burtescu-1/+1
2017-06-26Implement `quote!` and other `proc_macro` API.Jeffrey Seyfried-3/+4
2017-06-07Allocate DefIndices for global crate metadata.Michael Woerister-16/+24
This allows for treating global crate metadata the same as regular metadata with regard to incr. comp.
2017-05-28Auto merge of #42175 - michaelwoerister:filemap-hashing-fix-1, r=nikomatsakisbors-18/+4
incr.comp.: Track expanded spans instead of FileMaps. This PR removes explicit tracking of FileMaps in response to #42101. The reasoning behind being able to just *not* track access to FileMaps is similar to why we don't track access to the `DefId->DefPath` map: 1. One can only get ahold of a `Span` value by accessing the HIR (for local things) or a `metadata::schema::Entry` (for things from external crates). 2. For both of these things we compute a hash that incorporates the *expanded spans*, that is, what we hash is in the (FileMap independent) format `filename:line:col`. 3. Consequently, everything that emits a span should already be tracked via its dependency to something that has the span included in its hash and changes would be detected via that hash. One caveat here is that we have to be conservative when exporting things in metadata. A crate can be built without debuginfo and would thus by default not incorporate most spans into the metadata hashes. However, a downstream crate can make an inline copy of things in the upstream crate and span changes in the upstream crate would then go undetected, even if the downstream uses them (e.g. by emitting debuginfo for an inlined function). For this reason, we always incorporate spans into metadata hashes for now (there might be more efficient ways to handle this safely when red-green tracking is implemented). r? @nikomatsakis
2017-05-25Hygienize `librustc_resolve`.Jeffrey Seyfried-0/+1
2017-05-23incr.comp.: Track expanded spans instead of FileMaps.Michael Woerister-18/+4
2017-05-15Fix instability in GlobalMetadata::Impls ICH.Michael Woerister-7/+21
2017-05-08incr.comp.: Hash more pieces of crate metadata to detect changes there.Michael Woerister-433/+494
2017-05-05change various uses of `item_variances` to `variances_of`Niko Matsakis-3/+3
2017-05-02rename from `item_mir` to `optimized_mir`Niko Matsakis-11/+11
2017-05-02introduce `mir_keys()`Niko Matsakis-1/+6
Each MIR key is a DefId that has MIR associated with it
2017-04-28Auto merge of #41368 - nikomatsakis:incr-comp-dep-tracking-map, r=eddybbors-8/+8
make *most* maps private Currently we access the `DepTrackingMap` fields directly rather than using the query accessors. This seems bad. This branch removes several such uses, but not all, and extends the macro so that queries can hide their maps (so we can prevent regressions). The extension to the macro is kind of ugly :/ but couldn't find a simple way to do it otherwise (I guess I could use a nested macro...). Anyway I figure it's only temporary. r? @eddyb
2017-04-28Auto merge of #41508 - michaelwoerister:generic-path-remapping, r=alexcrichtonbors-2/+30
Implement a file-path remapping feature in support of debuginfo and reproducible builds This PR adds the `-Zremap-path-prefix-from`/`-Zremap-path-prefix-to` commandline option pair and is a more general implementation of #41419. As opposed to the previous attempt, this implementation should enable reproducible builds regardless of the working directory of the compiler. This implementation of the feature is more general in the sense that the re-mapping will affect *all* paths the compiler emits, including the ones in error messages. r? @alexcrichton
2017-04-28do not access `inherited_impls` map directlyNiko Matsakis-8/+8
2017-04-27Auto merge of #37860 - giannicic:defaultimpl, r=nagisabors-1/+3
#37653 support `default impl` for specialization this commit implements the first step of the `default impl` feature: > all items in a `default impl` are (implicitly) `default` and hence > specializable. In order to test this feature I've copied all the tests provided for the `default` method implementation (in run-pass/specialization and compile-fail/specialization directories) and moved the `default` keyword from the item to the impl. See [referenced](https://github.com/rust-lang/rust/issues/37653) issue for further info r? @aturon
2017-04-26Implement a file-path remapping feature in support of debuginfo and ↵Michael Woerister-2/+30
reproducible builds.
2017-04-24rustc: use tcx.at(span) to set the location of a query.Eduard-Mihai Burtescu-3/+3
2017-04-24rustc: expose the common DUMMY_SP query case as tcx methods.Eduard-Mihai Burtescu-2/+2
2017-04-24rustc: rename some of the queries to match tcx methods.Eduard-Mihai Burtescu-18/+18
2017-04-24support `default impl` for specializationGianni Ciccarelli-1/+3
this commit implements the first step of the `default impl` feature: all items in a `default impl` are (implicitly) `default` and hence specializable. In order to test this feature I've copied all the tests provided for the `default` method implementation (in run-pass/specialization and compile-fail/specialization directories) and moved the `default` keyword from the item to the impl. See referenced issue for further info
2017-04-16rustc: use monomorphic const_eval for cross-crate enum discriminants.Eduard-Mihai Burtescu-9/+37
2017-04-14Rollup merge of #40702 - mrhota:global_asm, r=nagisaCorey Farwell-0/+2
Implement global_asm!() (RFC 1548) This is a first attempt. ~~One (potential) problem I haven't solved is how to handle multiple usages of `global_asm!` in a module/crate. It looks like `LLVMSetModuleInlineAsm` overwrites module asm, and `LLVMAppendModuleInlineAsm` is not provided in LLVM C headers 😦~~ I can provide more detail as needed, but honestly, there's not a lot going on here. r? @eddyb CC @Amanieu @jackpot51 Tracking issue: #35119
2017-04-13use `tcx.crate_name(LOCAL_CRATE)` rather than `LinkMeta::crate_name`Niko Matsakis-2/+2
2017-04-12First attempt at global_asm! macroA.J. Gardner-0/+2
2017-04-12ICH: Replace old, transitive metadata hashing with direct hashing approach.Michael Woerister-11/+37
Instead of collecting all potential inputs to some metadata entry and hashing those, we directly hash the values we are storing in metadata. This is more accurate and doesn't suffer from quadratic blow-up when many entries have the same dependencies.
2017-04-12ICH: Hash everything that gets encoded into crate metadata.Michael Woerister-24/+36
2017-03-27Rollup merge of #40683 - nikomatsakis:incr-comp-coerce-unsized-info, r=eddybAlex Crichton-5/+13
on-demand-ify `custom_coerce_unsized_kind` and `inherent-impls` This "on-demand" task both checks for errors and computes the custom unsized kind, if any. This task is only defined on impls of `CoerceUnsized`; invoking it on any other kind of impl results in a bug. This is just to avoid having an `Option`, could easily be changed. r? @eddyb
2017-03-27Fix various useless derefs and slicingsOliver Schneider-2/+2
2017-03-23move `export_map` into the tcxNiko Matsakis-5/+1
2017-03-23convert `custom_coerce_unsized_kind` into a `coerce_unsized_info`Niko Matsakis-5/+13
This "on-demand" task both checks for errors and computes the custom unsized kind, if any. This task is only defined on impls of `CoerceUnsized`; invoking it on any other kind of impl results in a bug. This is just to avoid having an `Option`, could easily be changed.
2017-03-18translate tuple-variant constructors using MIRAriel Ben-Yehuda-2/+2
2017-03-12Update usages of 'OSX' (and other old names) to 'macOS'.Corey Farwell-1/+1
As of last year with version 'Sierra', the Mac operating system is now called 'macOS'.
2017-03-03Integrate `TokenStream`.Jeffrey Seyfried-1/+2
2017-02-25rustc_const_eval: demand that the MIR qualify_consts ran on each evaluated body.Eduard-Mihai Burtescu-3/+10
2017-02-25rustc: allow handling cycle errors gracefully in on-demand.Eduard-Mihai Burtescu-1/+1
2017-02-25rustc_typeck: hook up collect and item/body check to on-demand.Eduard-Mihai Burtescu-2/+2
2017-02-25rustc: simplify tcx.closure_type(...) as it can copy the cached values.Eduard-Mihai Burtescu-1/+1
2017-02-25rustc: introduce a query system for type information in ty::maps.Eduard Burtescu-2/+2
2017-02-25rustc: consolidate dep-tracked hashmaps in tcx.maps.Eduard-Mihai Burtescu-5/+5
2017-02-25rustc: move the actual values of enum discriminants into a map.Eduard-Mihai Burtescu-6/+14
2017-02-25rustc: store type parameter defaults outside of ty::Generics.Eduard-Mihai Burtescu-19/+42
2017-02-11Rebase falloutSimonas Kazlauskas-1/+2
Because certain somebody sucks at resolving big conflicts
2017-02-10Move type of discriminant to AdtDefSimonas Kazlauskas-5/+5
Previously AdtDef variants contained ConstInt for each discriminant, which did not really reflect the actual type of the discriminants. Moving the type into AdtDef allows to easily put the type into metadata and also saves bytes from ConstVal overhead for each discriminant. Also arguably the code is cleaner now :)
2017-02-06Introduce ReprOptions, a struct for holding info from the repr attributes. ↵Austin Hicks-5/+19
This effectively deprecates lookup_repr_hints.
2017-02-03Bump version, upgrade bootstrapAlex Crichton-2/+0
This commit updates the version number to 1.17.0 as we're not on that version of the nightly compiler, and at the same time this updates src/stage0.txt to bootstrap from freshly minted beta compiler and beta Cargo.