about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_resolve/src/imports.rs2
-rw-r--r--compiler/rustc_resolve/src/lib.rs4
2 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs
index 036fbf2dbf0..d37fe783bba 100644
--- a/compiler/rustc_resolve/src/imports.rs
+++ b/compiler/rustc_resolve/src/imports.rs
@@ -172,6 +172,8 @@ pub(crate) struct ImportData<'a> {
     pub used: Cell<bool>,
 }
 
+/// All imports are unique and allocated on a same arena,
+/// so we can use referential equality to compare them.
 pub(crate) type Import<'a> = Interned<'a, ImportData<'a>>;
 
 impl<'a> ImportData<'a> {
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs
index b6a312c2982..da3d86a4718 100644
--- a/compiler/rustc_resolve/src/lib.rs
+++ b/compiler/rustc_resolve/src/lib.rs
@@ -514,6 +514,8 @@ struct ModuleData<'a> {
     expansion: ExpnId,
 }
 
+/// All modules are unique and allocated on a same arena,
+/// so we can use referential equality to compare them.
 #[derive(Clone, Copy, PartialEq)]
 #[rustc_pass_by_value]
 struct Module<'a>(Interned<'a, ModuleData<'a>>);
@@ -661,6 +663,8 @@ struct NameBindingData<'a> {
     vis: ty::Visibility<DefId>,
 }
 
+/// All name bindings are unique and allocated on a same arena,
+/// so we can use referential equality to compare them.
 type NameBinding<'a> = Interned<'a, NameBindingData<'a>>;
 
 trait ToNameBinding<'a> {