Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

literal_string_with_formatting_args should provide a way to declare formatting macro #13994

Open
ia0 opened this issue Jan 13, 2025 · 2 comments

Comments

@ia0
Copy link

ia0 commented Jan 13, 2025

Description

If one wants to provide their own formatting macros (either as proc-macro or wrappers around existing formatting macros), they will get the lint at every call-site.

How does the lint check that a macro is a formatting macro? Does it have access to attributes declared on the macro definition?

If there is (or will be) such a feature, it should be documented in the lint documentation.

Version

rustc 1.86.0-nightly (48a426eca 2025-01-12)
binary: rustc
commit-hash: 48a426eca9df23b24b3559e545cf88dee61d4de9
commit-date: 2025-01-12
host: x86_64-unknown-linux-gnu
release: 1.86.0-nightly
LLVM version: 19.1.6

Additional Labels

No response

@joshtriplett
Copy link
Member

This should allow declaring both macros and functions that accept arguments whose strings may look like they contain formatting args.

@ia0
Copy link
Author

ia0 commented Jan 29, 2025

Good point! I assumed the lint triggered only on macros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants