Skip to content

Commit c29c212

Browse files
committed
Add documentation on skip_binder on how to get &T from &EarlyBinder<T>
1 parent c40e9cc commit c29c212

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_middle/src/ty/subst.rs

+3
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,9 @@ impl<T> EarlyBinder<T> {
586586
/// arguments of an `FnSig`). Otherwise, consider using
587587
/// [`subst_identity`](EarlyBinder::subst_identity).
588588
///
589+
/// To skip the binder on `x: &EarlyBinder<T>` to obtain `&T`, leverage
590+
/// [`EarlyBinder::as_ref`](EarlyBinder::as_ref): `x.as_ref().skip_binder()`.
591+
///
589592
/// See also [`Binder::skip_binder`](super::Binder::skip_binder), which is
590593
/// the analogous operation on [`super::Binder`].
591594
pub fn skip_binder(self) -> T {

0 commit comments

Comments
 (0)