@@ -90,13 +90,13 @@ fn test_log(harmless: String, password: String, encrypted_password: String) {
90
90
error ! ( value2: ?; "message" ) ; // $ MISSING: Alert[rust/cleartext-logging]
91
91
92
92
// pre-formatted
93
- let m1 = & password; // $ Source=m1
93
+ let m1 = & password; // $ Source[rust/cleartext-logging] =m1
94
94
info ! ( "message = {}" , m1) ; // $ Alert[rust/cleartext-logging]=m1
95
95
96
- let m2 = "message = " . to_string ( ) + & password; // $ Source=m2
96
+ let m2 = "message = " . to_string ( ) + & password; // $ Source[rust/cleartext-logging] =m2
97
97
info ! ( "{}" , m2) ; // $ Alert[rust/cleartext-logging]=m2
98
98
99
- let m3 = format ! ( "message = {}" , password) ; // $ Source=m3
99
+ let m3 = format ! ( "message = {}" , password) ; // $ Source[rust/cleartext-logging] =m3
100
100
info ! ( "{}" , m3) ; // $ Alert[rust/cleartext-logging]=m3
101
101
102
102
let mut m4 = String :: new ( ) ;
@@ -126,7 +126,7 @@ fn test_log(harmless: String, password: String, encrypted_password: String) {
126
126
trace ! ( "message = {}" , & str2) ;
127
127
128
128
// logging from a tuple
129
- let t1 = ( harmless, password) ; // $ Source=t1
129
+ let t1 = ( harmless, password) ; // $ Source[rust/cleartext-logging] =t1
130
130
trace ! ( "message = {}" , t1. 0 ) ;
131
131
trace ! ( "message = {}" , t1. 1 ) ; // $ Alert[rust/cleartext-logging]=t1
132
132
trace ! ( "message = {:?}" , t1) ; // $ MISSING: Alert[rust/cleartext-logging]=t1
@@ -180,11 +180,11 @@ fn test_log(harmless: String, password: String, encrypted_password: String) {
180
180
let _ = err_result. log_expect ( & format ! ( "Failed with password: {}" , password2) ) ; // $ Alert[rust/cleartext-logging]
181
181
182
182
// test `log_expect` with sensitive `Result.Err`
183
- let err_result2: Result < String , String > = Err ( password2. clone ( ) ) ; // $ Source=s3
183
+ let err_result2: Result < String , String > = Err ( password2. clone ( ) ) ; // $ Source[rust/cleartext-logging] =s3
184
184
let _ = err_result2. log_expect ( "" ) ; // $ Alert[rust/cleartext-logging]=s3
185
185
186
186
// test `log_unwrap` with sensitive `Result.Err`
187
- let err_result3: Result < String , String > = Err ( password2) ; // $ Source=err_result3
187
+ let err_result3: Result < String , String > = Err ( password2) ; // $ Source[rust/cleartext-logging] =err_result3
188
188
let _ = err_result3. log_unwrap ( ) ; // $ Alert[rust/cleartext-logging]=err_result3
189
189
}
190
190
0 commit comments