about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-05-31Remove GlobalArenas and use Arena insteadJohn Kåre Alsaker-3/+3
2019-05-30Move code from `parser` to `diagnostics`Esteban Küber-36/+40
2019-05-30Remove `ArgSource::Recovery`Esteban Küber-6/+4
2019-05-30Recover gracefully from argument with missing type or param nameEsteban Küber-18/+59
2019-05-31Parse 'async unsafe fn' instead of 'unsafe async fn'.Mazdak Farrokhzad-37/+34
2019-05-30Explicitly suggest 'type_ascription' featureJanusz Marcinkiewicz-2/+2
2019-05-30Auto merge of #61253 - nnethercote:avoid-hygiene_data-lookups, r=petrochenkovbors-3/+3
Avoid `hygiene_data` lookups These commits mostly introduce compound operations that allow two close adjacent `hygiene_data` lookups to be combined. r? @petrochenkov
2019-05-29libsyntax: introduce 'fn is_keyword_ahead(dist, keywords)'.Mazdak Farrokhzad-35/+38
2019-05-29Introduce and use `SyntaxContext::outer_expn_info()`.Nicholas Nethercote-3/+3
It reduces two `hygiene_data` accesses to one on some hot paths.
2019-05-29syntax: bail out of `find_width_of_character_at_span` if the span doesn't ↵Eduard-Mihai Burtescu-0/+5
start and end in the same file.
2019-05-27Auto merge of #61140 - estebank:attr-diagnostics, r=michaelwoeristerbors-12/+74
Reword malformed attribute input diagnostics - Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error - Use consistend error message: "malformed `attrname` attribute input" - Provide suggestions when possible - Move note/help to label/suggestion - Use consistent wording "ill-formed" -> "malformed" - Move diagnostic logic out of parser Split up from https://github.com/rust-lang/rust/pull/61026, where there's prior conversation.
2019-05-27Auto merge of #60967 - Zoxc:fix-syntax-sync, r=michaelwoeristerbors-0/+22
Short circuit Send and Sync impls for TokenTree Workaround to make the parallel compiler build after https://github.com/rust-lang/rust/pull/60444. r? @nikomatsakis
2019-05-27Short circuit Send and Sync impls for TokenTreeJohn Kåre Alsaker-0/+22
2019-05-27Stabilize repr_align_enum in 1.37.0.Mazdak Farrokhzad-14/+3
2019-05-27Use `Symbol` equality in `may_begin_with` and `parse_nt`.Nicholas Nethercote-27/+27
2019-05-27Use `Symbol` equality in `is_ident_named`.Nicholas Nethercote-8/+8
2019-05-27Avoid some re-interning in `to_lit_token`.Nicholas Nethercote-5/+8
2019-05-27Add `to_symbol` methods.Nicholas Nethercote-4/+26
2019-05-27Pre-intern "0", "1", ..., "9", and use where appropriate.Nicholas Nethercote-3/+3
2019-05-27Pass symbols to `ExtCtxt::std_path` instead of strings.Nicholas Nethercote-26/+16
Because this function is hot. Also remove the dead `ty_option` function.
2019-05-27Avoid unnecessary internings.Nicholas Nethercote-20/+11
Most involving `Symbol::intern` on string literals.
2019-05-25review comments: move back some methods and clean up wordingEsteban Küber-172/+176
2019-05-25Move some methods to `diagnostics.rs` away from `parser.rs`Esteban Küber-413/+462
Move a bunch of error recovery methods to `diagnostics.rs` away from `parser.rs`.
2019-05-25Tweak `self` arg not as first argument of a method diagnosticEsteban Küber-37/+55
Mention that `self` is only valid on "associated functions" ``` error: unexpected `self` argument in function --> $DIR/self-in-function-arg.rs:1:15 | LL | fn foo(x:i32, self: i32) -> i32 { self } | ^^^^ not valid as function argument | = note: `self` is only valid as the first argument of an associated function ``` When it is a method, mention it must be first ``` error: unexpected `self` argument in function --> $DIR/trait-fn.rs:4:20 | LL | fn c(foo: u32, self) {} | ^^^^ must be the first associated function argument ```
2019-05-25Reword malformed attribute input diagnosticsEsteban Küber-12/+74
- Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error - Use consistend error message: "malformed `attrname` attribute input" - Provide suggestions when possible - Move note/help to label/suggestion - Use consistent wording "ill-formed" -> "malformed" - Move diagnostic logic out of parser
2019-05-24Revert changes that belong to separate PREsteban Küber-18/+4
2019-05-24Move diagnostic logic out of parserEsteban Küber-19/+20
2019-05-24Fix rebaseEsteban Küber-4/+6
2019-05-24review commentsEsteban Küber-63/+70
2019-05-24Tweak macro parse errors when reaching EOF during macro call parseEsteban Küber-44/+105
- Add detail on origin of current parser when reaching EOF and stop saying "found <eof>" and point at the end of macro calls - Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error
2019-05-24Auto merge of #60803 - varkor:remove-in-place-syntax, r=petrochenkovbors-47/+4
Remove `ObsoleteInPlace` The in place syntax has been deprecated for over a year. As it is, this is accumulated cruft: the error messages are unlikely to be helpful any more and it conflicts with some useful syntax (e.g. const generics in some instances). It may be that removing `Token::LArrow` is backwards-incompatible. We should do a crater run to check. cc @eddyb
2019-05-24Auto merge of #60984 - matthewjasper:borrowck-error-reporting-cleanup, ↵bors-4/+5
r=pnkfelix Borrowck error reporting cleanup * Don't show variables created by desugarings in borrowck errors * Move "conflict error" reporting to it's own module, so that `error_reporting` contains only common error reporting methods. * Remove unused `ScopeTree` parameter. r? @pnkfelix
2019-05-24Remove `ObsoleteInPlace`varkor-47/+4
2019-05-24Rollup merge of #61056 - euclio:custom-discriminant-error, r=estebankMazdak Farrokhzad-16/+45
tweak discriminant on non-nullary enum diagnostic Adds notes pointing at the non-nullary variants, and uses "custom discriminant" language to be consistent with the Reference. Fixes #61039. r? @estebank
2019-05-23tweak discriminant on non-nullary enum diagnosticAndy Russell-16/+45
Adds notes pointing at the non-nullary variants, and uses "custom discriminant" language to be consistent with the Reference.
2019-05-23Auto merge of #60965 - petrochenkov:lit3, r=matkladbors-441/+435
syntax: Continue refactoring literals A follow up to https://github.com/rust-lang/rust/pull/60679. https://github.com/rust-lang/rust/commit/a2fd002bd5a91ba7997057724b72b9dac8fae550: Similarly to `EscapeError`, literal parsing now produces a `LitError`. This way we can get rid of `diag: Option<(Span, &Handler)>` in interfaces while leaving attr/mod alone. https://github.com/rust-lang/rust/commit/d9516d11208456d4a17fe68a34c1d0a00334e62c: Gathers all components of a literal token in a single struct.
2019-05-23syntax: Some code cleanupVadim Petrochenkov-212/+157
2019-05-23syntax: Turn `token::Lit` into a structVadim Petrochenkov-197/+216
2019-05-23syntax: Remove an obsolete hack from literal comparisonsVadim Petrochenkov-9/+1
2019-05-23syntax: Fix spans for boolean literals passed to proc macrosVadim Petrochenkov-5/+5
2019-05-23syntax: More consistent wording for some literal parsing errorsVadim Petrochenkov-2/+2
2019-05-23syntax: Return named errors from literal parsing functionsVadim Petrochenkov-128/+166
2019-05-23Auto merge of #61075 - Centril:rollup-1ugmcqu, r=Centrilbors-10/+14
Rollup of 7 pull requests Successful merges: - #60981 (Bump compiler-builtins to 0.1.15) - #61014 (Make -Zemit-artifact-notifications also emit the artifact type) - #61043 (Disable LLVM/debug assertions in gnu-full-bootstrap) - #61046 (Fix ICE with inconsistent macro matchers) - #61055 (Solaris CI: Build with dilos2 stable) - #61057 (Revert "Add implementations of last in terms of next_back on a bunch of DoubleEndedIterators.") - #61073 (librustc_errors: Remove unused annotation style `OldSchoolNoteText`) Failed merges: r? @ghost
2019-05-23Rollup merge of #61046 - mark-i-m:transcribe-fix, r=petrochenkovMazdak Farrokhzad-8/+10
Fix ICE with inconsistent macro matchers Fixes #61033 r? @petrochenkov
2019-05-23Rollup merge of #61014 - jsgf:emit-artifact-type, r=alexcrichtonMazdak Farrokhzad-2/+4
Make -Zemit-artifact-notifications also emit the artifact type This is easier for tooling to handle than trying to reverse-engineer the type from the filename extension. The field name and value is intended to reflect the `--emit` command-line option. Related issues https://github.com/rust-lang/rust/issues/60988 https://github.com/rust-lang/rust/issues/58465 cc @alexcrichton
2019-05-23Auto merge of #60174 - matthewjasper:add-match-arm-scopes, r=pnkfelixbors-2/+12
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-23Auto merge of #60740 - petrochenkov:kw, r=nnethercotebors-316/+314
Simplify use of keyword symbols They mirror non-keyword symbols now (see https://github.com/rust-lang/rust/pull/60630). `keywords::MyKeyword.name()` -> `kw::MyKeyword` `keywords::MyKeyword.ident()` -> `Ident::with_empty_ctxt(kw::MyKeyword)` (not common) `keywords::Invalid.ident()` -> `Ident::invalid()` (more common) Keywords are simply `Symbol` constants now, the `Keyword` struct is eliminated. This means `kw::MyKeyword` can now be used in `match` in particular.
2019-05-22Restore the old behavior of the rustdoc keyword check + Fix rebaseVadim Petrochenkov-19/+18
2019-05-22Eliminate unnecessary `Ident::with_empty_ctxt`sVadim Petrochenkov-22/+18
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-299/+302