mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Overloaded operators can't be unsafe anymore
This commit is contained in:
parent
38c6e99e20
commit
51456ef6a9
3 changed files with 0 additions and 15 deletions
|
@ -7,7 +7,6 @@ import js::jsapi::bindgen::{JS_ValueToString, JS_GetStringCharsZAndLength, JS_Re
|
||||||
JS_DefineFunctions, JS_DefineProperty, JS_DefineProperties};
|
JS_DefineFunctions, JS_DefineProperty, JS_DefineProperties};
|
||||||
import js::glue::bindgen::*;
|
import js::glue::bindgen::*;
|
||||||
import js::crust::{JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ConvertStub, JS_ResolveStub};
|
import js::crust::{JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ConvertStub, JS_ResolveStub};
|
||||||
import js::ptr_methods;
|
|
||||||
import result::{result, ok, err};
|
import result::{result, ok, err};
|
||||||
import ptr::null;
|
import ptr::null;
|
||||||
import libc::c_uint;
|
import libc::c_uint;
|
||||||
|
|
|
@ -99,7 +99,6 @@ mod text {
|
||||||
mod util {
|
mod util {
|
||||||
mod tree;
|
mod tree;
|
||||||
mod color;
|
mod color;
|
||||||
mod unsafe;
|
|
||||||
mod time;
|
mod time;
|
||||||
mod url;
|
mod url;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue