about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-07-08Auto merge of #51955 - zackmdavis:item_semi, r=oli-obkbors-0/+16
clarify why we're suggesting removing semicolon after braced items Previously (issue #46186, pull-request #46258), a suggestion was added to remove the semicolon after we fail to parse an item, but issue #51603 complains that it's still insufficiently obvious why. Let's add a note. Resolves #51603.
2018-07-06Auto merge of #52018 - flip1995:rfc2103, r=oli-obkbors-0/+15
Implementation of tool lints. Tracking issue: #44690
2018-07-05rustc: Update tracking issue for wasm_import_moduleAlex Crichton-1/+1
It's now https://github.com/rust-lang/rust/issues/52090
2018-07-04Improving span of unknown lint tool error messageflip1995-6/+8
2018-07-04Implementation of tool lintsflip1995-0/+13
2018-07-03Rollup merge of #51958 - euclio:attr-refactor, r=petrochenkovPietro Albini-678/+740
Show known meta items in unknown meta items error This PR adds a label to E0541. It also factors built-in attribute parsing into a submodule of `attr` for ease of future refactoring. Fixes #51469.
2018-07-02Auto merge of #51866 - zackmdavis:hir_making_each_day_of_the_year, ↵bors-1/+4
r=petrochenkov add modifier keyword spans to hir::Visibility; improve unreachable-pub, private-no-mangle lint suggestions #50455 pointed out that the unreachable-pub suggestion for brace-grouped `use`s was bogus; #50476 partially ameliorated this by marking the suggestion as `Applicability::MaybeIncorrect`, but this is the actual fix. Meanwhile, another application of having spans available in `hir::Visibility` is found in the private-no-mangle lints, where we can now issue a suggestion to use `pub` if the item has a more restricted visibility marker (this seems much less likely to come up in practice than not having any visibility keyword at all, but thoroughness is a virtue). While we're there, we can also add a helpful note if the item does have a `pub` (but triggered the lint presumably because enclosing modules were private). ![hir_vis](https://user-images.githubusercontent.com/1076988/42018064-ca830290-7a65-11e8-9c4c-48bc846f861f.png) r? @nrc cc @Manishearth
2018-07-01Auto merge of #51883 - estebank:placement-suggestion, r=varkorbors-0/+10
Suggest correct comparison against negative literal When parsing as emplacement syntax (`x<-1`), suggest the correct syntax for comparison against a negative value (`x< -1`). Fix #45651.
2018-06-30choose a less arbitrary span when parsing the empty visibility modifierZack M. Davis-1/+4
Visibility spans were added to the AST in #47799 (d6bdf296) as a `Spanned<_>`—which means that we need to choose a span even in the case of inherited visibility (what you get when there's no `pub` &c. keyword at all). That initial implementation's choice is pretty counterintuitive, which could matter if we want to use it as a site to suggest inserting a visibility modifier, &c. (The phrase "Schelling span" in the comment is meant in analogy to the game-theoretic concept of a "Schelling point", a value that is chosen simply because it's what one can expect to agree upon with other agents in the absence of explicit coördination.)
2018-06-30add label to unknown meta item errorAndy Russell-11/+33
2018-06-30factor built-in attribute parsing into submoduleAndy Russell-678/+718
2018-06-30clarify why we're suggesting removing semicolon after braced itemsZack M. Davis-0/+16
Previously (issue #46186, pull-request #46258), a suggestion was added to remove the semicolon after we fail to parse an item, but issue #51603 complains that it's still insufficiently obvious why. Let's add a note. Resolves #51603.
2018-06-30Auto merge of #51762 - petrochenkov:oh-hi-mark, r=oli-obkbors-39/+56
hygiene: Implement transparent marks and use them for call-site hygiene in proc-macros Fixes https://github.com/rust-lang/rust/issues/50050
2018-06-30Auto merge of #51806 - oli-obk:lowering_cleanups1, r=cramertjbors-25/+54
Lowering cleanups [1/N]
2018-06-30Fortify dummy span checkingVadim Petrochenkov-19/+19
2018-06-30hygiene: Implement transparent marksVadim Petrochenkov-1/+12
2018-06-30expansion: Give names to some fields of `SyntaxExtension`Vadim Petrochenkov-20/+26
2018-06-28Suggest correct comparison against negative literalEsteban Küber-0/+10
When parsing as emplacement syntax (`x<-1`), suggest the correct syntax for comparison against a negative value (`x< -1`).
2018-06-28Auto merge of #50997 - michaelwoerister:pre-analyze-filemaps, r=Mark-Simulacrumbors-126/+47
Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable. This PR removes most of the interior mutability from `FileMap`, which should be beneficial, especially in a multithreaded setting. This is achieved by initializing the state in question when the filemap is constructed instead of during lexing. Hopefully this doesn't degrade performance. cc @wesleywiser
2018-06-28Fix FileMap::line_begin_pos().Michael Woerister-2/+4
The method relied on the FileMap still being under construction in order for it to do what the name promises. It's now independent of the current state.
2018-06-28Use `Ident`s in a number of structures in HIRVadim Petrochenkov-1/+1
Namely: labels, type parameters, bindings in patterns, parameter names in functions without body. All of these do not need hygiene after lowering to HIR, only span locations.
2018-06-28Rollup merge of #51799 - mark-i-m:lower_case_feature_gate, r=mark-i-mkennytm-4/+4
Lower case some feature gate error messages
2018-06-27syntax_pos: Store multibyte char size as u8 instead of u32.Michael Woerister-2/+2
2018-06-27Use u32 instead of usize of encoding byte count of multi-byte chars.Michael Woerister-3/+3
2018-06-27Update CodeMap tests after changing FileMap construction.Michael Woerister-61/+10
2018-06-27Remove the now redundant CodeMap::new_filemap_with_lines() method.Michael Woerister-17/+13
2018-06-27Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable.Michael Woerister-43/+17
2018-06-27Implement `#[macro_export(local_inner_macros)]`Vadim Petrochenkov-1/+22
2018-06-27Add a convenience method for getting the impl Trait `NodeId` of an `IsAysnc`Oliver Schneider-0/+7
2018-06-27Generate `DefId`s for the impl trait of `async` functionsOliver Schneider-19/+37
2018-06-27Generate the `NodeId` for `existential type` in the ASTOliver Schneider-6/+10
2018-06-26lower case some feature gate messagesmark-4/+4
2018-06-26inclusive range syntax lint (`...` → `..=`)Zack M. Davis-18/+28
Our implementation ends up changing the `PatKind::Range` variant in the AST to take a `Spanned<RangeEnd>` instead of just a `RangeEnd`, because the alternative would be to try to infer the span of the range operator from the spans of the start and end subexpressions, which is both hideous and nontrivial to get right (whereas getting the change to the AST right was a simple game of type tennis). This is concerning #51043.
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-4/+4
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-06-26Auto merge of #49469 - Nokel81:allow-irrefutable-let-patterns, r=nikomatsakisbors-0/+3
Implementation of RFC 2086 - Allow Irrefutable Let patterns This is the set of changes for RFC2086. Tracking issue #44495. Rendered [here](https://github.com/rust-lang/rfcs/pull/2086)
2018-06-23structured suggestion and rewording for `...` expression syntax errorZack M. Davis-6/+8
Now that `..=` inclusive ranges are stabilized, people probably shouldn't be using `...` even in patterns, even if it's still legal there (see #51043). To avoid drawing attention to `...` being a real thing, let's reword this message to just say "unexpected token" rather "cannot be used in expressions".
2018-06-23hygiene: Merge `NameAndSpan` into `ExpnInfo`Vadim Petrochenkov-67/+51
2018-06-23hygiene: Do not reset expansion info for `quote!`Vadim Petrochenkov-3/+7
2018-06-23expansion: Add some commentsVadim Petrochenkov-2/+14
2018-06-23expansion: Improve searchability for `AstFragments` methodsVadim Petrochenkov-48/+65
2018-06-23expansion: Rename `Expansion` to `AstFragment`Vadim Petrochenkov-186/+198
2018-06-23hygiene: Rename `MarkKind` to `Transparency`Vadim Petrochenkov-2/+2
Move `is_builtin` for `Mark` to a separate flag
2018-06-23expansion: Remove unnecessary override from `impl Folder for Marker`Vadim Petrochenkov-5/+0
2018-06-23Auto merge of #51580 - cramertj:async-await, r=eddybbors-118/+330
async/await This PR implements `async`/`await` syntax for `async fn` in Rust 2015 and `async` closures and `async` blocks in Rust 2018 (tracking issue: https://github.com/rust-lang/rust/issues/50547). Limitations: non-`move` async closures with arguments are currently not supported, nor are `async fn` with multiple different input lifetimes. These limitations are not fundamental and will be removed in the future, however I'd like to go ahead and get this PR merged so we can start experimenting with this in combination with futures 0.3. Based on https://github.com/rust-lang/rust/pull/51414. cc @petrochenkov for parsing changes. r? @eddyb
2018-06-22Update libsyntax testTaylor Cramer-4/+14
2018-06-22Re-reexport some items that were recently made crate-private.Tim Kuehn-2/+2
2018-06-22Remove unused map_sliceTaylor Cramer-10/+0
2018-06-22Auto merge of #51704 - kennytm:rollup, r=kennytmbors-4/+4
Rollup of 6 pull requests Successful merges: - #51158 (Mention spec and indented blocks in doctest docs) - #51629 (Do not consume semicolon twice while parsing local statement) - #51637 (Update zx_cprng_draw_new on Fuchsia) - #51664 (make more libsyntax methods public) - #51666 (Disable probestack when GCOV profiling is being used) - #51703 (Recognize the extra "LLVM tools versions" argument to build-manifest.) Failed merges: r? @ghost
2018-06-22add an explanatory comment for recovery behaviorNiko Matsakis-0/+3
2018-06-22Issue #50974: Fix compilation error and testLamb-1/+1