Commit Graph

41172 Commits

Author SHA1 Message Date
Matthias Krüger
5c81dbf4fa
Rollup merge of #132134 - nnethercote:rm-ResultsVisitable, r=cjgillot
Remove `ResultsVisitable`

`ResultsVisitable` has annoyed me for a while. This PR removes it. Details in the individual commits.

r? `@cjgillot.`
2024-11-16 21:05:44 +01:00
bors
46e8d20301 Auto merge of #130443 - veluca93:legacy-const-generics-fix, r=BoxyUwU
Fix ICE when passing DefId-creating args to legacy_const_generics.

r? BoxyUwU

Fixes #123077
Fixes #129150
2024-11-16 04:57:15 +00:00
Luca Versari
b462c68aee Fix ICE when passing DefId-creating args to legacy_const_generics. 2024-11-16 01:07:51 +01:00
Guillaume Gomez
fc8d2b38d8
Rollup merge of #133080 - ehuss:edition-desugar-span, r=compiler-errors
Fix span edition for 2024 RPIT coming from an external macro

This fixes a problem where code generated by an external macro with an RPIT would end up using the call-site edition instead of the macro's edition for the RPIT. When used from a 2024 crate, this caused the code to change behavior to the 2024 capturing rules, which we don't want.

This was caused by the impl-trait lowering code would replace the span with one marked with `DesugaringKind::OpaqueTy` desugaring. However, it was also overriding the edition of the span with the edition of the local crate. Instead it should be using the edition of the span itself.

Fixes https://github.com/rust-lang/rust/issues/132917
2024-11-15 23:38:12 +01:00
Guillaume Gomez
b3e2981ff7
Rollup merge of #132978 - WaffleLapkin:very-semantic-change-kind, r=compiler-errors
Mention both release *and* edition breakage for never type lints

This PR makes ~~two changes~~ a change to the never type lints (`dependency_on_unit_never_type_fallback` and `never_type_fallback_flowing_into_unsafe`):
1.  Change the wording of the note to mention that the breaking change will be made in an edition _and_ in a future release
2. ~~Make these warnings be reported in deps (hopefully the lints are matured enough)~~

r? ``@compiler-errors``
cc ``@ehuss``
closes #132930
2024-11-15 23:38:10 +01:00
Guillaume Gomez
325bc6c201
Rollup merge of #132956 - maxcabrajac:coroutine_kind, r=petrochenkov
Add visit_coroutine_kind to ast::Visitor

r? ``@petrochenkov``

related to #128974
2024-11-15 23:38:10 +01:00
Guillaume Gomez
1f83a4de1f
Rollup merge of #132936 - surechen:fix_131989, r=Nadrieril
For expr `return (_ = 42);` unused_paren lint should not be triggered

fixes #131989
2024-11-15 23:38:09 +01:00
bors
917a50a039 Auto merge of #133079 - matthiaskrgr:rollup-k8u7syk, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #132817 (Recurse into APITs in `impl_trait_overcaptures`)
 - #133021 (Refactor `configure_annotatable`)
 - #133045 (tests: Test pac-ret flag merging on clang with LTO)
 - #133049 (Change Visitor::visit_precise_capturing_arg so it returns a Visitor::Result)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-15 19:13:57 +00:00
Eric Huss
03e2828e88 Fix span edition for 2024 RPIT coming from an external macro
This fixes a problem where code generated by an external macro with an
RPIT would end up using the call-site edition instead of the macro's
edition for the RPIT. When used from a 2024 crate, this caused the code
to change behavior to the 2024 capturing rules, which we don't want.

This was caused by the impl-trait lowering code would replace the span
with one marked with `DesugaringKind::OpaqueTy` desugaring. However, it
was also overriding the edition of the span with the edition of the
local crate. Instead it should be using the edition of the span itself.

Fixes https://github.com/rust-lang/rust/issues/132917
2024-11-15 10:06:53 -08:00
Matthias Krüger
a111716c42
Rollup merge of #133049 - maxcabrajac:visit_precise_capturing_arg, r=compiler-errors
Change Visitor::visit_precise_capturing_arg so it returns a Visitor::Result

r? `@petrochenkov`

