diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-12-18 10:13:13 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2014-12-19 03:29:59 -0500 |
| commit | 89922e52b06fbe1af74983cf2f936c5bf9e6d91e (patch) | |
| tree | 1638dfa1d89bb5ccf08dfcb69bcddc9fbf4223d7 | |
| parent | 1085012cd2f587bed0eb64a547d03d671d3a5c6f (diff) | |
Correct comment on Binder.
| -rw-r--r-- | src/librustc/middle/ty.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index ee56d919fef..6839e8bcc45 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -1368,12 +1368,13 @@ impl<'tcx> PolyTraitRef<'tcx> { } } -/// Binder serves as a synthetic binder for lifetimes. It is used when -/// we wish to replace the escaping higher-ranked lifetimes in a type -/// or something else that is not itself a binder (this is because the -/// `replace_late_bound_regions` function replaces all lifetimes bound -/// by the binder supplied to it; but a type is not a binder, so you -/// must introduce an artificial one). +/// Binder is a binder for higher-ranked lifetimes. It is part of the +/// compiler's representation for things like `for<'a> Fn(&'a int)` +/// (which would be represented by the type `PolyTraitRef == +/// Binder<TraitRef>`). Note that when we skolemize, instantiate, +/// erase, or otherwise "discharge" these bound reons, we change the +/// type from `Binder<T>` to just `T` (see +/// e.g. `liberate_late_bound_regions`). #[deriving(Clone, PartialEq, Eq, Hash, Show)] pub struct Binder<T>(pub T); |
