about summary refs log tree commit diff
path: root/src/libsyntax/ext/build.rs
AgeCommit message (Collapse)AuthorLines
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
2018-04-26rustc_target: move in syntax::abi and flip dependency.Irina Popa-1/+1
2018-04-18Auto merge of #49993 - nnethercote:shrink-Token, r=alexcrichtonbors-0/+5
Change the hashcounts in raw `Lit` variants from usize to u16. This reduces the size of `Token` from 32 bytes to 24 bytes on 64-bit platforms.
2018-04-12Avoid comparing fields by name when possibleVadim Petrochenkov-2/+2
Resolve them into field indices once and then use those resolutions + Fix rebase
2018-04-12AST/HIR: Merge field access expressions for named and numeric fieldsVadim Petrochenkov-2/+2
2018-04-12Change the hashcounts in raw `Lit` variants from usize to u16.Nicholas Nethercote-0/+5
This reduces the size of `Token` from 32 bytes to 24 bytes on 64-bit platforms.
2018-04-06Use `Ident` instead of `Name` in `MetaItem`Vadim Petrochenkov-4/+5
2018-04-06Remove more duplicated spansVadim Petrochenkov-8/+10
2018-04-06Rename `ast::Variant_::name` into `ident` + Fix rebaseVadim Petrochenkov-2/+2
2018-04-06Get rid of `SpannedIdent`Vadim Petrochenkov-14/+9
2018-04-06Rename `PathSegment::identifier` to `ident`Vadim Petrochenkov-3/+3
2018-03-22Use FunctionRetTy::Default rather than an explicit TyKind::Infer for ↵varkor-5/+5
lambda-building This prevents explicit `-> _` return type annotations for closures generated by `lambda`.
2018-03-17Rename `Span::empty` to `Span::shrink_to_lo`, add `Span::shrink_to_hi`Vadim Petrochenkov-2/+2
2018-03-17AST: Keep distinction between `path` and `::path` in imports and visibilitiesVadim Petrochenkov-3/+7
Add the root segment for name resolution purposes only