Skip to content

single-match lint expands println! macro in suggestion #2455

Closed
@kimsnj

Description

@kimsnj

The example in the README file:

    let x = Some(1u8);
    match x {
        Some(y) => println!("{:?}", y),
        _ => ()
    }

produces this suggestions:

help: try this: `if let Some(y) = x { $ crate :: io :: _print ( format_args ! ( $ ( $ arg ) * ) ) }`

Using current master (commit: 6b3487a)
And rustc 1.25.0-nightly (b8398d9 2018-02-11)

Note putting the statement inside a block { println!("{:?}", y) } works properly (and is the current case covered by ui tests).

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingT-macrosType: Issues with macros and macro expansion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions