Use #![register_tool] instead of #![register_attr]

CC https://github.com/rust-lang/rust/issues/66079
This commit is contained in:
Simon Sapin 2019-11-12 22:16:08 +01:00
parent 091feba0ba
commit bea73951db
46 changed files with 129 additions and 105 deletions

View file

@ -46,7 +46,7 @@ use style::thread_state;
/// A rooted value.
#[allow(unrooted_must_root)]
#[allow_unrooted_interior]
#[unrooted_must_root_lint::allow_unrooted_interior]
pub struct Root<T: StableTraceObject> {
/// The value to root.
value: T,
@ -283,7 +283,7 @@ where
/// on the stack, the `Dom<T>` can point to freed memory.
///
/// This should only be used as a field in other DOM objects.
#[must_root]
#[unrooted_must_root_lint::must_root]
pub struct Dom<T> {
ptr: ptr::NonNull<T>,
}
@ -343,7 +343,7 @@ unsafe impl<T: DomObject> JSTraceable for Dom<T> {
/// An unrooted reference to a DOM object for use in layout. `Layout*Helpers`
/// traits must be implemented on this.
#[allow_unrooted_interior]
#[unrooted_must_root_lint::allow_unrooted_interior]
pub struct LayoutDom<T> {
ptr: ptr::NonNull<T>,
}
@ -463,7 +463,7 @@ impl LayoutDom<Node> {
///
/// This should only be used as a field in other DOM objects; see warning
/// on `Dom<T>`.
#[must_root]
#[unrooted_must_root_lint::must_root]
#[derive(JSTraceable)]
pub struct MutDom<T: DomObject> {
val: UnsafeCell<Dom<T>>,
@ -518,7 +518,7 @@ impl<T: DomObject + PartialEq> PartialEq<T> for MutDom<T> {
///
/// This should only be used as a field in other DOM objects; see warning
/// on `Dom<T>`.
#[must_root]
#[unrooted_must_root_lint::must_root]
#[derive(JSTraceable)]
pub struct MutNullableDom<T: DomObject> {
ptr: UnsafeCell<Option<Dom<T>>>,
@ -616,7 +616,7 @@ impl<T: DomObject> MallocSizeOf for MutNullableDom<T> {
///
/// This should only be used as a field in other DOM objects; see warning
/// on `Dom<T>`.
#[must_root]
#[unrooted_must_root_lint::must_root]
pub struct DomOnceCell<T: DomObject> {
ptr: OnceCell<Dom<T>>,
}