Skip to content

Some invalid syntax in format spec in format! is ignored #15175

@alco

Description

@alco

These examples demonstrate the issue:

rusti: format!("A{:6>}A", "hi")                
Notice(rusti): AhiA             

rusti: format!("A{:>6}A", "hi")  
Notice(rusti): A    hiA      

rusti: format!("A{:^6}A", "hi")
Notice(rusti): http://j.mp/1v4FzyA

Per the format spec grammar, the alignment character should go on the left of the width specifier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions