Commit 3cbdf18
committed
Associate an allocator to boxes
This turns `Box<T>` into `Box<T, A = Global>`, with a `A: Alloc` bound
for impls.
Ideally, inherent methods like `Box::new` would be applied to
`Box<T, A: Alloc + Default>`, but as of now, that would be backwards
incompatible because it would require type annotations in places where
they currently aren't required.
`impl FromIterator` is not covered because it relies on `Vec`, which
would need allocator awareness.
`DispatchFromDyn` is left out or being generic over `A` because there
is no bound that would make it work currently. `FnBox` is left out
because it's related to `DispatchFromDyn`.1 parent 98ebb0c commit 3cbdf18
File tree
10 files changed
+210
-119
lines changed- src
- liballoc
- test/ui
- error-codes/e0119
- issues
10 files changed
+210
-119
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
| 170 | + | |
166 | 171 | | |
167 | 172 | | |
168 | 173 | | |
| |||
201 | 206 | | |
202 | 207 | | |
203 | 208 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
209 | 212 | | |
210 | 213 | | |
211 | 214 | | |
212 | 215 | | |
213 | 216 | | |
214 | 217 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
220 | 222 | | |
221 | 223 | | |
222 | | - | |
| 224 | + | |
223 | 225 | | |
224 | 226 | | |
225 | 227 | | |
| |||
0 commit comments