Rollup of 15 pull requests
Successful merges:
- #62860 (Stabilize checked_duration_since for 1.38.0)
- #63549 (Rev::rposition counts from the wrong end)
- #63985 (Stabilize pin_into_inner in 1.39.0)
- #64005 (Add a `Place::is_indirect` method to determine whether a `Place` contains a `Deref` projection)
- #64031 (Harden `param_attrs` test wrt. usage of a proc macro `#[attr]`)
- #64038 (Check impl trait substs when checking for recursive types)
- #64043 (Add some more tests for underscore imports)
- #64092 (Update xLTO compatibility table in rustc book.)
- #64110 (Refer to "`self` type" instead of "receiver type")
- #64120 (Move path parsing earlier)
- #64123 (Added warning around code with reference to uninit bytes)
- #64128 (unused_parens: account for or-patterns and `&(mut x)`)
- #64141 (Minimize uses of `LocalInternedString`)
- #64142 (Fix doc links in `std::cmp` module)
- #64148 (fix a few typos in comments)
Failed merges:
r? @ghost
Minimize uses of `LocalInternedString`
`LocalInternedString` is described as "An alternative to `Symbol` and `InternedString`, useful when the chars within the symbol need to be accessed. It is best used for temporary values."
This PR makes the code match that comment, by removing all non-local uses of `LocalInternedString`. This allows the removal of a number of operations on `LocalInternedString` and a couple of uses of `unsafe`.
Added warning around code with reference to uninit bytes
Officially, uninitialized integers, and therefore, Rust references to them are _invalid_ (note that this may evolve into official defined behavior (_c.f._, https://github.com/rust-lang/unsafe-code-guidelines/issues/71)).
However, `::std` uses references to uninitialized integers when working with the `Read::initializer` feature (#42788), since it relies on this unstably having defined behavior with the current implementation of the compiler (IIUC).
Hence the comment to disincentivize people from using this pattern outside the standard library.
Update xLTO compatibility table in rustc book.
This is a combination known to work reliable when building Firefox on all the major platforms.
r? @alexcrichton
Add a `Place::is_indirect` method to determine whether a `Place` contains a `Deref` projection
Working on #63860 requires tracking some property about each local. This requires differentiating `Place`s like `x` and `x.field[index]` from ones like `*x` and `*x.field`, since the first two will always access the same region of memory as `x` while the latter two may access any region of memory. This functionality is duplicated in various places across the compiler. This PR adds a helper method to `Place` which determines whether that `Place` has a `Deref` projection at any point and changes some existing code to use the new method.
I've not converted `qualify_consts.rs` to use the new method, since it's not a trivial conversion and it will get replaced anyway by #63860. There may be other potential uses besides the two I change in this PR.
r? @oli-obk
Rustbuild usually writes the LLVM submodule commit in a stamp file, so
we can avoid rebuilding it unnecessarily. However, for builds from a
source tarball (non-git), we were assuming a rebuild is always needed.
This can cause a lot of extra work if any environment like `CFLAGS`
changed between steps like build and install, which are often separate
in distro builds.
Now we also write an empty stamp file if the git commit is unknown, and
its presence is trusted to indicate that no rebuild is needed. An info
message reports that this is happening, along with the stamp file path
that can be deleted to force a rebuild anyway.