about summary refs log tree commit diff
path: root/src/libsyntax_ext
AgeCommit message (Collapse)AuthorLines
2016-03-15Auto merge of #32251 - durka:derive-2810, r=alexcrichtonbors-114/+136
derive: clean up hygiene derive: clean up hygiene Fixes #2810. Spawned from #32139. r? @alexcrichton
2016-03-15Auto merge of #32250 - durka:derive-31574, r=alexcrichtonbors-11/+18
derive: use intrinsics::unreachable over unreachable!() derive: use intrinsics::unreachable over unreachable!() Fixes #31574. Spawned from #32139. r? @alexcrichton
2016-03-14Add `default` as contextual keyword, and parse it for impl items.Aaron Turon-0/+2
2016-03-14derive: improve hygiene for type parameters (see #2810)Alex Burka-17/+46
When deriving Hash, RustcEncodable and RustcDecodable, the syntax extension needs a type parameter to use in the inner method. They used to use __H, __S and __D respectively. If this conflicts with a type parameter already declared for the item, bad times result (see the test). There is no hygiene for type parameters, but this commit introduces a better heuristic by concatenating the names of all extant type parameters (and prepending __H).
2016-03-14derive: remove most __ strings FIXME(#2810)Alex Burka-48/+48
This changes local variable names in all derives to remove leading double-underscores. As far as I can tell, this doesn't break anything because there is no user code in these generated functions except for struct, field and type parameter names, and this doesn't cause shadowing of those. But I am still a bit nervous.
2016-03-14fix FIXME(#6449) in #[derive(PartialOrd, Ord)]Alex Burka-55/+48
This replaces some `if`s with `match`es. This was originally not possible because using a global path in a match statement caused a "non-constant path in constant expr" ICE. The issue is long since closed, though you still hit it (as an error now, not an ICE) if you try to generate match patterns using pat_lit(expr_path). But it works when constructing the patterns more carefully.
2016-03-14derive: emit intrinsics::unreachable for impls on empty enumsAlex Burka-11/+18
fixes #31574
2016-02-23Some refactoring in deriving/debug.rsVadim Petrochenkov-8/+3
2016-02-22Fix #[derive] for empty structs with bracesVadim Petrochenkov-37/+49
2016-02-13Rename ast::Pat_ and its variantsVadim Petrochenkov-3/+3
2016-02-12Use more autoderef in libsyntax_extJonas Schievink-2/+2
2016-02-12Auto merge of #31583 - petrochenkov:indi_ast, r=Manishearthbors-13/+13
cc #31487 plugin-[breaking-change] The AST part of https://github.com/rust-lang/rust/pull/30087 r? @Manishearth
2016-02-11Remove some unnecessary indirection from AST structuresVadim Petrochenkov-13/+13
2016-02-11bootstrap: Add a bunch of Cargo.toml filesAlex Crichton-0/+13
These describe the structure of all our crate dependencies.
2016-02-11[breaking-change] don't glob export ast::StrStyle variantsOliver 'ker' Schneider-3/+2
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::Mutablity variantsOliver 'ker' Schneider-19/+22
2016-02-11[breaking-change] don't glob export ast::MetaItem_Oliver 'ker' Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::Item_ variantsOliver 'ker' Schneider-9/+9
2016-02-11[breaking-change] don't pub export ast::Stmt_ variantsOliver Schneider-2/+2
2016-02-11[breaking-change] don't pub export ast::IntLitType variantsOliver Schneider-3/+3
2016-02-11[breaking-change] don't pub export ast::Lit_ variantsOliver Schneider-14/+14
2016-02-11[breaking-change] don't pub export ast::Ty_ variantsOliver Schneider-4/+4
2016-02-11[breaking-change] remove the sign from integer literals in the astOliver Schneider-6/+2
2016-02-11[breaking-change] don't glob export ast::{UintTy, IntTy} variantsOliver Schneider-11/+11
2016-02-11[breaking-change] don't glob export ast::Expr_ variantsOliver Schneider-17/+15
2016-02-11[breaking-change] don't glob export ast::ExplicitSelf_ variantsOliver Schneider-4/+4
2016-02-11[breaking-change] don't glob export ast::Decl_ variantsOliver Schneider-2/+2
2016-02-11[breaking-change] don't glob import/export syntax::abi enum variantsOliver Schneider-3/+2
2016-02-11[breaking-change] don't glob export ast::BlockCheckMode variantsOliver Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::BinOp_Oliver Schneider-18/+16
2016-02-11[breaking-change] don't glob export ast::UnOp variantsOliver Schneider-1/+1
2016-02-03remove dead #[derive(FromPrimitive)] codeAlex Burka-145/+0
2016-01-26Auto merge of #31120 - alexcrichton:attribute-deny-warnings, r=brsonbors-2/+2
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today
2016-01-24mk: Move from `-D warnings` to `#![deny(warnings)]`Alex Crichton-2/+2
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today
2016-01-22Extended save-analysis to support generated code, alterned some spans in ↵Daniel Campbell-6/+6
format_args! and derive to maintain compatability
2015-12-31Cut out a bunch of Result and panictry! boilerplate from libsyntax.Nick Cameron-9/+9
[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
2015-12-30use structured errorsNick Cameron-18/+6
2015-12-21Auto merge of #30352 - alexcrichton:new-snashots, r=nikomatsakisbors-2/+0
Lots of cruft to remove!
2015-12-21Auto merge of #30460 - Ms2ger:BindingMode, r=alexcrichtonbors-1/+1
2015-12-21Register new snapshotsAlex Crichton-2/+0
Lots of cruft to remove!
2015-12-20Stop re-exporting the ast::BindingMode variants.Ms2ger-1/+1
2015-12-19Auto merge of #30184 - petrochenkov:ascr, r=nikomatsakisbors-5/+24
This PR is a rebase of the original PR by @eddyb https://github.com/rust-lang/rust/pull/21836 with some unrebasable parts manually reapplied, feature gate added + type equality restriction added as described below. This implementation is partial because the type equality restriction is applied to all type ascription expressions and not only those in lvalue contexts. Thus, all difficulties with detection of these contexts and translation of coercions having effect in runtime are avoided. So, you can't write things with coercions like `let slice = &[1, 2, 3]: &[u8];`. It obviously makes type ascription less useful than it should be, but it's still much more useful than not having type ascription at all. In particular, things like `let v = something.iter().collect(): Vec<_>;` and `let u = t.into(): U;` work as expected and I'm pretty happy with these improvements alone. Part of https://github.com/rust-lang/rust/issues/23416
2015-12-18Require exact type equality + add testsVadim Petrochenkov-1/+1
+ Rebase fixes
2015-12-18Rollup merge of #30420 - petrochenkov:owned2, r=nrcManish Goregaokar-7/+5
Part of https://github.com/rust-lang/rust/pull/30095 not causing mysterious segfaults. r? @nrc
2015-12-18Rollup merge of #30384 - nrc:diagnostics, r=@nikomatsakisManish Goregaokar-3/+3
Should make it possible to add JSON or HTML errors. Also tidies up a lot.
2015-12-18Deprecate name `OwnedSlice` and don't use itVadim Petrochenkov-7/+5
2015-12-17Remove unused importsJeffrey Seyfried-1/+0
2015-12-17test errorsNick Cameron-1/+1
2015-12-17move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*Nick Cameron-2/+2
Also split out emitters into their own module.