1. 15 9月, 2021 1 次提交
  2. 14 9月, 2021 14 次提交
  3. 13 9月, 2021 13 次提交
  4. 12 9月, 2021 12 次提交
    • G
    • B
      Auto merge of #88881 - Manishearth:rollup-alohfwx, r=Manishearth · c7dbe7a8
      bors 提交于
      Rollup of 7 pull requests
      
      Successful merges:
      
       - #88336 ( Detect stricter constraints on gats where clauses in impls vs trait)
       - #88677 (rustc: Remove local variable IDs from `Export`s)
       - #88699 (Remove extra unshallow from cherry-pick checker)
       - #88709 (generic_const_exprs: use thir for abstract consts instead of mir)
       - #88711 (Rework DepthFirstSearch API)
       - #88810 (rustdoc: Cleanup `clean` part 1)
       - #88813 (explicitly link to external `ena` docs)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      c7dbe7a8
    • M
      Rollup merge of #88813 - lcnr:ena-docs, r=jyn514 · 146aee66
      Manish Goregaokar 提交于
      explicitly link to external `ena` docs
      
      we currently do not link to the docs of `ena`: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxtInner.html#method.const_unification_table
      146aee66
    • M
      Rollup merge of #88810 - camelid:cleanup-pt1, r=jyn514 · b3af37ac
      Manish Goregaokar 提交于
      rustdoc: Cleanup `clean` part 1
      
      Split out from #88379.
      
      These commits are completely independent of each other, and each is a fairly
      small change (the last few are new commits; they are not from #88379):
      
      - Remove unnecessary `Cache.*_did` fields
      - rustdoc: Get symbol for `TyParam` directly
      - Create a valid `Res` in `external_path()`
      - Remove unused `hir_id` parameter from `resolve_type`
      - Fix redundant arguments in `external_path()`
      - Remove unnecessary `is_trait` argument
      - rustdoc: Cleanup a pattern match in `external_generic_args()`
      
      r? ``@jyn514``
      b3af37ac
    • M
      Rollup merge of #88711 - Mark-Simulacrum:fix-dfs-bug, r=jackh726 · b87d0d0d
      Manish Goregaokar 提交于
      Rework DepthFirstSearch API
      
      This expands the API to be more flexible, allowing for more visitation patterns
      on graphs. This will be useful to avoid extra datasets (and allocations) in
      cases where the expanded DFS API is sufficient.
      
      This also fixes a bug with the previous DFS constructor, which left the start
      node not marked as visited (even though it was immediately returned).
      
      Commit written by ```@nikomatsakis``` originally, cherry picked from several commits in work on never type stabilization, but stands alone.
      b87d0d0d
    • M
      Rollup merge of #88709 - BoxyUwU:thir-abstract-const, r=lcnr · f5ac5cad
      Manish Goregaokar 提交于
      generic_const_exprs: use thir for abstract consts instead of mir
      
      Changes `AbstractConst` building to use `thir` instead of `mir` so that there's less chance of consts unifying when they shouldn't because lowering to mir dropped information (see `abstract-consts-as-cast-5.rs` test)
      
      r? `@lcnr`
      f5ac5cad
    • M
      Rollup merge of #88699 - Mark-Simulacrum:fixes-cherry-picker, r=pietroalbini · a8e3afe3
      Manish Goregaokar 提交于
      Remove extra unshallow from cherry-pick checker
      
      This is already done by https://github.com/rust-lang/rust/blob/13db8440bbbe42870bc828d4ec3e965b38670277/src/ci/init_repo.sh#L32-L36 on the beta channel, and git throws an error if you attempt to unshallow an already non-shallow repository.
      
      r? ```@pietroalbini```
      a8e3afe3
    • M
      Rollup merge of #88677 - petrochenkov:exportid, r=davidtwco · bb5ca58d
      Manish Goregaokar 提交于
      rustc: Remove local variable IDs from `Export`s
      
      Local variables can never be exported.
      bb5ca58d
    • M
      Rollup merge of #88336 - jackh726:gats-where-constraints, r=estebank · 6d4f27eb
      Manish Goregaokar 提交于
       Detect stricter constraints on gats where clauses in impls vs trait
      
      I might try to see if I can do a bit more to improve these diagnostics, but any initial feedback is appreciated. I can also do any additional work in a followup PR.
      
      r? `@estebank`
      6d4f27eb
    • B
      Auto merge of #88771 - jackh726:wf_tys_set, r=nikomatsakis · 9ef27bf7
      bors 提交于
      Use FxHashSet instead of Vec for well formed tys
      
      Trying to recover perf from #88312
      
      r? `@ghost`
      9ef27bf7
    • B
      Auto merge of #88765 - mk12:update-llvm, r=cuviper · 0212c70b
      bors 提交于
      Update LLVM submodule
      
      This merges upstream `release/13.x` changes to our fork. In particular,
      this includes the bugfix https://reviews.llvm.org/D108608 (see also
      https://bugs.llvm.org/show_bug.cgi?id=51637).
      
      The motivation for this is fixing Rust coverage in Fuchsia: https://fxbug.dev/77427.
      0212c70b
    • B
      Auto merge of #87073 - jyn514:primitive-docs, r=GuillaumeGomez,jyn514 · 0273e3bc
      bors 提交于
      Fix rustdoc handling of primitive items
      
      This is a complicated PR and does a lot of things. I'm willing to split it up a little more if it would help reviewing, but it would be tricky and I'd rather not unless it's necessary.
      
       ## What does this do?
      
      - Fixes https://github.com/rust-lang/rust/issues/73423.
      - Fixes https://github.com/rust-lang/rust/issues/79630. I'm not sure how to test this for the standard library explicitly, but you can see from some of the diffs from the `no_std` tests. I also tested it locally and it works correctly: ![image](https://user-images.githubusercontent.com/23638587/125214383-e1fdd000-e284-11eb-8048-76b5df958aad.png)
      - Fixes https://github.com/rust-lang/rust/issues/83083.
      
      ## Why are these changes interconnected?
      
      - Allowing anchors (https://github.com/rust-lang/rust/issues/83083) without fixing the online/offline problem (https://github.com/rust-lang/rust/issues/79630) will actually just silently discard the anchors, that's not a fix. The online/offline problem is directly related to the fragment hack; links need to go through `fn href()` to be fixed.
      - Technically I could fix the online/offline problem without removing the error on anchors; I am willing to separate that out if it would be helpful for reviewing. However I can't fix the anchor problem without adding docs to core, since rustdoc needs all those primitives to have docs to avoid a fallback, and currently `#![no_std]` crates don't have docs for primitives. I also can't fix the online/offline problem without removing the fragment hack, since otherwise diffs like this will be wrong for some primitives but not others:
      ```diff
      `@@` -385,7 +381,7 `@@` fn resolve_primitive_associated_item(
                               ty::AssocKind::Const => "associatedconstant",
                               ty::AssocKind::Type => "associatedtype",
                           };
      -                    let fragment = format!("{}#{}.{}", prim_ty.as_sym(), out, item_name);
      +                    let fragment = format!("{}.{}", out, item_name);
                           (Res::Primitive(prim_ty), fragment, Some((kind.as_def_kind(), item.def_id)))
                       })
               })
      ```
      - Adding primitive docs to core without making any other change will cause links to go to `core` instead of `std`, even for crates with `extern crate std`. See "Breaking changes to doc(primitive)" below for why this is the case. That said, I could add some special casing to rustdoc at the same time that would let me separate this change from the others (it would fix https://github.com/rust-lang/rust/issues/73423 but still special-case intra-doc links). I'm willing to separate that out if helpful for reviewing.
      
      ### Add primitive documentation to libcore
      
      This works by reusing the same `include!("primitive_docs.rs")` file in both core and std, and then special-casing links in core to use relative links instead of intra-doc links. This doesn't use purely intra-doc links because some of the primitive docs links to items only in std; this doesn't use purely relative links because that introduces new broken links when the docs are re-exported (e.g. String's `&str` deref impl, or Vec's slice deref impl).
      
      Note that this copies the whole file to core, to avoid anyone compiling core to have to set `CARGO_PKG_NAME`. See https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Who.20should.20review.20changes.20to.20linkchecker.3F/near/249939598 for more context. It also adds a tidy check to make sure the two files are kept in sync.
      
      ### Fix inconsistent online/offline primitive docs
      
      This does four things:
      - Records modules with `doc(primitive)` in `cache.external_paths`. This is necessary for `href()` to find them later.
      - Makes `cache.primitive_locations` available to the intra-doc link pass, by refactoring out a `PrimitiveType::primitive_locations` function that only uses `TyCtxt`.
      - Special cases modules with `doc(primitive)` to be treated as always public for the purpose of links.
      - Removes the fragment hack. cc `@notriddle,` I know you added some comments about this in the code (thank you for that!)
      
      ### Breaking changes to `doc(primitive)`
      
      "Breaking" is a little misleading here - these are changes in behavior, none of them will cause code to fail to compile.
      
      Let me preface this by saying I think stabilizing `doc(primitive)` was a uniquely terrible idea. As far as I can tell, it was stabilized by oversight; it's been stable since 1.0. No one should have need to use it except the standard library, and a crater run shows that in fact no one is using it: https://github.com/rust-lang/rust/pull/87050#issuecomment-886166706. I hope to actually make `doc(primitive)` a no-op unless you opt-in with a nightly feature, which will keep crates compiling without forcing rustdoc into trying to keep somewhat arbitrary behavior guarantees; but for now, this just subtly changes some of the behavior if you use `doc(primitive)` in a dependency.
      
      That said, here are the changes:
      -  Refactoring out `primitive_locations()` is technically a change in behavior, since it no longer looks for primitives in crates that were passed through `--extern`, but not used by the crate; however, that seems like such an unlikely edge case it's not worth dealing with.
      - The precedence given to primitive locations is no longer just arbitrary, it can also be inconsistent from run to run. Let me explain that more: previously, primitive locations were sorted by the `CrateNum`; the comment on that sort said "Favor linking to as local extern as possible, so iterate all crates in reverse topological order." Unfortunately, that's not actually what CrateNum tracks: it measures the order crates are loaded, not the number of intermediate crates between that dependency and the root crate. It happened to work as intended before because the compiler injects `extern crate std;` at the top of every crate, which ensured it would have the first CrateNum other than the current, but every other CrateNum was completely arbitrary (for example, `core` often had a later CrateNum than `std`). This now removes the sort on CrateNum completely and special-cases core instead. In particular, if you depend on both `std` and a crate which defines a `doc(primitive)` module, it's arbitrary whether rustdoc will use the docs from std or the ones from the other crate. cc `@alexcrichton,` you wrote this originally.
      
      cc `@rust-lang/rustdoc`
      cc `@rust-lang/libs` for the addition to `core` (the commit you're interested in is https://github.com/rust-lang/rust/pull/87073/commits/91346c8293bb5f41d8e1d2ec9336433664652c53)
      0273e3bc