7 fn to_ref(self) -> Self::Output;
10 impl<'tcx> ToRef for &'tcx hir::Expr<'tcx> {
11 type Output = ExprRef<'tcx>;
13 fn to_ref(self) -> ExprRef<'tcx> {
18 impl<'tcx> ToRef for &'tcx &'tcx hir::Expr<'tcx> {
19 type Output = ExprRef<'tcx>;
21 fn to_ref(self) -> ExprRef<'tcx> {
22 ExprRef::Thir(&**self)
26 impl<'tcx> ToRef for Expr<'tcx> {
27 type Output = ExprRef<'tcx>;
29 fn to_ref(self) -> ExprRef<'tcx> {
30 ExprRef::Mirror(Box::new(self))
34 impl<'tcx, T, U> ToRef for &'tcx Option<T>
36 &'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<'tcx, T, U> ToRef for &'tcx Vec<T>
47 &'tcx T: ToRef<Output = U>,
51 fn to_ref(self) -> Vec<U> {
52 self.iter().map(|expr| expr.to_ref()).collect()
56 impl<'tcx, T, U> ToRef for &'tcx [T]
58 &'tcx T: ToRef<Output = U>,
62 fn to_ref(self) -> Vec<U> {
63 self.iter().map(|expr| expr.to_ref()).collect()