Auto merge of #39633 - steveklabnik:vendor-mdbook, r=alexcrichton
Port books to mdbook Part of https://github.com/rust-lang/rust/issues/39588 blocked on https://github.com/rust-lang/rust/pull/39431 As a first step towards the bookshelf, we ~vendor mdbook in-tree and~ port our books to it. Eventually, both of these books will be moved out-of-tree, but the nightly book will rely on doing the same thing. As such, this intermediate step is useful. r? @alexcrichton @brson /cc @azerupi
This commit is contained in:
commit
025c328bf5
|
@ -6,4 +6,4 @@
|
||||||
*.rs rust
|
*.rs rust
|
||||||
src/etc/installer/gfx/* binary
|
src/etc/installer/gfx/* binary
|
||||||
*.woff binary
|
*.woff binary
|
||||||
src/vendor/* binary
|
src/vendor/** -text
|
||||||
|
|
|
@ -100,3 +100,4 @@ version.md
|
||||||
version.ml
|
version.ml
|
||||||
version.texi
|
version.texi
|
||||||
.cargo
|
.cargo
|
||||||
|
!src/vendor/**
|
||||||
|
|
|
@ -6,6 +6,14 @@ dependencies = [
|
||||||
"libc 0.0.0",
|
"libc 0.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "aho-corasick"
|
||||||
|
version = "0.5.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "alloc"
|
name = "alloc"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
@ -31,10 +39,25 @@ dependencies = [
|
||||||
"libc 0.0.0",
|
"libc 0.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ansi_term"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arena"
|
name = "arena"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bitflags"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bitflags"
|
||||||
|
version = "0.7.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bootstrap"
|
name = "bootstrap"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
@ -69,6 +92,21 @@ dependencies = [
|
||||||
name = "cargotest"
|
name = "cargotest"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "clap"
|
||||||
|
version = "2.19.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"unicode-segmentation 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cmake"
|
name = "cmake"
|
||||||
version = "0.1.18"
|
version = "0.1.18"
|
||||||
|
@ -114,6 +152,7 @@ version = "0.3.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -158,6 +197,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
name = "graphviz"
|
name = "graphviz"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "handlebars"
|
||||||
|
version = "0.20.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"pest 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"quick-error 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "kernel32-sys"
|
||||||
|
version = "0.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lazy_static"
|
||||||
|
version = "0.1.16"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
@ -183,6 +249,27 @@ name = "log"
|
||||||
version = "0.3.6"
|
version = "0.3.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mdbook"
|
||||||
|
version = "0.0.14"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"clap 2.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"handlebars 0.20.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"pulldown-cmark 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "memchr"
|
||||||
|
version = "0.1.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num_cpus"
|
name = "num_cpus"
|
||||||
version = "0.2.13"
|
version = "0.2.13"
|
||||||
|
@ -209,6 +296,11 @@ dependencies = [
|
||||||
"unwind 0.0.0",
|
"unwind 0.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pest"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc_macro"
|
name = "proc_macro"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
@ -225,6 +317,15 @@ dependencies = [
|
||||||
"syntax_pos 0.0.0",
|
"syntax_pos 0.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pulldown-cmark"
|
||||||
|
version = "0.0.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "qemu-test-client"
|
name = "qemu-test-client"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@ -233,6 +334,11 @@ version = "0.1.0"
|
||||||
name = "qemu-test-server"
|
name = "qemu-test-server"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quick-error"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand"
|
name = "rand"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
@ -240,9 +346,30 @@ dependencies = [
|
||||||
"core 0.0.0",
|
"core 0.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex"
|
||||||
|
version = "0.1.80"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex-syntax"
|
||||||
|
version = "0.3.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustbook"
|
name = "rustbook"
|
||||||
version = "0.0.0"
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"clap 2.19.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"mdbook 0.0.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc"
|
name = "rustc"
|
||||||
|
@ -650,6 +777,11 @@ dependencies = [
|
||||||
"core 0.0.0",
|
"core 0.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "strsim"
|
||||||
|
version = "0.5.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syntax"
|
name = "syntax"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
@ -685,6 +817,16 @@ dependencies = [
|
||||||
name = "term"
|
name = "term"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "term_size"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "test"
|
name = "test"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
@ -700,6 +842,23 @@ dependencies = [
|
||||||
"test 0.0.0",
|
"test 0.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thread-id"
|
||||||
|
version = "2.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thread_local"
|
||||||
|
version = "0.2.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tidy"
|
name = "tidy"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@ -712,14 +871,69 @@ dependencies = [
|
||||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-segmentation"
|
||||||
|
version = "0.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-width"
|
||||||
|
version = "0.1.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "utf8-ranges"
|
||||||
|
version = "0.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "vec_map"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi"
|
||||||
|
version = "0.2.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi-build"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
|
"checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66"
|
||||||
|
"checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"
|
||||||
|
"checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23"
|
||||||
|
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
|
||||||
|
"checksum clap 2.19.3 (registry+https://github.com/rust-lang/crates.io-index)" = "95b78f3fe0fc94c13c731714363260e04b557a637166f33a4570d3189d642374"
|
||||||
"checksum cmake 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0e5bcf27e097a184c1df4437654ed98df3d7a516e8508a6ba45d8b092bbdf283"
|
"checksum cmake 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0e5bcf27e097a184c1df4437654ed98df3d7a516e8508a6ba45d8b092bbdf283"
|
||||||
"checksum env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f"
|
"checksum env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f"
|
||||||
"checksum filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "5363ab8e4139b8568a6237db5248646e5a8a2f89bd5ccb02092182b11fd3e922"
|
"checksum filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "5363ab8e4139b8568a6237db5248646e5a8a2f89bd5ccb02092182b11fd3e922"
|
||||||
"checksum gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)" = "c07c758b972368e703a562686adb39125707cc1ef3399da8c019fc6c2498a75d"
|
"checksum gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)" = "c07c758b972368e703a562686adb39125707cc1ef3399da8c019fc6c2498a75d"
|
||||||
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"
|
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"
|
||||||
|
"checksum handlebars 0.20.5 (registry+https://github.com/rust-lang/crates.io-index)" = "07f9c1d28bcfb97143c95ed0667141677b2b5675c7ba3d5b81459ad43b1073bd"
|
||||||
|
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
|
||||||
|
"checksum lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417"
|
||||||
"checksum libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "044d1360593a78f5c8e5e710beccdc24ab71d1f01bc19a29bcacdba22e8475d8"
|
"checksum libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "044d1360593a78f5c8e5e710beccdc24ab71d1f01bc19a29bcacdba22e8475d8"
|
||||||
"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
|
"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
|
||||||
|
"checksum mdbook 0.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "a629cd0194bbd0340a70db83a94b27cf9881fac8c55e6a2db983addcb7114ee4"
|
||||||
|
"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20"
|
||||||
"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3"
|
"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3"
|
||||||
|
"checksum pest 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0a6dda33d67c26f0aac90d324ab2eb7239c819fc7b2552fe9faa4fe88441edc8"
|
||||||
|
"checksum pulldown-cmark 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1058d7bb927ca067656537eec4e02c2b4b70eaaa129664c5b90c111e20326f41"
|
||||||
|
"checksum quick-error 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0aad603e8d7fb67da22dbdf1f4b826ce8829e406124109e73cf1b2454b93a71c"
|
||||||
|
"checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f"
|
||||||
|
"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
|
||||||
"checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b"
|
"checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b"
|
||||||
|
"checksum strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "67f84c44fbb2f91db7fef94554e6b2ac05909c9c0b0bc23bb98d3a1aebfe7f7c"
|
||||||
|
"checksum term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f7f5f3f71b0040cecc71af239414c23fd3c73570f5ff54cf50e03cef637f2a0"
|
||||||
|
"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03"
|
||||||
|
"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5"
|
||||||
"checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796"
|
"checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796"
|
||||||
|
"checksum unicode-segmentation 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c3bc443ded17b11305ffffe6b37e2076f328a5a8cb6aa877b1b98f77699e98b5"
|
||||||
|
"checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f"
|
||||||
|
"checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f"
|
||||||
|
"checksum vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cac5efe5cb0fa14ec2f84f83c701c562ee63f6dcc680861b21d65c682adfb05f"
|
||||||
|
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
|
||||||
|
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
|
||||||
|
|
|
@ -47,6 +47,7 @@ pub fn rustbook(build: &Build, target: &str, name: &str) {
|
||||||
build.run(build.tool_cmd(&compiler, "rustbook")
|
build.run(build.tool_cmd(&compiler, "rustbook")
|
||||||
.arg("build")
|
.arg("build")
|
||||||
.arg(&src)
|
.arg(&src)
|
||||||
|
.arg("-d")
|
||||||
.arg(out));
|
.arg(out));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% The Rust Programming Language
|
# The Rust Programming Language
|
||||||
|
|
||||||
Welcome! This book will teach you about the [Rust Programming Language][rust].
|
Welcome! This book will teach you about the [Rust Programming Language][rust].
|
||||||
Rust is a systems programming language focused on three goals: safety, speed,
|
Rust is a systems programming language focused on three goals: safety, speed,
|
|
@ -1,5 +1,7 @@
|
||||||
# Summary
|
# Summary
|
||||||
|
|
||||||
|
[Introduction](README.md)
|
||||||
|
|
||||||
* [Getting Started](getting-started.md)
|
* [Getting Started](getting-started.md)
|
||||||
* [Tutorial: Guessing Game](guessing-game.md)
|
* [Tutorial: Guessing Game](guessing-game.md)
|
||||||
* [Syntax and Semantics](syntax-and-semantics.md)
|
* [Syntax and Semantics](syntax-and-semantics.md)
|
|
@ -1,4 +1,4 @@
|
||||||
% Advanced Linking
|
# Advanced Linking
|
||||||
|
|
||||||
The common cases of linking with Rust have been covered earlier in this book,
|
The common cases of linking with Rust have been covered earlier in this book,
|
||||||
but supporting the range of linking possibilities made available by other
|
but supporting the range of linking possibilities made available by other
|
|
@ -1,4 +1,4 @@
|
||||||
% Associated Constants
|
# Associated Constants
|
||||||
|
|
||||||
With the `associated_consts` feature, you can define constants like this:
|
With the `associated_consts` feature, you can define constants like this:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% Associated Types
|
# Associated Types
|
||||||
|
|
||||||
Associated types are a powerful part of Rust’s type system. They’re related to
|
Associated types are a powerful part of Rust’s type system. They’re related to
|
||||||
the idea of a ‘type family’, in other words, grouping multiple types together. That
|
the idea of a ‘type family’, in other words, grouping multiple types together. That
|
|
@ -1,4 +1,4 @@
|
||||||
% Attributes
|
# Attributes
|
||||||
|
|
||||||
Declarations can be annotated with ‘attributes’ in Rust. They look like this:
|
Declarations can be annotated with ‘attributes’ in Rust. They look like this:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% Benchmark tests
|
# Benchmark tests
|
||||||
|
|
||||||
Rust supports benchmark tests, which can test the performance of your
|
Rust supports benchmark tests, which can test the performance of your
|
||||||
code. Let's make our `src/lib.rs` look like this (comments elided):
|
code. Let's make our `src/lib.rs` look like this (comments elided):
|
|
@ -1,4 +1,4 @@
|
||||||
% Bibliography
|
# Bibliography
|
||||||
|
|
||||||
This is a reading list of material relevant to Rust. It includes prior
|
This is a reading list of material relevant to Rust. It includes prior
|
||||||
research that has - at one time or another - influenced the design of
|
research that has - at one time or another - influenced the design of
|
|
@ -1,4 +1,4 @@
|
||||||
% Borrow and AsRef
|
# Borrow and AsRef
|
||||||
|
|
||||||
The [`Borrow`][borrow] and [`AsRef`][asref] traits are very similar, but
|
The [`Borrow`][borrow] and [`AsRef`][asref] traits are very similar, but
|
||||||
different. Here’s a quick refresher on what these two traits mean.
|
different. Here’s a quick refresher on what these two traits mean.
|
|
@ -1,4 +1,4 @@
|
||||||
% Box Syntax and Patterns
|
# Box Syntax and Patterns
|
||||||
|
|
||||||
Currently the only stable way to create a `Box` is via the `Box::new` method.
|
Currently the only stable way to create a `Box` is via the `Box::new` method.
|
||||||
Also it is not possible in stable Rust to destructure a `Box` in a match
|
Also it is not possible in stable Rust to destructure a `Box` in a match
|
|
@ -1,4 +1,4 @@
|
||||||
% Casting Between Types
|
# Casting Between Types
|
||||||
|
|
||||||
Rust, with its focus on safety, provides two different ways of casting
|
Rust, with its focus on safety, provides two different ways of casting
|
||||||
different types between each other. The first, `as`, is for safe casts.
|
different types between each other. The first, `as`, is for safe casts.
|
||||||
|
@ -8,7 +8,7 @@ most dangerous features of Rust!
|
||||||
# Coercion
|
# Coercion
|
||||||
|
|
||||||
Coercion between types is implicit and has no syntax of its own, but can
|
Coercion between types is implicit and has no syntax of its own, but can
|
||||||
be spelled out with [`as`](#explicit-coercions).
|
be spelled out with [`as`](#Explicit%20coercions).
|
||||||
|
|
||||||
Coercion occurs in `let`, `const`, and `static` statements; in
|
Coercion occurs in `let`, `const`, and `static` statements; in
|
||||||
function call arguments; in field values in struct initialization; and in a
|
function call arguments; in field values in struct initialization; and in a
|
||||||
|
@ -19,7 +19,7 @@ The most common case of coercion is removing mutability from a reference:
|
||||||
* `&mut T` to `&T`
|
* `&mut T` to `&T`
|
||||||
|
|
||||||
An analogous conversion is to remove mutability from a
|
An analogous conversion is to remove mutability from a
|
||||||
[raw pointer](raw-pointers.md):
|
[raw pointer](raw-pointers.html):
|
||||||
|
|
||||||
* `*mut T` to `*const T`
|
* `*mut T` to `*const T`
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ References can also be coerced to raw pointers:
|
||||||
|
|
||||||
* `&mut T` to `*mut T`
|
* `&mut T` to `*mut T`
|
||||||
|
|
||||||
Custom coercions may be defined using [`Deref`](deref-coercions.md).
|
Custom coercions may be defined using [`Deref`](deref-coercions.html).
|
||||||
|
|
||||||
Coercion is transitive.
|
Coercion is transitive.
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ The semantics of numeric casts are:
|
||||||
|
|
||||||
## Pointer casts
|
## Pointer casts
|
||||||
|
|
||||||
Perhaps surprisingly, it is safe to cast [raw pointers](raw-pointers.md) to and
|
Perhaps surprisingly, it is safe to cast [raw pointers](raw-pointers.html) to and
|
||||||
from integers, and to cast between pointers to different types subject to
|
from integers, and to cast between pointers to different types subject to
|
||||||
some constraints. It is only unsafe to dereference the pointer:
|
some constraints. It is only unsafe to dereference the pointer:
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
# Chapter 1
|
|
@ -1,4 +1,4 @@
|
||||||
% Choosing your Guarantees
|
# Choosing your Guarantees
|
||||||
|
|
||||||
One important feature of Rust is that it lets us control the costs and guarantees
|
One important feature of Rust is that it lets us control the costs and guarantees
|
||||||
of a program.
|
of a program.
|
|
@ -1,4 +1,4 @@
|
||||||
% Closures
|
# Closures
|
||||||
|
|
||||||
Sometimes it is useful to wrap up a function and _free variables_ for better
|
Sometimes it is useful to wrap up a function and _free variables_ for better
|
||||||
clarity and reuse. The free variables that can be used come from the
|
clarity and reuse. The free variables that can be used come from the
|
||||||
|
@ -463,7 +463,7 @@ fn factory() -> &(Fn(i32) -> i32) {
|
||||||
|
|
||||||
Right. Because we have a reference, we need to give it a lifetime. But
|
Right. Because we have a reference, we need to give it a lifetime. But
|
||||||
our `factory()` function takes no arguments, so
|
our `factory()` function takes no arguments, so
|
||||||
[elision](lifetimes.html#lifetime-elision) doesn’t kick in here. Then what
|
[elision](lifetimes.html#Lifetime%20Elision) doesn’t kick in here. Then what
|
||||||
choices do we have? Try `'static`:
|
choices do we have? Try `'static`:
|
||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
|
@ -1,4 +1,4 @@
|
||||||
% Comments
|
# Comments
|
||||||
|
|
||||||
Now that we have some functions, it’s a good idea to learn about comments.
|
Now that we have some functions, it’s a good idea to learn about comments.
|
||||||
Comments are notes that you leave to other programmers to help explain things
|
Comments are notes that you leave to other programmers to help explain things
|
|
@ -1,6 +1,6 @@
|
||||||
% Compiler Plugins
|
# Compiler Plugins
|
||||||
|
|
||||||
# Introduction
|
## Introduction
|
||||||
|
|
||||||
`rustc` can load compiler plugins, which are user-provided libraries that
|
`rustc` can load compiler plugins, which are user-provided libraries that
|
||||||
extend the compiler's behavior with new syntax extensions, lint checks, etc.
|
extend the compiler's behavior with new syntax extensions, lint checks, etc.
|
||||||
|
@ -127,7 +127,7 @@ enum. For a more involved macro example, see
|
||||||
|
|
||||||
## Tips and tricks
|
## Tips and tricks
|
||||||
|
|
||||||
Some of the [macro debugging tips](macros.html#debugging-macro-code) are applicable.
|
Some of the [macro debugging tips](macros.html#Debugging%20macro%20code) are applicable.
|
||||||
|
|
||||||
You can use `syntax::parse` to turn token trees into
|
You can use `syntax::parse` to turn token trees into
|
||||||
higher-level syntax elements like expressions:
|
higher-level syntax elements like expressions:
|
|
@ -1,4 +1,4 @@
|
||||||
% Concurrency
|
# Concurrency
|
||||||
|
|
||||||
Concurrency and parallelism are incredibly important topics in computer
|
Concurrency and parallelism are incredibly important topics in computer
|
||||||
science, and are also a hot topic in industry today. Computers are gaining more
|
science, and are also a hot topic in industry today. Computers are gaining more
|
||||||
|
@ -55,7 +55,7 @@ For sharing references across threads, Rust provides a wrapper type called
|
||||||
`Arc<T>`. `Arc<T>` implements `Send` and `Sync` if and only if `T` implements
|
`Arc<T>`. `Arc<T>` implements `Send` and `Sync` if and only if `T` implements
|
||||||
both `Send` and `Sync`. For example, an object of type `Arc<RefCell<U>>` cannot
|
both `Send` and `Sync`. For example, an object of type `Arc<RefCell<U>>` cannot
|
||||||
be transferred across threads because
|
be transferred across threads because
|
||||||
[`RefCell`](choosing-your-guarantees.html#refcellt) does not implement
|
[`RefCell`](choosing-your-guarantees.html#RefCell%3CT%3E) does not implement
|
||||||
`Sync`, consequently `Arc<RefCell<U>>` would not implement `Send`.
|
`Sync`, consequently `Arc<RefCell<U>>` would not implement `Send`.
|
||||||
|
|
||||||
These two traits allow you to use the type system to make strong guarantees
|
These two traits allow you to use the type system to make strong guarantees
|
||||||
|
@ -126,7 +126,7 @@ closure only captures a _reference to `x`_. This is a problem, because the
|
||||||
thread may outlive the scope of `x`, leading to a dangling pointer.
|
thread may outlive the scope of `x`, leading to a dangling pointer.
|
||||||
|
|
||||||
To fix this, we use a `move` closure as mentioned in the error message. `move`
|
To fix this, we use a `move` closure as mentioned in the error message. `move`
|
||||||
closures are explained in depth [here](closures.html#move-closures); basically
|
closures are explained in depth [here](closures.html#move%20closures); basically
|
||||||
they move variables from their environment into themselves.
|
they move variables from their environment into themselves.
|
||||||
|
|
||||||
```rust
|
```rust
|
|
@ -1,4 +1,4 @@
|
||||||
% Conditional Compilation
|
# Conditional Compilation
|
||||||
|
|
||||||
Rust has a special attribute, `#[cfg]`, which allows you to compile code
|
Rust has a special attribute, `#[cfg]`, which allows you to compile code
|
||||||
based on a flag passed to the compiler. It has two forms:
|
based on a flag passed to the compiler. It has two forms:
|
|
@ -1,4 +1,4 @@
|
||||||
% const and static
|
# const and static
|
||||||
|
|
||||||
Rust has a way of defining constants with the `const` keyword:
|
Rust has a way of defining constants with the `const` keyword:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% Crates and Modules
|
# Crates and Modules
|
||||||
|
|
||||||
When a project starts getting large, it’s considered good software
|
When a project starts getting large, it’s considered good software
|
||||||
engineering practice to split it up into a bunch of smaller pieces, and then
|
engineering practice to split it up into a bunch of smaller pieces, and then
|
|
@ -1,4 +1,4 @@
|
||||||
% Custom Allocators
|
# Custom Allocators
|
||||||
|
|
||||||
Allocating memory isn't always the easiest thing to do, and while Rust generally
|
Allocating memory isn't always the easiest thing to do, and while Rust generally
|
||||||
takes care of this by default it often becomes necessary to customize how
|
takes care of this by default it often becomes necessary to customize how
|
|
@ -1,4 +1,4 @@
|
||||||
% `Deref` coercions
|
# `Deref` coercions
|
||||||
|
|
||||||
The standard library provides a special trait, [`Deref`][deref]. It’s normally
|
The standard library provides a special trait, [`Deref`][deref]. It’s normally
|
||||||
used to overload `*`, the dereference operator:
|
used to overload `*`, the dereference operator:
|
|
@ -1,4 +1,4 @@
|
||||||
% Documentation
|
# Documentation
|
||||||
|
|
||||||
Documentation is an important part of any software project, and it's
|
Documentation is an important part of any software project, and it's
|
||||||
first-class in Rust. Let's talk about the tooling Rust gives you to
|
first-class in Rust. Let's talk about the tooling Rust gives you to
|
|
@ -1,4 +1,4 @@
|
||||||
% Drop
|
# Drop
|
||||||
|
|
||||||
Now that we’ve discussed traits, let’s talk about a particular trait provided
|
Now that we’ve discussed traits, let’s talk about a particular trait provided
|
||||||
by the Rust standard library, [`Drop`][drop]. The `Drop` trait provides a way
|
by the Rust standard library, [`Drop`][drop]. The `Drop` trait provides a way
|
|
@ -1,4 +1,4 @@
|
||||||
% Effective Rust
|
# Effective Rust
|
||||||
|
|
||||||
So you’ve learned how to write some Rust code. But there’s a difference between
|
So you’ve learned how to write some Rust code. But there’s a difference between
|
||||||
writing *any* Rust code and writing *good* Rust code.
|
writing *any* Rust code and writing *good* Rust code.
|
|
@ -1,4 +1,4 @@
|
||||||
% Enums
|
# Enums
|
||||||
|
|
||||||
An `enum` in Rust is a type that represents data that is one of
|
An `enum` in Rust is a type that represents data that is one of
|
||||||
several possible variants. Each variant in the `enum` can optionally
|
several possible variants. Each variant in the `enum` can optionally
|
|
@ -1,4 +1,4 @@
|
||||||
% Error Handling
|
# Error Handling
|
||||||
|
|
||||||
Like most programming languages, Rust encourages the programmer to handle
|
Like most programming languages, Rust encourages the programmer to handle
|
||||||
errors in a particular way. Generally speaking, error handling is divided into
|
errors in a particular way. Generally speaking, error handling is divided into
|
||||||
|
@ -21,35 +21,35 @@ sum types and combinators, and try to motivate the way Rust does error handling
|
||||||
incrementally. As such, programmers with experience in other expressive type
|
incrementally. As such, programmers with experience in other expressive type
|
||||||
systems may want to jump around.
|
systems may want to jump around.
|
||||||
|
|
||||||
* [The Basics](#the-basics)
|
* [The Basics](#The%20Basics)
|
||||||
* [Unwrapping explained](#unwrapping-explained)
|
* [Unwrapping explained](#Unwrapping%20explained)
|
||||||
* [The `Option` type](#the-option-type)
|
* [The `Option` type](#The%20Option%20type)
|
||||||
* [Composing `Option<T>` values](#composing-optiont-values)
|
* [Composing `Option<T>` values](#Composing%20Option%3CT%3E%20values)
|
||||||
* [The `Result` type](#the-result-type)
|
* [The `Result` type](#The%20Result%20type)
|
||||||
* [Parsing integers](#parsing-integers)
|
* [Parsing integers](#Parsing%20integers)
|
||||||
* [The `Result` type alias idiom](#the-result-type-alias-idiom)
|
* [The `Result` type alias idiom](#The%20Result%20type%20alias%20idiom)
|
||||||
* [A brief interlude: unwrapping isn't evil](#a-brief-interlude-unwrapping-isnt-evil)
|
* [A brief interlude: unwrapping isn't evil](#A%20brief%20interlude:%20unwrapping%20isnt%20evil)
|
||||||
* [Working with multiple error types](#working-with-multiple-error-types)
|
* [Working with multiple error types](#Working%20with%20multiple%20error%20types)
|
||||||
* [Composing `Option` and `Result`](#composing-option-and-result)
|
* [Composing `Option` and `Result`](#Composing%20Option%20and%20Result)
|
||||||
* [The limits of combinators](#the-limits-of-combinators)
|
* [The limits of combinators](#The%20limits%20of%20combinators)
|
||||||
* [Early returns](#early-returns)
|
* [Early returns](#Early%20returns)
|
||||||
* [The `try!` macro](#the-try-macro)
|
* [The `try!` macro](#The%20try%20macro)
|
||||||
* [Defining your own error type](#defining-your-own-error-type)
|
* [Defining your own error type](#Defining%20your%20own%20error%20type)
|
||||||
* [Standard library traits used for error handling](#standard-library-traits-used-for-error-handling)
|
* [Standard library traits used for error handling](#Standard%20library%20traits%20used%20for%20error%20handling)
|
||||||
* [The `Error` trait](#the-error-trait)
|
* [The `Error` trait](#The%20Error%20trait)
|
||||||
* [The `From` trait](#the-from-trait)
|
* [The `From` trait](#The%20From%20trait)
|
||||||
* [The real `try!` macro](#the-real-try-macro)
|
* [The real `try!` macro](#The%20real%20try%20macro)
|
||||||
* [Composing custom error types](#composing-custom-error-types)
|
* [Composing custom error types](#Composing%20custom%20error%20types)
|
||||||
* [Advice for library writers](#advice-for-library-writers)
|
* [Advice for library writers](#Advice%20for%20library%20writers)
|
||||||
* [Case study: A program to read population data](#case-study-a-program-to-read-population-data)
|
* [Case study: A program to read population data](#Case%20study:%20A%20program%20to%20read%20population%20data)
|
||||||
* [Initial setup](#initial-setup)
|
* [Initial setup](#Initial%20setup)
|
||||||
* [Argument parsing](#argument-parsing)
|
* [Argument parsing](#Argument%20parsing)
|
||||||
* [Writing the logic](#writing-the-logic)
|
* [Writing the logic](#Writing%20the%20logic)
|
||||||
* [Error handling with `Box<Error>`](#error-handling-with-boxerror)
|
* [Error handling with `Box<Error>`](#Error%20handling%20with%20Box%3CError%3E)
|
||||||
* [Reading from stdin](#reading-from-stdin)
|
* [Reading from stdin](#Reading%20from%20stdin)
|
||||||
* [Error handling with a custom type](#error-handling-with-a-custom-type)
|
* [Error handling with a custom type](#Error%20handling%20with%20a%20custom%20type)
|
||||||
* [Adding functionality](#adding-functionality)
|
* [Adding functionality](#Adding%20functionality)
|
||||||
* [The short story](#the-short-story)
|
* [The short story](#The%20short%20story)
|
||||||
|
|
||||||
# The Basics
|
# The Basics
|
||||||
|
|
||||||
|
@ -796,7 +796,7 @@ because of the return types of
|
||||||
[`std::fs::File::open`](../std/fs/struct.File.html#method.open) and
|
[`std::fs::File::open`](../std/fs/struct.File.html#method.open) and
|
||||||
[`std::io::Read::read_to_string`](../std/io/trait.Read.html#method.read_to_string).
|
[`std::io::Read::read_to_string`](../std/io/trait.Read.html#method.read_to_string).
|
||||||
(Note that they both use the [`Result` type alias
|
(Note that they both use the [`Result` type alias
|
||||||
idiom](#the-result-type-alias-idiom) described previously. If you
|
idiom](#The%20Result%20type%20alias%20idiom) described previously. If you
|
||||||
click on the `Result` type, you'll [see the type
|
click on the `Result` type, you'll [see the type
|
||||||
alias](../std/io/type.Result.html), and consequently, the underlying
|
alias](../std/io/type.Result.html), and consequently, the underlying
|
||||||
`io::Error` type.) The third problem is described by the
|
`io::Error` type.) The third problem is described by the
|
||||||
|
@ -1120,7 +1120,7 @@ returns an `&Error`, which is itself a trait object. We'll revisit the
|
||||||
|
|
||||||
For now, it suffices to show an example implementing the `Error` trait. Let's
|
For now, it suffices to show an example implementing the `Error` trait. Let's
|
||||||
use the error type we defined in the
|
use the error type we defined in the
|
||||||
[previous section](#defining-your-own-error-type):
|
[previous section](#Defining%20your%20own%20error%20type):
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use std::io;
|
use std::io;
|
||||||
|
@ -1493,19 +1493,19 @@ representation. But certainly, this will vary depending on use cases.
|
||||||
At a minimum, you should probably implement the
|
At a minimum, you should probably implement the
|
||||||
[`Error`](../std/error/trait.Error.html)
|
[`Error`](../std/error/trait.Error.html)
|
||||||
trait. This will give users of your library some minimum flexibility for
|
trait. This will give users of your library some minimum flexibility for
|
||||||
[composing errors](#the-real-try-macro). Implementing the `Error` trait also
|
[composing errors](#The%20real%20try%20macro). Implementing the `Error` trait also
|
||||||
means that users are guaranteed the ability to obtain a string representation
|
means that users are guaranteed the ability to obtain a string representation
|
||||||
of an error (because it requires impls for both `fmt::Debug` and
|
of an error (because it requires impls for both `fmt::Debug` and
|
||||||
`fmt::Display`).
|
`fmt::Display`).
|
||||||
|
|
||||||
Beyond that, it can also be useful to provide implementations of `From` on your
|
Beyond that, it can also be useful to provide implementations of `From` on your
|
||||||
error types. This allows you (the library author) and your users to
|
error types. This allows you (the library author) and your users to
|
||||||
[compose more detailed errors](#composing-custom-error-types). For example,
|
[compose more detailed errors](#Composing%20custom%20error%20types). For example,
|
||||||
[`csv::Error`](http://burntsushi.net/rustdoc/csv/enum.Error.html)
|
[`csv::Error`](http://burntsushi.net/rustdoc/csv/enum.Error.html)
|
||||||
provides `From` impls for both `io::Error` and `byteorder::Error`.
|
provides `From` impls for both `io::Error` and `byteorder::Error`.
|
||||||
|
|
||||||
Finally, depending on your tastes, you may also want to define a
|
Finally, depending on your tastes, you may also want to define a
|
||||||
[`Result` type alias](#the-result-type-alias-idiom), particularly if your
|
[`Result` type alias](#The%20Result%20type%20alias%20idiom), particularly if your
|
||||||
library defines a single error type. This is used in the standard library
|
library defines a single error type. This is used in the standard library
|
||||||
for [`io::Result`](../std/io/type.Result.html)
|
for [`io::Result`](../std/io/type.Result.html)
|
||||||
and [`fmt::Result`](../std/fmt/type.Result.html).
|
and [`fmt::Result`](../std/fmt/type.Result.html).
|
||||||
|
@ -1538,7 +1538,7 @@ and [`rustc-serialize`](https://crates.io/crates/rustc-serialize) crates.
|
||||||
|
|
||||||
We're not going to spend a lot of time on setting up a project with
|
We're not going to spend a lot of time on setting up a project with
|
||||||
Cargo because it is already covered well in [the Cargo
|
Cargo because it is already covered well in [the Cargo
|
||||||
section](getting-started.html#hello-cargo) and [Cargo's documentation][14].
|
section](getting-started.html#Hello%20Cargo) and [Cargo's documentation][14].
|
||||||
|
|
||||||
To get started from scratch, run `cargo new --bin city-pop` and make sure your
|
To get started from scratch, run `cargo new --bin city-pop` and make sure your
|
||||||
`Cargo.toml` looks something like this:
|
`Cargo.toml` looks something like this:
|
||||||
|
@ -1729,7 +1729,7 @@ error types and you don't need any `From` implementations. The downside is that
|
||||||
since `Box<Error>` is a trait object, it *erases the type*, which means the
|
since `Box<Error>` is a trait object, it *erases the type*, which means the
|
||||||
compiler can no longer reason about its underlying type.
|
compiler can no longer reason about its underlying type.
|
||||||
|
|
||||||
[Previously](#the-limits-of-combinators) we started refactoring our code by
|
[Previously](#The%20limits%20of%20combinators) we started refactoring our code by
|
||||||
changing the type of our function from `T` to `Result<T, OurErrorType>`. In
|
changing the type of our function from `T` to `Result<T, OurErrorType>`. In
|
||||||
this case, `OurErrorType` is only `Box<Error>`. But what's `T`? And can we add
|
this case, `OurErrorType` is only `Box<Error>`. But what's `T`? And can we add
|
||||||
a return type to `main`?
|
a return type to `main`?
|
|
@ -1,4 +1,4 @@
|
||||||
% Foreign Function Interface
|
# Foreign Function Interface
|
||||||
|
|
||||||
# Introduction
|
# Introduction
|
||||||
|
|
||||||
|
@ -680,7 +680,7 @@ pub extern fn hello_rust() -> *const u8 {
|
||||||
|
|
||||||
The `extern` makes this function adhere to the C calling convention, as
|
The `extern` makes this function adhere to the C calling convention, as
|
||||||
discussed above in "[Foreign Calling
|
discussed above in "[Foreign Calling
|
||||||
Conventions](ffi.html#foreign-calling-conventions)". The `no_mangle`
|
Conventions](ffi.html#Foreign%20calling%20conventions)". The `no_mangle`
|
||||||
attribute turns off Rust's name mangling, so that it is easier to link to.
|
attribute turns off Rust's name mangling, so that it is easier to link to.
|
||||||
|
|
||||||
# FFI and panics
|
# FFI and panics
|
|
@ -1,4 +1,4 @@
|
||||||
% Functions
|
# Functions
|
||||||
|
|
||||||
Every Rust program has at least one function, the `main` function:
|
Every Rust program has at least one function, the `main` function:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% Generics
|
# Generics
|
||||||
|
|
||||||
Sometimes, when writing a function or data type, we may want it to work for
|
Sometimes, when writing a function or data type, we may want it to work for
|
||||||
multiple types of arguments. In Rust, we can do this with generics.
|
multiple types of arguments. In Rust, we can do this with generics.
|
|
@ -1,4 +1,4 @@
|
||||||
% Getting Started
|
# Getting Started
|
||||||
|
|
||||||
This first chapter of the book will get us going with Rust and its tooling.
|
This first chapter of the book will get us going with Rust and its tooling.
|
||||||
First, we’ll install Rust. Then, the classic ‘Hello World’ program. Finally,
|
First, we’ll install Rust. Then, the classic ‘Hello World’ program. Finally,
|
||||||
|
@ -236,7 +236,7 @@ language]*, which means that most things are expressions, rather than
|
||||||
statements. The `;` indicates that this expression is over, and the next one is
|
statements. The `;` indicates that this expression is over, and the next one is
|
||||||
ready to begin. Most lines of Rust code end with a `;`.
|
ready to begin. Most lines of Rust code end with a `;`.
|
||||||
|
|
||||||
[expression-oriented language]: glossary.html#expression-oriented-language
|
[expression-oriented language]: glossary.html#Expression-Oriented%20Language
|
||||||
|
|
||||||
## Compiling and Running Are Separate Steps
|
## Compiling and Running Are Separate Steps
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% Glossary
|
# Glossary
|
||||||
|
|
||||||
Not every Rustacean has a background in systems programming, nor in computer
|
Not every Rustacean has a background in systems programming, nor in computer
|
||||||
science, so we've added explanations of terms that might be unfamiliar.
|
science, so we've added explanations of terms that might be unfamiliar.
|
||||||
|
@ -56,7 +56,7 @@ They can be used to manage control flow in a modular fashion.
|
||||||
|
|
||||||
A type without a statically known size or alignment. ([more info][link])
|
A type without a statically known size or alignment. ([more info][link])
|
||||||
|
|
||||||
[link]: ../nomicon/exotic-sizes.html#dynamically-sized-types-dsts
|
[link]: ../nomicon/exotic-sizes.html#Dynamically%20Sized%20Types%20(DSTs)
|
||||||
|
|
||||||
### Expression
|
### Expression
|
||||||
|
|
||||||
|
@ -76,8 +76,8 @@ In an expression-oriented language, (nearly) every statement is an expression
|
||||||
and therefore returns a value. Consequently, these expression statements can
|
and therefore returns a value. Consequently, these expression statements can
|
||||||
themselves form part of larger expressions.
|
themselves form part of larger expressions.
|
||||||
|
|
||||||
[expression]: glossary.html#expression
|
[expression]: glossary.html#Expression
|
||||||
[statement]: glossary.html#statement
|
[statement]: glossary.html#Statement
|
||||||
|
|
||||||
### Statement
|
### Statement
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% Guessing Game
|
# Guessing Game
|
||||||
|
|
||||||
Let’s learn some Rust! For our first project, we’ll implement a classic
|
Let’s learn some Rust! For our first project, we’ll implement a classic
|
||||||
beginner programming problem: the guessing game. Here’s how it works: Our
|
beginner programming problem: the guessing game. Here’s how it works: Our
|
||||||
|
@ -119,7 +119,7 @@ there are no arguments, and `{` starts the body of the function. Because
|
||||||
we didn’t include a return type, it’s assumed to be `()`, an empty
|
we didn’t include a return type, it’s assumed to be `()`, an empty
|
||||||
[tuple][tuples].
|
[tuple][tuples].
|
||||||
|
|
||||||
[tuples]: primitive-types.html#tuples
|
[tuples]: primitive-types.html#Tuples
|
||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
println!("Guess the number!");
|
println!("Guess the number!");
|
||||||
|
@ -727,7 +727,7 @@ thirty-two bit integer. Rust has [a number of built-in number types][number],
|
||||||
but we’ve chosen `u32`. It’s a good default choice for a small positive number.
|
but we’ve chosen `u32`. It’s a good default choice for a small positive number.
|
||||||
|
|
||||||
[parse]: ../std/primitive.str.html#method.parse
|
[parse]: ../std/primitive.str.html#method.parse
|
||||||
[number]: primitive-types.html#numeric-types
|
[number]: primitive-types.html#Numeric%20types
|
||||||
|
|
||||||
Just like `read_line()`, our call to `parse()` could cause an error. What if
|
Just like `read_line()`, our call to `parse()` could cause an error. What if
|
||||||
our string contained `A👍%`? There’d be no way to convert that to a number. As
|
our string contained `A👍%`? There’d be no way to convert that to a number. As
|
|
@ -1,4 +1,4 @@
|
||||||
% if let
|
# if let
|
||||||
|
|
||||||
`if let` permits [patterns][pattern] matching within the condition of an [if][if] statement.
|
`if let` permits [patterns][pattern] matching within the condition of an [if][if] statement.
|
||||||
This allows us to reduce the overhead of certain kinds of [pattern][patterns] matches
|
This allows us to reduce the overhead of certain kinds of [pattern][patterns] matches
|
|
@ -1,4 +1,4 @@
|
||||||
% if
|
# if
|
||||||
|
|
||||||
Rust’s take on `if` is not particularly complex, but it’s much more like the
|
Rust’s take on `if` is not particularly complex, but it’s much more like the
|
||||||
`if` you’ll find in a dynamically typed language than in a more traditional
|
`if` you’ll find in a dynamically typed language than in a more traditional
|
|
@ -1,4 +1,4 @@
|
||||||
% Inline Assembly
|
# Inline Assembly
|
||||||
|
|
||||||
For extremely low-level manipulations and performance reasons, one
|
For extremely low-level manipulations and performance reasons, one
|
||||||
might wish to control the CPU directly. Rust supports using inline
|
might wish to control the CPU directly. Rust supports using inline
|
|
@ -1,4 +1,4 @@
|
||||||
% Intrinsics
|
# Intrinsics
|
||||||
|
|
||||||
> **Note**: intrinsics will forever have an unstable interface, it is
|
> **Note**: intrinsics will forever have an unstable interface, it is
|
||||||
> recommended to use the stable interfaces of libcore rather than intrinsics
|
> recommended to use the stable interfaces of libcore rather than intrinsics
|
|
@ -1,4 +1,4 @@
|
||||||
% Iterators
|
# Iterators
|
||||||
|
|
||||||
Let's talk about loops.
|
Let's talk about loops.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% Lang items
|
# Lang items
|
||||||
|
|
||||||
> **Note**: lang items are often provided by crates in the Rust distribution,
|
> **Note**: lang items are often provided by crates in the Rust distribution,
|
||||||
> and lang items themselves have an unstable interface. It is recommended to use
|
> and lang items themselves have an unstable interface. It is recommended to use
|
|
@ -1,4 +1,4 @@
|
||||||
% Lifetimes
|
# Lifetimes
|
||||||
|
|
||||||
This is the last of three sections presenting Rust’s ownership system. This is one of
|
This is the last of three sections presenting Rust’s ownership system. This is one of
|
||||||
Rust’s most distinct and compelling features, with which Rust developers should
|
Rust’s most distinct and compelling features, with which Rust developers should
|
||||||
|
@ -139,7 +139,7 @@ associated with it, but the compiler lets you elide (i.e. omit, see
|
||||||
["Lifetime Elision"][lifetime-elision] below) them in common cases. Before we
|
["Lifetime Elision"][lifetime-elision] below) them in common cases. Before we
|
||||||
get to that, though, let’s look at a short example with explicit lifetimes:
|
get to that, though, let’s look at a short example with explicit lifetimes:
|
||||||
|
|
||||||
[lifetime-elision]: #lifetime-elision
|
[lifetime-elision]: #Lifetime%20Elision
|
||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
fn bar<'a>(...)
|
fn bar<'a>(...)
|
|
@ -1,4 +1,4 @@
|
||||||
% Loops
|
# Loops
|
||||||
|
|
||||||
Rust currently provides three approaches to performing some kind of iterative activity. They are: `loop`, `while` and `for`. Each approach has its own set of uses.
|
Rust currently provides three approaches to performing some kind of iterative activity. They are: `loop`, `while` and `for`. Each approach has its own set of uses.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% Macros
|
# Macros
|
||||||
|
|
||||||
By now you’ve learned about many of the tools Rust provides for abstracting and
|
By now you’ve learned about many of the tools Rust provides for abstracting and
|
||||||
reusing code. These units of code reuse have a rich semantic structure. For
|
reusing code. These units of code reuse have a rich semantic structure. For
|
||||||
|
@ -432,7 +432,7 @@ Even when Rust code contains un-expanded macros, it can be parsed as a full
|
||||||
tools that process code. It also has a few consequences for the design of
|
tools that process code. It also has a few consequences for the design of
|
||||||
Rust’s macro system.
|
Rust’s macro system.
|
||||||
|
|
||||||
[ast]: glossary.html#abstract-syntax-tree
|
[ast]: glossary.html#Abstract%20Syntax%20Tree
|
||||||
|
|
||||||
One consequence is that Rust must determine, when it parses a macro invocation,
|
One consequence is that Rust must determine, when it parses a macro invocation,
|
||||||
whether the macro stands in for
|
whether the macro stands in for
|
|
@ -1,4 +1,4 @@
|
||||||
% Match
|
# Match
|
||||||
|
|
||||||
Often, a simple [`if`][if]/`else` isn’t enough, because you have more than two
|
Often, a simple [`if`][if]/`else` isn’t enough, because you have more than two
|
||||||
possible options. Also, conditions can get quite complex. Rust
|
possible options. Also, conditions can get quite complex. Rust
|
|
@ -1,4 +1,4 @@
|
||||||
% Method Syntax
|
# Method Syntax
|
||||||
|
|
||||||
Functions are great, but if you want to call a bunch of them on some data, it
|
Functions are great, but if you want to call a bunch of them on some data, it
|
||||||
can be awkward. Consider this code:
|
can be awkward. Consider this code:
|
|
@ -1,4 +1,4 @@
|
||||||
% Mutability
|
# Mutability
|
||||||
|
|
||||||
Mutability, the ability to change something, works a bit differently in Rust
|
Mutability, the ability to change something, works a bit differently in Rust
|
||||||
than in other languages. The first aspect of mutability is its non-default
|
than in other languages. The first aspect of mutability is its non-default
|
||||||
|
@ -89,7 +89,7 @@ philosophy, memory safety, and the mechanism by which Rust guarantees it, the
|
||||||
> * exactly one mutable reference (`&mut T`).
|
> * exactly one mutable reference (`&mut T`).
|
||||||
|
|
||||||
[ownership]: ownership.html
|
[ownership]: ownership.html
|
||||||
[borrowing]: references-and-borrowing.html#borrowing
|
[borrowing]: references-and-borrowing.html#Borrowing
|
||||||
|
|
||||||
So, that’s the real definition of ‘immutability’: is this safe to have two
|
So, that’s the real definition of ‘immutability’: is this safe to have two
|
||||||
pointers to? In `Arc<T>`’s case, yes: the mutation is entirely contained inside
|
pointers to? In `Arc<T>`’s case, yes: the mutation is entirely contained inside
|
|
@ -1,8 +1,8 @@
|
||||||
% Nightly Rust
|
# Nightly Rust
|
||||||
|
|
||||||
Rust provides three distribution channels for Rust: nightly, beta, and stable.
|
Rust provides three distribution channels for Rust: nightly, beta, and stable.
|
||||||
Unstable features are only available on nightly Rust. For more details on this
|
Unstable features are only available on nightly Rust. For more details on this
|
||||||
process, see ‘[Stability as a deliverable][stability]’.
|
process, see [Stability as a deliverable][stability].
|
||||||
|
|
||||||
[stability]: http://blog.rust-lang.org/2014/10/30/Stability.html
|
[stability]: http://blog.rust-lang.org/2014/10/30/Stability.html
|
||||||
|
|
||||||
|
@ -91,9 +91,10 @@ If not, there are a number of places where you can get help. The easiest is
|
||||||
[the #rust IRC channel on irc.mozilla.org][irc], which you can access through
|
[the #rust IRC channel on irc.mozilla.org][irc], which you can access through
|
||||||
[Mibbit][mibbit]. Click that link, and you'll be chatting with other Rustaceans
|
[Mibbit][mibbit]. Click that link, and you'll be chatting with other Rustaceans
|
||||||
(a silly nickname we call ourselves), and we can help you out. Other great
|
(a silly nickname we call ourselves), and we can help you out. Other great
|
||||||
resources include [the user’s forum][users], and [Stack Overflow][stackoverflow].
|
resources include [the users forum][users], and [Stack Overflow][stackoverflow].
|
||||||
|
|
||||||
[irc]: irc://irc.mozilla.org/#rust
|
[irc]: irc://irc.mozilla.org/#rust
|
||||||
[mibbit]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
|
[mibbit]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
|
||||||
[users]: https://users.rust-lang.org/
|
[users]: https://users.rust-lang.org/
|
||||||
[stackoverflow]: http://stackoverflow.com/questions/tagged/rust
|
[stackoverflow]: http://stackoverflow.com/questions/tagged/rust
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% No stdlib
|
# No stdlib
|
||||||
|
|
||||||
Rust’s standard library provides a lot of useful functionality, but assumes
|
Rust’s standard library provides a lot of useful functionality, but assumes
|
||||||
support for various features of its host system: threads, networking, heap
|
support for various features of its host system: threads, networking, heap
|
|
@ -1,4 +1,4 @@
|
||||||
% Operators and Overloading
|
# Operators and Overloading
|
||||||
|
|
||||||
Rust allows for a limited form of operator overloading. There are certain
|
Rust allows for a limited form of operator overloading. There are certain
|
||||||
operators that are able to be overloaded. To support a particular operator
|
operators that are able to be overloaded. To support a particular operator
|
|
@ -1,4 +1,4 @@
|
||||||
% Ownership
|
# Ownership
|
||||||
|
|
||||||
This is the first of three sections presenting Rust’s ownership system. This is one of
|
This is the first of three sections presenting Rust’s ownership system. This is one of
|
||||||
Rust’s most distinct and compelling features, with which Rust developers should
|
Rust’s most distinct and compelling features, with which Rust developers should
|
||||||
|
@ -65,10 +65,10 @@ elements onto them.
|
||||||
Vectors have a [generic type][generics] `Vec<T>`, so in this example `v` will have type
|
Vectors have a [generic type][generics] `Vec<T>`, so in this example `v` will have type
|
||||||
`Vec<i32>`. We'll cover [generics] in detail in a later chapter.
|
`Vec<i32>`. We'll cover [generics] in detail in a later chapter.
|
||||||
|
|
||||||
[arrays]: primitive-types.html#arrays
|
[arrays]: primitive-types.html#Arrays
|
||||||
[vectors]: vectors.html
|
[vectors]: vectors.html
|
||||||
[heap]: the-stack-and-the-heap.html#the-heap
|
[heap]: the-stack-and-the-heap.html#The%20Heap
|
||||||
[stack]: the-stack-and-the-heap.html#the-stack
|
[stack]: the-stack-and-the-heap.html#The%20Stack
|
||||||
[bindings]: variable-bindings.html
|
[bindings]: variable-bindings.html
|
||||||
[generics]: generics.html
|
[generics]: generics.html
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ Rust allocates memory for an integer [i32] on the [stack][sh], copies the bit
|
||||||
pattern representing the value of 10 to the allocated memory and binds the
|
pattern representing the value of 10 to the allocated memory and binds the
|
||||||
variable name x to this memory region for future reference.
|
variable name x to this memory region for future reference.
|
||||||
|
|
||||||
[i32]: primitive-types.html#numeric-types
|
[i32]: primitive-types.html#Numeric%20types
|
||||||
|
|
||||||
Now consider the following code fragment:
|
Now consider the following code fragment:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% Patterns
|
# Patterns
|
||||||
|
|
||||||
Patterns are quite common in Rust. We use them in [variable
|
Patterns are quite common in Rust. We use them in [variable
|
||||||
bindings][bindings], [match expressions][match], and other places, too. Let’s go
|
bindings][bindings], [match expressions][match], and other places, too. Let’s go
|
|
@ -1,4 +1,4 @@
|
||||||
% Primitive Types
|
# Primitive Types
|
||||||
|
|
||||||
The Rust language has a number of types that are considered ‘primitive’. This
|
The Rust language has a number of types that are considered ‘primitive’. This
|
||||||
means that they’re built-in to the language. Rust is structured in such a way
|
means that they’re built-in to the language. Rust is structured in such a way
|
||||||
|
@ -232,7 +232,7 @@ soon.
|
||||||
You can assign one tuple into another, if they have the same contained types
|
You can assign one tuple into another, if they have the same contained types
|
||||||
and [arity]. Tuples have the same arity when they have the same length.
|
and [arity]. Tuples have the same arity when they have the same length.
|
||||||
|
|
||||||
[arity]: glossary.html#arity
|
[arity]: glossary.html#Arity
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
let mut x = (1, 2); // x: (i32, i32)
|
let mut x = (1, 2); // x: (i32, i32)
|
|
@ -1,4 +1,4 @@
|
||||||
% Procedural Macros (and custom Derive)
|
# Procedural Macros (and custom Derive)
|
||||||
|
|
||||||
As you've seen throughout the rest of the book, Rust provides a mechanism
|
As you've seen throughout the rest of the book, Rust provides a mechanism
|
||||||
called "derive" that lets you implement traits easily. For example,
|
called "derive" that lets you implement traits easily. For example,
|
|
@ -1,4 +1,4 @@
|
||||||
% Raw Pointers
|
# Raw Pointers
|
||||||
|
|
||||||
Rust has a number of different smart pointer types in its standard library, but
|
Rust has a number of different smart pointer types in its standard library, but
|
||||||
there are two types that are extra-special. Much of Rust’s safety comes from
|
there are two types that are extra-special. Much of Rust’s safety comes from
|
|
@ -1,4 +1,4 @@
|
||||||
% References and Borrowing
|
# References and Borrowing
|
||||||
|
|
||||||
This is the second of three sections presenting Rust’s ownership system. This is one of
|
This is the second of three sections presenting Rust’s ownership system. This is one of
|
||||||
Rust’s most distinct and compelling features, with which Rust developers should
|
Rust’s most distinct and compelling features, with which Rust developers should
|
|
@ -1,4 +1,4 @@
|
||||||
% Release Channels
|
# Release Channels
|
||||||
|
|
||||||
The Rust project uses a concept called ‘release channels’ to manage releases.
|
The Rust project uses a concept called ‘release channels’ to manage releases.
|
||||||
It’s important to understand this process to choose which version of Rust
|
It’s important to understand this process to choose which version of Rust
|
|
@ -1,4 +1,4 @@
|
||||||
% Slice patterns
|
# Slice patterns
|
||||||
|
|
||||||
If you want to match against a slice or array, you can use `&` with the
|
If you want to match against a slice or array, you can use `&` with the
|
||||||
`slice_patterns` feature:
|
`slice_patterns` feature:
|
|
@ -1,4 +1,4 @@
|
||||||
% Strings
|
# Strings
|
||||||
|
|
||||||
Strings are an important concept for any programmer to master. Rust’s string
|
Strings are an important concept for any programmer to master. Rust’s string
|
||||||
handling system is a bit different from other languages, due to its systems
|
handling system is a bit different from other languages, due to its systems
|
|
@ -1,4 +1,4 @@
|
||||||
% Structs
|
# Structs
|
||||||
|
|
||||||
`struct`s are a way of creating more complex data types. For example, if we were
|
`struct`s are a way of creating more complex data types. For example, if we were
|
||||||
doing calculations involving coordinates in 2D space, we would need both an `x`
|
doing calculations involving coordinates in 2D space, we would need both an `x`
|
|
@ -1,4 +1,4 @@
|
||||||
% Syntax and Semantics
|
# Syntax and Semantics
|
||||||
|
|
||||||
This chapter breaks Rust down into small chunks, one for each concept.
|
This chapter breaks Rust down into small chunks, one for each concept.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% Syntax Index
|
# Syntax Index
|
||||||
|
|
||||||
## Keywords
|
## Keywords
|
||||||
|
|
||||||
|
@ -196,18 +196,18 @@
|
||||||
[Associated Types]: associated-types.html
|
[Associated Types]: associated-types.html
|
||||||
[Attributes]: attributes.html
|
[Attributes]: attributes.html
|
||||||
[Casting Between Types (`as`)]: casting-between-types.html#as
|
[Casting Between Types (`as`)]: casting-between-types.html#as
|
||||||
[Closures (`move` closures)]: closures.html#move-closures
|
[Closures (`move` closures)]: closures.html#move%20closures
|
||||||
[Closures]: closures.html
|
[Closures]: closures.html
|
||||||
[Comments]: comments.html
|
[Comments]: comments.html
|
||||||
[Crates and Modules (Defining Modules)]: crates-and-modules.html#defining-modules
|
[Crates and Modules (Defining Modules)]: crates-and-modules.html#Defining%20modules
|
||||||
[Crates and Modules (Exporting a Public Interface)]: crates-and-modules.html#exporting-a-public-interface
|
[Crates and Modules (Exporting a Public Interface)]: crates-and-modules.html#Exporting%20a%20public%20interface
|
||||||
[Crates and Modules (Importing External Crates)]: crates-and-modules.html#importing-external-crates
|
[Crates and Modules (Importing External Crates)]: crates-and-modules.html#Importing%20external%20crates
|
||||||
[Crates and Modules (Importing Modules with `use`)]: crates-and-modules.html#importing-modules-with-use
|
[Crates and Modules (Importing Modules with `use`)]: crates-and-modules.html#Importing%20modules%20with%20use
|
||||||
[Crates and Modules (Re-exporting with `pub use`)]: crates-and-modules.html#re-exporting-with-pub-use
|
[Crates and Modules (Re-exporting with `pub use`)]: crates-and-modules.html#Re-exporting%20with%20pub%20use
|
||||||
[Diverging Functions]: functions.html#diverging-functions
|
[Diverging Functions]: functions.html#Diverging%20functions
|
||||||
[Enums]: enums.html
|
[Enums]: enums.html
|
||||||
[Foreign Function Interface]: ffi.html
|
[Foreign Function Interface]: ffi.html
|
||||||
[Functions (Early Returns)]: functions.html#early-returns
|
[Functions (Early Returns)]: functions.html#Early%20returns
|
||||||
[Functions]: functions.html
|
[Functions]: functions.html
|
||||||
[Generics]: generics.html
|
[Generics]: generics.html
|
||||||
[Iterators]: iterators.html
|
[Iterators]: iterators.html
|
||||||
|
@ -216,24 +216,24 @@
|
||||||
[Loops (`for`)]: loops.html#for
|
[Loops (`for`)]: loops.html#for
|
||||||
[Loops (`loop`)]: loops.html#loop
|
[Loops (`loop`)]: loops.html#loop
|
||||||
[Loops (`while`)]: loops.html#while
|
[Loops (`while`)]: loops.html#while
|
||||||
[Loops (Ending Iteration Early)]: loops.html#ending-iteration-early
|
[Loops (Ending Iteration Early)]: loops.html#Ending%20iteration%20early
|
||||||
[Loops (Loops Labels)]: loops.html#loop-labels
|
[Loops (Loops Labels)]: loops.html#Loop%20labels
|
||||||
[Macros]: macros.html
|
[Macros]: macros.html
|
||||||
[Match]: match.html
|
[Match]: match.html
|
||||||
[Method Syntax (Method Calls)]: method-syntax.html#method-calls
|
[Method Syntax (Method Calls)]: method-syntax.html#Method%20calls
|
||||||
[Method Syntax]: method-syntax.html
|
[Method Syntax]: method-syntax.html
|
||||||
[Mutability]: mutability.html
|
[Mutability]: mutability.html
|
||||||
[Operators and Overloading]: operators-and-overloading.html
|
[Operators and Overloading]: operators-and-overloading.html
|
||||||
[Patterns (`ref` and `ref mut`)]: patterns.html#ref-and-ref-mut
|
[Patterns (`ref` and `ref mut`)]: patterns.html#ref%20and%20ref%20mut
|
||||||
[Patterns (Bindings)]: patterns.html#bindings
|
[Patterns (Bindings)]: patterns.html#Bindings
|
||||||
[Patterns (Ignoring bindings)]: patterns.html#ignoring-bindings
|
[Patterns (Ignoring bindings)]: patterns.html#Ignoring%20bindings
|
||||||
[Patterns (Multiple patterns)]: patterns.html#multiple-patterns
|
[Patterns (Multiple patterns)]: patterns.html#Multiple%20patterns
|
||||||
[Patterns (Ranges)]: patterns.html#ranges
|
[Patterns (Ranges)]: patterns.html#Ranges
|
||||||
[Primitive Types (`char`)]: primitive-types.html#char
|
[Primitive Types (`char`)]: primitive-types.html#char
|
||||||
[Primitive Types (Arrays)]: primitive-types.html#arrays
|
[Primitive Types (Arrays)]: primitive-types.html#Arrays
|
||||||
[Primitive Types (Booleans)]: primitive-types.html#booleans
|
[Primitive Types (Booleans)]: primitive-types.html#Booleans
|
||||||
[Primitive Types (Tuple Indexing)]: primitive-types.html#tuple-indexing
|
[Primitive Types (Tuple Indexing)]: primitive-types.html#Tuple%20indexing
|
||||||
[Primitive Types (Tuples)]: primitive-types.html#tuples
|
[Primitive Types (Tuples)]: primitive-types.html#Tuples
|
||||||
[Raw Pointers]: raw-pointers.html
|
[Raw Pointers]: raw-pointers.html
|
||||||
[Reference (Byte String Literals)]: ../reference.html#byte-string-literals
|
[Reference (Byte String Literals)]: ../reference.html#byte-string-literals
|
||||||
[Reference (Integer literals)]: ../reference.html#integer-literals
|
[Reference (Integer literals)]: ../reference.html#integer-literals
|
||||||
|
@ -241,13 +241,13 @@
|
||||||
[Reference (Raw String Literals)]: ../reference.html#raw-string-literals
|
[Reference (Raw String Literals)]: ../reference.html#raw-string-literals
|
||||||
[References and Borrowing]: references-and-borrowing.html
|
[References and Borrowing]: references-and-borrowing.html
|
||||||
[Strings]: strings.html
|
[Strings]: strings.html
|
||||||
[Structs (Update syntax)]: structs.html#update-syntax
|
[Structs (Update syntax)]: structs.html#Update%20syntax
|
||||||
[Structs]: structs.html
|
[Structs]: structs.html
|
||||||
[Traits (`where` clause)]: traits.html#where-clause
|
[Traits (`where` clause)]: traits.html#Where%20clause
|
||||||
[Traits (Multiple Trait Bounds)]: traits.html#multiple-trait-bounds
|
[Traits (Multiple Trait Bounds)]: traits.html#Multiple%20trait%20bounds
|
||||||
[Traits]: traits.html
|
[Traits]: traits.html
|
||||||
[Universal Function Call Syntax]: ufcs.html
|
[Universal Function Call Syntax]: ufcs.html
|
||||||
[Universal Function Call Syntax (Angle-bracket Form)]: ufcs.html#angle-bracket-form
|
[Universal Function Call Syntax (Angle-bracket Form)]: ufcs.html#Angle-bracket%20Form
|
||||||
[Unsafe]: unsafe.html
|
[Unsafe]: unsafe.html
|
||||||
[Unsized Types (`?Sized`)]: unsized-types.html#sized
|
[Unsized Types (`?Sized`)]: unsized-types.html#Sized
|
||||||
[Variable Bindings]: variable-bindings.html
|
[Variable Bindings]: variable-bindings.html
|
|
@ -1,4 +1,4 @@
|
||||||
% Testing
|
# Testing
|
||||||
|
|
||||||
> Program testing can be a very effective way to show the presence of bugs, but
|
> Program testing can be a very effective way to show the presence of bugs, but
|
||||||
> it is hopelessly inadequate for showing their absence.
|
> it is hopelessly inadequate for showing their absence.
|
|
@ -1,4 +1,4 @@
|
||||||
% The Stack and the Heap
|
# The Stack and the Heap
|
||||||
|
|
||||||
As a systems language, Rust operates at a low level. If you’re coming from a
|
As a systems language, Rust operates at a low level. If you’re coming from a
|
||||||
high-level language, there are some aspects of systems programming that you may
|
high-level language, there are some aspects of systems programming that you may
|
|
@ -1,4 +1,4 @@
|
||||||
% Trait Objects
|
# Trait Objects
|
||||||
|
|
||||||
When code involves polymorphism, there needs to be a mechanism to determine
|
When code involves polymorphism, there needs to be a mechanism to determine
|
||||||
which specific version is actually run. This is called ‘dispatch’. There are
|
which specific version is actually run. This is called ‘dispatch’. There are
|
|
@ -1,4 +1,4 @@
|
||||||
% Traits
|
# Traits
|
||||||
|
|
||||||
A trait is a language feature that tells the Rust compiler about
|
A trait is a language feature that tells the Rust compiler about
|
||||||
functionality a type must provide.
|
functionality a type must provide.
|
||||||
|
@ -81,7 +81,7 @@ Traits are useful because they allow a type to make certain promises about its
|
||||||
behavior. Generic functions can exploit this to constrain, or [bound][bounds], the types they
|
behavior. Generic functions can exploit this to constrain, or [bound][bounds], the types they
|
||||||
accept. Consider this function, which does not compile:
|
accept. Consider this function, which does not compile:
|
||||||
|
|
||||||
[bounds]: glossary.html#bounds
|
[bounds]: glossary.html#Bounds
|
||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
fn print_area<T>(shape: T) {
|
fn print_area<T>(shape: T) {
|
|
@ -1,4 +1,4 @@
|
||||||
% Type Aliases
|
# Type Aliases
|
||||||
|
|
||||||
The `type` keyword lets you declare an alias of another type:
|
The `type` keyword lets you declare an alias of another type:
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ if x == y {
|
||||||
This compiles without error. Values of a `Num` type are the same as a value of
|
This compiles without error. Values of a `Num` type are the same as a value of
|
||||||
type `i32`, in every way. You can use [tuple struct] to really get a new type.
|
type `i32`, in every way. You can use [tuple struct] to really get a new type.
|
||||||
|
|
||||||
[tuple struct]: structs.html#tuple-structs
|
[tuple struct]: structs.html#Tuple%20structs
|
||||||
|
|
||||||
You can also use type aliases with generics:
|
You can also use type aliases with generics:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% Universal Function Call Syntax
|
# Universal Function Call Syntax
|
||||||
|
|
||||||
Sometimes, functions can have the same names. Consider this code:
|
Sometimes, functions can have the same names. Consider this code:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
% Unsafe
|
# Unsafe
|
||||||
|
|
||||||
Rust’s main draw is its powerful static guarantees about behavior. But safety
|
Rust’s main draw is its powerful static guarantees about behavior. But safety
|
||||||
checks are conservative by nature: there are some programs that are actually
|
checks are conservative by nature: there are some programs that are actually
|
|
@ -1,4 +1,4 @@
|
||||||
% Unsized Types
|
# Unsized Types
|
||||||
|
|
||||||
Most types have a particular size, in bytes, that is knowable at compile time.
|
Most types have a particular size, in bytes, that is knowable at compile time.
|
||||||
For example, an `i32` is thirty-two bits big, or four bytes. However, there are
|
For example, an `i32` is thirty-two bits big, or four bytes. However, there are
|
|
@ -1,4 +1,4 @@
|
||||||
% Using Rust Without the Standard Library
|
# Using Rust Without the Standard Library
|
||||||
|
|
||||||
Rust’s standard library provides a lot of useful functionality, but assumes
|
Rust’s standard library provides a lot of useful functionality, but assumes
|
||||||
support for various features of its host system: threads, networking, heap
|
support for various features of its host system: threads, networking, heap
|
|
@ -1,4 +1,4 @@
|
||||||
% Variable Bindings
|
# Variable Bindings
|
||||||
|
|
||||||
Virtually every non-'Hello World’ Rust program uses *variable bindings*. They
|
Virtually every non-'Hello World’ Rust program uses *variable bindings*. They
|
||||||
bind some value to a name, so it can be used later. `let` is
|
bind some value to a name, so it can be used later. `let` is
|
|
@ -1,4 +1,4 @@
|
||||||
% Vectors
|
# Vectors
|
||||||
|
|
||||||
A ‘vector’ is a dynamic or ‘growable’ array, implemented as the standard
|
A ‘vector’ is a dynamic or ‘growable’ array, implemented as the standard
|
||||||
library type [`Vec<T>`][vec]. The `T` means that we can have vectors
|
library type [`Vec<T>`][vec]. The `T` means that we can have vectors
|
||||||
|
@ -151,6 +151,6 @@ API documentation][vec].
|
||||||
[vec]: ../std/vec/index.html
|
[vec]: ../std/vec/index.html
|
||||||
[box]: ../std/boxed/index.html
|
[box]: ../std/boxed/index.html
|
||||||
[generic]: generics.html
|
[generic]: generics.html
|
||||||
[panic]: concurrency.html#panics
|
[panic]: concurrency.html#Panics
|
||||||
[get]: ../std/vec/struct.Vec.html#method.get
|
[get]: ../std/vec/struct.Vec.html#method.get
|
||||||
[get_mut]: ../std/vec/struct.Vec.html#method.get_mut
|
[get_mut]: ../std/vec/struct.Vec.html#method.get_mut
|
|
@ -1,4 +1,4 @@
|
||||||
% The Rustonomicon
|
# The Rustonomicon
|
||||||
|
|
||||||
#### The Dark Arts of Advanced and Unsafe Rust Programming
|
#### The Dark Arts of Advanced and Unsafe Rust Programming
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# Summary
|
# Summary
|
||||||
|
|
||||||
|
[Introduction](README.md)
|
||||||
|
|
||||||
* [Meet Safe and Unsafe](meet-safe-and-unsafe.md)
|
* [Meet Safe and Unsafe](meet-safe-and-unsafe.md)
|
||||||
* [How Safe and Unsafe Interact](safe-unsafe-meaning.md)
|
* [How Safe and Unsafe Interact](safe-unsafe-meaning.md)
|
||||||
* [Working with Unsafe](working-with-unsafe.md)
|
* [Working with Unsafe](working-with-unsafe.md)
|
|
@ -1,4 +1,4 @@
|
||||||
% Implementing Arc and Mutex
|
# Implementing Arc and Mutex
|
||||||
|
|
||||||
Knowing the theory is all fine and good, but the *best* way to understand
|
Knowing the theory is all fine and good, but the *best* way to understand
|
||||||
something is to use it. To better understand atomics and interior mutability,
|
something is to use it. To better understand atomics and interior mutability,
|
|
@ -1,4 +1,4 @@
|
||||||
% Atomics
|
# Atomics
|
||||||
|
|
||||||
Rust pretty blatantly just inherits C11's memory model for atomics. This is not
|
Rust pretty blatantly just inherits C11's memory model for atomics. This is not
|
||||||
due to this model being particularly excellent or easy to understand. Indeed,
|
due to this model being particularly excellent or easy to understand. Indeed,
|
|
@ -1,4 +1,4 @@
|
||||||
% Splitting Borrows
|
# Splitting Borrows
|
||||||
|
|
||||||
The mutual exclusion property of mutable references can be very limiting when
|
The mutual exclusion property of mutable references can be very limiting when
|
||||||
working with a composite structure. The borrow checker understands some basic
|
working with a composite structure. The borrow checker understands some basic
|
|
@ -1,4 +1,4 @@
|
||||||
% Casts
|
# Casts
|
||||||
|
|
||||||
Casts are a superset of coercions: every coercion can be explicitly
|
Casts are a superset of coercions: every coercion can be explicitly
|
||||||
invoked via a cast. However some conversions require a cast.
|
invoked via a cast. However some conversions require a cast.
|
|
@ -0,0 +1 @@
|
||||||
|
# Chapter 1
|
|
@ -1,4 +1,4 @@
|
||||||
% Checked Uninitialized Memory
|
# Checked Uninitialized Memory
|
||||||
|
|
||||||
Like C, all stack variables in Rust are uninitialized until a value is
|
Like C, all stack variables in Rust are uninitialized until a value is
|
||||||
explicitly assigned to them. Unlike C, Rust statically prevents you from ever
|
explicitly assigned to them. Unlike C, Rust statically prevents you from ever
|
|
@ -1,4 +1,4 @@
|
||||||
% Coercions
|
# Coercions
|
||||||
|
|
||||||
Types can implicitly be coerced to change in certain contexts. These changes are
|
Types can implicitly be coerced to change in certain contexts. These changes are
|
||||||
generally just *weakening* of types, largely focused around pointers and
|
generally just *weakening* of types, largely focused around pointers and
|
|
@ -1,4 +1,4 @@
|
||||||
% Concurrency and Parallelism
|
# Concurrency and Parallelism
|
||||||
|
|
||||||
Rust as a language doesn't *really* have an opinion on how to do concurrency or
|
Rust as a language doesn't *really* have an opinion on how to do concurrency or
|
||||||
parallelism. The standard library exposes OS threads and blocking sys-calls
|
parallelism. The standard library exposes OS threads and blocking sys-calls
|
|
@ -1,4 +1,4 @@
|
||||||
% Constructors
|
# Constructors
|
||||||
|
|
||||||
There is exactly one way to create an instance of a user-defined type: name it,
|
There is exactly one way to create an instance of a user-defined type: name it,
|
||||||
and initialize all its fields at once:
|
and initialize all its fields at once:
|
|
@ -1,4 +1,4 @@
|
||||||
% Type Conversions
|
# Type Conversions
|
||||||
|
|
||||||
At the end of the day, everything is just a pile of bits somewhere, and type
|
At the end of the day, everything is just a pile of bits somewhere, and type
|
||||||
systems are just there to help us use those bits right. There are two common
|
systems are just there to help us use those bits right. There are two common
|
|
@ -1,4 +1,4 @@
|
||||||
% Data Representation in Rust
|
# Data Representation in Rust
|
||||||
|
|
||||||
Low-level programming cares a lot about data layout. It's a big deal. It also
|
Low-level programming cares a lot about data layout. It's a big deal. It also
|
||||||
pervasively influences the rest of the language, so we're going to start by
|
pervasively influences the rest of the language, so we're going to start by
|
|
@ -1,4 +1,4 @@
|
||||||
% Destructors
|
# Destructors
|
||||||
|
|
||||||
What the language *does* provide is full-blown automatic destructors through the
|
What the language *does* provide is full-blown automatic destructors through the
|
||||||
`Drop` trait, which provides the following method:
|
`Drop` trait, which provides the following method:
|
|
@ -1,4 +1,4 @@
|
||||||
% The Dot Operator
|
# The Dot Operator
|
||||||
|
|
||||||
The dot operator will perform a lot of magic to convert types. It will perform
|
The dot operator will perform a lot of magic to convert types. It will perform
|
||||||
auto-referencing, auto-dereferencing, and coercion until types match.
|
auto-referencing, auto-dereferencing, and coercion until types match.
|
|
@ -1,4 +1,4 @@
|
||||||
% Drop Flags
|
# Drop Flags
|
||||||
|
|
||||||
The examples in the previous section introduce an interesting problem for Rust.
|
The examples in the previous section introduce an interesting problem for Rust.
|
||||||
We have seen that it's possible to conditionally initialize, deinitialize, and
|
We have seen that it's possible to conditionally initialize, deinitialize, and
|
|
@ -1,4 +1,4 @@
|
||||||
% Drop Check
|
# Drop Check
|
||||||
|
|
||||||
We have seen how lifetimes provide us some fairly simple rules for ensuring
|
We have seen how lifetimes provide us some fairly simple rules for ensuring
|
||||||
that we never read dangling references. However up to this point we have only ever
|
that we never read dangling references. However up to this point we have only ever
|
|
@ -1,4 +1,4 @@
|
||||||
% Exception Safety
|
# Exception Safety
|
||||||
|
|
||||||
Although programs should use unwinding sparingly, there's a lot of code that
|
Although programs should use unwinding sparingly, there's a lot of code that
|
||||||
*can* panic. If you unwrap a None, index out of bounds, or divide by 0, your
|
*can* panic. If you unwrap a None, index out of bounds, or divide by 0, your
|
|
@ -1,4 +1,4 @@
|
||||||
% Exotically Sized Types
|
# Exotically Sized Types
|
||||||
|
|
||||||
Most of the time, we think in terms of types with a fixed, positive size. This
|
Most of the time, we think in terms of types with a fixed, positive size. This
|
||||||
is not always the case, however.
|
is not always the case, however.
|
|
@ -1,4 +1,4 @@
|
||||||
% Higher-Rank Trait Bounds (HRTBs)
|
# Higher-Rank Trait Bounds (HRTBs)
|
||||||
|
|
||||||
Rust's `Fn` traits are a little bit magic. For instance, we can write the
|
Rust's `Fn` traits are a little bit magic. For instance, we can write the
|
||||||
following code:
|
following code:
|
|
@ -1,4 +1,4 @@
|
||||||
% Leaking
|
# Leaking
|
||||||
|
|
||||||
Ownership-based resource management is intended to simplify composition. You
|
Ownership-based resource management is intended to simplify composition. You
|
||||||
acquire resources when you create the object, and you release the resources when
|
acquire resources when you create the object, and you release the resources when
|
|
@ -1,4 +1,4 @@
|
||||||
% Lifetime Elision
|
# Lifetime Elision
|
||||||
|
|
||||||
In order to make common patterns more ergonomic, Rust allows lifetimes to be
|
In order to make common patterns more ergonomic, Rust allows lifetimes to be
|
||||||
*elided* in function signatures.
|
*elided* in function signatures.
|
|
@ -1,4 +1,4 @@
|
||||||
% Limits of Lifetimes
|
# Limits of Lifetimes
|
||||||
|
|
||||||
Given the following code:
|
Given the following code:
|
||||||
|
|
||||||
|
@ -78,4 +78,4 @@ TODO: other common problems? SEME regions stuff, mostly?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[ex2]: lifetimes.html#example-aliasing-a-mutable-reference
|
[ex2]: lifetimes.html#Example%3A%20aliasing%20a%20mutable%20reference
|
|
@ -1,4 +1,4 @@
|
||||||
% Lifetimes
|
# Lifetimes
|
||||||
|
|
||||||
Rust enforces these rules through *lifetimes*. Lifetimes are effectively
|
Rust enforces these rules through *lifetimes*. Lifetimes are effectively
|
||||||
just names for scopes somewhere in the program. Each reference,
|
just names for scopes somewhere in the program. Each reference,
|
|
@ -1,4 +1,4 @@
|
||||||
% Meet Safe and Unsafe
|
# Meet Safe and Unsafe
|
||||||
|
|
||||||
Programmers in safe "high-level" languages face a fundamental dilemma. On one
|
Programmers in safe "high-level" languages face a fundamental dilemma. On one
|
||||||
hand, it would be *really* great to just say what you want and not worry about
|
hand, it would be *really* great to just say what you want and not worry about
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue