We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
proc_macro
1 parent 0a6462b commit 74ec42eCopy full SHA for 74ec42e
library/proc_macro/src/bridge/arena.rs
@@ -90,14 +90,13 @@ impl Arena {
90
return &mut [];
91
}
92
93
- loop {
94
- if let Some(a) = self.alloc_raw_without_grow(bytes) {
95
- break a;
96
- }
97
- // No free space left. Allocate a new chunk to satisfy the request.
98
- // On failure the grow will panic or abort.
99
- self.grow(bytes);
+ if let Some(a) = self.alloc_raw_without_grow(bytes) {
+ return a;
100
+ // No free space left. Allocate a new chunk to satisfy the request.
+ // On failure the grow will panic or abort.
+ self.grow(bytes);
+ self.alloc_raw_without_grow(bytes).unwrap()
101
102
103
#[allow(clippy::mut_from_ref)] // arena allocator
0 commit comments