Skip to content

Commit

Permalink
Add documentation on skip_binder on how to get &T from &EarlyBinder<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
kylematsuda committed May 28, 2023
1 parent c40e9cc commit c29c212
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_middle/src/ty/subst.rs
Expand Up @@ -586,6 +586,9 @@ impl<T> EarlyBinder<T> {
/// arguments of an `FnSig`). Otherwise, consider using
/// [`subst_identity`](EarlyBinder::subst_identity).
///
/// To skip the binder on `x: &EarlyBinder<T>` to obtain `&T`, leverage
/// [`EarlyBinder::as_ref`](EarlyBinder::as_ref): `x.as_ref().skip_binder()`.
///
/// See also [`Binder::skip_binder`](super::Binder::skip_binder), which is
/// the analogous operation on [`super::Binder`].
pub fn skip_binder(self) -> T {
Expand Down

0 comments on commit c29c212

Please sign in to comment.