diff --git a/crates/ruff_linter/src/rules/flake8_errmsg/rules/string_in_exception.rs b/crates/ruff_linter/src/rules/flake8_errmsg/rules/string_in_exception.rs index dda27c6602..0efb2603a1 100644 --- a/crates/ruff_linter/src/rules/flake8_errmsg/rules/string_in_exception.rs +++ b/crates/ruff_linter/src/rules/flake8_errmsg/rules/string_in_exception.rs @@ -49,9 +49,11 @@ use crate::Locator; /// ``` /// /// ## Fix safety -/// This rule's fix is marked as unsafe because comments associated with the -/// exception argument may not be reliably matched to their original code -/// positions after the fix is applied. +/// This rule's fix is marked as unsafe because: +/// - Comments associated with the exception argument may not be reliably matched +/// to their original code positions after the fix is applied. +/// - The introduced `msg` variable may shadow an existing variable in the same +/// scope, potentially changing program behavior. #[derive(ViolationMetadata)] pub(crate) struct RawStringInException; @@ -109,9 +111,11 @@ impl Violation for RawStringInException { /// ``` /// /// ## Fix safety -/// This rule's fix is marked as unsafe because comments associated with the -/// exception argument may not be reliably matched to their original code -/// positions after the fix is applied. +/// This rule's fix is marked as unsafe because: +/// - Comments associated with the exception argument may not be reliably matched +/// to their original code positions after the fix is applied. +/// - The introduced `msg` variable may shadow an existing variable in the same +/// scope, potentially changing program behavior. #[derive(ViolationMetadata)] pub(crate) struct FStringInException; @@ -170,9 +174,11 @@ impl Violation for FStringInException { /// ``` /// /// ## Fix safety -/// This rule's fix is marked as unsafe because comments associated with the -/// exception argument may not be reliably matched to their original code -/// positions after the fix is applied. +/// This rule's fix is marked as unsafe because: +/// - Comments associated with the exception argument may not be reliably matched +/// to their original code positions after the fix is applied. +/// - The introduced `msg` variable may shadow an existing variable in the same +/// scope, potentially changing program behavior. #[derive(ViolationMetadata)] pub(crate) struct DotFormatInException;