diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-22 19:20:57 -0700 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-22 19:20:57 -0700 |
commit | 2b68cf4aba22b9e48e5e40e7191917ab4f2d967b (patch) | |
tree | 5f5d88d50f8bcca706d69ae9af0d9401f1196c54 | |
parent | 1946c71a9612260fefda89c528e41a1b259365c5 (diff) | |
parent | b747951d1582a6d3aa5ba4456265575b63d5f696 (diff) | |
download | servo-2b68cf4aba22b9e48e5e40e7191917ab4f2d967b.tar.gz servo-2b68cf4aba22b9e48e5e40e7191917ab4f2d967b.zip |
Auto merge of #10804 - tylersouthwick:remove-plugins-utils-unsafe_context, r=nox
Remove unused code and make utils private
fixes #10771
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10804)
<!-- Reviewable:end -->
-rw-r--r-- | components/plugins/lib.rs | 2 | ||||
-rw-r--r-- | components/plugins/utils.rs | 24 |
2 files changed, 1 insertions, 25 deletions
diff --git a/components/plugins/lib.rs b/components/plugins/lib.rs index 69ddbc9a094..9ee553145a5 100644 --- a/components/plugins/lib.rs +++ b/components/plugins/lib.rs @@ -39,7 +39,7 @@ pub mod lints; /// Autogenerates implementations of Reflectable on DOM structs pub mod reflector; /// Utilities for writing plugins -pub mod utils; +mod utils; #[plugin_registrar] pub fn plugin_registrar(reg: &mut Registry) { 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"])` |