about summary refs log tree commit diff
path: root/src/test/ui/consts/min_const_fn
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-967/+0
2022-10-20Update tests to match error message changesb4den-6/+6
2022-09-24Note the type when unable to drop values in compile timeDeadbeef-13/+13
2022-07-26Fix diagnostics for unfulfilled obligationsDeadbeef-10/+0
2022-07-26bless tests, remove nonexistent E0395Deadbeef-5/+21
2022-03-07Stabilize const_impl_trait as wellEric Holk-31/+0
2022-03-07Update tests after feature stabilizationEric Holk-397/+32
2022-03-03Cleanup feature gates.Camille GILLOT-4/+5
2022-02-12bless youDeadbeef-2/+3
2022-02-06Fix tracking issue for `const_fn_trait_bound`Ruby Lazuli-14/+14
It previously pointed to #57563, the conglomerate issue for `const fn` (presumably under the feature gate `const_fn`). `const_fn_trait_bounds` weren't mentioned here, so this commit changes its tracking issue to a new one.
2021-11-06Stabilize `const_raw_ptr_deref` for `*const T`Jacob Pratt-13/+12
This stabilizes dereferencing immutable raw pointers in const contexts. It does not stabilize `*mut T` dereferencing. This is placed behind the `const_raw_mut_ptr_deref` feature gate.
2021-10-04Rollup merge of #89482 - hkmatsumoto:patch-diagnostics, r=joshtriplettManish Goregaokar-9/+9
Follow the diagnostic output style guide Detected by #89455.
2021-10-03Practice diagnostic message conventionHirochika Matsumoto-5/+5
2021-10-03Follow the diagnostic output style guideHirochika Matsumoto-9/+9
2021-09-16Add a separate error for `dyn Trait` in `const fn`Waffle-14/+14
Previously "trait bounds other than `Sized` on const fn parameters are unstable" error was used for both trait bounds (<T: Trait>) and trait objects (dyn Trait). This was pretty confusing. This patch adds a separeta error for trait objects: "trait objects in const fn are unstable". The error for trait bounds is otherwise intact.
2021-09-13Highlight the const function if error happened because of a bound on the ↵Waffle-4/+23
impl block Currently, for the following code, the compiler produces the errors like the following error: ```rust struct Type<T> impl<T: Clone> Type<T> { fn const f() {} } ``` ```text error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable --> ./test.rs:3:6 | 3 | impl<T: Clone> Type<T> { | ^ | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable ``` This can be confusing (especially to newcomers) since the error mentions "const fn parameters", but highlights only the impl. This commits adds function highlighting, changing the error to the following: ```text error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable --> ./test.rs:3:6 | 3 | impl<T: Clone> Type<T> { | ^ 4 | pub const fn f() {} | ---------------- function declared as const here | = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable ```
2021-07-27Update testsJacob Pratt-16/+1
2021-07-10remove const_raw_ptr_to_usize_cast featureRalf Jung-16/+16
2021-05-22stabilize const_fn_unsizeRalf Jung-24/+24
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-2/+2
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-04-29remove const_fn feature gate from const testsRalf Jung-4/+4
2021-04-18separate feature flag for unsizing casts in const fnRalf Jung-15/+14
2021-04-18move 'trait bounds on const fn' to separate feature gateRalf Jung-21/+22
2021-01-29rename raw_const/mut -> const/mut_addr_of, and stabilize themRalf Jung-2/+1
2020-10-25Rollup merge of #78208 - liketechnik:issue-69399, r=oli-obkYuki Okushi-10/+10
replace `#[allow_internal_unstable]` with `#[rustc_allow_const_fn_unstable]` for `const fn`s `#[allow_internal_unstable]` is currently used to side-step feature gate and stability checks. While it was originally only meant to be used only on macros, its use was expanded to `const fn`s. This pr adds stricter checks for the usage of `#[allow_internal_unstable]` (only on macros) and introduces the `#[rustc_allow_const_fn_unstable]` attribute for usage on `const fn`s. This pr does not change any of the functionality associated with the use of `#[allow_internal_unstable]` on macros or the usage of `#[rustc_allow_const_fn_unstable]` (instead of `#[allow_internal_unstable]`) on `const fn`s (see https://github.com/rust-lang/rust/issues/69399#issuecomment-712911540). Note: The check for `#[rustc_allow_const_fn_unstable]` currently only validates that the attribute is used on a function, because I don't know how I would check if the function is a `const fn` at the place of the check. I therefore openend this as a 'draft pull request'. Closes rust-lang/rust#69399 r? @oli-obk
2020-10-22Rollup merge of #77420 - ecstatic-morse:const-checking-raw-mut-ref, r=davidtwcoYuki Okushi-4/+4
Unify const-checking structured errors for `&mut` and `&raw mut` Resolves #77414 as well as a FIXME.
2020-10-21switch allow_internal_unstable const fns to rustc_allow_const_fn_unstableFlorian Warzecha-10/+10
2020-10-05Remove `fn` from feature nameDylan MacKenzie-3/+3
2020-10-05Make `min_const_fn` `impl Trait` test into a gate testDylan MacKenzie-2/+4
2020-10-05Bless test outuptDylan MacKenzie-11/+10
2020-10-01Bless testsDylan MacKenzie-4/+4
2020-09-29Bless testsDylan MacKenzie-15/+55
2020-09-29Bless outputDylan MacKenzie-11/+81
2020-09-29Bless testsDylan MacKenzie-76/+36
2020-09-29Bless mut testsDylan MacKenzie-41/+151
2020-09-29Fix "unstable in stable" errorDylan MacKenzie-3/+12
The "otherwise" note is printed before the suggestion currently.
2020-09-27Remove feature gate test for `rustc_allow_const_fn_ptr`Dylan MacKenzie-47/+0
2020-09-27Mark `min_const_fn_fn_ptr` test as gate testDylan MacKenzie-2/+4
2020-09-27Bless testsDylan MacKenzie-32/+56
2020-09-27Update tests with new feature gateDylan MacKenzie-15/+22
2020-09-25Move const fn floating point test out of `min_const_fn`Dylan MacKenzie-62/+18
2020-09-25Bless testsDylan MacKenzie-19/+19
2020-09-23Bless testsDylan MacKenzie-29/+29
2020-09-22Bless testsDylan MacKenzie-92/+104
2020-08-21Suppress "const" prefix of FnDef in MIR dumpLzu Tao-9/+9
2020-08-16Allowing raw ptr dereference in const fn5M1Sec-12/+15
Change `UnsafetyViolationKind::General` to `UnsafetyViolationKind::GeneralAndConstFn` in check_unsafety.rs Remove unsafe in min_const_fn_unsafe_bad.rs Bless min_const_fn Add the test case from issue 75340 Co-authored-by: lzutao <taolzu@gmail.com>
2020-06-30Stabilize casts and coercions to `&[T]` in const fnOliver Scherer-15/+5
2020-06-28Update testsDylan MacKenzie-17/+0
2020-06-28Update testsDylan MacKenzie-24/+6
2020-06-20update testsChristian Poveda-3/+9