Skip to content

Inline trait methods in derive-generated code #7

@joshlf

Description

@joshlf

Status

zerocopy-derive

We don't care about inline attributes for zerocopy-derive itself, but we do care for code emitted by zerocopy-derive. We need to figure out a way to either modify zerocopy-derive's output or modify our zerocopy-derive tests so that, when running zerocopy-derive tests, missing #[inline] attributes generate warnings or errors. It might be possible to use the clippy::missing_inline_in_public_items lint for this, but I'm not sure.

zerocopy

Many zerocopy trait methods contain very little logic or no logic at all, but are currently not marked with any inline attribute, and so cannot be inlined across a crate boundary. We should change this.

#[inline] attributes are now enforced by Clippy as of #341.

Mentoring instructions

Interested in contributing? See our contributing guide.

Figure out how we can ensure that the clippy::missing_inline_in_public_items lint is enforced (at least during testing) in code emitted by zerocopy-derive.

Metadata

Metadata

Assignees

Labels

compatibility-nonbreakingChanges that are (likely to be) non-breakingexperience-mediumThis issue is of medium difficulty, and requires some experiencehelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions