libcore: Remove mutable fields from os and ptr

This commit is contained in:
Patrick Walton 2013-05-02 23:12:43 -07:00
parent b2d1ac100f
commit 2961997f16
2 changed files with 8 additions and 2 deletions

View file

@ -352,7 +352,10 @@ pub fn fsync_fd(fd: c_int, _l: io::fsync::Level) -> c_int {
}
}
pub struct Pipe { in: c_int, out: c_int }
pub struct Pipe {
in: c_int,
out: c_int
}
#[cfg(unix)]
pub fn pipe() -> Pipe {

View file

@ -336,7 +336,10 @@ pub mod ptr_tests {
#[test]
fn test() {
unsafe {
struct Pair {mut fst: int, mut snd: int};
struct Pair {
fst: int,
snd: int
};
let mut p = Pair {fst: 10, snd: 20};
let pptr: *mut Pair = &mut p;
let iptr: *mut int = cast::transmute(pptr);