1. 14 1月, 2021 11 次提交
    • B
      Auto merge of #81003 - tmiasko:generator-layout, r=oli-obk · 7bb16309
      bors 提交于
      Encode optimized MIR of generators when emitting metadata
      7bb16309
    • B
      Auto merge of #78259 - plaflamme:fix-49660, r=KodrAus · a4f022e1
      bors 提交于
      Fix #49660 - Adds checks to ensure existence of arithmetic trait implementations
      
      The first 2 commits fix an issue with the existing `wrapping.rs` tests. It wasn't referred to from the module, so the file was being ignored. This is fixed in https://github.com/rust-lang/rust/pull/78259/commits/872dc60ed203d16d43140c1d1623474cf8a9aedc This surfaced a bug in its macro which is fixed in https://github.com/rust-lang/rust/pull/78259/commits/8ddad18283e304753e09ef651209b4a6b54148b0
      
      Lastly, commit https://github.com/rust-lang/rust/pull/78259/commits/64d695b753bfe09797b5f95c7b9b72948da01710 is the actual tests for fixing #49660
      
      The following checks are done:
      
      * `Add`, `Sub`, `Mul`, `Div`, `Rem`
        * `T op T`, `T op &T`, `&T op T` and `&T op &T`
        * for all integer and floating point types
      * `AddAssign`, `SubAssign`, `MulAssign`, `DivAssign`, `RemAssign`
        * `&mut T op T` and `&mut T op &T`
        * for all integer and floating point types
      * `Neg`
        * `op T` and `op &T`
        * for all signed integer and floating point types
      * `Not`
        * `op T` and `op &T`
        * for `bool`
      * `BitAnd`, `BitOr`, `BitXor`
        * `T op T`, `T op &T`, `&T op T` and `&T op &T`
        * for all integer types and bool
      * `BitAndAssign`, `BitOrAssign`, `BitXorAssign`
        * `&mut T op T` and `&mut T op &T`
        * for all integer types and bool
      * `Shl`, `Shr`
        * `L op R`, `L op &R`, `&L op R` and `&L op &R`
        * for all pairs of integer types
      * `ShlAssign`, `ShrAssign`
        * `&mut L op R`, `&mut L op &R`
        * for all pairs of integer types
      
      NOTE: I'd like some feedback on improving the macros. I'm not familiar with the idioms and patterns there and composing them has been a challenge for me.
      
      [EDIT]: updated links to commits after rebase.
      a4f022e1
    • P
      Adds tests to ensure some base op traits exist. · 64d695b7
      Philippe Laflamme 提交于
      These tests invoke the various op traits using all accepted types they
      are implemented for as well as for references to those types.
      
      This fixes #49660 and ensures the following implementations exist:
      
      * `Add`, `Sub`, `Mul`, `Div`, `Rem`
        * `T op T`, `T op &T`, `&T op T` and `&T op &T`
        * for all integer and floating point types
      * `AddAssign`, `SubAssign`, `MulAssign`, `DivAssign`, `RemAssign`
        * `&mut T op T` and `&mut T op &T`
        * for all integer and floating point types
      * `Neg`
        * `op T` and `op &T`
        * for all signed integer and floating point types
      * `Not`
        * `op T` and `op &T`
        * for `bool`
      * `BitAnd`, `BitOr`, `BitXor`
        * `T op T`, `T op &T`, `&T op T` and `&T op &T`
        * for all integer types and bool
      * `BitAndAssign`, `BitOrAssign`, `BitXorAssign`
        * `&mut T op T` and `&mut T op &T`
        * for all integer types and bool
      * `Shl`, `Shr`
        * `L op R`, `L op &R`, `&L op R` and `&L op &R`
        * for all pairs of integer types
      * `ShlAssign`, `ShrAssign`
        * `&mut L op R`, `&mut L op &R`
        * for all pairs of integer types
      64d695b7
    • P
      Avoid ident concatenation in macro. · 8ddad182
      Philippe Laflamme 提交于
      AFAIK it isn't currently possible to do this. It is also more in line with other tests in the surrounding modules.
      8ddad182
    • P
      Fix missing mod declaration for Wrapping tests. · 872dc60e
      Philippe Laflamme 提交于
      872dc60e
    • B
      Auto merge of #80802 - jyn514:box-attributes, r=nnethercote · c7b0ddbf
      bors 提交于
      Box Item::Attributes
      
      This reduces the size of Item from 128 to 40 bytes. I think this is as small as it needs to get 🎉
      
      Builds on https://github.com/rust-lang/rust/pull/80339 and should not be merged before.
      
      r? `@GuillaumeGomez`
      c7b0ddbf
    • T
      ea4cbff2
    • B
      Auto merge of #80654 - Aaron1011:fix/dummy-span-ctxt, r=wesleywiser · 180fdffa
      bors 提交于
      Properly handle `SyntaxContext` of dummy spans in incr comp
      
      Fixes #80336
      
      Due to macro expansion, we may end up with spans with an invalid
      location and non-root `SyntaxContext`. This commits preserves the
      `SyntaxContext` of such spans in the incremental cache, and ensures
      that we always hash the `SyntaxContext` when computing the `Fingerprint`
      of a `Span`
      
      Previously, we would discard the `SyntaxContext` during serialization to
      the incremental cache, causing the span's `Fingerprint` to change across
      compilation sessions.
      180fdffa
    • B
      Auto merge of #77524 - Patryk27:fixes/66228, r=estebank · a62a7604
      bors 提交于
      Rework diagnostics for wrong number of generic args (fixes #66228 and #71924)
      
      This PR reworks the `wrong number of {} arguments` message, so that it provides more details and contextual hints.
      a62a7604
    • A
      Properly handle `SyntaxContext` of dummy spans in incr comp · 482a67d2
      Aaron Hill 提交于
      Fixes #80336
      
      Due to macro expansion, we may end up with spans with an invalid
      location and non-root `SyntaxContext`. This commits preserves the
      `SyntaxContext` of such spans in the incremental cache, and ensures
      that we always hash the `SyntaxContext` when computing the `Fingerprint`
      of a `Span`
      
      Previously, we would discard the `SyntaxContext` during serialization to
      the incremental cache, causing the span's `Fingerprint` to change across
      compilation sessions.
      482a67d2
    • B
      Auto merge of #80718 - tmiasko:skip-opt-mir, r=oli-obk · 9bc8b00b
      bors 提交于
      Consistently avoid constructing optimized MIR when not doing codegen
      
      The optimized MIR for closures is being encoded unconditionally, while
      being unnecessary for cargo check. This turns out to be especially
      costly with MIR inlining enabled, since it triggers computation of
      optimized MIR for all callees that are being examined for inlining
      purposes https://github.com/rust-lang/rust/pull/77307#issuecomment-751915450.
      
      Skip encoding of optimized MIR for closures, enum constructors, struct
      constructors, and trait fns when not doing codegen, like it is already
      done for other items since 49433.
      9bc8b00b
  2. 13 1月, 2021 29 次提交