about summary refs log tree commit diff
path: root/tests/ui-fulldeps/internal-lints
AgeCommit message (Collapse)AuthorLines
2025-08-25Switch next solver to use a specific associated type for trait def idChayim Refael Friedman-1/+1
The compiler just puts `DefId` in there, but rust-analyzer uses different types for each kind of item.
2025-08-17Add `//@ ignore-stage1` to query_stability.rs testSamuel Moelius-10/+11
2025-08-15Extend `QueryStability` to handle `IntoIterator` implementationsSamuel Moelius-1/+29
Fix adjacent code Fix duplicate warning; merge test into `tests/ui-fulldeps/internal-lints` Use `rustc_middle::ty::FnSig::inputs` Address two review comments - https://github.com/rust-lang/rust/pull/139345#discussion_r2109006991 - https://github.com/rust-lang/rust/pull/139345#discussion_r2109058588 Use `Instance::try_resolve` Import `rustc_middle::ty::Ty` as `Ty` rather than `MiddleTy` Simplify predicate handling Add more `#[allow(rustc::potential_query_instability)]` following rebase Remove two `#[allow(rustc::potential_query_instability)]` following rebase Address review comment Update compiler/rustc_lint/src/internal.rs Co-authored-by: lcnr <rust@lcnr.de>
2025-06-18Implement lint against direct uses of rustc_type_ir in compiler cratesRomain Perier-0/+65
This commit adds a lint to prevent the use of rustc_type_ir in random compiler crates, except for type system internals traits, which are explicitly allowed. Moreover, this fixes diagnostic_items() to include the CRATE_OWNER_ID, otherwise rustc_diagnostic_item attribute is ignored on the crate root.
2025-04-16Move eager translation to a method on `Diag`Jake Goulding-14/+12
This will allow us to eagerly translate messages on a top-level diagnostic, such as a `LintDiagnostic`. As a bonus, we can remove the awkward closure passed into Subdiagnostic and make better use of `Into`.
2025-03-26Implement lint against using Interner and InferCtxtLike in random compiler ↵Michael Goulet-0/+31
crates
2024-12-22Begin to implement type system layer of unsafe bindersMichael Goulet-197/+9
2024-11-10Fix error message for direct usage of sess.opts.crate_typesbjorn3-2/+2
2024-10-19Do not run lints that cannot emitblyxyas-2/+10
Before this change, adding a lint was a difficult matter because it always had some overhead involved. This was because all lints would run, no matter their default level, or if the user had #![allow]ed them. This PR changes that
2024-10-15update bootstrap configsJosh Stone-11/+6
2024-09-03Add an internal lint that warns when accessing untracked dataNadrieril-0/+31
2024-09-01Deny imports of rustc_type_ir::inherent outside of type ir + new trait solverMichael Goulet-0/+49
2024-08-10`untranslatable_diagnostic` lint: point at the untranslated thingPavel Grigorenko-18/+16
and not the function/method call
2024-08-10Add more test cases for untranslatable_diagnostic lintPavel Grigorenko-1/+34
2024-07-28Bless a bootstrap-dependent UI testTrevor Gross-10/+10
2024-07-28step cfg(bootstrap)Mark Rousskov-1/+0
2024-07-18Add internal lint for detecting non-glob imports of `rustc_type_ir::inherent`León Orell Valerian Liehr-0/+106
2024-06-18Use a dedicated type instead of a reference for the diagnostic contextOli Scherer-7/+7
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-05-23Remove `LintDiagnostic::msg`León Orell Valerian Liehr-11/+3
* instead simply set the primary message inside the lint decorator functions * it used to be this way before [#]101986 which introduced `msg` to prevent good path delayed bugs (which no longer exist) from firing under certain circumstances when lints were suppressed / silenced * this is no longer necessary for various reasons I presume * it shaves off complexity and makes further changes easier to implement
2024-04-21Pass translation closure to add_to_diag_with() as referenceXiretza-2/+2
2024-04-08Actually create ranged int types in the type system.Oli Scherer-23/+30
2024-03-11Allow multiple `impl Into<{D,Subd}iagMessage>` parameters in a function.Nicholas Nethercote-2/+8
The internal diagnostic lint currently only allows one, because that was all that occurred in practice. But rust-lang/rust-clippy/pull/12453 wants to introduce functions with more than one, and this limitation is getting in the way.
2024-03-11Rename `DecorateLint` as `LintDiagnostic`.Nicholas Nethercote-9/+9
To match `derive(LintDiagnostic)`.
2024-03-11Rename `AddToDiagnostic` as `Subdiagnostic`.Nicholas Nethercote-12/+12
To match `derive(Subdiagnostic)`. Also rename `add_to_diagnostic{,_with}` as `add_to_diag{,_with}`.
2024-03-11Rename `IntoDiagnostic` as `Diagnostic`.Nicholas Nethercote-11/+11
To match `derive(Diagnostic)`. Also rename `into_diagnostic` as `into_diag`.
2024-03-06Rewrite the `untranslatable_diagnostic` lint.Nicholas Nethercote-7/+40
Currently it only checks calls to functions marked with `#[rustc_lint_diagnostics]`. This commit changes it to check calls to any function with an `impl Into<{D,Subd}iagMessage>` parameter. This greatly improves its coverage and doesn't rely on people remembering to add `#[rustc_lint_diagnostics]`. The commit also adds `#[allow(rustc::untranslatable_diagnostic)`] attributes to places that need it that are caught by the improved lint. These places that might be easy to convert to translatable diagnostics. Finally, it also: - Expands and corrects some comments. - Does some minor formatting improvements. - Adds missing `DecorateLint` cases to `tests/ui-fulldeps/internal-lints/diagnostics.rs`.
2024-03-05Rename `SubdiagnosticMessageOp` as `SubdiagMessageOp`.Nicholas Nethercote-3/+3
2024-03-05Disable `tests/ui-fulldeps/internal-lints/diagnostics.rs` on stage 1.Nicholas Nethercote-7/+8
When you make a change to the diagnostic lints, it uses the old version of the lints with stage 1 and the new version with stage 2, which often leads to failures in stage 1. Let's just stick to stage 2.
2024-02-28Rename `DiagnosticBuilder` as `Diag`.Nicholas Nethercote-9/+9
Much better! Note that this involves renaming (and updating the value of) `DIAGNOSTIC_BUILDER` in clippy.
2024-02-28Rename `Diagnostic` as `DiagInner`.Nicholas Nethercote-2/+2
I started by changing it to `DiagData`, but that didn't feel right. `DiagInner` felt much better.
2024-02-22[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives许杰友 Jieyou Xu (Joe)-9/+9
2024-02-20Reduce capabilities of `Diagnostic`.Nicholas Nethercote-7/+14
Currently many diagnostic modifier methods are available on both `Diagnostic` and `DiagnosticBuilder`. This commit removes most of them from `Diagnostic`. To minimize the diff size, it keeps them within `diagnostic.rs` but changes the surrounding `impl Diagnostic` block to `impl DiagnosticBuilder`. (I intend to move things around later, to give a more sensible code layout.) `Diagnostic` keeps a few methods that it still needs, like `sub`, `arg`, and `replace_args`. The `forward!` macro, which defined two additional methods per call (e.g. `note` and `with_note`), is replaced by the `with_fn!` macro, which defines one additional method per call (e.g. `with_note`). It's now also only used when necessary -- not all modifier methods currently need a `with_*` form. (New ones can be easily added as necessary.) All this also requires changing `trait AddToDiagnostic` so its methods take `DiagnosticBuilder` instead of `Diagnostic`, which leads to many mechanical changes. `SubdiagnosticMessageOp` gains a type parameter `G`. There are three subdiagnostics -- `DelayedAtWithoutNewline`, `DelayedAtWithNewline`, and `InvalidFlushedDelayedDiagnosticLevel` -- that are created within the diagnostics machinery and appended to external diagnostics. These are handled at the `Diagnostic` level, which means it's now hard to construct them via `derive(Diagnostic)`, so instead we construct them by hand. This has no effect on what they look like when printed. There are lots of new `allow` markers for `untranslatable_diagnostics` and `diagnostics_outside_of_impl`. This is because `#[rustc_lint_diagnostics]` annotations were present on the `Diagnostic` modifier methods, but missing from the `DiagnosticBuilder` modifier methods. They're now present.
2024-02-08Add `SubdiagnosticMessageOp` as a trait alias.Nicholas Nethercote-12/+7
It avoids a lot of repetition.
2024-02-06Add CoroutineClosure to TyKind, AggregateKind, UpvarArgsMichael Goulet-15/+22
2024-01-30add missing potential_query_instability for keys and values in hashmapyukang-1/+38
2024-01-06Remove ignore-stage1 that was added when changing error count msgNilstrieb-3/+2
The bootstrap bump has happened, so the bootstrap compiler now contains the new diagnotic.
2023-12-19Add `level` arg to `into_diagnostic`.Nicholas Nethercote-11/+11
And make all hand-written `IntoDiagnostic` impls generic, by using `DiagnosticBuilder::new(dcx, level, ...)` instead of e.g. `dcx.struct_err(...)`. This means the `create_*` functions are the source of the error level. This change will let us remove `struct_diagnostic`. Note: `#[rustc_lint_diagnostics]` is added to `DiagnosticBuilder::new`, it's necessary to pass diagnostics tests now that it's used in `into_diagnostic` functions.
2023-12-18Fix up some `ui-fulldeps` tests.Nicholas Nethercote-22/+22
2023-11-26Use `rustc_fluent_macro::fluent_messages!` directly.Nicholas Nethercote-7/+6
Currently we always do this: ``` use rustc_fluent_macro::fluent_messages; ... fluent_messages! { "./example.ftl" } ``` But there is no need, we can just do this everywhere: ``` rustc_fluent_macro::fluent_messages! { "./example.ftl" } ``` which is shorter.
2023-11-24Bless ui-fulldepsNilstrieb-3/+4
We have to ignore some tests in stage1.
2023-11-15Bump cfg(bootstrap)sMark Rousskov-4/+2
2023-10-22Auto merge of #116932 - Kobzol:fix-stage1-tests, r=Mark-Simulacrumbors-2/+4
Fix x86_64-gnu-llvm-15 CI tests The CI script was broken - if there was a test failure in the first command chain (inside the `if`), CI would not report the failure. It happened because there were two command chains separated by `&&` in the script, and since `set -e` doesn't exit for chained commands, if the first chain has failed, the script would happily continue forward, ignoring any test failures. This could be fixed e.g. by adding some `|| exit 1` to the first chain, but I suppose that the `&&` chaining is unnecessary here anyway. Reported [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/test.20failure.20didn't.20stop.20CI). Fixes: https://github.com/rust-lang/rust/issues/116867
2023-10-20bless ui-fulldepsOli Scherer-2/+2
2023-10-20s/Generator/Coroutine/Oli Scherer-2/+2
2023-10-19Fix `span_use_eq_ctxt` testJakub Beránek-2/+4
The stage0 compiler does not know about the lint yet, so ignore the test on stage1.
2023-10-16debug Span::ctxt() call detectionArthur Lafrance-3/+17
2023-10-16basic lint v2 implementedArthur Lafrance-0/+13
2023-09-28Remove `rustc_lint_defs::lint_array`DaniPopes-1/+1
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-20/+13
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-8/+10
Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).