Skip to content

Commit 223f92a

Browse files
authored
Rollup merge of #128919 - Nadrieril:lint-query-leaks, r=cjgillot
Add an internal lint that warns when accessing untracked data Some methods access data that is not tracked by the query system and should be used with caution. As suggested in rust-lang/rust#128815 (comment), in this PR I propose a lint (modeled on the `potential_query_instability` lint) that warns when using some specially-annotatted functions. I can't tell myself if this lint would be that useful, compared to renaming `Steal::is_stolen` to `is_stolen_untracked`. This would depend on whether there are other functions we'd want to lint like this. So far it seems they're called `*_untracked`, which may be clear enough. r? ``@oli-obk``
2 parents 0ff282b + c304e9b commit 223f92a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/hir-expand/src/inert_attr_macro.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,9 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
464464
// Used by the `rustc::potential_query_instability` lint to warn methods which
465465
// might not be stable during incremental compilation.
466466
rustc_attr!(rustc_lint_query_instability, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE),
467+
// Used by the `rustc::untracked_query_information` lint to warn methods which
468+
// might break incremental compilation.
469+
rustc_attr!(rustc_lint_untracked_query_information, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE),
467470
// Used by the `rustc::untranslatable_diagnostic` and `rustc::diagnostic_outside_of_impl` lints
468471
// to assist in changes to diagnostic APIs.
469472
rustc_attr!(rustc_lint_diagnostics, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE),

0 commit comments

Comments
 (0)