mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Add unrooted_must_root lint for enums and structs containing JS<T>, as well as functions with JS<T> in their parameter list
For safe wrappers over JS<T> (eg Temporary<T>) use #[allow(unrooted_must_root)]. For all other types containing a #[must_root] value, annotate the type with #[must_root] to ensure that it is never used unrooted
This commit is contained in:
parent
13ae369dec
commit
12dc54d238
22 changed files with 101 additions and 4 deletions
|
@ -19,12 +19,14 @@ use std::cell::RefCell;
|
|||
use std::collections::hashmap::HashMap;
|
||||
|
||||
#[deriving(Encodable, Clone)]
|
||||
#[must_root]
|
||||
pub enum FormDatum {
|
||||
StringData(DOMString),
|
||||
FileData(JS<File>)
|
||||
}
|
||||
|
||||
#[deriving(Encodable)]
|
||||
#[must_root]
|
||||
pub struct FormData {
|
||||
data: Traceable<RefCell<HashMap<DOMString, Vec<FormDatum>>>>,
|
||||
reflector_: Reflector,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue