Commit fc5e064
lib: make InPlaceInit available even without alloc feature
The only dependency of the InPlaceInit trait on the allocator API is the
AllocError type. Replace it with Infallible instead, i.e. allow any
error as long as it has an "impl From<Infallible> for MyError" - which
can have a trivial implementation as seen in examples/rror.rs.
While admittedly of limited usefulness due to orphan rules, this is
a first step towards allowing usage of pinned_init entirely without
the allocator API, and therefore on stable Rust.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent da5a88a commit fc5e064
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
259 | 264 | | |
260 | 265 | | |
261 | 266 | | |
| |||
1153 | 1158 | | |
1154 | 1159 | | |
1155 | 1160 | | |
1156 | | - | |
1157 | 1161 | | |
1158 | 1162 | | |
1159 | 1163 | | |
| |||
0 commit comments