about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-06-11Auto merge of #51490 - Havvy:diagnostic-list, r=GuillaumeGomezbors-1/+32
Long diagnostic for E0541 r? @GuillaumeGomez
2018-06-11More E0541 long diagnostic wording tweaksHavvy-3/+3
2018-06-11Auto merge of #51480 - dtolnay:lifetime, r=kennytmbors-0/+8
Enable fall through past $:lifetime matcher ```rust macro_rules! is_lifetime { ($lifetime:lifetime) => { true }; ($other:tt) => { false }; } fn main() { println!("{}", is_lifetime!('lifetime)); println!("{}", is_lifetime!(@)); } ``` Before this fix, the `is_lifetime!` invocation would fail to compile with: ``` error: expected a lifetime, found `@` --> src/main.rs:8:33 | 8 | println!("{}", is_lifetime!(@)); | ^ ``` Fixes #50903. Fixes #51477. r? @kennytm
2018-06-11Make tidy happyHavvy-7/+8
2018-06-11Fix typos in previous commitHavvy-1/+3
2018-06-11Long diagnostic for E0541Havvy-1/+29
2018-06-10Enable fall through past $:lifetime matcherDavid Tolnay-0/+8
2018-06-10Auto merge of #50205 - topecongiro:include-parens-to-type-parameter, ↵bors-8/+9
r=petrochenkov Include parens to type parameter The motivation of this PR is to fix a bug in rustfmt (cc https://github.com/rust-lang-nursery/rustfmt/issues/2630).
2018-06-10Simplify an error handling in the parserSeiichi Uchida-6/+2
2018-06-10Include parens to type parameterSeiichi Uchida-2/+7
2018-06-09Crate-ify and delete unused code in syntax::parseMark Simulacrum-365/+191
2018-06-09Auto merge of #51068 - Crazycolorz5:pluseqsplitting, r=petrochenkovbors-10/+51
parser: Split `+=` into `+` and `=` where `+` is explicitly requested (such as generics) Added functions in tokens to check whether a token leads with `+`. Used them when parsing to allow for token splitting of `+=` into `+` and `=`. Fixes https://github.com/rust-lang/rust/issues/47856
2018-06-08Rollup merge of #51298 - Dylan-DPC:stabilise/termination-test, r=nikomatsakisMark Rousskov-37/+11
Stabilize unit tests with non-`()` return type References #48854
2018-06-08Rollup merge of #51099 - Crazycolorz5:expectedcloseparen, r=estebankMark Rousskov-2/+7
Fix Issue 38777 When looking through for a closing bracket in the loop condition, adds them to expecteds. https://github.com/rust-lang/rust/issues/38777
2018-06-08Rollup merge of #51417 - pietroalbini:revert-49719, r=nikomatsakiskennytm-22/+67
Revert #49719 This also needs to be backported into beta. Fixes #51416. r? @nikomatsakis
2018-06-08Rollup merge of #51283 - ↵kennytm-3/+40
kennytm:fix-51279-preempt-the-warning-song-and-dance, r=nikomatsakis Deny #[cfg] and #[cfg_attr] on generic parameters. Fix #51279. Attributes on generic parameters are not expanded, meaning `#[cfg]`, `#[cfg_attr]` and attribute proc macros are entirely ignored on them. This PR makes using the first two attributes an error, because if they are correctly expanded will affect the AST and change code behavior. I'm beta-nominating this, because generic parameter attributes are stabilizing in 1.27, and if we did not reserve their usage, we may never be able to repurpose the meaning of these attributes in the Rust 2015 edition.
2018-06-07Revert "Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkov"Pietro Albini-22/+67
This reverts commit d6ba1b9b021c408fcad60ee52acf8af5e1b2eb00, reversing changes made to 8de5353f75dcde04abe947e0560dc5edd861cf3a.
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-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-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.