about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-05-20Rollup merge of #60959 - petrochenkov:sassert, r=estebankMazdak Farrokhzad-7/+7
rustc: Improve type size assertions Now they - Tell what the new size is, when it changes - Do not require passing an identifier ``` ::: src\libsyntax\parse\token.rs:223:1 | 223 | static_assert_size!(Token, 123); | -------------------------------- in this macro invocation | = note: expected type `[(); 123]` found type `[(); 16]` ```
2019-05-20Rollup merge of #60823 - oli-obk:used_unused_no_mangle, r=michaelwoeristerMazdak Farrokhzad-1/+1
Fix incremental compilation of cdylib emitting spurious unused_attributes lint fixes #60050
2019-05-20Ban multi-trait objects via trait aliases.Alexander Regueiro-2/+2
2019-05-20Remove `Symbol::gensym()`.Nicholas Nethercote-15/+18
2019-05-20Eliminate `Symbol::gensymed`.Nicholas Nethercote-9/+4
2019-05-20Move `is_gensymed` from `Symbol` to `Ident`.Nicholas Nethercote-5/+1
Note that the `is_gensymed` call on `primitive_types` is unnecessary because that table only contains the name of primitive types (e.g. `i32`) and never contains gensyms.
2019-05-19Improve type size assertionsVadim Petrochenkov-7/+7
Now they - Tell what the new size is, when it changes - Do not require passing an identifier
2019-05-18Auto merge of #60910 - nnethercote:avoid-some-unnecessary-interning, ↵bors-18/+22
r=petrochenkov Avoid some unnecessary interning r? @petrochenkov
2019-05-17Rollup merge of #60901 - estebank:str-str-str, r=CentrilManish Goregaokar-2/+1
Handle more string addition cases with appropriate suggestions
2019-05-17Avoid unnecessary interning in `Ident::from_str()` calls.Nicholas Nethercote-18/+22
A lot of these static symbols are pre-interned.
2019-05-16Fix binop spanEsteban Küber-2/+1
2019-05-16review commentsEsteban Küber-26/+22
2019-05-16Move some parser recovery methods to diagnosticsEsteban Küber-263/+271
2019-05-16Fix span for await macro callEsteban Küber-1/+1
2019-05-16Review commentsEsteban Küber-96/+68
- Change wording of suggestion - Move recovery logic to `diagnostics.rs` - Reduce ammount of code duplication
2019-05-16Simplify span usage for incorrect awaitEsteban Küber-3/+3
2019-05-16Split parser logic to its own methodEsteban Küber-87/+96
2019-05-16Parse alternative incorrect uses of await and recoverEsteban Küber-8/+105
2019-05-16Rollup merge of #60691 - topecongiro:await-macro-span, r=CentrilMazdak Farrokhzad-0/+1
Include expression to wait for to the span of Await Currently the span of `await!` only includes itself: ```rust await!(3); // ^^^^^ ``` This PR changes it so that the span holds the whole `await!` expression: ```rust await!(3); // ^^^^^^^^^
2019-05-16Auto merge of #60763 - matklad:tt-parser, r=petrochenkovbors-43/+62
Move token tree related lexer state to a separate struct Just a types-based refactoring. We only used a bunch of fields when tokenizing into a token tree, so let's move them out of the base lexer
2019-05-14Fix incremental compilation of cdylib emitting spurious unused_attributes lintOliver Scherer-1/+1
2019-05-13add impl_trait_in_bindings to INCOMPLETE_FEATURESPulkit Goyal-0/+1
impl_trait_in_bindings is not yet complete and can lead to compiler crashes. Fixes #60764.
2019-05-13move raw span to tt readerAleksey Kladov-1/+2
See https://github.com/rust-lang/rust/pull/50838/files#r283296243 for explanation how jointness checking works with *next* pair
2019-05-13move span and token to tt readerAleksey Kladov-40/+35
2019-05-13Move token tree related lexer state to a separate structAleksey Kladov-48/+71
We only used a bunch of fields when tokenizing into a token tree, so let's move them out of the base lexer
2019-05-13Auto merge of #60630 - nnethercote:use-Symbol-more, r=petrochenkovbors-397/+394
Use `Symbol` more A `Symbol` can be equated with a string (e.g. `&str`). This involves a TLS lookup to get the chars (and a Mutex lock in a parallel compiler) and then a char-by-char comparison. This functionality is convenient but avoids one of the main benefits of `Symbol`s, which is fast equality comparisons. This PR removes the `Symbol`/string equality operations, forcing a lot of existing string occurrences to become `Symbol`s. Fortunately, these are almost all static strings (many are attribute names) and we can add static `Symbol`s as necessary, and very little extra interning occurs. The benefits are (a) a slight speedup (possibly greater in a parallel compiler), and (b) the code is a lot more principled about `Symbol` use. The main downside is verbosity, particularly with more `use syntax::symbol::symbols` items. r? @Zoxc
2019-05-13Return a `Symbol` from `name_or_empty` functions.Nicholas Nethercote-52/+49
2019-05-13Remove the equality operation between `Symbol` and strings.Nicholas Nethercote-53/+58
And also the equality between `Path` and strings, because `Path` is made up of `Symbol`s.
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-166/+161
2019-05-13Rename `syntax::symbol::symbols` as `syntax::symbol::sym`.Nicholas Nethercote-132/+132
Because it's going to be used a lot.
2019-05-12Auto merge of #60767 - Centril:rollup-4cbsb73, r=Centrilbors-75/+42
Rollup of 4 pull requests Successful merges: - #60694 (Fix HIR printing of existential type #60662) - #60750 (syntax: Remove some legacy nonterminal tokens) - #60751 (Assorted cleanup in parser & AST validation) - #60752 (Fix minor typos for ItemLocalId) Failed merges: r? @ghost
2019-05-12Rollup merge of #60751 - Centril:general-cleanup, r=petrochenkovMazdak Farrokhzad-49/+38
Assorted cleanup in parser & AST validation r? @petrochenkov Extracted out of a larger PR.
2019-05-12Minor cleanup in parse_assoc_expr_with.Mazdak Farrokhzad-24/+14
2019-05-12parse_bottom_expr: extract common 'return' out.Mazdak Farrokhzad-6/+5
2019-05-12syntax::parse::parser: convert unnecessary '&mut self's to '&self'.Mazdak Farrokhzad-19/+19
2019-05-12syntax: Remove some legacy nonterminal tokensVadim Petrochenkov-26/+4
2019-05-11Address comments + Fix testsVadim Petrochenkov-4/+9
2019-05-11Move literal parsing code into a separate fileVadim Petrochenkov-521/+505
Remove some dead code
2019-05-11Simplify conversions between tokens and semantic literalsVadim Petrochenkov-248/+241
2019-05-11Eliminate `comments::Literal`Vadim Petrochenkov-160/+44
2019-05-11Introduce `hir::Lit` not keeping the original tokenVadim Petrochenkov-1/+1
2019-05-11Keep the original token in `ast::Lit`Vadim Petrochenkov-42/+66
2019-05-11Turn `ast::Lit` into a structVadim Petrochenkov-16/+19
2019-05-10turn a couple of fixmes into span_bugsMark Mansi-9/+7
2019-05-10Include expression to wait for to the span of Awaittopecongiro-0/+1
2019-05-09Rollup merge of #60676 - davidtwco:issue-60674, r=cramertjMazdak Farrokhzad-10/+38
Fix async desugaring providing wrong input to procedural macros. Fixes #60674. This PR fixes a minor oversight introduced by #60535 where unused `mut` binding modes were removed from the arguments to an `async fn` (as they were added to the statement that we insert into the closure body). However, this meant that the input to procedural macros was incorrect. This removes that and instead fixes the `unused_mut` error that it avoided. r? @cramertj cc @taiki-e
2019-05-09Rollup merge of #60618 - mark-i-m:transcribe, r=petrochenkovMazdak Farrokhzad-69/+194
Comment ext::tt::transcribe Also did a bit of minor cleanup (remove unidiomatic use of `Add` and an unneeded `clone`). No functionality changes. r? @petrochenkov
2019-05-09Rollup merge of #60188 - estebank:recover-block, r=varkorMazdak Farrokhzad-7/+101
Identify when a stmt could have been parsed as an expr There are some expressions that can be parsed as a statement without a trailing semicolon depending on the context, which can lead to confusing errors due to the same looking code being accepted in some places and not others. Identify these cases and suggest enclosing in parenthesis making the parse non-ambiguous without changing the accepted grammar. Fix #54186, cc #54482, fix #59975, fix #47287.
2019-05-09Add FIXME about `construct_async_arguments`.David Wood-0/+4
This is unrelated to the rest of this PR but it made sense to add a FIXME explaining that the function shouldn't really be in the parser.
2019-05-09Do not modify mutability of simple bindings.David Wood-10/+34
This commit removes the modification of the mutability of simple bindings. While the mutability isn't used, it is important that it is kept so that the input to procedural macros matches what the user wrote. This commit also modifies the span of the binding mode so that it is considered a compiler desugaring and won't be linted against for being unused..