Skip to content

uninlined_format_args misses multi-line macros #9719

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

Closed
Nemo157 opened this issue Oct 25, 2022 · 1 comment · Fixed by #9945
Closed

uninlined_format_args misses multi-line macros #9719

Nemo157 opened this issue Oct 25, 2022 · 1 comment · Fixed by #9945
Labels
C-bug Category: Clippy is not doing the correct thing I-false-negative Issue: The lint should have been triggered on code, but wasn't

Comments

@Nemo157
Copy link
Member

Nemo157 commented Oct 25, 2022

Summary

When the macro arguments span multiple lines they are missed by the lint.

Lint Name

uninlined_format_args

Reproducer

I tried this code (playground):

pub fn foo() {
    let a = 1;
    format!("{}",
        a
    );
}

I expected to see this happen: an uninlined_format_args warning

Instead, this happened: no warning

Version

clippy: 0.1.66 (2022-10-24 758f196)
@Nemo157 Nemo157 added C-bug Category: Clippy is not doing the correct thing I-false-negative Issue: The lint should have been triggered on code, but wasn't labels Oct 25, 2022
@kraktus
Copy link
Contributor

kraktus commented Nov 25, 2022

Hello, this is known limitation for now, due to rustc crashing when too many arguments are inlined: #9599

bors added a commit that referenced this issue Nov 25, 2022
Re-enable `uninlined_format_args` on multiline `format!`

fix #9719

There was an issue with the code suggestion which can be sometimes completely broken (fortunately when applied it's valid), so we do not show it.
@bors bors closed this as completed in 6d0b4e3 Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-negative Issue: The lint should have been triggered on code, but wasn't
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants