summary refs log tree commit diff
path: root/tests/ui/stability-attribute
AgeCommit message (Collapse)AuthorLines
2024-11-04remove support for extern-block const intrinsicsRalf Jung-6/+0
2024-11-04Rollup merge of #132544 - dianne:unstable-library-feature-backticks, ↵Matthias Krüger-110/+110
r=compiler-errors Use backticks instead of single quotes for library feature names in diagnostics This PR changes the text of library feature errors for using unstable or body-unstable items. Displaying library feature names in backticks is consistent with other diagnostics (e.g. those from `rustc_passes`) and with the `reason`s on unstable attributes in the library. Additionally, this simplifies diagnostics when supporting multiple unstable attributes on items (see #131824) since `DiagSymbolList` also displays symbols using backticks.
2024-11-03use backticks instead of single quotes when reporting "use of unstable ↵dianne-110/+110
library feature" This is consistent with all other diagnostics I could find containing features and enables the use of `DiagSymbolList` for generalizing diagnostics for unstable library features to multiple features.
2024-11-03Yeet effects featureMichael Goulet-11/+2
2024-10-25Re-do recursive const stability checksRalf Jung-13/+21
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-06-30Migrate tests to use `-Znext-solver`Deadbeef-4/+5
2024-06-24ast: Standardize visiting order for attributes and node IDsVadim Petrochenkov-4/+4
2024-06-22Make `effects` an incomplete featureDeadbeef-2/+11
2024-03-31refer to a different module in UI testjoboet-10/+10
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-28/+28
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-1/+10
2024-01-13Bless testsGeorge-lewis-0/+57
Update tests
2024-01-09Avoid silencing relevant follow-up errorsOli Scherer-2/+13
2023-11-24Show number in error message even for one errorNilstrieb-16/+16
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-30Preserve deprecation attribute even if 'since' version is missingDavid Tolnay-3/+11
2023-10-29Store version of `deprecated` attribute in structured formDavid Tolnay-11/+7
2023-10-29Fill in syntactically valid deprecation version in testsDavid Tolnay-12/+12
2023-10-24Update stability attribute sanity UI test to delete superfluous errorsDavid Tolnay-19/+6
2023-10-23Update `since` stability attributes in testsDavid Tolnay-43/+53
2023-08-06bless testsDeadbeef-1/+1
2023-06-28Auto merge of #111269 - clubby789:validate-fluent-variables, r=davidtwcobors-2/+19
Validate fluent variable references in tests Closes #101109 Under `cfg(test)`, the `fluent_messages` macro will emit a list of variables referenced by each message and its attributes. The derive attribute will now emit a `#[test]` that checks that each referenced variable exists in the structure it's applied to.
2023-06-22Tweak privacy errors to account for reachable itemsEsteban Küber-1/+3
Suggest publicly accessible paths for items in private mod: When encountering a path in non-import situations that are not reachable due to privacy constraints, search for any public re-exports that the user could use instead. Track whether an import suggestion is offering a re-export. When encountering a path with private segments, mention if the item at the final path segment is not publicly accessible at all. Add item visibility metadata to privacy errors from imports: On unreachable imports, record the item that was being imported in order to suggest publicly available re-exports or to be explicit that the item is not available publicly from any path. In order to allow this, we add a mode to `resolve_path` that will not add new privacy errors, nor return early if it encounters one. This way we can get the `Res` corresponding to the final item in the import, which is used in the privacy error machinery.
2023-05-26Fix diagnostics with errorsclubby789-2/+19
2023-04-29Update testsGary Guo-4/+4
2023-03-18fix: don't suggest similar method when unstableEzra Shaw-0/+47
2023-03-06Rollup merge of #107801 - davidtwco:stability-implies-const, r=NilstriebMatthias Krüger-0/+146
const_eval: `implies_by` in `rustc_const_unstable` Fixes #107605. Extend support for `implies_by` (from `#[stable]` and `#[unstable]`) to `#[rustc_const_stable]` and `#[rustc_const_unstable]`. cc ``@steffahn``
2023-02-25Do not lint unresolved trait for ineffective unstable trait implDeadbeef-0/+17
2023-02-08const_eval: `implies_by` in `rustc_const_unstable`David Wood-0/+146
Extend support for `implies_by` (from `#[stable]` and `#[unstable]`) to `#[rustc_const_stable]` and `#[rustc_const_unstable]`. Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-14fix: don't emit `E0711` if `staged_api` not enabledEzra Shaw-0/+25
2023-01-11Move /src/test to /testsAlbert Larsan-0/+2468