1. 21 8月, 2021 4 次提交
    • B
      Auto merge of #88087 - jesyspa:issue-87935-box, r=jackh726 · 1e3d632f
      bors 提交于
      Check that a box expression's type is Sized
      
      This resolves [issue 87935](https://github.com/rust-lang/rust/issues/87935).
      
      This makes E0161 (move from an unsized rvalue) much less common.  I've replaced the test to use [this case](https://github.com/rust-lang/rust/blob/master/src/test/ui/object-safety/object-safety-by-value-self-use.rs), when a boxed `dyn` trait is passed by value, but that isn't an error when `unsized_locals` is enabled.  I think it may be possible to get rid of E0161 entirely by checking that case earlier, but I'm not sure if that's desirable?
      1e3d632f
    • B
      Auto merge of #83093 - the8472:smaller-instant-hammer, r=Amanieu · a0035916
      bors 提交于
      where available use AtomicU{64,128} instead of mutex for Instant backsliding protection
      
      This decreases the overhead of backsliding protection on x86 systems with unreliable TSC, e.g. windows. And on aarch64 systems where 128bit atomics are available.
      
      The following benchmarks were taken on x86_64 linux though by overriding `actually_monotonic()`, the numbers may look different on other platforms
      
      ```
      # actually_monotonic() == true
      test time::tests::instant_contention_01_threads                   ... bench:          44 ns/iter (+/- 0)
      test time::tests::instant_contention_02_threads                   ... bench:          44 ns/iter (+/- 0)
      test time::tests::instant_contention_04_threads                   ... bench:          44 ns/iter (+/- 0)
      test time::tests::instant_contention_08_threads                   ... bench:          44 ns/iter (+/- 0)
      test time::tests::instant_contention_16_threads                   ... bench:          44 ns/iter (+/- 0)
      
      # 1x AtomicU64
      test time::tests::instant_contention_01_threads                   ... bench:          65 ns/iter (+/- 0)
      test time::tests::instant_contention_02_threads                   ... bench:         157 ns/iter (+/- 20)
      test time::tests::instant_contention_04_threads                   ... bench:         281 ns/iter (+/- 53)
      test time::tests::instant_contention_08_threads                   ... bench:         555 ns/iter (+/- 77)
      test time::tests::instant_contention_16_threads                   ... bench:         883 ns/iter (+/- 107)
      
      # mutex
      test time::tests::instant_contention_01_threads                   ... bench:          60 ns/iter (+/- 2)
      test time::tests::instant_contention_02_threads                   ... bench:         770 ns/iter (+/- 231)
      test time::tests::instant_contention_04_threads                   ... bench:       1,347 ns/iter (+/- 45)
      test time::tests::instant_contention_08_threads                   ... bench:       2,693 ns/iter (+/- 114)
      test time::tests::instant_contention_16_threads                   ... bench:       5,244 ns/iter (+/- 487)
      ```
      
      Since I don't have an arm machine with 128bit atomics I wasn't able to benchmark the AtomicU128 implementation.
      a0035916
    • T
      cd82b424
    • B
      Auto merge of #88176 - erikdesjardins:rezst, r=oli-obk · 914a1e2c
      bors 提交于
      Reenable RemoveZsts
      
      Now that the underlying issue has been fixed by #88124, we can reland #83417.
      
      r? `@oli-obk`
      914a1e2c
  2. 20 8月, 2021 36 次提交