Skip to content

Commit 9fefb46

Browse files
committed
docs(allocator): improve Allocator code examples (#11670)
Improve code examples for `Allocator` by tagging the code blocks correctly.
1 parent e523d86 commit 9fefb46

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

crates/oxc_allocator/src/allocator.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ use oxc_data_structures::assert_unchecked;
109109
///
110110
/// If workload is completely uniform, it reaches stable state on the 3rd round.
111111
///
112-
/// ```ignore
112+
/// ```
113113
/// # use oxc_allocator::Allocator;
114114
/// let mut allocator = Allocator::new();
115115
///
@@ -162,9 +162,8 @@ use oxc_data_structures::assert_unchecked;
162162
/// [`HashMap::new_in`], and all other methods which store data in the arena will refuse to compile
163163
/// if called with a [`Drop`] type.
164164
///
165-
/// ```ignore
165+
/// ```compile_fail
166166
/// use oxc_allocator::{Allocator, Box};
167-
///
168167
/// let allocator = Allocator::new();
169168
///
170169
/// struct Foo {
@@ -177,6 +176,11 @@ use oxc_data_structures::assert_unchecked;
177176
///
178177
/// // This will fail to compile because `Foo` implements `Drop`
179178
/// let foo = Box::new_in(Foo { a: 0 }, &allocator);
179+
/// ```
180+
///
181+
/// ```compile_fail
182+
/// use oxc_allocator::{Allocator, Box};
183+
/// let allocator = Allocator::new();
180184
///
181185
/// struct Bar {
182186
/// v: std::vec::Vec<u8>,

0 commit comments

Comments
 (0)