1. 16 7月, 2018 2 次提交
  2. 28 6月, 2018 1 次提交
  3. 23 6月, 2018 1 次提交
  4. 29 5月, 2018 1 次提交
    • Z
      operate on `HirId` in `hir::Pat::each_binding`, and consequences of that · 1329605a
      Zack M. Davis 提交于
      Changing the `each_binding` utility method to take the `HirId` of a
      binding pattern rather than its `NodeId` seems like a modest first step
      in support of the `HirId`ification initiative #50928. (The inspiration
      for choosing this in particular came from the present author's previous
      work on diagnostics issued during liveness analysis, which is the most
      greatly affected module in this change.)
      1329605a
  5. 23 5月, 2018 1 次提交
    • N
      Shrink `LiveNode`. · 8d0fad5d
      Nicholas Nethercote 提交于
      `Liveness::users` is a vector that is occasionally enormous. For
      example, doing a "clean incremental" check build of `inflate`, there is
      one instance that represents 5,499 live nodes and 1087 vars, which
      requires 5,977,413 entries. At 24 bytes per entry, that is 143MB.
      
      This patch changes LiveNode from a usize to a u32. On 64-bit machines
      that halves the size of these entries, significantly reducing peak
      memory usage and memory traffic, and speeding up "clean incremental"
      builds of `inflate` by about 10%.
      8d0fad5d
  6. 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
  7. 18 5月, 2018 1 次提交
    • Z
      in which the unused shorthand field pattern debacle/saga continues · 59782f48
      Zack M. Davis 提交于
      In e4b1a797 (#47922), we corrected erroneous suggestions for unused
      shorthand field pattern bindings, suggesting `field: _` where the
      previous suggestion of `_field` wouldn't even have compiled
      (#47390). Soon, it was revealed that this was insufficient (#50303), and
      the fix was extended to references, slices, &c. (#50327) But even this
      proved inadequate, as the erroneous suggestions were still being issued
      for patterns in local (`let`) bindings (#50804). Here, we yank the
      shorthand-detection and variable/node registration code into a new
      common function that can be called while visiting both match arms and
      `let` bindings.
      
      Resolves #50804.
      59782f48
  8. 16 5月, 2018 1 次提交
  9. 15 5月, 2018 2 次提交
    • E
      Remove LoopIdResult · 235e7c1b
      est31 提交于
      It's redundant as Result already implements Encodable
      as well as Decodable.
      235e7c1b
    • E
      Remove hir::ScopeTarget · 3ef481a5
      est31 提交于
      When we want to implement label-break-value,
      we can't really decide whether to emit ScopeTarget::Loop or
      ScopeTarget::Block in the code that is supposed to create it.
      So we get rid of it and reconstruct the information when
      needed.
      3ef481a5
  10. 13 5月, 2018 3 次提交
  11. 30 4月, 2018 3 次提交
  12. 17 4月, 2018 1 次提交
  13. 13 4月, 2018 1 次提交
  14. 17 3月, 2018 1 次提交
  15. 03 3月, 2018 1 次提交
  16. 01 2月, 2018 1 次提交
    • Z
      concerning well-formed suggestions for unused shorthand field patterns · e4b1a797
      Zack M. Davis 提交于
      Previously, unused variables would get a note that the warning could be
      silenced by prefixing the variable with an underscore, but that doesn't
      work for field shorthand patterns, which the liveness analysis didn't
      know about.
      
      The "to avoid this warning" verbiage seemed unnecessary.
      
      Resolves #47390.
      e4b1a797
  17. 29 1月, 2018 1 次提交
  18. 14 9月, 2017 1 次提交
  19. 09 9月, 2017 1 次提交
  20. 16 8月, 2017 1 次提交
  21. 10 8月, 2017 1 次提交
    • A
      rustc: Rearchitect lints to be emitted more eagerly · 0374e6aa
      Alex Crichton 提交于
      In preparation for incremental compilation this commit refactors the lint
      handling infrastructure in the compiler to be more "eager" and overall more
      incremental-friendly. Many passes of the compiler can emit lints at various
      points but before this commit all lints were buffered in a table to be emitted
      at the very end of compilation. This commit changes these lints to be emitted
      immediately during compilation using pre-calculated lint level-related data
      structures.
      
      Linting today is split into two phases, one set of "early" lints run on the
      `syntax::ast` and a "late" set of lints run on the HIR. This commit moves the
      "early" lints to running as late as possible in compilation, just before HIR
      lowering. This notably means that we're catching resolve-related lints just
      before HIR lowering. The early linting remains a pass very similar to how it was
      before, maintaining context of the current lint level as it walks the tree.
      
      Post-HIR, however, linting is structured as a method on the `TyCtxt` which
      transitively executes a query to calculate lint levels. Each request to lint on
      a `TyCtxt` will query the entire crate's 'lint level data structure' and then go
      from there about whether the lint should be emitted or not.
      
      The query depends on the entire HIR crate but should be very quick to calculate
      (just a quick walk of the HIR) and the red-green system should notice that the
      lint level data structure rarely changes, and should hopefully preserve
      incrementality.
      
      Overall this resulted in a pretty big change to the test suite now that lints
      are emitted much earlier in compilation (on-demand vs only at the end). This in
      turn necessitated the addition of many `#![allow(warnings)]` directives
      throughout the compile-fail test suite and a number of updates to the UI test
      suite.
      0374e6aa
  22. 28 7月, 2017 3 次提交
  23. 06 7月, 2017 1 次提交
  24. 01 6月, 2017 4 次提交
  25. 13 5月, 2017 3 次提交
  26. 01 5月, 2017 2 次提交