about summary refs log tree commit diff
path: root/tests/ui/consts/min_const_fn
AgeCommit message (Collapse)AuthorLines
2025-05-25const-check: stop recommending the use of rustc_allow_const_fn_unstableRalf Jung-96/+16
2025-04-10replace `//@ compile-flags: --edition` with `//@ edition`Pietro Albini-1/+1
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-2/+2
2025-01-25Fix typo in const stability error messageDeadbeef-14/+14
2024-12-23Note def descr in NonConstFunctionCallMichael Goulet-2/+2
2024-11-13check_consts: fix error requesting feature gate when that gate is not ↵Ralf Jung-1/+1
actually needed
2024-11-12allow rustc_private feature in force-unstable-if-unmarked cratesRalf Jung-5/+3
2024-11-10honor rustc_const_stable_indirect in non-staged_api crate with ↵Ralf Jung-0/+121
-Zforce-unstable-if-unmarked
2024-10-25Re-do recursive const stability checksRalf Jung-44/+206
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-26Stabilize `const_refs_to_static`Ding Xiang Fei-29/+4
update tests fix bitwidth-sensitive stderr output use build-fail for asm tests
2024-09-15also stabilize const_refs_to_cellRalf Jung-26/+16
2024-09-15stabilize const_mut_refsRalf Jung-310/+21
2024-09-01Rollup merge of #129207 - GrigorenkoPV:elided-is-named, r=cjgillotMatthias Krüger-3/+23
Lint that warns when an elided lifetime ends up being a named lifetime As suggested in https://github.com/rust-lang/rust/issues/48686#issuecomment-1817334575 Fixes #48686
2024-08-31Auto merge of #129831 - matthiaskrgr:rollup-befq6zx, r=matthiaskrgrbors-2/+2
Rollup of 11 pull requests Successful merges: - #128523 (Add release notes for 1.81.0) - #129605 (Add missing `needs-llvm-components` directives for run-make tests that need target-specific codegen) - #129650 (Clean up `library/profiler_builtins/build.rs`) - #129651 (skip stage 0 target check if `BOOTSTRAP_SKIP_TARGET_SANITY` is set) - #129684 (Enable Miri to pass pointers through FFI) - #129762 (Update the `wasm-component-ld` binary dependency) - #129782 (couple more crash tests) - #129816 (tidy: say which feature gate has a stability issue mismatch) - #129818 (make the const-unstable-in-stable error more clear) - #129824 (Fix code examples buttons not appearing on click on mobile) - #129826 (library: Fix typo in `core::mem`) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-31make the const-unstable-in-stable error more clearRalf Jung-2/+2
2024-08-31elided_named_lifetimes: bless & add testsPavel Grigorenko-3/+23
2024-08-31const fn stability checking: also check declared language featuresRalf Jung-0/+20
2024-08-25tweak rustc_allow_const_fn_unstable hint, and add back test for ↵Ralf Jung-8/+16
stable-const-can-only-call-stable-const
2024-08-22stabilize const_fn_floating_point_arithmeticRalf Jung-39/+29
2024-08-18stabilize raw_ref_opRalf Jung-6/+2
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-7/+7
2024-02-10rebless after rebaseRalf Jung-0/+2
2024-02-10unstably allow constants to refer to statics and read from immutable staticsRalf Jung-8/+14
2024-01-22raw pointers are not referencesRalf Jung-4/+4
2024-01-13Bless testsGeorge-lewis-0/+21
Update tests
2023-11-24Show number in error message even for one errorNilstrieb-1/+1
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-04-16fix library and rustdoc testsDeadbeef-11/+5
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-4/+8
2023-03-09Test `let _ =` for const_mut_refs.Camille GILLOT-1/+13
2023-01-11Move /src/test to /testsAlbert Larsan-0/+967