1. 26 1月, 2022 2 次提交
  2. 25 1月, 2022 12 次提交
    • B
      Auto merge of #93089 - pierwill:rm-outlivesconstraint-ord, r=michaelwoerister · 17dfae79
      bors 提交于
      Remove ordering traits from `OutlivesConstraint`
      
      In two cases where this ordering was used, I've replaced the sorting to use a key that does not rely on `DefId` being `Ord`. This is part of #90317. If I understand correctly, whether this is correct depends on whether the `RegionVid`s are tracked during incremental compilation. But I might be mistaken in this approach. cc `@cjgillot`
      17dfae79
    • B
      Auto merge of #93288 - matthiaskrgr:rollup-uu4uwd1, r=matthiaskrgr · df368ae4
      bors 提交于
      Rollup of 8 pull requests
      
      Successful merges:
      
       - #88794 (Add a `try_clone()` function to `OwnedFd`.)
       - #93064 (Properly track `DepNode`s in trait evaluation provisional cache)
       - #93118 (Move param count error emission to end of `check_argument_types`)
       - #93144 (Work around missing code coverage data causing llvm-cov failures)
       - #93169 (Fix inconsistency of local blanket impls)
       - #93175 (Implement stable overlap check considering negative traits)
       - #93251 (rustdoc settings: use radio buttons for theme)
       - #93269 (Use error-on-mismatch policy for PAuth module flags.)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      df368ae4
    • M
      Rollup merge of #93269 - jacobbramley:dev/pauth-option-1, r=petrochenkov · 13b87d8c
      Matthias Krüger 提交于
      Use error-on-mismatch policy for PAuth module flags.
      
      This agrees with Clang, and avoids an error when using LTO with mixed
      C/Rust. LLVM considers different behaviour flags to be a mismatch,
      even when the flag value itself is the same.
      
      This also makes the flag setting explicit for all uses of
      LLVMRustAddModuleFlag.
      
      ----
      
      I believe that this fixes #92885, but have only reproduced it locally on Linux hosts so cannot confirm that it fixes the issue as reported.
      
      I have not included a test for this because it is covered by an existing test (`src/test/run-make-fulldeps/cross-lang-lto-clang`). It is not without its problems, though:
      * The test requires Clang and `--run-clang-based-tests-with=...` to run, and this is not the case on the CI.
         * Any test I add would have a similar requirement.
      * With this patch applied, the test gets further, but it still fails (for other reasons). I don't think that affects #92885.
      13b87d8c
    • M
      Rollup merge of #93251 - jsha:theme-radio, r=GuillaumeGomez · c3ddca6d
      Matthias Krüger 提交于
      rustdoc settings: use radio buttons for theme
      
      This reduces the number of clicks required to change theme.
      
      Also, simplify the UI a bit (remove setting grouping), and add a "Back" link close to the settings icon.
      
      Demo: https://rustdoc.crud.net/jsha/theme-radio/settings.html
      
      r? ``@GuillaumeGomez``
      
      New:
      
      ![image](https://user-images.githubusercontent.com/220205/150702647-4826d525-54fa-439a-b24c-6d5bca6f95bf.png)
      
      Old:
      
      ![image](https://user-images.githubusercontent.com/220205/150702669-6a4214ed-1dab-4fee-b1aa-59acfce3dbca.png)
      c3ddca6d
    • M
      Rollup merge of #93175 - spastorino:negative-traits-coherence-new, r=nikomatsakis · 3d6f276c
      Matthias Krüger 提交于
      Implement stable overlap check considering negative traits
      
      This PR implement the new disjointness rules for overlap check described in https://rust-lang.github.io/negative-impls-initiative/explainer/coherence-check.html#new-disjointness-rules
      
      r? ``@nikomatsakis``
      3d6f276c
    • M
      Rollup merge of #93169 - CraftSpider:rustdoc-clean-inconsistency, r=GuillaumeGomez · 677126ca
      Matthias Krüger 提交于
      Fix inconsistency of local blanket impls
      
      When a blanket impl is local, go through HIR instead of middle. This fixes inconsistencies with data detected during JSON generation.
      
      Expected this change to take longer. I also tried doing the whole item through existing clean architecture, but it didn't work out trivially, and felt like it would have added more complexity than it removed.
      
      Properly fixes #83718
      677126ca
    • M
      Rollup merge of #93144 - wesleywiser:uninhabited_type_code_cov2, r=tmandry · 8dddc864
      Matthias Krüger 提交于
      Work around missing code coverage data causing llvm-cov failures
      
      If we do not add code coverage instrumentation to the `Body` of a
      function, then when we go to generate the function record for it, we
      won't write any data and this later causes llvm-cov to fail when
      processing data for the entire coverage report.
      
      I've identified two main cases where we do not currently add code
      coverage instrumentation to the `Body` of a function:
      
        1. If the function has a single `BasicBlock` and it ends with a
           `TerminatorKind::Unreachable`.
      
        2. If the function is created using a proc macro of some kind.
      
      For case 1, this is typically not important as this most often occurs as
      a result of function definitions that take or return uninhabited
      types. These kinds of functions, by definition, cannot even be called so
      they logically should not be counted in code coverage statistics.
      
      For case 2, I haven't looked into this very much but I've noticed while
      testing this patch that (other than functions which are covered by case
      1) the skipped function coverage debug message is occasionally triggered
      in large crate graphs by functions generated from a proc macro. This may
      have something to do with weird spans being generated by the proc macro
      but this is just a guess.
      
      I think it's reasonable to land this change since currently, we fail to
      generate *any* results from llvm-cov when a function has no coverage
      instrumentation applied to it. With this change, we get coverage data
      for all functions other than the two cases discussed above.
      
      Fixes #93054 which occurs because of uncallable functions which shouldn't
      have code coverage anyway.
      
      I will open an issue for missing code coverage of proc macro generated
      functions and leave a link here once I have a more minimal repro.
      
      r? ``@tmandry``
      cc ``@richkadel``
      8dddc864
    • M
      Rollup merge of #93118 - jackh726:param-heuristics-3, r=estebank · c8ede152
      Matthias Krüger 提交于
      Move param count error emission to end of `check_argument_types`
      
      The error emission here isn't exactly what is done in #92364, but replicating that is hard . The general move should make for a smaller diff.
      
      Also included the `(usize, Ty, Ty)` to -> `Option<(Ty, Ty)>` commit.
      
      r? ``@estebank``
      c8ede152
    • M
      Rollup merge of #93064 - Aaron1011:provisional-dep-node, r=michaelwoerister · cf704118
      Matthias Krüger 提交于
      Properly track `DepNode`s in trait evaluation provisional cache
      
      Fixes #92987
      
      During evaluation of an auto trait predicate, we may encounter a cycle.
      This causes us to store the evaluation result in a special 'provisional
      cache;. If we later end up determining that the type can legitimately
      implement the auto trait despite the cycle, we remove the entry from
      the provisional cache, and insert it into the evaluation cache.
      
      Additionally, trait evaluation creates a special anonymous `DepNode`.
      All queries invoked during the predicate evaluation are added as
      outoging dependency edges from the `DepNode`. This `DepNode` is then
      store in the evaluation cache - if a different query ends up reading
      from the cache entry, it will also perform a read of the stored
      `DepNode`. As a result, the cached evaluation will still end up
      (transitively) incurring all of the same dependencies that it would
      if it actually performed the uncached evaluation (e.g. a call to
      `type_of` to determine constituent types).
      
      Previously, we did not correctly handle the interaction between the
      provisional cache and the created `DepNode`. Storing an evaluation
      result in the provisional cache would cause us to lose the `DepNode`
      created during the evaluation. If we later moved the entry from the
      provisional cache to the evaluation cache, we would use the `DepNode`
      associated with the evaluation that caused us to 'complete' the cycle,
      not the evaluatoon where we first discovered the cycle. As a result,
      future reads from the evaluation cache would miss some incremental
      compilation dependencies that would have otherwise been added if the
      evaluation was *not* cached.
      
      Under the right circumstances, this could lead to us trying to force
      a query with a no-longer-existing `DefPathHash`, since we were missing
      the (red) dependency edge that would have caused us to bail out before
      attempting forcing.
      
      This commit makes the provisional cache store the `DepNode` create
      during the provisional evaluation. When we move an entry from the
      provisional cache to the evaluation cache, we create a *new* `DepNode`
      that has dependencies going to *both* of the evaluation `DepNodes` we
      have available. This ensures that cached reads will incur all of
      the necessary dependency edges.
      cf704118
    • M
      Rollup merge of #88794 - sunfishcode:sunfishcode/try-clone, r=joshtriplett · 687bb583
      Matthias Krüger 提交于
      Add a `try_clone()` function to `OwnedFd`.
      
      As suggested in #88564. This adds a `try_clone()` to `OwnedFd` by
      refactoring the code out of the existing `File`/`Socket` code.
      
      r? ``@joshtriplett``
      687bb583
    • B
      Auto merge of #90842 - pierwill:localdefid-indexmap, r=wesleywiser · e7825f2b
      bors 提交于
      Use `indexmap` to avoid sorting `LocalDefId`s
      
      See discussion in https://github.com/rust-lang/rust/pull/90408#discussion_r745935459.
      
      Related to work on https://github.com/rust-lang/rust/issues/90317.
      e7825f2b
    • J
      Use error-on-mismatch policy for PAuth module flags. · e02e9582
      Jacob Bramley 提交于
      This agrees with Clang, and avoids an error when using LTO with mixed
      C/Rust. LLVM considers different behaviour flags to be a mismatch,
      even when the flag value itself is the same.
      
      This also makes the flag setting explicit for all uses of
      LLVMRustAddModuleFlag.
      e02e9582
  3. 24 1月, 2022 26 次提交