Skip to content

#[plugin(...)] at the top level should cause an error; #![plugin(...)] is correct #24213

Closed
@apoelstra

Description

@apoelstra

Right now if you write #[plugin(...)] to import some syntax extension, the import simply won't happen and other errors will occur. For example, if you write #[plugin(serde_macros)] and then later do #[derive(Serialize)] on a type you will get errors about Serialize not being implemented, as though the derive had done nothing.

This is extremely confusing since a user is basically being told "#derive had no effect" when the real problem is a missing exclamation mark in a totally different source file.

This should trigger an error to use #![plugin(...)] instead.

cc @erickt

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-pluginsArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions