about summary refs log tree commit diff
path: root/src/test/ui-fulldeps/internal-lints
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-1125/+0
2022-12-13Combine projection and opaque into aliasMichael Goulet-19/+12
2022-10-23Update translation testsNilstrieb-6/+6
2022-10-10errors: `AddToDiagnostic::add_to_diagnostic_with`David Wood-7/+13
`AddToDiagnostic::add_to_diagnostic_with` is similar to the previous `AddToDiagnostic::add_to_diagnostic` but takes a function that can be used by the caller to modify diagnostic messages originating from the subdiagnostic (such as performing translation eagerly). `add_to_diagnostic` now just calls `add_to_diagnostic_with` with an empty closure. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-03errors: rename `typeck.ftl` to `hir_analysis.ftl`David Wood-6/+6
In #102306, `rustc_typeck` was renamed to `rustc_hir_analysis` but the diagnostic resources were not renamed - which is what this commit changes. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-01`ui-fulldeps`: adopt to the new rustc lint APIMaybe Waffle-4/+4
2022-09-21FIX - adopt new Diagnostic naming in newly migrated modulesJhonny Bill Mena-5/+5
FIX - ambiguous Diagnostic link in docs UPDATE - rename diagnostic_items to IntoDiagnostic and AddToDiagnostic [Gardening] FIX - formatting via `x fmt` FIX - rebase conflicts. NOTE: Confirm wheather or not we want to handle TargetDataLayoutErrorsWrapper this way DELETE - unneeded allow attributes in Handler method FIX - broken test FIX - Rebase conflict UPDATE - rename residual _SessionDiagnostic and fix LintDiag link
2022-09-21UPDATE - rename SessionSubdiagnostic macro to SubdiagnosticJhonny Bill Mena-2/+2
Also renames: - sym::AddSubdiagnostic to sym:: Subdiagnostic - rustc_diagnostic_item = "AddSubdiagnostic" to rustc_diagnostic_item = "Subdiagnostic"
2022-09-21UPDATE - rename DiagnosticHandler macro to DiagnosticJhonny Bill Mena-2/+2
2022-09-21UPDATE - rename AddSubdiagnostic trait to AddToDiagnosticJhonny Bill Mena-9/+9
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-9/+10
2022-09-21UPDATE - move SessionDiagnostic from rustc_session to rustc_errorsJhonny Bill Mena-2/+1
2022-09-05FIX - broken translatable diagnostics testsJhonny Bill Mena-5/+5
2022-09-05FIX - broken translatable diagnostics testsJhonny Bill Mena-13/+15
2022-09-05UPDATE - into_diagnostic to take a Handler instead of a ParseSessJhonny Bill Mena-11/+11
Suggested by the team in this Zulip Topic https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler Handler already has almost all the capabilities of ParseSess when it comes to diagnostic emission, in this migration we only needed to add the ability to access source_map from the emitter in order to get a Snippet and the start_point. Not sure if this is the best way to address this gap
2022-08-31lint: avoid linting diag functions with diag lintsDavid Wood-7/+15
Functions annotated with `#[rustc_lint_diagnostics]` are used by the diagnostic migration lints to know when to lint, but functions that are annotated with this attribute shouldn't themselves be linted. Signed-off-by: David Wood <david.wood@huawei.com>
2022-08-21Replace #[lint/warning/error] with #[diag]Xiretza-1/+1
2022-07-27lint: add bad opt access internal lintDavid Wood-0/+42
Some command-line options accessible through `sess.opts` are best accessed through wrapper functions on `Session`, `TyCtxt` or otherwise, rather than through field access on the option struct in the `Session`. Adds a new lint which triggers on those options that should be accessed through a wrapper function so that this is prohibited. Options are annotated with a new attribute `rustc_lint_opt_deny_field_access` which can specify the error message (i.e. "use this other function instead") to be emitted. A simpler alternative would be to simply rename the options in the option type so that it is clear they should not be used, however this doesn't prevent uses, just discourages them. Another alternative would be to make the option fields private, and adding accessor functions on the option types, however the wrapper functions sometimes rely on additional state from `Session` or `TyCtxt` which wouldn't be available in an function on the option type, so the accessor would simply make the field available and its use would be discouraged too. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-25passes: port more of `check_attr` moduleDavid Wood-4/+4
Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-19tests: fix `rustc-pass-by-value-self`Artur Sinila-2/+2
2022-07-19tests: fix `rustc-pass-by-value-self`Artur Sinila-4/+4
2022-07-13Bless ui-fulldeps tests.Camille GILLOT-3/+3
2022-06-30lint: port non-existant doc keyword diagnosticsDavid Wood-1/+1
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-24macros: use typed identifiers in subdiag deriveDavid Wood-1/+1
As in the diagnostic derive, using typed identifiers in the subdiagnostic derive improves the diagnostics of using the subdiagnostic derive as Fluent messages will be confirmed to exist at compile-time. Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-24macros: use typed identifiers in diag deriveDavid Wood-1/+1
Using typed identifiers instead of strings with the Fluent identifier enables the diagnostic derive to benefit from the compile-time validation that comes with typed identifiers - use of a non-existent Fluent identifier will not compile. Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-10lint: add diagnostic translation migration lintsDavid Wood-0/+149
Introduce allow-by-default lints for checking whether diagnostics are written in `SessionDiagnostic`/`AddSubdiagnostic` impls and whether diagnostics are translatable. These lints can be denied for modules once they are fully migrated to impls and translation. Signed-off-by: David Wood <david.wood@huawei.com>
2022-05-28Fix TyKind lint, make consts no longer fn, etcMichael Goulet-87/+119
2022-02-01add a rustc::query_stability lintlcnr-0/+95
2022-01-27Clarify the `usage-of-qualified-ty` error message.Nicholas Nethercote-2/+2
I found this message confusing when I encountered it. This commit makes it clearer that you have to import the unqualified type yourself.
2022-01-11rustc_pass_by_value: handle inferred generic types (with _)Mahdi Dibaiee-6/+20
2022-01-11rustc_pass_by_value: handle generic and const type parametersMahdi Dibaiee-2/+55
2022-01-11rustc_pass_by_value: allow types with no parameters on selfMahdi Dibaiee-1/+14
includes minor refactorings
2022-01-10rustc_pass_by_value remove dependency on rustc_diagnostic_itemMahdi Dibaiee-11/+6
2022-01-10rustc_pass_by_value lint: add test on custom typesMahdi Dibaiee-14/+78
2022-01-09feat: pass_by_value lint attributeMahdi Dibaiee-23/+24
Useful for thin wrapper attributes that are best passed as value instead of reference.
2021-11-24Add feature gate test for "rustdoc_internal" featureGuillaume Gomez-1/+1
2021-10-28Revert "Add rustc lint, warning when iterating over hashmaps"Mark Rousskov-95/+0
2021-10-24Rollup merge of #89558 - lcnr:query-stable-lint, r=estebankMatthias Krüger-0/+95
Add rustc lint, warning when iterating over hashmaps r? rust-lang/wg-incr-comp
2021-10-15add a `rustc::query_stability` lintlcnr-0/+95
2021-10-15Bless testsCameron Steffen-1/+1
2021-08-22Fix typos “an”→“a” and a few different ones that appeared in the ↵Frank Steffahn-1/+1
same search
2021-07-09Fix default_hash_types to use resolved pathCameron Steffen-20/+27
2021-06-06Don't pass -Z unstable-options by default for UI testsJoshua Nelson-3/+4
- Pass it explicitly where appropriate - Update stderr files and warnings; it turns that unstable-options has far-reaching effects on diagnostics.
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-1/+1
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2020-12-03Only deny doc_keyword in std and set it as "allow" by defaultGuillaume Gomez-2/+8
2020-12-03Add test for EXISTING_DOC_KEYWORD internal lintGuillaume Gomez-0/+20
2020-09-21add testBastian Kauschke-0/+53
2020-06-15make all uses of ty::Error or ConstKind::Error delay a span bugmark-2/+2
2020-05-12Remove ty::UnnormalizedProjectionJack Huey-15/+8
2020-03-30rustc -> rustc_middle part 5 -- fix testsMazdak Farrokhzad-7/+7