Merge pull request #2255 from topecongiro/rustup-2017-12-01

Rustup to rustc 1.24.0-nightly (bb42071f6 2017-12-01)
This commit is contained in:
Oliver Schneider 2017-12-02 12:59:37 +01:00 committed by GitHub
commit 6c7b71d81a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,26 +35,27 @@ impl LintPass for UnsafeNameRemoval {
impl EarlyLintPass for UnsafeNameRemoval { impl EarlyLintPass for UnsafeNameRemoval {
fn check_item(&mut self, cx: &EarlyContext, item: &Item) { fn check_item(&mut self, cx: &EarlyContext, item: &Item) {
if let ItemKind::Use(ref item_use) = item.node { if let ItemKind::Use(ref use_tree) = item.node {
match item_use.node { check_use_tree(use_tree, cx, &item.span);
ViewPath_::ViewPathSimple(ref name, ref path) => { }
unsafe_to_safe_check( }
path.segments }
.last()
.expect("use paths cannot be empty") fn check_use_tree(use_tree: &UseTree, cx: &EarlyContext, span: &Span) {
.identifier, match use_tree.kind {
*name, UseTreeKind::Simple(new_name) => {
cx, let old_name = use_tree
&item.span, .prefix
); .segments
}, .last()
ViewPath_::ViewPathList(_, ref path_list_items) => for path_list_item in path_list_items.iter() { .expect("use paths cannot be empty")
let plid = path_list_item.node; .identifier;
if let Some(rename) = plid.rename { unsafe_to_safe_check(old_name, new_name, cx, span);
unsafe_to_safe_check(plid.name, rename, cx, &item.span); }
}; UseTreeKind::Glob => {},
}, UseTreeKind::Nested(ref nested_use_tree) => {
ViewPath_::ViewPathGlob(_) => {}, for &(ref use_tree, _) in nested_use_tree {
check_use_tree(use_tree, cx, span);
} }
} }
} }