File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -629,7 +629,7 @@ impl<'de> Visitor<'de> for AttrsVisitor {
629629
630630 let exe_name = std:: env:: current_exe ( )
631631 . ok ( )
632- . and_then ( |p| p. file_name ( ) . map ( |os| os . to_string_lossy ( ) . to_string ( ) ) )
632+ . map ( |p| p. display ( ) . to_string ( ) )
633633 . unwrap_or_else ( || "<unknown-exe>" . to_string ( ) ) ;
634634
635635 let mut attrs = Attrs :: new ( ) ;
@@ -1263,8 +1263,14 @@ mod tests {
12631263 let err = bincode:: deserialize :: < Attrs > ( & wire_bytes)
12641264 . expect_err ( "should error on unknown attr key" ) ;
12651265
1266+ let exe_str = std:: env:: current_exe ( )
1267+ . ok ( )
1268+ . map ( |p| p. display ( ) . to_string ( ) )
1269+ . unwrap_or_else ( || "<unknown-exe>" . to_string ( ) ) ;
12661270 let msg = format ! ( "{err}" ) ;
1271+
12671272 assert ! ( msg. contains( "unknown attr key" ) , "got: {msg}" ) ;
12681273 assert ! ( msg. contains( bad_key) , "got: {msg}" ) ;
1274+ assert ! ( msg. contains( & exe_str) , "got: {msg}" ) ;
12691275 }
12701276}
You can’t perform that action at this time.
0 commit comments