From 89922e52b06fbe1af74983cf2f936c5bf9e6d91e Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 18 Dec 2014 10:13:13 -0500 Subject: [PATCH] Correct comment on Binder. --- src/librustc/middle/ty.rs | 13 +++++++------ 1 file 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`). Note that when we skolemize, instantiate, +/// erase, or otherwise "discharge" these bound reons, we change the +/// type from `Binder` to just `T` (see +/// e.g. `liberate_late_bound_regions`). #[deriving(Clone, PartialEq, Eq, Hash, Show)] pub struct Binder(pub T);