- 27 6月, 2018 1 次提交
-
-
由 Michael Woerister 提交于
-
- 24 6月, 2018 6 次提交
-
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
- 02 6月, 2018 1 次提交
-
-
由 kennytm 提交于
-
- 26 5月, 2018 1 次提交
-
-
由 Vadim Petrochenkov 提交于
-
- 21 5月, 2018 1 次提交
-
-
由 Zack M. Davis 提交于
Consider this a down payment on #50723. To recap, an `Applicability` enum was recently (#50204) added, to convey to Rustfix and other tools whether we think it's OK for them to blindly apply the suggestion, or whether to prompt a human for guidance (because the suggestion might contain placeholders that we can't infer, or because we think it has a sufficiently high probability of being wrong even though it's— presumably—right often enough to be worth emitting in the first place). When a suggestion is marked as `MaybeIncorrect`, we try to use comments to indicate precisely why (although there are a few places where we just say `// speculative` because the present author's subjective judgement balked at the idea that the suggestion has no false positives). The `run-rustfix` directive is opporunistically set on some relevant UI tests (and a couple tests that were in the `test/ui/suggestions` directory, even if the suggestions didn't originate in librustc or libsyntax). This is less trivial than it sounds, because a surprising number of test files aren't equipped to be tested as fixed even when they contain successfully fixable errors, because, e.g., there are more, not-directly-related errors after fixing. Some test files need an attribute or underscore to avoid unused warnings tripping up the "fixed code is still producing diagnostics" check despite the fixes being correct; this is an interesting contrast-to/inconsistency-with the behavior of UI tests (which secretly pass `-A unused`), a behavior which we probably ought to resolve one way or the other (filed issue #50926). A few suggestion labels are reworded (e.g., to avoid phrasing it as a question, which which is discouraged by the style guidelines listed in `.span_suggestion`'s doc-comment).
-
- 19 5月, 2018 1 次提交
-
-
由 Alex Crichton 提交于
This commit feature gates generating modules and macro definitions in procedural macro expansions. Custom derive is exempt from this check as it would be a large retroactive breaking change (#50587). It's hoped that we can hopefully stem the bleeding to figure out a better solution here before opening up the floodgates. The restriction here is specifically targeted at surprising hygiene results [1] that result in non-"copy/paste" behavior. Hygiene and procedural macros is intended to be avoided as much as possible for Macros 1.2 by saying everything is "as if you copy/pasted the code", but modules and macros are sort of weird exceptions to this rule that aren't fully fleshed out. [1]: https://github.com/rust-lang/rust/issues/50504#issuecomment-387734625 cc #50504
-
- 18 5月, 2018 2 次提交
-
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
- 02 5月, 2018 3 次提交
-
-
由 flip1995 提交于
-
由 Seiichi Uchida 提交于
-
由 Seiichi Uchida 提交于
-
- 30 4月, 2018 1 次提交
-
-
由 Austin Bonander 提交于
This fixes the regression in #49934 and ensures that unused `#[derive]`s on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. For `#[derive]` on macro invocations it has a hardcoded warning since linting occurs after expansion. This also adds regression testing for some nodes that were already warning properly. closes #49934
-
- 21 4月, 2018 1 次提交
-
-
由 Alex Crichton 提交于
This commit starts to lay some groundwork for the stabilization of custom attribute invocations and general procedural macros. It applies a number of changes discussed on [internals] as well as a [recent issue][issue], namely: * The path used to specify a custom attribute must be of length one and cannot be a global path. This'll help future-proof us against any ambiguities and give us more time to settle the precise syntax. In the meantime though a bare identifier can be used and imported to invoke a custom attribute macro. A new feature gate, `proc_macro_path_invoc`, was added to gate multi-segment paths and absolute paths. * The set of items which can be annotated by a custom procedural attribute has been restricted. Statements, expressions, and modules are disallowed behind two new feature gates: `proc_macro_expr` and `proc_macro_mod`. * The input to procedural macro attributes has been restricted and adjusted. Today an invocation like `#[foo(bar)]` will receive `(bar)` as the input token stream, but after this PR it will only receive `bar` (the delimiters were removed). Invocations like `#[foo]` are still allowed and will be invoked in the same way as `#[foo()]`. This is a **breaking change** for all nightly users as the syntax coming in to procedural macros will be tweaked slightly. * Procedural macros (`foo!()` style) can only be expanded to item-like items by default. A separate feature gate, `proc_macro_non_items`, is required to expand to items like expressions, statements, etc. Closes #50038 [internals]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252 [issue]: https://github.com/rust-lang/rust/issues/50038
-
- 06 4月, 2018 4 次提交
-
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
- 04 4月, 2018 1 次提交
-
-
由 Austin Bonander 提交于
-
- 02 4月, 2018 1 次提交
-
-
由 Austin Bonander 提交于
Retains the `stmt_expr_attributes` feature requirement for attributes on expressions. closes #41475 cc #38356
-
- 18 3月, 2018 1 次提交
-
-
由 Vadim Petrochenkov 提交于
-
- 14 3月, 2018 1 次提交
-
-
由 Michael Lamparski 提交于
-
- 08 3月, 2018 1 次提交
-
-
由 Austin Bonander 提交于
-
- 02 3月, 2018 1 次提交
-
-
由 John Kåre Alsaker 提交于
-
- 17 2月, 2018 2 次提交
-
-
由 Seiichi Uchida 提交于
-
由 Seiichi Uchida 提交于
-
- 26 1月, 2018 1 次提交
-
-
由 John Kåre Alsaker 提交于
-
- 26 12月, 2017 1 次提交
-
-
由 Seiichi Uchida 提交于
1. Change the return type of `expand_invoc()` and its subroutines to `Option<Expansion>` from `Expansion`. 2. Return `None` when expanding a derive invocation if the item cannot have derive on it (in `expand_derive_invoc()`).
-
- 20 12月, 2017 3 次提交
-
-
由 Taylor Cramer 提交于
-
由 QuietMisdreavus 提交于
-
由 QuietMisdreavus 提交于
-
- 17 12月, 2017 1 次提交
-
-
由 Vadim Petrochenkov 提交于
-
- 14 12月, 2017 1 次提交
-
-
由 Oliver Schneider 提交于
-
- 10 12月, 2017 1 次提交
-
-
由 Jeffrey Seyfried 提交于
-
- 06 12月, 2017 1 次提交
-
-
由 Oliver Schneider 提交于
-
- 22 11月, 2017 1 次提交
-
-
由 QuietMisdreavus 提交于
Partial implementation of https://github.com/rust-lang/rfcs/pull/1990 (needs error reporting work) cc #44732
-