`#[structural_match]`.
Outline of changes:
* Recur as deeply as necessary when searching for `#[structural_match]`.
* `#[structural_match]`: handle case of `const A: & &Wrap(NoDerive)`
by including the fields of an ADT during traversal of input
type. (We continue to not traverse the substs of an ADT, though, so
that we continue to handle `PhantomData<NoDerive>` and `*NoDerive`
properly.)
* Refactored code to use `match` instead of `if let`. This ends up
*with less* right-ward drift by moving the handling of the main
*`ty::Adt` case *outside* the match.
* Using lint (rather than hard error) mmeans we need to check that
type is `PartialEq` to avoid ICE'ing the compiler in scneario where
MIR codegen dispatches to `PartialEq::eq`. Added said check, and
fatal error in that case.
Rollup of 5 pull requests
Successful merges:
- #62356 (Implement Option::contains and Result::contains)
- #62462 (Document `while` keyword)
- #62472 (Normalize use of backticks in compiler messages p2)
- #62477 (Re-add bootstrap attribute to libunwind for llvm-libunwind feature)
- #62478 (normalize use of backticks for compiler messages in librustc_codegen)
Failed merges:
r? @ghost
Re-add bootstrap attribute to libunwind for llvm-libunwind feature
This was removed in 8a7dded, but since #62286 hasn't yet made it into
beta, this is breaking the build with llvm-libunwind feature enabled.
Furthemore, restrict the link attribute to Fuchsia and Linux, matching
the logic in build.rs since llvm-libunwind feature isn't yet supported
on other systems.
This was removed in 8a7dded, but since #62286 hasn't yet made it into
beta, this is breaking the build with llvm-libunwind feature enabled.
Furthemore, restrict the link attribute to Fuchsia and Linux, matching
the logic in build.rs since llvm-libunwind feature isn't yet supported
on other systems.
- uses a never-stable core::array::LengthAtMost32 to bound the impls
- includes a custom error message to avoid mentioning LengthAtMost32 too often
- doesn't use macros for the slice implementations to avoid #62433
Rollup of 4 pull requests
Successful merges:
- #61883 (`non_ascii_idents` lint (part of RFC 2457))
- #62042 (Support stability and deprecation checking for all macros)
- #62213 (rustdoc: set cfg(doctest) when collecting doctests)
- #62286 (Check if the archive has already been added to avoid duplicates)
Failed merges:
r? @ghost
Check if the archive has already been added to avoid duplicates
This avoids adding archives multiple times, which results in duplicate
objects in the resulting rlib, leading to symbol collision and link
failures. This could happen when crate contains multiple link attributes
that all reference the same archive.
rustdoc: set cfg(doctest) when collecting doctests
Note: This PR builds on top of https://github.com/rust-lang/rust/pull/61199; only the last commit is specific to this PR.
As discussed in https://github.com/rust-lang/rust/pull/61199, we want the ability to isolate items to only when rustdoc is collecting doctests, but we can't use `cfg(test)` because of libcore's `#![cfg(not(test))]`. This PR proposes a new cfg flag, `cfg(doctest)`, specific to this situation, rather than reusing an existing flag. I've isolated it behind a feature gate so that we can contain the effects to nightly only. (A stable workaround that can be used in lieu of `#[cfg(doctest)]` is `#[cfg(rustdoc)] #[doc(hidden)]`, at least once https://github.com/rust-lang/rust/pull/61351 lands.)
Tracking issue: https://github.com/rust-lang/rust/issues/62210
`non_ascii_idents` lint (part of RFC 2457)
RFC 2457 [declares](121bbeff50/text/2457-non-ascii-idents.md): "A `non_ascii_idents` lint is added to the compiler. This lint is allow by default."
(Part of #55467.)
r? @Manishearth