related to #128974
2024-11-15 19:05:18 +01:00
Matthias Krüger
6963572c78
Rollup merge of #133021 - nnethercote:refactor-configure_annotatable, r=petrochenkov
Refactor `configure_annotatable`

This PR streamlines `configure_annotatable` and nearby code considerably.

r? `@petrochenkov`
2024-11-15 19:05:16 +01:00
Matthias Krüger
213803549a
Rollup merge of #132817 - compiler-errors:impl-trait-overcaptures-apit, r=BoxyUwU
Recurse into APITs in `impl_trait_overcaptures`

We were previously not detecting cases where an RPIT was located in the return type of an async function, leading to underfiring of the `impl_trait_overcaptures`. This PR does this recursion properly now.

cc https://github.com/rust-lang/rust/issues/132809
2024-11-15 19:05:15 +01:00
bors
ce40196577 Auto merge of #132992 - RalfJung:check-consts-feature-gate, r=compiler-errors
check_consts: fix error requesting feature gate when that gate is not actually needed

When working on https://github.com/rust-lang/hashbrown/pull/586 I noticed that the compiler asks for the `rustc_private` feature to be enabled if one forgets to set `rustc_const_stable_indirect` on a function -- but enabling `rustc_private` would not actually help. This fixes the diagnostics.

r? `@compiler-errors`
2024-11-15 16:03:47 +00:00
Piotr Osiewicz
42e71bb8ea rustc_metadata: Preprocess search paths for better performance
Over in Zed we've noticed that loading crates for a large-ish workspace can take almost 200ms. We've pinned it down to how rustc searches for paths, as it performs a linear search over the list of candidate paths. In our case the candidate list had about 20k entries which we had to iterate over for each dependency being loaded.

This commit introduces a simple FilesIndex that's just a sorted Vec under the hood. Since crates are looked up by both prefix and suffix, we perform a range search on said Vec (which constraints the search space based on prefix) and follow up with a linear scan of entries with matching suffixes.
FilesIndex is also pre-filtered before any queries are performed using available target information; query prefixes/sufixes are based on the target we are compiling for, so we can remove entries that can never match up front.

Overall, this commit brings down build time for us in dev scenarios by about 6%.
100ms might not seem like much, but this is a constant cost that each of our workspace crates has to pay, even when said crate is miniscule.
2024-11-15 10:35:33 +01:00
bors
251dc8ad84 Auto merge of #133059 - workingjubilee:rollup-rc5kvr1, r=workingjubilee
Rollup of 8 pull requests

Successful merges:

 - #132790 (Add as_slice/into_slice for IoSlice/IoSliceMut.)
 - #132905 ([AIX] Add crate "unwind" to link with libunwind)
 - #132977 (Fix compilation error on Solaris due to flock usage)
 - #132984 ([illumos] use pipe2 to create anonymous pipes)
 - #133019 (docs: Fix missing period and colon in methods for primitive types)
 - #133048 (use `&raw` in `{read, write}_unaligned` documentation)
 - #133050 (Always inline functions signatures containing `f16` or `f128`)
 - #133053 (tests: Fix the SIMD FFI tests with certain x86 configuration)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-15 03:29:57 +00:00
Jubilee
cea081e980
Rollup merge of #133050 - tgross35:inline-f16-f128, r=saethlin
Always inline functions signatures containing `f16` or `f128`

There are a handful of tier 2 and tier 3 targets that cause a LLVM crash or linker error when generating code that contains `f16` or `f128`. The cranelift backend also does not support these types. To work around this, every function in `std` or `core` that contains these types must be marked `#[inline]` in order to avoid sending any code to the backend unless specifically requested.

However, this is inconvenient and easy to forget. Introduce a check for these types in the frontend that automatically inlines any function signatures that take or return `f16` or `f128`.

Note that this is not a perfect fix because it does not account for the types being passed by reference or as members of aggregate types, but this is sufficient for what is currently needed in the standard library.

Fixes: https://github.com/rust-lang/rust/issues/133035
Closes: https://github.com/rust-lang/rust/pull/133037
2024-11-14 17:55:27 -08:00
bors
3bc6916f4c Auto merge of #132965 - mati865:cfguard-gnullvm, r=wesleywiser
allow CFGuard on windows-gnullvm

