about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-03-20Rollup merge of #48834 - ysiraichi:suggest-remove-ref, r=estebankkennytm-46/+50
Suggest removing `&`s This implements the error message discussed in #47744. We check whether removing each `&` yields a type that satisfies the requested obligation. Also, it was created a new `NodeId` field in `ObligationCause` in order to iterate through the `&`s. The way it's implemented now, it iterates through the obligation snippet and counts the number of `&`. r? @estebank
2018-03-19Stabilize termination_trait in 1.25, not 1.26Tyler Mandry-2/+2
2018-03-19Stabilize termination_traitTyler Mandry-3/+2
This stabilizes `main` with non-() return types; see #48453.
2018-03-19Split out termination_trait_test feature gateTyler Mandry-4/+7
2018-03-18CodeMap functions refactored.Yukio Siraichi-50/+38
- Using `span_take_while` to implement others.
2018-03-18Review fixes.Yukio Siraichi-0/+16
- `span_suggestion` changed to `span_suggestion_short`; - `Span` used changed to contain only `&` refs; - Tests passing.
2018-03-18Allow raw identifiers in diagnostic macros.Lymia Aluysia-5/+5
2018-03-18Return a is_raw parameter from Token::ident rather than having separate methods.Lymia Aluysia-34/+19
2018-03-18Move raw_identifiers check to the lexer.Lymia Aluysia-4/+5
2018-03-18Feature gate raw identifiers.Lymia Aluysia-1/+23
2018-03-18Initial implementation of RFC 2151, Raw IdentifiersLymia Aluysia-128/+215
2018-03-18Auto merge of #48985 - scalexm:lowering, r=nikomatsakisbors-0/+7
MVP for chalkification r? @nikomatsakis
2018-03-18Auto merge of #48917 - petrochenkov:import, r=oli-obkbors-169/+135
syntax: Make imports in AST closer to the source and cleanup their parsing This is a continuation of https://github.com/rust-lang/rust/pull/45846 in some sense.
2018-03-17Add some docs + Fix rebaseVadim Petrochenkov-1/+7
2018-03-17Cleanup import parsingVadim Petrochenkov-54/+23
Fix spans of root segments
2018-03-17Rename `Span::empty` to `Span::shrink_to_lo`, add `Span::shrink_to_hi`Vadim Petrochenkov-12/+12
2018-03-17AST: Keep distinction between `path` and `::path` in imports and visibilitiesVadim Petrochenkov-47/+41
Add the root segment for name resolution purposes only
2018-03-17AST: Make renames in imports closer to the sourceVadim Petrochenkov-26/+36
Fix `unused_import_braces` lint false positive on `use prefix::{self as rename}`
2018-03-17AST/HIR: Clarify what the optional name in extern crate items meanVadim Petrochenkov-30/+17
2018-03-17Reject `_` in `ident` matcherVadim Petrochenkov-17/+19
2018-03-17syntax: Make `_` an identifierVadim Petrochenkov-42/+28
2018-03-17remove FIXME(#8372) since for-loops wont support borrowing iteratorsNiv Kaminer-2/+0
2018-03-17remove FIXME(#2543) and avoid bad copiesNiv Kaminer-7/+14
2018-03-17improve attribute trailing semicolon errorcsmoe-10/+1
2018-03-17Auto merge of #48904 - Zoxc:code-and-file-maps, r=michaelwoeristerbors-41/+43
Make CodeMap and FileMap thread-safe r? @michaelwoerister
2018-03-16Replace many of the last references to readmesMark Mansi-4/+6
2018-03-16Auto merge of #48524 - abonander:check-macro-stability, r=petrochenkovbors-17/+56
check stability of macro invocations I haven't implemented tests yet but this should be a pretty solid prototype. I think as-implemented it will also stability-check macro invocations in the same crate, dunno if we want that or not. I don't know if we want this to go through `rustc::middle::stability` or not, considering the information there wouldn't be available at the time of macro expansion (even for external crates, right?). r? @nrc closes #34079 cc @petrochenkov @durka @jseyfried #38356
2018-03-16Auto merge of #49051 - kennytm:rollup, r=kennytmbors-10/+42
Rollup of 17 pull requests - Successful merges: #48706, #48875, #48892, #48922, #48957, #48959, #48961, #48965, #49007, #49024, #49042, #49050, #48853, #48990, #49037, #49049, #48972 - Failed merges:
2018-03-16Rollup merge of #48990 - ExpHP:dont-drop-the-bomb, r=estebankkennytm-2/+4
Fix ICE on malformed plugin attributes See #48941 for some discussion. This bug had several duplicate reports which were never closed as dupes: Fixes #47612 Fixes #48387 Fixes #48941 Fixes #48982
2018-03-16Rollup merge of #49007 - estebank:follow-up-47574, r=oli-obkkennytm-7/+15
Some tweaks to "type parameters from outer function" diagnostic Follow up to #47574.
2018-03-16Rollup merge of #48922 - petrochenkov:asunder, r=nikomatsakiskennytm-1/+23
Implement import renaming with `_` (RFC 2166) cc https://github.com/rust-lang/rust/issues/48216
2018-03-15Disallow &a..=b and box a..=b in pattern.kennytm-2/+27
They are disallowed because they have different precedence than expressions. I assume parenthesis in pattern will be soon stabilized and thus write that as suggestion directly.
2018-03-15Stabilize `dotdoteq_in_patterns` language feature.kennytm-8/+3
Stabilize `match 2 { 1..=3 => {} }`.
2018-03-15Stabilize `inclusive_range_syntax` language feature.kennytm-12/+2
Stabilize the syntax `a..=b` and `..=b`.
2018-03-14Auto merge of #47630 - canndrew:exhaustive-patterns, r=nikomatsakisbors-6/+2
Stabilise feature(never_type). Introduce feature(exhaustive_patterns) This stabilizes `!`, removing the feature gate as well as the old defaulting-to-`()` behavior. The pattern exhaustiveness checks which were covered by `feature(never_type)` have been moved behind a new `feature(exhaustive_patterns)` gate.
2018-03-15Use a single Lock for CodeMap.stable_id_to_filemap and CodeMap.filesJohn Kåre Alsaker-25/+32
2018-03-15Require the code mapper to be thread-safeJohn Kåre Alsaker-2/+2
2018-03-15Make CodeMap thread-safeJohn Kåre Alsaker-22/+17
2018-03-15Require a thread-safe file loaderJohn Kåre Alsaker-2/+2
2018-03-14Some tweaks to "type parameters from outer function" diagnosticEsteban Küber-7/+15
Follow up to #47574.
2018-03-14Add MVP for chalkificationscalexm-0/+7
2018-03-14Remove syntax and syntax_pos thread localsJohn Kåre Alsaker-521/+643
2018-03-14Implement import renaming with `_` (RFC 2166)Vadim Petrochenkov-1/+23
2018-03-14stabilise feature(never_type)Andrew Cann-6/+2
Replace feature(never_type) with feature(exhaustive_patterns). feature(exhaustive_patterns) only covers the pattern-exhaustives checks that used to be covered by feature(never_type)
2018-03-13Fix ICE on malformed plugin attributesMichael Lamparski-2/+4
2018-03-11in which some labels and notes are upgraded to structured suggestionsZack M. Davis-5/+8
(Meanwhile, a couple of parse-fail tests are moved to UI tests so that the reader can see the new output, and an existing UI test is given a more evocative name.)
2018-03-10Auto merge of #47574 - zilbuz:issue-14844, r=nikomatsakisbors-3/+63
Show the used type variable when issuing a "can't use type parameters from outer function" error message Fix #14844 r? @estebank
2018-03-09Auto merge of #48326 - RalfJung:generic-bounds, r=petrochenkovbors-12/+22
Warn about ignored generic bounds in `for` This adds a new lint to fix #42181. For consistency and to avoid code duplication, I also moved the existing "bounds in type aliases are ignored" here. Questions to the reviewer: * Is it okay to just remove a diagnostic error code like this? Should I instead keep the warning about type aliases where it is? The old code provided a detailed explanation of what's going on when asked, that information is now lost. On the other hand, `span_warn!` seems deprecated (after this patch, it has exactly one user left!). * Did I miss any syntactic construct that can appear as `for` in the surface syntax? I covered function types (`for<'a> fn(...)`), generic traits (`for <'a> Fn(...)`, can appear both as bounds as as trait objects) and bounds (`for<'a> F: ...`). * For the sake of backwards compatibility, this adds a warning, not an error. @nikomatsakis suggested an error in https://github.com/rust-lang/rust/issues/42181#issuecomment-306924389, but I feel that can only happen in a new epoch -- right? Cc @eddyb
2018-03-08Rollup merge of #48801 - Manishearth:epoch-features, r=nikomatsakisManish Goregaokar-189/+274
Add functionality for gating feature flags on epochs ; rejigger epoch lints fixes #48794 r? @nikomatsakis
2018-03-08Rollup merge of #48527 - zackmdavis:and_the_social_construction_of_tuples, ↵Manish Goregaokar-5/+39
r=estebank in which parentheses are suggested for should-have-been-tuple-patterns ![destructure_suggest_parens](https://user-images.githubusercontent.com/1076988/36638335-48b082d4-19a7-11e8-9726-0d043544df2f.png) Programmers used to working in some other languages (such as Python or Go) might expect to be able to destructure values with comma-separated identifiers but no parentheses on the left side of an assignment. Previously, the first name in such code would get parsed as a single-indentifier pattern—recognizing, for example, the `let a` in `let a, b = (1, 2);`—whereupon we would have a fatal syntax error on seeing an unexpected comma rather than the expected semicolon (all the way nearer to the end of `parse_full_stmt`). Instead, let's look for that comma when parsing the pattern, and if we see it, make-believe that we're parsing the remaining elements in a tuple pattern, so that we can suggest wrapping it all in parentheses. We need to do this in a separate wrapper method called on a "top-level" pattern, rather than within `parse_pat` itself, because `parse_pat` gets called recursively to parse the sub-patterns within a tuple pattern. ~~We could also do this for `match` arms, `if let`, and `while let`, but we elect not to in this patch, as it seems less likely for users to make the mistake in those contexts.~~ Resolves #48492. r? @petrochenkov