summary refs log tree commit diff
path: root/src/librustc_front
AgeCommit message (Collapse)AuthorLines
2015-12-09Auto merge of #30145 - petrochenkov:hyg, r=nrcbors-35/+128
Instead of `ast::Ident`, bindings, paths and labels in HIR now keep a new structure called `hir::Ident` containing mtwt-renamed `name` and the original not-renamed `unhygienic_name`. `name` is supposed to be used by default, `unhygienic_name` is rarely used. This is not ideal, but better than the status quo for two reasons: - MTWT tables can be cleared immediately after lowering to HIR - This is less bug-prone, because it is impossible now to forget applying `mtwt::resolve` to a name. It is still possible to use `name` instead of `unhygienic_name` by mistake, but `unhygienic_name`s are used only in few very special circumstances, so it shouldn't be a problem. Besides name resolution `unhygienic_name` is used in some lints and debuginfo. `unhygienic_name` can be very well approximated by "reverse renaming" `token::intern(name.as_str())` or even plain string `name.as_str()`, except that it would break gensyms like `iter` in desugared `for` loops. This approximation is likely good enough for lints and debuginfo, but not for name resolution, unfortunately (see https://github.com/rust-lang/rust/issues/27639), so `unhygienic_name` has to be kept. cc https://github.com/rust-lang/rust/issues/29782 r? @nrc
2015-12-07Add comments for Ident::from_name and identifiers in path segmentsVadim Petrochenkov-0/+14
2015-12-07Remove some unnecessary indirection from HIR structuresVadim Petrochenkov-150/+137
2015-12-05Do MTWT resolution during lowering to HIRVadim Petrochenkov-35/+114
2015-11-26Rebase fixup for lower.rsMarvin Löbel-37/+55
2015-11-26Some TLC for the MoveMap traitMarvin Löbel-38/+7
2015-11-26Moved and refactored ThinAttributesMarvin Löbel-6/+7
2015-11-26Add syntax support for attributes on expressions and all syntaxMarvin Löbel-24/+52
nodes in statement position. Extended #[cfg] folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. Extended lint checker to recognize lint levels on expressions and locals.
2015-11-25Remove all uses of `#[staged_api]`Vadim Petrochenkov-1/+1
2015-11-18Fix two long lines.Niko Matsakis-2/+6
2015-11-18Remove rustc_data_structures from the deps of librustc_front nowNiko Matsakis-1/+0
that we no longer use FnvHashMap
2015-11-18Change to a BTreeMap rather than sorting the keys of a FnvHashMap.Niko Matsakis-15/+13
2015-11-18Add comment explaining why it is called `intravisit`Niko Matsakis-10/+14
2015-11-18Refactor the HIR so that items are stored in a map in the `Crate`,Niko Matsakis-111/+228
rather being stored inline. Refactor (and rename) the visitor so that (by default) it only visits the interior content of an item not nested items. This is a [breaking-change] for anyone who uses the HIR visitor. Besides changing `visit::` to `intravisit::`, you need to refactor your visitor in one of two ways, depending on what it requires: 1. If you just want to visit all items (most common), you should call `krate.visit_all_items(&mut visitor)`. 2. If you need to visit nested items in the middle of the parent items, you should override `visit_nested_item` with something like: `self.visit_item(self.tcx.map.expect_item(item.id))`, presuming you have access to a tcx (or at least a HIR map).
2015-11-18refactorings of `lowering` that make it more amenable to using `&mut`Niko Matsakis-290/+295
instead of `Cell` (but stop short of actualling switching to `&mut`)
2015-11-18rename `_lctx` to `lctx` where appropriateNiko Matsakis-209/+210
2015-11-17Auto merge of #29766 - oli-obk:impl_item, r=nikomatsakisbors-23/+22
[breaking change] I'm not sure if those renames are ok. [TokenType::Tt* to TokenType::*](https://github.com/rust-lang/rust/pull/29582) was obvious, but for all those Item-enums it's less obvious to me what the right way forward is due to the underscore.
2015-11-16Remove `TyParen` from HIRVadim Petrochenkov-10/+4
2015-11-16rename `ast::ImplItem_::*ImplItem` to `ast::ImplItemKind::*`Oliver Schneider-4/+4
2015-11-16ImplItem_ -> ImplItemKind renameOliver Schneider-16/+16
2015-11-16rename ImplItem_::*ImplItem to ImplItem_::*Oliver Schneider-18/+17
[breaking change]
2015-11-13simplify HIR folder so that it only maps 1 item to 1 item,Niko Matsakis-124/+89
removing a bunch of asserts
2015-11-09Rustfmting librustc_front (again).Jose Narvaez-196/+192
2015-11-02Auto merge of #29291 - petrochenkov:privacy, r=alexcrichtonbors-0/+6
The public set is expanded with trait items, impls and their items, foreign items, exported macros, variant fields, i.e. all the missing parts. Now it's a subset of the exported set. This is needed for https://github.com/rust-lang/rust/pull/29083 because stability annotation pass uses the public set and all things listed above need to be annotated. Rustdoc can now be migrated to the public set as well, I guess. Exported set is now slightly more correct with regard to exported items in blocks - 1) blocks in foreign items are considered and 2) publicity is not inherited from the block's parent - if a function is public it doesn't mean structures defined in its body are public. r? @alexcrichton or maybe someone else
2015-11-01Auto merge of #29501 - Manishearth:pat-docs, r=alexcrichtonbors-3/+3
None
2015-11-01Add code formatting on PatVec docsManish Goregaokar-2/+2
2015-11-01Fix PatEnum docsManish Goregaokar-1/+1
2015-10-31Remove PatWildMultiVadim Petrochenkov-32/+11
2015-10-25syntax/rustc_front: Simplify VariantData::fieldsVadim Petrochenkov-32/+24
And use VariantData instead of P<VariantData> in Item_ and Variant_
2015-10-25rustc_privacy: Expand public node set, build exported node set more correctlyVadim Petrochenkov-0/+6
2015-10-17Auto merge of #29102 - petrochenkov:spanvis, r=alexcrichtonbors-5/+3
Closes https://github.com/rust-lang/rust/issues/28750 `Arm` and `Generics` don't have spans at all, so it's not a visitor's problem, `visit_struct_def` was fixed in https://github.com/rust-lang/rust/pull/28816
2015-10-16Auto merge of #29014 - petrochenkov:stability, r=brsonbors-625/+0
Stricter checking of stability attributes + enforcement of their invariants at compile time (+ removed dead file librustc_front/attr.rs) I intended to enforce use of `reason` for unstable items as well (it normally presents for new items), but it turned out too intrusive, many older unstable items don't have `reason`s. r? @aturon I'm studying how stability works and do some refactoring along the way, so it's probably not the last PR.
2015-10-16Provide span for visit_enum_defVadim Petrochenkov-5/+3
2015-10-15Auto merge of #28980 - nrc:unsafe-macros, r=@pnkfelixbors-2/+0
This is a [breaking change]. @brson could you do a Crater run with this PR please? Lets not land till Crater says its OK. This was discussed at https://internals.rust-lang.org/t/does-anyone-use-the-push-pop-unsafe-macros/2702
2015-10-13Comment on the purpose(s) of NodeId in VariantDataVadim Petrochenkov-0/+11
2015-10-13Merge VariantData and VariantData_Vadim Petrochenkov-42/+33
2015-10-13Fix rebase 2Vadim Petrochenkov-4/+6
2015-10-13Merge struct fields and struct kindVadim Petrochenkov-21/+53
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-24/+24
2015-10-13Provide span for visit_struct_def + remove some dead codeVadim Petrochenkov-23/+8
2015-10-13Remove now redundant NodeId from VariantVadim Petrochenkov-23/+15
2015-10-13Decouple structure kinds from NodeIdsVadim Petrochenkov-22/+21
2015-10-13Unify structures and enum variants in HIRVadim Petrochenkov-61/+22
2015-10-13Unify structures and enum variants in ASTVadim Petrochenkov-15/+7
2015-10-13Refactor attr::StabilityVadim Petrochenkov-625/+0
Stricter checking + enforcement of invariants at compile time
2015-10-12Remove the push_unsafe! and pop_unsafe! macros.Nick Cameron-2/+0
This is a [breaking change].
2015-10-12Properly set the MatchSource for for loopsNick Cameron-3/+8
2015-10-09review commentsNick Cameron-15/+155
2015-10-09rustfmt'ingNick Cameron-554/+660
2015-10-09Misc fixupsNick Cameron-8/+10