mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make stmt part of unrooted_must_root handle type parameters (fixes #6651)
This commit is contained in:
parent
126f5ae8f0
commit
f6f0a7e4aa
7 changed files with 64 additions and 18 deletions
|
@ -382,6 +382,7 @@ pub unsafe fn trace_roots(tracer: *mut JSTracer) {
|
|||
/// are additive, so this object's destruction will not invalidate other roots
|
||||
/// for the same JS value. `Root`s cannot outlive the associated
|
||||
/// `RootCollection` object.
|
||||
#[allow_unrooted_interior]
|
||||
pub struct Root<T: Reflectable> {
|
||||
/// Reference to rooted value that must not outlive this container
|
||||
ptr: NonZero<*const T>,
|
||||
|
|
|
@ -57,6 +57,7 @@ unsafe impl Send for TrustedReference {}
|
|||
/// shared among tasks for use in asynchronous operations. The underlying
|
||||
/// DOM object is guaranteed to live at least as long as the last outstanding
|
||||
/// `Trusted<T>` instance.
|
||||
#[allow_unrooted_interior]
|
||||
pub struct Trusted<T: Reflectable> {
|
||||
/// A pointer to the Rust DOM object of type T, but void to allow
|
||||
/// sending `Trusted<T>` between tasks, regardless of T's sendability.
|
||||
|
|
|
@ -455,6 +455,7 @@ impl<'a, T: JSTraceable> Drop for RootedTraceable<'a, T> {
|
|||
#[allow(unrooted_must_root)]
|
||||
#[no_move]
|
||||
#[derive(JSTraceable)]
|
||||
#[allow_unrooted_interior]
|
||||
pub struct RootedVec<T: JSTraceable + Reflectable> {
|
||||
v: Vec<T>
|
||||
}
|
||||
|
|
|
@ -413,8 +413,7 @@ pub fn reflect_dom_object<T: Reflectable>
|
|||
}
|
||||
|
||||
/// A struct to store a reference to the reflector of a DOM object.
|
||||
// Allowing unused_attribute because the lint sometimes doesn't run in order
|
||||
#[allow(raw_pointer_derive, unrooted_must_root, unused_attributes)]
|
||||
#[allow(raw_pointer_derive, unrooted_must_root)]
|
||||
#[must_root]
|
||||
#[servo_lang = "reflector"]
|
||||
// If you're renaming or moving this field, update the path in plugins::reflector as well
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue