Commit Graph

56 Commits

Author SHA1 Message Date
Manish Goregaokar 76b3523ac0 Re-add double underscores in derive (fixes #32292) 2016-03-17 08:11:44 +05:30
bors 1efa752ea6 Auto merge of #32251 - durka:derive-2810, r=alexcrichton
derive: clean up hygiene

derive: clean up hygiene

Fixes #2810.

Spawned from #32139.

r? @alexcrichton
2016-03-15 09:45:57 -07:00
bors f9121e87a6 Auto merge of #32250 - durka:derive-31574, r=alexcrichton
derive: use intrinsics::unreachable over unreachable!()

derive: use intrinsics::unreachable over unreachable!()

Fixes #31574.

Spawned from #32139.

r? @alexcrichton
2016-03-15 06:51:30 -07:00
Aaron Turon 8fe63e2342 Add default as contextual keyword, and parse it for impl items. 2016-03-14 15:04:33 -07:00
Alex Burka 8355389e3e derive: improve hygiene for type parameters (see #2810)
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-14 16:59:55 -04:00
Alex Burka fd4fa62885 derive: remove most __ strings FIXME(#2810)
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-14 16:49:18 -04:00
Alex Burka 4982f91346 fix FIXME(#6449) in #[derive(PartialOrd, Ord)]
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-14 16:49:12 -04:00
Alex Burka a09a41928f derive: emit intrinsics::unreachable for impls on empty enums
fixes #31574
2016-03-14 16:47:04 -04:00
Vadim Petrochenkov a3f3c4a0a0 Some refactoring in deriving/debug.rs 2016-02-23 03:01:24 +03:00
Vadim Petrochenkov 4e8e607d84 Fix #[derive] for empty structs with braces 2016-02-22 21:24:32 +03:00
Vadim Petrochenkov 14adc9bb63 Rename ast::Pat_ and its variants 2016-02-13 13:49:24 +03:00
Jonas Schievink db6e5d5ef9 Use more autoderef in libsyntax_ext 2016-02-12 19:28:10 +01:00
bors c7640aa2aa Auto merge of #31583 - petrochenkov:indi_ast, r=Manishearth
cc #31487
plugin-[breaking-change]

The AST part of https://github.com/rust-lang/rust/pull/30087

r? @Manishearth
2016-02-12 14:56:20 +00:00
Vadim Petrochenkov 77cc5764b9 Remove some unnecessary indirection from AST structures 2016-02-11 23:33:09 +03:00
Alex Crichton 2581b14147 bootstrap: Add a bunch of Cargo.toml files
These describe the structure of all our crate dependencies.
2016-02-11 11:12:32 -08:00
Oliver 'ker' Schneider 8b3856b1bc [breaking-change] don't glob export ast::StrStyle variants 2016-02-11 12:34:48 +01:00
Oliver 'ker' Schneider d844bfb196 [breaking-change] don't glob export ast::Visibility variants 2016-02-11 12:34:48 +01:00
Oliver 'ker' Schneider 73fa9b2da2 [breaking-change] don't glob export ast::Mutablity variants 2016-02-11 12:34:48 +01:00
Oliver 'ker' Schneider 14e09ad468 [breaking-change] don't glob export ast::MetaItem_ 2016-02-11 12:34:48 +01:00
Oliver 'ker' Schneider 019614f03d [breaking-change] don't glob export ast::Item_ variants 2016-02-11 12:34:48 +01:00
Oliver Schneider 8290c950a8 [breaking-change] don't pub export ast::Stmt_ variants 2016-02-11 12:34:48 +01:00
Oliver Schneider 498a2e416e [breaking-change] don't pub export ast::IntLitType variants 2016-02-11 12:34:48 +01:00
Oliver Schneider 69072c4f5d [breaking-change] don't pub export ast::Lit_ variants 2016-02-11 12:34:48 +01:00
Oliver Schneider 05d4cefd63 [breaking-change] don't pub export ast::Ty_ variants 2016-02-11 12:34:48 +01:00
Oliver Schneider bfa66bb389 [breaking-change] remove the sign from integer literals in the ast 2016-02-11 12:34:48 +01:00
Oliver Schneider 625e78b700 [breaking-change] don't glob export ast::{UintTy, IntTy} variants 2016-02-11 12:34:48 +01:00
Oliver Schneider 80bf9ae18a [breaking-change] don't glob export ast::Expr_ variants 2016-02-11 12:34:48 +01:00
Oliver Schneider 1c4d437158 [breaking-change] don't glob export ast::ExplicitSelf_ variants 2016-02-11 12:34:48 +01:00
Oliver Schneider 79fa657abc [breaking-change] don't glob export ast::Decl_ variants 2016-02-11 12:34:48 +01:00
Oliver Schneider 243a30c931 [breaking-change] don't glob import/export syntax::abi enum variants 2016-02-11 12:34:48 +01:00
Oliver Schneider 47b0784ba8 [breaking-change] don't glob export ast::BlockCheckMode variants 2016-02-11 12:34:48 +01:00
Oliver Schneider 05e25de4f0 [breaking-change] don't glob export ast::BinOp_ 2016-02-11 12:34:48 +01:00
Oliver Schneider f875f4c4c2 [breaking-change] don't glob export ast::UnOp variants 2016-02-11 12:34:48 +01:00
Alex Burka f6e22e53f3 remove dead #[derive(FromPrimitive)] code 2016-02-03 21:26:02 -05:00
bors 4b615854f0 Auto merge of #31120 - alexcrichton:attribute-deny-warnings, r=brson
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-26 22:10:10 +00:00
Alex Crichton 2273b52023 mk: Move from -D warnings to #![deny(warnings)]
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-24 20:35:55 -08:00
Daniel Campbell 616bfb6f15 Extended save-analysis to support generated code, alterned some spans in format_args! and derive to maintain compatability 2016-01-22 19:12:51 +13:00
Nick Cameron 9023c659af Cut out a bunch of Result and panictry! boilerplate from libsyntax.
[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
2015-12-31 14:29:02 +13:00
Nick Cameron 95dc7efad0 use structured errors 2015-12-30 14:27:59 +13:00
bors 2343a92a90 Auto merge of #30352 - alexcrichton:new-snashots, r=nikomatsakis
Lots of cruft to remove!
2015-12-21 21:37:26 +00:00
bors 709d00a231 Auto merge of #30460 - Ms2ger:BindingMode, r=alexcrichton 2015-12-21 19:10:51 +00:00
Alex Crichton cd1848a1a6 Register new snapshots
Lots of cruft to remove!
2015-12-21 09:26:21 -08:00
Ms2ger 143b9d80d0 Stop re-exporting the ast::BindingMode variants. 2015-12-20 22:15:26 +01:00
bors 440ef8b154 Auto merge of #30184 - petrochenkov:ascr, r=nikomatsakis
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-19 02:45:15 +00:00
Vadim Petrochenkov 95fdaf2375 Require exact type equality + add tests
+ Rebase fixes
2015-12-18 20:00:19 +03:00
Manish Goregaokar 9e953df6f0 Rollup merge of #30420 - petrochenkov:owned2, r=nrc
Part of https://github.com/rust-lang/rust/pull/30095 not causing mysterious segfaults.

r? @nrc
2015-12-18 20:02:12 +05:30
Manish Goregaokar c2902965cb Rollup merge of #30384 - nrc:diagnostics, r=@nikomatsakis
Should make it possible to add JSON or HTML errors. Also tidies up a lot.
2015-12-18 16:47:37 +05:30
Vadim Petrochenkov 0d298f9904 Deprecate name OwnedSlice and don't use it 2015-12-18 00:52:56 +03:00
Jeffrey Seyfried 8364a6feef Remove unused imports 2015-12-17 05:43:27 +00:00
Nick Cameron ff0c74f7d4 test errors 2015-12-17 10:00:16 +13:00