Skip to content

#cfg conditional compilation does not work in object expressions #1181

@boggle

Description

@boggle

Likely, this also holds for non toplevel functions. It is inconvenient and probably should be fixed. Example from io.rs:

obj FILE_writer(f: os::libc::FILE, res: option::t@FILE_res) {
#cfg[target="macos"]
fn fsync() { ret macos_os::fsync(f); }
}

will not compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions