MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / get_many_mut

Function get_many_mut

cranelift/entity/src/primary.rs:576–591  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

574
575 #[test]
576 fn get_many_mut() {
577 let mut m: PrimaryMap<E, usize> = PrimaryMap::new();
578 let _0 = m.push(0);
579 let _1 = m.push(1);
580 let _2 = m.push(2);
581
582 assert_eq!([&mut 0, &mut 2], m.get_disjoint_mut([_0, _2]).unwrap());
583 assert_eq!(
584 m.get_disjoint_mut([_0, _0]),
585 Err(slice::GetDisjointMutError::OverlappingIndices)
586 );
587 assert_eq!(
588 m.get_disjoint_mut([E(4)]),
589 Err(slice::GetDisjointMutError::IndexOutOfBounds)
590 );
591 }
592}

Callers

nothing calls this directly

Calls 2

newFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected