Skip to content
Permalink
Browse files

Fix issue with using `self` module via indirection

  • Loading branch information
varkor committed Jan 10, 2020
1 parent 2d8d559 commit 799efd3615f468c1382c61fe73b137fcffcd0a78
Showing with 9 additions and 0 deletions.
  1. +3 −0 src/librustc_privacy/lib.rs
  2. +6 −0 src/test/ui/issues/issue-68103.rs
@@ -652,6 +652,9 @@ impl EmbargoVisitor<'tcx> {
if let Some(item) = module
.res
.and_then(|res| res.mod_def_id())
// If the module is `self`, i.e. the current crate,
// there will be no corresponding item.
.filter(|def_id| def_id.index != CRATE_DEF_INDEX || def_id.krate != LOCAL_CRATE)
.and_then(|def_id| self.tcx.hir().as_local_hir_id(def_id))
.map(|module_hir_id| self.tcx.hir().expect_item(module_hir_id))
{
@@ -0,0 +1,6 @@
// check-pass

pub extern crate self as name;
pub use name::name as bug;

fn main() {}

0 comments on commit 799efd3

Please sign in to comment.
You can’t perform that action at this time.