The advantage of making these docs is mostly in pointing out that these
functions all make new allocations and copy/clone/move the source into them.
These docs are on the function, and not the `impl` block, to avoid showing
the "[+] show undocumented items" button.
CC #51430
Try fast_reject::simplify_type in coherence before doing full check
This is a reattempt at landing #69010 (by `@jonas-schievink).` The change adds a fast path for coherence checking to see if there's no way for types to unify since full coherence checking can be somewhat expensive.
This has big effects on code generated by the [`windows`](https://github.com/microsoft/windows-rs) which in some cases spends as much as 20% of compilation time in the `specialization_graph_of` query. In local benchmarks this took a compilation that previously took ~500 seconds down to ~380 seconds.
This is surely not going to make a difference on much smaller crates, so the question is whether it will have a negative impact. #69010 was closed because some of the perf suite crates did show small regressions.
Additional discussion of this issue is happening [here](https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/windows-rs.20perf).
Rollup of 16 pull requests
Successful merges:
- #79983 (fix indefinite article in cell.rs)
- #81831 (Don't display `mut` in arguments for functions documentation)
- #81947 (Relax ItemCtxt::to_ty lifetime)
- #81954 (RELEASES.md 1.50: Group platform support notes together)
- #81955 (bootstrap: Locate llvm-dwp based on llvm-config bindir)
- #81959 (Fix assosiated typo)
- #81964 (Fix documentation not showing on localStorage error)
- #81968 (bootstrap: fix wrong docs installation path)
- #81990 (Make suggestion of changing mutability of arguments broader)
- #81994 (Improve long explanation for E0542 and E0546)
- #81997 (dist: include src/build_helper as part of the crate graph for rustc-dev)
- #82003 (Stack probes: fix error message)
- #82004 (clean up clean::Static struct)
- #82011 (Fix private intra-doc warnings on associated items)
- #82013 (Tell user how to fix CI file being not up to date)
- #82017 (Fix typo in mod.rs)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Fix private intra-doc warnings on associated items
The issue was that the `kind, id` override was previously only being
considered for the disambiguator check, not the privacy check. This uses
the same ID for both.
Fixes https://github.com/rust-lang/rust/issues/81981.
r? ``@max-heller``
clean up clean::Static struct
Having a `String` for the expression didn't make much sense, and even less when it's actually not used (except in json so I kept it).
r? ``@jyn514``
dist: include src/build_helper as part of the crate graph for rustc-dev
The build_helper dependency is used to build the compiler/rustc_llvm build script.
Since it was missing, it wasn't possible to really use rustc-dev to
build, see for instance: https://github.com/rust-analyzer/rust-analyzer/issues/7589.
Make suggestion of changing mutability of arguments broader
Fix#81421
Previously rustc tries to emit the suggestion of changing mutablity unless `!trait_ref.has_infer_types_or_consts() && self.predicate_can_apply(obligation.param_env, trait_ref)` and this led to some false negatives to occur.
bootstrap: Locate llvm-dwp based on llvm-config bindir
Fixes#81949.
Tested by successfully building 1.50.0 pre-release, which is where I originally hit the issue (https://internals.rust-lang.org/t/rust-1-50-0-pre-release-testing/14012/4?u=dtolnay). Tested both with and without prebuilt LLVM. The check for dry_run is necessary in the non-prebuilt case because the llvm-config built by bootstrap won't exist yet.
BTreeMap: disentangle Drop implementation from IntoIter
No longer require every `BTreeMap` to dig up its last leaf edge before dying. This speeds up the `clone_` benchmarks by 25% for normal keys and values (far less for huge values).
r? `@Mark-Simulacrum`
The issue was that the `kind, id` override was previously only being
considered for the disambiguator check, not the privacy check. This uses
the same ID for both.
Unfortunately, this can't currently be tested. The problem is that we
need the file to be compiled first to then be used as dependency, which
cannot be done currently unfortunately in the rustdoc test suites.
Example:
```rust
// name this file "foo.rs"
/// ```
/// let x = foo::foo();
/// ```
pub fn foo() {}
```
If you run `rustdoc --test foo.rs`, you'll get:
```
running 1 test
test foo.rs - foo (line 1) ... FAILED
failures:
---- foo.rs - foo (line 1) stdout ----
error[E0463]: can't find crate for `foo`
--> foo.rs:0:1
|
2 | extern crate foo;
| ^^^^^^^^^^^^^^^^^ can't find crate
```
If a test were possible, it would look something like
````rust
#![crate_name = "mod"]
#![crate_type = "lib"]
//! ```
//! // NOTE: requires that the literal string 'mod' appears in the doctest for
//! // the bug to appear
//! assert_eq!(1, 1);
//! ```
````
Reduce log level used by tracing instrumentation from info to debug
Restore log level to debug to avoid make info log level overly verbose (the uses of instrument attribute modified there, were for the most part a replacement for `debug!`; one use was novel).