We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
self
1 parent 2d8d559 commit 799efd3Copy full SHA for 799efd3
src/librustc_privacy/lib.rs
@@ -652,6 +652,9 @@ impl EmbargoVisitor<'tcx> {
652
if let Some(item) = module
653
.res
654
.and_then(|res| res.mod_def_id())
655
+ // If the module is `self`, i.e. the current crate,
656
+ // there will be no corresponding item.
657
+ .filter(|def_id| def_id.index != CRATE_DEF_INDEX || def_id.krate != LOCAL_CRATE)
658
.and_then(|def_id| self.tcx.hir().as_local_hir_id(def_id))
659
.map(|module_hir_id| self.tcx.hir().expect_item(module_hir_id))
660
{
src/test/ui/issues/issue-68103.rs
@@ -0,0 +1,6 @@
1
+// check-pass
2
+
3
+pub extern crate self as name;
4
+pub use name::name as bug;
5
6
+fn main() {}
0 commit comments