No unit tests because of https://github.com/rust-lang/rust/issues/132278
2024-11-15 00:21:07 +00:00
Trevor Gross
5d818914af Always inline functions signatures containing f16 or f128
There are a handful of tier 2 and tier 3 targets that cause a LLVM crash
or linker error when generating code that contains `f16` or `f128`. The
cranelift backend also does not support these types. To work around
this, every function in `std` or `core` that contains these types must
be marked `#[inline]` in order to avoid sending any code to the backend
unless specifically requested.

However, this is inconvenient and easy to forget. Introduce a check for
these types in the frontend that automatically inlines any function
signatures that take or return `f16` or `f128`.

Note that this is not a perfect fix because it does not account for the
types being passed by reference or as members of aggregate types, but
this is sufficient for what is currently needed in the standard library.

Fixes: https://github.com/rust-lang/rust/issues/133035
Closes: https://github.com/rust-lang/rust/pull/133037
2024-11-14 16:18:41 -06:00
bors
e84902d35a Auto merge of #133047 - matthiaskrgr:rollup-9se1vth, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #128197 (Skip locking span interner for some syntax context checks)
 - #133040 ([rustdoc] Fix handling of footnote reference in footnote definition)
 - #133043 (rustdoc-search: case-sensitive only when capitals are used)
 - #133046 (Clippy subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-14 21:09:28 +00:00
maxcabrajac
9fde49b338 Change visit_precise_capturing_arg so it returns a Self::Result 2024-11-14 17:07:46 -03:00
Matthias Krüger
e158303c09
Rollup merge of #128197 - Alexendoo:span-ctxt, r=davidtwco
Skip locking span interner for some syntax context checks

- `from_expansion` now never needs to consult the interner
- `eq_ctxt` now only needs the interner when both spans are fully interned
2024-11-14 20:45:12 +01:00
Guillaume Gomez
5ee347ece4
Rollup merge of #132172 - dianne:suggest-borrow-generic, r=matthewjasper
borrowck diagnostics: suggest borrowing function inputs in generic positions

# Summary
This generalizes borrowck's existing suggestions to borrow instead of moving when passing by-value to a function that's generic in that input. Previously, this was special-cased to `AsRef`/`Borrow`-like traits and `Fn`-like traits. This PR changes it to test if, for a moved place with type `T`, that the callee's signature and clauses don't break if you substitute in `&T` or `&mut T`. For instance, it now works with `Read`/`Write`-like traits.

Fixes https://github.com/rust-lang/rust/issues/131413

