about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
AgeCommit message (Collapse)AuthorLines
2017-05-08Remove need for &format!(...) or &&"" dances in `span_label` callsOliver Schneider-8/+8
2017-05-07Auto merge of #41729 - ubsan:master, r=nrcbors-20/+20
Delete features which are easily removed, in libsyntax
2017-05-07fix the easy features in libsyntaxubsan-20/+20
2017-05-06Fix "an" usageacdenisSK-1/+1
2017-05-05Suggest `!` for bitwise negation when encountering a `~`F001-0/+13
2017-05-02Auto merge of #40851 - oli-obk:multisugg, r=jonathandturnerbors-10/+7
Minimize single span suggestions into a label changes ``` 14 | println!("☃{}", tup[0]); | ^^^^^^ | help: to access tuple elements, use tuple indexing syntax as shown | println!("☃{}", tup.0); ``` into ``` 14 | println!("☃{}", tup[0]); | ^^^^^^ to access tuple elements, use `tup.0` ``` Also makes suggestions explicit in the backend in preparation of adding multiple suggestions to a single diagnostic. Currently that's already possible, but results in a full help message + modified code snippet per suggestion, and has no rate limit (might show 100+ suggestions).
2017-04-28Auto merge of #41542 - petrochenkov:objpars2, r=nikomatsakisbors-2/+2
syntax: Parse trait object types starting with a lifetime bound Fixes https://github.com/rust-lang/rust/issues/39085 This was originally implemented in https://github.com/rust-lang/rust/pull/40043, then reverted, then there was some [agreement](https://github.com/rust-lang/rust/issues/39318#issuecomment-289108720) that it should be supported. (This is hopefully the last PR related to bound parsing.)
2017-04-27Auto merge of #37860 - giannicic:defaultimpl, r=nagisabors-7/+27
#37653 support `default impl` for specialization this commit implements the first step of the `default impl` feature: > all items in a `default impl` are (implicitly) `default` and hence > specializable. In order to test this feature I've copied all the tests provided for the `default` method implementation (in run-pass/specialization and compile-fail/specialization directories) and moved the `default` keyword from the item to the impl. See [referenced](https://github.com/rust-lang/rust/issues/37653) issue for further info r? @aturon
2017-04-26 support `default impl` for specializationGianni Ciccarelli-9/+6
`[default] [unsafe] impl` and typecheck
2017-04-25Parse trait object types starting with a lifetime boundVadim Petrochenkov-2/+2
2017-04-25Add ui testsGuillaume Gomez-7/+4
2017-04-25Improve E0178 suggestion placementOliver Schneider-4/+5
2017-04-25Address PR commentsOliver Schneider-3/+1
2017-04-25Update affected testsOliver Schneider-3/+1
2017-04-25 support `default impl` for specializationGianni Ciccarelli-3/+11
pr review
2017-04-24Remove strip prefixGuillaume Gomez-16/+2
2017-04-24Add tests for module suggestionsGuillaume Gomez-15/+28
2017-04-24Fix invalid module suggestionGuillaume Gomez-13/+20
2017-04-24support `default impl` for specializationGianni Ciccarelli-7/+22
this commit implements the first step of the `default impl` feature: all items in a `default impl` are (implicitly) `default` and hence specializable. In order to test this feature I've copied all the tests provided for the `default` method implementation (in run-pass/specialization and compile-fail/specialization directories) and moved the `default` keyword from the item to the impl. See referenced issue for further info
2017-04-21Move parse_remaining_bounds into a separate functionVadim Petrochenkov-20/+21
2017-04-21Fix issue with single question mark or parenVadim Petrochenkov-23/+28
2017-04-21syntax: Support parentheses around trait boundsVadim Petrochenkov-4/+25
2017-04-17Auto merge of #41282 - arielb1:missing-impl-item, r=petrochenkovbors-68/+99
libsyntax/parse: fix missing kind error reporting Fixes #41161. Fixes #41239.
2017-04-17libsyntax/parse: improve associated item error reportingAriel Ben-Yehuda-68/+99
Fixes #41161. Fixes #41239.
2017-04-17Auto merge of #41345 - frewsxcv:rollup, r=frewsxcvbors-1/+3
Rollup of 3 pull requests - Successful merges: #41012, #41280, #41290 - Failed merges:
2017-04-17Adjust descriptionalexey zabelin-1/+1
2017-04-15parse interpolated visibility tokensAlex Burka-0/+2
2017-04-15update :vis implementation to current rustAlex Burka-1/+1
2017-04-13Address the PR reviewalexey zabelin-2/+2
2017-04-12Fix old docsalexey zabelin-2/+2
#41158
2017-04-12Rollup merge of #41087 - estebank:tuple-float-index, r=arielb1Tim Neumann-3/+3
Use proper span for tuple index parsed as float Fix diagnostic suggestion from: ```rust help: try parenthesizing the first index | (1, (2, 3)).((1, (2, 3)).1).1; ``` to the correct: ```rust help: try parenthesizing the first index | ((1, (2, 3)).1).1; ``` Fix #41081.
2017-04-10Point at only one char on `Span::next_point`Esteban Küber-2/+4
Avoid pointing at two chars so the diagnostic output doesn't display a multiline span when starting beyond a line end.
2017-04-07Merge branch 'master' into ty-placeholderEsteban Küber-28/+88
2017-04-05Rollup merge of #41050 - jseyfried:fix_derive_parsing, r=petrochenkovCorey Farwell-0/+20
macros: fix bug parsing `#[derive]` invocations Fixes #40962 (introduced in #40346). r? @nrc
2017-04-05Rollup merge of #40815 - estebank:issue-40006, r=GuillaumeGomezAriel Ben-Yehuda-15/+42
Identify missing item category in `impl`s ```rust struct S; impl S { pub hello_method(&self) { println!("Hello"); } } fn main() { S.hello_method(); } ``` ```rust error: missing `fn` for method declaration --> file.rs:3:4 | 3 | pub hello_method(&self) { | ^ missing `fn` ``` Fix #40006. r? @pnkfelix CC @jonathandturner @GuillaumeGomez
2017-04-05Use proper span for tuple index parsed as floatEsteban Küber-3/+3
Fix diagnostic suggestion from: ```rust help: try parenthesizing the first index | (1, (2, 3)).((1, (2, 3)).1).1; ``` to the correct: ```rust help: try parenthesizing the first index | ((1, (2, 3)).1).1; ```
2017-04-04Merge branch 'master' into issue-32540Esteban Küber-388/+356
2017-04-03Fix bug parsing `#[derive]` macro invocations.Jeffrey Seyfried-0/+20
2017-04-03Merge branch 'master' into issue-40006Esteban Küber-389/+357
2017-04-02Introduce `TyErr` independent from `TyInfer`Esteban Küber-1/+24
Add a `TyErr` type to represent unknown types in places where parse errors have happened, while still able to build the AST. Initially only used to represent incorrectly written fn arguments and avoid "expected X parameters, found Y" errors when called with the appropriate amount of parameters. We cannot use `TyInfer` for this as `_` is not allowed as a valid argument type. Example output: ```rust error: expected one of `:` or `@`, found `,` --> file.rs:12:9 | 12 | fn bar(x, y: usize) {} | ^ error[E0061]: this function takes 2 parameters but 3 parameters were supplied --> file.rs:19:9 | 12 | fn bar(x, y) {} | --------------- defined here ... 19 | bar(1, 2, 3); | ^^^^^^^ expected 2 parameters ```
2017-03-30Replace hardcoded forward slash with path::MAIN_SEPARATORThomas Jespersen-4/+5
Fixes #40149
2017-03-30Improve `Path` spans.Jeffrey Seyfried-21/+35
2017-03-29Refactor how spans are combined in the parser.Jeffrey Seyfried-336/+281
2017-03-29Merge `ExpnId` and `SyntaxContext`.Jeffrey Seyfried-5/+1
2017-03-27Fix unittestsEsteban Küber-1/+1
2017-03-27Simplify error outputEsteban Küber-11/+6
2017-03-27Fix various useless derefs and slicingsOliver Schneider-3/+3
2017-03-25Improve wording and spans for unexpected tokenEsteban Küber-6/+19
* Point at where the token was expected instead of the last token successfuly parsed. * Only show `unexpected token` if the next char and the unexpected token don't have the same span. * Change some cfail and pfail tests to ui test. * Don't show all possible tokens in span label if they are more than 6.
2017-03-24Point at last valid token on failed `expect_one_of`Esteban Küber-14/+14
```rust error: expected one of `.`, `;`, `?`, `}`, or an operator, found `)` --> $DIR/token-error-correct-3.rs:29:9 | 25 | foo() | - expected one of `.`, `;`, `?`, `}`, or an operator after this ... 29 | } else { | ^ unexpected token ```
2017-03-24Identify missing item category in `impl`sEsteban Küber-15/+47
```rust struct S; impl S { pub hello_method(&self) { println!("Hello"); } } fn main() { S.hello_method(); } ``` ```rust error: can't qualify macro invocation with `pub` --> file.rs:3:4 | 3 | pub hello_method(&self) { | ^^^- - expected `!` here for a macro invocation | | | did you mean to write `fn` here for a method declaration? | = help: try adjusting the macro to put `pub` inside the invocation ```