about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-06-12Auto merge of #51498 - topecongiro:pub-parse_ident, r=petrochenkovbors-1/+1
Make parse_ident public `parse_ident` was made private in #51265. In rustfmt the method is used to create a custom parser for macro call.
2018-06-11Slightly better summary for E0538Havvy-1/+1
2018-06-11Long diagnostic for E0538Havvy-1/+30
2018-06-11Stabilize the #[global_allocator] attributeSimon Sapin-7/+3
Fixes https://github.com/rust-lang/rust/issues/27389
2018-06-11Make span_fatal and parse_block publicPSeitz-2/+2
span_fatal and parse_block were made private in #51265. These methods are used in stainless. Related #51498 #51504
2018-06-11Make parse_seq_to_end and parse_path publicjeb-2/+2
2018-06-11Auto merge of #51490 - Havvy:diagnostic-list, r=GuillaumeGomezbors-1/+32
Long diagnostic for E0541 r? @GuillaumeGomez
2018-06-11Make parse_ident publicSeiichi Uchida-1/+1
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-08provide error message when using more than 65535 hash symbols for raw stringsDavid Cao-0/+14
2018-06-08rename `irrefutable_let_pattern` to `irrefutable_let_patterns`Niko Matsakis-1/+1
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-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