summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2017-03-19Auto merge of #40346 - jseyfried:path_and_tokenstream_attr, r=nrcbors-350/+691
`TokenStream`-based attributes, paths in attribute and derive macro invocations This PR - refactors `Attribute` to use `Path` and `TokenStream` instead of `MetaItem`. - supports macro invocation paths for attribute procedural macros. - e.g. `#[::foo::attr_macro] struct S;`, `#[cfg_attr(all(), foo::attr_macro)] struct S;` - supports macro invocation paths for derive procedural macros. - e.g. `#[derive(foo::Bar, super::Baz)] struct S;` - supports arbitrary tokens as arguments to attribute procedural macros. - e.g. `#[foo::attr_macro arbitrary + tokens] struct S;` - supports using arbitrary tokens in "inert attributes" with derive procedural macros. - e.g. `#[derive(Foo)] struct S(#[inert arbitrary + tokens] i32);` where `#[proc_macro_derive(Foo, attributes(inert))]` r? @nrc
2017-03-18Parse 0e+10 as a valid floating-point literaltopecongiro-1/+1
Fixes issue #40408.
2017-03-15Stabilize pub(restricted)Taylor Cramer-14/+3
2017-03-15Improve the `TokenStream` quoter.Jeffrey Seyfried-0/+6
2017-03-14Point out correct turbofish usage on `Foo<Bar<Baz>>`Esteban Küber-1/+4
Whenever we parse a chain of binary operations, as long as the first operation is `<` and the subsequent operations are either `>` or `<`, present the following diagnostic help: use `::<...>` instead of `<...>` if you meant to specify type arguments This will lead to spurious recommendations on situations like `2 < 3 < 4` but should be clear from context that the help doesn't apply in that case.
2017-03-14Add feature toggle for rvalue-static-promotion RFCTobias Schottdorf-0/+3
See https://github.com/rust-lang/rfcs/pull/1414. Updates #38865.
2017-03-14Auto merge of #39921 - cramertj:add-catch-to-ast, r=nikomatsakisbors-1/+47
Add catch {} to AST Part of #39849. Builds on #39864.
2017-03-14Liberalize attributes.Jeffrey Seyfried-120/+187
2017-03-14Refactor `Attribute` to use `Path` and `TokenStream` instead of `MetaItem`.Jeffrey Seyfried-229/+504
2017-03-14Cleanup.Jeffrey Seyfried-12/+11
2017-03-12Rollup merge of #40369 - petrochenkov:segspan, r=eddybCorey Farwell-35/+52
Give spans to individual path segments in AST And use these spans in path resolution diagnostics. The spans are spans of identifiers in segments, not whole segments. I'm not sure what spans are more useful in general, but identifier spans are a better fit for resolve errors. HIR still doesn't have spans. Fixes https://github.com/rust-lang/rust/pull/38927#discussion_r95336667 https://github.com/rust-lang/rust/pull/38890#issuecomment-271731008 r? @nrc @eddyb
2017-03-12Auto merge of #40340 - petrochenkov:restricted, r=nikomatsakisbors-32/+40
Update syntax for `pub(restricted)` Update the syntax before stabilization. cc https://github.com/rust-lang/rust/issues/32409 r? @nikomatsakis
2017-03-11Temporarily prefix catch block with do keywordTaylor Cramer-14/+7
2017-03-11Add catch expr to AST and disallow catch as a struct nameTaylor Cramer-1/+54
2017-03-11Auto merge of #40220 - jseyfried:ast_macro_def, r=nrcbors-156/+89
syntax: add `ast::ItemKind::MacroDef`, simplify hygiene info This PR - adds a new variant `MacroDef` to `ast::ItemKind` for `macro_rules!` and eventually `macro` items, - [breaking-change] forbids macro defs without a name (`macro_rules! { () => {} }` compiles today), - removes `ast::MacroDef`, and - no longer uses `Mark` and `Invocation` to identify and characterize macro definitions. - We used to apply (at least) two `Mark`s to an expanded identifier's `SyntaxContext` -- the definition mark(s) and the expansion mark(s). We now only apply the latter. r? @nrc
2017-03-10Give spans to individual path segments in ASTVadim Petrochenkov-35/+52
2017-03-10Update syntax for `pub(restricted)`Vadim Petrochenkov-32/+40
2017-03-10Expect macro defs in save-analysis and add expn info to spans for attr proc ↵Nick Cameron-1/+13
macros
2017-03-10Avoid using `Mark` and `Invocation` for macro defs.Jeffrey Seyfried-23/+10
2017-03-10Move `resolve_invoc` from `syntax` to `resolve`.Jeffrey Seyfried-63/+11
2017-03-10Refactor out `ast::ItemKind::MacroDef`.Jeffrey Seyfried-81/+79
2017-03-08Rollup merge of #40258 - est31:master, r=nikomatsakisAriel Ben-Yehuda-2/+1
Fix description of closure coercion feature Thanks to @whitequark for pointing this out.
2017-03-04Inline function to avoid naming confusion.Mark Simulacrum-8/+6
2017-03-04Fix description of closure coercion featureest31-2/+1
2017-03-03Fix fallout in unit tests.Jeffrey Seyfried-44/+36
2017-03-03Fix `token::Eof` spans.Jeffrey Seyfried-2/+6
2017-03-03Integrate `TokenStream`.Jeffrey Seyfried-275/+247
2017-03-03Introduce `syntax::parse::parser::TokenCursor`.Jeffrey Seyfried-115/+173
2017-03-03Optimize `syntax::tokenstream::Cursor`.Jeffrey Seyfried-57/+59
2017-03-03Remove lifetime parameter from `syntax::tokenstream::Cursor`.Jeffrey Seyfried-28/+34
2017-03-02Auto merge of #40216 - frewsxcv:rollup, r=frewsxcvbors-7/+33
Rollup of 7 pull requests - Successful merges: #39832, #40104, #40110, #40117, #40129, #40139, #40166 - Failed merges:
2017-03-02Rollup merge of #40129 - abonander:proc_macro_bang, r=jseyfriedCorey Farwell-0/+5
Implement function-like procedural macros ( `#[proc_macro]`) Adds the `#[proc_macro]` attribute, which expects bare functions of the kind `fn(TokenStream) -> TokenStream`, which can be invoked like `my_macro!()`. cc rust-lang/rfcs#1913, #38356 r? @jseyfried cc @nrc
2017-03-02Rollup merge of #40110 - benschreiber:nostackcheck, r=brsonCorey Farwell-7/+19
Made no_stack_check a stable_removed attribute r? @brson
2017-03-02Add support for x86-interrupt calling conventionPhilipp Oppermann-0/+9
Tracking issue: https://github.com/rust-lang/rust/issues/40180 This calling convention can be used for definining interrupt handlers on 32-bit and 64-bit x86 targets. The compiler then uses `iret` instead of `ret` for returning and ensures that all registers are restored to their original values. Usage: ``` extern "x86-interrupt" fn handler(stack_frame: &ExceptionStackFrame) {…} ``` for interrupts and exceptions without error code and ``` extern "x86-interrupt" fn page_fault_handler(stack_frame: &ExceptionStackFrame, error_code: u64) {…} ``` for exceptions that push an error code (e.g., page faults or general protection faults). The programmer must ensure that the correct version is used for each interrupt. For more details see the [LLVM PR][1] and the corresponding [proposal][2]. [1]: https://reviews.llvm.org/D15567 [2]: http://lists.llvm.org/pipermail/cfe-dev/2015-September/045171.html
2017-03-02Auto merge of #39655 - durka:recursion-limit-suggestion, r=nikomatsakisbors-4/+10
suggest doubling recursion limit in more situations Fixes #38852. r? @bluss
2017-03-02note -> helpAlex Burka-1/+1
2017-02-28Implement function-like procedural macros ( `#[proc_macro]`)Austin Bonander-0/+5
2017-02-28Add warning cycle.Jeffrey Seyfried-11/+31
2017-02-28Refactor out `parser.expect_delimited_token_tree()`.Jeffrey Seyfried-36/+13
2017-02-28Merge `repeat_idx` and `repeat_len`.Jeffrey Seyfried-17/+15
2017-02-28Remove `Token::MatchNt`.Jeffrey Seyfried-73/+78
2017-02-28Add `syntax::ext::tt::quoted::{TokenTree, ..}` and remove ↵Jeffrey Seyfried-426/+380
`tokenstream::TokenTree::Sequence`.
2017-02-28Avoid `Token::{OpenDelim, CloseDelim}`.Jeffrey Seyfried-17/+23
2017-02-28Remove `ext::tt::transcribe::tt_next_token`.Jeffrey Seyfried-149/+124
2017-02-28Clean up `ext::tt::transcribe::TtFrame`, rename to `Frame`.Jeffrey Seyfried-61/+88
2017-02-28Remove a `loop` in `ext::tt::transcribe`.Jeffrey Seyfried-32/+23
2017-02-28rustc_save_analysis: don't pollute the codemap with fake files.Eduard Burtescu-8/+38
2017-02-25removed unneeded comment blocksBen Schreiber-5/+0
2017-02-25teach rustc about remove_stable_features and removed no-stack-chech feature. ↵Ben Schreiber-7/+24
fixes #34915
2017-02-25rustc_typeck: hook up collect and item/body check to on-demand.Eduard-Mihai Burtescu-23/+0