Vadim Petrochenkov
8edbbacbca
syntax: Remove SyntaxExtension::DeclMacro
...
It's a less powerful duplicate of `SyntaxExtension::NormalTT`
2019-06-10 21:33:31 +03:00
Vadim Petrochenkov
edb925a91f
syntax: Use MultiItemModifier for built-in derives
2019-06-10 21:32:48 +03:00
Vadim Petrochenkov
5a6ebec018
syntax: Remove SyntaxExtension::MultiDecorator and MultiItemDecorator
2019-06-10 21:25:56 +03:00
Vadim Petrochenkov
97f4e700c2
syntax: Remove SyntaxExtension::IdentTT and IdentMacroExpander
2019-06-10 21:19:40 +03:00
bors
61a60ce7d3
Auto merge of #61229 - Centril:stabilize-repr_align_enum, r=nagisa
...
Stabilize #![feature(repr_align_enum)] in Rust 1.37.0
On an `enum` item, you may now write:
```rust
#[repr(align(X))]
enum Foo {
// ...
}
```
This has equivalent effects to first defining:
```rust
#[repr(align(X))]
struct AlignX<T>(T);
```
and then using `AlignX<Foo>` in `Foo`'s stead.
r? @nagisa
2019-06-09 23:50:04 +00:00
Mazdak Farrokhzad
3ba82f7cd8
pacify tidy.
2019-06-09 04:16:34 +02:00
Mazdak Farrokhzad
f86719a111
Some more cleanup in libsyntax::ext::tt::quoted
2019-06-09 04:16:34 +02:00
Mazdak Farrokhzad
ab7d75d89b
Cleanups in parse_sep_and_kleene_op.
2019-06-09 04:16:34 +02:00
Mazdak Farrokhzad
39fbcfb277
Support ? Kleene operator in 2015.
2019-06-09 04:16:33 +02:00
Mazdak Farrokhzad
6b71fba9c1
Rollup merge of #61669 - petrochenkov:tokderef2, r=oli-obk
...
syntax: Remove `Deref` impl from `Token`
Follow up to https://github.com/rust-lang/rust/pull/61541
r? @oli-obk
2019-06-09 00:20:38 +02:00
Mazdak Farrokhzad
21b5c1d51e
Rollup merge of #61660 - petrochenkov:nocusta, r=Centril
...
Minimize use of `#![feature(custom_attribute)]`
Some preparations before resurrecting https://github.com/rust-lang/rust/pull/57921 .
2019-06-09 00:20:35 +02:00
Mazdak Farrokhzad
8dea8464f4
Rollup merge of #61646 - L117:master, r=Centril
...
Remove useless allocations in macro_rules follow logic.
Closes #61543
2019-06-09 00:20:32 +02:00
Vadim Petrochenkov
ea4ad555d7
Introduce #[rustc_dummy] attribute and use it in tests
...
Unlike other built-in attributes, this attribute accepts any input
2019-06-08 23:55:25 +03:00
Vadim Petrochenkov
74a6d1c821
Turn #[allocator] into a built-in attribute and rename it to #[rustc_allocator]
2019-06-08 23:55:25 +03:00
Vadim Petrochenkov
9aaa7c770c
syntax: Move some Token methods around
2019-06-08 22:38:39 +03:00
Vadim Petrochenkov
25b05147b3
syntax: Remove Deref impl from Token
2019-06-08 22:38:23 +03:00
Vadim Petrochenkov
0ca3c2f881
syntax: Move most of the TokenKind methods to Token
2019-06-08 22:38:12 +03:00
Vadim Petrochenkov
ffe23475cb
syntax: Keep full Tokens for macro_rules separators
2019-06-08 20:36:20 +03:00
Mazdak Farrokhzad
ae487e04c8
Rollup merge of #61616 - petrochenkov:parsderef, r=oli-obk
...
parser: Remove `Deref` impl from `Parser`
Follow up to https://github.com/rust-lang/rust/pull/61541
You have to write `self.token.span` instead of `self.span` in the parser now, which is not nice, but not too bad either, I guess.
Not sure.
Probably still better than people using both and being confused about the definition point of `span`.
r? @oli-obk @estebank
2019-06-08 03:33:57 +02:00
L117
7a74f33f90
Remove useless allocations in macro_rules follow logic.
2019-06-08 09:39:52 +10:00
Vadim Petrochenkov
2af47facc3
syntax: Treat error literals in more principled way
2019-06-07 18:01:50 +03:00
Vadim Petrochenkov
3dbee57dae
parser: Remove look_ahead_span
2019-06-07 13:57:57 +03:00
Vadim Petrochenkov
6eae6b0fe9
parser: Remove Deref impl from Parser
2019-06-07 13:52:03 +03:00
Vadim Petrochenkov
3da094319c
parser: self.span -> self.token.span
2019-06-07 13:51:23 +03:00
bors
c1c60d292e
Auto merge of #61209 - matthewjasper:const-tuple-constructors, r=oli-obk
...
Make tuple constructors real const fns
Mir construction special cases `Ctor(...)` to be lowered as `Ctor { 0: ... }`, which means this doesn't come up much in practice, but it seems inconsistent not to allow this.
r? @oli-obk
2019-06-07 09:41:06 +00:00
Matthew Jasper
0d75ab2293
Make constructors actually be const functions
2019-06-06 17:20:06 +01:00
Vadim Petrochenkov
3a31f0634b
Address review comments
2019-06-06 14:04:33 +03:00
Vadim Petrochenkov
ff40e37b98
Some code cleanup and tidy/test fixes
2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
738e14565d
syntax: Use Token in visitors and fix a mut visitor test
2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
67ce3f4589
syntax: Switch function parameter order in TokenTree::token
2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
350a34f85c
syntax: Use Token in some more places
2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
f745e5f9b6
syntax: Remove duplicate span from token::Ident
2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
4c5d773b4d
syntax: Remove duplicate span from token::Lifetime
2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
5e693531ff
syntax: Add some helper methods to Token
2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
aa6fba98ae
syntax: Use Token in Parser
2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
c0c57acd7b
syntax: Use Token in StringReader and TokenTreesReader
2019-06-06 14:03:15 +03:00
Vadim Petrochenkov
e0127dbf81
syntax: Use Token in TokenTree::Token
2019-06-06 14:03:15 +03:00
Vadim Petrochenkov
a3425edb46
syntax: Rename TokenAndSpan into Token
2019-06-06 14:03:15 +03:00
Vadim Petrochenkov
99b27d749c
syntax: Rename Token into TokenKind
2019-06-06 14:03:14 +03:00
Vadim Petrochenkov
eac3846b65
Always use token kinds through token module rather than Token type
2019-06-06 14:01:57 +03:00
Alexander Regueiro
cad1b1847e
Added feature gate.
2019-06-05 21:09:27 +01:00
Alexander Regueiro
3816958f18
Implemented for function bounds, type bounds, and named existential types.
2019-06-05 21:09:26 +01:00
Alexander Regueiro
35585c499f
Aggregation of drive-by cosmetic changes.
2019-06-05 21:09:26 +01:00
bors
2a1d6c83d3
Auto merge of #61484 - nnethercote:avoid-more-hygiene-lookups, r=petrochenkov
...
Avoid more hygiene lookups
Mostly by combining multiple `HygieneData::with` calls into a single call on hot paths.
r? @petrochenkov
2019-06-05 12:46:15 +00:00
Nicholas Nethercote
ab9bbf48db
Avoid unnecessary rust_2018 calls.
...
The commit combines two calls into one by saving the result in a local
variable. The commit also moves the check for `async` later, so that
when a different keyword is present the `rust_2018` call will be avoided
completely.
2019-06-05 07:43:15 +10:00
Pietro Albini
46344122d1
Rollup merge of #61500 - estebank:expregression, r=petrochenkov
...
Fix regression 61475
Addresses #61475 .
2019-06-04 22:39:39 +02:00
Mazdak Farrokhzad
3a06a93f59
Rollup merge of #61413 - davidtwco:async-argument-order-in-a-sane-way, r=eddyb
...
Re-implement async fn drop order lowering
This PR re-implements the async fn drop order lowering changes so
that it all takes place in HIR lowering, building atop the work done by
@eddyb to refactor `Res::Upvar`.
Previously, this types involved in the lowering were constructed in
libsyntax as they had to be used during name resolution and HIR
lowering. This was awful because none of that logic should have existed
in libsyntax.
This commit also changes `ArgSource` to keep a `HirId` to the original
argument pattern rather than a cloned copy of the pattern.
Only b7aa4ed and 71fb8fa should be reviewed, any other commits
are from #61276 (though 447e336 might end up staying in this PR).
As a nice side effect, it also fixes #61187 (cc #61192 ).
r? @eddyb
cc @cramertj
2019-06-04 04:48:11 +02:00
Mazdak Farrokhzad
1563514196
Rollup merge of #61409 - varkor:condition-trait-param-ice, r=oli-obk
...
Fix an ICE with a const argument in a trait
This goes some way towards fixing https://github.com/rust-lang/rust/issues/61383 (the reduced test case is fixed).
2019-06-04 04:48:08 +02:00
Esteban Küber
288202ec29
Fix regression #61475
2019-06-03 12:06:49 -07:00
David Wood
32771071e8
syntax/rustc: move mark_span_with_reason back.
2019-06-03 10:20:35 +01:00