Skip to content

error_on_line_overflow does not diagnose function attributes inside macros #3164

@gnzlbg

Description

@gnzlbg
macro_rules! foo {
    ($id:ident) => {
        macro_rules! bar {
            ($id2:tt) => {
                #[cfg(any(target_feature = $id2, target_feature = $id2, target_feature = $id2, target_feature = $id2, target_feature = $id2))]
                fn $id() {}
            };
        }
    };
}

fn main() {}

rustfmt, as expected, does not format this code (its inside a macro), but with error_on_line_overflow = true in the rustfmt.toml I'd expect cargo fmt -- --check to diagnose that the line where the #[cfg(...)] macro is located is too long, yet no diagnostic is emitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEE-fixed-needs-confirmationCall for participation: expected to have been fixed, needs confirmationE-needs-testCall for participation: the issue is fixed but lacks a regression testonly-with-optionRequires a non-default option value to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions