8

stabilize format args capture by joshtriplett · Pull Request #90473 · rust-lang/...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/90473
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Copy link

Member

joshtriplett commented 17 days ago

edited

Works as expected, and there are widespread reports of success with it, as well as interest in it.

RFC: rust-lang/rfcs#2795
Tracking issue: #67984

Addressing items from the tracking issue:

  • We don't support capturing arguments from a non-literal format string like format_args!(concat!(...)). We could add that in a future enhancement, or we can decide that it isn't supported (as suggested in #67984 (comment) ).
  • I've updated the documentation.
  • panic! now supports capture as well.
  • There are potentially opportunities to further improve diagnostics for invalid usage, such as if it looks like the user tried to use an expression rather than a variable. However, such cases are all already caught and provide reasonable syntax errors now, and we can always provided even friendlier diagnostics in the future.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK