libcore: Remove mutable fields from os and ptr
This commit is contained in:
parent
b2d1ac100f
commit
2961997f16
2 changed files with 8 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue