diff --git a/crates/ruff_linter/src/rules/flake8_simplify/rules/ast_ifexp.rs b/crates/ruff_linter/src/rules/flake8_simplify/rules/ast_ifexp.rs index 9f054ef51e..afa332011e 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/rules/ast_ifexp.rs +++ b/crates/ruff_linter/src/rules/flake8_simplify/rules/ast_ifexp.rs @@ -27,6 +27,13 @@ use crate::checkers::ast::Checker; /// bool(a) /// ``` /// +/// ## Fix safety +/// +/// This fix is marked as unsafe because it may change the program’s behavior if the condition does not +/// return a proper Boolean. While the fix will try to wrap non-boolean values in a call to bool, +/// custom implementations of comparison functions like `__eq__` can avoid the bool call and still +/// lead to altered behavior. Moreover, the fix may remove comments. +/// /// ## References /// - [Python documentation: Truth Value Testing](https://docs.python.org/3/library/stdtypes.html#truth-value-testing) #[derive(ViolationMetadata)]