1. 01 3月, 2022 1 次提交
  2. 15 2月, 2022 1 次提交
    • N
      Overhaul `Const`. · a95fb8b1
      Nicholas Nethercote 提交于
      Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as
      this:
      ```
      pub struct Const<'tcx>(&'tcx Interned<ConstS>);
      ```
      This now matches `Ty` and `Predicate` more closely, including using
      pointer-based `eq` and `hash`.
      
      Notable changes:
      - `mk_const` now takes a `ConstS`.
      - `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a
        we need separate arena for it, because we can't use the `Dropless` one any
        more.
      - Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes
      - Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes.
      - Lots of tedious sigil fiddling.
      a95fb8b1
  3. 03 2月, 2022 1 次提交
  4. 02 2月, 2022 1 次提交
  5. 19 1月, 2022 2 次提交
  6. 19 11月, 2021 1 次提交
  7. 15 11月, 2021 1 次提交
    • K
      rustc_mir_build: reorder bindings · c1c20138
      Krasimir Georgiev 提交于
      No functional changes intended.
      
      I'm playing around with building compiler components using nightly rust
      (2021-11-02) in a non-standard way. I encountered the following error while
      trying to build rustc_mir_build:
      
      ```
      error[E0597]: `wildcard` does not live long enough
          --> rust/src/nightly/compiler/rustc_mir_build/src/build/matches/mod.rs:1767:82
           |
      1767 |         let mut otherwise_candidate = Candidate::new(expr_place_builder.clone(), &wildcard, false);
           |                                                                                  ^^^^^^^^^ borrowed value does not live long enough
      ...
      1799 |     }
           |     -
           |     |
           |     `wildcard` dropped here while still borrowed
           |     borrow might be used here, when `guard_candidate` is dropped and runs the destructor for type `Candidate<'_, '_>`
           |
           = note: values in a scope are dropped in the opposite order they are defined
      ```
      
      I believe this flags an issue that may become an error in the future.
      Swapping the order of `wildcard` and `guard_candidate` resolves it.
      c1c20138
  8. 11 9月, 2021 1 次提交
  9. 10 9月, 2021 1 次提交
  10. 06 9月, 2021 1 次提交
    • M
      Change scope of temporaries in match guards · ad7f109b
      Matthew Jasper 提交于
      Each pattern in a match arm has its own copy of the match guard in MIR,
      with its own temporary, so it has to be dropped before the the guards
      are joined to the single copy of the arm.
      ad7f109b
  11. 02 9月, 2021 3 次提交
  12. 26 8月, 2021 1 次提交
    • W
      Fix debugger stepping behavior around `match` expressions · 0a42dfc2
      Wesley Wiser 提交于
      Previously, we would set up the source lines for `match` expressions so
      that the code generated to perform the test of the scrutinee was matched
      to the line of the arm that required the test and then jump from the arm
      block to the "next" block was matched to all of the lines in the `match`
      expression.
      
      While that makes sense, it has the side effect of causing strange
      stepping behavior in debuggers.
      
      I've changed the source information so that all of the generated tests
      are sourced to `match {scrutinee}` and the jumps are sourced to the last
      line of the block they are inside. This resolves the weird stepping
      behavior in all debuggers and resolves some instances of "ambiguous
      symbol" errors in WinDbg preventing the user from setting breakpoints at
      `match` expressions.
      0a42dfc2
  13. 22 8月, 2021 1 次提交
  14. 18 8月, 2021 1 次提交
  15. 16 8月, 2021 2 次提交
  16. 22 5月, 2021 1 次提交
  17. 19 5月, 2021 1 次提交
  18. 03 4月, 2021 1 次提交
  19. 16 3月, 2021 2 次提交
  20. 15 3月, 2021 2 次提交
  21. 10 3月, 2021 4 次提交
  22. 05 2月, 2021 2 次提交
  23. 02 2月, 2021 1 次提交
  24. 01 2月, 2021 1 次提交
  25. 25 1月, 2021 1 次提交
  26. 07 12月, 2020 1 次提交
    • W
      [mir-opt] Allow debuginfo to be generated for a constant or a Place · 01aec8d1
      Wesley Wiser 提交于
      Prior to this commit, debuginfo was always generated by mapping a name
      to a Place. This has the side-effect that `SimplifyLocals` cannot remove
      locals that are only used for debuginfo because their other uses have
      been const-propagated.
      
      To allow these locals to be removed, we now allow debuginfo to point to
      a constant value. The `ConstProp` pass detects when debuginfo points to
      a local with a known constant value and replaces it with the value. This
      allows the later `SimplifyLocals` pass to remove the local.
      01aec8d1
  27. 06 12月, 2020 1 次提交
  28. 05 12月, 2020 1 次提交
  29. 26 10月, 2020 1 次提交
  30. 04 10月, 2020 1 次提交