mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Mark JSTraceable and its method as unsafe
This commit is contained in:
parent
73b6e705b4
commit
620a67ff14
16 changed files with 191 additions and 185 deletions
|
@ -122,8 +122,8 @@ which has an area, and the trait provides a way to get that object's area.
|
|||
Now let's look at the `JSTraceable` trait, which we use for tracing:
|
||||
|
||||
```rust
|
||||
pub trait JSTraceable {
|
||||
fn trace(&self, trc: *mut JSTracer);
|
||||
pub unsafe trait JSTraceable {
|
||||
unsafe fn trace(&self, trc: *mut JSTracer);
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -182,7 +182,7 @@ pub fn trace_reflector(tracer: *mut JSTracer, description: &str, reflector: &Ref
|
|||
}
|
||||
|
||||
impl<T: Reflectable> JSTraceable for JS<T> {
|
||||
fn trace(&self, trc: *mut JSTracer) {
|
||||
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||
trace_reflector(trc, "", unsafe { (**self.ptr).reflector() });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue