]>
git.proxmox.com Git - rustc.git/blob - src/librustc_mir/hair/cx/to_ref.rs
8 fn to_ref(self) -> Self::Output
;
11 impl<'a
, 'tcx
: 'a
> ToRef
for &'tcx hir
::Expr
{
12 type Output
= ExprRef
<'tcx
>;
14 fn to_ref(self) -> ExprRef
<'tcx
> {
19 impl<'a
, 'tcx
: 'a
> ToRef
for &'tcx P
<hir
::Expr
> {
20 type Output
= ExprRef
<'tcx
>;
22 fn to_ref(self) -> ExprRef
<'tcx
> {
23 ExprRef
::Hair(&**self)
27 impl<'a
, 'tcx
: 'a
> ToRef
for Expr
<'tcx
> {
28 type Output
= ExprRef
<'tcx
>;
30 fn to_ref(self) -> ExprRef
<'tcx
> {
31 ExprRef
::Mirror(Box
::new(self))
35 impl<'a
, 'tcx
: 'a
, T
, U
> ToRef
for &'tcx Option
<T
>
36 where &'tcx T
: ToRef
<Output
= U
>
38 type Output
= Option
<U
>;
40 fn to_ref(self) -> Option
<U
> {
41 self.as_ref().map(|expr
| expr
.to_ref())
45 impl<'a
, 'tcx
: 'a
, T
, U
> ToRef
for &'tcx Vec
<T
>
46 where &'tcx T
: ToRef
<Output
= U
>
50 fn to_ref(self) -> Vec
<U
> {
51 self.iter().map(|expr
| expr
.to_ref()).collect()
55 impl<'a
, 'tcx
: 'a
, T
, U
> ToRef
for &'tcx P
<[T
]>
56 where &'tcx T
: ToRef
<Output
= U
>
60 fn to_ref(self) -> Vec
<U
> {
61 self.iter().map(|expr
| expr
.to_ref()).collect()