Skip to content

Commit 5967b19

Browse files
committed
Some docs for UniverseIndex
I'm learning so do check the correctness of the terminology.
1 parent d67e569 commit 5967b19

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ir.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ impl TypeName {
153153
}
154154
}
155155

156+
/// An universe index is how a universally quantified parameter is
157+
/// represented when it's binder is moved into the environment.
158+
/// An example chain of transformations would be:
159+
/// `forall<T> { Goal(T) }` (syntatical representation)
160+
/// `forall { Goal(?0) }` (used a DeBruijn index)
161+
/// `Goal(!U1)` (the quantifier was moved to the environment and replaced with a universe index)
162+
/// See https://rust-lang-nursery.github.io/rustc-guide/mir/regionck.html#skol for more.
156163
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
157164
pub struct UniverseIndex {
158165
crate counter: usize,

0 commit comments

Comments
 (0)