diff options
author | Tyler Southwick <tyler@northfuse.net> | 2016-04-22 00:45:17 -0700 |
---|---|---|
committer | Tyler Southwick <tyler@northfuse.net> | 2016-04-22 00:45:17 -0700 |
commit | b747951d1582a6d3aa5ba4456265575b63d5f696 (patch) | |
tree | a7d38fabe82cfd926dc56e7b54a56748f42e5769 /components/plugins/utils.rs | |
parent | 0e0e902edd200359db6ae06cd149fb1b0a97fcc6 (diff) | |
download | servo-b747951d1582a6d3aa5ba4456265575b63d5f696.tar.gz servo-b747951d1582a6d3aa5ba4456265575b63d5f696.zip |
Remove unused code and make utils private
Diffstat (limited to 'components/plugins/utils.rs')
-rw-r--r-- | components/plugins/utils.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/components/plugins/utils.rs b/components/plugins/utils.rs index b514e967d5b..b39102f5626 100644 --- a/components/plugins/utils.rs +++ b/components/plugins/utils.rs @@ -73,30 +73,6 @@ pub fn match_lang_did(cx: &LateContext, did: DefId, value: &str) -> bool { }) } -// Determines if a block is in an unsafe context so that an unhelpful -// lint can be aborted. -pub fn unsafe_context(map: &ast_map::Map, id: ast::NodeId) -> bool { - match map.find(map.get_parent(id)) { - Some(ast_map::NodeImplItem(itm)) => { - match itm.node { - hir::ImplItemKind::Method(ref sig, _) => sig.unsafety == hir::Unsafety::Unsafe, - _ => false - } - }, - Some(ast_map::NodeItem(itm)) => { - match itm.node { - hir::ItemFn(_, style, _, _, _, _) => match style { - hir::Unsafety::Unsafe => true, - _ => false, - }, - _ => false, - } - } - _ => false // There are probably a couple of other unsafe cases we don't care to lint, those will need - // to be added. - } -} - /// check if a DefId's path matches the given absolute type path /// usage e.g. with /// `match_def_path(cx, id, &["core", "option", "Option"])` |