[rust-dev] Large Collection of rustc builds
Hello all, I now have on a disk here every merge into master that builds on my machine, built. That is, 3733 copies, using 560GB of disk, of rustc going back to the first run of bors on February 1, 2013. If there's anything interesting you want to do with them, let me know! -- http://octayn.net/ ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev
Re: [rust-dev] Convincing compiler that *T is safe
Indeed, I would say a wrapper would be a good abstraction here. Even more so than in modern C++, ’naked’ raw pointers are in general (exceptions granted) distasteful for public APIs in Rust. ~Brendan On 14 Apr 2014, at 6:22 am, György Andrasek wrote: > You could make a container struct: > >struct Dev { >ptr: *mut InternalDev >} > > and then impl your methods on that. > ___ > Rust-dev mailing list > Rust-dev@mozilla.org > https://mail.mozilla.org/listinfo/rust-dev ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev
Re: [rust-dev] Convincing compiler that *T is safe
You could make a container struct: struct Dev { ptr: *mut InternalDev } and then impl your methods on that. ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev
[rust-dev] Convincing compiler that *T is safe
I have a number of I/O mapped registers that look like: struct Dev { .. // u32 fields } pub static Dev0 : *mut Dev = 0xsomeaddr as *mut Dev; with macro-generated getters and setters: pub fn $getter_name(&self) -> u32 { unsafe { volatile_load(&(self.$reg)) } } unfortunately, calling a getter is calling a method on *Reg, which is unsafe and looks like: unsafe { (*Dev0).SOME_REG() }; is there any way to simplify the syntax, hopefully to simple Dev0.SOME_REG()? I'm ok with any "unsafe" tricks including transmuting it to &Dev (that doesn't seem to be possible though), as the getter/setter methods are always safe in this scenario. -- Sincerely, Vladimir "Farcaller" Pouzanov http://farcaller.net/ ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev