File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/librustc_data_structures Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
+ use std:: borrow:: { Borrow , BorrowMut , ToOwned } ;
11
12
use std:: fmt;
12
13
use std:: iter;
13
14
use std:: marker:: PhantomData ;
@@ -73,6 +74,25 @@ pub struct IdxSet<T: Idx> {
73
74
bits : [ Word ] ,
74
75
}
75
76
77
+ impl < T : Idx > Borrow < IdxSet < T > > for IdxSetBuf < T > {
78
+ fn borrow ( & self ) -> & IdxSet < T > {
79
+ & * self
80
+ }
81
+ }
82
+
83
+ impl < T : Idx > BorrowMut < IdxSet < T > > for IdxSetBuf < T > {
84
+ fn borrow_mut ( & mut self ) -> & mut IdxSet < T > {
85
+ & mut * self
86
+ }
87
+ }
88
+
89
+ impl < T : Idx > ToOwned for IdxSet < T > {
90
+ type Owned = IdxSetBuf < T > ;
91
+ fn to_owned ( & self ) -> Self :: Owned {
92
+ IdxSet :: to_owned ( self )
93
+ }
94
+ }
95
+
76
96
impl < T : Idx > fmt:: Debug for IdxSetBuf < T > {
77
97
fn fmt ( & self , w : & mut fmt:: Formatter ) -> fmt:: Result {
78
98
w. debug_list ( )
You can’t perform that action at this time.
0 commit comments