Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unrooted_must_root lint misses Option<JS<T>> return values #8022

Closed
jdm opened this issue Oct 14, 2015 · 4 comments
Closed

unrooted_must_root lint misses Option<JS<T>> return values #8022

jdm opened this issue Oct 14, 2015 · 4 comments
Labels
A-plugins I-safety Some piece of code violates memory safety guarantees.

Comments

@jdm
Copy link
Member

jdm commented Oct 14, 2015

This is unfortunate.

cc @Manishearth

@jdm jdm added I-safety Some piece of code violates memory safety guarantees. A-plugins labels Oct 14, 2015
@Manishearth
Copy link
Member

Ah, this is because we don't check return values at all.

@Manishearth
Copy link
Member

...turns out the entire function checking lint was entirely broken when I updated things to use ty::Ty instead of ast::Ty.

@Manishearth
Copy link
Member

/home/manishearth/Mozilla/voser/components/script/dom/htmlcanvaselement.rs:38:23: 38:28 note: in this expansion of #[derive_Clone] (defined in /home/manishearth/Mozilla/voser/components/script/dom/htmlcanvaselement.rs)
/home/manishearth/Mozilla/voser/components/script/dom/node.rs:1374:52: 1374:56 error: Type must be rooted, #[deny(unrooted_must_root)] on by default
/home/manishearth/Mozilla/voser/components/script/dom/node.rs:1374     pub fn new_without_doc(type_id: NodeTypeId) -> Node {
                                                                                                                      ^~~~
/home/manishearth/Mozilla/voser/components/script/dom/node.rs:1378:61: 1378:65 error: Type must be rooted, #[deny(unrooted_must_root)] on by default
/home/manishearth/Mozilla/voser/components/script/dom/node.rs:1378     fn new_(type_id: NodeTypeId, doc: Option<&Document>) -> Node {
                                                                                                                               ^~~~
/home/manishearth/Mozilla/voser/components/script/dom/servohtmlparser.rs:46:40: 46:60 error: Type must be rooted, #[deny(unrooted_must_root)] on by default
/home/manishearth/Mozilla/voser/components/script/dom/servohtmlparser.rs:46     pub fn get_or_create(&self, child: NodeOrText<JS<Node>>) -> Root<Node> {
                                                                                                                   ^~~~~~~~~~~~~~~~~~~~
/home/manishearth/Mozilla/voser/components/script/dom/webglrenderingcontext.rs:150:53: 150:77 error: Type must be rooted, #[deny(unrooted_must_root)] on by default
/home/manishearth/Mozilla/voser/components/script/dom/webglrenderingcontext.rs:150     pub fn bound_texture_for(&self, target: u32) -> Option<JS<WebGLTexture>> {
                                                                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~
/home/manishearth/Mozilla/voser/components/script/page.rs:122:36: 122:49 error: Type must be rooted, #[deny(unrooted_must_root)] on by default
/home/manishearth/Mozilla/voser/components/script/page.rs:122     pub fn set_frame(&self, frame: Option<Frame>) {
                                                                                                 ^~~~~~~~~~~~~
time: 3.006; rss: 758MB lint checking

Will finish fixing these later today

@jdm
Copy link
Member Author

jdm commented Oct 15, 2015

Perhaps I'll try to interest someone in #5646 to avoid this problem occurring again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-plugins I-safety Some piece of code violates memory safety guarantees.
Projects
None yet
Development

No branches or pull requests

2 participants