1. 27 6月, 2018 1 次提交
  2. 24 6月, 2018 6 次提交
  3. 02 6月, 2018 1 次提交
  4. 26 5月, 2018 1 次提交
  5. 21 5月, 2018 1 次提交
    • Z
      suggestion applicabilities for libsyntax and librustc, run-rustfix tests · 98a04291
      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).
      98a04291
  6. 19 5月, 2018 1 次提交
    • A
      rustc: Disallow modules and macros in expansions · 5e4bac31
      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
      5e4bac31
  7. 18 5月, 2018 2 次提交
  8. 02 5月, 2018 3 次提交
  9. 30 4月, 2018 1 次提交
    • A
      Warn on pointless `#[derive]` in more places · f16d2ff7
      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
      f16d2ff7
  10. 21 4月, 2018 1 次提交
    • A
      rustc: Tweak custom attribute capabilities · 79630d4f
      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
      79630d4f
  11. 06 4月, 2018 4 次提交
  12. 04 4月, 2018 1 次提交
  13. 02 4月, 2018 1 次提交
  14. 18 3月, 2018 1 次提交
  15. 14 3月, 2018 1 次提交
  16. 08 3月, 2018 1 次提交
  17. 02 3月, 2018 1 次提交
  18. 17 2月, 2018 2 次提交
  19. 26 1月, 2018 1 次提交
  20. 26 12月, 2017 1 次提交
  21. 20 12月, 2017 3 次提交
  22. 17 12月, 2017 1 次提交
  23. 14 12月, 2017 1 次提交
  24. 10 12月, 2017 1 次提交
  25. 06 12月, 2017 1 次提交
  26. 22 11月, 2017 1 次提交