summary refs log tree commit diff
path: root/src/librustc_metadata/encoder.rs
AgeCommit message (Collapse)AuthorLines
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.
2017-01-29Privatize constructors of tuple structs with private fieldsVadim Petrochenkov-1/+7
2017-01-28rustc: move object default lifetimes to resolve_lifetimes.Eduard-Mihai Burtescu-0/+7
2017-01-28rustc: always include elidable lifetimes in HIR types.Eduard-Mihai Burtescu-2/+12
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-30/+30
2017-01-06rustc: keep track of tables everywhere as if they were per-body.Eduard-Mihai Burtescu-1/+1
2016-12-30Fix rebase falloutSimonas Kazlauskas-4/+8
This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-12-28rustc: simplify constant cross-crate loading and rustc_passes::consts.Eduard-Mihai Burtescu-29/+13
2016-12-28rustc: move function arguments into hir::Body.Eduard-Mihai Burtescu-14/+30
2016-12-28rustc: separate bodies for static/(associated)const and embedded constants.Eduard-Mihai Burtescu-1/+3
2016-12-28rustc: separate TraitItem from their parent Item, just like ImplItem.Eduard-Mihai Burtescu-2/+4
2016-12-24Use `DefId`s instead of `NodeId`s for `pub(restricted)` visibilities.Jeffrey Seyfried-35/+11
2016-12-16definitions: Store DefPath data in separate table in metadataMichael Woerister-19/+13
2016-12-08also generate MIR for staticsOliver Schneider-0/+1
2016-12-07add a -Z flag to guarantee that MIR is generated for all functionsOliver Schneider-2/+4
2016-12-05trans: Rename `reachable` to `exported_symbols` where appropriate.Michael Woerister-12/+12
2016-12-02Auto merge of #38053 - eddyb:lazy-9, r=nikomatsakisbors-1/+0
[9/n] rustc: move type information out of AdtDef and TraitDef. _This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37688) | [next]()) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well. If any motivation is unclear, please ask for additional PR description clarifications or code comments._ <hr> Both `AdtDef` and `TraitDef` contained type information (field types, generics and predicates) which was required to create them, preventing their use before that type information exists, or in the case of field types, *mutation* was required, leading to a variance-magicking implementation of `ivar`s. This PR takes that information out and the resulting cleaner setup could even eventually end up merged with HIR, because, just like `AssociatedItem` before it, there's no dependency on types anymore. (With one exception, variant discriminants should probably be moved into their own map later.)
2016-11-30rustc: track the Span's of definitions across crates.Eduard-Mihai Burtescu-12/+18
2016-11-29rustc: remove type information from TraitDef.Eduard-Mihai Burtescu-1/+0
2016-11-29revamp `Visitor` with a single method for controlling nested visitsNiko Matsakis-3/+3
2016-11-29Split nested_visit_mode function off from nested_visit_mapFlorian Diebold-3/+3
... and make the latter mandatory to implement.
2016-11-29Refactor inlined items some moreFlorian Diebold-3/+3
They don't implement FnLikeNode anymore, instead are handled differently further up in the call tree. Also, keep less information (just def ids for the args).
2016-11-29Add make tidy fixesFlorian Diebold-3/+9
2016-11-29Fix cross-crate associated constant evaluationFlorian Diebold-1/+3
2016-11-29Save bodies of functions for inlining into other cratesFlorian Diebold-3/+5
This is quite hacky and I hope to refactor it a bit, but at least it seems to work.
2016-11-29rustc_metadata: fix compilationFlorian Diebold-2/+5
2016-11-28rustc: embed path resolutions into the HIR instead of keeping DefMap.Eduard-Mihai Burtescu-1/+1
2016-11-28rustc: desugar `use a::{b,c};` into `use a::b; use a::c;` in HIR.Eduard-Mihai Burtescu-2/+2
2016-11-22rustc_metadata: don't break the version check when CrateRoot changes.Eduard-Mihai Burtescu-4/+11
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-3/+3
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-3/+3
2016-11-17Auto merge of #37660 - nikomatsakis:incremental-36349, r=eddybbors-9/+19
Separate impl items from the parent impl This change separates impl item bodies out of the impl itself. This gives incremental more resolution. In so doing, it refactors how the visitors work, and cleans up a bit of the collect/check logic (mostly by moving things out of collect that didn't really belong there, because they were just checking conditions). However, this is not as effective as I expected, for a kind of frustrating reason. In particular, when invoking `foo.bar()` you still wind up with dependencies on private items. The problem is that the method resolution code scans that list for methods with the name `bar` -- and this winds up touching *all* the methods, even private ones. I can imagine two obvious ways to fix this: - separating fn bodies from fn sigs (#35078, currently being pursued by @flodiebold) - a more aggressive model of incremental that @michaelwoerister has been advocating, in which we hash the intermediate results (e.g., the outputs of collect) so that we can see that the intermediate result hasn't changed, even if a particular impl item has changed. So all in all I'm not quite sure whether to land this or not. =) It still seems like it has to be a win in some cases, but not with the test cases we have just now. I can try to gin up some test cases, but I'm not sure if they will be totally realistic. On the other hand, some of the early refactorings to the visitor trait seem worthwhile to me regardless. cc #36349 -- well, this is basically a fix for that issue, I guess r? @michaelwoerister NB: Based atop of @eddyb's PR https://github.com/rust-lang/rust/pull/37402; don't land until that lands.
2016-11-17hash the contents of impl-item-ref by adding them to visitorNiko Matsakis-6/+11
Also simplify some of the `ty::AssociatedItem` representation, in particular by folding `has_value` into `hir::Defaultness`
2016-11-16fallout from separating impl-items from implsNiko Matsakis-0/+4
Basically adding `visit_impl_item` in various places and so forth.
2016-11-16refactor Visitor into ItemLikeVisitor and intravisit::VisitorNiko Matsakis-3/+4
There are now three patterns (shallow, deep, and nested visit). These are described in detail on the docs in `itemlikevisit::ItemLikeVisitor`.
2016-11-16rustc: Implement #[link(cfg(..))] and crt-staticAlex Crichton-8/+3
This commit is an implementation of [RFC 1721] which adds a new target feature to the compiler, `crt-static`, which can be used to select how the C runtime for a target is linked. Most targets dynamically linke the C runtime by default with the notable exception of some of the musl targets. [RFC 1721]: https://github.com/rust-lang/rfcs/blob/master/text/1721-crt-static.md This commit first adds the new target-feature, `crt-static`. If enabled, then the `cfg(target_feature = "crt-static")` will be available. Targets like musl will have this enabled by default. This feature can be controlled through the standard target-feature interface, `-C target-feature=+crt-static` or `-C target-feature=-crt-static`. Next this adds an gated and unstable `#[link(cfg(..))]` feature to enable the `crt-static` semantics we want with libc. The exact behavior of this attribute is a little squishy, but it's intended to be a forever-unstable implementation detail of the liblibc crate. Specifically the `#[link(cfg(..))]` annotation means that the `#[link]` directive is only active in a compilation unit if that `cfg` value is satisfied. For example when compiling an rlib, these directives are just encoded and ignored for dylibs, and all staticlibs are continued to be put into the rlib as usual. When placing that rlib into a staticlib, executable, or dylib, however, the `cfg` is evaluated *as if it were defined in the final artifact* and the library is decided to be linked or not. Essentially, what'll happen is: * On MSVC with `-C target-feature=-crt-static`, the `msvcrt.lib` library will be linked to. * On MSVC with `-C target-feature=+crt-static`, the `libcmt.lib` library will be linked to. * On musl with `-C target-feature=-crt-static`, the object files in liblibc.rlib are removed and `-lc` is passed instead. * On musl with `-C target-feature=+crt-static`, the object files in liblibc.rlib are used and `-lc` is not passed. This commit does **not** include an update to the liblibc module to implement these changes. I plan to do that just after the 1.14.0 beta release is cut to ensure we get ample time to test this feature. cc #37406
2016-11-12rustc_typeck: register item types for closuresAriel Ben-Yehuda-1/+1
This makes them closer to actual items and allows for more transparent treatment.
2016-11-12rustc: move closure upvar types to the closure substsAriel Ben-Yehuda-1/+1
This moves closures to the (DefId, Substs) scheme like all other items, and saves a word from the size of TyS now that Substs is 2 words.