Auto merge of #70884 - Dylan-DPC:rollup-r3raqdf, r=jonas-schievink
Rollup of 5 pull requests
Successful merges:
- #70201 (Small tweaks in ToOwned::clone_into)
- #70762 (Miri leak check: memory reachable through globals is not leaked)
- #70846 (Keep codegen units unmerged when building compiler builtins)
- #70854 (Use assoc int submodules)
- #70857 (Don't import integer and float modules, use assoc consts 2)
Rollup merge of #70857 - faern:use-assoc-int-float-consts, r=dtolnay
Don't import integer and float modules, use assoc consts 2
Follow up to #70777. I missed quite a lot of places. Partially because I wanted to keep the size of the last PR down, and partially because my regexes were not good enough :)
Rollup merge of #70854 - faern:use-assoc-int-submodules, r=dtolnay
Use assoc int submodules
Bumping some submodules to the commits their masters currently point at. The main point of this is to get the associated integer/float constant documentation updates that were recently merged to them:
Rollup merge of #70846 - tmiasko:compiler-builtins-codegen-units, r=alexcrichton
Keep codegen units unmerged when building compiler builtins
Make it possible to control how mono items are partitioned into code generation
units, when compiling the compiler builtins, by retaining the original partitioning.
Rollup merge of #70762 - RalfJung:miri-leak-check, r=oli-obk
Miri leak check: memory reachable through globals is not leaked
Also make Miri memory dump prettier by sharing more code with MIR dumping, and fix a bug where the Miri memory dump would print some allocations twice.
Rollup merge of #70201 - cuviper:clone_into, r=dtolnay
Small tweaks in ToOwned::clone_into
- `<[T]>::clone_into` is slightly more optimized.
- `CStr::clone_into` is new, letting it reuse its allocation.
- `OsStr::clone_into` now forwards to the underlying slice/`Vec`.
Auto merge of #70164 - eddyb:walk-generic-arg, r=nikomatsakis
ty/walk: iterate `GenericArg`s instead of `Ty`s.
Before this PR, `Ty::walk` only iterated over `Ty`s, but that's becoming an increasing problem with `const` generics, as `ty::Const`s in `Substs` are missed by it.
By working with `GenericArg` instead, we can handle both `Ty`s and `ty::Const`s, but also `ty::Region`s, which used to require ad-hoc mechanisms such as `push_regions`.
I've also removed `TraitRef::input_types`, as it's both long obsolete, and easy to misuse.
Auto merge of #70832 - Centril:rollup-ixc09ve, r=Centril
Rollup of 5 pull requests
Successful merges:
- #70519 (Tweak output of type params and constraints in the wrong order)
- #70704 (Make panic unwind the default for aarch64-*-windows-msvc targets)
- #70713 (Prefer sysroot from rustc in same directory as rust-gdb)
- #70739 (def_collector, visit_fn: account for no body)
- #70827 (Use smaller span for suggestion restricting lifetime)
Auto merge of #70826 - Centril:rollup-yn0hc1h, r=Centril
Rollup of 7 pull requests
Successful merges:
- #70553 (move OS constants to platform crate)
- #70665 (Do not lose or reorder user-provided linker arguments)
- #70750 (Match options directly in the Fuse implementation)
- #70782 (Stop importing the float modules in documentation)
- #70798 ("cannot resolve" → "cannot satisfy")
- #70808 (Simplify dtor registration for HermitCore by using a list of destructors)
- #70824 (Remove marker comments in libstd/lib.rs macro imports)
Rollup merge of #70824 - yoshuawuyts:fix-labels-in-std-macro-imports, r=Mark-Simulacrum
Remove marker comments in libstd/lib.rs macro imports
These comments were probably moved around when rustfmt was introduced. They don't correctly denote what they were intended for, so I propose we remove them instead. Thanks!
Rollup merge of #70782 - faern:use-assoc-float-consts, r=dtolnay
Stop importing the float modules in documentation
Follow up to #69860. I realized I had not searched for and fixed this for the float values. So with this PR they also use the associated constants instead of the module level constants.
For the documentation where it also was using the `consts` submodule I opted to change it to import that directly. This becomes more in line with how other docs that use the `consts` submodule looks. And it also makes it so there are not two `f32` or `f64` things in the current namespace (both the module and the primitive type) and then hopefully confusing documentation readers less.
Rollup merge of #70750 - cuviper:direct-fuse, r=scottmcm
Match options directly in the Fuse implementation
Rather than using `as_ref()`, `as_mut()`, and `?`, we can use `match` directly to save a lot of generated code. This was mentioned as a possibility in https://github.com/rust-lang/rust/pull/70366#issuecomment-603462546, and I found that it had a very large impact on #70332 using `Fuse` within `Chain`. Let's evaluate this change on its own first.
Rollup merge of #70665 - petrochenkov:linkargs, r=nagisa
Do not lose or reorder user-provided linker arguments
Linker arguments are potentially order-dependent, so the order in which `-C link-arg` and `-C link-args` options are passed to `rustc` should be preserved when they are passed further to the linker.
Also, multiple `-C link-args` options are now appended to each other rather than overwrite each other.
In other words, `-C link-arg=a -C link-args="b c" -C link-args="d e" -C link-arg=f` is now passed as `"a" "b" "c" "d" "e" "f"` and not as `"d" "e" "a" "f"`.
Auto merge of #70816 - Dylan-DPC:rollup-kzcs8px, r=Dylan-DPC
Rollup of 5 pull requests
Successful merges:
- #67797 (Query-ify Instance::resolve)
- #70777 (Don't import integer and float modules, use assoc consts)
- #70795 (Keep track of position when deleting from a BTreeMap)
- #70812 (Do not use "nil" to refer to `()`)
- #70815 (Enable layout debugging for `impl Trait` type aliases)
Rollup merge of #70812 - rossmacarthur:fix/unit-called-nil, r=LukasKalbertodt
Do not use "nil" to refer to `()`
"nil" is not used in the [book](https://doc.rust-lang.org/book) or in the [standard library](https://doc.rust-lang.org/std) anywhere else. Because "nil" is often used in programming languages to refer to "None" or "null" I think it could be a little confusing for newcomers to see this type referred to as "nil".
Rollup merge of #70777 - faern:use-assoc-int-consts2, r=dtolnay
Don't import integer and float modules, use assoc consts
Stop importing the standard library integer and float modules to reach the `MIN`, `MAX` and other constants. They are available directly on the primitive types now.
This PR is a follow up of #69860 which made sure we use the new constants in documentation.
This type of change touches a lot of files, and previously all my assoc int consts PRs had collisions and were accepted only after a long delay. So I'd prefer to do it in smaller steps now. Just removing these imports seem like a good next step.
Auto merge of #70807 - Dylan-DPC:rollup-qd1kgl2, r=Dylan-DPC
Rollup of 5 pull requests
Successful merges:
- #70558 (Fix some aliasing issues in Vec)
- #70760 (docs: make the description of Result::map_or more clear)
- #70769 (Miri: remove an outdated FIXME)
- #70776 (clarify comment in RawVec::into_box)
- #70806 (fix Miri assignment sanity check)
Rollup merge of #70769 - RalfJung:fixed, r=Dylan-DPC
Miri: remove an outdated FIXME
We even [have a test ](https://github.com/rust-lang/rust/blob/49dc2f9f091748beb1a8a9d5b3eb3bbe7362c3bd/src/test/ui/consts/miri_unleashed/drop.rs) making sure that we detect dropping with a non-const implementation.
Rollup merge of #70760 - PonasKovas:docs, r=Dylan-DPC
docs: make the description of Result::map_or more clear
The documentation of [`Result::map_or`](https://doc.rust-lang.org/std/result/enum.Result.html#method.map_or) is very unclear and confusing, probably because it was copied straight from [`Option::map_or`](https://doc.rust-lang.org/std/option/enum.Option.html#method.map_or) and someone forgot to adapt it for Result.