diff --git a/src/librustc_front/visit.rs b/src/librustc_front/visit.rs index 89c9818efbf0..12a20a8d21f4 100644 --- a/src/librustc_front/visit.rs +++ b/src/librustc_front/visit.rs @@ -218,8 +218,8 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) { visitor.visit_path_list_item(prefix, item) } } else { - // FIXME: uncomment this and fix the resulting ICE - // visitor.visit_path(prefix, item.id); + // FIXME(#28388) visit_path should be used instead of walk_path + walk_path(visitor, prefix); } } } diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 1a07877066e6..817fd9847089 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -980,15 +980,19 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivacyVisitor<'a, 'tcx> { } fn visit_path(&mut self, path: &hir::Path, id: ast::NodeId) { - self.check_path(path.span, id, path.segments.last().unwrap().identifier.name); - visit::walk_path(self, path); + if !path.segments.is_empty() { + self.check_path(path.span, id, path.segments.last().unwrap().identifier.name); + visit::walk_path(self, path); + } } fn visit_path_list_item(&mut self, prefix: &hir::Path, item: &hir::PathListItem) { let name = if let hir::PathListIdent { name, .. } = item.node { name.name - } else { + } else if !prefix.segments.is_empty() { prefix.segments.last().unwrap().identifier.name + } else { + self.tcx.sess.bug("`self` import in an import list with empty prefix"); }; self.check_path(item.span, item.node.id(), name); visit::walk_path_list_item(self, prefix, item); diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 6eabf5d69a2c..774d13966bd6 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -201,7 +201,6 @@ #![feature(alloc)] #![feature(allow_internal_unstable)] -#![feature(arc_weak)] #![feature(associated_consts)] #![feature(borrow_state)] #![feature(box_syntax)] diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 2a2f5c0f2c16..cda750c5cda7 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -224,8 +224,8 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) { visitor.visit_path_list_item(prefix, item) } } else { - // FIXME: uncomment this and fix the resulting ICE - // visitor.visit_path(prefix, item.id); + // FIXME(#28388) visit_path should be used instead of walk_path + walk_path(visitor, prefix); } } } diff --git a/src/test/compile-fail/issue-28075.rs b/src/test/compile-fail/issue-28075.rs index 74a241e819f3..7e9dfcf3ccb8 100644 --- a/src/test/compile-fail/issue-28075.rs +++ b/src/test/compile-fail/issue-28075.rs @@ -12,11 +12,10 @@ #![allow(unused_imports)] -use std::thread::{catch_panic, sleep}; //~ ERROR use of unstable library feature 'catch_panic' -//~^ ERROR use of unstable library feature 'thread_sleep' +use std::thread::{catch_panic, ScopedKey}; //~ ERROR use of unstable library feature 'catch_panic' +//~^ ERROR use of unstable library feature 'scoped_tls' use std::rt::{self}; //~ ERROR use of unstable library feature 'rt' -use std::rt::{}; fn main() { }