Instead of ``` fn close(fd: int) -> int = "_close"; ``` we should write ``` #[link_name = "_close"] fn close(fd: int) -> int; ```
Activity
lht commentedon Nov 11, 2011
Should native mod be moved to attribute also to keep it consistent with native fn?
So
becomes
lht commentedon Nov 11, 2011
Okay, I guess the answer is yes. Issue #547 (Replace some native module syntax with attributes).
brson commentedon Nov 11, 2011
Also native mods that are crate directives.
rustc: Use link_name attribute for native function
lht commentedon Nov 21, 2011
Now I'm about to start hacking crate directive. The plan is:
mod os_fs = "posix_fs.rs";
to
#[path = "posix_fs.rs"] mod os_fs;
path
is chosen overfilename
, considering it might indicate a directory.brson commentedon Nov 21, 2011
Yes. What you propose sounds good.
lht commentedon Nov 22, 2011
Are native
item
declarations in .rc files allowed? As hinted by the few native rc test cases.but the reference states
a crate is a sequence of directives
.brson commentedon Nov 22, 2011
Seems to be a feature that was never implemented, and I don't think there's any need.
rustc: Add a path attribute for crate directives
rustc: Add a path attribute for crate directives
lht commentedon Dec 1, 2011
I guess this can be closed? Or should we remove the tests:
./run-pass/native-mod.rc
./run-pass/native.rc
brson commentedon Dec 1, 2011
Let's leave the tests as a reminder that somebody wanted that feature at some point.
Remove expression from cbmc check descriptions (rust-lang#906)