about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-10-03Rollup merge of #64675 - Centril:deprecate-plugin, r=oli-obkTyler Mandry-4/+17
Deprecate `#![plugin]` & `#[plugin_registrar]` This PR deprecates `#![plugin]` and `#[plugin_registrar]`. ~A removal deadline is set: 1.44.0. This will be in 9 months from now and should give everyone who is still relying on the feature ample time to rid themselves of this dependency.~ cc https://github.com/rust-lang/rust/issues/29597 r? @Mark-Simulacrum
2019-10-03review commentsEsteban Küber-25/+32
2019-10-03review commentsEsteban Küber-20/+17
2019-10-03review commentsEsteban Küber-36/+43
2019-10-03Account for missing turbofish in paths tooEsteban Küber-4/+43
2019-10-03review commentsEsteban Küber-38/+49
2019-10-03When encountering chained operators use heuristics to recover from bad turbofishEsteban Küber-13/+91
2019-10-03Add long error explanation for E0556Guillaume Gomez-1/+19
2019-10-03proc_macro: Add `Span::mixed_site` exposing `macro_rules` hygieneVadim Petrochenkov-0/+11
2019-10-03plugin_registrary: use normal deprecation instead of hard coded warning.Mazdak Farrokhzad-6/+10
2019-10-03Deprecate `#![plugin]` and `#[plugin_registrar]`.Mazdak Farrokhzad-3/+12
2019-10-02syntax: improve parameter without type suggestionsDavid Wood-8/+25
This commit improves the suggestions provided when function parameters do not have types: - A new suggestion is added for arbitrary self types, which suggests adding `self: ` before the type. - Existing suggestions are now provided when a `<` is found where a `:` was expected (previously only `,` and `)` or trait items), this gives suggestions in the case where the unnamed parameter type is generic in a free function. - The suggestion that a type name be provided (e.g. `fn foo(HashMap<u32>)` -> `fn foo(HashMap: TypeName<u32>)`) will no longer occur when a `<` was found instead of `:`. - The ident will not be used for recovery when a `<` was found instead of `:`. Signed-off-by: David Wood <david@davidtw.co>
2019-10-02Add missing 'bump'Aaron Hill-0/+1
2019-10-02Add support for 'extern const fn'Aaron Hill-19/+48
This works just as you might expect - an 'extern const fn' is a 'const fn' that is callable from foreign code. Currently, panicking is not allowed in consts. When RFC 2345 is stabilized, then panicking in an 'extern const fn' will produce a compile-time error when invoked at compile time, and an abort when invoked at runtime. Since this is extending the language (we're allowing the `const` keyword in a new context), I believe that this will need an FCP. However, it's a very minor change, so I didn't think that filing an RFC was necessary. This will allow libc (and other FFI crates) to make many functions `const`, without having to give up on making them `extern` as well.
2019-10-01Rollup merge of #64910 - Centril:params-cleanup, r=petrochenkovMazdak Farrokhzad-563/+495
syntax: cleanup param, method, and misc parsing Do some misc cleanup of the parser: - Method and parameter parsing is refactored. - A parser for `const | mut` is introduced that https://github.com/rust-lang/rust/pull/64588 can reuse. - Some other misc parsing. Next up in a different PR: - ~Implementing https://github.com/rust-lang/rust/issues/64252.~ -- maybe some other time... - Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^). r? @petrochenkov
2019-10-01Add E0551 long error explanationGuillaume Gomez-1/+19
2019-10-01Rollup merge of #64907 - alexreg:tidy-up, r=Mark-SimulacrumMazdak Farrokhzad-1/+1
A small amount of tidying-up factored out from PR #64648 As requested by @Mark-Simulacrum, I put this in a separate commit to make it easier to review. (As far as I can tell, no violations of the policy here, and they are simply in a separate PR because they're not directly related to the import of that PR.) r? @Mark-Simulacrum
2019-10-01Rollup merge of #64887 - Centril:recover-trailing-vert, r=estebankMazdak Farrokhzad-26/+79
syntax: recover trailing `|` in or-patterns Fixes https://github.com/rust-lang/rust/issues/64879. For example (this also shows that we are sensitive to the typo `||`): ``` error: a trailing `|` is not allowed in an or-pattern --> $DIR/remove-leading-vert.rs:33:11 | LL | A || => {} | - ^^ help: remove the `||` | | | while parsing this or-pattern starting here | = note: alternatives in or-patterns are separated with `|`, not `||` ``` r? @estebank
2019-10-01Rollup merge of #63931 - petrochenkov:stabmac, r=CentrilMazdak Farrokhzad-20/+8
Stabilize macros in some more positions - Fn-like macros and attribute macros in `extern` blocks - Fn-like procedural macros in type positions - ~Attribute macros on inline modules~ (moved to https://github.com/rust-lang/rust/pull/64273) Stabilization report: https://github.com/rust-lang/rust/pull/63931#issuecomment-526362396. Closes https://github.com/rust-lang/rust/issues/49476 cc https://github.com/rust-lang/rust/issues/54727
2019-10-01Rollup merge of #63674 - petrochenkov:meta2, r=CentrilMazdak Farrokhzad-65/+93
syntax: Support modern attribute syntax in the `meta` matcher Where "modern" means https://github.com/rust-lang/rust/pull/57367: ``` PATH PATH `(` TOKEN_STREAM `)` PATH `[` TOKEN_STREAM `]` PATH `{` TOKEN_STREAM `}` ``` Unfortunately, `meta` wasn't future-proofed using the `FOLLOW` token set like other matchers (https://github.com/rust-lang/rust/issues/34011), so code like `$meta:meta {` or `$meta:meta [` may break, and we need a crater run to find out how often this happens in practice. Closes https://github.com/rust-lang/rust/issues/49629 (by fully supporting `meta` rather than removing it.)
2019-10-01syntax: reformat passing of `FnHeader` to `parse_item_fn`.Mazdak Farrokhzad-12/+16
2019-10-01syntax: de-closure-ify `check_or_expected`.Mazdak Farrokhzad-7/+7
2019-10-01syntax: merge things back into `parse_visibility`.Mazdak Farrokhzad-37/+25
2019-10-01syntax: put helpers of `parse_self_param` in the method.Mazdak Farrokhzad-58/+57
2019-10-01syntax: document some methods.Mazdak Farrokhzad-2/+6
2019-10-01Address review commentsVadim Petrochenkov-2/+3
2019-09-30Rollup merge of #64838 - GuillaumeGomez:long-err-explanation-e0550, r=oli-obkTyler Mandry-1/+19
Add long error explanation for E0550 Part of #61137
2019-09-30syntax: Support modern attribute syntax in the `meta` matcherVadim Petrochenkov-46/+64
2019-09-30syntax: Split `ast::Attribute` into container and inner partsVadim Petrochenkov-19/+28
2019-09-30Stabilize proc macros in type positionsVadim Petrochenkov-5/+5
2019-09-30Stabilize macros in `extern` blocksVadim Petrochenkov-15/+3
Add some tests for macros in extern blocks, remove duplicate tests
2019-09-30Add long error explanation for E0550Guillaume Gomez-1/+19
2019-09-30Auto merge of #64778 - csmoe:index, r=eddybbors-5/+5
Introduce librustc_index crate Closes #50592
2019-09-30syntax: reduce repetition in fn parsing.Mazdak Farrokhzad-26/+21
2019-09-30syntax: stylistic cleanup in item parsing.Mazdak Farrokhzad-107/+47
2019-09-30syntax: fuse more code paths together.Mazdak Farrokhzad-48/+51
2019-09-30syntax: extract `error_on_invalid_abi`.Mazdak Farrokhzad-14/+17
2019-09-30syntax: cleanup `parse_visibility`.Mazdak Farrokhzad-53/+69
2019-09-30syntax: misc cleanupMazdak Farrokhzad-44/+30
2019-09-30syntax: cleanup `parse_fn_decl`.Mazdak Farrokhzad-6/+3
2019-09-30syntax: reorder param parsing to make more sense.Mazdak Farrokhzad-153/+153
2019-09-30syntax refactor `parse_self_param` (5)Mazdak Farrokhzad-22/+21
2019-09-30syntax refactor `parse_self_param` (4)Mazdak Farrokhzad-30/+37
2019-09-30syntax refactor `parse_self_param` (3)Mazdak Farrokhzad-28/+20
2019-09-30syntax refactor `parse_self_param` (2)Mazdak Farrokhzad-11/+16
2019-09-30syntax refactor `parse_self_param` (1)Mazdak Farrokhzad-12/+13
2019-09-30syntax refactor `parse_fn_params`Mazdak Farrokhzad-28/+29
2019-09-30syntax: `is_named_argument` -> `is_named_param`.Mazdak Farrokhzad-2/+2
2019-09-30syntax: cleanup method parsing.Mazdak Farrokhzad-74/+66
2019-09-30Added backticks for one diagnostic message.Alexander Regueiro-1/+1