about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2017-05-12Disallow ._ in float literal.Masaki Hara-3/+1
2017-05-08Rollup merge of #41827 - qnighy:allow-bare-cr-in-nondoc-comment, r=estebankCorey Farwell-1/+1
Allow bare CR in ////-style comment. Fixes #40624 in a way that bare CR is allowed in all non-doc comments.
2017-05-08Allow bare CR in ////-style comment.Masaki Hara-1/+1
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-22/+26
Delete features which are easily removed, in libsyntax
2017-05-07fix the easy features in libsyntaxubsan-22/+26
2017-05-06Fix "an" usageacdenisSK-1/+1
2017-05-05Rollup merge of #41722 - F001:warnTilde, r=petrochenkovCorey Farwell-0/+13
Suggest `!` for bitwise negation when encountering a `~` Fix #41679 Here is a program ```rust fn main() { let x = ~1; } ``` It's output: ``` error: `~` can not be used as an unary operator --> /home/fcc/temp/test.rs:4:13 | 4 | let x = ~1; | ^^ | = help: use `!` instead of `~` if you meant to bitwise negation ``` cc @bstrie
2017-05-05Suggest `!` for bitwise negation when encountering a `~`F001-0/+13
2017-05-04Remove use of `Self: Sized` from libsyntaxTommy Ip-1/+1
The bound is not required for compiling but it prevents using `next_token()` from a trait object. Fixes #33506.
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-28Auto merge of #41508 - michaelwoerister:generic-path-remapping, r=alexcrichtonbors-26/+26
Implement a file-path remapping feature in support of debuginfo and reproducible builds This PR adds the `-Zremap-path-prefix-from`/`-Zremap-path-prefix-to` commandline option pair and is a more general implementation of #41419. As opposed to the previous attempt, this implementation should enable reproducible builds regardless of the working directory of the compiler. This implementation of the feature is more general in the sense that the re-mapping will affect *all* paths the compiler emits, including the ones in error messages. r? @alexcrichton
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-26Implement a file-path remapping feature in support of debuginfo and ↵Michael Woerister-26/+26
reproducible builds.
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/+5
Rollup of 3 pull requests - Successful merges: #41012, #41280, #41290 - Failed merges:
2017-04-17Adjust descriptionalexey zabelin-1/+1
2017-04-15move NtVis enum variant to stave off comment rotAlex Burka-1/+1
2017-04-15parse interpolated visibility tokensAlex Burka-0/+2
2017-04-15update :vis implementation to current rustAlex Burka-1/+1
2017-04-15Implementation of the `vis` macro matcher.Daniel Keep-0/+2
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-456/+422
2017-04-03Fix bug parsing `#[derive]` macro invocations.Jeffrey Seyfried-0/+20
2017-04-03Merge branch 'master' into issue-40006Esteban Küber-457/+423
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-31Auto merge of #40620 - laumann:slash-in-diagnostics-path, r=BurntSushibors-4/+5
Replace hardcoded forward slash with path::MAIN_SEPARATOR Fixes #40149