1. 20 8月, 2021 11 次提交
    • B
      Auto merge of #87996 - sexxi-goose:fix-87988, r=nikomatsakis · ebedfedc
      bors 提交于
      RFC2229 Add missing edge case
      
      Closes https://github.com/rust-lang/rust/issues/87988
      
      This PR fixes an ICE where a match discriminant is not being read when expected. This ICE was the result of a missing edge case which assumed that if a pattern is of type `PatKind::TupleStruct(..) | PatKind::Path(..) | PatKind::Struct(..) | PatKind::Tuple(..)` then a place could only be a multi variant if the place is of type kind Adt.
      ebedfedc
    • B
      Auto merge of #88165 - GuillaumeGomez:rollup-4o0v2ps, r=GuillaumeGomez · 6d64f7f6
      bors 提交于
      Rollup of 8 pull requests
      
      Successful merges:
      
       - #86123 (Preserve more spans in internal `rustc_queries!` macro)
       - #87874 (Add TcpStream type to TcpListener::incoming docs)
       - #88034 (rustc_privacy: Replace `HirId`s and `DefId`s with `LocalDefId`s where possible)
       - #88050 (Remove `HashStable` impls for `FileName` and `RealFileName`)
       - #88093 ([rustdoc] Wrap code blocks in `<code>` tag)
       - #88146 (Add tests for some `feature(const_evaluatable_checked)` incr comp issues)
       - #88153 (Update .mailmap)
       - #88159 (Use a trait instead of the now disallowed missing trait there)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      6d64f7f6
    • G
      Rollup merge of #88159 - spastorino:fix-unused-generic-param-test, r=oli-obk · 1095bb1e
      Guillaume Gomez 提交于
      Use a trait instead of the now disallowed missing trait there
      
      To properly test the unused generic parameter and just that we need to use a trait in the tait. Missing the trait there is already tested and is not what we meant to test here.
      
      r? `@oli-obk`
      1095bb1e
    • G
      Rollup merge of #88153 - hkmatsumoto:mailmap, r=Mark-Simulacrum · bcc3b4ef
      Guillaume Gomez 提交于
      Update .mailmap
      bcc3b4ef
    • G
      Rollup merge of #88146 - BoxyUwU:tests-cec-incr-comp, r=oli-obk · 01b0a8dc
      Guillaume Gomez 提交于
      Add tests for some `feature(const_evaluatable_checked)` incr comp issues
      
      Closes #77650
      Closes #79251
      
      #79251 didn't seem to be ICEing anymore so added regression tests for that aswell
      
      r? `@oli-obk`
      01b0a8dc
    • G
      Rollup merge of #88093 - Kobzol:rustdoc-wrap-code-in-code-tag, r=GuillaumeGomez · 10165f8a
      Guillaume Gomez 提交于
      [rustdoc] Wrap code blocks in <code> tag
      
      This PR modifies Rustdoc output so that fenced code snippets, items and whole file source codes are wrapped in `<pre><code>` instead of just `<pre>`. This should improve the semantic meaning of the generated content.
      
      I'm not sure what to do about `render_attributes_in_pre` and `render_attributes_in_code`. These functions were clearly expected to be used for things inside `<pre>` or `<code>`, and since I added `<code>` in this PR, some of them will be used in a different context than before. However, it seems to me that even before they were not consistent. For example, `item_constant` used `render_attributes_in_code` for its attributes, however there was no `<code>` used for constants before this PR...
      
      Should I create some `rustdoc-gui` tests? For example to check that all `<pre>` tags have a `<code>` child?
      
      Fixes: https://github.com/rust-lang/rust/issues/88020
      10165f8a
    • G
      Rollup merge of #88050 - Aaron1011:filename-hash-stable, r=michaelwoerister · 09d56a74
      Guillaume Gomez 提交于
      Remove `HashStable` impls for `FileName` and `RealFileName`
      
      These impls were unused, and incorrectly hashed the local
      (non-remapped) path for `RealFileName::Remapped` (which would
      break reproducible builds if these impls were used).
      09d56a74
    • G
      Rollup merge of #88034 - petrochenkov:localevel2, r=wesleywiser · 8b9a4c3c
      Guillaume Gomez 提交于
      rustc_privacy: Replace `HirId`s and `DefId`s with `LocalDefId`s where possible
      
      Follow up to https://github.com/rust-lang/rust/pull/87568
      8b9a4c3c
    • G
      Rollup merge of #87874 - schneems:schneems/tcpstream-iterator-type, r=Mark-Simulacrum · 6ce8a371
      Guillaume Gomez 提交于
      Add TcpStream type to TcpListener::incoming docs
      
      ## Context
      
      While going through the "The Rust Programming Language" book (Klabnik & Nichols), the TCP server example directs us to use TcpListener::incoming. I was curious how I could pass this value to a function (before reading ahead in the book), so I looked up the docs to determine the signature.
      
      When I opened the docs, I found https://doc.rust-lang.org/std/net/struct.TcpListener.html#method.incoming, which didn't mention TcpStream anywhere in the example.
      
      Eventually, I clicked on https://doc.rust-lang.org/std/net/struct.TcpListener.html#method.accept in the docs (after clicking a few other locations first), and was able to surmise that the value contained TcpStream.
      
      ## Opportunity
      
      While this type is mentioned several times in this doc, I feel that someone should be able to fully use the results of the TcpListner::incoming iterator based solely on the docs of just this method.
      
      ## Implementation
      
      I took the code from the top-level TcpListener https://doc.rust-lang.org/std/net/struct.TcpListener.html#method.incoming and blended it with the existing docs for TcpListener::incoming https://doc.rust-lang.org/std/net/struct.TcpListener.html#method.incoming.
      
      It does make the example a little longer, and it also introduces a little duplication. It also gives the reader the type signatures they need to move on to the next step.
      
      ## Additional considerations
      
      I noticed that in this doc, `handle_connection` and `handle_client` are both used to accept a TcpStream in the docs on this page. I want to standardize on one function name convention, so readers don't accidentally think two different concepts are being referenced. I didn't want to cram do too much in one PR, I can update this PR to make that change, or I could send another PR (if you would like).
      
      First attempted contribution to Rust (and I'm also still very new, hence reading through the rust book for the first time)! Would you please let me know what you think?
      6ce8a371
    • G
      Rollup merge of #86123 - Aaron1011:query-span, r=cjgillot · def6393a
      Guillaume Gomez 提交于
      Preserve more spans in internal `rustc_queries!` macro
      
      We now preserve the span of the various query modifiers, and
      use the span of the query's name for the commas that we
      generate to separate the modifiers. This makes debugging issues with the
      internal query macro infrastructure much nicer - previously, we
      would get errors messages pointing at the entire call site
      (the `rustc_queries!` invocation), which isn't very useful.
      
      This should have no effect when compilation succeeds.
      
      A concrete example of an error message produced after this changed:
      
      ```
      error: local ambiguity: multiple parsing options: built-in NTs tt ('modifiers') or 1 other option.
          --> /home/aaron/repos/rust/compiler/rustc_middle/src/query/mod.rs:23:11
           |
      12   | / rustc_queries! {
      13   | |     query trigger_delay_span_bug(key: DefId) -> () {
      14   | |         desc { "trigger a delay span bug" }
      15   | |     }
      ...    |
      23   | |     query hir_crate(key: ()) -> &'tcx Crate<'tcx> {
           | |           ^^^^^^^^^
      ...    |
      1715 | |     }
      1716 | | }
           | |_- in this expansion of `rustc_query_append!`
           |
          ::: compiler/rustc_query_impl/src/lib.rs:51:1
           |
      51   |   rustc_query_append! { [define_queries!][<'tcx>] }
           |   ------------------------------------------------- in this macro invocation
      ```
      
      The particular bug shown in this error message will be fixed
      in a separate PR.
      def6393a
    • B
      Auto merge of #88151 - alexcrichton:update-backtrace, r=Mark-Simulacrum · 7960030d
      bors 提交于
      Update the backtrace crate in libstd
      
      This commit updates the backtrace crate in libstd now that dependencies
      have been updated to use `memchr` from the standard library as well.
      This is mostly just making sure deps are up-to-date and have all the
      latest-and-greatest fixes and such.
      
      Closes rust-lang/backtrace-rs#432
      7960030d
  2. 19 8月, 2021 22 次提交
  3. 18 8月, 2021 7 次提交