Skip to content

Commit 89922e5

Browse files
committed
Correct comment on Binder.
1 parent 1085012 commit 89922e5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/librustc/middle/ty.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,12 +1368,13 @@ impl<'tcx> PolyTraitRef<'tcx> {
13681368
}
13691369
}
13701370

1371-
/// Binder serves as a synthetic binder for lifetimes. It is used when
1372-
/// we wish to replace the escaping higher-ranked lifetimes in a type
1373-
/// or something else that is not itself a binder (this is because the
1374-
/// `replace_late_bound_regions` function replaces all lifetimes bound
1375-
/// by the binder supplied to it; but a type is not a binder, so you
1376-
/// must introduce an artificial one).
1371+
/// Binder is a binder for higher-ranked lifetimes. It is part of the
1372+
/// compiler's representation for things like `for<'a> Fn(&'a int)`
1373+
/// (which would be represented by the type `PolyTraitRef ==
1374+
/// Binder<TraitRef>`). Note that when we skolemize, instantiate,
1375+
/// erase, or otherwise "discharge" these bound reons, we change the
1376+
/// type from `Binder<T>` to just `T` (see
1377+
/// e.g. `liberate_late_bound_regions`).
13771378
#[deriving(Clone, PartialEq, Eq, Hash, Show)]
13781379
pub struct Binder<T>(pub T);
13791380

0 commit comments

Comments
 (0)