.githooks/ compiler/ kernel/ lib/ scripts/ seed/ sublime/ test/ boot/ bootstrap/ compiler/ cycles/ dispatch/ format/ host/ integration/ kernel/ loader/ manifests/ mmio/ native/ packages/ runtime/ scheduling/ shared/ slots/ smp/ std/ sync/ termination/ tests/ asm.link/ asm.rodata.prefix/ assign.qualified.static/ entry.storage.start/ fn.unsafe.callbacks/ method.module/ optional.union.const.match/ record.opaque/ ref.qualified.static/ return.never/ stack.limit.ok/ stack.limit.trap/ start.default/ start.exit/ wildcard.import.owner/ abi.sizes.rad 3.5 KiB addfn.rad 52 B addfn.ril 76 B address.literal.aggregate.rad 6.2 KiB address.literal.escape.reject.rad 1.4 KiB address.literal.local.mutable.reject.rad 293 B address.literal.local.reject.rad 336 B address.literal.mutable.rad 1.3 KiB address.literal.shared.rad 734 B address.literal.shared.ril 1.0 KiB address.value.escape.reject.rad 2.5 KiB address.value.linear.field.reject.rad 297 B address.value.linear.mutable.reject.rad 262 B address.value.linear.reject.rad 303 B address.value.local.mutable.reject.rad 361 B address.value.local.reject.rad 322 B address.value.rad 6.7 KiB address.value.temporary.rad 1.2 KiB address.value.temporary.ril 1.6 KiB aggregate.return.rad 4.1 KiB alloc.arena.trait.rad 2.7 KiB alloc.new.arena.rad 1.8 KiB alloc.new.rad 1.0 KiB arena.static.rad 1.1 KiB arith.assignment.rad 631 B arith.basic.rad 189 B arith.modulo.rad 109 B arith.subword.rad 3.9 KiB arith.subword.ril 4.3 KiB arith.sum.rad 192 B arith.w64.rad 4.1 KiB arith.w64.ril 5.2 KiB array.aggregate.stride.rad 773 B array.aggregate.stride.ril 697 B array.assign.rad 225 B array.assign.ril 570 B array.bound.signature.rad 695 B array.bounds.check.rad 321 B array.fn.assign.rad 265 B array.index.assign.rad 422 B array.index.rad 278 B array.index.ril 520 B array.len.const.rad 348 B array.len.const.ril 333 B array.length.rad 281 B array.literal.rad 136 B array.literal.ril 376 B array.math.rad 1.2 KiB array.nested.assign.rad 320 B array.nested.rad 318 B array.nested.ril 995 B array.pointer.rad 2.5 KiB array.record.elements.rad 1.7 KiB array.repeat.edge.rad 548 B array.repeat.element.type.rad 1.2 KiB array.repeat.loop.lower.rad 1.5 KiB array.repeat.loop.lower.ril 2.1 KiB array.repeat.loop.rad 52.3 KiB array.repeat.rad 831 B array.repeat.ril 2.4 KiB array.repeat.word.aggregate.lower.rad 2.0 KiB array.repeat.word.aggregate.lower.ril 3.7 KiB array.repeat.word.aggregate.rad 4.6 KiB array.repeat.word.lower.rad 2.3 KiB array.repeat.word.lower.ril 4.8 KiB array.repeat.word.rad 53.8 KiB array.return.rad 344 B array.slice.empty.rad 127 B array.slice.full.rad 124 B array.slice.full.ril 253 B array.slice.gen.end.rad 156 B array.slice.gen.index.rad 167 B array.slice.gen.open.rad 154 B array.slice.gen.start.end.rad 158 B array.slice.gen.start.rad 156 B array.slice.openend.rad 149 B array.slice.openend.ril 436 B array.slice.openstart.rad 149 B array.slice.openstart.ril 373 B array.slice.rad 816 B as.precedence.rad 224 B asm.arithmetic.spacing.ras 537 B asm.atomic.reserve.ras 1.1 KiB asm.basic.text.program.ras 191 B asm.bleu.ras 251 B asm.branch.comparisons.ras 652 B asm.call.return.flow.ras 205 B asm.compare.set.logic.ras 613 B asm.csr.system.instructions.ras 223 B asm.data.directives.ras 441 B asm.data.symbol.fixup.ras 229 B asm.directive.boundary.values.ras 813 B asm.divrem.edges.ras 2.5 KiB asm.fence.ras 78 B asm.global.scoped.symbols.ras 211 B asm.instruction.matrix.alu.ras 568 B asm.instruction.matrix.mem.control.ras 357 B asm.instruction.matrix.system.ras 117 B asm.label.fixups.ras 237 B asm.li.expressions.ras 214 B asm.li.wide.ras 578 B asm.load.store.widths.ras 713 B asm.mul.div.rem.ras 773 B asm.mulh.ras 2.3 KiB asm.scoped.symbols.la.ras 152 B asm.scoped.symbols.tail.ras 161 B asm.section.switching.ras 177 B asm.space.constant.expressions.ras 360 B asm.string.directive.lists.ras 328 B asm.vector.integer.ras 633 B asm.word.dword.constants.ras 375 B asm.word.shift.ops.ras 872 B assert.basic.rad 398 B assert.basic.ril 623 B assert.fail.rad 138 B assert.false.rad 140 B assert.message.rad 123 B assert.message.ril 141 B assert.true.rad 115 B assign.loop.rad 213 B assign.loop.ril 242 B assign.multi.var.rad 194 B assign.multi.var.ril 73 B assign.mutable.rad 6.2 KiB assign.param.rad 150 B assign.param.ril 96 B assign.rad 156 B assign.self.ref.rad 161 B assign.self.ref.ril 92 B assign.sequential.rad 163 B assign.sequential.ril 52 B assign.shadow.mutable.rad 489 B assign.use.intermediate.rad 191 B assign.use.intermediate.ril 99 B average.rad 189 B average.ril 447 B binding.storage.rad 962 B binop.arith.rad 479 B binop.arith.ril 389 B binop.bitwise.rad 1.2 KiB binop.bitwise.ril 1.2 KiB binop.cmp.rad 425 B binop.logical.rad 216 B binop.logical.ril 373 B binop.shift.rad 197 B binop.shift.ril 149 B binop.unsigned.rad 317 B binop.unsigned.ril 236 B bitmanip.rad 4.5 KiB bool.comparison.array.rad 691 B bool.comparison.nested.gen.rad 1.0 KiB bool.comparison.opt.rad 865 B bool.comparison.record.gen.rad 1.0 KiB bool.comparison.record.rad 1.1 KiB bool.comparison.slice.gen.rad 157 B bool.comparison.slice.rad 4.4 KiB bool.comparison.slice.record.gen.rad 2.0 KiB bool.comparison.slice.union.gen.rad 2.6 KiB bool.comparison.union.ctor.rad 711 B bool.comparison.union.gen.rad 1.2 KiB bool.comparison.union.record.gen.rad 1.5 KiB bool.comparison.union.simple.gen.rad 302 B bool.operators.complex.rad 368 B bool.operators.rad 824 B bool.short.circuit.rad 2.4 KiB bool.simple.rad 202 B bool.values.rad 787 B borrow.fields.calls.rad 1.3 KiB borrow.fields.calls.ril 1.1 KiB borrow.fields.pattern.rad 594 B borrow.fields.pattern.ril 362 B borrow.index.disjoint.rad 2.9 KiB borrow.index.overlap.reject.rad 611 B builtin.alignof.rad 698 B builtin.alignof.ril 287 B builtin.memory.fence.rad 108 B builtin.size.align.rad 1.2 KiB builtin.sizeof.rad 656 B builtin.sizeof.ril 282 B builtin.sliceof.invalid.cap.rad 271 B builtin.sliceof.limit.rad 479 B builtin.sliceof.mut.rad 672 B builtin.sliceof.rad 542 B byte.load.store.rad 380 B byte.load.store.ril 687 B call.aggregate.arg.snapshot.rad 520 B call.arg.clobber.rad 732 B call.basic.rad 256 B call.clobber.rad 509 B call.stack.args.aggregate.rad 603 B call.stack.args.fnptr.rad 1.4 KiB call.stack.args.method.rad 1.4 KiB call.stack.args.mixed.rad 1.6 KiB call.stack.args.recursive.rad 1.0 KiB call.stack.args.spill.rad 1.9 KiB call.stack.args.survive.rad 2.9 KiB call.stack.args.throws.rad 861 B call.tests.rad 764 B call.tests.ril 605 B cast.basic.rad 855 B cast.basic.ril 681 B cast.narrow.rad 583 B cast.narrow.ril 557 B cast.same.size.rad 1.0 KiB cast.same.size.ril 1.1 KiB casting.numbers.rad 1.5 KiB char.literal.rad 180 B cmp.extension.rad 3.1 KiB cmp.narrow.live.rad 1.5 KiB cmp.narrow.live.ril 2.2 KiB cmp.rel.rad 733 B cmp.rel.ril 467 B cmp.unsigned.rad 733 B cmp.unsigned.ril 467 B coercion.implicit.rad 941 B coercion.implicit.ril 1.0 KiB compare.literal.first.u64.rad 301 B compound.assign.field.rad 318 B compound.assign.index.once.rad 431 B compound.assign.rad 1.2 KiB compound.assign.ril 2.0 KiB cond.assign.merge.basic.rad 221 B cond.assign.merge.basic.ril 172 B cond.assign.merge.rad 214 B cond.assign.merge.ril 169 B cond.assign.rad 766 B cond.elseif.rad 204 B cond.elseif.ril 181 B cond.expr.aggregate.rad 1.2 KiB cond.expr.literal-first.rad 326 B cond.expr.rad 1.9 KiB cond.expr.ril 3.5 KiB cond.for.else.break.rad 343 B cond.for.indexed.rad 255 B cond.for.rad 180 B cond.for.range.indexed.rad 549 B cond.for.range.rad 190 B cond.for.unsigned.range.rad 677 B cond.forever.break.continue.rad 197 B cond.forever.break.rad 251 B cond.fused.rad 939 B cond.if.case.rad 2.2 KiB cond.if.else.min.rad 152 B cond.if.else.rad 233 B cond.if.elseif.rad 418 B cond.if.noelse.rad 134 B cond.if.rad 840 B cond.ifelse.rad 104 B cond.ifelse.ril 117 B cond.iflet.case.rad 170 B cond.iflet.case.ril 114 B cond.iflet.guard.rad 182 B cond.iflet.guard.ril 165 B cond.iflet.mut.rad 195 B cond.iflet.mut.ril 223 B cond.iflet.noelse.rad 156 B cond.iflet.noelse.ril 231 B cond.iflet.optional.rad 184 B cond.iflet.optional.ril 197 B cond.iflet.optional.value.rad 194 B cond.iflet.optional.value.ril 212 B cond.letelse.case.rad 158 B cond.letelse.case.ril 149 B cond.letelse.guard.rad 172 B cond.letelse.guard.ril 200 B cond.letelse.mut.rad 185 B cond.letelse.mut.ril 258 B cond.letelse.optional.rad 172 B cond.letelse.optional.ril 232 B cond.match.fallthrough.rad 418 B cond.match.guard.rad 1.4 KiB cond.match.guard.regalloc.rad 1.4 KiB cond.nested.rad 138 B cond.nested.ril 185 B cond.optional.annotation.rad 867 B cond.shortcircuit.eval.rad 1006 B cond.shortcircuit.rad 418 B cond.shortcircuit.ril 484 B cond.simple.rad 86 B cond.simple.ril 118 B cond.while.else.break.rad 299 B cond.while.rad 134 B const-cast-wrap.rad 442 B const-expr-array-size.rad 391 B const-expr-cast.rad 1.1 KiB const-expr-literal.rad 673 B const-expr-refs.rad 872 B const.array.copy.mutate.rad 397 B const.array.ident.rad 247 B const.array.ident.ril 208 B const.array.rad 213 B const.array.record.ident.rad 396 B const.array.record.ident.ril 293 B const.array.repeat.record.rad 225 B const.array.repeat.record.ril 211 B const.array.repeat.string.slice.rad 303 B const.array.repeat.string.slice.ril 1.1 KiB const.array.ril 437 B const.array.strings.slice.rad 274 B const.array.strings.slice.ril 781 B const.basic.rad 341 B const.char.rad 174 B const.fn.array.rad 670 B const.i32.shift.right.rad 244 B const.local.duplicate.rad 474 B const.local.duplicate.ril 866 B const.negative.rad 331 B const.negative.ril 380 B const.record.array.rad 1.2 KiB const.record.array.simple.rad 554 B const.record.ctor.rad 194 B const.record.ctor.ril 448 B const.record.fn.rad 362 B const.record.mutcopy.rad 1.0 KiB const.record.mutcopy.ril 1.4 KiB const.record.nested.rad 408 B const.record.nested.ril 312 B const.record.packed.rad 275 B const.record.packed.ril 204 B const.record.padded.rad 275 B const.record.padded.ril 237 B const.record.rad 204 B const.record.ril 164 B const.record.union.rad 612 B const.record.union.ril 883 B const.scalar.rad 105 B const.scalar.ril 116 B const.shift.negative.count.rad 305 B const.slice.of.slices.rad 238 B const.slice.of.slices.ril 1.2 KiB const.slice.param.rad 339 B const.string.rad 114 B const.string.ril 401 B const.string.scoped.names.rad 263 B const.string.scoped.names.ril 1.0 KiB const.u32.shift.mask.rad 249 B const.u64.compare.rad 188 B const.u64.divide.rad 174 B const.union.nested.mixed.rad 889 B const.union.payload.ctor.rad 376 B const.union.payload.ctor.ril 504 B const.union.payload.fn.array.rad 1.1 KiB const.union.payload.record.array.rad 1.5 KiB const.union.record.literal.rad 383 B const.union.record.literal.ril 550 B constant.mutable.pointer.reject.rad 416 B constant.projections.rad 1.8 KiB data.array.rad 803 B data.bool.rad 237 B data.i16.rad 288 B data.i32.rad 308 B data.i8.rad 275 B data.optional.nil.rad 935 B data.optional.value.rad 2.5 KiB data.record.rad 597 B data.simple.rad 492 B data.u16.rad 244 B data.u32.rad 264 B data.u8.rad 232 B data.union.rad 1.0 KiB debug.tag.rad 563 B definit.aggregates.rad 1.9 KiB definit.branches.rad 3.5 KiB definit.loops.rad 1.9 KiB div.u8.immediate.wrap.rad 213 B ecall.i64.rad 535 B edge.cases.2.rad 361 B edge.cases.3.rad 606 B edge.cases.4.rad 1.3 KiB edge.cases.5.rad 1.1 KiB edge.cases.6.rad 3.0 KiB edge.cases.7.addr.bug.rad 246 B edge.cases.8.bug.rad 553 B edge.cases.rad 246 B entry.storage.call.rad 635 B entry.storage.dict.rad 1.6 KiB entry.storage.noenv.rad 1.6 KiB entry.storage.rad 2.3 KiB entry.storage.record.rad 5.5 KiB entry.storage.reject.rad 4.9 KiB entry.storage.slices.index.rad 346 B entry.storage.slices.lower.rad 616 B entry.storage.slices.lower.ril 904 B entry.storage.slices.rad 4.7 KiB entry.storage.slices.range.rad 441 B entry.storage.small.rad 446 B entry.storage.small.record.rad 432 B entry.storage.small.record.ril 367 B entry.storage.small.ril 641 B entry.storage.split.rad 2.5 KiB error.basic.rad 185 B error.catch.discard.pointer.rad 1.0 KiB error.catch.rad 1.6 KiB error.catch.return.rad 414 B error.catch.return.ril 511 B error.division.zero.rad 164 B error.match.discard.rad 533 B error.modulo.zero.rad 162 B error.multi.basic.rad 721 B error.multi.catch.rad 870 B error.multi.catch.typed.binding.rad 840 B error.multi.catch.typed.catchall.rad 1.1 KiB error.multi.catch.typed.rad 1.1 KiB error.multi.mixed.union.rad 3.0 KiB error.multi.propagate.multi.rad 1010 B error.multi.propagate.rad 874 B error.multi.try.optional.rad 544 B error.slice.bounds.rad 233 B error.throw.coercion.rad 318 B error.try.bang.success.rad 381 B error.try.catch.binding.rad 2.0 KiB error.try.optional.rad 1.9 KiB error.try.rad 4.1 KiB extern.inferred.rad 70 B externfn.rad 32 B externfn.ril 37 B fibonacci.rad 120 B fibonacci.ril 247 B field.aggregate.rad 842 B field.aggregate.ril 934 B fn.block.scope.rad 508 B fn.callback.nested.rad 1.6 KiB fn.default.rad 144 B fn.local.rad 153 B fn.ptr.assign.rad 277 B fn.ptr.assign.ril 180 B fn.ptr.call.rad 258 B fn.ptr.call.ril 217 B fn.ptr.param.rad 356 B fn.ptr.param.ril 319 B fn.recursion.2.rad 237 B fn.void.rad 163 B for.else.continue.rad 1.1 KiB for.record.inner.loop.rad 713 B frame.large.rad 614 B generic.function.growth.reject.rad 284 B generic.function.rad 1.5 KiB generic.layout.overflow.reject.rad 211 B generic.layout.rad 875 B heap.allocator.slots.reject.rad 630 B heap.constant.rad 1.2 KiB heap.forge.handle.reject.rad 440 B heap.forge.local.reject.rad 499 B heap.forge.param.reject.rad 316 B heap.forge.static.reject.rad 351 B heap.rewind.static.rad 328 B heap.static.rad 2.8 KiB if-let-mut.rad 1.2 KiB iflet.shadow.else.rad 408 B iflet.shadow.leak.rad 316 B index.eval.order.rad 395 B index.u8.rad 616 B infer.empty.array.reject.rad 197 B infer.nested.integer.reject.rad 366 B int.default.i64.rad 1.1 KiB integer.bitwise.basic.rad 738 B integer.overflow.rad 1.8 KiB intrinsic.bits.rad 239 B intrinsic.bytes.load16.end.rad 406 B intrinsic.bytes.load16.overflow.rad 415 B intrinsic.bytes.load16.short.rad 406 B intrinsic.bytes.load32.end.rad 406 B intrinsic.bytes.load32.overflow.rad 415 B intrinsic.bytes.load32.short.rad 406 B intrinsic.bytes.load64.end.rad 406 B intrinsic.bytes.load64.overflow.rad 415 B intrinsic.bytes.load64.short.rad 406 B intrinsic.bytes.rad 389 B intrinsic.bytes.store16.end.rad 391 B intrinsic.bytes.store16.overflow.rad 400 B intrinsic.bytes.store16.short.rad 391 B intrinsic.bytes.store32.end.rad 391 B intrinsic.bytes.store32.overflow.rad 400 B intrinsic.bytes.store32.short.rad 391 B intrinsic.bytes.store64.end.rad 391 B intrinsic.bytes.store64.overflow.rad 400 B intrinsic.bytes.store64.short.rad 391 B intrinsic.ebreak.rad 90 B intrinsic.ebreak.ril 51 B intrinsic.ecall.buffer.rad 1.1 KiB intrinsic.ecall.buffer.ril 730 B intrinsic.ecall.rad 171 B intrinsic.ecall.ril 70 B intrinsic.page.heap.rad 1.6 KiB large.blit.store.rad 2.1 KiB layout.fn.rad 771 B layout.fn.ril 1.1 KiB layout.optional.rad 698 B layout.optional.ril 1.1 KiB layout.recursive.rad 816 B layout.recursive.ril 409 B layout.result.rad 782 B layout.result.ril 1.5 KiB layout.slice.rad 1.0 KiB layout.slice.ril 2.1 KiB layout.union.rad 996 B layout.union.ril 1.1 KiB let.case.ref.binding.rad 2.7 KiB let.copy.semantics.rad 883 B let.copy.semantics.ril 1.0 KiB let.guard.rad 1.9 KiB let.placeholder.rad 291 B let.placeholder.ril 262 B linear.let-else.rad 402 B linear.ownership.rad 395 B linear.ownership.ril 362 B linear.reference.rad 663 B linear.reference.ril 736 B linear.unsafe.rad 531 B linear.unsafe.ril 318 B literal.char.rad 209 B literal.char.ril 127 B literal.slice.bytes.rad 124 B literal.slice.bytes.ril 351 B literal.slice.dedup.rad 199 B literal.slice.dedup.ril 485 B literal.slice.empty.rad 100 B literal.slice.empty.ril 212 B literal.slice.multi.rad 170 B literal.slice.multi.ril 580 B literal.slice.rad 123 B literal.slice.record.rad 217 B literal.slice.record.ril 495 B literal.slice.ril 361 B literal.string.dedup.rad 179 B literal.string.dedup.ril 472 B literal.string.empty.rad 93 B literal.string.empty.ril 336 B literal.string.fns.rad 180 B literal.string.fns.ril 524 B literal.string.multi.rad 153 B literal.string.multi.ril 534 B literal.string.rad 108 B literal.string.ril 335 B literal.w64.rad 1.7 KiB load.u32.high.rad 1.8 KiB loc.addr.offset.bug.rad 453 B loc.addr.opt.to.opt.rad 454 B loc.addr.optional.assign.rad 429 B loc.addr.record.assign.rad 497 B local.multi.rad 85 B local.multi.ril 67 B local.mut.rad 79 B local.mut.ril 45 B local.simple.rad 60 B local.simple.ril 45 B loop.break.rad 156 B loop.break.ril 228 B loop.complex.flow.rad 1.0 KiB loop.continue.rad 219 B loop.continue.ril 327 B loop.for.array.rad 223 B loop.for.array.ril 371 B loop.for.break.bound.rad 163 B loop.for.break.bound.ril 264 B loop.for.continue.rad 405 B loop.for.continue.ril 797 B loop.for.indexed.rad 151 B loop.for.indexed.ril 285 B loop.for.placeholder.rad 323 B loop.for.placeholder.ril 502 B loop.for.pointer.rad 1.5 KiB loop.for.rad 122 B loop.for.ril 220 B loop.for.slice.indexed.offset.bounds.rad 275 B loop.for.slice.indexed.other.bounds.rad 345 B loop.for.slice.indexed.rad 209 B loop.for.slice.indexed.ril 446 B loop.for.slice.indexed.runtime.rad 1.2 KiB loop.for.slice.indexed.shadow.bounds.rad 296 B loop.for.slice.indexed.source.shadow.bounds.rad 346 B loop.for.slice.pointer.bound.rad 190 B loop.for.slice.pointer.bound.ril 415 B loop.for.slice.rad 216 B loop.for.slice.ril 431 B loop.for.unsigned.range.rad 321 B loop.for.unsigned.range.ril 481 B loop.infinite.rad 41 B loop.infinite.ril 105 B loop.mutable.rad 377 B loop.mutable.ril 569 B loop.nested.break.rad 392 B loop.nested.break.ril 461 B loop.nested.continue.rad 418 B loop.nested.continue.ril 581 B loop.return.rad 141 B loop.return.ril 206 B loop.sealblock.rad 946 B loop.while.false.noparams.rad 170 B loop.while.false.noparams.ril 171 B loop.while.nested.shortcircuit.rad 872 B loop.while.nested.shortcircuit.ril 429 B loop.while.rad 164 B loop.while.ril 241 B loop.whilelet.case.rad 259 B loop.whilelet.case.ril 204 B loop.whilelet.guard.rad 265 B loop.whilelet.guard.ril 256 B loop.whilelet.optional.rad 212 B loop.whilelet.optional.ril 293 B loop.whilelet.union.rad 387 B loop.whilelet.union.ril 444 B lower.const.record.ident.rad 291 B lower.const.record.ident.ril 635 B lower.private.union.const.rad 259 B lower.private.union.const.ril 528 B lower.record.scalar.record.const.rad 244 B lower.record.scalar.record.const.ril 561 B lower.slice.strings.names.rad 462 B match.alternatives.il.rad 1.1 KiB match.alternatives.il.ril 2.0 KiB match.alternatives.nested.rad 9.2 KiB match.alternatives.subject.rad 10.1 KiB match.array.rad 3.5 KiB match.borrow.scope.rad 797 B match.byref.scalar.rad 5.9 KiB match.catchall.reject.rad 660 B match.char.rad 1.7 KiB match.last.prong.il.rad 1.5 KiB match.last.prong.il.ril 1.6 KiB match.last.prong.rad 4.0 KiB match.many.rad 1.6 KiB match.more.rad 667 B match.more.ril 778 B match.multi.seal.rad 1011 B match.multi.seal.ril 848 B match.multi.survive.rad 1.6 KiB match.mutref.push.rad 1.1 KiB match.mutref.union.rad 691 B match.nested.call.rad 1.8 KiB match.nested.deep.rad 2.2 KiB match.nested.deref.rad 3.8 KiB match.nested.enum.byref.rad 27.3 KiB match.nested.guard.field.rad 1.0 KiB match.nested.guard.field.safe.rad 1.9 KiB match.nested.guard.rad 1.6 KiB match.nested.iflet.guard.rad 1.6 KiB match.nested.iflet.rad 1.4 KiB match.nested.iflet.ril 2.3 KiB match.nested.letelse.rad 848 B match.nested.letelse.union.rad 1.4 KiB match.nested.literal.rad 3.1 KiB match.nested.multi.rad 2.5 KiB match.nested.pattern.rad 5.3 KiB match.nested.pattern.ril 8.1 KiB match.nested.record.rad 2.1 KiB match.nested.record.ril 3.4 KiB match.nested.scalar.byref.rad 15.3 KiB match.nested.union.rad 2.3 KiB match.nested.union.ril 4.5 KiB match.nested.whilelet.rad 2.4 KiB match.optional.aggregate.rad 230 B match.optional.aggregate.ril 607 B match.optional.rad 190 B match.optional.record.pattern.rad 14.1 KiB match.optional.record.rad 294 B match.optional.record.ril 369 B match.optional.ref.rad 215 B match.optional.ref.ril 328 B match.optional.ril 268 B match.optional.union.variant.rad 303 B match.optional.union.variant.ril 385 B match.optional.wildcard.rad 282 B match.record.pattern.rad 349 B match.record.pattern.ril 302 B match.record.positional.fields.rad 5.1 KiB match.scalar.extension.rad 1.6 KiB match.simple.rad 375 B match.simple.ril 392 B match.string.rad 1.9 KiB match.subject.inplace.eval.rad 1.9 KiB match.subject.inplace.rad 1.6 KiB match.subject.inplace.ril 2.4 KiB match.switch.dense.rad 3.6 KiB match.switch.rad 219 B match.switch.ril 207 B match.union.switch.rad 3.8 KiB match.value.copy.rad 2.0 KiB match.variant.fields.bind.rad 6.3 KiB match.variant.fields.deref.rad 1.6 KiB match.variant.fields.literal.rad 5.0 KiB match.variant.fields.nested.rad 7.0 KiB match.variant.fields.optional.rad 4.6 KiB match.variant.fields.rad 459 B match.variant.fields.ref.rad 3.2 KiB match.variant.fields.reject.rad 372 B match.variant.fields.ril 835 B match.void.then.or.rad 1.6 KiB match.wildcard.literal.rad 3.5 KiB match.wildcard.switch.rad 403 B match.wildcard.switch.ril 297 B match.wildcard.union.rad 1.7 KiB memzero.result.bug.rad 820 B memzero.union.bug.rad 617 B method.basic.rad 590 B method.eight.params.rad 1.4 KiB method.eight.params.throws.rad 2.3 KiB method.multiple.rad 945 B method.ptr.rad 717 B method.pub.rad 247 B method.return.rad 472 B method.scalar.receiver.rad 920 B method.throws.rad 849 B method.union.rad 447 B method.with.trait.rad 706 B mixedtypes.rad 79 B mixedtypes.ril 82 B multi.throw.basic.rad 294 B multi.throw.basic.ril 395 B multi.throw.catch.typed.rad 466 B multi.throw.catch.typed.ril 830 B multi.throw.propagate.rad 357 B multi.throw.propagate.ril 697 B multiplefns.rad 109 B multiplefns.ril 147 B mutable.data.plain.rad 1.7 KiB mutable.data.slice.reject.rad 992 B mutable.static.slice.reject.rad 404 B mutref.call.result.rad 350 B mutref.loop.bug.rad 1.9 KiB mutref.loop.rad 324 B mutref.loop.ril 412 B mutref.scalar.rad 232 B mutref.scalar.ril 366 B nil.cmp.rad 622 B nil.cmp.ril 556 B noparams.rad 38 B noparams.ril 43 B opt.array.hint.rad 951 B opt.assignment.bug.rad 1.3 KiB opt.bug.test.rad 1.4 KiB opt.if.let.complex.rad 6.1 KiB opt.if.let.guard.rad 801 B opt.if.let.rad 948 B opt.nil.check.rad 1.6 KiB opt.ptr.return.nil.rad 85 B opt.ptr.return.nil.ril 104 B opt.record.eq.rad 864 B opt.record.eq.rev.rad 313 B opt.record.eq.rev.ril 593 B opt.record.eq.ril 3.5 KiB opt.record.rad 677 B opt.return.array.rad 289 B opt.return.nested.rad 803 B opt.return.nil.rad 82 B opt.return.nil.ril 156 B opt.return.record.rad 351 B opt.return.value.rad 91 B opt.return.value.ril 180 B opt.slice.npo.rad 3.0 KiB opt.slice.npo.ril 6.8 KiB opt.type.rad 227 B opt.while.let.complex.rad 411 B optional.aggregate.eq.rad 292 B optional.aggregate.eq.ril 825 B optional.array.repeat.rad 2.9 KiB optional.array.repeat.static.rad 833 B optional.const.scalar.rad 2.6 KiB optional.const.string.rad 340 B optional.eq.rad 131 B optional.eq.ril 311 B optional.field.value.match.rad 628 B optional.let.literal.rad 1.5 KiB optional.pointer.wide.rad 875 B optional.pointer.wide.ril 1.1 KiB optional.ptr.eq.rad 313 B optional.ptr.eq.ril 477 B optional.record.value.match.rad 645 B optional.union.eq.rad 1.5 KiB optional.union.init.rad 2.5 KiB optional.union.let.rad 2.9 KiB optional.union.variant.cond.rad 2.5 KiB optional.union.variant.exhaustive.rad 2.0 KiB optional.union.variant.match.rad 2.4 KiB optional.union.variant.nested.rad 1.5 KiB optional.union.variant.owned.rad 1.3 KiB optional.union.variant.placeholder.rad 408 B optional.union.variant.record.rad 2.9 KiB optional.union.variant.ref.rad 1.4 KiB optional.union.variant.void.rad 1.3 KiB owned.root.fields.rad 1.8 KiB panic.basic.rad 70 B panic.basic.ril 46 B panic.rad 111 B param.address.loop.rad 423 B parser.call.record.argument.rad 209 B parser.condition.array.record.rad 232 B parser.condition.subscript.record.rad 278 B parser.keyword.reject.rad 206 B placeholder.basic.rad 147 B placeholder.comprehensive.rad 578 B placeholder.value.reject.rad 510 B pointer.arithmetic.unsafe.rad 465 B pointer.borrow.unsafe.rad 1.7 KiB pointer.cast.unsafe.rad 475 B pointer.copy.edge.case.rad 1.5 KiB pointer.move.record.rad 570 B pointer.nonnull.rad 1.7 KiB pointer.nonnull.ril 3.3 KiB pointer.slice.index.rad 302 B pointer.slice.store.rad 1005 B pointer.stack.borrow.rad 954 B pointer.stack.unsafe.rad 517 B pointer.zero.trap.rad 407 B pointerfn.rad 50 B pointerfn.ril 112 B prog.ackermann.rad 5.0 KiB prog.bignum.rad 9.7 KiB prog.binsearch.rad 2.5 KiB prog.bubblesort.rad 2.0 KiB prog.cordic.rad 6.9 KiB prog.crc32.rad 2.8 KiB prog.dijkstra.rad 8.0 KiB prog.eval.rad 6.3 KiB prog.hanoi.rad 3.8 KiB prog.huffman.rad 9.8 KiB prog.hybridsort.rad 3.1 KiB prog.linkedlist.rad 5.9 KiB prog.lzw.rad 7.2 KiB prog.matmul.rad 3.0 KiB prog.mersenne.rad 5.5 KiB prog.nqueens.rad 3.6 KiB prog.rbtree.rad 8.8 KiB prog.regex.rad 11.0 KiB prog.sha256.rad 7.2 KiB prog.sieve.rad 2.8 KiB prog.symtab.rad 10.3 KiB prog.tokenizer.rad 14.8 KiB prog.vm.rad 18.2 KiB ptr.addressof.field.rad 138 B ptr.addressof.field.ril 163 B ptr.addressof.local.rad 501 B ptr.addressof.local.ril 353 B ptr.addressof.rad 133 B ptr.addressof.ril 163 B ptr.assign.rad 155 B ptr.assign.ril 159 B ptr.deref.rad 720 B ptr.deref.record.rad 288 B ptr.deref.record.ril 250 B ptr.deref.ril 1.1 KiB ptr.eq.rad 1.1 KiB ptr.mutate.rad 256 B ptr.opaque.rad 1.6 KiB ptr.subscript.assign.rad 133 B ptr.subscript.assign.ril 229 B range.arithmetic.rad 897 B record.access.rad 304 B record.alignment.rad 200 B record.array.elements.rad 1.7 KiB record.assign.blit.rad 121 B record.assign.blit.ril 193 B record.copy.rad 2.1 KiB record.ctor.tuple.rad 75 B record.ctor.tuple.ril 248 B record.empty.eq.rad 278 B record.empty.eq.ril 312 B record.eq.rad 229 B record.eq.ril 272 B record.field.assign.rad 215 B record.field.assign.ril 337 B record.literal.labeled.rad 109 B record.literal.labeled.ril 157 B record.mixed.layout.rad 122 B record.mixed.layout.ril 179 B record.nested.calls.2.rad 622 B record.nested.calls.3.rad 755 B record.nested.eq.rad 258 B record.nested.eq.ril 638 B record.nested.lit.rad 182 B record.nested.lit.ril 249 B record.nodeid.cheap.rad 1.1 KiB record.nodeid.cheap.ril 1.5 KiB record.param.lit.rad 379 B record.positional.destructure.rad 1.1 KiB record.ptr.access.rad 260 B record.ptr.access.ril 227 B record.ptr.mutate.rad 249 B record.scalar.rad 10.7 KiB record.shorthand.rad 1.5 KiB record.single.deref.rad 1.6 KiB record.unlabeled.deref.rad 1.4 KiB record.unlabeled.rad 419 B ref.if.bug.rad 527 B ref.immut.loop.bug.rad 674 B ref.local.bindings.rad 1.5 KiB ref.local.bindings.ril 1.2 KiB ref.local.fields.rad 1.8 KiB ref.local.never.rad 269 B ref.local.never.ril 124 B ref.local.scopes.rad 1.1 KiB ref.local.scopes.ril 1023 B ref.local.slice.release.rad 288 B ref.local.slice.release.ril 654 B ref.mut.ptr.rad 291 B reference.array.repeat.rad 133 B reference.array.repeat.ril 360 B regalloc.callee.save.rad 1.5 KiB regalloc.spill.reuse.rad 488 B region.buffered.rad 6.1 KiB region.cursor.implicit.rad 1.1 KiB region.empty.rad 1.4 KiB region.heap.rad 2.1 KiB region.http.rad 5.9 KiB region.iterator.rad 2.5 KiB region.mutable.views.escape.reject.rad 463 B region.mutable.views.rad 588 B region.nested.rad 2.7 KiB region.record.rad 4.4 KiB region.return.rad 5.4 KiB region.slice.rad 1.5 KiB region.sources.rad 3.6 KiB region.stores.rad 2.8 KiB region.union.variants.rad 1.3 KiB region.unknown.join.reject.rad 456 B region.unnamed.optional.reject.rad 230 B region.unnamed.rad 1.5 KiB region.unnamed.slice.reject.rad 234 B region.writer.rad 2.8 KiB reserve.loop.rad 421 B reserve.loop.ril 502 B reserve.zeroed.rad 1.2 KiB result.slice.rad 1.7 KiB result.void.success.rad 699 B return.lit.rad 45 B return.lit.ril 50 B return.never.catch.rad 794 B return.never.flow.rad 647 B return.never.flow.ril 607 B return.param.rad 48 B return.param.ril 54 B rv64.u32.compare.rad 2.1 KiB scope.local.overflow.reject.rad 842 B scratch.forge.opaque.rad 698 B scratch.frame.rad 3.3 KiB scratch.slots.reject.rad 650 B scratch.stale.values.rad 1.7 KiB set.keyword.rad 446 B simplefn.rad 45 B simplefn.ril 51 B slice.alloc.loop.rad 850 B slice.append.failure.rad 1.1 KiB slice.append.limit.rad 915 B slice.append.limit.trap.rad 369 B slice.append.rad 586 B slice.append.ril 1.5 KiB slice.append.values.rad 3.4 KiB slice.append.zero.rad 1.3 KiB slice.assign.mismatch.rad 220 B slice.assign.rad 2.2 KiB slice.basic.rad 763 B slice.basic.ril 1.3 KiB slice.borrow.coerce.rad 1.4 KiB slice.cap.rad 996 B slice.construct.unsafe.rad 468 B slice.delete.bounds.rad 288 B slice.delete.owned.rad 420 B slice.delete.rad 1009 B slice.delete.ril 4.4 KiB slice.delete.slots.rad 1.2 KiB slice.elem.bounds.rad 271 B slice.empty.nonnull.rad 1.9 KiB slice.empty.suffix.rad 599 B slice.eq.rad 126 B slice.eq.ril 330 B slice.extend.borrowed.rad 6.7 KiB slice.extend.bytes.rad 892 B slice.extend.bytes.ril 3.2 KiB slice.extend.copy.rad 24.0 KiB slice.extend.overflow.rad 1.1 KiB slice.extend.overflow.words.rad 1.1 KiB slice.failure.rad 2.6 KiB slice.grow.rad 6.7 KiB slice.header.unsafe.rad 629 B slice.index.rad 104 B slice.index.ril 220 B slice.mutable.rad 297 B slice.mutable.ril 696 B slice.mutator.place.reject.rad 1.3 KiB slice.new.bounds.rad 258 B slice.new.order.rad 258 B slice.of.rad 560 B slice.owned.return.const.rad 1.5 KiB slice.param.grow.rad 4.0 KiB slice.param.lent.rad 1.6 KiB slice.ptr.checked.bounds.rad 228 B slice.ptr.unsafe.rad 680 B slice.range.bounds.check.rad 301 B slice.range.capacity.bounds.rad 349 B slice.range.capacity.rad 1.8 KiB slice.range.dynamic.rad 883 B slice.range.order.check.rad 300 B slice.range.rad 682 B slice.range.ril 2.2 KiB slice.reserve.limit.rad 722 B slice.reserve.overflow.rad 1.6 KiB slice.reserve.rad 2.2 KiB slice.reserve.result.rad 634 B slice.reserve.result.ril 1.1 KiB slice.resize.extend.rad 793 B slice.resize.extend.ril 2.8 KiB slice.resize.fill.snapshot.rad 1.5 KiB slice.runtime.i32.rad 279 B slice.runtime.i32.ril 873 B slice.runtime.literal.rad 271 B slice.runtime.literal.ril 564 B slice.sizes.rad 13.1 KiB slice.sub.bounds.rad 407 B slice.sub.order.rad 357 B slice.sub.values.rad 1.1 KiB slice.subslice.rad 1.5 KiB slice.take.control.rad 1.4 KiB slice.take.lower.rad 410 B slice.take.lower.ril 351 B slice.take.neighbors.rad 1.8 KiB slice.take.rad 1.9 KiB slice.take.sizes.rad 2.7 KiB slice.zero-sized.limit.rad 345 B slice.zero-sized.rad 1.6 KiB spill.blockarg.clobber.rad 3.6 KiB spill.loop.rad 1.7 KiB stack.local.corrupt.rad 335 B static.array.mutate.rad 441 B static.assign.rad 138 B static.assign.ril 278 B static.basic.rad 361 B static.empty.slice.optional.rad 902 B static.fn.array.rad 628 B static.local.decl.rad 208 B static.local.decl.ril 458 B static.move.reject.rad 566 B static.mutation.reject.rad 3.4 KiB static.optional.nil.rad 1.0 KiB static.owned.alias.reject.rad 499 B static.record.array.rad 546 B static.reference.call.reject.rad 984 B static.scalar.rad 109 B static.scalar.ril 169 B static.slice.empty.rad 375 B static.slice.empty.record.table.rad 2.4 KiB static.slice.empty.ril 729 B static.slice.empty.table.rad 1.6 KiB static.slice.index.assign.rad 450 B static.slice.offset.rad 719 B static.zero.bss.rad 1.1 KiB static.zero.record.repeat.rad 759 B static.zero.record.repeat.ril 581 B string.basic.rad 162 B string.escape.rad 364 B string.index.rad 129 B switch.blockargs.clobber.rad 1.4 KiB trait.aggregate.ret.rad 1.7 KiB trait.array.optional.rad 1.8 KiB trait.basic.rad 632 B trait.control.flow.rad 1.2 KiB trait.dispatch.rad 333 B trait.dispatch.ril 801 B trait.fn.param.rad 1.8 KiB trait.multiple.methods.rad 1.3 KiB trait.multiple.traits.rad 1.3 KiB trait.multiple.types.rad 1.4 KiB trait.object.narrow.rad 1.7 KiB trait.object.rad 408 B trait.object.ril 642 B trait.optional.coerce.rad 1.0 KiB trait.param.names.shared.rad 759 B trait.supertrait.forward.rad 693 B trait.supertrait.rad 2.7 KiB trait.supertrait.ril 4.0 KiB trait.throws.rad 1.0 KiB trait.type.local.reject.rad 357 B trait.type.scoped.reject.rad 333 B trait.writer.rad 2.8 KiB trivial.phi.rad 1.1 KiB trivial.phi.ril 512 B try.basic.rad 402 B try.basic.ril 702 B try.catch.rad 350 B try.catch.ril 637 B try.optional.rad 374 B try.optional.ril 736 B try.panic.rad 362 B try.panic.ril 516 B try.reference.rad 911 B try.reference.ril 2.0 KiB type.unify.rad 4.7 KiB undefined.aggregate.rad 165 B undefined.aggregate.ril 114 B undefined.bitvalid.rad 2.7 KiB undefined.merge.dominance.rad 1.1 KiB undefined.merge.dominance.ril 934 B undefined.merge.one.path.rad 197 B undefined.merge.one.path.ril 119 B undefined.merge.pointer.rad 661 B undefined.merge.rad 1.9 KiB undefined.primitive.rad 122 B undefined.primitive.ril 48 B undefined.rad 459 B undefined.record.field.rad 1.6 KiB undefined.record.field.ril 849 B undefined.unsafe.rad 868 B union-tag.rad 967 B union.bitfield.rad 1.2 KiB union.ctor.rad 574 B union.ctor.ril 509 B union.discriminant.cast.rad 391 B union.edge.case.2.rad 699 B union.edge.case.3.rad 674 B union.eq.rad 827 B union.eq.ril 1.5 KiB union.eq.void.ctor.rad 389 B union.eq.void.ctor.ril 131 B union.eq.void.rad 189 B union.eq.void.ril 75 B union.match.bind.rad 275 B union.match.bind.ril 256 B union.match.ref.rad 1.1 KiB union.match.ref.ril 1.3 KiB union.match.tag.rad 910 B union.match.tag.ril 821 B union.mixed.alias.rad 1.1 KiB union.mixed.assign.rad 1002 B union.mixed.rad 9.9 KiB union.mixed.snapshot.rad 1.7 KiB union.payload.mutref.rad 1.5 KiB union.payload.rad 666 B union.payload.record.eq.rad 304 B union.payload.record.eq.ril 1.0 KiB union.record.forward.rad 1.3 KiB union.record.literal.rad 457 B union.record.literal.ril 418 B union.variant.access.rad 753 B union.variant.access.ril 692 B union.variants.limit.reject.rad 1.4 KiB union.variants.max.rad 1.3 KiB union.void.call.rad 1.5 KiB union.void.match.rad 427 B union.void.rad 969 B unop.rad 701 B unop.ril 506 B unsafe.block.bounds.rad 268 B unsafe.block.rad 866 B unsafe.static.rad 535 B unsigned.compare.rad 1.8 KiB var.align.rad 996 B var.infer.rad 574 B var.shadow.rad 244 B var.shadow.ril 145 B void.throw.rad 281 B void.throw.ril 601 B voidfn.rad 18 B voidfn.ril 44 B trap/ verify/ Makefile 9.2 KiB kernel.rad 776 B runner.rad 11.6 KiB vim/ .gitignore 333 B .gitsigners 224 B AGENTS.md 8.3 KiB CONTRIBUTING 2.1 KiB LICENSE 1.1 KiB Makefile 2.5 KiB README 3.4 KiB STYLE 3.2 KiB std.lib 2.1 KiB std.lib.test 1.1 KiB
test/tests/slice.extend.copy.rad 24.0 KiB raw
1
//! returns: 0
2
//! uses-std
3
//! Slice extend copies every source element for lengths 0 to 33, source and destination offsets
4
//! that vary the byte alignment, and element sizes 1, 2, 3, 4, 6, 8, 12, and 112. The copy leaves
5
//! the bytes around the destination range unchanged, in place and after growth.
6
7
/// Allocation failures.
8
@language union AllocError: Copy {
9
    /// The allocator cannot provide storage.
10
    OutOfMemory,
11
}
12
13
use std::mem::heap;
14
15
/// Backing storage of the arena.
16
unsafe static ARENA_BUF: [u8; 16384] = undefined;
17
18
/// Storage of a heap that rejects every request, for copies that fit in capacity.
19
unsafe static REJECT_BUF: [u8; 64] = undefined;
20
21
/// A heap with no room, so that an allocation fails and panics in `try!`.
22
unsafe fn rejectHeap() -> *heap::Heap {
23
    return heap::withCapacity(&mut REJECT_BUF[..], 0);
24
}
25
26
/// Source lengths of the checks. They straddle the 8-byte word size.
27
static COUNTS: [u32; 16] = [0, 1, 2, 3, 4, 5, 7, 8, 9, 12, 15, 16, 17, 24, 31, 33];
28
29
/// Number of elements in each source and destination buffer.
30
constant BUF_LEN: u32 = 48;
31
32
/// Element of 3 bytes and alignment 1.
33
record Rgb: Copy {
34
    /// Red.
35
    r: u8,
36
    /// Green.
37
    g: u8,
38
    /// Blue.
39
    b: u8,
40
}
41
42
/// Element of 6 bytes and alignment 2.
43
record Half3: Copy {
44
    /// First half word.
45
    a: u16,
46
    /// Second half word.
47
    b: u16,
48
    /// Third half word.
49
    c: u16,
50
}
51
52
/// Element of 12 bytes and alignment 4.
53
record Triple: Copy {
54
    /// First word.
55
    a: u32,
56
    /// Second word.
57
    b: u32,
58
    /// Third word.
59
    c: u32,
60
}
61
62
/// Element of 112 bytes and alignment 8.
63
record Wide: Copy {
64
    /// Fourteen double words.
65
    f: [u64; 14],
66
}
67
68
// U8 //
69
70
/// Build the element for seed `v`.
71
fn mkU8(v: u32) -> u8 {
72
    return (v * 7 + 1) as u8;
73
}
74
75
/// Compare two elements field by field.
76
fn eqU8(a: u8, b: u8) -> bool {
77
    return a == b;
78
}
79
80
/// Source elements.
81
unsafe static SRC_U8: [u8; BUF_LEN] = undefined;
82
/// Destination elements.
83
unsafe static DST_U8: [u8; BUF_LEN] = undefined;
84
85
/// Fill the source with seeds 1 to BUF_LEN and the destination with a sentinel.
86
unsafe fn resetU8() {
87
    for i in 0 .. BUF_LEN {
88
        set SRC_U8[i] = mkU8(i + 1);
89
        set DST_U8[i] = mkU8(i + 900);
90
    }
91
}
92
93
/// Extend an empty slice that starts `pre` elements into the destination buffer with `n` source
94
/// elements from `off`, and check the copy and the untouched elements around it.
95
unsafe fn inPlaceU8(pre: u32, off: u32, n: u32) -> i32 {
96
    resetU8();
97
    let reject = rejectHeap();
98
    let mut items: *mut [u8] = &mut DST_U8[pre .. pre];
99
    let src: *[u8] = &SRC_U8[off .. off + n] as *[u8];
100
    try! items.extend(src, reject);
101
    if items.len <> n {
102
        return 1;
103
    }
104
    for i in 0 .. BUF_LEN {
105
        if i >= pre and i < pre + n {
106
            if not eqU8(DST_U8[i], mkU8(off + i - pre + 1)) {
107
                return 2;
108
            }
109
        } else if not eqU8(DST_U8[i], mkU8(i + 900)) {
110
            return 3;
111
        }
112
    }
113
    return 0;
114
}
115
116
/// Extend a slice that holds `pre` elements by `n` more, which grows it, and check every element.
117
unsafe fn growthU8(pre: u32, off: u32, n: u32, skew: u32) -> i32 {
118
    resetU8();
119
    let arena = heap::over(&mut ARENA_BUF[..]);
120
    heap::rewind(arena, skew);
121
    let mut items: *mut [u8] = &mut [];
122
    try! items.extend(&SRC_U8[.. pre] as *[u8], arena);
123
    // Re-skew so the grown buffer starts at another byte alignment.
124
    heap::rewind(arena, heap::used(arena) + skew);
125
    try! items.extend(&SRC_U8[off .. off + n] as *[u8], arena);
126
    if items.len <> pre + n {
127
        return 4;
128
    }
129
    for i in 0 .. pre {
130
        if not eqU8(items[i], mkU8(i + 1)) {
131
            return 5;
132
        }
133
    }
134
    for i in 0 .. n {
135
        if not eqU8(items[pre + i], mkU8(off + i + 1)) {
136
            return 6;
137
        }
138
    }
139
    return 0;
140
}
141
142
/// Run every in-place and growth check for `U8`.
143
unsafe fn checkU8() -> i32 {
144
    for pre in 0 .. 9 {
145
        for k in 0 .. 16 {
146
            let n = COUNTS[k];
147
            for off in 0 .. 9 {
148
                let r = inPlaceU8(pre, off, n);
149
                if r <> 0 {
150
                    return r;
151
                }
152
                let g = growthU8(pre, off, n, (pre + off + k) % 8);
153
                if g <> 0 {
154
                    return g;
155
                }
156
            }
157
        }
158
    }
159
    return 0;
160
}
161
162
// U16 //
163
164
/// Build the element for seed `v`.
165
fn mkU16(v: u32) -> u16 {
166
    return (v * 13 + 1) as u16;
167
}
168
169
/// Compare two elements field by field.
170
fn eqU16(a: u16, b: u16) -> bool {
171
    return a == b;
172
}
173
174
/// Source elements.
175
unsafe static SRC_U16: [u16; BUF_LEN] = undefined;
176
/// Destination elements.
177
unsafe static DST_U16: [u16; BUF_LEN] = undefined;
178
179
/// Fill the source with seeds 1 to BUF_LEN and the destination with a sentinel.
180
unsafe fn resetU16() {
181
    for i in 0 .. BUF_LEN {
182
        set SRC_U16[i] = mkU16(i + 1);
183
        set DST_U16[i] = mkU16(i + 900);
184
    }
185
}
186
187
/// Extend an empty slice that starts `pre` elements into the destination buffer with `n` source
188
/// elements from `off`, and check the copy and the untouched elements around it.
189
unsafe fn inPlaceU16(pre: u32, off: u32, n: u32) -> i32 {
190
    resetU16();
191
    let reject = rejectHeap();
192
    let mut items: *mut [u16] = &mut DST_U16[pre .. pre];
193
    let src: *[u16] = &SRC_U16[off .. off + n] as *[u16];
194
    try! items.extend(src, reject);
195
    if items.len <> n {
196
        return 1;
197
    }
198
    for i in 0 .. BUF_LEN {
199
        if i >= pre and i < pre + n {
200
            if not eqU16(DST_U16[i], mkU16(off + i - pre + 1)) {
201
                return 2;
202
            }
203
        } else if not eqU16(DST_U16[i], mkU16(i + 900)) {
204
            return 3;
205
        }
206
    }
207
    return 0;
208
}
209
210
/// Extend a slice that holds `pre` elements by `n` more, which grows it, and check every element.
211
unsafe fn growthU16(pre: u32, off: u32, n: u32, skew: u32) -> i32 {
212
    resetU16();
213
    let arena = heap::over(&mut ARENA_BUF[..]);
214
    heap::rewind(arena, skew);
215
    let mut items: *mut [u16] = &mut [];
216
    try! items.extend(&SRC_U16[.. pre] as *[u16], arena);
217
    // Re-skew so the grown buffer starts at another byte alignment.
218
    heap::rewind(arena, heap::used(arena) + skew);
219
    try! items.extend(&SRC_U16[off .. off + n] as *[u16], arena);
220
    if items.len <> pre + n {
221
        return 4;
222
    }
223
    for i in 0 .. pre {
224
        if not eqU16(items[i], mkU16(i + 1)) {
225
            return 5;
226
        }
227
    }
228
    for i in 0 .. n {
229
        if not eqU16(items[pre + i], mkU16(off + i + 1)) {
230
            return 6;
231
        }
232
    }
233
    return 0;
234
}
235
236
/// Run every in-place and growth check for `U16`.
237
unsafe fn checkU16() -> i32 {
238
    for pre in 0 .. 9 {
239
        for k in 0 .. 16 {
240
            let n = COUNTS[k];
241
            for off in 0 .. 9 {
242
                let r = inPlaceU16(pre, off, n);
243
                if r <> 0 {
244
                    return r;
245
                }
246
                let g = growthU16(pre, off, n, (pre + off + k) % 8);
247
                if g <> 0 {
248
                    return g;
249
                }
250
            }
251
        }
252
    }
253
    return 0;
254
}
255
256
// U32 //
257
258
/// Build the element for seed `v`.
259
fn mkU32(v: u32) -> u32 {
260
    return v * 1000003 + 1;
261
}
262
263
/// Compare two elements field by field.
264
fn eqU32(a: u32, b: u32) -> bool {
265
    return a == b;
266
}
267
268
/// Source elements.
269
unsafe static SRC_U32: [u32; BUF_LEN] = undefined;
270
/// Destination elements.
271
unsafe static DST_U32: [u32; BUF_LEN] = undefined;
272
273
/// Fill the source with seeds 1 to BUF_LEN and the destination with a sentinel.
274
unsafe fn resetU32() {
275
    for i in 0 .. BUF_LEN {
276
        set SRC_U32[i] = mkU32(i + 1);
277
        set DST_U32[i] = mkU32(i + 900);
278
    }
279
}
280
281
/// Extend an empty slice that starts `pre` elements into the destination buffer with `n` source
282
/// elements from `off`, and check the copy and the untouched elements around it.
283
unsafe fn inPlaceU32(pre: u32, off: u32, n: u32) -> i32 {
284
    resetU32();
285
    let reject = rejectHeap();
286
    let mut items: *mut [u32] = &mut DST_U32[pre .. pre];
287
    let src: *[u32] = &SRC_U32[off .. off + n] as *[u32];
288
    try! items.extend(src, reject);
289
    if items.len <> n {
290
        return 1;
291
    }
292
    for i in 0 .. BUF_LEN {
293
        if i >= pre and i < pre + n {
294
            if not eqU32(DST_U32[i], mkU32(off + i - pre + 1)) {
295
                return 2;
296
            }
297
        } else if not eqU32(DST_U32[i], mkU32(i + 900)) {
298
            return 3;
299
        }
300
    }
301
    return 0;
302
}
303
304
/// Extend a slice that holds `pre` elements by `n` more, which grows it, and check every element.
305
unsafe fn growthU32(pre: u32, off: u32, n: u32, skew: u32) -> i32 {
306
    resetU32();
307
    let arena = heap::over(&mut ARENA_BUF[..]);
308
    heap::rewind(arena, skew);
309
    let mut items: *mut [u32] = &mut [];
310
    try! items.extend(&SRC_U32[.. pre] as *[u32], arena);
311
    // Re-skew so the grown buffer starts at another byte alignment.
312
    heap::rewind(arena, heap::used(arena) + skew);
313
    try! items.extend(&SRC_U32[off .. off + n] as *[u32], arena);
314
    if items.len <> pre + n {
315
        return 4;
316
    }
317
    for i in 0 .. pre {
318
        if not eqU32(items[i], mkU32(i + 1)) {
319
            return 5;
320
        }
321
    }
322
    for i in 0 .. n {
323
        if not eqU32(items[pre + i], mkU32(off + i + 1)) {
324
            return 6;
325
        }
326
    }
327
    return 0;
328
}
329
330
/// Run every in-place and growth check for `U32`.
331
unsafe fn checkU32() -> i32 {
332
    for pre in 0 .. 9 {
333
        for k in 0 .. 16 {
334
            let n = COUNTS[k];
335
            for off in 0 .. 9 {
336
                let r = inPlaceU32(pre, off, n);
337
                if r <> 0 {
338
                    return r;
339
                }
340
                let g = growthU32(pre, off, n, (pre + off + k) % 8);
341
                if g <> 0 {
342
                    return g;
343
                }
344
            }
345
        }
346
    }
347
    return 0;
348
}
349
350
// U64 //
351
352
/// Build the element for seed `v`.
353
fn mkU64(v: u32) -> u64 {
354
    return v as u64 * 1000003 + 4294967296;
355
}
356
357
/// Compare two elements field by field.
358
fn eqU64(a: u64, b: u64) -> bool {
359
    return a == b;
360
}
361
362
/// Source elements.
363
unsafe static SRC_U64: [u64; BUF_LEN] = undefined;
364
/// Destination elements.
365
unsafe static DST_U64: [u64; BUF_LEN] = undefined;
366
367
/// Fill the source with seeds 1 to BUF_LEN and the destination with a sentinel.
368
unsafe fn resetU64() {
369
    for i in 0 .. BUF_LEN {
370
        set SRC_U64[i] = mkU64(i + 1);
371
        set DST_U64[i] = mkU64(i + 900);
372
    }
373
}
374
375
/// Extend an empty slice that starts `pre` elements into the destination buffer with `n` source
376
/// elements from `off`, and check the copy and the untouched elements around it.
377
unsafe fn inPlaceU64(pre: u32, off: u32, n: u32) -> i32 {
378
    resetU64();
379
    let reject = rejectHeap();
380
    let mut items: *mut [u64] = &mut DST_U64[pre .. pre];
381
    let src: *[u64] = &SRC_U64[off .. off + n] as *[u64];
382
    try! items.extend(src, reject);
383
    if items.len <> n {
384
        return 1;
385
    }
386
    for i in 0 .. BUF_LEN {
387
        if i >= pre and i < pre + n {
388
            if not eqU64(DST_U64[i], mkU64(off + i - pre + 1)) {
389
                return 2;
390
            }
391
        } else if not eqU64(DST_U64[i], mkU64(i + 900)) {
392
            return 3;
393
        }
394
    }
395
    return 0;
396
}
397
398
/// Extend a slice that holds `pre` elements by `n` more, which grows it, and check every element.
399
unsafe fn growthU64(pre: u32, off: u32, n: u32, skew: u32) -> i32 {
400
    resetU64();
401
    let arena = heap::over(&mut ARENA_BUF[..]);
402
    heap::rewind(arena, skew);
403
    let mut items: *mut [u64] = &mut [];
404
    try! items.extend(&SRC_U64[.. pre] as *[u64], arena);
405
    // Re-skew so the grown buffer starts at another byte alignment.
406
    heap::rewind(arena, heap::used(arena) + skew);
407
    try! items.extend(&SRC_U64[off .. off + n] as *[u64], arena);
408
    if items.len <> pre + n {
409
        return 4;
410
    }
411
    for i in 0 .. pre {
412
        if not eqU64(items[i], mkU64(i + 1)) {
413
            return 5;
414
        }
415
    }
416
    for i in 0 .. n {
417
        if not eqU64(items[pre + i], mkU64(off + i + 1)) {
418
            return 6;
419
        }
420
    }
421
    return 0;
422
}
423
424
/// Run every in-place and growth check for `U64`.
425
unsafe fn checkU64() -> i32 {
426
    for pre in 0 .. 9 {
427
        for k in 0 .. 16 {
428
            let n = COUNTS[k];
429
            for off in 0 .. 9 {
430
                let r = inPlaceU64(pre, off, n);
431
                if r <> 0 {
432
                    return r;
433
                }
434
                let g = growthU64(pre, off, n, (pre + off + k) % 8);
435
                if g <> 0 {
436
                    return g;
437
                }
438
            }
439
        }
440
    }
441
    return 0;
442
}
443
444
// Rgb //
445
446
/// Build the element for seed `v`.
447
fn mkRgb(v: u32) -> Rgb {
448
    return Rgb { r: (v * 3) as u8, g: (v * 5 + 1) as u8, b: (v * 7 + 2) as u8 };
449
}
450
451
/// Compare two elements field by field.
452
fn eqRgb(a: Rgb, b: Rgb) -> bool {
453
    return a.r == b.r and a.g == b.g and a.b == b.b;
454
}
455
456
/// Source elements.
457
unsafe static SRC_Rgb: [Rgb; BUF_LEN] = undefined;
458
/// Destination elements.
459
unsafe static DST_Rgb: [Rgb; BUF_LEN] = undefined;
460
461
/// Fill the source with seeds 1 to BUF_LEN and the destination with a sentinel.
462
unsafe fn resetRgb() {
463
    for i in 0 .. BUF_LEN {
464
        set SRC_Rgb[i] = mkRgb(i + 1);
465
        set DST_Rgb[i] = mkRgb(i + 900);
466
    }
467
}
468
469
/// Extend an empty slice that starts `pre` elements into the destination buffer with `n` source
470
/// elements from `off`, and check the copy and the untouched elements around it.
471
unsafe fn inPlaceRgb(pre: u32, off: u32, n: u32) -> i32 {
472
    resetRgb();
473
    let reject = rejectHeap();
474
    let mut items: *mut [Rgb] = &mut DST_Rgb[pre .. pre];
475
    let src: *[Rgb] = &SRC_Rgb[off .. off + n] as *[Rgb];
476
    try! items.extend(src, reject);
477
    if items.len <> n {
478
        return 1;
479
    }
480
    for i in 0 .. BUF_LEN {
481
        if i >= pre and i < pre + n {
482
            if not eqRgb(DST_Rgb[i], mkRgb(off + i - pre + 1)) {
483
                return 2;
484
            }
485
        } else if not eqRgb(DST_Rgb[i], mkRgb(i + 900)) {
486
            return 3;
487
        }
488
    }
489
    return 0;
490
}
491
492
/// Extend a slice that holds `pre` elements by `n` more, which grows it, and check every element.
493
unsafe fn growthRgb(pre: u32, off: u32, n: u32, skew: u32) -> i32 {
494
    resetRgb();
495
    let arena = heap::over(&mut ARENA_BUF[..]);
496
    heap::rewind(arena, skew);
497
    let mut items: *mut [Rgb] = &mut [];
498
    try! items.extend(&SRC_Rgb[.. pre] as *[Rgb], arena);
499
    // Re-skew so the grown buffer starts at another byte alignment.
500
    heap::rewind(arena, heap::used(arena) + skew);
501
    try! items.extend(&SRC_Rgb[off .. off + n] as *[Rgb], arena);
502
    if items.len <> pre + n {
503
        return 4;
504
    }
505
    for i in 0 .. pre {
506
        if not eqRgb(items[i], mkRgb(i + 1)) {
507
            return 5;
508
        }
509
    }
510
    for i in 0 .. n {
511
        if not eqRgb(items[pre + i], mkRgb(off + i + 1)) {
512
            return 6;
513
        }
514
    }
515
    return 0;
516
}
517
518
/// Run every in-place and growth check for `Rgb`.
519
unsafe fn checkRgb() -> i32 {
520
    for pre in 0 .. 9 {
521
        for k in 0 .. 16 {
522
            let n = COUNTS[k];
523
            for off in 0 .. 9 {
524
                let r = inPlaceRgb(pre, off, n);
525
                if r <> 0 {
526
                    return r;
527
                }
528
                let g = growthRgb(pre, off, n, (pre + off + k) % 8);
529
                if g <> 0 {
530
                    return g;
531
                }
532
            }
533
        }
534
    }
535
    return 0;
536
}
537
538
// Half3 //
539
540
/// Build the element for seed `v`.
541
fn mkHalf3(v: u32) -> Half3 {
542
    return Half3 { a: (v * 3) as u16, b: (v * 5 + 1) as u16, c: (v * 7 + 2) as u16 };
543
}
544
545
/// Compare two elements field by field.
546
fn eqHalf3(a: Half3, b: Half3) -> bool {
547
    return a.a == b.a and a.b == b.b and a.c == b.c;
548
}
549
550
/// Source elements.
551
unsafe static SRC_Half3: [Half3; BUF_LEN] = undefined;
552
/// Destination elements.
553
unsafe static DST_Half3: [Half3; BUF_LEN] = undefined;
554
555
/// Fill the source with seeds 1 to BUF_LEN and the destination with a sentinel.
556
unsafe fn resetHalf3() {
557
    for i in 0 .. BUF_LEN {
558
        set SRC_Half3[i] = mkHalf3(i + 1);
559
        set DST_Half3[i] = mkHalf3(i + 900);
560
    }
561
}
562
563
/// Extend an empty slice that starts `pre` elements into the destination buffer with `n` source
564
/// elements from `off`, and check the copy and the untouched elements around it.
565
unsafe fn inPlaceHalf3(pre: u32, off: u32, n: u32) -> i32 {
566
    resetHalf3();
567
    let reject = rejectHeap();
568
    let mut items: *mut [Half3] = &mut DST_Half3[pre .. pre];
569
    let src: *[Half3] = &SRC_Half3[off .. off + n] as *[Half3];
570
    try! items.extend(src, reject);
571
    if items.len <> n {
572
        return 1;
573
    }
574
    for i in 0 .. BUF_LEN {
575
        if i >= pre and i < pre + n {
576
            if not eqHalf3(DST_Half3[i], mkHalf3(off + i - pre + 1)) {
577
                return 2;
578
            }
579
        } else if not eqHalf3(DST_Half3[i], mkHalf3(i + 900)) {
580
            return 3;
581
        }
582
    }
583
    return 0;
584
}
585
586
/// Extend a slice that holds `pre` elements by `n` more, which grows it, and check every element.
587
unsafe fn growthHalf3(pre: u32, off: u32, n: u32, skew: u32) -> i32 {
588
    resetHalf3();
589
    let arena = heap::over(&mut ARENA_BUF[..]);
590
    heap::rewind(arena, skew);
591
    let mut items: *mut [Half3] = &mut [];
592
    try! items.extend(&SRC_Half3[.. pre] as *[Half3], arena);
593
    // Re-skew so the grown buffer starts at another byte alignment.
594
    heap::rewind(arena, heap::used(arena) + skew);
595
    try! items.extend(&SRC_Half3[off .. off + n] as *[Half3], arena);
596
    if items.len <> pre + n {
597
        return 4;
598
    }
599
    for i in 0 .. pre {
600
        if not eqHalf3(items[i], mkHalf3(i + 1)) {
601
            return 5;
602
        }
603
    }
604
    for i in 0 .. n {
605
        if not eqHalf3(items[pre + i], mkHalf3(off + i + 1)) {
606
            return 6;
607
        }
608
    }
609
    return 0;
610
}
611
612
/// Run every in-place and growth check for `Half3`.
613
unsafe fn checkHalf3() -> i32 {
614
    for pre in 0 .. 9 {
615
        for k in 0 .. 16 {
616
            let n = COUNTS[k];
617
            for off in 0 .. 9 {
618
                let r = inPlaceHalf3(pre, off, n);
619
                if r <> 0 {
620
                    return r;
621
                }
622
                let g = growthHalf3(pre, off, n, (pre + off + k) % 8);
623
                if g <> 0 {
624
                    return g;
625
                }
626
            }
627
        }
628
    }
629
    return 0;
630
}
631
632
// Triple //
633
634
/// Build the element for seed `v`.
635
fn mkTriple(v: u32) -> Triple {
636
    return Triple { a: v * 3, b: v * 5 + 1, c: v * 7 + 2 };
637
}
638
639
/// Compare two elements field by field.
640
fn eqTriple(a: Triple, b: Triple) -> bool {
641
    return a.a == b.a and a.b == b.b and a.c == b.c;
642
}
643
644
/// Source elements.
645
unsafe static SRC_Triple: [Triple; BUF_LEN] = undefined;
646
/// Destination elements.
647
unsafe static DST_Triple: [Triple; BUF_LEN] = undefined;
648
649
/// Fill the source with seeds 1 to BUF_LEN and the destination with a sentinel.
650
unsafe fn resetTriple() {
651
    for i in 0 .. BUF_LEN {
652
        set SRC_Triple[i] = mkTriple(i + 1);
653
        set DST_Triple[i] = mkTriple(i + 900);
654
    }
655
}
656
657
/// Extend an empty slice that starts `pre` elements into the destination buffer with `n` source
658
/// elements from `off`, and check the copy and the untouched elements around it.
659
unsafe fn inPlaceTriple(pre: u32, off: u32, n: u32) -> i32 {
660
    resetTriple();
661
    let reject = rejectHeap();
662
    let mut items: *mut [Triple] = &mut DST_Triple[pre .. pre];
663
    let src: *[Triple] = &SRC_Triple[off .. off + n] as *[Triple];
664
    try! items.extend(src, reject);
665
    if items.len <> n {
666
        return 1;
667
    }
668
    for i in 0 .. BUF_LEN {
669
        if i >= pre and i < pre + n {
670
            if not eqTriple(DST_Triple[i], mkTriple(off + i - pre + 1)) {
671
                return 2;
672
            }
673
        } else if not eqTriple(DST_Triple[i], mkTriple(i + 900)) {
674
            return 3;
675
        }
676
    }
677
    return 0;
678
}
679
680
/// Extend a slice that holds `pre` elements by `n` more, which grows it, and check every element.
681
unsafe fn growthTriple(pre: u32, off: u32, n: u32, skew: u32) -> i32 {
682
    resetTriple();
683
    let arena = heap::over(&mut ARENA_BUF[..]);
684
    heap::rewind(arena, skew);
685
    let mut items: *mut [Triple] = &mut [];
686
    try! items.extend(&SRC_Triple[.. pre] as *[Triple], arena);
687
    // Re-skew so the grown buffer starts at another byte alignment.
688
    heap::rewind(arena, heap::used(arena) + skew);
689
    try! items.extend(&SRC_Triple[off .. off + n] as *[Triple], arena);
690
    if items.len <> pre + n {
691
        return 4;
692
    }
693
    for i in 0 .. pre {
694
        if not eqTriple(items[i], mkTriple(i + 1)) {
695
            return 5;
696
        }
697
    }
698
    for i in 0 .. n {
699
        if not eqTriple(items[pre + i], mkTriple(off + i + 1)) {
700
            return 6;
701
        }
702
    }
703
    return 0;
704
}
705
706
/// Run every in-place and growth check for `Triple`.
707
unsafe fn checkTriple() -> i32 {
708
    for pre in 0 .. 9 {
709
        for k in 0 .. 16 {
710
            let n = COUNTS[k];
711
            for off in 0 .. 9 {
712
                let r = inPlaceTriple(pre, off, n);
713
                if r <> 0 {
714
                    return r;
715
                }
716
                let g = growthTriple(pre, off, n, (pre + off + k) % 8);
717
                if g <> 0 {
718
                    return g;
719
                }
720
            }
721
        }
722
    }
723
    return 0;
724
}
725
726
// Wide //
727
728
/// Build the element for seed `v`.
729
fn mkWide(v: u32) -> Wide {
730
    let mut w = Wide { f: [0; 14] };
731
    for i in 0 .. 14 {
732
        set w.f[i] = v as u64 * 100 + i;
733
    }
734
    return w;
735
}
736
737
/// Compare two elements field by field.
738
fn eqWide(a: Wide, b: Wide) -> bool {
739
    for i in 0 .. 14 {
740
        if a.f[i] <> b.f[i] {
741
            return false;
742
        }
743
    }
744
    return true;
745
}
746
747
/// Source elements.
748
unsafe static SRC_Wide: [Wide; BUF_LEN] = undefined;
749
/// Destination elements.
750
unsafe static DST_Wide: [Wide; BUF_LEN] = undefined;
751
752
/// Fill the source with seeds 1 to BUF_LEN and the destination with a sentinel.
753
unsafe fn resetWide() {
754
    for i in 0 .. BUF_LEN {
755
        set SRC_Wide[i] = mkWide(i + 1);
756
        set DST_Wide[i] = mkWide(i + 900);
757
    }
758
}
759
760
/// Extend an empty slice that starts `pre` elements into the destination buffer with `n` source
761
/// elements from `off`, and check the copy and the untouched elements around it.
762
unsafe fn inPlaceWide(pre: u32, off: u32, n: u32) -> i32 {
763
    resetWide();
764
    let reject = rejectHeap();
765
    let mut items: *mut [Wide] = &mut DST_Wide[pre .. pre];
766
    let src: *[Wide] = &SRC_Wide[off .. off + n] as *[Wide];
767
    try! items.extend(src, reject);
768
    if items.len <> n {
769
        return 1;
770
    }
771
    for i in 0 .. BUF_LEN {
772
        if i >= pre and i < pre + n {
773
            if not eqWide(DST_Wide[i], mkWide(off + i - pre + 1)) {
774
                return 2;
775
            }
776
        } else if not eqWide(DST_Wide[i], mkWide(i + 900)) {
777
            return 3;
778
        }
779
    }
780
    return 0;
781
}
782
783
/// Extend a slice that holds `pre` elements by `n` more, which grows it, and check every element.
784
unsafe fn growthWide(pre: u32, off: u32, n: u32, skew: u32) -> i32 {
785
    resetWide();
786
    let arena = heap::over(&mut ARENA_BUF[..]);
787
    heap::rewind(arena, skew);
788
    let mut items: *mut [Wide] = &mut [];
789
    try! items.extend(&SRC_Wide[.. pre] as *[Wide], arena);
790
    // Re-skew so the grown buffer starts at another byte alignment.
791
    heap::rewind(arena, heap::used(arena) + skew);
792
    try! items.extend(&SRC_Wide[off .. off + n] as *[Wide], arena);
793
    if items.len <> pre + n {
794
        return 4;
795
    }
796
    for i in 0 .. pre {
797
        if not eqWide(items[i], mkWide(i + 1)) {
798
            return 5;
799
        }
800
    }
801
    for i in 0 .. n {
802
        if not eqWide(items[pre + i], mkWide(off + i + 1)) {
803
            return 6;
804
        }
805
    }
806
    return 0;
807
}
808
809
/// Run every in-place and growth check for `Wide`.
810
unsafe fn checkWide() -> i32 {
811
    for pre in 0 .. 9 {
812
        for k in 0 .. 16 {
813
            let n = COUNTS[k];
814
            for off in 0 .. 9 {
815
                let r = inPlaceWide(pre, off, n);
816
                if r <> 0 {
817
                    return r;
818
                }
819
                let g = growthWide(pre, off, n, (pre + off + k) % 8);
820
                if g <> 0 {
821
                    return g;
822
                }
823
            }
824
        }
825
    }
826
    return 0;
827
}
828
829
@default unsafe fn main() -> i32 {
830
    let r8 = checkU8();
831
    if r8 <> 0 {
832
        return 10 + r8;
833
    }
834
    let r16 = checkU16();
835
    if r16 <> 0 {
836
        return 20 + r16;
837
    }
838
    let r32 = checkU32();
839
    if r32 <> 0 {
840
        return 30 + r32;
841
    }
842
    let r64 = checkU64();
843
    if r64 <> 0 {
844
        return 40 + r64;
845
    }
846
    let rRgb = checkRgb();
847
    if rRgb <> 0 {
848
        return 50 + rRgb;
849
    }
850
    let rHalf = checkHalf3();
851
    if rHalf <> 0 {
852
        return 60 + rHalf;
853
    }
854
    let rTriple = checkTriple();
855
    if rTriple <> 0 {
856
        return 70 + rTriple;
857
    }
858
    let rWide = checkWide();
859
    if rWide <> 0 {
860
        return 80 + rWide;
861
    }
862
    return 0;
863
}