about summary refs log tree commit diff
path: root/src/libsyntax/ext/build.rs
AgeCommit message (Collapse)AuthorLines
2019-06-09Allow attributes in formal function parametersCaio-2/+3
2019-06-05Implemented for function bounds, type bounds, and named existential types.Alexander Regueiro-8/+8
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-18/+15
2019-06-03syntax: revert `ast::AsyncArgument` and associated changes.Eduard-Mihai Burtescu-5/+1
Here follows the main reverts applied in order to make this commit: Revert "Rollup merge of #60676 - davidtwco:issue-60674, r=cramertj" This reverts commit 45b09453dbf120cc23d889435aac3ed7d2ec8eb7, reversing changes made to f6df1f6c30b469cb9e65c5453a0efa03cbb6005e. Revert "Rollup merge of #60437 - davidtwco:issue-60236, r=nikomatsakis" This reverts commit 16939a50ea440e72cb6ecefdaabb988addb1ec0e, reversing changes made to 12bf98155249783583a91863c5dccf9e346f1226. Revert "Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj" This reverts commit 62d1574876f5531bce1b267e62dff520d7adcbbb, reversing changes made to 4eff8526a789e0dfa8b97f7dec91b7b5c18e8544.
2019-05-27Pass symbols to `ExtCtxt::std_path` instead of strings.Nicholas Nethercote-24/+14
Because this function is hot. Also remove the dead `ty_option` function.
2019-05-23Auto merge of #60174 - matthewjasper:add-match-arm-scopes, r=pnkfelixbors-1/+2
Add match arm scopes and other scope fixes * Add drop and lint scopes for match arms. * Lint attributes are now respected on match arms. * Make sure we emit a StorageDead if we diverge when initializing a temporary. * Adjust MIR pretty printing of scopes for locals. * Don't generate duplicate lint scopes for `let statements`. * Add some previously missing fake borrows for matches. closes #46525 cc @rust-lang/compiler
2019-05-22Eliminate unnecessary `Ident::with_empty_ctxt`sVadim Petrochenkov-1/+1
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-3/+3
2019-05-21Give match arms an HirId and a SpanMatthew Jasper-1/+2
2019-05-11Simplify conversions between tokens and semantic literalsVadim Petrochenkov-6/+5
2019-05-11Keep the original token in `ast::Lit`Vadim Petrochenkov-2/+4
2019-05-11Turn `ast::Lit` into a structVadim Petrochenkov-5/+5
2019-04-21Introduce `ArgSource` for diagnostics.David Wood-1/+2
This commit introduces an `ArgSource` enum that is lowered into the HIR so that diagnostics can correctly refer to the argument pattern's original name rather than the generated pattern.
2019-04-21Introduce `LocalSource` into the AST.David Wood-0/+3
This will be used to keep track of the origin of a local in the AST. In particular, it will be used by `async fn` lowering for the locals in `let <pat>: <ty> = __arg0;` statements.
2019-03-24Separate variant id and variant constructor id.David Wood-0/+1
This commit makes two changes - separating the `NodeId` that identifies an enum variant from the `NodeId` that identifies the variant's constructor; and no longer creating a `NodeId` for `Struct`-style enum variants and structs. Separation of the variant id and variant constructor id will allow the rest of RFC 2008 to be implemented by lowering the visibility of the variant's constructor without lowering the visbility of the variant itself. No longer creating a `NodeId` for `Struct`-style enum variants and structs mostly simplifies logic as previously this `NodeId` wasn't used. There were various cases where the `NodeId` wouldn't be used unless there was an unit or tuple struct or enum variant but not all uses of this `NodeId` had that condition, by removing this `NodeId`, this must be explicitly dealt with. This change mostly applied cleanly, but there were one or two cases in name resolution and one case in type check where the existing logic required a id for `Struct`-style enum variants and structs.
2019-02-28Auto merge of #57760 - dlrobertson:varargs1, r=alexregbors-1/+1
Support defining C compatible variadic functions ## Summary Add support for defining C compatible variadic functions in unsafe rust with `extern "C"` according to [RFC 2137]. ## Details ### Parsing When parsing a user defined function that is `unsafe` and `extern "C"` allow variadic signatures and inject a "spoofed" `VaList` in the new functions signature. This allows the user to interact with the variadic arguments via a `VaList` instead of manually using `va_start` and `va_end` (See [RFC 2137] for details). ### Codegen When running codegen for a variadic function, remove the "spoofed" `VaList` from the function signature and inject `va_start` when the arg local references are created for the function and `va_end` on return. ## TODO - [x] Get feedback on injecting `va_start/va_end` in MIR vs codegen - [x] Properly inject `va_end` - It seems like it should be possible to inject `va_end` on the `TerminatorKind::Return`. I just need to figure out how to get the `LocalRef` here. - [x] Properly call Rust defined C variadic functions in Rust - The spoofed `VaList` causes problems here. Related to: #44930 r? @ghost [RFC 2137]: https://github.com/rust-lang/rfcs/blob/master/text/2137-variadic.md
2019-02-27Rename variadic to c_variadicDan Robertson-1/+1
Function signatures with the `variadic` member set are actually C-variadic functions. Make this a little more explicit by renaming the `variadic` boolean value, `c_variadic`.
2019-02-24Deny `async fn` in 2015 editionNathan Corbyn-1/+1
Fix style issues and update diagnostic messages Update src/librustc_passes/diagnostics.rs Co-Authored-By: doctorn <me@nathancorbyn.com> Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition
2019-02-20remove a bit of dead codeAleksey Kladov-6/+0
2019-02-10rustc: doc commentsAlexander Regueiro-1/+1
2019-02-07Support const generics in derivevarkor-1/+19
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07libsyntax => 2018Taiki Endo-9/+10
2018-12-27Get rid of `Block::recovered`Vadim Petrochenkov-1/+0
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-04Address review commentsVadim Petrochenkov-9/+7
2018-12-04syntax: Rename some keywordsVadim Petrochenkov-1/+1
`CrateRoot` -> `PathRoot`, `::` doesn't necessarily mean crate root now `SelfValue` -> `SelfLower`, `SelfType` -> `SelfUpper`, both `self` and `Self` can be used in type and value namespaces now
2018-11-08Use `Lit` rather than `P<Lit>` in `ast::ExprKind`.Nicholas Nethercote-1/+1
Because it results in fewer allocations and small speedups on some benchmarks.
2018-10-26Give each PathSegment a NodeIdNick Cameron-2/+6
2018-09-10Track whether module declarations are inline (fixes #12590)Tinco Andringa-0/+1
2018-08-19mv codemap() source_map()Donato Sciarra-1/+1
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-13Move SmallVec and ThinVec out of libsyntaxljedrz-5/+6
2018-06-21async await desugaring and testsTaylor Cramer-0/+2
2018-06-21Parse async fn header.Without Boats-3/+6
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-20Rename ty_param_bound to trait_boundvarkor-2/+2
2018-06-20Make GenericBound explicitvarkor-1/+2
2018-06-20Rename ParamBound(s) to GenericBound(s)varkor-6/+6
2018-06-20Rename TraitTyParamBound to ParamBound::Traitvarkor-1/+1
2018-06-20Remove name from GenericParamKind::Lifetimevarkor-3/+1
2018-06-20Lift bounds into GenericParamvarkor-8/+8
2018-06-20Rename structures in astvarkor-13/+13
2018-06-20Refactor ast::GenericParam as a structvarkor-10/+17
2018-06-20Rename ast::GenericParam and ast::GenericArgvarkor-5/+5
It's so confusing to have everything having the same name, at least while refactoring.
2018-06-20Make method and variable names more consistentvarkor-6/+6
2018-06-20Rename "parameter" to "arg"varkor-11/+11
2018-06-20Rename *Parameter to *Paramvarkor-5/+5
2018-06-20Consolidate PathParameters and AngleBracketedParameterDatavarkor-19/+14
2018-06-14create multiple HIR items for a use statementQuietMisdreavus-2/+2
2018-05-22add `Span` information into `Qself`Niko Matsakis-0/+1
2018-05-16label-break-value: Parsing and AST/HIR changesest31-1/+1