diff --git a/crates/ruff_linter/src/rules/perflint/rules/incorrect_dict_iterator.rs b/crates/ruff_linter/src/rules/perflint/rules/incorrect_dict_iterator.rs index 829e63e0ddea4..d1f1e6ef9748a 100644 --- a/crates/ruff_linter/src/rules/perflint/rules/incorrect_dict_iterator.rs +++ b/crates/ruff_linter/src/rules/perflint/rules/incorrect_dict_iterator.rs @@ -37,6 +37,12 @@ use crate::checkers::ast::Checker; /// for value in obj.values(): /// print(value) /// ``` +/// +/// ## Fix safety +/// The fix does not perform any type analysis. The fix will be incorrect if the +/// object in question does not duck-type as a mapping, e.g. because it is +/// missing `.keys()` or `.values()` or because those methods behave differently +/// than they do on mappings. #[violation] pub struct IncorrectDictIterator { subset: DictSubset,