about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2022-11-10 10:47:41 -0500
committerGitHub <noreply@github.com>2022-11-10 10:47:41 -0500
commitc6595ea22a5f05b3595a6ce3ea582e0a70e677f2 (patch)
tree3da6120a33920ef75e5611039a9f0ae816220f6a
parent819c9315c38732d98b5288ec4664f0a3fc455c38 (diff)
parent2566701e33fd6908cc2d36f869637f65089fae27 (diff)
downloadrust-c6595ea22a5f05b3595a6ce3ea582e0a70e677f2.tar.gz
rust-c6595ea22a5f05b3595a6ce3ea582e0a70e677f2.zip
Rollup merge of #104194 - BoxyUwU:early_binder_docs, r=compiler-errors
`EarlyBinder` docs
-rw-r--r--compiler/rustc_middle/src/ty/subst.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/subst.rs b/compiler/rustc_middle/src/ty/subst.rs
index 0660e9b79a7..2bcb2d82484 100644
--- a/compiler/rustc_middle/src/ty/subst.rs
+++ b/compiler/rustc_middle/src/ty/subst.rs
@@ -506,6 +506,9 @@ impl<'tcx, T: TypeVisitable<'tcx>> TypeVisitable<'tcx> for &'tcx ty::List<T> {
     }
 }
 
+/// Similar to [`super::Binder`] except that it tracks early bound generics, i.e. `struct Foo<T>(T)`
+/// needs `T` substituted immediately. This type primarily exists to avoid forgetting to call
+/// `subst`.
 #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
 #[derive(Encodable, Decodable, HashStable)]
 pub struct EarlyBinder<T>(pub T);