about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-06-06Allowing attributes to be on if let statementsSebastian Malton-1/+1
2018-06-07add an explanatory commentNiko Matsakis-0/+5
2018-06-06Auto merge of #51201 - estebank:dotdot, r=petrochenkovbors-69/+135
Accept `..` in incorrect position to avoid further errors We currently give a specific message when encountering a `..` anywhere other than the end of a pattern. Modify the parser to accept it (while still emitting the error) so that we don't also trigger "missing fields in pattern" errors afterwards. Add suggestions to either remove trailing `,` or moving the `..` to the end. Follow up to #49268.
2018-06-06append unused variables with _dylan_DPC-3/+3
2018-06-05remove redundant match branchdylan_DPC-1/+0
2018-06-05flag changed to nonedylan_DPC-1/+1
2018-06-05Account for comma in suggestionEsteban Küber-1/+1
2018-06-05Improve diagnostics for incorrect `..` usageEsteban Küber-79/+135
When using `..` somewhere other than the end, parse the rest of the pattern correctly while still emitting an error. Add suggestions to either remove trailing `,` or moving the `..` to the end.
2018-06-05Accept `..` in incorrect position to avoid further errorsEsteban Küber-0/+10
We currently give a specific message when encountering a `..` anywhere other than the end of a pattern. Modify the parser to accept it (while still emitting the error) so that we don't also trigger "missing fields in pattern" errors afterwards.
2018-06-05Implementation of RFC 2086 - Allow Irrefutable Let patternsSebastian Malton-0/+3
2018-06-05Auto merge of #51140 - GuillaumeGomez:doc-keyword, r=QuietMisdreavusbors-0/+8
rustdoc: introduce the #[doc(keyword="")] attribute for documenting keywords Part of #34601. r? @QuietMisdreavus
2018-06-04Fixed indentation error.Crazycolorz5-2/+2
2018-06-04Fixed incorrect check_plus to token.is_like_plus.Crazycolorz5-1/+1
2018-06-04Tidy fixes.Crazycolorz5-6/+6
2018-06-04Added is_like_plus to token, and used that in place of equality comparison ↵Crazycolorz5-9/+29
to Plus token.
2018-06-04Implemented eat_plus and used it in parsing parse_ty_param_bounds_common.Crazycolorz5-1/+22
2018-06-05Auto merge of #51242 - ytausky:mut-ref, r=estebankbors-20/+22
Suggest not mutably borrowing a mutable reference This PR would (hopefully) solve #45392. I deviated a bit from @estebank's instructions since the error span only included the borrowed expression (e.g. the `b` in `&mut b`). I also didn't check the mutability of the local binding, since this whole case is concerned with an immutable local. I can see two outstanding questions: 1. `note_immutability_blame` is called in two places, but I only have one test case. I think it covers the call in `report_bckerror`, but I'm not sure how to trigger the call from `report_aliasability_violation`. 2. There is one failing test, where the local binding is `self: &mut Self`. I'm not entirely sure what the correct output should be, but I think the new message should also apply. Unfortunately, since this parameter is parsed differently, its `let_span` covers both the pattern and the type, leading to a wrong suggestion text. I'm not sure how to correctly identify this case.
2018-06-04Put doc keyword behind feature flagGuillaume Gomez-0/+8
2018-06-04Merge branch 'master' into stabilise/termination-testDylan DPC-0/+8
2018-06-03implement #[panic_implementation]Jorge Aparicio-0/+9
2018-06-02fixed feature gate to right placedylan_DPC-2/+2
2018-06-02Stabilize unit tests with non-`()` return typedylan_DPC-34/+10
2018-06-01Suggest not mutably borrowing a mutable referenceYaron Tausky-20/+22
This commit is concerned with the case where the user tries to mutably borrow a mutable reference, thereby triggering an error. Instead of the existing suggestion to make the binding mutable, the compiler will now suggest to avoid borrowing altogether.
2018-06-02Deny #[cfg] and #[cfg_attr] on generic parameters.kennytm-3/+40
2018-06-01Fix processing mod with multi-level path on WindowsEvgenii Pashkin-1/+8
2018-06-01Add closing bracket expectation to sequences, modified appropriate test cases.Crazycolorz5-2/+7
2018-05-31Rollup merge of #51240 - nnethercote:parse-2, r=nikomatsakisGuillaume Gomez-5/+3
Two minor parsing tweaks
2018-05-31Avoid an unnecessary `match` when lexing "<-".Nicholas Nethercote-5/+1
2018-05-31Tweak identifer lexing.Nicholas Nethercote-0/+2
By calling `bump()` after getting the first char, to avoid a redundant `ident_continue()` test on it.
2018-05-31Auto merge of #51145 - petrochenkov:npbot, r=alexcrichtonbors-0/+10
resolve: Make sure indeterminate and inconsistent macro resolutions always generate errors Addresses the issue described in https://github.com/rust-lang/rust/pull/50911#issuecomment-392560525 I haven't come up with a minimized reproduction yet, but confirmed that `npbot` now generates the correct error with `![feature(use_extern_macros)]`.
2018-05-30resolve: Make sure indeterminate and inconsistent macro resolutions always ↵Vadim Petrochenkov-0/+10
generate errors
2018-05-30rustc: don't visit lifetime parameters through visit_lifetime.Eduard-Mihai Burtescu-2/+2
2018-05-30syntax: remove overloading of fold_lifetime{,_def}{,s}.Eduard-Mihai Burtescu-54/+20
2018-05-28Auto merge of #50724 - zackmdavis:applicability_rush, r=Manishearthbors-67/+166
add suggestion applicabilities to librustc and libsyntax A down payment on #50723. Interested in feedback on whether my `MaybeIncorrect` vs. `MachineApplicable` judgement calls are well-calibrated (and that we have a consensus on what this means). r? @Manishearth cc @killercup @estebank
2018-05-27Auto merge of #51101 - 11Takanori:fix-typo, r=frewsxcvbors-1/+1
Fix typo in macro_parser.rs innacurate -> inaccurate
2018-05-27Ensure every unstable feature has a tracking issue.kennytm-22/+24
2018-05-27Auto merge of #51075 - ↵bors-7/+18
estebank:and_the_case_of_the_confusable_float_exponent, r=eddyb Check for confusable Unicode chars in float literal exponent Fixing tests for #49989. Resolves #49746.
2018-05-27Auto merge of #51066 - est31:master, r=sfacklerbors-1/+1
Point to the current box syntax tracking issue The issue was used for both box syntax as well as placement new. It got closed due to placement new being unapproved. So a new one got created for box syntax, yet neither the unstable book nor feature_gate.rs got updated. We are doing this now. r? @aidanhs
2018-05-27innacurate -> inaccurateTakanori Ishibashi-1/+1
2018-05-26Fix testEsteban Küber-4/+8
2018-05-26Point to the current box syntax tracking issueest31-1/+1
The issue was used for both box syntax as well as placement new. It got closed due to placement new being unapproved. So a new one got created for box syntax, yet neither the unstable book nor feature_gate.rs got updated. We are doing this now.
2018-05-26Auto merge of #51072 - petrochenkov:ifield, r=eddybbors-15/+15
Use `Ident`s for fields in HIR Continuation of https://github.com/rust-lang/rust/pull/49718, part of https://github.com/rust-lang/rust/issues/49300
2018-05-26Auto merge of #51052 - nikomatsakis:obsolete-arrow, r=petrochenkovbors-5/+44
restore emplacement syntax (obsolete) Fix https://github.com/rust-lang/rust/issues/50832 r? @petrochenkov
2018-05-26Add `Ident::as_str` helperVadim Petrochenkov-15/+15
2018-05-25in which we check for confusable Unicodepoints in float literal exponentZack M. Davis-5/+12
The `FatalError.raise()` might seem unmotivated (in most places in the compiler, `err.emit()` suffices), but it's actually used to maintain behavior (viz., stop lexing, don't emit potentially spurious errors looking for the next token after the bad Unicodepoint in the exponent): the previous revision's `self.err_span_` ultimately calls `Handler::emit`, which aborts if the `Handler`'s continue_after_error flag is set, which seems to typically be true during lexing (see `phase_1_parse_input` and and how `CompileController::basic` has `continue_parse_after_error: false` in librustc_driver). Also, let's avoid apostrophes in error messages (the present author would argue that users expect a reassuringly detached, formal, above-it-all tone from a Serious tool like a compiler), and use an RLS-friendly structured suggestion. Resolves #49746.
2018-05-26Auto merge of #50070 - toidiu:ak-2093-outlives, r=nikomatsakisbors-0/+6
2093 infer outlives requirements Tracking issue: #44493 RFC: https://github.com/rust-lang/rfcs/pull/2093 - [x] add `rustc_attrs` flag - [x] use `RequirePredicates` type - [x] handle explicit predicates on `dyn` Trait - [x] handle explicit predicates on projections - [x] more tests - [x] remove `unused`, `dead_code` and etc.. - [x] documentation
2018-05-25Implement outlives requirements inference for dyn and projections.toidiu-0/+6
Add tests, documentation and attr for feature.
2018-05-24restore emplacement syntax (obsolete)Niko Matsakis-5/+44
2018-05-24Replace `ScalarKind` with `Primitive`Oliver Schneider-35/+2
2018-05-24Auto merge of #50930 - toidiu:ak-ordOutlivesPredicate, r=nikomatsakisbors-1/+1
implement Ord for OutlivesPredicate and other types It became necessary while implementing https://github.com/rust-lang/rust/pull/50070 to have `Ord` implemented for `OutlivesPredicate`. This PR implements `Ord` for `OutlivesPredicate` as well as other types needed for the implementation.