about summary refs log tree commit diff
path: root/tests/ui/consts/auxiliary
AgeCommit message (Collapse)AuthorLines
2025-06-12intrinsics: rename min_align_of to align_ofRalf Jung-1/+1
2025-01-04rustc_intrinsic: support functions without body; they are implicitly marked ↵Ralf Jung-4/+2
as must-be-overridden
2024-11-04when an intrinsic has a const-stable fallback body, we can easily expose it ↵Ralf Jung-0/+2
on stable
2024-11-04remove support for extern-block const intrinsicsRalf Jung-23/+8
2024-11-03Yeet effects featureMichael Goulet-2/+1
2024-10-25Re-do recursive const stability checksRalf Jung-13/+26
Fundamentally, we have *three* disjoint categories of functions: 1. const-stable functions 2. private/unstable functions that are meant to be callable from const-stable functions 3. functions that can make use of unstable const features This PR implements the following system: - `#[rustc_const_stable]` puts functions in the first category. It may only be applied to `#[stable]` functions. - `#[rustc_const_unstable]` by default puts functions in the third category. The new attribute `#[rustc_const_stable_indirect]` can be added to such a function to move it into the second category. - `const fn` without a const stability marker are in the second category if they are still unstable. They automatically inherit the feature gate for regular calls, it can now also be used for const-calls. Also, several holes in recursive const stability checking are being closed. There's still one potential hole that is hard to avoid, which is when MIR building automatically inserts calls to a particular function in stable functions -- which happens in the panic machinery. Those need to *not* be `rustc_const_unstable` (or manually get a `rustc_const_stable_indirect`) to be sure they follow recursive const stability. But that's a fairly rare and special case so IMO it's fine. The net effect of this is that a `#[unstable]` or unmarked function can be constified simply by marking it as `const fn`, and it will then be const-callable from stable `const fn` and subject to recursive const stability requirements. If it is publicly reachable (which implies it cannot be unmarked), it will be const-unstable under the same feature gate. Only if the function ever becomes `#[stable]` does it need a `#[rustc_const_unstable]` or `#[rustc_const_stable]` marker to decide if this should also imply const-stability. Adding `#[rustc_const_unstable]` is only needed for (a) functions that need to use unstable const lang features (including intrinsics), or (b) `#[stable]` functions that are not yet intended to be const-stable. Adding `#[rustc_const_stable]` is only needed for functions that are actually meant to be directly callable from stable const code. `#[rustc_const_stable_indirect]` is used to mark intrinsics as const-callable and for `#[rustc_const_unstable]` functions that are actually called from other, exposed-on-stable `const fn`. No other attributes are required.
2024-09-30add test ensuring we cannot call const-stable unstable functionsRalf Jung-0/+13
2024-09-15stabilize const_mut_refsRalf Jung-2/+0
2024-06-30Migrate tests to use `-Znext-solver`Deadbeef-1/+3
2024-06-22Make `effects` an incomplete featureDeadbeef-1/+1
2024-03-25extend doc comment for reachability set computationRalf Jung-1/+12
also extend the const fn reachability test
2024-03-12Auto merge of #121644 - oli-obk:unique_static_innards2, r=RalfJung,nnethercotebors-0/+23
Ensure nested allocations in statics neither get deduplicated nor duplicated This PR generates new `DefId`s for nested allocations in static items and feeds all the right queries to make the compiler believe these are regular `static` items. I chose this design, because all other designs are fragile and make the compiler horribly complex for such a niche use case. At present this wrecks incremental compilation performance *in case nested allocations exist* (because any query creating a `DefId` will be recomputed and never loaded from the cache). This will be resolved later in https://github.com/rust-lang/rust/pull/115613 . All other statics are unaffected by this change and will not have performance regressions (heh, famous last words) This PR contains various smaller refactorings that can be pulled out into separate PRs. It is best reviewed commit-by-commit. The last commit is where the actual magic happens. r? `@RalfJung` on the const interner and engine changes fixes https://github.com/rust-lang/rust/issues/79738
2024-03-12Add tests showing how we duplicate allocations when we shouldn'tAmanjeev Sethi-0/+23
2024-03-11Remove some unnecessary allow(incomplete_features)Michael Goulet-1/+0
2023-12-19bless ui testsDeadbeef-1/+1
2023-05-01Rip it outNilstrieb-1/+1
My type ascription Oh rip it out Ah If you think we live too much then You can sacrifice diagnostics Don't mix your garbage Into my syntax So many weird hacks keep diagnostics alive Yet I don't even step outside So many bad diagnostics keep tyasc alive Yet tyasc doesn't even bother to survive!
2023-04-22Encode lifetime param spans tooMichael Goulet-1/+0
2023-04-17Encode def span for ConstParamMichael Goulet-0/+1
2023-01-16Encode const mir for closures if they're constMichael Goulet-0/+8
2023-01-11Move /src/test to /testsAlbert Larsan-0/+89