Overloaded operators can't be unsafe anymore

This commit is contained in:
Patrick Walton 2012-07-27 22:29:27 -07:00
parent 38c6e99e20
commit 51456ef6a9
3 changed files with 0 additions and 15 deletions

View file

@ -7,7 +7,6 @@ import js::jsapi::bindgen::{JS_ValueToString, JS_GetStringCharsZAndLength, JS_Re
JS_DefineFunctions, JS_DefineProperty, JS_DefineProperties};
import js::glue::bindgen::*;
import js::crust::{JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ConvertStub, JS_ResolveStub};
import js::ptr_methods;
import result::{result, ok, err};
import ptr::null;
import libc::c_uint;

View file

@ -99,7 +99,6 @@ mod text {
mod util {
mod tree;
mod color;
mod unsafe;
mod time;
mod url;
}

View file

@ -1,13 +0,0 @@
trait methods<T> {
unsafe fn +(idx: uint) -> *T;
unsafe fn [](idx: uint) -> T;
}
impl methods<T: copy> of methods<T> for *T {
unsafe fn +(idx: uint) -> *T {
ptr::offset(self, idx)
}
unsafe fn [](idx: uint) -> T {
*(self + idx)
}
}