@@ -373,7 +373,7 @@ pub fn run(tool: Tool, matches: &ArgMatches) -> Result<i32> {
373373 // make the artifact path relative. This makes the path that the
374374 // tool will print easier to read. eg. `libfoo.rlib` instead of
375375 // `/home/user/rust/project/target/$T/debug/libfoo.rlib`.
376- Tool :: Objdump | Tool :: Nm | Tool :: Readobj | Tool :: Size => {
376+ Tool :: Objdump | Tool :: Nm | Tool :: Readobj | Tool :: Readelf | Tool :: Size => {
377377 lltool
378378 . current_dir ( file. parent ( ) . unwrap ( ) )
379379 . arg ( file. file_name ( ) . unwrap ( ) ) ;
@@ -409,7 +409,9 @@ pub fn run(tool: Tool, matches: &ArgMatches) -> Result<i32> {
409409 | Tool :: Objcopy
410410 | Tool :: Profdata
411411 | Tool :: Strip => output. stdout . into ( ) ,
412- Tool :: Nm | Tool :: Objdump | Tool :: Readobj => postprocess:: demangle ( & output. stdout ) ,
412+ Tool :: Nm | Tool :: Objdump | Tool :: Readobj | Tool :: Readelf => {
413+ postprocess:: demangle ( & output. stdout )
414+ }
413415 Tool :: Size => postprocess:: size ( & output. stdout ) ,
414416 } ;
415417
@@ -448,22 +450,19 @@ fn cargo_build(matches: &ArgMatches, metadata: &Metadata) -> Result<Option<Artif
448450 let mut target_artifact: Option < Artifact > = None ;
449451 for message in messages {
450452 match message? {
451- Message :: CompilerArtifact ( artifact) => {
453+ Message :: CompilerArtifact ( artifact)
452454 if metadata. workspace_members . contains ( & artifact. package_id )
453- && build_type. matches ( & artifact)
454- {
455- if target_artifact. is_some ( ) {
456- bail ! ( "Can only have one matching artifact but found several" ) ;
457- }
458-
459- target_artifact = Some ( artifact) ;
455+ && build_type. matches ( & artifact) =>
456+ {
457+ if target_artifact. is_some ( ) {
458+ bail ! ( "Can only have one matching artifact but found several" ) ;
460459 }
460+
461+ target_artifact = Some ( artifact) ;
461462 }
462- Message :: CompilerMessage ( msg) => {
463- if !quiet || verbose > 1 {
464- if let Some ( rendered) = msg. message . rendered {
465- eprint ! ( "{rendered}" ) ;
466- }
463+ Message :: CompilerMessage ( msg) if ( !quiet || verbose > 1 ) => {
464+ if let Some ( rendered) = msg. message . rendered {
465+ eprint ! ( "{rendered}" ) ;
467466 }
468467 }
469468 _ => ( ) ,
0 commit comments