about summary refs log tree commit diff
path: root/src/librustc_front
AgeCommit message (Collapse)AuthorLines
2016-04-06rustc: move rustc_front to rustc::hir.Eduard Burtescu-8443/+0
2016-04-02Add `Crate` and `Restricted` variants to `ast::Visibility`Jeffrey Seyfried-1/+2
2016-04-02Make `ast::Visibility` non-copyableJeffrey Seyfried-5/+5
2016-03-31Remove incorrect comment about `PartialEq` implementationTobias Bucher-1/+0
2016-03-24address nitsAlex Burka-1/+1
2016-03-24fatal error instead of ICE for impossible range during HIR loweringAlex Burka-1/+8
End-less ranges (`a...`) don't parse but bad syntax extensions could conceivably produce them. Unbounded ranges (`...`) do parse and are caught here. The other panics in HIR lowering are all for unexpanded macros, which cannot be constructed by bad syntax extensions.
2016-03-22fix alignmentJorge Aparicio-53/+53
2016-03-22sprinkle feature gates here and thereJorge Aparicio-0/+1
2016-03-22try! -> ?Jorge Aparicio-698/+698
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-21Expose attached attributes to `FnKind` abstraction so that I can look at ↵Felix S. Klock II-13/+31
them in borrowck.
2016-03-17hir_map: Provide expression and statement attributes.Eduard Burtescu-1/+20
2016-03-17hir, mir: Separate HIR expressions / MIR operands from InlineAsm.Eduard Burtescu-46/+24
2016-03-14Add pretty printer output for `default`Aaron Turon-0/+5
2016-03-14Move specialization graph walks to iterators; make associated typeAaron Turon-0/+10
projection sensitive to "mode" (most importantly, trans vs middle). This commit introduces several pieces of iteration infrastructure in the specialization graph data structure, as well as various helpers for finding the definition of a given item, given its kind and name. In addition, associated type projection is now *mode-sensitive*, with three possible modes: - **Topmost**. This means that projection is only possible if there is a non-`default` definition of the associated type directly on the selected impl. This mode is a bit of a hack: it's used during early coherence checking before we have built the specialization graph (and therefore before we can walk up the specialization parents to find other definitions). Eventually, this should be replaced with a less "staged" construction of the specialization graph. - **AnyFinal**. Projection succeeds for any non-`default` associated type definition, even if it is defined by a parent impl. Used throughout typechecking. - **Any**. Projection always succeeds. Used by trans. The lasting distinction here is between `AnyFinal` and `Any` -- we wish to treat `default` associated types opaquely for typechecking purposes. In addition to the above, the commit includes a few other minor review fixes.
2016-03-14Add `default` as contextual keyword, and parse it for impl items.Aaron Turon-4/+20
2016-03-11removed suffixes for librustc_frontsrinivasreddy-2/+2
2016-03-07implement the `?` operatorJorge Aparicio-0/+70
The `?` postfix operator is sugar equivalent to the try! macro, but is more amenable to chaining: `File::open("foo")?.metadata()?.is_dir()`. `?` is accepted on any *expression* that can return a `Result`, e.g. `x()?`, `y!()?`, `{z}?`, `(w)?`, etc. And binds more tightly than unary operators, e.g. `!x?` is parsed as `!(x?)`. cc #31436
2016-03-06Auto merge of #30884 - durka:inclusive-ranges, r=aturonbors-22/+94
This PR implements [RFC 1192](https://github.com/rust-lang/rfcs/blob/master/text/1192-inclusive-ranges.md), which is triple-dot syntax for inclusive range expressions. The new stuff is behind two feature gates (one for the syntax and one for the std::ops types). This replaces the deprecated functionality in std::iter. Along the way I simplified the desugaring for all ranges. This is my first contribution to rust which changes more than one character outside of a test or comment, so please review carefully! Some of the individual commit messages have more of my notes. Also thanks for putting up with my dumb questions in #rust-internals. - For implementing `std::ops::RangeInclusive`, I took @Stebalien's suggestion from https://github.com/rust-lang/rfcs/pull/1192#issuecomment-137864421. It seemed to me to make the implementation easier and increase type safety. If that stands, the RFC should be amended to avoid confusion. - I also kind of like @glaebhoerl's [idea](https://github.com/rust-lang/rfcs/pull/1254#issuecomment-147815299), which is unified inclusive/exclusive range syntax something like `x>..=y`. We can experiment with this while everything is behind a feature gate. - There are a couple of FIXMEs left (see the last commit). I didn't know what to do about `RangeArgument` and I haven't added `Index` impls yet. Those should be discussed/finished before merging. cc @Gankro since you [complained](https://www.reddit.com/r/rust/comments/3xkfro/what_happened_to_inclusive_ranges/cy5j0yq) cc #27777 #30877 rust-lang/rust#1192 rust-lang/rfcs#1254 relevant to #28237 (tracking issue)
2016-03-02Move span into `StructField`Vadim Petrochenkov-33/+27
+ some cleanup in rustdoc
2016-03-02Use numeric field `Name`s ("0", "1" etc) for positional fieldsVadim Petrochenkov-35/+17
2016-03-02Get rid of hir::StructFieldKindVadim Petrochenkov-65/+48
2016-02-27fix stability holeAlex Burka-1/+6
2016-02-27fallout from removing hir::ExprRangeAlex Burka-17/+0
A whole bunch of stuff gets folded into struct handling! Plus, removes an ugly hack from trans and accidentally fixes a bug with constructing ranges from references (see later commits with tests).
2016-02-27HIR: add inclusive ranges, desugar all ranges (remove ExprRange)Alex Burka-5/+89
2016-02-21rustbuild: Sync some Cargo.toml/lib.rs dependenciesAlex Crichton-0/+1
The standard library doesn't depend on rustc_bitflags, so move it to explicit dependencies on all other crates. Additionally, the arena/fmt_macros deps could be dropped from libsyntax.
2016-02-16Split PatKind::Enum into PatKind::TupleStruct and PatKind::PathVadim Petrochenkov-25/+43
2016-02-14Rename hir::Pat_ and its variantsVadim Petrochenkov-88/+87
2016-02-13Split ast::PatKind::Enum into tuple struct and path patternsVadim Petrochenkov-1/+4
2016-02-13Rename ast::Pat_ and its variantsVadim Petrochenkov-12/+14
2016-02-12Make more use of autoderef in librustc_frontJonas Schievink-109/+108
2016-02-11bootstrap: Add a bunch of Cargo.toml filesAlex Crichton-0/+14
These describe the structure of all our crate dependencies.
2016-02-11[breaking-change] don't glob export ast::PathListItem_ variantsOliver 'ker' Schneider-18/+18
2016-02-11[breaking-change] don't glob export ast::StrStyle variantsOliver 'ker' Schneider-6/+6
2016-02-11[breaking-change] don't glob export ast::Visibility variantsOliver 'ker' Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::TraitItemKind variantsOliver 'ker' Schneider-3/+3
2016-02-11[breaking-change] don't glob export ast::Mutablity variantsOliver 'ker' Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::MetaItem_Oliver 'ker' Schneider-5/+5
2016-02-11[breaking-change] don't glob export ast::Item_ variantsOliver 'ker' Schneider-16/+16
2016-02-11[breaking-change] don't glob export ast::ForeignItem_ variantsOliver 'ker' Schneider-2/+2
2016-02-11[breaking-change] don't pub export ast::Stmt_ variantsOliver Schneider-4/+4
2016-02-11[breaking-change] don't pub export ast::Ty_ variantsOliver Schneider-13/+14
2016-02-11[breaking-change] don't glob export ast::Expr_ variantsOliver Schneider-37/+37
2016-02-11[breaking-change] don't glob export ast::ExplicitSelf_ variantsOliver Schneider-5/+5
2016-02-11[breaking-change] don't glob export ast::Decl_ variantsOliver Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::CaptureClause variantsOliver Schneider-3/+3
2016-02-11[breaking-change] don't glob import/export syntax::abi enum variantsOliver Schneider-10/+10
2016-02-11[breaking-change] don't glob export ast::BlockCheckMode variantsOliver Schneider-2/+2
2016-02-11[breaking-change] don't glob import ast::FunctionRetTy variantsOliver Schneider-3/+3
2016-02-11[breaking-change] don't glob export ast::BinOp_Oliver Schneider-18/+18
2016-02-11[breaking-change] don't glob export ast::UnOp variantsOliver Schneider-3/+3