{"record":{"id":"a516f2e712862884","repo":"rust-lang/rust-clippy","slug":"unqualified-repr-packed-defaults-to-repr","errorCode":null,"errorMessage":"unqualified `#[repr(packed)]` defaults to `#[repr(Rust, packed)]`, which has no stable ABI","messagePattern":"unqualified `#\\[repr\\(packed\\)\\]` defaults to `#\\[repr\\(Rust, packed\\)\\]`, which has no stable ABI","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"clippy_lints/src/attrs/repr_attributes.rs","lineNumber":30,"sourceCode":"    if let Some(reprs) = find_attr!(attrs, Repr { reprs, .. } => reprs) {\n        let packed_span = reprs\n            .iter()\n            .find(|(r, _)| matches!(r, ReprAttr::ReprPacked(..)))\n            .map(|(_, s)| *s);\n\n        if let Some(packed_span) = packed_span\n            && !reprs\n                .iter()\n                .any(|(x, _)| *x == ReprAttr::ReprC || *x == ReprAttr::ReprRust)\n            && msrv.meets(cx, msrvs::REPR_RUST)\n        {\n            span_lint_and_then(\n                cx,\n                REPR_PACKED_WITHOUT_ABI,\n                item_span,\n                \"item uses `packed` representation without ABI-qualification\",\n                |diag| {\n                    diag.warn(\n                        \"unqualified `#[repr(packed)]` defaults to `#[repr(Rust, packed)]`, which has no stable ABI\",\n                    )\n                    .help(\"qualify the desired ABI explicitly via `#[repr(C, packed)]` or `#[repr(Rust, packed)]`\")\n                    .span_label(packed_span, \"`packed` representation set here\");\n                },\n            );\n        }\n    }\n}\n","sourceCodeStart":12,"sourceCodeEnd":40,"githubUrl":"https://github.com/rust-lang/rust-clippy/blob/13aece11388703700981f29d9480ffd6409a3192/clippy_lints/src/attrs/repr_attributes.rs#L12-L40","documentation":"Clippy lint REPR_PACKED_WITHOUT_ABI: #[repr(packed)] without an explicit ABI resets the layout to the unspecified #[repr(Rust, packed)] representation, which has no stable ABI. The lint fires when the repr list contains ReprPacked but neither ReprC nor ReprRust, and the MSRV supports REPR_RUST — i.e. the author relied on an implicit default instead of naming the intended ABI.","triggerScenarios":"Thrown at clippy_lints/src/attrs/repr_attributes.rs:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write #[repr(C, packed)] when a stable, C-compatible packed layout is intended","Or spell out the default explicitly as #[repr(Rust, packed)] if no stable ABI is required","Audit FFI boundaries and any code transmuting or serializing the type to confirm the chosen ABI matches consumers"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"13aece11388703700981f29d9480ffd6409a3192","analyzedAt":"2026-09-07T23:08:18.134Z","contentChangedAt":"2026-09-07T23:08:18.134Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}