about summary refs log tree commit diff
path: root/src/librustc_save_analysis
AgeCommit message (Collapse)AuthorLines
2016-12-06save-analysis: fix a few generated code errorsNick Cameron-9/+11
2016-12-06annotate stricter lifetimes on LateLintPass methods to allow them to forward ↵Oliver Schneider-50/+53
to a Visitor
2016-12-02Auto merge of #38053 - eddyb:lazy-9, r=nikomatsakisbors-2/+2
[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-30Auto merge of #37800 - alexcrichton:new-bootstrap, r=eddybbors-1/+0
Update the bootstrap compiler Now that we've got a beta build, let's use it!
2016-11-30Update the bootstrap compilerAlex Crichton-1/+0
Now that we've got a beta build, let's use it!
2016-11-30Auto merge of #37989 - nrc:save-mod, r=nikomatsakisbors-17/+39
save-analysis: redirect a module decl to the start of the defining file
2016-11-29rustc: simplify AdtDef by removing the field types and ty::ivar.Eduard-Mihai Burtescu-2/+2
2016-11-28rustc_typeck: save the type cache for rustdoc and save-analysis.Eduard Burtescu-16/+27
2016-11-28rustc: embed path resolutions into the HIR instead of keeping DefMap.Eduard-Mihai Burtescu-21/+47
2016-11-25save-analysis: redirect a module decl to the start of the defining fileNick Cameron-17/+39
2016-11-23Auto merge of #37908 - nrc:save-def, r=eddybbors-6/+32
save-analysis: fix ICE on partially resolved path Occurs when we produce save-analysis before type checking is complete (due to errors).
2016-11-24Inspect def locally instead of using a methodNick Cameron-1/+6
2016-11-23Fix a bunch of bugs shown by the testNick Cameron-5/+26
2016-11-23save-analysis: fix ICE on partially resolved pathNick Cameron-1/+1
Occurs when we produce save-analysis before type checking is complete (due to errors).
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-4/+4
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-4/+7
2016-11-20Refactor `MetaItemKind` to use `Name`s instead of `InternedString`s.Jeffrey Seyfried-2/+2
2016-11-20Refactor away `ast::Attribute_`.Jeffrey Seyfried-1/+1
2016-11-18Auto merge of #37776 - nrc:save-double-angle, r=@brsonbors-14/+42
save-analysis: handle << and >> operators inside [] in types Fixes #37700
2016-11-18save-analysis: handle << and >> operators inside [] in typesNick Cameron-14/+42
Fixes #37700
2016-11-17hash the contents of impl-item-ref by adding them to visitorNiko Matsakis-1/+1
Also simplify some of the `ty::AssociatedItem` representation, in particular by folding `has_value` into `hir::Defaultness`
2016-11-12Rollup merge of #37688 - eddyb:lazy-8, r=petrochenkovEduard-Mihai Burtescu-1/+2
[8/n] rustc: clean up lookup_item_type and remove TypeScheme. _This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37676) | [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> * `tcx.tcache` -> `tcx.item_types` * `TypeScheme` (grouping `Ty` and `ty::Generics`) is removed * `tcx.item_types` entries no longer duplicated in `tcx.tables.node_types` * `tcx.lookup_item_type(def_id).ty` -> `tcx.item_type(def_id)` * `tcx.lookup_item_type(def_id).generics` -> `tcx.item_generics(def_id)` * `tcx.lookup_generics(def_id)` -> `tcx.item_generics(def_id)` * `tcx.lookup_{super_,}predicates(def_id)` -> `tcx.item_{super_,}predicates(def_id)`
2016-11-10rustc: clean up lookup_item_type and remove TypeScheme.Eduard Burtescu-1/+2
2016-11-10Add variants `Def::Macro` and `Namespace::MacroNS`.Jeffrey Seyfried-0/+2
2016-11-10Rollup merge of #37412 - eddyb:lazy-6, r=nikomatsakisEduard-Mihai Burtescu-1/+1
[6/n] rustc: transition HIR function bodies from Block to Expr. _This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37408) | [next](https://github.com/rust-lang/rust/pull/37676)) 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> The main change here is that functions and closures both use `Expr` instead of `Block` for their bodies. For closures this actually allows a honest representation of brace-less closure bodies, e.g. `|x| x + 1` is now distinguishable from `|x| { x + 1 }`, therefore this PR is `[syntax-breaking]` (cc @Manishearth). Using `Expr` allows more logic to be shared between constant bodies and function bodies, with some small such changes already part of this PR, and eventually easing #35078 and per-body type tables. Incidentally, there used to be some corners cut here and there and as such I had to (re)write divergence tracking for type-checking so that it is capable of understanding basic structured control-flow: ``` rust fn a(x: bool) -> i32 { // match also works (as long as all arms diverge) if x { panic!("true") } else { return 1; } 0 // "unreachable expression" after this PR } ``` And since liveness' "not all control paths return a value" moved to type-checking we can have nice things: ``` rust // before & after: fn b() -> i32 { 0; } // help: consider removing this semicolon // only after this PR fn c() -> i32 { { 0; } } // help: consider removing this semicolon fn d() { let x: i32 = { 0; }; } // help: consider removing this semicolon fn e() { f({ 0; }); } // help: consider removing this semicolon ```
2016-11-10rustc: unify and simplify managing associated items.Eduard Burtescu-55/+26
2016-11-10syntax: don't fake a block around closures' bodies during parsing.Eduard Burtescu-1/+1
2016-11-09Rollup merge of #37644 - nrc:save-derive-span, r=eddybEduard-Mihai Burtescu-1/+5
save-analysis: don't choke on stripped doc attributes
2016-11-08Auto merge of #36843 - petrochenkov:dotstab, r=nikomatsakisbors-1/+1
Stabilize `..` in tuple (struct) patterns I'd like to nominate `..` in tuple and tuple struct patterns for stabilization. This feature is a relatively small extension to existing stable functionality and doesn't have known blockers. The feature first appeared in Rust 1.10 6 months ago. An example of use: https://github.com/rust-lang/rust/pull/36203 Closes https://github.com/rust-lang/rust/issues/33627 r? @nikomatsakis
2016-11-08save-analysis: don't choke on stripped doc attributesNick Cameron-1/+5
2016-11-03Stabilize `..` in tuple (struct) patternsVadim Petrochenkov-1/+1
2016-11-02rustc: record the target type of every adjustment.Eduard Burtescu-4/+4
2016-11-02rustc: make all read access to tcx.tables go through a method.Eduard Burtescu-8/+7
2016-10-31Changed most vec! invocations to use square bracesiirelu-6/+6
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-29save-analysis: change imports to carry a ref id rather than their own node idNick Cameron-4/+4
2016-10-28Rollup merge of #37436 - nrc:save-span-errs, r=petrochenkovGuillaume Gomez-0/+1
Give variant spans used in derives the correct expansion id This fixes a problem in save-analysis where it mistakes a path to a variant as the variant itself. r? @petrochenkov
2016-10-28Give variant spans used in derives the correct expansion idNick Cameron-0/+1
This fixes a problem in save-analysis where it mistakes a path to a variant as the variant itself.
2016-10-27Preparations and cleanupVadim Petrochenkov-1/+2
Diagnostics for struct path resolution errors in resolve and typeck are unified. Self type is treated as a type alias in few places (not reachable yet). Unsafe cell is seen in constants even through type aliases. All checks for struct paths in typeck work on type level.
2016-10-26Rollup merge of #37144 - eulerdisk:fix_37126, r=nrcGuillaume Gomez-3/+1
save_analysis: Dump data only if get_path_data doesn't fail to resolve a path. Solves #37126 Dump data only if `get_path_data` doesn't fail to resolve a path. `get_path_data` returns `None` when it have to deals with `Def::Err`, which is used as placeholder for a failed resolution. Tell me if this is good enough, maybe I have to add some tests ? r? @nrc
2016-10-17Auto merge of #36969 - nnethercote:rename-Parser-fields, r=eddybbors-5/+5
Clarify the positions of the lexer and parser The lexer and parser use unclear names to indicate their positions in the source code. I propose the following renamings. Lexer: ``` pos -> next_pos # it's actually the next pos! last_pos -> pos # it's actually the current pos! curr -> ch # the current char curr_is -> ch_is # tests the current char col (unchanged) # the current column ``` parser ``` - last_span -> prev_span # the previous token's span - last_token_kind -> prev_token_kind # the previous token's kind - LastTokenKind -> PrevTokenKind # ditto (but the type) - token (unchanged) # the current token - span (unchanged) # the current span ``` Things to note: - This proposal removes all uses of "last", which is an unclear word because it could mean (a) previous, (b) final, or (c) most recent, i.e. current. - The "current" things (ch, col, token, span) consistently lack a prefix. The "previous" and "next" things consistently have a prefix.
2016-10-14save-analysis: dump data only if get_path_data doesn't fail to resolve a path.Andrea Pretto-3/+1
Fixes #37126.
2016-10-05Rename Parser::last_span as prev_span.Nicholas Nethercote-5/+5
This is a [breaking-change] for libsyntax.
2016-10-04Turn some impossible definitions into ICEsVadim Petrochenkov-31/+35
2016-10-04Separate Def::StructCtor/Def::VariantCtor from Def::Struct/Def::VariantVadim Petrochenkov-3/+9
2016-10-03std: Stabilize and deprecate APIs for 1.13Alex Crichton-1/+2
This commit is intended to be backported to the 1.13 branch, and works with the following APIs: Stabilized * `i32::checked_abs` * `i32::wrapping_abs` * `i32::overflowing_abs` * `RefCell::try_borrow` * `RefCell::try_borrow_mut` * `DefaultHasher` * `DefaultHasher::new` * `DefaultHasher::default` Deprecated * `BinaryHeap::push_pop` * `BinaryHeap::replace` * `SipHash13` * `SipHash24` * `SipHasher` - use `DefaultHasher` instead in the `std::collections::hash_map` module Closes #28147 Closes #34767 Closes #35057 Closes #35070
2016-09-20rustc_metadata: group information into less tags.Eduard Burtescu-2/+1
2016-09-20rustc: remove ImplOrTraitItemId and TraitDef's associated_type_names.Eduard Burtescu-10/+4
2016-09-20rustc_metadata: move more RBML tags to auto-serialization.Eduard Burtescu-4/+2
2016-09-20rustc: replace uses of NodeId in Def, other than closures and labels.Eduard Burtescu-1/+2
2016-09-20rustc_metadata: go only through rustc_serialize in astencode.Eduard Burtescu-19/+22