graydon/rust — Issue #1181: #cfg conditional compilation does not work in object expressions
Author: boggle
Created: 2011-11-16 18:50:12+00:00
State: open

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.