1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Runtime for Go packages compiled to Rust by the rustygo compiler.
//!
//! Generated code is safe Rust and calls into this crate for everything Go
//! has and Rust does not. The `unsafe` in the project lives here, the same way
//! Rust's own `std` confines it.
//!
//! This crate is at the M0 spike stage (see `docs/ROADMAP.md`). What exists:
//!
//! * [`value`] and [`place`]: Go values, addressable storage and pointers.
//! * [`string`]: Go strings.
//! * [`ops`]: Go integer semantics that differ from Rust's (shifts,
//! division) and bounds checks.
//! * [`print`]: the builtin `print` / `println`.
//! * [`panic`](mod@panic): Go panics carried on Rust unwinding.
//! * `rt`: the process entry point for a Go `main` (`std` only).
//! * [`prelude`]: what generated code imports.
//! * [`gc`] and [`heap`]: GC roots and the collector.
//! * [`trace`]: how the collector walks a value's references.
//!
//! Still to come, by milestone: slices, maps, closures and interfaces (M1); goroutines, channels and timers (M2);
//! the `syscall` layer and netpoller (M3).
//!
//! # Features
//!
//! * `std` (default): hosted targets. Without it the crate is `no_std` +
//! `alloc`.
//! * `gc-torture`: debug collector that collects at every safe point.
extern crate alloc;
extern crate std;