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
notriddle authored Nov 10, 2022
2 parents 1a2aee6 + 4c197c0 commit a26b48a
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 [`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 a26b48a

Please sign in to comment.