diff --git a/crates/ruff_linter/src/rules/flynt/rules/static_join_to_fstring.rs b/crates/ruff_linter/src/rules/flynt/rules/static_join_to_fstring.rs index 309ec0ccc70a1..5aed9103bd69b 100644 --- a/crates/ruff_linter/src/rules/flynt/rules/static_join_to_fstring.rs +++ b/crates/ruff_linter/src/rules/flynt/rules/static_join_to_fstring.rs @@ -28,6 +28,14 @@ use crate::rules::flynt::helpers; /// f"{foo} {bar}" /// ``` /// +/// # Fix safety +/// The fix is always marked unsafe because the evaluation of the f-string +/// expressions will default to calling the `__format__` method of each +/// object, whereas `str.join` expects each object to be an instance of +/// `str` and uses the corresponding string. Therefore it is possible for +/// the values of the resulting strings to differ, or for one expression +/// to raise an exception while the other does not. +/// /// ## References /// - [Python documentation: f-strings](https://docs.python.org/3/reference/lexical_analysis.html#f-strings) #[derive(ViolationMetadata)]