@@ -90,13 +90,13 @@ fn test_log(harmless: String, password: String, encrypted_password: String) {
9090 error ! ( value2: ?; "message" ) ; // $ MISSING: Alert[rust/cleartext-logging]
9191
9292 // pre-formatted
93- let m1 = & password; // $ Source=m1
93+ let m1 = & password; // $ Source[rust/cleartext-logging] =m1
9494 info ! ( "message = {}" , m1) ; // $ Alert[rust/cleartext-logging]=m1
9595
96- let m2 = "message = " . to_string ( ) + & password; // $ Source=m2
96+ let m2 = "message = " . to_string ( ) + & password; // $ Source[rust/cleartext-logging] =m2
9797 info ! ( "{}" , m2) ; // $ Alert[rust/cleartext-logging]=m2
9898
99- let m3 = format ! ( "message = {}" , password) ; // $ Source=m3
99+ let m3 = format ! ( "message = {}" , password) ; // $ Source[rust/cleartext-logging] =m3
100100 info ! ( "{}" , m3) ; // $ Alert[rust/cleartext-logging]=m3
101101
102102 let mut m4 = String :: new ( ) ;
@@ -126,7 +126,7 @@ fn test_log(harmless: String, password: String, encrypted_password: String) {
126126 trace ! ( "message = {}" , & str2) ;
127127
128128 // logging from a tuple
129- let t1 = ( harmless, password) ; // $ Source=t1
129+ let t1 = ( harmless, password) ; // $ Source[rust/cleartext-logging] =t1
130130 trace ! ( "message = {}" , t1. 0 ) ;
131131 trace ! ( "message = {}" , t1. 1 ) ; // $ Alert[rust/cleartext-logging]=t1
132132 trace ! ( "message = {:?}" , t1) ; // $ MISSING: Alert[rust/cleartext-logging]=t1
@@ -180,11 +180,11 @@ fn test_log(harmless: String, password: String, encrypted_password: String) {
180180 let _ = err_result. log_expect ( & format ! ( "Failed with password: {}" , password2) ) ; // $ Alert[rust/cleartext-logging]
181181
182182 // 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
184184 let _ = err_result2. log_expect ( "" ) ; // $ Alert[rust/cleartext-logging]=s3
185185
186186 // 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
188188 let _ = err_result3. log_unwrap ( ) ; // $ Alert[rust/cleartext-logging]=err_result3
189189}
190190
0 commit comments