Alex Burka
1e67d8a570
deriving: factor out discriminant_value construction
2016-03-27 01:25:47 -04:00
bors
6cc502c986
Auto merge of #32253 - durka:derive-31886, r=alexcrichton
...
derive: assume enum repr defaults to isize
derive: assume enum repr defaults to isize
Fixes #31886 .
Spawned from #32139 .
r? @alexcrichton
2016-03-21 21:07:28 -07:00
bors
02954ae0a8
Auto merge of #31977 - bluss:partial-eq-save, r=brson
...
derive: Avoid emitting provided PartialEq, PartialOrd methods for c-like enums
derive: Avoid emitting provided PartialEq, PartialOrd method for c-like enums
`ne` is completely symmetrical with the method `eq`, and we can save
rust code size and compilation time here if we only emit one of them
when possible.
One case where it's easy to recognize is when it's a C-like enum. Most
other cases can not omit ne, because any value field may have a custom
PartialEq implementation.
2016-03-18 14:36:49 -07:00
Alex Burka
ee4b607dfb
derive: assume enum repr defaults to isize
...
It was originally intended to be i32, but it isn't.
Fixes #31886 .
2016-03-18 15:03:54 -04:00
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
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
a09a41928f
derive: emit intrinsics::unreachable for impls on empty enums
...
fixes #31574
2016-03-14 16:47:04 -04:00
Ulrik Sverdrup
edcc02bfee
derive: Emit only PartialOrd::partial_cmp for simple enums
...
Using the same logic as for `PartialEq`, when possible define only
`partial_cmp` and leave `lt, le, gt, ge` to their default
implementations. This works well for c-like enums.
2016-03-01 02:27:27 +01: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
Vadim Petrochenkov
77cc5764b9
Remove some unnecessary indirection from AST structures
2016-02-11 23:33:09 +03: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
019614f03d
[breaking-change] don't glob export ast::Item_ 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
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
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
bors
709d00a231
Auto merge of #30460 - Ms2ger:BindingMode, r=alexcrichton
2015-12-21 19:10:51 +00:00
Ms2ger
143b9d80d0
Stop re-exporting the ast::BindingMode variants.
2015-12-20 22:15:26 +01: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
Vadim Petrochenkov
0d298f9904
Deprecate name OwnedSlice
and don't use it
2015-12-18 00:52:56 +03:00
Nick Cameron
6309b0f5bb
move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*
...
Also split out emitters into their own module.
2015-12-17 09:35:50 +13:00
Seo Sanghyeon
f9ba107824
Move built-in syntax extensions to a separate crate
2015-12-15 15:04:46 +09:00