1. 19 10月, 2022 20 次提交
    • B
      Auto merge of #103213 - matthiaskrgr:rollup-diloxg3, r=matthiaskrgr · 415d8fcc
      bors 提交于
      Rollup of 6 pull requests
      
      Successful merges:
      
       - #101889 (doc: rewrite doc for uint::{carrying_add,borrowing_sub})
       - #102507 (More slice::partition_point examples)
       - #103164 (rustdoc: remove CSS ``@media` (min-width: 701px)`)
       - #103189 (Clean up code-color and headers-color rustdoc GUI tests)
       - #103203 (Retrieve LLVM version from llvm-filecheck binary if it is not set yet)
       - #103204 (Add some more autolabels)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      415d8fcc
    • B
      Auto merge of #102769 - nnethercote:rustdoc-startup, r=jyn514 · 2efc90e7
      bors 提交于
      Clean up rustdoc startup
      
      Startup is pretty hairy, in both rustdoc and rustc. The first commit here improves the rustdoc situation quite a bit. The remaining commits are smaller but also help.
      
      Best reviewed one commit at a time.
      
      r? `@jyn514`
      2efc90e7
    • N
      Avoid cloning `RenderOptions`. · ca2561a0
      Nicholas Nethercote 提交于
      By moving `RenderOptions` out of `Option`, because the two structs' uses
      are almost entirely separate.
      
      The only complication is that `unstable_features` is needed in both
      structs, but it's a tiny `Copy` type so its duplication seems fine.
      ca2561a0
    • N
      Use `interface::run_compiler` for `markdown::render`. · 38988e62
      Nicholas Nethercote 提交于
      It turns out `markdown::render` is more complex than it first appears,
      because it can invoke `doctest::make_test`, which requires session
      globals and a thread pool.
      
      So this commit changes it to use `interface::run_compiler`. Three of the
      four paths in `main_args` now use `interface::run_compiler`.
      38988e62
    • N
      63db9e54
    • N
      Apply `Lrc` later to `sess` and `codegen_backend`. · ec409f95
      Nicholas Nethercote 提交于
      This avoids the need for a degenerate `Lrc::get_mut` call.
      ec409f95
    • N
      Inline and remove `create_compiler_and_run`. · b6ae1453
      Nicholas Nethercote 提交于
      It has a single call site.
      b6ae1453
    • N
      Reduce visibility of some functions. · dcc194e4
      Nicholas Nethercote 提交于
      dcc194e4
    • N
      Inline and remove `scoped_thread`. · 134e9d36
      Nicholas Nethercote 提交于
      It has a single call site, and removing it slightly improves the
      confusing tangle of nested closures present at startup.
      134e9d36
    • N
      Merge `main_options` into `main_args`. · 2a62c92b
      Nicholas Nethercote 提交于
      There is no longer any need for them to be separate.
      2a62c92b
    • N
      Clean up rustdoc startup. · 021d1fbd
      Nicholas Nethercote 提交于
      rustc's startup has several layers, including:
      - `interface::run_compiler` passes a closure, `f`, to
        `run_in_thread_pool_with_globals`, which creates a thread pool, sets
        up session globals, and passes `f` to `create_compiler_and_run`.
      - `create_compiler_and_run` creates a `Session`, a `Compiler`, sets the
        source map, and calls `f`.
      
      rustdoc is a bit different.
      - `main_args` calls `main_options` via
        `run_in_thread_pool_with_globals`, which (again) creates a thread pool
        (hardcoded to a single thread!) and sets up session globals.
      - `main_options` has four different paths.
        - The second one calls `interface::run_compiler`, which redoes the
          `run_in_thread_pool_with_globals`! This is bad.
        - The fourth one calls `interface::create_compiler_and_run`, which is
          reasonable.
        - The first and third ones don't do anything of note involving the
          above functions, except for some symbol interning which requires
          session globals.
      
      In other words, rustdoc calls into `rustc_interface` at three different
      levels. It's a bit confused, and feels like code where functionality has
      been added by different people at different times without fully
      understanding how the globally accessible stuff is set up.
      
      This commit tidies things up. It removes the
      `run_in_thread_pool_with_globals` call in `main_args`, and adjust the
      four paths in `main_options` as follows.
      - `markdown::test` calls `test::test_main`, which provides its own
        parallelism and so doesn't need a thread pool. It had one small use of
        symbol interning, which required session globals, but the commit
        removes this.
      - `doctest::run` already calls `interface::run_compiler`, so it doesn't
        need further adjustment.
      - `markdown::render` is simple but needs session globals for interning
        (which can't easily be removed), so it's now wrapped in
        `create_session_globals_then`.
      - The fourth path now uses `interface::run_compiler`, which is
        equivalent to the old `run_in_thread_pool_with_globals` +
        `create_compiler_and_run` pairing.
      021d1fbd
    • M
      Rollup merge of #103204 - jyn514:autolabels, r=Mark-Simulacrum · e0c162ff
      Matthias Krüger 提交于
      Add some more autolabels
      e0c162ff
    • M
      Rollup merge of #103203 - GuillaumeGomez:fix-llvm-runtools-condition, r=Amanieu · 4012538c
      Matthias Krüger 提交于
      Retrieve LLVM version from llvm-filecheck binary if it is not set yet
      
      In `rustc_codegen_gcc`, we run the `ASM` test suite. The problem is that, if a too recent version of the `llvm-filecheck` binary is provided, an extra argument needs to be passed and the to detect this version, it currently only expects a `--llvm-version` argument. With this, the version can be determined directly from the `llvm-filecheck` binary.
      
      r? ``@Amanieu``
      4012538c
    • M
      Rollup merge of #103189 - GuillaumeGomez:clean-up-gui-tests, r=notriddle · aaee7376
      Matthias Krüger 提交于
      Clean up code-color and headers-color rustdoc GUI tests
      
      r? ``@notriddle``
      aaee7376
    • M
      Rollup merge of #103164 - notriddle:notriddle/media-min-width, r=GuillaumeGomez · 2ae06ca3
      Matthias Krüger 提交于
      rustdoc: remove CSS `@media (min-width: 701px)`
      
      The two rules within it can and should be done without the separate media query:
      
        * There ain't no rule saying a viewport can't be `700.5px` wide, since hardware pixels can be finer than CSS pixels.
      
          <details><summary>Screenshot</summary>
      
          ![image](https://user-images.githubusercontent.com/1593513/196283804-e946fbe3-d914-4819-ba2d-b4a6a07f190a.png)
      
          </details>
      
        * The rule for the first example-wrap child should probably apply on mobile.
      
          <details><summary>Screenshots</summary>
      
          ## Before
      
          ![rustdoc-before](https://user-images.githubusercontent.com/1593513/196282813-88b861c7-7b05-4de5-a421-914396f86a04.png)
      
          ## After
      
          ![rustdoc-after](https://user-images.githubusercontent.com/1593513/196282842-e57760c2-72d5-4dad-94f5-1d7175043326.png)
      
          </details>
      
        * The rule for the source sidebar is overriden by the mobile rule setting `max-width: 100vw`, so it can be merged with the rest of the styles.
      2ae06ca3
    • M
      Rollup merge of #102507 - scottmcm:more-binary-search-docs, r=m-ou-se · 18431b66
      Matthias Krüger 提交于
      More slice::partition_point examples
      
      After seeing the discussion of `binary_search` vs `partition_point` in #101999, I thought some more example code could be helpful.
      18431b66
    • M
      Rollup merge of #101889 - tspiteri:redoc-uint-adc-sbb, r=m-ou-se · d2644e53
      Matthias Krüger 提交于
      doc: rewrite doc for uint::{carrying_add,borrowing_sub}
      
      Reword the documentation for bigint helper methods `uint::{carrying_add,borrowing_sub}` (#85532).
      
      The examples were also rewritten to demonstrate how the methods can be used in bignum arithmetic. No loops are used in the examples, but the variable names were chosen to include indices so that it is clear how this can be used in a loop if required.
      
      Also, previously `carrying_add` had an example to say that if the input carry is false, the method is equivalent to `overflowing_add`. While the note was kept, the example was removed and an extra note was added to make sure this equivalence is not assumed for signed integers as well.
      d2644e53
    • B
      Auto merge of #102418 - citrus-it:illumos-strip-debug, r=nagisa · a24a020e
      bors 提交于
      The illumos linker does not support --strip-debug
      
      When building and testing rust 1.64.0 on illumos, we saw a large number of failing tests associated with:
      
      ```
         = note: ld: fatal: unrecognized option '--strip-debug'
                 ld: fatal: use the -z help option for usage information
                 collect2: error: ld returned 1 exit status
      ```
      
      The illumos linker does not support the `--strip-debug` option (although it does support `--strip-all`).
      a24a020e
    • G
    • J
      Add some more autolabels · 10f982d3
      Joshua Nelson 提交于
      10f982d3
  2. 18 10月, 2022 20 次提交