Skip to content

Consider making pointer boxing a higher priority #5144

Closed
@Kimundi

Description

@Kimundi

Right now, ~[1,2,3].to_str() is the same as ~([1,2,3].to_str()), which is confusing because in the case of of strings and vectors, the sigil is basically part of the literal.

If pointer boxing gets at least a higher priority than method application, ~[1,2,3].to_str() would mean (~[1,2,3]).to_str(), and you'd have to add explicit delimiters to box the whole method chain, like so: ~([1,2,3].to_str())

Which, I think, would be more intuitive: A pointer sigil puts the thing right next to it in a box, if you want to box the result of an complex operation, but it in brackets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)A-grammarArea: The grammar of Rust

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions