about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/expect.rs
AgeCommit message (Collapse)AuthorLines
2025-06-18Reduce uses of `hir_crate`.Camille GILLOT-2/+1
2025-03-12Move methods from `Map` to `TyCtxt`, part 4.Nicholas Nethercote-1/+1
Continuing the work from #137350. Removes the unused methods: `expect_variant`, `expect_field`, `expect_foreign_item`. Every method gains a `hir_` prefix.
2025-02-24Introduce new-style attribute parsers for several attributesJana Dönszelmann-0/+1
note: compiler compiles but librustdoc and clippy don't
2025-02-24Change span field accesses to method callsJana Dönszelmann-1/+1
2025-01-19Run `clippy --fix` for `unnecessary_map_or` lintYotam Ofek-1/+1
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-09-06Check AttrId for expectations.Camille GILLOT-51/+39
2024-08-31Remove attr_id from stable lint ids.Camille GILLOT-2/+1
2024-08-31Rewrite lint_expectations in a single pass.Camille GILLOT-4/+50
2024-08-21Use bool in favor of Option<()> for diagnosticsMichael Goulet-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-1/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-25RFC 2383: Stabilize `lint_reasons` :tada:xFrednet-5/+0
2024-01-23Rename `TyCtxt::emit_spanned_lint` as `TyCtxt::emit_node_span_lint`.Nicholas Nethercote-1/+1
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-1/+1
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-18Rename `Session::span_diagnostic` as `Session::dcx`.Nicholas Nethercote-1/+1
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-1/+1
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-10-16Rename `ACTIVE_FEATURES` as `UNSTABLE_FEATURES`.Nicholas Nethercote-1/+1
It's a better name, and lets "active features" refer to the features that are active in a particular program, due to being declared or enabled by the edition. The commit also renames `Features::enabled` as `Features::active` to match this; I changed my mind and have decided that "active" is a little better thatn "enabled" for this, particularly because a number of pre-existing comments use "active" in this way. Finally, the commit renames `Status::Stable` as `Status::Accepted`, to match `ACCEPTED_FEATURES`.
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-1/+1
2023-01-13Auto merge of #106776 - oli-obk:om_nom_nom_nom_nom, r=cjgillotbors-1/+1
Feed a bunch of queries instead of tracking fields on TyCtxt r? `@cjgillot` pulled out of https://github.com/rust-lang/rust/pull/105462
2023-01-12Feed the `features_query` instead of grabbing it from the session lazilyOli Scherer-1/+1
2023-01-09refactor: cleanupRejyr-2/+0
2023-01-09refactor: refactor to derive for some lints.Rejyr-2/+4
2023-01-09migrate: `expect.rs`Rejyr-29/+11
2022-10-23Migrate all diagnosticsNilstrieb-2/+2
2022-10-01Compute `lint_levels` by definitionDeadbeef-1/+3
2022-10-01Refactor rustc lint APIMaybe Waffle-5/+5
2022-09-22Revert "Auto merge of #101620 - cjgillot:compute_lint_levels_by_def, r=oli-obk"Camille GILLOT-3/+1
This reverts commit 2cb9a65684dba47c52de8fa938febf97a73e70a9, reversing changes made to 750bd1a7ff3e010611b97ee75d30b7cbf5f3a03c.
2022-09-14Compute `lint_levels` by definitionDeadbeef-1/+3
2022-06-30lint: port expectation diagnosticsDavid Wood-2/+3
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-16Support lint expectations for `--force-warn` lints (RFC 2383)xFrednet-8/+8
2022-05-08Move lint expectation checking into a separate query (RFC 2383)xFrednet-2/+10
2022-04-05errors: implement fallback diagnostic translationDavid Wood-1/+1
This commit updates the signatures of all diagnostic functions to accept types that can be converted into a `DiagnosticMessage`. This enables existing diagnostic calls to continue to work as before and Fluent identifiers to be provided. The `SessionDiagnostic` derive just generates normal diagnostic calls, so these APIs had to be modified to accept Fluent identifiers. In addition, loading of the "fallback" Fluent bundle, which contains the built-in English messages, has been implemented. Each diagnostic now has "arguments" which correspond to variables in the Fluent messages (necessary to render a Fluent message) but no API for adding arguments has been added yet. Therefore, diagnostics (that do not require interpolation) can be converted to use Fluent identifiers and will be output as before.
2022-03-07Handle `#[expect(unfulfilled_lint_expectations)]` with a lint messagexFrednet-4/+5
2022-03-02Use Vec for expectations to have a constant order (RFC-2383)xFrednet-3/+1
2022-03-02Added `panics` for unreachable states for expectations (RFC 2383)xFrednet-0/+2
2022-03-02Emit `unfullfilled_lint_expectation` using a `HirId` for performance (RFC-2383)xFrednet-13/+16
2022-03-02Add UI tests for the `expect` attribute (RFC-2383)xFrednet-4/+2
* Add UI tests with macros for the `expect` attribute (RFC-2383) * Addressed review comments - mostly UI test updates (RFC-2383) * Documented lint level attribute on macro not working bug (RFC-2383) See `rust#87391`
2022-03-02Make `LintExpectationId` stable between compilation sessions (RFC-2383)xFrednet-1/+1
2022-03-02Check lint expectations and emit lint if unfulfilled (RFC-2383)xFrednet-0/+48