Skip to content

Commit

Permalink
Rollup merge of rust-lang#104194 - BoxyUwU:early_binder_docs, r=compi…
Browse files Browse the repository at this point in the history
…ler-errors

`EarlyBinder` docs
  • Loading branch information
Manishearth authored Nov 10, 2022
2 parents 819c931 + 2566701 commit c6595ea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_middle/src/ty/subst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c6595ea

Please sign in to comment.