about summary refs log tree commit diff
path: root/tests/ui/stability-attribute
AgeCommit message (Collapse)AuthorLines
2025-07-17Integrate stable feature checking into a query.Camille GILLOT-13/+7
2025-07-17parse `const trait Trait`Deadbeef-5/+4
2025-06-17make error codes reflect reality betterJana Dönszelmann-35/+20
2025-06-17use consistent attr errors in all attribute parsersJana Dönszelmann-11/+41
2025-06-13Rollup merge of #142158 - xizheyin:141617, r=jdonszelmannMatthias Krüger-0/+12
Tracking the old name of renamed unstable library features This PR resolves the first problem of rust-lang/rust#141617 : tracking renamed unstable features. The first commit is to add a ui test, and the second one tracks the changes. I will comment on the code for clarification. r? `@jdonszelmann` There have been a lot of PR's reviewed by you lately, thanks for your time! cc `@jyn514`
2025-06-12Tracking the old name of renamed unstable library attributexizheyin-2/+2
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-06-11cleaned up some testsKivooeo-0/+387
2025-06-07Add test renamed_feature.rsxizheyin-0/+12
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-10Rollup merge of #140151 - RalfJung:drop_in_place-is-not-an-intrinsic, ↵Matthias Krüger-2/+1
r=Mark-Simulacrum remove intrinsics::drop_in_place This was only ever accidentally stable, and has been marked as deprecated since Rust 1.52, released almost 4 years ago. We've removed the old serialization `derive`s, maybe we can remove this one as well? As suggested by ``@jhpratt,`` let's see what crater says for this one.
2025-05-05Do not gather local all together at the beginning of typeckMichael Goulet-32/+32
2025-04-22remove intrinsics::drop_in_placeRalf Jung-2/+1
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-40/+40
2025-03-14Pass precise HirId when calling check_stabilityxizheyin-0/+49
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-02-24Fix test output expectationsJana Dönszelmann-20/+20
2025-02-14Trim suggestion parts to the subset that is purely additiveMichael Goulet-4/+4
2025-02-14Use underline suggestions for purely 'additive' replacementsMichael Goulet-12/+8
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-8/+12
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2025-02-02rustc_allowed_through_unstable_modules: require deprecation messageRalf Jung-11/+6
2025-01-18Structured suggestion for "missing `feature` in unstable fn call"Esteban Küber-1/+4
When encountering a call corresponding to an item marked as unstable behind a feature flag, provide a structured suggestion pointing at where in the crate the `#![feature(..)]` needs to be written. ``` error: `foobar` is not yet stable as a const fn --> $DIR/const-stability-attribute-implies-no-feature.rs:12:5 | LL | foobar(); | ^^^^^^^^ | help: add `#![feature(const_foobar)]` to the crate attributes to enable | LL + #![feature(const_foobar)] | ``` Fix #81370.
2025-01-15Rollup merge of #135003 - RalfJung:deprecate-allowed-through-unstable, ↵Guillaume Gomez-3/+25
r=davidtwco deprecate `std::intrinsics::transmute` etc, use `std::mem::*` instead The `rustc_allowed_through_unstable_modules` attribute lets users call `std::mem::transmute` as `std::intrinsics::transmute`. The former is a reexport of the latter, and for a long time we didn't properly check stability for reexports, so making this a hard error now would be a breaking change for little gain. But at the same time, `std::intrinsics::transmute` is not the intended path for this function, so I think it is a good idea to show a deprecation warning when that path is used. This PR implements that, for all the functions in `std::intrinsics` that carry the attribute. I assume this will need ``@rust-lang/libs-api`` FCP.
2025-01-15intrinsics: deprecate calling them via the unstable std::intrinsics pathRalf Jung-1/+10
2025-01-15allowed_through_unstable_modules: support showing a deprecation message when ↵Ralf Jung-2/+15
the unstable module name is used
2025-01-14Enforce syntactical stability of const traits in HIRMichael Goulet-2/+13
2024-12-12Filter empty lines, comments and delimiters from previous to last multiline ↵Esteban Küber-1/+0
span rendering
2024-12-12Tweak multispan renderingEsteban Küber-2/+1
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
2024-11-20don't require const stability for const implsDeadbeef-11/+2
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