@@ -366,11 +366,11 @@ pub unsafe trait Allocator {
366
366
367
367
/// The mode of error handling for types using this allocator.
368
368
///
369
- /// [ `Fatal`] means that any allocation failures should be handled
369
+ /// `Fatal` means that any allocation failures should be handled
370
370
/// globally, often by panicking or aborting. Functions performing
371
371
/// allocation will simply return the value or nothing.
372
372
///
373
- /// [ `Fallible`] means that any allocation failures should be handled
373
+ /// `Fallible` means that any allocation failures should be handled
374
374
/// at the point of use. Functions performing allocation will return
375
375
/// `Result`.
376
376
type ErrorHandling : ErrorHandling ;
@@ -383,19 +383,27 @@ pub mod error_handling_sealed {
383
383
}
384
384
use error_handling_sealed:: Sealed ;
385
385
386
- // FIXME: this trait should be sealed
386
+ /// The mode of error handling for types using an allocator.
387
+ ///
388
+ /// `Fatal` means that any allocation failures should be handled
389
+ /// globally, often by panicking or aborting. Functions performing
390
+ /// allocation will simply return the value or nothing.
391
+ ///
392
+ /// `Fallible` means that any allocation failures should be handled
393
+ /// at the point of use. Functions performing allocation will return
394
+ /// `Result`.
387
395
#[ unstable( feature = "allocator_api" , issue = "32838" ) ]
388
396
pub trait ErrorHandling : Sealed {
389
397
/// Result type returned by functions that are conditionally fallible.
390
398
///
391
- /// - "Infallible" allocators set `type Result<T, E> = T`
392
- /// - " Fallible" allocators set `type Result<T, E> = Result<T, E>`
399
+ /// - `Fatal` allocators set `type Result<T, E> = T`
400
+ /// - ` Fallible` allocators set `type Result<T, E> = Result<T, E>`
393
401
type Result < T , E : Error > ;
394
402
395
403
/// Function to map allocation results into `Self::Result`.
396
404
///
397
- /// - For "Infallible" allocators, this should call [`HandleAllocError::handle_alloc_error`]
398
- /// - For " Fallible" allocators, this is just the identity function
405
+ /// - For `Fatal` allocators, this should unwrap the result
406
+ /// - For ` Fallible` allocators, this is just the identity function
399
407
#[ must_use]
400
408
fn map_result < T , E : Error > ( result : Result < T , E > ) -> Self :: Result < T , E > ;
401
409
}
0 commit comments