MCPcopy Create free account
hub / github.com/Manishearth/array-init / array_init_no_drop

Function array_init_no_drop

src/lib.rs:335–346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

333
334 #[test]
335 fn array_init_no_drop() {
336 DropChecker::with(|drop_checker| {
337 let result: Result<[_; 5], ()> = try_array_init(|i| {
338 if i < 3 {
339 Ok(drop_checker.new_element())
340 } else {
341 Err(())
342 }
343 });
344 assert!(result.is_err());
345 });
346 }
347
348 #[test]
349 fn from_iter_no_drop() {

Callers

nothing calls this directly

Calls 2

try_array_initFunction · 0.85
new_elementMethod · 0.80

Tested by

no test coverage detected