Skip to content

#[deriving] should copy lint attributes from the original item #13054

Closed
@lifthrasiir

Description

@lifthrasiir

Otherwise it can be very annoying to use lint-affected items selectively. For example, the following code tries to use an unstable item X from a stable item A, but boilerplates generated from #[deriving(Clone)] do not have #[allow(unstable)] attached, so it fails to compile. Currently the only way available is to manually add impls with the proper lint attributes.

#[deny(unstable)];

#[allow(unstable)]
#[unstable]
#[deriving(Clone)]
struct X;

#[allow(unstable)]
#[deriving(Clone)]
struct A { x: X }

fn main() { }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions