Make unrooted_must_root a bit more aggressive.

Basically, instead of trying to check for specific kinds of statements,
just check the types of all local variables.

Also included are some commented-out proposals for some slightly more
aggressive lints which might be useful (but trigger a little too
frequently at the moment).
This commit is contained in:
Eli Friedman 2015-10-18 14:52:18 -07:00
parent e3bcf7bab7
commit 81ecf7824c
4 changed files with 94 additions and 95 deletions

View file

@ -431,6 +431,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SaveContext)).unwrap();
}
#[allow(unrooted_must_root)]
// https://html.spec.whatwg.org/multipage/#dom-context-2d-restore
fn Restore(&self) {
let mut saved_states = self.saved_states.borrow_mut();