# Incidental changes
- No longer spuriously suggests mutable borrows of closures in some situations (see e.g. the tests in [tests/ui/closures/2229_closure_analysis/](https://github.com/rust-lang/rust/compare/master...dianne:rust:suggest-borrow-generic?expand=1#diff-8dfb200c559f0995d0f2ffa2f23bc6f8041b263e264e5c329a1f4171769787c0)).
- No longer suggests cloning closures that implement `Fn`, since they can be borrowed (see e.g. [tests/ui/moves/borrow-closures-instead-of-move.stderr](https://github.com/rust-lang/rust/compare/master...dianne:rust:suggest-borrow-generic?expand=1#diff-5db268aac405eec56d099a72d8b58ac46dab523cf013e29008104840168577fb)).

This keeps the behavior to suppress suggestions of `fn_once.clone()()`. I think it might make sense to suggest it with a "but this might not be your desired behavior" caveat, as is done when something is used after being consumed as the receiver for a method call. That's probably out of the scope of this PR though.

# Limitations and possible improvements
- This doesn't work for receivers of method calls. This is a small change, and I have it implemented locally, but I'm not sure it's useful on its own. In most cases I've found borrowing the receiver would change the call's output type (see below). In other cases (e.g. `Iterator::sum`), borrowing the receiver isn't useful since it's consumed.
- This doesn't work when it would change the call's output type. In general, I figure inserting references into the output type is an unwanted change. However, this also means it doesn't work in cases where the new output type would be effectively the same as the old one. For example, from the rand crate, the iterator returned by [`Rng::sample_iter`](https://docs.rs/rand/latest/rand/trait.Rng.html#method.sample_iter) is effectively the same (modulo regions) whether you borrow or consume the receiver `Rng`, so common usage involves borrowing it. I'm not sure whether the best approach is to add a more complex check of approximate equivalence, to forego checking the call's output type and give spurious suggestions, or to leave it as-is.
- This doesn't work when it would change the call's other input types. Instead, it could suggest borrowing any others that have the same parameter type (but only when suggesting shared borrows). I think this would be a pretty easy change, but I don't think it's very useful so long as the normalized output type can't change.

I'm happy to implement any of these (or other potential improvements to this), but I'm not sure which are common enough patterns to justify the added complexity. Please let me know if any sound worthwhile.
2024-11-14 15:16:08 +01:00
Guillaume Gomez
e3c76c5699
Rollup merge of #132773 - jakos-sec:fix-asan-win32, r=jieyouxu
PassWrapper: disable UseOdrIndicator for Asan Win32

As described in https://reviews.llvm.org/D137227 UseOdrIndicator should be disabled on Windows since link.exe does not support duplicate weak definitions.

Fixes https://github.com/rust-lang/rust/issues/124390.

Credits also belong to `@1c3t3a`  who worked with me on this.
We are currently testing this on a Windows machine.
2024-11-14 18:26:15 +08:00
Jubilee
aa189460b8
Rollup merge of #132971 - BoxyUwU:handle_infers_in_anon_consts, r=compiler-errors
Handle infer vars in anon consts on stable

Fixes #132955

Diagnostics will sometimes try to replace generic parameters with inference variables in failing goals. This means that if we have some failing goal with an array repeat expr count anon const in it, we will wind up with some `ty::ConstKind::Unevaluated(anon_const_def, [?x])` during diagnostics which will then ICE if we do not handle inference variables correctly on stable when normalizing type system consts.

r? ```@compiler-errors```
2024-11-13 22:43:37 -08:00
Maybe Lapkin
673bb5e3ff
Mark never_type_fallback_flowing_into_unsafe as a semantic change
...rather than a future error
2024-11-14 06:01:14 +01:00
dianne
2ab8480605 Suggest borrowing arguments in generic positions when trait bounds are satisfied
This subsumes the suggestions to borrow arguments with `AsRef`/`Borrow` bounds and those to borrow
arguments with `Fn` and `FnMut` bounds. It works for other traits implemented on references as well,
such as `std::io::Read`, `std::io::Write`, and `core::fmt::Write`.

Incidentally, by making the logic for suggesting borrowing closures general, this removes some
spurious suggestions to mutably borrow `FnMut` closures in assignments, as well as an unhelpful
suggestion to add a `Clone` constraint to an `impl Fn` argument.
2024-11-13 20:29:40 -08:00
Nicholas Nethercote
7a96ed3dd0 Remove unreachable code in has_cfg_or_cfg_attr. 2024-11-14 14:58:16 +11:00
Nicholas Nethercote
d55a5e5dda Merge matches in configure_annotatable.
There are two matches: one in a closure, and one vanilla one. They can
be combined and simplified by putting them in a `try` block.
2024-11-14 14:52:42 +11:00
Nicholas Nethercote
b2b643c9d9 Inline and remove flat_map_annotatable.
Important: we know from the `parse_annotatable_with` call above the call
site that only some of the `Annotatable` variants are possible. The
remaining cases can be replaced with `unreachable!`.
2024-11-14 14:52:18 +11:00
Nicholas Nethercote
7aee2b332f Make configure_annotatable/flat_map_annotatable infallible.
They each have a single callsite, and the result is always unwrapped, so
the `Option<Annotatable>` return type is misleading.

Also, the comment at the `configure_annotatable` call site is wrong,
talking about a result vector, so this commit also removes that.
2024-11-14 14:51:45 +11:00
surechen
3a74bce72e Adding BreakValue to UnusedDelimsCtx to make UnusedParens and UnusedBraces checking break 2024-11-14 09:08:56 +08:00
dianne
ea37000b56 Use a common subdiagnostic format for generic borrows
This is setup for unifing the logic for suggestions to borrow arguments in generic positions.
As of this commit, it's still special cases for `AsRef`/`Borrow`-like traits and `Fn`-like traits.
2024-11-13 16:36:23 -08:00
dianne
2280d8ea00 Provide borrow-instead-of-move suggestions for calls of fn-like items from other crates
This also downgrades its applicability to MaybeIncorrect. Its suggestion can result in ill-typed
code when the type parameter it suggests providing a different generic argument for appears
elsewhere in the callee's signature or predicates.
2024-11-13 16:36:23 -08:00
Maybe Lapkin
46967bd2e9
Mention both release *and* edition breakage for never type lints 2024-11-14 01:32:54 +01:00
Jakob Koschel
61013f040e PassWrapper: disable UseOdrIndicator for Asan Win32
As described here UseOdrIndicator should be disabled on Windows
since link.exe does not support duplicate weak definitions
(https://reviews.llvm.org/D137227).

Co-Authored-By: Bastian Kersting <bkersting@google.com>
2024-11-14 04:20:18 +08:00
Matthias Krüger
e6b3a55b98
Rollup merge of #132996 - clubby789:unn-let-space, r=jieyouxu
Trim extra space when suggesting removing bad `let`

Fixes #132969
2024-11-13 21:04:25 +01:00
Matthias Krüger
a5372ed938
Rollup merge of #132842 - veluca93:abi-checks-tier2, r=workingjubilee
ABI checks: add support for tier2 arches

See #131800 for the data collection behind this change.

r? RalfJung
2024-11-13 21:04:23 +01:00
clubby789
1136bbf066 Trim extra space when suggesting removing bad let 2024-11-13 13:19:13 +00:00
Ralf Jung
9760983353 check_consts: fix error requesting feature gate when that gate is not actually needed 2024-11-13 12:03:16 +01:00
maxcabrajac
a7ac8bfc22 format 2024-11-12 21:57:25 -03:00
Matthias Krüger
f7e40680b5
Rollup merge of #132950 - knickish:m68k_gnu_ld, r=workingjubilee
Use GNU ld on m68k-unknown-linux-gnu

LLD does not really support the M68k architecture yet, specify `m68k-linux-gnu-ld` as the linker for the platform
2024-11-12 23:26:44 +01:00
Matthias Krüger
bd79fe7a94
Rollup merge of #132702 - 1c3t3a:issue-132615, r=rcvalle
CFI: Append debug location to CFI blocks

Currently we're not appending debug locations to the inserted CFI blocks. This shows up in #132615 and #100783. This change fixes that by passing down the debug location to the CFI type-test generation and appending it to the blocks.

Credits also belong to `@jakos-sec` who worked with me on this.
2024-11-12 23:26:41 +01:00
Boxy
6dad074907 Handle infer vars in anon consts on stable 2024-11-12 21:36:42 +00:00
Luca Versari
295cffc4b4 ABI checks: add support for tier2 arches
See #131800 for the data collection behind this change.

Also adds a test that exercise the "empty list of features" path.
2024-11-12 22:34:31 +01:00
kirk
d3768ea81f use gnu ld for m68k target 2024-11-12 20:48:30 +00:00
bors
f7273e0044 Auto merge of #132954 - matthiaskrgr:rollup-x3rww9h, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #131831 (extend the "if-unchanged" logic for compiler builds)
 - #132541 (Proper support for cross-crate recursive const stability checks)
 - #132657 (AIX: add run-make support)
 - #132901 (Warn about invalid `mir-enable-passes` pass names)
 - #132923 (Triagebot: Consolidate the T-compiler ad hoc assignment groups)
 - #132938 (Make precise capturing suggestion machine-applicable only if it has no APITs)
 - #132947 (clarify `must_produce_diag` ICE for debugging)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-12 18:04:27 +00:00
Matthias Krüger
f00a31c44d
Rollup merge of #132947 - lqd:trimmed-ice, r=compiler-errors
clarify `must_produce_diag` ICE for debugging

We have a sanity check to ensure the expensive `trimmed_def_paths` functions are called only when producing diagnostics, and not e.g. on the happy path. The panic often happens IME during development because of randomly printing stuff, causing an ICE if no diagnostics were also emitted.

I have this change locally but figured it could be useful to others, so this PR clarifies the message when this happens during development.

The output currently looks like this by default; it's a bit confusing with words missing:

```
thread 'rustc' panicked at compiler/rustc_errors/src/lib.rs:628:17:
must_produce_diag: `trimmed_def_paths` called but no diagnostics emitted; `with_no_trimmed_paths` for debugging. called at: disabled backtrace
stack backtrace:
   0:     0x7ffff79570f6 - std::backtrace_rs::backtrace::libunwind::trace::h33576c57327a3cea
                               at .../library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x7ffff79570f6 - std::backtrace_rs::backtrace::trace_unsynchronized::h7972a09393b420db
                               at .../library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7ffff79570f6 - std::sys::backtrace::_print_fmt::hae8c5bbfbf7a8322
                               at .../library/std/src/sys/backtrace.rs:66:9
   3:     0x7ffff79570f6 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h1fd6a7a210f5b535
...
```

The new output mentions how to get more information and locate where the `with_no_trimmed_paths` call needs to be added.

1. By default, backtraces are disabled:
```
thread 'rustc' panicked at compiler/rustc_errors/src/lib.rs:642:17:
`trimmed_def_paths` called, diagnostics were expected but none were emitted. Use `with_no_trimmed_paths` for debugging. Backtraces are currently disabled: set `RUST_BACKTRACE=1` and re-run to see where it happened.
stack backtrace:
   0:     0x7ffff79565f6 - std::backtrace_rs::backtrace::libunwind::trace::h33576c57327a3cea
...
```

2. With backtraces enabled:
```
thread 'rustc' panicked at compiler/rustc_errors/src/lib.rs:642:17:
`trimmed_def_paths` called, diagnostics were expected but none were emitted. Use `with_no_trimmed_paths` for debugging. This happened in the following `must_produce_diag` call's backtrace:
   0: <rustc_errors::DiagCtxtHandle>::set_must_produce_diag
             at .../compiler/rustc_errors/src/lib.rs:1133:58
   1: <rustc_session::session::Session>::record_trimmed_def_paths
             at .../compiler/rustc_session/src/session.rs:327:9
   2: rustc_middle::ty::print::pretty::trimmed_def_paths
             at .../compiler/rustc_middle/src/ty/print/pretty.rs:3351:5
...
```

A `\n` could be added here or there, but it didn't matter much whenever I hit this case with the new message.
2024-11-12 18:11:07 +01:00
Matthias Krüger
11c7b01aa7
Rollup merge of #132938 - compiler-errors:ed2024-apit-sugg, r=chenyukang
Make precise capturing suggestion machine-applicable only if it has no APITs

cc https://github.com/rust-lang/rust/issues/132932

The only case where this suggestion is not machine-applicable is when we suggest turning arg-position impl trait into type parameters, which may expose type parameters that were not turbofishable before.
2024-11-12 18:11:06 +01:00
Matthias Krüger
8628fd553d
Rollup merge of #132901 - clubby789:enable-pass-check, r=jieyouxu
Warn about invalid `mir-enable-passes` pass names

Fixes #132805
2024-11-12 18:11:05 +01:00
Matthias Krüger
4a699fc475
Rollup merge of #132541 - RalfJung:const-stable-extern-crate, r=compiler-errors
Proper support for cross-crate recursive const stability checks

~~Stacked on top of https://github.com/rust-lang/rust/pull/132492; only the last three commits are new.~~

In a crate without `staged_api` but with `-Zforce-unstable-if-unmarked`, we now subject all functions marked with `#[rustc_const_stable_indirect]` to recursive const stability checks. We require an opt-in so that by default, a crate can be built with `-Zforce-unstable-if-unmarked` and use nightly features as usual. This property is recorded in the crate metadata so when a `staged_api` crate calls such a function, it sees the `#[rustc_const_stable_indirect]` and allows it to be exposed on stable. This, finally, will let us expose `const fn` from hashbrown on stable.

The second commit makes const stability more like regular stability: via `check_missing_const_stability`, we ensure that all publicly reachable functions have a const stability attribute -- both in  `staged_api` crates and `-Zforce-unstable-if-unmarked` crates. To achieve this, we move around the stability computation so that const stability is computed after regular stability is done. This lets us access the final result of the regular stability computation, which we use so that `const fn` can inherit the regular stability (but only if that is "unstable"). Fortunately, this lets us get rid of an `Option` in `ConstStability`.

This is the last PR that I have planned in this series.

r? `@compiler-errors`
2024-11-12 18:11:04 +01:00