1. 08 6月, 2022 3 次提交
  2. 07 6月, 2022 29 次提交
  3. 06 6月, 2022 8 次提交
    • C
      Update src/test/ui/unsized/issue-97732.rs · 10336cf1
      Chase Wilson 提交于
      Co-authored-by: NEduard-Mihai Burtescu <edy.burt@gmail.com>
      10336cf1
    • B
      Auto merge of #97684 - RalfJung:better-provenance-control, r=oli-obk · 9d20fd10
      bors 提交于
      interpret: better control over whether we read data with provenance
      
      The resolution in https://github.com/rust-lang/unsafe-code-guidelines/issues/286 seems to be that when we load data at integer type, we implicitly strip provenance. So let's implement that in Miri at least for scalar loads. This makes use of the fact that `Scalar` layouts distinguish pointer-sized integers and pointers -- so I was expecting some wild bugs where layouts set this incorrectly, but so far that does not seem to happen.
      
      This does not entirely implement the solution to https://github.com/rust-lang/unsafe-code-guidelines/issues/286; we still do the wrong thing for integers in larger types: we will `copy_op` them and then do validation, and validation will complain about the provenance. To fix that we need mutating validation; validation needs to strip the provenance rather than complaining about it. This is a larger undertaking (but will also help resolve https://github.com/rust-lang/miri/issues/845 since we can reset padding to `Uninit`).
      
      The reason this is useful is that we can now implement `addr` as a `transmute` from a pointer to an integer, and actually get the desired behavior of stripping provenance without exposing it!
      9d20fd10
    • B
      Make saved_file field of WorkProduct non-optional · e16c3b4a
      bjorn3 提交于
      A WorkProduct without a saved file is useless
      e16c3b4a
    • B
      Factor Option out of copy_cgu_workproduct_to_incr_comp_cache_dir call · 906b8515
      bjorn3 提交于
      This improves clarity of the code a bit
      906b8515
    • D
      Rollup merge of #97787 - matthiaskrgr:e0432_explain, r=Dylan-DPC · 99afe260
      Dylan DPC 提交于
      E0432: rust 2018 -> rust 2018 or later    in --explain message
      99afe260
    • D
      Rollup merge of #97767 - RalfJung:variadic, r=davidtwco · 85617f1c
      Dylan DPC 提交于
      interpret: do not claim UB until we looked more into variadic functions
      
      I am not actually sure if this is UB, and anyway for FFI shims, Miri currently does not attempt to distinguish between arguments passed via variadics vs directly. So let's be consistent.
      (Programs that ran into this error will anyway immediately fall through to the "unsupported" message on the next line.)
      85617f1c
    • D
      Rollup merge of #97579 - SparrowLii:target_features, r=nagisa · 6da214c1
      Dylan DPC 提交于
      Avoid creating `SmallVec`s in `global_llvm_features`
      
      This PR made a simple optimization to avoid creating extra `SmallVec`s by adjusting the use of iterator statements.
      Also, given the very small size of `tied_target_features`, there is no need to insert each feature into the FxHashMap.
      6da214c1
    • D
      Rollup merge of #97495 - clarfonthey:e0788-no-coverage, r=nagisa · cb787bea
      Dylan DPC 提交于
      Add E0788 for improper #[no_coverage] usage
      
      Essentially, this adds proper checking for the attribute (tracking issue #84605) and throws errors when it's put in obviously-wrong places, like on struct or const definitions. Most of the code is taken directly from the checks for the `#[inline]` attribute, since it's very similar.
      
      Right now, the code only checks at the function level, but it seems reasonable to allow adding `#[no_coverage]` to individual blocks or expressions, so, for now those just throw `unused_attributes` warnings. Similarly, since there was a lot of desire to eventually allow recursive definitions as well on modules and impl blocks, these also throw `unused_attributes` instead of an error.
      
      I'm not sure if anything has to be done since this error is technically for an unstable feature, but since an error for using unstable features will show up anyway, I think it's okay.
      
      This is the first big piece needed for stabilising this attribute, although I personally would like to explore renaming it to `#[coverage(never)]` on a separate PR, which I will offer soon. There's a lot of discussion still to be had about that, which is why it will be kept separate.
      
      I don't think much is needed besides adding this simple check and a UI test, but let me know if there's something else that should be added to make this happen.
      cb787bea