Skip to content

Compiler silently ignores #[warn(..)] attributes where non-applicable #2946

Closed
@bblum

Description

@bblum

The same ICFP (#2928) teammate as in bug #2942 was also confused by this code, which warns about the implicit copy on x:

enum asdf = int;
impl foo for asdf {
    #[warn(no_implicit_copies)]
    fn foo(x: ~[asdf]) -> ~[asdf] { x } 
}
fn main() {
    asdf(5).foo(~[]);
}

Moving the #[warn(..)] up to the top level makes it compile with no warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions