Commit Graph

913 Commits

Author SHA1 Message Date
Vadim Petrochenkov
d7072b5bb4 Fix rebase 2018-06-28 11:04:51 +03:00
Vadim Petrochenkov
f0622dfe5d Use Idents for associated item definitions in HIR
Remove emulation of hygiene with gensyms
2018-06-28 11:04:50 +03:00
Vadim Petrochenkov
c6ca1e4abd Use Idents in a number of structures in HIR
Namely: labels, type parameters, bindings in patterns, parameter names in functions without body.
All of these do not need hygiene after lowering to HIR, only span locations.
2018-06-28 11:04:50 +03:00
Vadim Petrochenkov
e8215a4f6f Use Idents for path segments in HIR 2018-06-28 11:04:50 +03:00
Vadim Petrochenkov
1fe9b4d763 Use Idents for associated type bindings in HIR 2018-06-28 11:04:50 +03:00
Vadim Petrochenkov
c5454c04bc Use Idents for lifetimes in HIR 2018-06-28 11:04:50 +03:00
Vadim Petrochenkov
d347270e0c Implement #[macro_export(local_inner_macros)] 2018-06-27 13:10:16 +03:00
bors
971f7d34d4 Auto merge of #51815 - oli-obk:lowering_cleanups2, r=nikomatsakis
Lowering cleanups [2/N]

Double indirections are unnecessary
2018-06-27 07:16:13 +00:00
Oliver Schneider
174b761432 Flatten some occurrences of [P<T>] to [T] 2018-06-26 17:07:53 +02:00
Zack M. Davis
3fb76f4027 inclusive range syntax lint (.....=)
Our implementation ends up changing the `PatKind::Range` variant in the
AST to take a `Spanned<RangeEnd>` instead of just a `RangeEnd`, because
the alternative would be to try to infer the span of the range operator
from the spans of the start and end subexpressions, which is both
hideous and nontrivial to get right (whereas getting the change to the
AST right was a simple game of type tennis).

This is concerning #51043.
2018-06-26 07:54:49 -07:00
Pietro Albini
7262824128
Rollup merge of #51731 - varkor:closure-array-break-length, r=estebank
Fix ICEs when using continue as an array length inside closures (inside loop conditions)

Fixes #51707.
Fixes #51708.

r? @estebank
2018-06-26 11:35:38 +02:00
bors
01cc982e93 Auto merge of #51740 - GuillaumeGomez:fix-error-code-numbers, r=cramertj
Fix error code numbers

Fixes issue created by #51580.

r? @cramertj
2018-06-24 15:08:48 +00:00
Guillaume Gomez
8f1ef6e3be Fix error code numbers 2018-06-23 22:08:40 +02:00
Vadim Petrochenkov
20ce91076a hygiene: Merge NameAndSpan into ExpnInfo 2018-06-23 21:53:24 +03:00
Vadim Petrochenkov
fffe9fbb51 hygiene: More descriptive names for things involved in late hygienic name resolution 2018-06-23 20:09:21 +03:00
varkor
4efd5c75a8 Fix an ICE with continue inside a closure inside a loop condition 2018-06-23 18:00:47 +01:00
bors
4fe88c05cd Auto merge of #51727 - varkor:expragain-to-exprcontinue, r=petrochenkov
Rename hir::ExprAgain to hir::ExprContinue

The current name is confusing and historical.

I also used this PR to clean up the annoying indentation in `check/mod.rs`. If that's viewed as too tangential a change, I'll split it up, but it seemed reasonable to slip it in to reduce @bors's work. It's easy to compare for the two commits individually.

r? @petrochenkov
2018-06-23 14:33:10 +00:00
varkor
7ba2952af6 Rename ExprAgain to ExprContinue 2018-06-23 10:51:01 +01:00
Taylor Cramer
a62c4aa03a Fix rustdoc and remove default impl for FnHeader 2018-06-22 17:27:58 -07:00
Taylor Cramer
9a310abf79 Remove impl trait names and move bits of await into a function 2018-06-22 16:08:07 -07:00
Taylor Cramer
ee51a3c10a Review nits and updates
Move future_from_generator out of raw
Update await to use $crate
Renumber errors
2018-06-22 11:36:01 -07:00
Taylor Cramer
85e4866320 PathParameters -> GenericArgs fixes 2018-06-21 23:24:51 -07:00
Taylor Cramer
083a7eaa1a Add path parameters to std_path 2018-06-21 22:38:06 -07:00
Taylor Cramer
d64e577fa3 Async methods 2018-06-21 22:38:05 -07:00
Taylor Cramer
d02631d3df Fix typo in multiple lifetimes error 2018-06-21 22:37:17 -07:00
Taylor Cramer
cf844b547d async await desugaring and tests 2018-06-21 22:36:36 -07:00
Without Boats
18ff7d091a Parse async fn header.
This is gated on edition 2018 & the `async_await` feature gate.

The parser will accept `async fn` and `async unsafe fn` as fn
items. Along the same lines as `const fn`, only `async unsafe fn`
is permitted, not `unsafe async fn`.The parser will not accept
`async` functions as trait methods.

To do a little code clean up, four fields of the function type
struct have been merged into the new `FnHeader` struct: constness,
asyncness, unsafety, and ABI.

Also, a small bug in HIR printing is fixed: it previously printed
`const unsafe fn` as `unsafe const fn`, which is grammatically
incorrect.
2018-06-21 22:29:47 -07:00
varkor
daf7e359a1 Fix rebase issues with existential types 2018-06-20 12:34:39 +01:00
varkor
21136b8ab4 Rename ParenthesizedArgData to ParenthesisedArgs 2018-06-20 12:23:46 +01:00
varkor
dde942bb64 Fix additional comments 2018-06-20 12:23:46 +01:00
varkor
95f1866a4d Make GenericBound explicit 2018-06-20 12:23:46 +01:00
varkor
c5f16e0e18 Rename ParamBound(s) to GenericBound(s) 2018-06-20 12:23:46 +01:00
varkor
991efa4284 Address various comments 2018-06-20 12:23:33 +01:00
varkor
91712bc665 Lift attrs into hir::GenericParam 2018-06-20 12:23:23 +01:00
varkor
7de6ed06a5 Rename TraitTyParamBound to ParamBound::Trait 2018-06-20 12:23:23 +01:00
varkor
390aa5d421 Introduce ParamName and use it in place of LifetimeName 2018-06-20 12:23:23 +01:00
varkor
831b5c02df Take advantage of the lifetime refactoring 2018-06-20 12:23:08 +01:00
varkor
6015edf9af Remove name from GenericParamKind::Lifetime 2018-06-20 12:23:08 +01:00
varkor
c4e8e71880 Lift name into GenericParam 2018-06-20 12:23:08 +01:00
varkor
32b2dacdf8 Handle lifetimes in NodeGenericParam also 2018-06-20 12:23:07 +01:00
varkor
80dbe58efc Use ParamBounds in WhereRegionPredicate 2018-06-20 12:23:07 +01:00
varkor
aed530a457 Lift bounds into GenericParam 2018-06-20 12:22:46 +01:00
varkor
a5328bc17b Simply joint lifetime/type iteration 2018-06-20 12:21:52 +01:00
varkor
8bccfe7a52 Refactor counting methods 2018-06-20 12:21:52 +01:00
varkor
3bcb006fd9 Rename structures in ast 2018-06-20 12:21:52 +01:00
varkor
f457b3d10a Refactor generic parameters in rustdoc/clean 2018-06-20 12:21:52 +01:00
varkor
80b381e041 Remove all traces of lifetimes() and types() methods 2018-06-20 12:21:24 +01:00
varkor
10229fd9d5 Rename DefPathData::LifetimeDef to LifetimeParam 2018-06-20 12:21:24 +01:00
varkor
c65454850f Remove AngleBracketedArgs impl 2018-06-20 12:21:08 +01:00
varkor
e1d888c722 Remove methods from ast::GenericParam and ast::Generics 2018-06-20 12:21:08 +01:00