"rustc_data_structures 0.0.0",
]
+[[package]]
+name = "argon2rs"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
[[package]]
name = "arrayref"
version = "0.3.5"
"nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "assert_cli"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "colored 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "environment 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "atty"
version = "0.2.11"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
+[[package]]
+name = "blake2-rfc"
+version = "0.2.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
[[package]]
name = "block-buffer"
version = "0.3.3"
[[package]]
name = "bytecount"
-version = "0.4.0"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"packed_simd 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ignore 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "im-rc 12.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "im-rc 12.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"jobserver 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
+[[package]]
+name = "constant_time_eq"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
[[package]]
name = "core"
version = "0.0.0"
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
+[[package]]
+name = "dirs"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_users 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
[[package]]
name = "dlmalloc"
version = "0.1.2"
"termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "environment"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "error-chain"
version = "0.11.0"
[[package]]
name = "im-rc"
-version = "12.2.0"
+version = "12.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "lsp-types"
-version = "0.55.1"
+version = "0.55.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "racer"
-version = "2.1.17"
+version = "2.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rls-span 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
"redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
+[[package]]
+name = "redox_users"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
[[package]]
name = "regex"
version = "0.2.11"
"env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
+ "heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"lsp-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "lsp-types 0.55.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lsp-types 0.55.4 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ordslice 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "racer 2.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
+ "racer 2.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rls-analysis 0.16.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rls-analysis 0.16.12 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-blacklist 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "rls-data 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rls-data 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-rustc 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rls-span 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rls-vfs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-workspace-hack 1.0.0",
"rustc_tools_util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustfmt-nightly 1.0.1",
+ "rustfmt-nightly 1.0.3",
"serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "rls-analysis"
-version = "0.16.10"
+version = "0.16.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
"json 0.11.13 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "rls-data 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rls-data 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rls-span 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rls-data"
-version = "0.18.1"
+version = "0.18.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rls-span 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "rls-span"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rls-span 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
[[package]]
name = "rustc-ap-arena"
-version = "306.0.0"
+version = "373.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "rustc-ap-rustc_data_structures 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-graphviz"
-version = "306.0.0"
+version = "373.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc-ap-rustc_cratesio_shim"
-version = "306.0.0"
+version = "373.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "rustc-ap-rustc_data_structures"
-version = "306.0.0"
+version = "373.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"ena 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-graphviz 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-graphviz 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_cratesio_shim 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "rustc-ap-rustc_errors"
-version = "306.0.0"
+version = "373.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_cratesio_shim 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-rustc_target"
-version = "306.0.0"
+version = "373.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_cratesio_shim 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-serialize"
-version = "306.0.0"
+version = "373.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "rustc-ap-syntax"
-version = "306.0.0"
+version = "373.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_errors 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_target 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_errors 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_target 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-ap-syntax_pos"
-version = "306.0.0"
+version = "373.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-arena 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-arena 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
version = "0.0.0"
dependencies = [
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "rls-data 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rls-data 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rls-span 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_codegen_utils 0.0.0",
[[package]]
name = "rustfmt-nightly"
-version = "1.0.1"
+version = "1.0.3"
dependencies = [
- "assert_cli 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "bytecount 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "cargo_metadata 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "bytecount 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "cargo_metadata 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "dirs 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_target 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_target 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-workspace-hack 1.0.0",
"serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "unicode_categories 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+[[package]]
+name = "scoped_threadpool"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
[[package]]
name = "scopeguard"
version = "0.3.3"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+[[package]]
+name = "unicode_categories"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
[[package]]
name = "unreachable"
version = "1.0.0"
"checksum ammonia 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fd4c682378117e4186a492b2252b9537990e1617f44aed9788b9a1149de45477"
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
"checksum arc-swap 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1025aeae2b664ca0ea726a89d574fe8f4e77dd712d443236ad1de00379450cf6"
+"checksum argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392"
"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee"
"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"
-"checksum assert_cli 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98589b0e465a6c510d95fceebd365bb79bedece7f6e18a480897f2015f85ec51"
"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
"checksum backtrace 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "18b65ea1161bfb2dd6da6fade5edd4dbd08fba85012123dd333d2fd1b90b2782"
"checksum backtrace-sys 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)" = "6ea90dd7b012b3d1a2cb6bec16670a0db2c95d4e931e84f4047e0460c1b34c8d"
"checksum bit-vec 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4440d5cb623bb7390ae27fec0bb6c61111969860f8e3ae198bfa0663645e67cf"
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
+"checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400"
"checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab"
"checksum bufstream 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "40e38929add23cdf8a366df9b0e088953150724bcbe5fc330b0d8eb3b328eec8"
"checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39"
"checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40"
-"checksum bytecount 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b92204551573580e078dc80017f36a213eb77a0450e4ddd8cfa0f3f2d1f0178f"
+"checksum bytecount 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be0fdd54b507df8f22012890aadd099979befdba27713c767993f8380112ca7c"
"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d"
"checksum bytes 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "40ade3d27603c2cb345eb0912aec461a6dec7e06a4ae48589904e808335c7afa"
"checksum bytesize 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "716960a18f978640f25101b5cbf1c6f6b0d3192fab36a2d98ca96f0ecbe41010"
"checksum commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2"
"checksum compiler_builtins 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6711d51cb46744dd8305293cc3fbc392aaff7a8f5095a7c4fae1e5113ef07c96"
"checksum compiletest_rs 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0d76d4322a40f6b0db7259d4f2c8a65ed8b0d84fce0bbc61b98cf47f8ec6eec3"
+"checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e"
"checksum core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4e2640d6d0bf22e82bed1b73c6aef8d5dd31e5abe6666c57e6d45e2649f4f887"
"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b"
"checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"
"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
"checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90"
"checksum directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72d337a64190607d4fcca2cb78982c5dd57f4916e19696b48a575fa746b6cb0f"
+"checksum dirs 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "88972de891f6118092b643d85a0b28e0678e0f948d7f879aa32f2d5aafe97d2a"
"checksum dlmalloc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d56ad71b31043818d0ee10a7fb9664882f8e45849c81647585e6a3124f185517"
"checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0"
"checksum elasticlunr-rs 2.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a99a310cd1f9770e7bf8e48810c7bcbb0e078c8fb23a8c7bcf0da4c2bf61a455"
"checksum ena 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f56c93cc076508c549d9bb747f79aa9b4eb098be7b8cad8830c3137ef52d1e00"
"checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38"
"checksum env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "afb070faf94c85d17d50ca44f6ad076bce18ae92f0037d350947240a36e9d42e"
-"checksum environment 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f4b14e20978669064c33b4c1e0fb4083412e40fe56cbea2eae80fd7591503ee"
"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3"
"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02"
"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2"
"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
"checksum if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac95d9aa0624e7b78187d6fb8ab012b41d9f6f54b1bcb61e61c4845f8357ec"
"checksum ignore 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36ecfc5ad80f0b1226df948c562e2cddd446096be3f644c95106400eae8a5e01"
-"checksum im-rc 12.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4591152fd573cf453a890b5f9fdc5c328a751a0785539316739d5f85e5c468c"
+"checksum im-rc 12.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9460397452f537fd51808056ff209f4c4c4c9d20d42ae952f517708726284972"
"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
"checksum is-match 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7e5b386aef33a1c677be65237cb9d32c3f3ef56bd035949710c4bb13083eb053"
"checksum itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f58856976b776fedd95533137617a02fb25719f40e7d9b01c7043cd65474f450"
"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
"checksum log_settings 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19af41f0565d7c19b2058153ad0b42d4d5ce89ec4dbf06ed6741114a8b63e7cd"
"checksum lsp-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3570f641b984e3e4613a1ca34db2ea72549bbc3c0316d33f5af91ab514dcbff"
-"checksum lsp-types 0.55.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca49aeb430780992121d582520170411658b1e41bf968b917d85fd0fb6da3c5"
+"checksum lsp-types 0.55.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6392b5843615b8a2adeebe87b83fdd29567c0870baba3407a67e6dbfee4712f8"
"checksum lzma-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d1eaa027402541975218bb0eec67d6b0412f6233af96e0d096d31dbdfd22e614"
"checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
"checksum macro-utils 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2c4deaccc2ead6a28c16c0ba82f07d52b6475397415ce40876e559b0b0ea510"
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
"checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8"
"checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c"
-"checksum racer 2.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "11db0de64c3eed7ee25f7b0af2109d296a67efa1efe7566ed17cc01115f961c8"
+"checksum racer 2.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "d634483bed41bb116122b84ffe0ef8740345c2ceb2784ce86c33499700eb13a7"
"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
"checksum rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae9d223d52ae411a33cf7e54ec6034ec165df296ccd23533d671a28252b6f66a"
"checksum rayon-core 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d24ad214285a7729b174ed6d3bcfcb80177807f959d95fafd5bfc5c4f201ac8"
"checksum redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "679da7508e9a6390aeaf7fbd02a800fdc64b73fe2204dd2c8ae66d22d9d5ad5d"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
+"checksum redox_users 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "214a97e49be64fd2c86f568dd0cb2c757d2cc53de95b273b6ad0a1c908482f26"
"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384"
"checksum regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37e7cbbd370869ce2e8dff25c7018702d10b21a20ef7135316f8daecd6c25b7f"
"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7"
"checksum regex-syntax 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4e47a2ed29da7a9e1960e1639e7a982e6edc6d49be308a3b02daf511504a16d1"
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
-"checksum rls-analysis 0.16.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2de1187cceaf16d7642cc78835a2890b55b35ed9e8a8e3c6348a6297d8dd0fb1"
+"checksum rls-analysis 0.16.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ae18d8ad01dec3b2014f4d7ae3c607d7adbcff79e5d3b48ea42ea71c10d43a71"
"checksum rls-blacklist 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ce1fdac03e138c4617ff87b194e1ff57a39bb985a044ccbd8673d30701e411"
-"checksum rls-data 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a209ce46bb52813cbe0786a7baadc0c1a3f5543ef93f179eda3b841ed72cf2e"
+"checksum rls-data 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5f80b84551b32e26affaf7f12374913b5061730c0dcd185d9e8fa5a15e36e65c"
"checksum rls-rustc 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9dba7390427aefa953608429701e3665192ca810ba8ae09301e001b7c7bed0"
-"checksum rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d7c7046dc6a92f2ae02ed302746db4382e75131b9ce20ce967259f6b5867a6a"
+"checksum rls-span 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "33d66f1d6c6ccd5c98029f162544131698f6ebb61d8c697681cac409dcd08805"
"checksum rls-vfs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "72d56425bd5aa86d9d4372b76f0381d3b4bda9c0220e71956c9fcc929f45c1f1"
-"checksum rustc-ap-arena 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cbfb540c1347a3993060896b18e0d64084203fa37aaffdc5e5c31264f275d476"
-"checksum rustc-ap-graphviz 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "790ac657d5bf69be9ef56f6810e8a0238b07e8460a88526e11d41f8214eb6c4e"
-"checksum rustc-ap-rustc_cratesio_shim 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b721cf32b543f3ee90240d7b757ca4a45930fe9981458a50678b4ccd75c472e2"
-"checksum rustc-ap-rustc_data_structures 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4fa11df199d45ce948b07792ca593f59c1d19d2cb05d35c6b0a02271e772a416"
-"checksum rustc-ap-rustc_errors 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b7ead3163ef995bbba520b88739e1d60f9ccf74fdacdda985067644c8134e827"
-"checksum rustc-ap-rustc_target 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "688fef9cc27837755019b72b4f13e7a3d3e5012473475f377b75dbb1f07beb5f"
-"checksum rustc-ap-serialize 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b2c0e8161e956647592a737074736e6ce05ea36b70c770ea8cca3eb9cb33737"
-"checksum rustc-ap-syntax 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1adc189e5e4500a4167b9afa04e67067f40d0039e0e05870c977bebb561f065a"
-"checksum rustc-ap-syntax_pos 306.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4d42c430dbb0be4377bfe6aa5099074c63ac8796b24098562c2e2154aecc5652"
+"checksum rustc-ap-arena 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8be999235b541fc8eb54901b66e899a06076709ac5f53d6b2c5c59d29ad54780"
+"checksum rustc-ap-graphviz 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "532b5df15ca1a19a42815e37e521a20a7632b86b36868d1447932f8476f8f789"
+"checksum rustc-ap-rustc_cratesio_shim 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c388afe1ef810013c878bdf9073ab1ae28dc49e9325863b351afb10acf4cc46e"
+"checksum rustc-ap-rustc_data_structures 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63a8f08b9fb6d607afb842ee7206273d09d69c9201bfc1c479a726093251a24e"
+"checksum rustc-ap-rustc_errors 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6dc0df7bf31588ea67e6386f6ad19f6b9a37ba7d5726ecad1cacce22e231bd98"
+"checksum rustc-ap-rustc_target 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb4623a6f6c65b928cbe8d9c52b38cf57ba1722677645dc53fb1bdadfd0e127"
+"checksum rustc-ap-serialize 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c290b148c9e4e08bbcb8a313393e257c1103cedf6a038aefc9f957c8a77c755"
+"checksum rustc-ap-syntax 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "526fdc5bdbaaeae3b2a9ba42e5f5f7f29cda6ce8971b607a2955b1cb4ca339b5"
+"checksum rustc-ap-syntax_pos 373.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e4f88a1213562373cee9de5a1d77bbf16dd706030304af041c9733492fcc952"
"checksum rustc-demangle 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "82ae957aa1b3055d8e086486723c0ccd3d7b8fa190ae8fa2e35543b6171c810e"
"checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8"
"checksum rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c6d5a683c6ba4ed37959097e88d71c9e8e26659a3cb5be8b389078e7ad45306"
"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267"
"checksum schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "0e1a231dc10abf6749cfa5d7767f25888d484201accbd919b66ab5413c502d56"
"checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28"
+"checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8"
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
+"checksum unicode_categories 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e"
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a"
"checksum url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74e7d099f1ee52f823d4bdd60c93c3602043c728f5db3b97bdb548467f7bddea"
let libdir = env::var_os("RUSTDOC_LIBDIR").expect("RUSTDOC_LIBDIR was not set");
let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set");
+ let mut has_unstable = false;
use std::str::FromStr;
// it up so we can make rustdoc print this into the docs
if let Some(version) = env::var_os("RUSTDOC_CRATE_VERSION") {
// This "unstable-options" can be removed when `--crate-version` is stabilized
- cmd.arg("-Z")
- .arg("unstable-options")
- .arg("--crate-version").arg(version);
+ if !has_unstable {
+ cmd.arg("-Z")
+ .arg("unstable-options");
+ }
+ cmd.arg("--crate-version").arg(version);
+ has_unstable = true;
+ }
+
+ // Needed to be able to run all rustdoc tests.
+ if let Some(_) = env::var_os("RUSTDOC_GENERATE_REDIRECT_PAGES") {
+ // This "unstable-options" can be removed when `--generate-redirect-pages` is stabilized
+ if !has_unstable {
+ cmd.arg("-Z")
+ .arg("unstable-options");
+ }
+ cmd.arg("--generate-redirect-pages");
}
if verbose > 1 {
cargo.arg("--")
.arg("--markdown-css").arg("rust.css")
.arg("--markdown-no-toc")
+ .arg("--generate-redirect-pages")
.arg("--index-page").arg(&builder.src.join("src/doc/index.md"));
builder.run(&mut cargo);
let mut cargo = builder.cargo(compiler, Mode::Test, target, "doc");
compile::test_cargo(builder, &compiler, target, &mut cargo);
- cargo.arg("--no-deps").arg("-p").arg("test");
+ cargo.arg("--no-deps")
+ .arg("-p").arg("test")
+ .env("RUSTDOC_GENERATE_REDIRECT_PAGES", "1");
builder.run(&mut cargo);
builder.cp_r(&my_out, &out);
// We don't want to build docs for internal compiler dependencies in this
// step (there is another step for that). Therefore, we whitelist the crates
// for which docs must be built.
- cargo.arg("--no-deps");
for krate in &["proc_macro"] {
- cargo.arg("-p").arg(krate);
+ cargo.arg("-p").arg(krate)
+ .env("RUSTDOC_GENERATE_REDIRECT_PAGES", "1");
}
builder.run(&mut cargo);
For targets: `arm-unknown-linux-gnueabi`
- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
+- Path and misc options > Patches origin = Bundled, then local
+- Path and misc options > Local patch directory = /tmp/patches
- Target options > Target Architecture = arm
- Target options > Architecture level = armv6 -- (+)
- Target options > Floating point = software (no FPU) -- (\*)
- Operating System > Target OS = linux
- Operating System > Linux kernel version = 3.2.72 -- Precise kernel
-- C-library > glibc version = 2.14.1
-- C compiler > gcc version = 4.9.3
+- C-library > glibc version = 2.16.0
+- C compiler > gcc version = 5.2.0
- C compiler > C++ = ENABLE -- to cross compile LLVM
### `arm-linux-gnueabihf.config`
For targets: `arm-unknown-linux-gnueabihf`
- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
+- Path and misc options > Patches origin = Bundled, then local
+- Path and misc options > Local patch directory = /tmp/patches
- Target options > Target Architecture = arm
- Target options > Architecture level = armv6 -- (+)
- Target options > Use specific FPU = vfp -- (+)
- Target options > Default instruction set mode = arm -- (+)
- Operating System > Target OS = linux
- Operating System > Linux kernel version = 3.2.72 -- Precise kernel
-- C-library > glibc version = 2.14.1
-- C compiler > gcc version = 4.9.3
+- C-library > glibc version = 2.16.0
+- C compiler > gcc version = 5.2.0
- C compiler > C++ = ENABLE -- to cross compile LLVM
### `armv7-linux-gnueabihf.config`
For targets: `armv7-unknown-linux-gnueabihf`
- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
+- Path and misc options > Patches origin = Bundled, then local
+- Path and misc options > Local patch directory = /tmp/patches
- Target options > Target Architecture = arm
- Target options > Suffix to the arch-part = v7
- Target options > Architecture level = armv7-a -- (+)
- Target options > Default instruction set mode = thumb -- (\*)
- Operating System > Target OS = linux
- Operating System > Linux kernel version = 3.2.72 -- Precise kernel
-- C-library > glibc version = 2.14.1
-- C compiler > gcc version = 4.9.3
+- C-library > glibc version = 2.16.0
+- C compiler > gcc version = 5.2.0
- C compiler > C++ = ENABLE -- to cross compile LLVM
(\*) These options have been selected to match the configuration of the arm
- Operating System > Target OS = linux
- Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
- C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
-- C compiler > gcc version = 4.9.3
+- C compiler > gcc version = 5.2.0
- C compiler > C++ = ENABLE -- to cross compile LLVM
### `powerpc64-linux-gnu.config`
- Operating System > Target OS = linux
- Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
- C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
-- C compiler > gcc version = 4.9.3
+- C compiler > gcc version = 5.2.0
- C compiler > C++ = ENABLE -- to cross compile LLVM
(+) These CPU options match the configuration of the toolchains in RHEL6.
- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
- Path and misc options > Patches origin = Bundled, then local
-- Path and misc options > Local patch directory = /build/patches
+- Path and misc options > Local patch directory = /tmp/patches
- Target options > Target Architecture = s390
- Target options > Bitness = 64-bit
- Operating System > Target OS = linux
- Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
- C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
-- C compiler > gcc version = 4.9.3
+- C compiler > gcc version = 5.2.0
- C compiler > gcc extra config = --with-arch=z10 -- LLVM's minimum support
- C compiler > C++ = ENABLE -- to cross compile LLVM
USER rustbuild
WORKDIR /tmp
+COPY dist-arm-linux/patches/ /tmp/patches/
COPY dist-arm-linux/arm-linux-gnueabi.config dist-arm-linux/build-toolchains.sh /tmp/
RUN ./build-toolchains.sh
# Crosstool-NG Configuration
#
CT_CONFIGURE_has_make381=y
+CT_CONFIGURE_has_xz=y
CT_MODULES=y
#
# CT_FORCE_EXTRACT is not set
CT_OVERIDE_CONFIG_GUESS_SUB=y
# CT_ONLY_EXTRACT is not set
-CT_PATCH_BUNDLED=y
+# CT_PATCH_BUNDLED is not set
# CT_PATCH_LOCAL is not set
-# CT_PATCH_BUNDLED_LOCAL is not set
+CT_PATCH_BUNDLED_LOCAL=y
# CT_PATCH_LOCAL_BUNDLED is not set
# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set
# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set
# CT_PATCH_NONE is not set
-CT_PATCH_ORDER="bundled"
+CT_PATCH_ORDER="bundled,local"
+CT_PATCH_USE_LOCAL=y
+CT_LOCAL_PATCH_DIR="/tmp/patches"
#
# Build behavior
CT_CC_CORE_PASS_2_NEEDED=y
CT_CC_gcc=y
# CT_CC_GCC_SHOW_LINARO is not set
-# CT_CC_GCC_V_5_2_0 is not set
-CT_CC_GCC_V_4_9_3=y
+CT_CC_GCC_V_5_2_0=y
+# CT_CC_GCC_V_4_9_3 is not set
# CT_CC_GCC_V_4_8_5 is not set
# CT_CC_GCC_V_4_7_4 is not set
# CT_CC_GCC_V_4_6_4 is not set
CT_CC_GCC_4_6_or_later=y
CT_CC_GCC_4_7_or_later=y
CT_CC_GCC_4_8_or_later=y
-CT_CC_GCC_4_9=y
CT_CC_GCC_4_9_or_later=y
+CT_CC_GCC_5=y
+CT_CC_GCC_5_or_later=y
CT_CC_GCC_HAS_GRAPHITE=y
CT_CC_GCC_USE_GRAPHITE=y
CT_CC_GCC_HAS_LTO=y
CT_CC_GCC_USE_MPC=y
CT_CC_GCC_HAS_LIBQUADMATH=y
CT_CC_GCC_HAS_LIBSANITIZER=y
-CT_CC_GCC_VERSION="4.9.3"
+CT_CC_GCC_VERSION="5.2.0"
# CT_CC_LANG_FORTRAN is not set
CT_CC_GCC_ENABLE_CXX_FLAGS=""
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
CT_GMP_NEEDED=y
CT_MPFR_NEEDED=y
CT_ISL_NEEDED=y
-CT_CLOOG_NEEDED=y
CT_MPC_NEEDED=y
CT_COMPLIBS=y
CT_LIBICONV=y
CT_GMP=y
CT_MPFR=y
CT_ISL=y
-CT_CLOOG=y
CT_MPC=y
CT_LIBICONV_V_1_14=y
CT_LIBICONV_VERSION="1.14"
# CT_MPFR_V_2_4_0 is not set
CT_MPFR_VERSION="3.1.3"
CT_ISL_V_0_14=y
+# CT_ISL_V_0_12_2 is not set
CT_ISL_V_0_14_or_later=y
CT_ISL_V_0_12_or_later=y
CT_ISL_VERSION="0.14"
-CT_CLOOG_V_0_18_4=y
+# CT_CLOOG_V_0_18_4 is not set
# CT_CLOOG_V_0_18_1 is not set
# CT_CLOOG_V_0_18_0 is not set
-CT_CLOOG_VERSION="0.18.4"
-CT_CLOOG_0_18_4_or_later=y
-CT_CLOOG_0_18_or_later=y
CT_MPC_V_1_0_3=y
# CT_MPC_V_1_0_2 is not set
# CT_MPC_V_1_0_1 is not set
--- /dev/null
+commit bdb24c2851fd5f0ad9b82d7ea1db911d334b02d2
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue May 20 21:27:13 2014 +0000
+
+ Fix ARM build with GCC trunk.
+
+ sysdeps/unix/sysv/linux/arm/unwind-resume.c and
+ sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
+ variables that are written in C code but only read from toplevel asms.
+ Current GCC trunk now optimizes away such apparently write-only static
+ variables, so causing a build failure. This patch marks those
+ variables with __attribute_used__ to avoid that optimization.
+
+ Tested that this fixes the build for ARM.
+
+ * sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
+ (libgcc_s_resume): Use __attribute_used__.
+ * sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
+ Likewise.
+
+diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+index 29e2c2b00b04..e848bfeffdcb 100644
+--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
++++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+@@ -22,7 +22,8 @@
+ #include <pthreadP.h>
+
+ static void *libgcc_s_handle;
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
++ __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+ static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
+diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+index 285b99b5ed0d..48d00fc83641 100644
+--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
++++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+@@ -20,7 +20,8 @@
+ #include <stdio.h>
+ #include <unwind.h>
+
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
++ __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+
USER rustbuild
WORKDIR /tmp
+COPY dist-armhf-linux/patches/ /tmp/patches/
COPY dist-armhf-linux/arm-linux-gnueabihf.config dist-armhf-linux/build-toolchains.sh /tmp/
RUN ./build-toolchains.sh
# Crosstool-NG Configuration
#
CT_CONFIGURE_has_make381=y
+CT_CONFIGURE_has_xz=y
CT_MODULES=y
#
# CT_FORCE_EXTRACT is not set
CT_OVERIDE_CONFIG_GUESS_SUB=y
# CT_ONLY_EXTRACT is not set
-CT_PATCH_BUNDLED=y
+# CT_PATCH_BUNDLED is not set
# CT_PATCH_LOCAL is not set
-# CT_PATCH_BUNDLED_LOCAL is not set
+CT_PATCH_BUNDLED_LOCAL=y
# CT_PATCH_LOCAL_BUNDLED is not set
# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set
# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set
# CT_PATCH_NONE is not set
-CT_PATCH_ORDER="bundled"
+CT_PATCH_ORDER="bundled,local"
+CT_PATCH_USE_LOCAL=y
+CT_LOCAL_PATCH_DIR="/tmp/patches"
#
# Build behavior
CT_CC_CORE_PASS_2_NEEDED=y
CT_CC_gcc=y
# CT_CC_GCC_SHOW_LINARO is not set
-# CT_CC_GCC_V_5_2_0 is not set
-CT_CC_GCC_V_4_9_3=y
+CT_CC_GCC_V_5_2_0=y
+# CT_CC_GCC_V_4_9_3 is not set
# CT_CC_GCC_V_4_8_5 is not set
# CT_CC_GCC_V_4_7_4 is not set
# CT_CC_GCC_V_4_6_4 is not set
CT_CC_GCC_4_6_or_later=y
CT_CC_GCC_4_7_or_later=y
CT_CC_GCC_4_8_or_later=y
-CT_CC_GCC_4_9=y
CT_CC_GCC_4_9_or_later=y
+CT_CC_GCC_5=y
+CT_CC_GCC_5_or_later=y
CT_CC_GCC_HAS_GRAPHITE=y
CT_CC_GCC_USE_GRAPHITE=y
CT_CC_GCC_HAS_LTO=y
CT_CC_GCC_USE_MPC=y
CT_CC_GCC_HAS_LIBQUADMATH=y
CT_CC_GCC_HAS_LIBSANITIZER=y
-CT_CC_GCC_VERSION="4.9.3"
+CT_CC_GCC_VERSION="5.2.0"
# CT_CC_LANG_FORTRAN is not set
CT_CC_GCC_ENABLE_CXX_FLAGS=""
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
CT_GMP_NEEDED=y
CT_MPFR_NEEDED=y
CT_ISL_NEEDED=y
-CT_CLOOG_NEEDED=y
CT_MPC_NEEDED=y
CT_COMPLIBS=y
CT_LIBICONV=y
CT_GMP=y
CT_MPFR=y
CT_ISL=y
-CT_CLOOG=y
CT_MPC=y
CT_LIBICONV_V_1_14=y
CT_LIBICONV_VERSION="1.14"
# CT_MPFR_V_2_4_0 is not set
CT_MPFR_VERSION="3.1.3"
CT_ISL_V_0_14=y
+# CT_ISL_V_0_12_2 is not set
CT_ISL_V_0_14_or_later=y
CT_ISL_V_0_12_or_later=y
CT_ISL_VERSION="0.14"
-CT_CLOOG_V_0_18_4=y
+# CT_CLOOG_V_0_18_4 is not set
# CT_CLOOG_V_0_18_1 is not set
# CT_CLOOG_V_0_18_0 is not set
-CT_CLOOG_VERSION="0.18.4"
-CT_CLOOG_0_18_4_or_later=y
-CT_CLOOG_0_18_or_later=y
CT_MPC_V_1_0_3=y
# CT_MPC_V_1_0_2 is not set
# CT_MPC_V_1_0_1 is not set
--- /dev/null
+commit bdb24c2851fd5f0ad9b82d7ea1db911d334b02d2
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue May 20 21:27:13 2014 +0000
+
+ Fix ARM build with GCC trunk.
+
+ sysdeps/unix/sysv/linux/arm/unwind-resume.c and
+ sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
+ variables that are written in C code but only read from toplevel asms.
+ Current GCC trunk now optimizes away such apparently write-only static
+ variables, so causing a build failure. This patch marks those
+ variables with __attribute_used__ to avoid that optimization.
+
+ Tested that this fixes the build for ARM.
+
+ * sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
+ (libgcc_s_resume): Use __attribute_used__.
+ * sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
+ Likewise.
+
+diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+index 29e2c2b00b04..e848bfeffdcb 100644
+--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
++++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+@@ -22,7 +22,8 @@
+ #include <pthreadP.h>
+
+ static void *libgcc_s_handle;
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
++ __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+ static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
+diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+index 285b99b5ed0d..48d00fc83641 100644
+--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
++++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+@@ -20,7 +20,8 @@
+ #include <stdio.h>
+ #include <unwind.h>
+
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
++ __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+
USER rustbuild
WORKDIR /tmp
+COPY dist-armv7-linux/patches/ /tmp/patches/
COPY dist-armv7-linux/build-toolchains.sh dist-armv7-linux/armv7-linux-gnueabihf.config /tmp/
RUN ./build-toolchains.sh
# Crosstool-NG Configuration
#
CT_CONFIGURE_has_make381=y
+CT_CONFIGURE_has_xz=y
CT_MODULES=y
#
# CT_FORCE_EXTRACT is not set
CT_OVERIDE_CONFIG_GUESS_SUB=y
# CT_ONLY_EXTRACT is not set
-CT_PATCH_BUNDLED=y
+# CT_PATCH_BUNDLED is not set
# CT_PATCH_LOCAL is not set
-# CT_PATCH_BUNDLED_LOCAL is not set
+CT_PATCH_BUNDLED_LOCAL=y
# CT_PATCH_LOCAL_BUNDLED is not set
# CT_PATCH_BUNDLED_FALLBACK_LOCAL is not set
# CT_PATCH_LOCAL_FALLBACK_BUNDLED is not set
# CT_PATCH_NONE is not set
-CT_PATCH_ORDER="bundled"
+CT_PATCH_ORDER="bundled,local"
+CT_PATCH_USE_LOCAL=y
+CT_LOCAL_PATCH_DIR="/tmp/patches"
#
# Build behavior
# CT_ARCH_FLOAT_AUTO is not set
# CT_ARCH_FLOAT_SOFTFP is not set
CT_ARCH_FLOAT="hard"
-# CT_ARCH_ALPHA_EV4 is not set
-# CT_ARCH_ALPHA_EV45 is not set
-# CT_ARCH_ALPHA_EV5 is not set
-# CT_ARCH_ALPHA_EV56 is not set
-# CT_ARCH_ALPHA_EV6 is not set
-# CT_ARCH_ALPHA_EV67 is not set
#
# arm other options
CT_LIBC_VERSION="2.16.0"
CT_LIBC_glibc=y
# CT_LIBC_musl is not set
-# CT_LIBC_newlib is not set
-# CT_LIBC_none is not set
# CT_LIBC_uClibc is not set
CT_LIBC_avr_libc_AVAILABLE=y
CT_LIBC_glibc_AVAILABLE=y
CT_CC_CORE_PASS_2_NEEDED=y
CT_CC_gcc=y
# CT_CC_GCC_SHOW_LINARO is not set
-# CT_CC_GCC_V_5_2_0 is not set
-CT_CC_GCC_V_4_9_3=y
+CT_CC_GCC_V_5_2_0=y
+# CT_CC_GCC_V_4_9_3 is not set
# CT_CC_GCC_V_4_8_5 is not set
# CT_CC_GCC_V_4_7_4 is not set
# CT_CC_GCC_V_4_6_4 is not set
CT_CC_GCC_4_6_or_later=y
CT_CC_GCC_4_7_or_later=y
CT_CC_GCC_4_8_or_later=y
-CT_CC_GCC_4_9=y
CT_CC_GCC_4_9_or_later=y
+CT_CC_GCC_5=y
+CT_CC_GCC_5_or_later=y
CT_CC_GCC_HAS_GRAPHITE=y
CT_CC_GCC_USE_GRAPHITE=y
CT_CC_GCC_HAS_LTO=y
CT_CC_GCC_USE_MPC=y
CT_CC_GCC_HAS_LIBQUADMATH=y
CT_CC_GCC_HAS_LIBSANITIZER=y
-CT_CC_GCC_VERSION="4.9.3"
+CT_CC_GCC_VERSION="5.2.0"
# CT_CC_LANG_FORTRAN is not set
CT_CC_GCC_ENABLE_CXX_FLAGS=""
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
CT_GMP_NEEDED=y
CT_MPFR_NEEDED=y
CT_ISL_NEEDED=y
-CT_CLOOG_NEEDED=y
CT_MPC_NEEDED=y
CT_COMPLIBS=y
CT_LIBICONV=y
CT_GMP=y
CT_MPFR=y
CT_ISL=y
-CT_CLOOG=y
CT_MPC=y
CT_LIBICONV_V_1_14=y
CT_LIBICONV_VERSION="1.14"
# CT_MPFR_V_2_4_0 is not set
CT_MPFR_VERSION="3.1.3"
CT_ISL_V_0_14=y
+# CT_ISL_V_0_12_2 is not set
CT_ISL_V_0_14_or_later=y
CT_ISL_V_0_12_or_later=y
CT_ISL_VERSION="0.14"
-CT_CLOOG_V_0_18_4=y
+# CT_CLOOG_V_0_18_4 is not set
# CT_CLOOG_V_0_18_1 is not set
# CT_CLOOG_V_0_18_0 is not set
-CT_CLOOG_VERSION="0.18.4"
-CT_CLOOG_0_18_4_or_later=y
-CT_CLOOG_0_18_or_later=y
CT_MPC_V_1_0_3=y
# CT_MPC_V_1_0_2 is not set
# CT_MPC_V_1_0_1 is not set
--- /dev/null
+commit bdb24c2851fd5f0ad9b82d7ea1db911d334b02d2
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue May 20 21:27:13 2014 +0000
+
+ Fix ARM build with GCC trunk.
+
+ sysdeps/unix/sysv/linux/arm/unwind-resume.c and
+ sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
+ variables that are written in C code but only read from toplevel asms.
+ Current GCC trunk now optimizes away such apparently write-only static
+ variables, so causing a build failure. This patch marks those
+ variables with __attribute_used__ to avoid that optimization.
+
+ Tested that this fixes the build for ARM.
+
+ * sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
+ (libgcc_s_resume): Use __attribute_used__.
+ * sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
+ Likewise.
+
+diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+index 29e2c2b00b04..e848bfeffdcb 100644
+--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
++++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+@@ -22,7 +22,8 @@
+ #include <pthreadP.h>
+
+ static void *libgcc_s_handle;
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
++ __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+ static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
+diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+index 285b99b5ed0d..48d00fc83641 100644
+--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
++++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+@@ -20,7 +20,8 @@
+ #include <stdio.h>
+ #include <unwind.h>
+
+-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
++static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
++ __attribute_used__;
+ static _Unwind_Reason_Code (*libgcc_s_personality)
+ (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
+
--- /dev/null
+diff --git a/configure b/configure
+index b6752d147c6b..6089a3403410 100755
+--- a/configure
++++ b/configure
+@@ -5079,7 +5079,7 @@ $as_echo_n "checking version of $CC... " >&6; }
+ ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+- 3.4* | 4.[0-9]* )
++ 3.4* | [4-9].* )
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+
+diff --git a/configure.in b/configure.in
+index 56849dfc489a..09677eb3d0c1 100644
+--- a/configure.in
++++ b/configure.in
+@@ -960,7 +960,7 @@ fi
+ # These programs are version sensitive.
+ AC_CHECK_TOOL_PREFIX
+ AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
+- [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
++ [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | [4-9].* ],
+ critic_missing="$critic_missing gcc")
+ AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
+ [GNU Make[^0-9]*\([0-9][0-9.]*\)],
CT_CC_CORE_PASS_2_NEEDED=y
CT_CC_gcc=y
# CT_CC_GCC_SHOW_LINARO is not set
-# CT_CC_GCC_V_5_2_0 is not set
-CT_CC_GCC_V_4_9_3=y
+CT_CC_GCC_V_5_2_0=y
+# CT_CC_GCC_V_4_9_3 is not set
# CT_CC_GCC_V_4_8_5 is not set
# CT_CC_GCC_V_4_7_4 is not set
# CT_CC_GCC_V_4_6_4 is not set
CT_CC_GCC_4_6_or_later=y
CT_CC_GCC_4_7_or_later=y
CT_CC_GCC_4_8_or_later=y
-CT_CC_GCC_4_9=y
CT_CC_GCC_4_9_or_later=y
+CT_CC_GCC_5=y
+CT_CC_GCC_5_or_later=y
CT_CC_GCC_HAS_GRAPHITE=y
CT_CC_GCC_USE_GRAPHITE=y
CT_CC_GCC_HAS_LTO=y
CT_CC_GCC_USE_MPC=y
CT_CC_GCC_HAS_LIBQUADMATH=y
CT_CC_GCC_HAS_LIBSANITIZER=y
-CT_CC_GCC_VERSION="4.9.3"
+CT_CC_GCC_VERSION="5.2.0"
# CT_CC_LANG_FORTRAN is not set
CT_CC_GCC_ENABLE_CXX_FLAGS=""
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
CT_GMP_NEEDED=y
CT_MPFR_NEEDED=y
CT_ISL_NEEDED=y
-CT_CLOOG_NEEDED=y
CT_MPC_NEEDED=y
CT_COMPLIBS=y
CT_LIBICONV=y
CT_GMP=y
CT_MPFR=y
CT_ISL=y
-CT_CLOOG=y
CT_MPC=y
CT_LIBICONV_V_1_14=y
CT_LIBICONV_VERSION="1.14"
# CT_MPFR_V_2_4_0 is not set
CT_MPFR_VERSION="3.1.3"
CT_ISL_V_0_14=y
+# CT_ISL_V_0_12_2 is not set
CT_ISL_V_0_14_or_later=y
CT_ISL_V_0_12_or_later=y
CT_ISL_VERSION="0.14"
-CT_CLOOG_V_0_18_4=y
+# CT_CLOOG_V_0_18_4 is not set
# CT_CLOOG_V_0_18_1 is not set
# CT_CLOOG_V_0_18_0 is not set
-CT_CLOOG_VERSION="0.18.4"
-CT_CLOOG_0_18_4_or_later=y
-CT_CLOOG_0_18_or_later=y
CT_MPC_V_1_0_3=y
# CT_MPC_V_1_0_2 is not set
# CT_MPC_V_1_0_1 is not set
--- /dev/null
+diff --git a/configure b/configure
+index b6752d147c6b..6089a3403410 100755
+--- a/configure
++++ b/configure
+@@ -5079,7 +5079,7 @@ $as_echo_n "checking version of $CC... " >&6; }
+ ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+- 3.4* | 4.[0-9]* )
++ 3.4* | [4-9].* )
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+
+diff --git a/configure.in b/configure.in
+index 56849dfc489a..09677eb3d0c1 100644
+--- a/configure.in
++++ b/configure.in
+@@ -960,7 +960,7 @@ fi
+ # These programs are version sensitive.
+ AC_CHECK_TOOL_PREFIX
+ AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
+- [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
++ [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | [4-9].* ],
+ critic_missing="$critic_missing gcc")
+ AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
+ [GNU Make[^0-9]*\([0-9][0-9.]*\)],
CT_CC_CORE_PASS_2_NEEDED=y
CT_CC_gcc=y
# CT_CC_GCC_SHOW_LINARO is not set
-# CT_CC_GCC_V_5_2_0 is not set
-CT_CC_GCC_V_4_9_3=y
+CT_CC_GCC_V_5_2_0=y
+# CT_CC_GCC_V_4_9_3 is not set
# CT_CC_GCC_V_4_8_5 is not set
# CT_CC_GCC_V_4_7_4 is not set
# CT_CC_GCC_V_4_6_4 is not set
CT_CC_GCC_4_6_or_later=y
CT_CC_GCC_4_7_or_later=y
CT_CC_GCC_4_8_or_later=y
-CT_CC_GCC_4_9=y
CT_CC_GCC_4_9_or_later=y
+CT_CC_GCC_5=y
+CT_CC_GCC_5_or_later=y
CT_CC_GCC_HAS_GRAPHITE=y
CT_CC_GCC_USE_GRAPHITE=y
CT_CC_GCC_HAS_LTO=y
CT_CC_GCC_USE_MPC=y
CT_CC_GCC_HAS_LIBQUADMATH=y
CT_CC_GCC_HAS_LIBSANITIZER=y
-CT_CC_GCC_VERSION="4.9.3"
+CT_CC_GCC_VERSION="5.2.0"
# CT_CC_LANG_FORTRAN is not set
CT_CC_GCC_ENABLE_CXX_FLAGS=""
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
CT_GMP_NEEDED=y
CT_MPFR_NEEDED=y
CT_ISL_NEEDED=y
-CT_CLOOG_NEEDED=y
CT_MPC_NEEDED=y
CT_COMPLIBS=y
CT_LIBICONV=y
CT_GMP=y
CT_MPFR=y
CT_ISL=y
-CT_CLOOG=y
CT_MPC=y
CT_LIBICONV_V_1_14=y
CT_LIBICONV_VERSION="1.14"
# CT_MPFR_V_2_4_0 is not set
CT_MPFR_VERSION="3.1.3"
CT_ISL_V_0_14=y
+# CT_ISL_V_0_12_2 is not set
CT_ISL_V_0_14_or_later=y
CT_ISL_V_0_12_or_later=y
CT_ISL_VERSION="0.14"
-CT_CLOOG_V_0_18_4=y
-# CT_CLOOG_V_0_18_1 is not set
-# CT_CLOOG_V_0_18_0 is not set
-CT_CLOOG_VERSION="0.18.4"
-CT_CLOOG_0_18_4_or_later=y
-CT_CLOOG_0_18_or_later=y
CT_MPC_V_1_0_3=y
# CT_MPC_V_1_0_2 is not set
# CT_MPC_V_1_0_1 is not set
--- /dev/null
+diff --git a/configure b/configure
+index b6752d147c6b..6089a3403410 100755
+--- a/configure
++++ b/configure
+@@ -5079,7 +5079,7 @@ $as_echo_n "checking version of $CC... " >&6; }
+ ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+- 3.4* | 4.[0-9]* )
++ 3.4* | [4-9].* )
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+
+diff --git a/configure.in b/configure.in
+index 56849dfc489a..09677eb3d0c1 100644
+--- a/configure.in
++++ b/configure.in
+@@ -960,7 +960,7 @@ fi
+ # These programs are version sensitive.
+ AC_CHECK_TOOL_PREFIX
+ AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
+- [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
++ [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | [4-9].* ],
+ critic_missing="$critic_missing gcc")
+ AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
+ [GNU Make[^0-9]*\([0-9][0-9.]*\)],
CT_CC_CORE_PASS_2_NEEDED=y
CT_CC_gcc=y
# CT_CC_GCC_SHOW_LINARO is not set
-# CT_CC_GCC_V_5_2_0 is not set
-CT_CC_GCC_V_4_9_3=y
+CT_CC_GCC_V_5_2_0=y
+# CT_CC_GCC_V_4_9_3 is not set
# CT_CC_GCC_V_4_8_5 is not set
# CT_CC_GCC_V_4_7_4 is not set
# CT_CC_GCC_V_4_6_4 is not set
CT_CC_GCC_4_6_or_later=y
CT_CC_GCC_4_7_or_later=y
CT_CC_GCC_4_8_or_later=y
-CT_CC_GCC_4_9=y
CT_CC_GCC_4_9_or_later=y
+CT_CC_GCC_5=y
+CT_CC_GCC_5_or_later=y
CT_CC_GCC_HAS_GRAPHITE=y
CT_CC_GCC_USE_GRAPHITE=y
CT_CC_GCC_HAS_LTO=y
CT_CC_GCC_USE_MPC=y
CT_CC_GCC_HAS_LIBQUADMATH=y
CT_CC_GCC_HAS_LIBSANITIZER=y
-CT_CC_GCC_VERSION="4.9.3"
+CT_CC_GCC_VERSION="5.2.0"
# CT_CC_LANG_FORTRAN is not set
CT_CC_GCC_ENABLE_CXX_FLAGS=""
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=""
CT_GMP_NEEDED=y
CT_MPFR_NEEDED=y
CT_ISL_NEEDED=y
-CT_CLOOG_NEEDED=y
CT_MPC_NEEDED=y
CT_COMPLIBS=y
CT_LIBICONV=y
CT_GMP=y
CT_MPFR=y
CT_ISL=y
-CT_CLOOG=y
CT_MPC=y
CT_LIBICONV_V_1_14=y
CT_LIBICONV_VERSION="1.14"
# CT_MPFR_V_2_4_0 is not set
CT_MPFR_VERSION="3.1.3"
CT_ISL_V_0_14=y
+# CT_ISL_V_0_12_2 is not set
CT_ISL_V_0_14_or_later=y
CT_ISL_V_0_12_or_later=y
CT_ISL_VERSION="0.14"
-CT_CLOOG_V_0_18_4=y
+# CT_CLOOG_V_0_18_4 is not set
# CT_CLOOG_V_0_18_1 is not set
# CT_CLOOG_V_0_18_0 is not set
-CT_CLOOG_VERSION="0.18.4"
-CT_CLOOG_0_18_4_or_later=y
-CT_CLOOG_0_18_or_later=y
CT_MPC_V_1_0_3=y
# CT_MPC_V_1_0_2 is not set
# CT_MPC_V_1_0_1 is not set
source shared.sh
-# Currently these commits are all tip-of-tree as of 2018-12-16, used to pick up
-# a fix for rust-lang/rust#56849
-LLVM=032b00a5404865765cda7db3039f39d54964d8b0
-LLD=3e4aa4e8671523321af51449e0569f455ef3ad43
-CLANG=a6b9739069763243020f4ea6fe586bc135fde1f9
+LLVM=llvmorg-8.0.0-rc2
-mkdir clang
-cd clang
+mkdir llvm-project
+cd llvm-project
-curl -L https://github.com/llvm-mirror/llvm/archive/$LLVM.tar.gz | \
+curl -L https://github.com/llvm/llvm-project/archive/$LLVM.tar.gz | \
tar xzf - --strip-components=1
-mkdir -p tools/clang
-curl -L https://github.com/llvm-mirror/clang/archive/$CLANG.tar.gz | \
- tar xzf - --strip-components=1 -C tools/clang
-
-mkdir -p tools/lld
-curl -L https://github.com/llvm-mirror/lld/archive/$LLD.tar.gz | \
- tar zxf - --strip-components=1 -C tools/lld
-
mkdir clang-build
cd clang-build
#
# [1]: https://sourceware.org/ml/crossgcc/2008-11/msg00028.html
INC="/rustroot/include"
-INC="$INC:/rustroot/lib/gcc/x86_64-unknown-linux-gnu/4.8.5/include-fixed"
+INC="$INC:/rustroot/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/include-fixed"
INC="$INC:/usr/include"
hide_output \
- cmake .. \
+ cmake ../llvm \
-DCMAKE_C_COMPILER=/rustroot/bin/gcc \
-DCMAKE_CXX_COMPILER=/rustroot/bin/g++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/rustroot \
-DLLVM_TARGETS_TO_BUILD=X86 \
+ -DLLVM_ENABLE_PROJECTS="clang;lld" \
-DC_INCLUDE_DIRS="$INC"
hide_output make -j10
hide_output make install
cd ../..
-rm -rf clang
+rm -rf llvm-project
source shared.sh
-GCC=4.8.5
+GCC=5.5.0
-curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.bz2 | tar xjf -
+curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.xz | xzcat | tar xf -
cd gcc-$GCC
# FIXME(#49246): Remove the `sed` below.
# Gotta do some hackery to tell python about our custom OpenSSL build, but other
# than that fairly normal.
CC=gcc \
-CFLAGS='-I /rustroot/include' LDFLAGS='-L /rustroot/lib -L /rustroot/lib64' \
+CFLAGS='-I /rustroot/include -fgnu89-inline' \
+LDFLAGS='-L /rustroot/lib -L /rustroot/lib64' \
hide_output ./configure.gnu
hide_output make -j10
hide_output make install
if [ -f "$docker_dir/$image/Dockerfile" ]; then
if [ "$CI" != "" ]; then
hash_key=/tmp/.docker-hash-key.txt
- find $docker_dir/$image $docker_dir/scripts -type f | \
- sort | \
- xargs cat >> $hash_key
+ rm -f "${hash_key}"
+ echo $image >> $hash_key
+ find $docker_dir -type f | sort | xargs cat >> $hash_key
docker --version >> $hash_key
cksum=$(sha512sum $hash_key | \
awk '{print $1}')
/// ```
```
+As of version 1.34.0, one can also omit the `fn main()`, but you will have to
+disambiguate the error type:
+
+```ignore
+/// ```
+/// use std::io;
+/// let mut input = String::new();
+/// io::stdin().read_line(&mut input)?;
+/// # Ok::<(), io:Error>(())
+/// ```
+```
+
+This is an unfortunate consequence of the `?` operator adding an implicit
+conversion, so type inference fails because the type is not unique. Please note
+that you must write the `(())` in one sequence without intermediate whitespace
+so that rustdoc understands you want an implicit `Result`-returning function.
+
## Documenting macros
Here’s an example of documenting a macro:
sample usage: src/etc/generate-deriving-span-tests.py
"""
-import os, datetime, stat, re
+import os, stat
TEST_DIR = os.path.abspath(
os.path.join(os.path.dirname(__file__), '../test/ui/derives/'))
-YEAR = datetime.datetime.now().year
-
-TEMPLATE = """
+TEMPLATE = """\
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
{error_deriving}
errors = '\n'.join('//~%s ERROR' % ('^' * n) for n in range(error_count))
code = string.format(traits = all_traits, errors = errors)
- return TEMPLATE.format(year = YEAR, error_deriving=error_deriving, code = code)
+ return TEMPLATE.format(error_deriving=error_deriving, code = code)
def write_file(name, string):
test_file = os.path.join(TEST_DIR, 'derives-span-%s.rs' % name)
- with open(test_file) as f:
- old_str = f.read()
- old_str_ignoring_date = re.sub(r'^// Copyright \d+',
- '// Copyright {year}'.format(year = YEAR), old_str)
- if old_str_ignoring_date == string:
- # if all we're doing is updating the copyright year, ignore it
- return 0
-
# set write permission if file exists, so it can be changed
if os.path.exists(test_file):
os.chmod(test_file, stat.S_IWUSR)
# mark file read-only
os.chmod(test_file, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH)
- return 1
-
ENUM = 1
STRUCT = 2
('Hash', [], 1)]:
traits[trait] = (ALL, supers, errs)
-files = 0
-
for (trait, (types, super_traits, error_count)) in traits.items():
mk = lambda ty: create_test_case(ty, trait, super_traits, error_count)
if types & ENUM:
- files += write_file(trait + '-enum', mk(ENUM_TUPLE))
- files += write_file(trait + '-enum-struct-variant', mk(ENUM_STRUCT))
+ write_file(trait + '-enum', mk(ENUM_TUPLE))
+ write_file(trait + '-enum-struct-variant', mk(ENUM_STRUCT))
if types & STRUCT:
- files += write_file(trait + '-struct', mk(STRUCT_FIELDS))
- files += write_file(trait + '-tuple-struct', mk(STRUCT_TUPLE))
-
-print('Generated {files} deriving span test{}.'.format('s' if files != 1 else '', files = files))
+ write_file(trait + '-struct', mk(STRUCT_FIELDS))
+ write_file(trait + '-tuple-struct', mk(STRUCT_TUPLE))
import stat
-template = """
+template = """\
// This file was auto-generated using 'src/etc/generate-keyword-tests.py %s'
fn main() {
os.chmod(test_file, stat.S_IWUSR)
with open(test_file, 'wt') as f:
- f.write(template % (datetime.datetime.now().year, kw, kw, kw))
+ f.write(template % (kw, kw, kw))
# mark file read-only
os.chmod(test_file, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
#![feature(repr_simd)]
-#![feature(slice_sort_by_cached_key)]
#![feature(test)]
extern crate rand;
#[unstable(feature = "ptr_internals", issue = "0", reason = "use into_raw_non_null instead")]
#[inline]
#[doc(hidden)]
- pub fn into_unique(b: Box<T>) -> Unique<T> {
- let unique = b.0;
+ pub fn into_unique(mut b: Box<T>) -> Unique<T> {
+ // Box is kind-of a library type, but recognized as a "unique pointer" by
+ // Stacked Borrows. This function here corresponds to "reborrowing to
+ // a raw pointer", but there is no actual reborrow here -- so
+ // without some care, the pointer we are returning here still carries
+ // the `Uniq` tag. We round-trip through a mutable reference to avoid that.
+ let unique = unsafe { b.0.as_mut() as *mut T };
mem::forget(b);
- unique
+ unsafe { Unique::new_unchecked(unique) }
}
/// Consumes and leaks the `Box`, returning a mutable reference,
root: self.root,
_marker: PhantomData
},
- idx: unsafe { usize::from(*self.as_header().parent_idx.get_ref()) },
+ idx: unsafe { usize::from(*self.as_header().parent_idx.as_ptr()) },
_marker: PhantomData
})
} else {
NodeRef {
height: self.node.height - 1,
node: unsafe {
- self.node.as_internal().edges.get_unchecked(self.idx).get_ref().as_ptr()
+ (&*self.node.as_internal().edges.get_unchecked(self.idx).as_ptr()).as_ptr()
},
root: self.node.root,
_marker: PhantomData
#![feature(rustc_const_unstable)]
#![feature(const_vec_new)]
#![feature(slice_partition_dedup)]
-#![feature(maybe_uninit)]
+#![feature(maybe_uninit, maybe_uninit_slice, maybe_uninit_array)]
#![feature(alloc_layout_extra)]
#![feature(try_trait)]
/// This sort is stable (i.e., does not reorder equal elements) and `O(m n log(m n))`
/// worst-case, where the key function is `O(m)`.
///
+ /// For expensive key functions (e.g. functions that are not simple property accesses or
+ /// basic operations), [`sort_by_cached_key`](#method.sort_by_cached_key) is likely to be
+ /// significantly faster, as it does not recompute element keys.
+ ///
/// When applicable, unstable sorting is preferred because it is generally faster than stable
/// sorting and it doesn't allocate auxiliary memory.
/// See [`sort_unstable_by_key`](#method.sort_unstable_by_key).
/// # Examples
///
/// ```
- /// #![feature(slice_sort_by_cached_key)]
/// let mut v = [-5i32, 4, 32, -3, 2];
///
/// v.sort_by_cached_key(|k| k.to_string());
/// ```
///
/// [pdqsort]: https://github.com/orlp/pdqsort
- #[unstable(feature = "slice_sort_by_cached_key", issue = "34447")]
+ #[stable(feature = "slice_sort_by_cached_key", since = "1.34.0")]
#[inline]
pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord
-#![cfg(not(miri))]
-
use std::any::Any;
use std::sync::{Arc, Weak};
use std::cell::RefCell;
//
// Destructors must be called exactly once per element.
#[test]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn panic_safe() {
static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);
#[test]
fn test_basic_large() {
let mut map = BTreeMap::new();
+ #[cfg(not(miri))] // Miri is too slow
let size = 10000;
+ #[cfg(miri)]
+ let size = 200;
assert_eq!(map.len(), 0);
for i in 0..size {
#[test]
fn test_iter() {
+ #[cfg(not(miri))] // Miri is too slow
let size = 10000;
+ #[cfg(miri)]
+ let size = 200;
// Forwards
let mut map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
#[test]
fn test_iter_rev() {
+ #[cfg(not(miri))] // Miri is too slow
let size = 10000;
+ #[cfg(miri)]
+ let size = 200;
// Forwards
let mut map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
#[test]
fn test_iter_mixed() {
+ #[cfg(not(miri))] // Miri is too slow
let size = 10000;
+ #[cfg(miri)]
+ let size = 200;
// Forwards
let mut map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_range_equal_excluded() {
let map: BTreeMap<_, _> = (0..5).map(|i| (i, i)).collect();
map.range((Excluded(2), Excluded(2)));
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_range_backwards_1() {
let map: BTreeMap<_, _> = (0..5).map(|i| (i, i)).collect();
map.range((Included(3), Included(2)));
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_range_backwards_2() {
let map: BTreeMap<_, _> = (0..5).map(|i| (i, i)).collect();
map.range((Included(3), Excluded(2)));
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_range_backwards_3() {
let map: BTreeMap<_, _> = (0..5).map(|i| (i, i)).collect();
map.range((Excluded(3), Included(2)));
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_range_backwards_4() {
let map: BTreeMap<_, _> = (0..5).map(|i| (i, i)).collect();
map.range((Excluded(3), Excluded(2)));
#[test]
fn test_range_1000() {
+ #[cfg(not(miri))] // Miri is too slow
let size = 1000;
+ #[cfg(miri)]
+ let size = 200;
let map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
fn test(map: &BTreeMap<u32, u32>, size: u32, min: Bound<&u32>, max: Bound<&u32>) {
#[test]
fn test_range() {
+ #[cfg(not(miri))] // Miri is too slow
let size = 200;
+ #[cfg(miri)]
+ let size = 30;
let map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
for i in 0..size {
#[test]
fn test_range_mut() {
+ #[cfg(not(miri))] // Miri is too slow
let size = 200;
+ #[cfg(miri)]
+ let size = 30;
let mut map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
for i in 0..size {
#[test]
fn test_clone() {
let mut map = BTreeMap::new();
+ #[cfg(not(miri))] // Miri is too slow
let size = 100;
+ #[cfg(miri)]
+ let size = 30;
assert_eq!(map.len(), 0);
for i in 0..size {
create_append_test!(test_append_170, 170);
create_append_test!(test_append_181, 181);
create_append_test!(test_append_239, 239);
+#[cfg(not(miri))] // Miri is too slow
create_append_test!(test_append_1700, 1700);
fn rand_data(len: usize) -> Vec<(u32, u32)> {
-#![cfg(not(miri))]
-
mod map;
mod set;
-#![cfg(not(miri))]
-
use std::alloc::{Global, Alloc, Layout, System};
/// Issue #45955.
#![feature(exact_size_is_empty)]
#![feature(pattern)]
#![feature(repeat_generic_slice)]
-#![feature(slice_sort_by_cached_key)]
#![feature(try_reserve)]
#![feature(unboxed_closures)]
#![feature(vecdeque_rotate)]
-#![cfg(not(miri))]
-
use std::any::Any;
use std::rc::{Rc, Weak};
use std::cell::RefCell;
-#![cfg(not(miri))]
-
use std::cell::Cell;
use std::cmp::Ordering::{self, Equal, Greater, Less};
use std::mem;
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_swap_remove_fail() {
let mut v = vec![1];
let _ = v.swap_remove(0);
}
#[test]
+#[cfg(not(miri))] // Miri does not support entropy
fn test_sort() {
let mut rng = thread_rng();
}
#[test]
+#[cfg(not(miri))] // Miri does not support entropy
fn test_sort_stability() {
for len in (2..25).chain(500..510) {
for _ in 0..10 {
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_insert_oob() {
let mut a = vec![1, 2, 3];
a.insert(4, 5);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_remove_fail() {
let mut a = vec![1];
let _ = a.remove(0);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_windowsator_0() {
let v = &[1, 2, 3, 4];
let _it = v.windows(0);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_chunksator_0() {
let v = &[1, 2, 3, 4];
let _it = v.chunks(0);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_chunks_exactator_0() {
let v = &[1, 2, 3, 4];
let _it = v.chunks_exact(0);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_rchunksator_0() {
let v = &[1, 2, 3, 4];
let _it = v.rchunks(0);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_rchunks_exactator_0() {
let v = &[1, 2, 3, 4];
let _it = v.rchunks_exact(0);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_overflow_does_not_cause_segfault() {
let mut v = vec![];
v.reserve_exact(!0);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_overflow_does_not_cause_segfault_managed() {
let mut v = vec![Rc::new(1)];
v.reserve_exact(!0);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_mut_chunks_0() {
let mut v = [1, 2, 3, 4];
let _it = v.chunks_mut(0);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_mut_chunks_exact_0() {
let mut v = [1, 2, 3, 4];
let _it = v.chunks_exact_mut(0);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_mut_rchunks_0() {
let mut v = [1, 2, 3, 4];
let _it = v.rchunks_mut(0);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_mut_rchunks_exact_0() {
let mut v = [1, 2, 3, 4];
let _it = v.rchunks_exact_mut(0);
#[test]
#[allow(unused_must_use)] // here, we care about the side effects of `.clone()`
#[cfg_attr(target_os = "emscripten", ignore)]
+#[cfg(not(miri))] // Miri does not support panics
fn test_box_slice_clone_panics() {
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
#[test]
#[should_panic(expected = "destination and source slices have different lengths")]
+#[cfg(not(miri))] // Miri does not support panics
fn test_copy_from_slice_dst_longer() {
let src = [0, 1, 2, 3];
let mut dst = [0; 5];
#[test]
#[should_panic(expected = "destination and source slices have different lengths")]
+#[cfg(not(miri))] // Miri does not support panics
fn test_copy_from_slice_dst_shorter() {
let src = [0, 1, 2, 3];
let mut dst = [0; 3];
#[test]
#[cfg_attr(target_os = "emscripten", ignore)] // no threads
+#[cfg(not(miri))] // Miri does not support panics
fn panic_safe() {
let prev = panic::take_hook();
panic::set_hook(Box::new(move |info| {
}
#[test]
-#[cfg(not(miri))]
fn test_collect() {
let empty = "";
let s: String = empty.chars().collect();
#[test]
fn test_concat_for_different_lengths() {
let empty: &[&str] = &[];
- #[cfg(not(miri))]
test_concat!("", empty);
test_concat!("a", ["a"]);
test_concat!("ab", ["a", "b"]);
#[test]
fn test_join_for_different_lengths() {
let empty: &[&str] = &[];
- #[cfg(not(miri))]
test_join!("", empty, "-");
test_join!("a", ["a"], "-");
test_join!("a-b", ["a", "b"], "-");
assert_eq!("~~~~~".len(), 15);
let empty: &[&str] = &[];
- #[cfg(not(miri))]
test_join!("", empty, "~~~~~");
test_join!("a", ["a"], "~~~~~");
test_join!("a~~~~~b", ["a", "b"], "~~~~~");
}
#[test]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri is too slow
fn test_unsafe_slice() {
assert_eq!("ab", unsafe {"abc".get_unchecked(0..2)});
assert_eq!("bc", unsafe {"abc".get_unchecked(1..3)});
#[test]
fn test_replace() {
let a = "a";
- #[cfg(not(miri))]
assert_eq!("".replace(a, "b"), "");
assert_eq!("a".replace(a, "b"), "b");
assert_eq!("ab".replace(a, "b"), "bb");
// The current implementation of SliceIndex fails to handle methods
// orthogonally from range types; therefore, it is worth testing
// all of the indexing operations on each input.
-#[cfg(not(miri))]
mod slice_index {
// Test a slicing operation **that should succeed,**
// testing it on all of the indexing methods.
// to be used in `should_panic`)
#[test]
#[should_panic(expected = "out of bounds")]
+ #[cfg(not(miri))] // Miri does not support panics
fn assert_range_eq_can_fail_by_panic() {
assert_range_eq!("abc", 0..5, "abc");
}
// to be used in `should_panic`)
#[test]
#[should_panic(expected = "==")]
+ #[cfg(not(miri))] // Miri does not support panics
fn assert_range_eq_can_fail_by_inequality() {
assert_range_eq!("abc", 0..2, "abc");
}
#[test]
#[should_panic(expected = $expect_msg)]
+ #[cfg(not(miri))] // Miri does not support panics
fn index_fail() {
let v: String = $data.into();
let v: &str = &v;
#[test]
#[should_panic(expected = $expect_msg)]
+ #[cfg(not(miri))] // Miri does not support panics
fn index_mut_fail() {
let mut v: String = $data.into();
let v: &mut str = &mut v;
#[test]
#[cfg(not(target_arch = "asmjs"))] // hits an OOM
+ #[cfg(not(miri))] // Miri is too slow
fn simple_big() {
fn a_million_letter_x() -> String {
let mut i = 0;
#[test]
#[should_panic]
+ #[cfg(not(miri))] // Miri does not support panics
fn test_slice_fail() {
&"中华Việt Nam"[0..2];
}
// check the panic includes the prefix of the sliced string
#[test]
#[should_panic(expected="byte index 1024 is out of bounds of `Lorem ipsum dolor sit amet")]
+ #[cfg(not(miri))] // Miri does not support panics
fn test_slice_fail_truncated_1() {
&LOREM_PARAGRAPH[..1024];
}
// check the truncation in the panic message
#[test]
#[should_panic(expected="luctus, im`[...]")]
+ #[cfg(not(miri))] // Miri does not support panics
fn test_slice_fail_truncated_2() {
&LOREM_PARAGRAPH[..1024];
}
#[test]
#[should_panic]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_str_slice_rangetoinclusive_notok() {
let s = "abcαβγ";
&s[..=3];
#[test]
#[should_panic]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_str_slicemut_rangetoinclusive_notok() {
let mut s = "abcαβγ".to_owned();
let s: &mut str = &mut s;
#[test]
#[should_panic]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_as_bytes_fail() {
// Don't double free. (I'm not sure if this exercises the
// original problem code path anymore.)
#[test]
#[should_panic]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_split_at_boundscheck() {
let s = "ศไทย中华Việt Nam";
s.split_at(1);
}
#[test]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri is too slow
fn test_chars_decoding() {
let mut bytes = [0; 4];
for c in (0..0x110000).filter_map(std::char::from_u32) {
}
#[test]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri is too slow
fn test_chars_rev_decoding() {
let mut bytes = [0; 4];
for c in (0..0x110000).filter_map(std::char::from_u32) {
}
#[test]
-#[cfg(not(miri))]
fn test_str_default() {
use std::default::Default;
assert_eq!("not even a boolean".parse::<bool>().ok(), None);
}
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri is too slow
fn check_contains_all_substrings(s: &str) {
assert!(s.contains(""));
for i in 0..s.len() {
}
#[test]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri is too slow
fn strslice_issue_16589() {
assert!("bananas".contains("nana"));
}
#[test]
-#[cfg(not(miri))]
fn strslice_issue_16878() {
assert!(!"1234567ah012345678901ah".contains("hah"));
assert!(!"00abc01234567890123456789abc".contains("bcabc"));
#[test]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri is too slow
fn test_strslice_contains() {
let x = "There are moments, Jeeves, when one asks oneself, 'Do trousers matter?'";
check_contains_all_substrings(x);
#[test]
fn to_lowercase() {
- #[cfg(not(miri))]
assert_eq!("".to_lowercase(), "");
assert_eq!("AÉDžaé ".to_lowercase(), "aédžaé ");
#[test]
fn to_uppercase() {
- #[cfg(not(miri))]
assert_eq!("".to_uppercase(), "");
assert_eq!("aéDžßfiᾀ".to_uppercase(), "AÉDŽSSFIἈΙ");
}
}
#[test]
-#[cfg(not(miri))]
fn test_repeat() {
assert_eq!("".repeat(3), "");
assert_eq!("abc".repeat(0), "");
-#![cfg(not(miri))]
-
use std::borrow::Cow;
use std::collections::CollectionAllocErr::*;
use std::mem::size_of;
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_split_off_past_end() {
let orig = "Hello, world!";
let mut split = String::from(orig);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_split_off_mid_char() {
let mut orig = String::from("山");
orig.split_off(1);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_str_truncate_split_codepoint() {
let mut s = String::from("\u{FC}"); // ü
s.truncate(1);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn remove_bad() {
"ศ".to_string().remove(1);
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn insert_bad1() {
"".to_string().insert(1, 't');
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn insert_bad2() {
"ệ".to_string().insert(1, 't');
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_replace_range_char_boundary() {
let mut s = "Hello, 世界!".to_owned();
s.replace_range(..8, "");
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_replace_range_out_of_bounds() {
let mut s = String::from("12345");
s.replace_range(5..6, "789");
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_replace_range_inclusive_out_of_bounds() {
let mut s = String::from("12345");
s.replace_range(5..=5, "789");
}
#[test]
+#[cfg(not(miri))] // Miri does not support signalling OOM
fn test_try_reserve() {
// These are the interesting cases:
}
#[test]
+#[cfg(not(miri))] // Miri does not support signalling OOM
fn test_try_reserve_exact() {
// This is exactly the same as test_try_reserve with the method changed.
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_vec_truncate_fail() {
struct BadElem(i32);
impl Drop for BadElem {
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_index_out_of_bounds() {
let vec = vec![1, 2, 3];
let _ = vec[3];
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_slice_out_of_bounds_1() {
let x = vec![1, 2, 3, 4, 5];
&x[!0..];
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_slice_out_of_bounds_2() {
let x = vec![1, 2, 3, 4, 5];
&x[..6];
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_slice_out_of_bounds_3() {
let x = vec![1, 2, 3, 4, 5];
&x[!0..4];
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_slice_out_of_bounds_4() {
let x = vec![1, 2, 3, 4, 5];
&x[1..6];
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_slice_out_of_bounds_5() {
let x = vec![1, 2, 3, 4, 5];
&x[3..2];
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_swap_remove_empty() {
let mut vec = Vec::<i32>::new();
vec.swap_remove(0);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_drain_out_of_bounds() {
let mut v = vec![1, 2, 3, 4, 5];
v.drain(5..6);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_drain_inclusive_out_of_bounds() {
let mut v = vec![1, 2, 3, 4, 5];
v.drain(5..=5);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_splice_out_of_bounds() {
let mut v = vec![1, 2, 3, 4, 5];
let a = [10, 11, 12];
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_splice_inclusive_out_of_bounds() {
let mut v = vec![1, 2, 3, 4, 5];
let a = [10, 11, 12];
#[test]
#[should_panic]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_index_out_of_bounds() {
let mut deq = VecDeque::new();
for i in 1..4 {
// normal append
a.append(&mut b);
assert_eq!(a.iter().cloned().collect::<Vec<_>>(), [1, 2, 3, 4, 5, 6]);
- #[cfg(not(miri))]
assert_eq!(b.iter().cloned().collect::<Vec<_>>(), []);
// append nothing to something
a.append(&mut b);
assert_eq!(a.iter().cloned().collect::<Vec<_>>(), [1, 2, 3, 4, 5, 6]);
- #[cfg(not(miri))]
assert_eq!(b.iter().cloned().collect::<Vec<_>>(), []);
// append something to nothing
b.append(&mut a);
assert_eq!(b.iter().cloned().collect::<Vec<_>>(), [1, 2, 3, 4, 5, 6]);
- #[cfg(not(miri))]
assert_eq!(a.iter().cloned().collect::<Vec<_>>(), []);
}
#[test]
-#[cfg(not(miri))]
fn test_append_permutations() {
fn construct_vec_deque(
push_back: usize,
out
}
+ #[cfg(not(miri))] // Miri is too slow
const MAX: usize = 5;
+ #[cfg(miri)]
+ const MAX: usize = 3;
// Many different permutations of both the `VecDeque` getting appended to
// and the one getting appended are generated to check `append`.
}
#[test]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support signalling OOM
fn test_try_reserve() {
// These are the interesting cases:
}
#[test]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support signalling OOM
fn test_try_reserve_exact() {
// This is exactly the same as test_try_reserve with the method changed.
#![feature(structural_match)]
#![feature(abi_unadjusted)]
#![feature(adx_target_feature)]
-#![feature(maybe_uninit)]
+#![feature(maybe_uninit, maybe_uninit_slice, maybe_uninit_array)]
#![feature(unrestricted_attribute_tokens)]
+#![feature(external_doc)]
#[prelude_import]
#[allow(unused)]
/// A macro to create an array of [`MaybeUninit`]
///
-/// This macro constructs and uninitialized array of the type `[MaybeUninit<K>; N]`.
+/// This macro constructs an uninitialized array of the type `[MaybeUninit<K>; N]`.
///
/// [`MaybeUninit`]: mem/union.MaybeUninit.html
#[macro_export]
-#[unstable(feature = "maybe_uninit", issue = "53491")]
+#[unstable(feature = "maybe_uninit_array", issue = "53491")]
macro_rules! uninitialized_array {
// This `into_initialized` is safe because an array of `MaybeUninit` does not
// require initialization.
/// ever gets used to access memory:
///
/// ```rust,no_run
-/// use std::mem;
+/// #![feature(maybe_uninit)]
+/// use std::mem::{self, MaybeUninit};
///
/// let x: &i32 = unsafe { mem::zeroed() }; // undefined behavior!
+/// // equivalent code with `MaybeUninit`
+/// let x: &i32 = unsafe { MaybeUninit::zeroed().into_initialized() }; // undefined behavior!
/// ```
///
/// This is exploited by the compiler for various optimizations, such as eliding
/// run-time checks and optimizing `enum` layout.
///
-/// Not initializing memory at all (instead of zero--initializing it) causes the same
+/// Not initializing memory at all (instead of zero-initializing it) causes the same
/// issue: after all, the initial value of the variable might just happen to be
-/// one that violates the invariant.
+/// one that violates the invariant. Moreover, uninitialized memory is special
+/// in that the compiler knows that it does not have a fixed value. This makes
+/// it undefined behavior to have uninitialized data in a variable even if that
+/// variable has otherwise no restrictions about which values are valid:
+///
+/// ```rust,no_run
+/// #![feature(maybe_uninit)]
+/// use std::mem::{self, MaybeUninit};
+///
+/// let x: i32 = unsafe { mem::uninitialized() }; // undefined behavior!
+/// // equivalent code with `MaybeUninit`
+/// let x: i32 = unsafe { MaybeUninit::uninitialized().into_initialized() }; // undefined behavior!
+/// ```
+/// (Notice that the rules around uninitialized integers are not finalized yet, but
+/// until they are, it is advisable to avoid them.)
///
/// `MaybeUninit` serves to enable unsafe code to deal with uninitialized data:
/// it is a signal to the compiler indicating that the data here might *not*
/// #![feature(maybe_uninit)]
/// use std::mem::MaybeUninit;
///
-/// // Create an explicitly uninitialized reference.
+/// // Create an explicitly uninitialized reference. The compiler knows that data inside
+/// // a `MaybeUninit` may be invalid, and hence this is not UB:
/// let mut x = MaybeUninit::<&i32>::uninitialized();
/// // Set it to a valid value.
/// x.set(&0);
/// ```
///
/// The compiler then knows to not optimize this code.
+// FIXME before stabilizing, explain how to initialize a struct field-by-field.
#[allow(missing_debug_implementations)]
#[unstable(feature = "maybe_uninit", issue = "53491")]
// NOTE after stabilizing `MaybeUninit` proceed to deprecate `mem::{uninitialized,zeroed}`
}
}
+ /// Gets a pointer to the contained value. Reading from this pointer or turning it
+ /// into a reference will be undefined behavior unless the `MaybeUninit` is initialized.
+ #[unstable(feature = "maybe_uninit", issue = "53491")]
+ #[inline(always)]
+ pub fn as_ptr(&self) -> *const T {
+ unsafe { &*self.value as *const T }
+ }
+
+ /// Gets a mutable pointer to the contained value. Reading from this pointer or turning it
+ /// into a reference will be undefined behavior unless the `MaybeUninit` is initialized.
+ #[unstable(feature = "maybe_uninit", issue = "53491")]
+ #[inline(always)]
+ pub fn as_mut_ptr(&mut self) -> *mut T {
+ unsafe { &mut *self.value as *mut T }
+ }
+
/// Extracts the value from the `MaybeUninit` container. This is a great way
/// to ensure that the data will get dropped, because the resulting `T` is
/// subject to the usual drop handling.
/// # Unsafety
///
/// It is up to the caller to guarantee that the `MaybeUninit` really is in an initialized
- /// state, otherwise this will immediately cause undefined behavior.
+ /// state. Calling this when the content is not yet fully initialized causes undefined
+ /// behavior.
#[unstable(feature = "maybe_uninit", issue = "53491")]
#[inline(always)]
pub unsafe fn into_initialized(self) -> T {
ManuallyDrop::into_inner(self.value)
}
- /// Deprecated alternative to `into_initialized`. Will never get stabilized.
- /// Exists only to transition stdsimd to `into_initialized`.
- #[inline(always)]
- #[allow(unused)]
- pub(crate) unsafe fn into_inner(self) -> T {
- self.into_initialized()
- }
-
/// Gets a reference to the contained value.
///
/// # Unsafety
///
/// It is up to the caller to guarantee that the `MaybeUninit` really is in an initialized
- /// state, otherwise this will immediately cause undefined behavior.
- #[unstable(feature = "maybe_uninit", issue = "53491")]
+ /// state. Calling this when the content is not yet fully initialized causes undefined
+ /// behavior.
+ #[unstable(feature = "maybe_uninit_ref", issue = "53491")]
#[inline(always)]
pub unsafe fn get_ref(&self) -> &T {
&*self.value
/// # Unsafety
///
/// It is up to the caller to guarantee that the `MaybeUninit` really is in an initialized
- /// state, otherwise this will immediately cause undefined behavior.
+ /// state. Calling this when the content is not yet fully initialized causes undefined
+ /// behavior.
// FIXME(#53491): We currently rely on the above being incorrect, i.e., we have references
// to uninitialized data (e.g., in `libcore/fmt/float.rs`). We should make
// a final decision about the rules before stabilization.
- #[unstable(feature = "maybe_uninit", issue = "53491")]
+ #[unstable(feature = "maybe_uninit_ref", issue = "53491")]
#[inline(always)]
pub unsafe fn get_mut(&mut self) -> &mut T {
&mut *self.value
}
- /// Gets a pointer to the contained value. Reading from this pointer or turning it
- /// into a reference will be undefined behavior unless the `MaybeUninit` is initialized.
- #[unstable(feature = "maybe_uninit", issue = "53491")]
- #[inline(always)]
- pub fn as_ptr(&self) -> *const T {
- unsafe { &*self.value as *const T }
- }
-
- /// Get sa mutable pointer to the contained value. Reading from this pointer or turning it
- /// into a reference will be undefined behavior unless the `MaybeUninit` is initialized.
- #[unstable(feature = "maybe_uninit", issue = "53491")]
- #[inline(always)]
- pub fn as_mut_ptr(&mut self) -> *mut T {
- unsafe { &mut *self.value as *mut T }
- }
-
/// Gets a pointer to the first element of the array.
- #[unstable(feature = "maybe_uninit", issue = "53491")]
+ #[unstable(feature = "maybe_uninit_slice", issue = "53491")]
#[inline(always)]
pub fn first_ptr(this: &[MaybeUninit<T>]) -> *const T {
this as *const [MaybeUninit<T>] as *const T
}
/// Gets a mutable pointer to the first element of the array.
- #[unstable(feature = "maybe_uninit", issue = "53491")]
+ #[unstable(feature = "maybe_uninit_slice", issue = "53491")]
#[inline(always)]
pub fn first_ptr_mut(this: &mut [MaybeUninit<T>]) -> *mut T {
this as *mut [MaybeUninit<T>] as *mut T
/// randomization to avoid degenerate cases, but with a fixed seed to always provide
/// deterministic behavior.
///
+ /// Due to its key calling strategy, [`sort_unstable_by_key`](#method.sort_unstable_by_key)
+ /// is likely to be slower than [`sort_by_cached_key`](#method.sort_by_cached_key) in
+ /// cases where the key function is expensive.
+ ///
/// # Examples
///
/// ```
-#![cfg(not(miri))]
-
use core::cell::*;
use core::default::Default;
use std::mem::drop;
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn discard_doesnt_unborrow() {
let x = RefCell::new(0);
let _b = x.borrow();
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn refcell_swap_borrows() {
let x = RefCell::new(0);
let _b = x.borrow();
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn refcell_replace_borrows() {
let x = RefCell::new(0);
let _b = x.borrow();
-#![cfg(not(miri))]
-
mod builders;
mod float;
mod num;
#[test]
+#[cfg(not(miri))] // Miri cannot print pointers
fn test_format_flags() {
// No residual flags left by pointer formatting
let p = "".as_ptr();
}
#[test]
+#[cfg(not(miri))] // Miri cannot print pointers
fn test_pointer_formats_data_pointer() {
let b: &[u8] = b"";
let s: &str = "";
-#![cfg(not(miri))]
-
mod sip;
use std::hash::{Hash, Hasher};
let cs: &mut [u8] = &mut [1, 2, 3];
let ptr = cs.as_ptr();
let slice_ptr = cs as *const [u8];
+ #[cfg(not(miri))] // Miri cannot hash pointers
assert_eq!(hash(&slice_ptr), hash(&ptr) + cs.len() as u64);
let slice_ptr = cs as *mut [u8];
+ #[cfg(not(miri))] // Miri cannot hash pointers
assert_eq!(hash(&slice_ptr), hash(&ptr) + cs.len() as u64);
}
}
#[test]
-#[cfg(not(miri))]
fn test_iterator_step_by_nth() {
let mut it = (0..16).step_by(5);
assert_eq!(it.nth(0), Some(0));
}
#[test]
-#[cfg(not(miri))]
fn test_iterator_step_by_nth_overflow() {
#[cfg(target_pointer_width = "8")]
type Bigger = u16;
#[test]
#[should_panic]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_iterator_step_by_zero() {
let mut it = (0..).step_by(0);
it.next();
}
#[test]
-#[cfg(not(miri))]
fn test_iterator_step_by_size_hint() {
struct StubSizeHint(usize, Option<usize>);
impl Iterator for StubSizeHint {
#[test]
#[should_panic]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_rposition_panic() {
let v: [(Box<_>, Box<_>); 4] =
[(box 0, box 0), (box 0, box 0),
}
#[test]
-#[cfg(not(miri))]
fn test_range_step() {
#![allow(deprecated)]
}
#[test]
-#[cfg(not(miri))]
fn test_step_by_skip() {
assert_eq!((0..640).step_by(128).skip(1).collect::<Vec<_>>(), [128, 256, 384, 512]);
assert_eq!((0..=50).step_by(10).nth(3), Some(30));
}
#[test]
-#[cfg(not(miri))]
fn test_range_inclusive_step() {
assert_eq!((0..=50).step_by(10).collect::<Vec<_>>(), [0, 10, 20, 30, 40, 50]);
assert_eq!((0..=5).step_by(1).collect::<Vec<_>>(), [0, 1, 2, 3, 4, 5]);
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_from_u64_overflow() {
Big::from_u64(0x1000000);
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_add_overflow_1() {
Big::from_small(1).add(&Big::from_u64(0xffffff));
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_add_overflow_2() {
Big::from_u64(0xffffff).add(&Big::from_small(1));
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_add_small_overflow() {
Big::from_u64(0xffffff).add_small(1);
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_sub_underflow_1() {
Big::from_u64(0x10665).sub(&Big::from_u64(0x10666));
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_sub_underflow_2() {
Big::from_small(0).sub(&Big::from_u64(0x123456));
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_mul_small_overflow() {
Big::from_u64(0x800000).mul_small(2);
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_mul_pow2_overflow_1() {
Big::from_u64(0x1).mul_pow2(24);
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_mul_pow2_overflow_2() {
Big::from_u64(0x123).mul_pow2(16);
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_mul_pow5_overflow_1() {
Big::from_small(1).mul_pow5(12);
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_mul_pow5_overflow_2() {
Big::from_small(230).mul_pow5(8);
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_mul_digits_overflow_1() {
Big::from_u64(0x800000).mul_digits(&[2]);
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_mul_digits_overflow_2() {
Big::from_u64(0x1000).mul_digits(&[0, 0x10]);
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn test_get_bit_out_of_range() {
Big::from_small(42).get_bit(24);
}
}
#[test]
+#[cfg(not(miri))] // Miri is too slow
fn subnormals() {
test_literal!(5e-324);
test_literal!(91e-324);
}
#[test]
+#[cfg(not(miri))] // Miri is too slow
fn infinity() {
test_literal!(1e400);
test_literal!(1e309);
+#![cfg(not(miri))] // Miri does not implement ldexp, which most tests here need
+
use std::prelude::v1::*;
use std::{str, i16, f32, f64, fmt};
-#![cfg(not(miri))]
-
use core::convert::{TryFrom, TryInto};
use core::cmp::PartialEq;
use core::fmt::Debug;
}
#[test] #[should_panic]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_option_too_much_dance() {
struct A;
let mut y = Some(A);
#[test]
#[should_panic]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_unwrap_panic1() {
let x: Option<isize> = None;
x.unwrap();
#[test]
#[should_panic]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_unwrap_panic2() {
let x: Option<String> = None;
x.unwrap();
-#![cfg(not(miri))]
-
use core::ptr::*;
use core::cell::RefCell;
}
#[test]
+#[cfg(not(miri))] // This test performs invalid OOB pointer arithmetic
fn test_is_null() {
let p: *const isize = null();
assert!(p.is_null());
}
#[test]
+#[cfg(not(miri))] // This test is UB according to Stacked Borrows
fn test_as_mut() {
unsafe {
let p: *mut isize = null_mut();
}
#[test]
+#[cfg(not(miri))] // This test performs invalid OOB pointer arithmetic
fn test_ptr_subtraction() {
unsafe {
let xs = vec![0,1,2,3,4,5,6,7,8,9];
#[test]
#[allow(warnings)]
+#[cfg(not(miri))] // Miri cannot hash pointers
// Have a symbol for the test below. It doesn’t need to be an actual variadic function, match the
// ABI, or even point to an actual executable code, because the function itself is never invoked.
#[no_mangle]
}
#[test]
+#[cfg(not(miri))] // Miri cannot compute actual alignment of an allocation
fn align_offset_zst() {
// For pointers of stride = 0, the pointer is already aligned or it cannot be aligned at
// all, because no amount of elements will align the pointer.
}
#[test]
+#[cfg(not(miri))] // Miri cannot compute actual alignment of an allocation
fn align_offset_stride1() {
// For pointers of stride = 1, the pointer can always be aligned. The offset is equal to
// number of bytes.
}
#[test]
+#[cfg(not(miri))] // Miri is too slow
fn align_offset_weird_strides() {
#[repr(packed)]
struct A3(u16, u8);
#[test]
#[should_panic]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
pub fn test_unwrap_or_else_panic() {
fn handler(msg: &'static str) -> isize {
if msg == "I got this." {
}
#[test]
#[should_panic(expected="Got expected error: \"All good\"")]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
pub fn test_expect_err() {
let err: Result<isize, &'static str> = Err("All good");
err.expect("Got expected error");
}
#[test]
#[should_panic(expected="Got expected ok: \"All good\"")]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
pub fn test_expect_err_ok() {
let err: Result<&'static str, isize> = Ok("All good");
err.expect_err("Got expected ok");
// to be used in `should_panic`)
#[test]
#[should_panic(expected = "out of range")]
- #[cfg(not(miri))]
+ #[cfg(not(miri))] // Miri does not support panics
fn assert_range_eq_can_fail_by_panic() {
assert_range_eq!([0, 1, 2], 0..5, [0, 1, 2]);
}
// to be used in `should_panic`)
#[test]
#[should_panic(expected = "==")]
- #[cfg(not(miri))]
+ #[cfg(not(miri))] // Miri does not support panics
fn assert_range_eq_can_fail_by_inequality() {
assert_range_eq!([0, 1, 2], 0..2, [0, 1, 2]);
}
#[test]
#[should_panic(expected = $expect_msg)]
- #[cfg(not(miri))]
+ #[cfg(not(miri))] // Miri does not support panics
fn index_fail() {
let v = $data;
let v: &[_] = &v;
#[test]
#[should_panic(expected = $expect_msg)]
- #[cfg(not(miri))]
+ #[cfg(not(miri))] // Miri does not support panics
fn index_mut_fail() {
let mut v = $data;
let v: &mut [_] = &mut v;
#[test]
#[cfg(not(target_arch = "wasm32"))]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support entropy
fn sort_unstable() {
use core::cmp::Ordering::{Equal, Greater, Less};
use core::slice::heapsort;
}
#[test]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri cannot compute actual alignment of an allocation
fn test_align_to_simple() {
let bytes = [1u8, 2, 3, 4, 5, 6, 7];
let (prefix, aligned, suffix) = unsafe { bytes.align_to::<u16>() };
}
#[test]
-#[cfg(not(miri))]
fn test_align_to_zst() {
let bytes = [1, 2, 3, 4, 5, 6, 7];
let (prefix, aligned, suffix) = unsafe { bytes.align_to::<()>() };
}
#[test]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri cannot compute actual alignment of an allocation
fn test_align_to_non_trivial() {
#[repr(align(8))] struct U64(u64, u64);
#[repr(align(8))] struct U64U64U32(u64, u64, u32);
}
#[test]
-#[cfg(not(miri))]
fn test_align_to_empty_mid() {
use core::mem;
#[test]
#[should_panic(expected = "src is out of bounds")]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_copy_within_panics_src_too_long() {
let mut bytes = *b"Hello, World!";
// The length is only 13, so 14 is out of bounds.
#[test]
#[should_panic(expected = "dest is out of bounds")]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_copy_within_panics_dest_too_long() {
let mut bytes = *b"Hello, World!";
// The length is only 13, so a slice of length 4 starting at index 10 is out of bounds.
}
#[test]
#[should_panic(expected = "src end is before src start")]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support panics
fn test_copy_within_panics_src_inverted() {
let mut bytes = *b"Hello, World!";
// 2 is greater than 1, so this range is invalid.
-#![cfg(not(miri))]
-
use core::time::Duration;
#[test]
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn sub_bad1() {
let _ = Duration::new(0, 0) - Duration::new(0, 1);
}
#[test]
#[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
fn sub_bad2() {
let _ = Duration::new(0, 0) - Duration::new(1, 0);
}
fn baz<'a>(x: &'a str, y: &str) -> &str { }
```
-Lifetime elision in implementation headers was part of the lifetime elision
-RFC. It is, however, [currently unimplemented][iss15872].
-
[book-le]: https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html#lifetime-elision
-[iss15872]: https://github.com/rust-lang/rust/issues/15872
"##,
E0119: r##"
AssociatedExistential(DefId),
PrimTy(hir::PrimTy),
TyParam(DefId),
- ConstParam(DefId),
SelfTy(Option<DefId> /* trait */, Option<DefId> /* impl */),
ToolMod, // e.g., `rustfmt` in `#[rustfmt::skip]`
// Value namespace
Fn(DefId),
Const(DefId),
+ ConstParam(DefId),
Static(DefId, bool /* is_mutbl */),
StructCtor(DefId, CtorKind), // `DefId` refers to `NodeId` of the struct's constructor
VariantCtor(DefId, CtorKind), // `DefId` refers to the enum variant
match generic_arg {
GenericArg::Lifetime(lt) => self.visit_lifetime(lt),
GenericArg::Type(ty) => self.visit_ty(ty),
+ GenericArg::Const(ct) => self.visit_anon_const(&ct.value),
}
}
fn visit_lifetime(&mut self, lifetime: &'v Lifetime) {
match param.kind {
GenericParamKind::Lifetime { .. } => {}
GenericParamKind::Type { ref default, .. } => walk_list!(visitor, visit_ty, default),
+ GenericParamKind::Const { ref ty } => visitor.visit_ty(ty),
}
walk_list!(visitor, visit_param_bound, ¶m.bounds);
}
visitor.visit_id(statement.id);
match statement.node {
StmtKind::Local(ref local) => visitor.visit_local(local),
- StmtKind::Item(ref item) => visitor.visit_nested_item(**item),
+ StmtKind::Item(item) => visitor.visit_nested_item(item),
StmtKind::Expr(ref expression) |
StmtKind::Semi(ref expression) => {
visitor.visit_expr(expression)
use crate::hir::map::{DefKey, DefPathData, Definitions};
use crate::hir::def_id::{DefId, DefIndex, DefIndexAddressSpace, CRATE_DEF_INDEX};
use crate::hir::def::{Def, PathResolution, PerNS};
-use crate::hir::GenericArg;
+use crate::hir::{GenericArg, ConstArg};
use crate::lint::builtin::{self, PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES,
ELIDED_LIFETIMES_IN_PATHS};
use crate::middle::cstore::CrateStore;
ast::GenericArg::Lifetime(lt) => GenericArg::Lifetime(self.lower_lifetime(<)),
ast::GenericArg::Type(ty) => GenericArg::Type(self.lower_ty_direct(&ty, itctx)),
ast::GenericArg::Const(ct) => {
- // FIXME(const_generics): const generics are not yet defined in the HIR.
- self.sess.struct_span_err(
- ct.value.span,
- "const generics in any position are currently unsupported",
- ).emit();
- self.sess.abort_if_errors();
- bug!();
+ GenericArg::Const(ConstArg {
+ value: self.lower_anon_const(&ct),
+ span: ct.value.span,
+ })
}
}
}
(hir::ParamName::Plain(ident), kind)
}
- GenericParamKind::Const { .. } => {
- // FIXME(const_generics): const generics are not yet defined in the HIR.
- self.sess.struct_span_err(
- param.ident.span,
- "const generics in any position are currently unsupported",
- ).emit();
- self.sess.abort_if_errors();
- bug!();
+ GenericParamKind::Const { ref ty } => {
+ (hir::ParamName::Plain(param.ident), hir::GenericParamKind::Const {
+ ty: self.lower_ty(&ty, ImplTraitContext::disallowed()),
+ })
}
};
hir::Stmt {
id: node_id,
hir_id,
- node: hir::StmtKind::Item(P(item_id)),
+ node: hir::StmtKind::Item(item_id),
span: s.span,
}
})
hir::Stmt {
id: node_id,
hir_id,
- node: hir::StmtKind::Item(P(item_id)),
+ node: hir::StmtKind::Item(item_id),
span: s.span,
}
})
Some(match param.kind {
GenericParamKind::Lifetime { .. } => Def::Local(param.id),
GenericParamKind::Type { .. } => Def::TyParam(self.local_def_id(param.id)),
+ GenericParamKind::Const { .. } => Def::ConstParam(self.local_def_id(param.id)),
})
}
}
}
}
+#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
+pub struct ConstArg {
+ pub value: AnonConst,
+ pub span: Span,
+}
+
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
pub enum GenericArg {
Lifetime(Lifetime),
Type(Ty),
+ Const(ConstArg),
}
impl GenericArg {
match self {
GenericArg::Lifetime(l) => l.span,
GenericArg::Type(t) => t.span,
+ GenericArg::Const(c) => c.span,
}
}
match self {
GenericArg::Lifetime(l) => l.id,
GenericArg::Type(t) => t.id,
+ GenericArg::Const(c) => c.value.id,
}
}
}
}
break;
}
+ GenericArg::Const(_) => {}
}
}
}
match arg {
GenericArg::Lifetime(_) => own_counts.lifetimes += 1,
GenericArg::Type(_) => own_counts.types += 1,
+ GenericArg::Const(_) => own_counts.consts += 1,
};
}
Type {
default: Option<P<Ty>>,
synthetic: Option<SyntheticTyParamKind>,
+ },
+ Const {
+ ty: P<Ty>,
}
}
pub struct GenericParamCount {
pub lifetimes: usize,
pub types: usize,
+ pub consts: usize,
}
/// Represents lifetimes and type parameters attached to a declaration
match param.kind {
GenericParamKind::Lifetime { .. } => own_counts.lifetimes += 1,
GenericParamKind::Type { .. } => own_counts.types += 1,
+ GenericParamKind::Const { .. } => own_counts.consts += 1,
};
}
pub enum StmtKind {
/// A local (`let`) binding.
Local(P<Local>),
+
/// An item binding.
- Item(P<ItemId>),
+ Item(ItemId),
/// An expression without a trailing semi-colon (must have unit type).
Expr(P<Expr>),
/// These are usually found nested inside types (e.g., array lengths)
/// or expressions (e.g., repeat counts), and also used to define
/// explicit discriminant values for enum variants.
-#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Debug)]
pub struct AnonConst {
pub id: NodeId,
pub hir_id: HirId,
}
}
- pub fn is_const(&self) -> bool {
- match self.node {
- PatKind::Path(hir::QPath::TypeRelative(..)) => true,
- PatKind::Path(hir::QPath::Resolved(_, ref path)) => {
- match path.def {
- Def::Const(..) | Def::AssociatedConst(..) => true,
- _ => false
- }
- }
- _ => false
- }
- }
-
/// Call `f` on every "binding" in a pattern, e.g., on `a` in
/// `match foo() { Some(a) => (), None => () }`
pub fn each_binding<F>(&self, mut f: F)
}
self.end()?
}
- hir::StmtKind::Item(ref item) => {
- self.ann.nested(self, Nested::Item(**item))?
+ hir::StmtKind::Item(item) => {
+ self.ann.nested(self, Nested::Item(item))?
}
hir::StmtKind::Expr(ref expr) => {
self.space_if_not_bol()?;
}
};
- let mut types = vec![];
- let mut elide_lifetimes = true;
- for arg in &generic_args.args {
- match arg {
- GenericArg::Lifetime(lt) => {
- if !lt.is_elided() {
- elide_lifetimes = false;
- }
- }
- GenericArg::Type(ty) => {
- types.push(ty);
- }
+ let mut nonelided_generic_args: bool = false;
+ let elide_lifetimes = generic_args.args.iter().all(|arg| match arg {
+ GenericArg::Lifetime(lt) => lt.is_elided(),
+ _ => {
+ nonelided_generic_args = true;
+ true
}
- }
- if !elide_lifetimes {
+ });
+
+ if nonelided_generic_args {
start_or_comma(self)?;
self.commasep(Inconsistent, &generic_args.args, |s, generic_arg| {
match generic_arg {
- GenericArg::Lifetime(lt) => s.print_lifetime(lt),
+ GenericArg::Lifetime(lt) if !elide_lifetimes => s.print_lifetime(lt),
+ GenericArg::Lifetime(_) => Ok(()),
GenericArg::Type(ty) => s.print_type(ty),
+ GenericArg::Const(ct) => s.print_anon_const(&ct.value),
}
})?;
- } else if !types.is_empty() {
- start_or_comma(self)?;
- self.commasep(Inconsistent, &types, |s, ty| s.print_type(&ty))?;
}
// FIXME(eddyb) This would leak into error messages, e.g.:
}
pub fn print_generic_param(&mut self, param: &GenericParam) -> io::Result<()> {
+ if let GenericParamKind::Const { .. } = param.kind {
+ self.word_space("const")?;
+ }
+
self.print_ident(param.name.ident())?;
+
match param.kind {
GenericParamKind::Lifetime { .. } => {
let mut sep = ":";
_ => Ok(()),
}
}
+ GenericParamKind::Const { ref ty } => {
+ self.word_space(":")?;
+ self.print_type(ty)
+ }
}
}
args
});
+impl_stable_hash_for!(struct hir::ConstArg {
+ value,
+ span,
+});
+
impl_stable_hash_for!(enum hir::GenericArg {
Lifetime(lt),
- Type(ty)
+ Type(ty),
+ Const(ct),
});
impl_stable_hash_for!(struct hir::GenericArgs {
default.hash_stable(hcx, hasher);
synthetic.hash_stable(hcx, hasher);
}
+ hir::GenericParamKind::Const { ref ty } => {
+ ty.hash_stable(hcx, hasher);
+ }
}
}
}
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_attrs)]
#![feature(slice_patterns)]
-#![feature(slice_sort_by_cached_key)]
#![feature(specialization)]
#![feature(unboxed_closures)]
#![feature(thread_local)]
hir_id, expr_ty, def);
match def {
- Def::StructCtor(..) | Def::VariantCtor(..) | Def::Const(..) |
+ Def::StructCtor(..) | Def::VariantCtor(..) | Def::Const(..) | Def::ConstParam(..) |
Def::AssociatedConst(..) | Def::Fn(..) | Def::Method(..) | Def::SelfCtor(..) => {
Ok(self.cat_rvalue_node(hir_id, span, expr_ty))
}
Node::Ty(_) |
Node::MacroDef(_) => {}
_ => {
- bug!("found unexpected thingy in worklist: {}",
- self.tcx.hir().node_to_string(search_item))
+ bug!(
+ "found unexpected node kind in worklist: {} ({:?})",
+ self.tcx.hir().node_to_string(search_item),
+ node,
+ );
}
}
}
} else {
0
};
- let mut type_count = 0;
- let lifetimes = generics
- .params
- .iter()
- .filter_map(|param| match param.kind {
- GenericParamKind::Lifetime { .. } => {
- Some(Region::early(&self.tcx.hir(), &mut index, param))
- }
- GenericParamKind::Type { .. } => {
- type_count += 1;
- None
- }
- })
- .collect();
+ let mut non_lifetime_count = 0;
+ let lifetimes = generics.params.iter().filter_map(|param| match param.kind {
+ GenericParamKind::Lifetime { .. } => {
+ Some(Region::early(&self.tcx.hir(), &mut index, param))
+ }
+ GenericParamKind::Type { .. } |
+ GenericParamKind::Const { .. } => {
+ non_lifetime_count += 1;
+ None
+ }
+ }).collect();
let scope = Scope::Binder {
lifetimes,
- next_early_index: index + type_count,
+ next_early_index: index + non_lifetime_count,
abstract_type_parent: true,
track_lifetime_uses,
s: ROOT_SCOPE,
let mut elision = None;
let mut lifetimes = FxHashMap::default();
- let mut type_count = 0;
+ let mut non_lifetime_count = 0;
for param in &generics.params {
match param.kind {
GenericParamKind::Lifetime { .. } => {
lifetimes.insert(name, reg);
}
}
- GenericParamKind::Type { .. } => {
- type_count += 1;
+ GenericParamKind::Type { .. } |
+ GenericParamKind::Const { .. } => {
+ non_lifetime_count += 1;
}
}
}
- let next_early_index = index + type_count;
+ let next_early_index = index + non_lifetime_count;
if let Some(elision_region) = elision {
let scope = Scope::Elision {
let generics = &trait_item.generics;
let mut index = self.next_early_index();
debug!("visit_ty: index = {}", index);
- let mut type_count = 0;
- let lifetimes = generics
- .params
- .iter()
- .filter_map(|param| match param.kind {
- GenericParamKind::Lifetime { .. } => {
- Some(Region::early(&self.tcx.hir(), &mut index, param))
- }
- GenericParamKind::Type { .. } => {
- type_count += 1;
- None
- }
- })
- .collect();
+ let mut non_lifetime_count = 0;
+ let lifetimes = generics.params.iter().filter_map(|param| match param.kind {
+ GenericParamKind::Lifetime { .. } => {
+ Some(Region::early(&self.tcx.hir(), &mut index, param))
+ }
+ GenericParamKind::Type { .. } |
+ GenericParamKind::Const { .. } => {
+ non_lifetime_count += 1;
+ None
+ }
+ }).collect();
let scope = Scope::Binder {
lifetimes,
- next_early_index: index + type_count,
+ next_early_index: index + non_lifetime_count,
s: self.scope,
track_lifetime_uses: true,
abstract_type_parent: true,
Type(ref ty) => {
let generics = &impl_item.generics;
let mut index = self.next_early_index();
- let mut next_early_index = index;
+ let mut non_lifetime_count = 0;
debug!("visit_ty: index = {}", index);
- let lifetimes = generics
- .params
- .iter()
- .filter_map(|param| match param.kind {
- GenericParamKind::Lifetime { .. } => {
- Some(Region::early(&self.tcx.hir(), &mut index, param))
- }
- GenericParamKind::Type { .. } => {
- next_early_index += 1;
- None
- }
- })
- .collect();
+ let lifetimes = generics.params.iter().filter_map(|param| match param.kind {
+ GenericParamKind::Lifetime { .. } => {
+ Some(Region::early(&self.tcx.hir(), &mut index, param))
+ }
+ GenericParamKind::Const { .. } |
+ GenericParamKind::Type { .. } => {
+ non_lifetime_count += 1;
+ None
+ }
+ }).collect();
let scope = Scope::Binder {
lifetimes,
- next_early_index,
+ next_early_index: index + non_lifetime_count,
s: self.scope,
track_lifetime_uses: true,
abstract_type_parent: true,
let mut index = self.next_early_index();
let mut next_early_index = index;
debug!("visit_ty: index = {}", index);
- let lifetimes = generics
- .params
- .iter()
- .filter_map(|param| match param.kind {
- GenericParamKind::Lifetime { .. } => {
- Some(Region::early(&self.tcx.hir(), &mut index, param))
- }
- GenericParamKind::Type { .. } => {
- next_early_index += 1;
- None
- }
- })
- .collect();
+ let lifetimes = generics.params.iter().filter_map(|param| match param.kind {
+ GenericParamKind::Lifetime { .. } => {
+ Some(Region::early(&self.tcx.hir(), &mut index, param))
+ }
+ GenericParamKind::Type { .. } => {
+ next_early_index += 1;
+ None
+ }
+ GenericParamKind::Const { .. } => {
+ next_early_index += 1;
+ None
+ }
+ }).collect();
let scope = Scope::Binder {
lifetimes,
self.visit_ty(&ty);
}
}
+ GenericParamKind::Const { ref ty, .. } => {
+ walk_list!(self, visit_param_bound, ¶m.bounds);
+ self.visit_ty(&ty);
+ }
}
}
for predicate in &generics.where_clause.predicates {
Set1::Many => Set1::Many,
})
}
+ GenericParamKind::Const { .. } => {
+ // Generic consts don't impose any constraints.
+ None
+ }
})
.collect()
}
}
}
- let mut type_count = 0;
- let lifetimes = generics
- .params
- .iter()
- .filter_map(|param| match param.kind {
- GenericParamKind::Lifetime { .. } => {
- if self.map.late_bound.contains(¶m.id) {
- Some(Region::late(&self.tcx.hir(), param))
- } else {
- Some(Region::early(&self.tcx.hir(), &mut index, param))
- }
- }
- GenericParamKind::Type { .. } => {
- type_count += 1;
- None
+ let mut non_lifetime_count = 0;
+ let lifetimes = generics.params.iter().filter_map(|param| match param.kind {
+ GenericParamKind::Lifetime { .. } => {
+ if self.map.late_bound.contains(¶m.id) {
+ Some(Region::late(&self.tcx.hir(), param))
+ } else {
+ Some(Region::early(&self.tcx.hir(), &mut index, param))
}
- })
- .collect();
- let next_early_index = index + type_count;
+ }
+ GenericParamKind::Type { .. } |
+ GenericParamKind::Const { .. } => {
+ non_lifetime_count += 1;
+ None
+ }
+ }).collect();
+ let next_early_index = index + non_lifetime_count;
let scope = Scope::Binder {
lifetimes,
}
i += 1;
}
+ GenericArg::Const(ct) => {
+ self.visit_anon_const(&ct.value);
+ }
}
}
match param.kind {
hir::GenericParamKind::Lifetime { .. } => { /* fall through */ }
- // Types are not late-bound.
- hir::GenericParamKind::Type { .. } => continue,
+ // Neither types nor consts are late-bound.
+ hir::GenericParamKind::Type { .. }
+ | hir::GenericParamKind::Const { .. } => continue,
}
let lt_name = hir::LifetimeName::Param(param.name.modern());
#![feature(nll)]
#![feature(range_contains)]
#![feature(rustc_diagnostic_macros)]
-#![feature(slice_sort_by_cached_key)]
#![feature(optin_builtin_traits)]
#![feature(concat_idents)]
#![feature(link_args)]
("dsp", Some("arm_target_feature")),
("neon", Some("arm_target_feature")),
("v5te", Some("arm_target_feature")),
+ ("v6", Some("arm_target_feature")),
("v6k", Some("arm_target_feature")),
("v6t2", Some("arm_target_feature")),
("v7", Some("arm_target_feature")),
+ ("v8", Some("arm_target_feature")),
("vfp2", Some("arm_target_feature")),
("vfp3", Some("arm_target_feature")),
("vfp4", Some("arm_target_feature")),
#![feature(libc)]
#![feature(rustc_diagnostic_macros)]
#![feature(in_band_lifetimes)]
-#![feature(slice_sort_by_cached_key)]
#![feature(nll)]
#![allow(unused_attributes)]
#![allow(dead_code)]
#![cfg_attr(unix, feature(libc))]
#![feature(nll)]
#![feature(rustc_diagnostic_macros)]
-#![feature(slice_sort_by_cached_key)]
#![feature(set_stdio)]
#![feature(no_debug)]
#![feature(integer_atomics)]
for param in &generics.params {
match param.kind {
GenericParamKind::Lifetime { .. } => {}
- GenericParamKind::Type { .. } => {
- let mut err = cx.struct_span_lint(NO_MANGLE_GENERIC_ITEMS,
- it.span,
- "functions generic over \
- types must be mangled");
+ GenericParamKind::Type { .. } |
+ GenericParamKind::Const { .. } => {
+ let mut err = cx.struct_span_lint(
+ NO_MANGLE_GENERIC_ITEMS,
+ it.span,
+ "functions generic over types or consts must be mangled",
+ );
err.span_suggestion_short(
no_mangle_attr.span,
"remove this attribute",
for param in &generics.params {
let param_name = match param.kind {
- hir::GenericParamKind::Lifetime { .. } => { continue; },
+ hir::GenericParamKind::Lifetime { .. } => continue,
hir::GenericParamKind::Type { .. } => {
match param.name {
- hir::ParamName::Fresh(_) => { continue; },
- hir::ParamName::Error => { continue; },
- hir::ParamName::Plain(name) => name.to_string()
+ hir::ParamName::Fresh(_) => continue,
+ hir::ParamName::Error => continue,
+ hir::ParamName::Plain(name) => name.to_string(),
}
}
+ hir::GenericParamKind::Const { .. } => continue,
};
let bound_spans = self.collect_outlives_bound_spans(
cx, def_id, ¶m_name, ¶m.bounds, infer_static
}
}
}
+
+ fn check_generic_param(&mut self, cx: &LateContext<'_, '_>, param: &hir::GenericParam) {
+ if let GenericParamKind::Const { .. } = param.kind {
+ NonUpperCaseGlobals::check_upper_case(
+ cx,
+ "const parameter",
+ ¶m.name.ident(),
+ );
+ }
+ }
}
#[cfg(test)]
}
}
+ fn encode_info_for_const_param(&mut self, def_id: DefId) -> Entry<'tcx> {
+ debug!("IsolatedEncoder::encode_info_for_const_param({:?})", def_id);
+ let tcx = self.tcx;
+ Entry {
+ kind: EntryKind::Type,
+ visibility: self.lazy(&ty::Visibility::Public),
+ span: self.lazy(&tcx.def_span(def_id)),
+ attributes: LazySeq::empty(),
+ children: LazySeq::empty(),
+ stability: None,
+ deprecation: None,
+
+ ty: Some(self.encode_item_type(def_id)),
+ inherent_impls: LazySeq::empty(),
+ variances: LazySeq::empty(),
+ generics: None,
+ predicates: None,
+ predicates_defined_on: None,
+
+ mir: None,
+ }
+ }
+
fn encode_info_for_closure(&mut self, def_id: DefId) -> Entry<'tcx> {
debug!("IsolatedEncoder::encode_info_for_closure({:?})", def_id);
let tcx = self.tcx;
let encode_info = IsolatedEncoder::encode_info_for_ty_param;
self.record(def_id, encode_info, (def_id, has_default));
}
+ hir::GenericParamKind::Const { .. } => {
+ let def_id = self.tcx.hir().local_def_id(param.id);
+ let encode_info = IsolatedEncoder::encode_info_for_const_param;
+ self.record(def_id, encode_info, def_id);
+ }
}
}
}
#![feature(proc_macro_internals)]
#![feature(proc_macro_quote)]
#![feature(rustc_diagnostic_macros)]
-#![feature(slice_sort_by_cached_key)]
#![feature(crate_visibility_modifier)]
#![feature(specialization)]
#![feature(rustc_private)]
```
"##,
+E0723: r##"
+An feature unstable in `const` contexts was used.
+
+Erroneous code example:
+
+```compile_fail,E0723
+trait T {}
+
+impl T for () {}
+
+const fn foo() -> impl T { // error: `impl Trait` in const fn is unstable
+ ()
+}
+```
+
+To enable this feature on a nightly version of rustc, add the `const_fn`
+feature flag:
+
+```
+#![feature(const_fn)]
+
+trait T {}
+
+impl T for () {}
+
+const fn foo() -> impl T {
+ ()
+}
+```
+"##,
+
}
register_diagnostics! {
// This assumes the type has two type parameters, first for the tag (set to `()`),
// then for the id
macro_rules! impl_snapshot_for {
- // FIXME(mark-i-m): Some of these should be `?` rather than `*`.
(enum $enum_name:ident {
- $( $variant:ident $( ( $($field:ident $(-> $delegate:expr)*),* ) )* ),* $(,)*
+ $( $variant:ident $( ( $($field:ident $(-> $delegate:expr)?),* ) )? ),* $(,)?
}) => {
impl<'a, Ctx> self::Snapshot<'a, Ctx> for $enum_name
fn snapshot(&self, __ctx: &'a Ctx) -> Self::Item {
match *self {
$(
- $enum_name::$variant $( ( $(ref $field),* ) )* =>
+ $enum_name::$variant $( ( $(ref $field),* ) )? =>
$enum_name::$variant $(
- ( $( __impl_snapshot_field!($field, __ctx $(, $delegate)*) ),* ),
- )*
+ ( $( __impl_snapshot_field!($field, __ctx $(, $delegate)?) ),* ),
+ )?
)*
}
}
}
};
- // FIXME(mark-i-m): same here.
- (struct $struct_name:ident { $($field:ident $(-> $delegate:expr)*),* $(,)* }) => {
+ (struct $struct_name:ident { $($field:ident $(-> $delegate:expr)?),* $(,)? }) => {
impl<'a, Ctx> self::Snapshot<'a, Ctx> for $struct_name
where Ctx: self::SnapshotContext<'a>,
{
} = *self;
$struct_name {
- $( $field: __impl_snapshot_field!($field, __ctx $(, $delegate)*) ),*
+ $( $field: __impl_snapshot_field!($field, __ctx $(, $delegate)?) ),*
}
}
}
#![feature(nll)]
#![feature(in_band_lifetimes)]
#![feature(slice_patterns)]
-#![feature(slice_sort_by_cached_key)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(crate_visibility_modifier)]
for param in &generics.params {
match param.kind {
hir::GenericParamKind::Lifetime { .. } => {}
- hir::GenericParamKind::Type { .. } => return,
+ hir::GenericParamKind::Type { .. } |
+ hir::GenericParamKind::Const { .. } => {
+ return
+ }
}
}
// enforce `min_const_fn` for stable const fns
use super::qualify_min_const_fn::is_min_const_fn;
if let Err((span, err)) = is_min_const_fn(tcx, def_id, mir) {
- tcx.sess.span_err(span, &err);
+ let mut diag = struct_span_err!(
+ tcx.sess,
+ span,
+ E0723,
+ "{} (see issue #57563)",
+ err,
+ );
+ diag.help(
+ "add #![feature(const_fn)] to the crate attributes to enable",
+ );
+ diag.emit();
} else {
// this should not produce any errors, but better safe than sorry
// FIXME(#53819)
if let Some(ref type_) = data.output {
// `-> Foo` syntax is essentially an associated type binding,
// so it is also allowed to contain nested `impl Trait`.
- self.with_impl_trait(None, |this| visit::walk_ty(this, type_));
+ self.with_impl_trait(None, |this| this.visit_ty(type_));
}
}
}
#![feature(label_break_value)]
#![feature(nll)]
#![feature(rustc_diagnostic_macros)]
-#![feature(slice_sort_by_cached_key)]
#![recursion_limit="256"]
args.next();
params.next();
}
- (GenericArg::Lifetime(_), GenericParamDefKind::Type { .. }) => {
- // We expected a type argument, but got a lifetime
- // argument. This is an error, but we need to handle it
- // gracefully so we can report sensible errors. In this
- // case, we're simply going to infer this argument.
- args.next();
- }
- (GenericArg::Type(_), GenericParamDefKind::Lifetime) => {
- // We expected a lifetime argument, but got a type
+ (GenericArg::Type(_), GenericParamDefKind::Lifetime)
+ | (GenericArg::Const(_), GenericParamDefKind::Lifetime) => {
+ // We expected a lifetime argument, but got a type or const
// argument. That means we're inferring the lifetimes.
substs.push(inferred_kind(None, param, infer_types));
params.next();
}
+ (_, _) => {
+ // We expected one kind of parameter, but the user provided
+ // another. This is an error, but we need to handle it
+ // gracefully so we can report sensible errors.
+ // In this case, we're simply going to infer this argument.
+ args.next();
+ }
}
}
(Some(_), None) => {
(None, Some(¶m)) => {
// If there are fewer arguments than parameters, it means
// we're inferring the remaining arguments.
- match param.kind {
- GenericParamDefKind::Lifetime | GenericParamDefKind::Type { .. } => {
- let kind = inferred_kind(Some(&substs), param, infer_types);
- substs.push(kind);
- }
- }
+ substs.push(inferred_kind(Some(&substs), param, infer_types));
args.next();
params.next();
}
let mut has_err = false;
for segment in segments {
segment.with_generic_args(|generic_args| {
- let (mut err_for_lt, mut err_for_ty) = (false, false);
+ let (mut err_for_lt, mut err_for_ty, mut err_for_ct) = (false, false, false);
for arg in &generic_args.args {
let (mut span_err, span, kind) = match arg {
+ // FIXME(varkor): unify E0109, E0110 and E0111.
hir::GenericArg::Lifetime(lt) => {
if err_for_lt { continue }
err_for_lt = true;
ty.span,
"type")
}
+ hir::GenericArg::Const(ct) => {
+ if err_for_ct { continue }
+ err_for_ct = true;
+ (struct_span_err!(self.tcx().sess, ct.span, E0111,
+ "const parameters are not allowed on this type"),
+ ct.span,
+ "const")
+ }
};
span_err.span_label(span, format!("{} argument not allowed", kind))
.emit();
- if err_for_lt && err_for_ty {
+ if err_for_lt && err_for_ty && err_for_ct {
break;
}
}
let bounds = impl_m.generics.params.iter().find_map(|param| {
match param.kind {
GenericParamKind::Lifetime { .. } => None,
- GenericParamKind::Type { .. } => {
+ GenericParamKind::Type { .. } |
+ GenericParamKind::Const { .. } => {
if param.hir_id == impl_hir_id {
Some(¶m.bounds)
} else {
self.tcx.type_of(def_id);
}
hir::GenericParamKind::Type { .. } => {}
+ hir::GenericParamKind::Const { .. } => {
+ let def_id = self.tcx.hir().local_def_id(param.id);
+ self.tcx.type_of(def_id);
+ }
}
}
intravisit::walk_generics(self, generics);
i += 1;
Some(ty_param)
}
+ GenericParamKind::Const { .. } => {
+ if param.name.ident().name == keywords::SelfUpper.name() {
+ span_bug!(
+ param.span,
+ "`Self` should not be the name of a regular parameter",
+ );
+ }
+
+ // Emit an error, but skip the parameter rather than aborting to
+ // continue to get other errors.
+ tcx.sess.struct_span_err(
+ param.span,
+ "const generics in any position are currently unsupported",
+ ).emit();
+ None
+ }
_ => None,
}),
);
},
Node::GenericParam(param) => match ¶m.kind {
- hir::GenericParamKind::Type {
- default: Some(ref ty),
- ..
- } => icx.to_ty(ty),
+ hir::GenericParamKind::Type { default: Some(ref ty), .. } |
+ hir::GenericParamKind::Const { ref ty, .. } => {
+ icx.to_ty(ty)
+ }
x => bug!("unexpected non-type Node::GenericParam: {:?}", x),
},
```
"##,
+E0111: r##"
+You tried to give a const parameter to a type which doesn't need it.
+"##,
+
E0116: r##"
You can only define an inherent implementation for a type in the same crate
where the type was defined. For example, an `impl` block as below is not allowed
#![feature(refcell_replace_swap)]
#![feature(rustc_diagnostic_macros)]
#![feature(slice_patterns)]
-#![feature(slice_sort_by_cached_key)]
#![feature(never_type)]
#![recursion_limit="256"]
}
}
GenericParamDefKind::Lifetime => {}
+ GenericParamDefKind::Const { .. } => {}
}
}
match module.inner {
ModuleItem(ref module) => {
for it in &module.items {
- if it.is_extern_crate() && it.attrs.has_doc_flag("masked") {
+ // `compiler_builtins` should be masked too, but we can't apply
+ // `#[doc(masked)]` to the injected `extern crate` because it's unstable.
+ if it.is_extern_crate()
+ && (it.attrs.has_doc_flag("masked")
+ || self.cx.tcx.is_compiler_builtins(it.def_id.krate))
+ {
masked_crates.insert(it.def_id.krate);
}
}
}
}
+impl Clean<Constant> for hir::ConstArg {
+ fn clean(&self, cx: &DocContext) -> Constant {
+ Constant {
+ type_: cx.tcx.type_of(cx.tcx.hir().body_owner_def_id(self.value.body)).clean(cx),
+ expr: print_const_expr(cx, self.value.body),
+ }
+ }
+}
+
impl<'tcx> Clean<Lifetime> for ty::GenericParamDef {
fn clean(&self, _cx: &DocContext) -> Lifetime {
Lifetime(self.name.to_string())
default: Option<Type>,
synthetic: Option<hir::SyntheticTyParamKind>,
},
+ Const {
+ did: DefId,
+ ty: Type,
+ },
}
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Debug, Hash)]
impl GenericParamDef {
pub fn is_synthetic_type_param(&self) -> bool {
match self.kind {
- GenericParamDefKind::Lifetime => false,
+ GenericParamDefKind::Lifetime |
+ GenericParamDefKind::Const { .. } => {
+ false
+ }
GenericParamDefKind::Type { ref synthetic, .. } => synthetic.is_some(),
}
}
};
(name, GenericParamDefKind::Lifetime)
}
- hir::GenericParamKind::Type { ref default, synthetic, .. } => {
+ hir::GenericParamKind::Type { ref default, synthetic } => {
(self.name.ident().name.clean(cx), GenericParamDefKind::Type {
did: cx.tcx.hir().local_def_id(self.id),
bounds: self.bounds.clean(cx),
synthetic: synthetic,
})
}
+ hir::GenericParamKind::Const { ref ty } => {
+ (self.name.ident().name.clean(cx), GenericParamDefKind::Const {
+ did: cx.tcx.hir().local_def_id(self.id),
+ ty: ty.clean(cx),
+ })
+ }
};
GenericParamDef {
GenericParamDefKind::Type { did, ref bounds, .. } => {
cx.impl_trait_bounds.borrow_mut().insert(did, bounds.clone());
}
+ GenericParamDefKind::Const { .. } => unreachable!(),
}
param
})
break
}
}
+ GenericParamDefKind::Const { .. } => {}
}
}
}
let provided_params = &path.segments.last().expect("segments were empty");
let mut ty_substs = FxHashMap::default();
let mut lt_substs = FxHashMap::default();
+ let mut const_substs = FxHashMap::default();
provided_params.with_generic_args(|generic_args| {
let mut indices: GenericParamCount = Default::default();
for param in generics.params.iter() {
let mut j = 0;
let lifetime = generic_args.args.iter().find_map(|arg| {
match arg {
- GenericArg::Lifetime(lt) => {
+ hir::GenericArg::Lifetime(lt) => {
if indices.lifetimes == j {
return Some(lt);
}
let mut j = 0;
let type_ = generic_args.args.iter().find_map(|arg| {
match arg {
- GenericArg::Type(ty) => {
+ hir::GenericArg::Type(ty) => {
if indices.types == j {
return Some(ty);
}
}
indices.types += 1;
}
+ hir::GenericParamKind::Const { .. } => {
+ let const_param_def =
+ Def::ConstParam(cx.tcx.hir().local_def_id(param.id));
+ let mut j = 0;
+ let const_ = generic_args.args.iter().find_map(|arg| {
+ match arg {
+ hir::GenericArg::Const(ct) => {
+ if indices.consts == j {
+ return Some(ct);
+ }
+ j += 1;
+ None
+ }
+ _ => None,
+ }
+ });
+ if let Some(ct) = const_.cloned() {
+ const_substs.insert(const_param_def, ct.clean(cx));
+ }
+ // FIXME(const_generics:defaults)
+ indices.consts += 1;
+ }
}
}
});
- return cx.enter_alias(ty_substs, lt_substs, || ty.clean(cx));
+ return cx.enter_alias(ty_substs, lt_substs, const_substs, || ty.clean(cx));
}
resolve_type(cx, path.clean(cx), self.id)
}
GenericArg::Type(ty) => {
types.push(ty.clean(cx));
}
+ GenericArg::Const(..) => {
+ unimplemented!() // FIXME(const_generics)
+ }
}
}
GenericArgs::AngleBracketed {
/// If false, the `select` element to have search filtering by crates on rendered docs
/// won't be generated.
pub generate_search_filter: bool,
+ /// Option (disabled by default) to generate files used by RLS and some other tools.
+ pub generate_redirect_pages: bool,
}
impl Options {
let static_root_path = matches.opt_str("static-root-path");
let generate_search_filter = !matches.opt_present("disable-per-crate-search");
let persist_doctests = matches.opt_str("persist-doctests").map(PathBuf::from);
+ let generate_redirect_pages = matches.opt_present("generate-redirect-pages");
let (lint_opts, describe_lints, lint_cap) = get_cmd_lint_options(matches, error_format);
markdown_css,
markdown_playground_url,
generate_search_filter,
+ generate_redirect_pages,
}
})
}
pub ty_substs: RefCell<FxHashMap<Def, clean::Type>>,
/// Table `NodeId` of lifetime parameter definition -> substituted lifetime
pub lt_substs: RefCell<FxHashMap<DefId, clean::Lifetime>>,
+ /// Table node id of const parameter definition -> substituted const
+ pub ct_substs: RefCell<FxHashMap<Def, clean::Constant>>,
/// Table DefId of `impl Trait` in argument position -> bounds
pub impl_trait_bounds: RefCell<FxHashMap<DefId, Vec<clean::GenericBound>>>,
pub send_trait: Option<DefId>,
pub fn enter_alias<F, R>(&self,
ty_substs: FxHashMap<Def, clean::Type>,
lt_substs: FxHashMap<DefId, clean::Lifetime>,
+ ct_substs: FxHashMap<Def, clean::Constant>,
f: F) -> R
where F: FnOnce() -> R {
- let (old_tys, old_lts) =
- (mem::replace(&mut *self.ty_substs.borrow_mut(), ty_substs),
- mem::replace(&mut *self.lt_substs.borrow_mut(), lt_substs));
+ let (old_tys, old_lts, old_cts) = (
+ mem::replace(&mut *self.ty_substs.borrow_mut(), ty_substs),
+ mem::replace(&mut *self.lt_substs.borrow_mut(), lt_substs),
+ mem::replace(&mut *self.ct_substs.borrow_mut(), ct_substs),
+ );
let r = f();
*self.ty_substs.borrow_mut() = old_tys;
*self.lt_substs.borrow_mut() = old_lts;
+ *self.ct_substs.borrow_mut() = old_cts;
r
}
name: hir::LifetimeName::Param(name),
}));
}
- ty::GenericParamDefKind::Type {..} => {
+ ty::GenericParamDefKind::Type { .. } => {
args.push(hir::GenericArg::Type(self.ty_param_to_ty(param.clone())));
}
}
renderinfo: RefCell::new(renderinfo),
ty_substs: Default::default(),
lt_substs: Default::default(),
+ ct_substs: Default::default(),
impl_trait_bounds: Default::default(),
send_trait: send_trait,
fake_def_ids: Default::default(),
pub struct Function<'a> {
/// The declaration to emit.
pub decl: &'a clean::FnDecl,
- /// The length of the function's "name", used to determine line-wrapping.
- pub name_len: usize,
+ /// The length of the function header and name. In other words, the number of characters in the
+ /// function declaration up to but not including the parentheses.
+ ///
+ /// Used to determine line-wrapping.
+ pub header_len: usize,
/// The number of spaces to indent each successive line with, if line-wrapping is necessary.
pub indent: usize,
/// Whether the function is async or not.
Ok(())
}
+ clean::GenericParamDefKind::Const { ref ty, .. } => {
+ f.write_str("const ")?;
+ f.write_str(&self.name)?;
+
+ if f.alternate() {
+ write!(f, ": {:#}", ty)
+ } else {
+ write!(f, ": {}", ty)
+ }
+ }
}
}
}
}
}
clean::ImplTrait(ref bounds) => {
- write!(f, "impl {}", GenericBounds(bounds))
+ if f.alternate() {
+ write!(f, "impl {:#}", GenericBounds(bounds))
+ } else {
+ write!(f, "impl {}", GenericBounds(bounds))
+ }
}
clean::QPath { ref name, ref self_type, ref trait_ } => {
let should_show_cast = match *trait_ {
impl<'a> fmt::Display for Function<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- let &Function { decl, name_len, indent, asyncness } = self;
+ let &Function { decl, header_len, indent, asyncness } = self;
let amp = if f.alternate() { "&" } else { "&" };
let mut args = String::new();
let mut args_plain = String::new();
}
}
+ let mut args_plain = format!("({})", args_plain);
+
if decl.variadic {
args.push_str(",<br> ...");
args_plain.push_str(", ...");
output.to_string()
};
- let pad = " ".repeat(name_len);
- let plain = format!("{pad}({args}){arrow}",
- pad = pad,
- args = args_plain,
- arrow = arrow_plain);
-
- let output = if plain.len() > 80 {
+ let declaration_len = header_len + args_plain.len() + arrow_plain.len();
+ let output = if declaration_len > 80 {
let full_pad = format!("<br>{}", " ".repeat(indent + 4));
let close_pad = format!("<br>{}", " ".repeat(indent));
format!("({args}{close}){arrow}",
/// If false, the `select` element to have search filtering by crates on rendered docs
/// won't be generated.
pub generate_search_filter: bool,
+ /// Option disabled by default to generate files used by RLS and some other tools.
+ pub generate_redirect_pages: bool,
}
impl SharedContext {
resource_suffix,
static_root_path,
generate_search_filter,
+ generate_redirect_pages,
..
} = options;
resource_suffix,
static_root_path,
generate_search_filter,
+ generate_redirect_pages,
};
// If user passed in `--playground-url` arg, we fill in crate name here
for param in &generics.params {
match param.kind {
clean::GenericParamDefKind::Lifetime => {}
- clean::GenericParamDefKind::Type { did, .. } => {
+ clean::GenericParamDefKind::Type { did, .. } |
+ clean::GenericParamDefKind::Const { did, .. } => {
self.typarams.insert(did, param.name.clone());
}
}
if !self.render_redirect_pages {
all.append(full_path(self, &item), &item_type);
}
- // Redirect from a sane URL using the namespace to Rustdoc's
- // URL for the page.
- let redir_name = format!("{}.{}.html", name, item_type.name_space());
- let redir_dst = self.dst.join(redir_name);
- if let Ok(redirect_out) = OpenOptions::new().create_new(true)
- .write(true)
- .open(&redir_dst) {
- let mut redirect_out = BufWriter::new(redirect_out);
- try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
+ if self.shared.generate_redirect_pages {
+ // Redirect from a sane URL using the namespace to Rustdoc's
+ // URL for the page.
+ let redir_name = format!("{}.{}.html", name, item_type.name_space());
+ let redir_dst = self.dst.join(redir_name);
+ if let Ok(redirect_out) = OpenOptions::new().create_new(true)
+ .write(true)
+ .open(&redir_dst) {
+ let mut redirect_out = BufWriter::new(redirect_out);
+ try_err!(layout::redirect(&mut redirect_out, file_name), &redir_dst);
+ }
}
-
// If the item is a macro, redirect from the old macro URL (with !)
// to the new one (without).
if item_type == ItemType::Macro {
<tr class='{stab}{add}module-item'>\
<td><a class=\"{class}\" href=\"{href}\" \
title='{title}'>{name}</a>{unsafety_flag}</td>\
- <td class='docblock-short'>{stab_tags}{docs}\
- </td>\
+ <td class='docblock-short'>{stab_tags}{docs}</td>\
</tr>",
name = *myitem.name.as_ref().unwrap(),
stab_tags = stability_tags(myitem),
fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
f: &clean::Function) -> fmt::Result {
- let name_len = format!("{}{}{}{}{:#}fn {}{:#}",
- VisSpace(&it.visibility),
- ConstnessSpace(f.header.constness),
- UnsafetySpace(f.header.unsafety),
- AsyncSpace(f.header.asyncness),
- AbiSpace(f.header.abi),
- it.name.as_ref().unwrap(),
- f.generics).len();
+ let header_len = format!(
+ "{}{}{}{}{:#}fn {}{:#}",
+ VisSpace(&it.visibility),
+ ConstnessSpace(f.header.constness),
+ UnsafetySpace(f.header.unsafety),
+ AsyncSpace(f.header.asyncness),
+ AbiSpace(f.header.abi),
+ it.name.as_ref().unwrap(),
+ f.generics
+ ).len();
write!(w, "{}<pre class='rust fn'>", render_spotlight_traits(it)?)?;
render_attributes(w, it)?;
write!(w,
where_clause = WhereClause { gens: &f.generics, indent: 0, end_newline: true },
decl = Function {
decl: &f.decl,
- name_len,
+ header_len,
indent: 0,
asyncness: f.header.asyncness,
})?;
href(did).map(|p| format!("{}#{}.{}", p.0, ty, name)).unwrap_or(anchor)
}
};
- let mut head_len = format!("{}{}{}{}{:#}fn {}{:#}",
- VisSpace(&meth.visibility),
- ConstnessSpace(header.constness),
- UnsafetySpace(header.unsafety),
- AsyncSpace(header.asyncness),
- AbiSpace(header.abi),
- name,
- *g).len();
+ let mut header_len = format!(
+ "{}{}{}{}{:#}fn {}{:#}",
+ VisSpace(&meth.visibility),
+ ConstnessSpace(header.constness),
+ UnsafetySpace(header.unsafety),
+ AsyncSpace(header.asyncness),
+ AbiSpace(header.abi),
+ name,
+ *g
+ ).len();
let (indent, end_newline) = if parent == ItemType::Trait {
- head_len += 4;
+ header_len += 4;
(4, false)
} else {
(0, true)
generics = *g,
decl = Function {
decl: d,
- name_len: head_len,
+ header_len,
indent,
asyncness: header.asyncness,
},
var actives = [[], [], []];
// "current" is used to know which tab we're looking into.
var current = 0;
- onEachLazy(document.getElementsByClassName("search-results"), function(e) {
+ onEachLazy(document.getElementById("results").childNodes, function(e) {
onEachLazy(e.getElementsByClassName("highlighted"), function(e) {
actives[current].push(e);
});
removeClass(actives[currentTab][0], "highlighted");
} else if (e.which === 40) { // down
if (!actives[currentTab].length) {
- var results = document.getElementsByClassName("search-results");
+ var results = document.getElementById("results").childNodes;
if (results.length > 0) {
var res = results[currentTab].getElementsByClassName("result");
if (res.length > 0) {
clearTimeout(searchTimeout);
if (search_input.value.length === 0) {
if (browserSupportsHistoryApi()) {
- history.replaceState("", "std - Rust", "?search=");
+ history.replaceState("", window.currentCrate + " - Rust", "?search=");
}
if (hasClass(main, "content")) {
removeClass(main, "hidden");
.docblock table {
margin: .5em 0;
- width: 100%;
+ width: calc(100% - 2px);
+ border: 1px dashed;
}
.docblock table td {
transition: border-color 300ms ease;
transition: border-radius 300ms ease-in-out;
transition: box-shadow 300ms ease-in-out;
- width: 100%;
+ width: calc(100% - 32px);
}
#crate-search + .search-input {
border-bottom-color: #DDD;
}
-.docblock table {
+.docblock table, .docblock table td, .docblock table th {
border-color: #ddd;
}
-.docblock table td {
- border-top-color: #ddd;
- border-bottom-color: #ddd;
-}
-
-.docblock table th {
- border-top-color: #ddd;
- border-bottom-color: #ddd;
-}
-
.content .method .where,
.content .fn .where,
.content .where.fmt-newline {
box-shadow: 1px 0 0 1px #000, 0 0 0 2px transparent;
}
-.stab.unstable { background: #FFF5D6; border-color: #FFC600; color: #404040; }
-.stab.internal { background: #FFB9B3; border-color: #B71C1C; color: #404040; }
-.stab.deprecated { background: #F3DFFF; border-color: #7F0087; color: #404040; }
-.stab.portability { background: #C4ECFF; border-color: #7BA5DB; color: #404040; }
-
.module-item .stab {
color: #ddd;
}
+.stab.unstable {background: #FFF5D6; border-color: #FFC600; color: #2f2f2f; }
+.stab.internal { background: #FFB9B3; border-color: #B71C1C; color: #2f2f2f; }
+.stab.deprecated { background: #F3DFFF; border-color: #7F0087; color: #2f2f2f; }
+.stab.portability { background: #C4ECFF; border-color: #7BA5DB; color: #2f2f2f; }
+
#help > div {
background: #4d4d4d;
border-color: #bfbfbf;
}
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
- border-bottom-color: #DDD;
-}
-
-.docblock table {
- border-color: #ddd;
-}
-
-.docblock table td {
- border-top-color: #ddd;
border-bottom-color: #ddd;
}
-.docblock table th {
- border-top-color: #ddd;
- border-bottom-color: #ddd;
+.docblock table, .docblock table td, .docblock table th {
+ border-color: #ddd;
}
.content .method .where,
box-shadow: 1px 0 0 1px #e0e0e0, 0 0 0 2px transparent;
}
+.module-item .stab {
+ color: #000;
+}
+
.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
.stab.internal { background: #FFB9B3; border-color: #B71C1C; }
.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }
.stab.portability { background: #C4ECFF; border-color: #7BA5DB; }
-.module-item .stab {
- color: #000;
-}
-
#help > div {
background: #e9e9e9;
border-color: #bfbfbf;
#![feature(box_syntax)]
#![feature(nll)]
#![feature(set_stdio)]
-#![feature(slice_sort_by_cached_key)]
#![feature(test)]
#![feature(vec_remove_item)]
#![feature(ptr_offset_from)]
"Directory to persist doctest executables into",
"PATH")
}),
+ unstable("generate-redirect-pages", |o| {
+ o.optflag("",
+ "generate-redirect-pages",
+ "Generate extra pages to support legacy URLs and tool links")
+ }),
]
}
use rustc_driver::{self, driver, target_features, Compilation};
use rustc_driver::driver::phase_2_configure_and_expand;
use rustc_metadata::cstore::CStore;
-use rustc_metadata::dynamic_lib::DynamicLibrary;
use rustc::hir;
use rustc::hir::intravisit;
use rustc::session::{self, CompileIncomplete, config};
use rustc::session::config::{OutputType, OutputTypes, Externs, CodegenOptions};
-use rustc::session::search_paths::{SearchPath, PathKind};
+use rustc::session::search_paths::SearchPath;
use syntax::ast;
use syntax::source_map::SourceMap;
use syntax::edition::Edition;
use testing;
use std::env;
-use std::ffi::OsString;
use std::io::prelude::*;
use std::io;
use std::path::PathBuf;
}
}
- let (libdir, outdir, compile_result) = driver::spawn_thread_pool(sessopts, |sessopts| {
+ let (outdir, compile_result) = driver::spawn_thread_pool(sessopts, |sessopts| {
let source_map = Lrc::new(SourceMap::new(sessopts.file_path_mapping()));
let emitter = errors::emitter::EmitterWriter::new(box Sink(data.clone()),
Some(source_map.clone()),
.expect("rustdoc needs a tempdir"))
}
);
- let libdir = sess.target_filesearch(PathKind::All).get_lib_path();
let mut control = driver::CompileController::basic();
let mut cfg = config::build_configuration(&sess, config::parse_cfgspecs(cfgs.clone()));
Err(_) | Ok(Err(CompileIncomplete::Errored(_))) => Err(())
};
- (libdir, outdir, compile_result)
+ (outdir, compile_result)
});
match (compile_result, compile_fail) {
if no_run { return }
// Run the code!
- //
- // We're careful to prepend the *target* dylib search path to the child's
- // environment to ensure that the target loads the right libraries at
- // runtime. It would be a sad day if the *host* libraries were loaded as a
- // mistake.
let mut cmd = Command::new(&outdir.lock().unwrap().path().join("rust_out"));
- let var = DynamicLibrary::envvar();
- let newpath = {
- let path = env::var_os(var).unwrap_or(OsString::new());
- let mut path = env::split_paths(&path).collect::<Vec<_>>();
- path.insert(0, libdir);
- env::join_paths(path).unwrap()
- };
- cmd.env(var, &newpath);
-
match cmd.output() {
Err(e) => panic!("couldn't run the test: {}{}", e,
if e.kind() == io::ErrorKind::PermissionDenied {
}
}
- if dont_insert_main || already_has_main {
+ // FIXME: This code cannot yet handle no_std test cases yet
+ if dont_insert_main || already_has_main || prog.contains("![no_std]") {
prog.push_str(everything_else);
} else {
- prog.push_str("fn main() {\n");
+ let returns_result = everything_else.trim_end().ends_with("(())");
+ let (main_pre, main_post) = if returns_result {
+ ("fn main() { fn _inner() -> Result<(), impl core::fmt::Debug> {",
+ "}\n_inner().unwrap() }")
+ } else {
+ ("fn main() {\n", "\n}")
+ };
+ prog.extend([main_pre, everything_else, main_post].iter().cloned());
line_offset += 1;
- prog.push_str(everything_else);
- prog.push_str("\n}");
}
debug!("final doctest:\n{}", prog);
cc = "1.0"
[features]
-default = ["compiler_builtins_c"]
+default = ["compiler_builtins_c", "std_detect_file_io", "std_detect_dlsym_getauxval"]
backtrace = ["backtrace-sys"]
panic-unwind = ["panic_unwind"]
# the environment for hooking up some thread-related information like the
# current thread id and accessing/getting the current thread's TCB
wasm-bindgen-threads = []
+
+# Enable std_detect default features for stdsimd:
+# https://github.com/rust-lang-nursery/stdsimd/blob/master/crates/std_detect/Cargo.toml
+std_detect_file_io = []
+std_detect_dlsym_getauxval = []
/// ```
///
/// [`source`]: trait.Error.html#method.source
- #[unstable(feature = "error_iter", issue = "58289")]
+ #[unstable(feature = "error_iter", issue = "58520")]
#[inline]
pub fn iter_chain(&self) -> ErrorIter {
ErrorIter {
///
/// [`source`]: trait.Error.html#method.source
#[inline]
- #[unstable(feature = "error_iter", issue = "58289")]
+ #[unstable(feature = "error_iter", issue = "58520")]
pub fn iter_sources(&self) -> ErrorIter {
ErrorIter {
current: self.source(),
/// An iterator over [`Error`]
///
/// [`Error`]: trait.Error.html
-#[unstable(feature = "error_iter", issue = "58289")]
+#[unstable(feature = "error_iter", issue = "58520")]
#[derive(Copy, Clone, Debug)]
pub struct ErrorIter<'a> {
current: Option<&'a (dyn Error + 'static)>,
}
-#[unstable(feature = "error_iter", issue = "58289")]
+#[unstable(feature = "error_iter", issue = "58520")]
impl<'a> Iterator for ErrorIter<'a> {
type Item = &'a (dyn Error + 'static);
/// ```
#[stable(feature = "fs_read_write_bytes", since = "1.26.0")]
pub fn read<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
- let mut file = File::open(path)?;
- let mut bytes = Vec::with_capacity(initial_buffer_size(&file));
- file.read_to_end(&mut bytes)?;
- Ok(bytes)
+ fn inner(path: &Path) -> io::Result<Vec<u8>> {
+ let mut file = File::open(path)?;
+ let mut bytes = Vec::with_capacity(initial_buffer_size(&file));
+ file.read_to_end(&mut bytes)?;
+ Ok(bytes)
+ }
+ inner(path.as_ref())
}
/// Read the entire contents of a file into a string.
/// ```
#[stable(feature = "fs_read_write", since = "1.26.0")]
pub fn read_to_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
- let mut file = File::open(path)?;
- let mut string = String::with_capacity(initial_buffer_size(&file));
- file.read_to_string(&mut string)?;
- Ok(string)
+ fn inner(path: &Path) -> io::Result<String> {
+ let mut file = File::open(path)?;
+ let mut string = String::with_capacity(initial_buffer_size(&file));
+ file.read_to_string(&mut string)?;
+ Ok(string)
+ }
+ inner(path.as_ref())
}
/// Write a slice as the entire contents of a file.
/// ```
#[stable(feature = "fs_read_write_bytes", since = "1.26.0")]
pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> io::Result<()> {
- File::create(path)?.write_all(contents.as_ref())
+ fn inner(path: &Path, contents: &[u8]) -> io::Result<()> {
+ File::create(path)?.write_all(contents)
+ }
+ inner(path.as_ref(), contents.as_ref())
}
impl File {
#![feature(non_exhaustive)]
#![feature(alloc_layout_extra)]
#![feature(maybe_uninit)]
+#![feature(checked_duration_since)]
#![cfg_attr(all(target_vendor = "fortanix", target_env = "sgx"),
feature(global_asm, range_contains, slice_index_methods,
decl_macro, coerce_unsized, sgx_platform, ptr_wrapping_offset_from))]
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
+ // FIXME: should just be u32::from_be_bytes([a, b, c, d]),
+ // once that method is no longer rustc_const_unstable
Ipv4Addr {
inner: c::in_addr {
s_addr: u32::to_be(
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn octets(&self) -> [u8; 4] {
+ // This returns the order we want because s_addr is stored in big-endian.
self.inner.s_addr.to_ne_bytes()
}
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn to_ipv6_compatible(&self) -> Ipv6Addr {
- Ipv6Addr::new(0, 0, 0, 0, 0, 0,
- ((self.octets()[0] as u16) << 8) | self.octets()[1] as u16,
- ((self.octets()[2] as u16) << 8) | self.octets()[3] as u16)
+ let octets = self.octets();
+ Ipv6Addr::from([
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ octets[0], octets[1], octets[2], octets[3],
+ ])
}
/// Converts this address to an IPv4-mapped [IPv6 address].
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn to_ipv6_mapped(&self) -> Ipv6Addr {
- Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff,
- ((self.octets()[0] as u16) << 8) | self.octets()[1] as u16,
- ((self.octets()[2] as u16) << 8) | self.octets()[3] as u16)
+ let octets = self.octets();
+ Ipv6Addr::from([
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0xFF, 0xFF,
+ octets[0], octets[1], octets[2], octets[3],
+ ])
}
}
/// ```
fn from(ip: Ipv4Addr) -> u32 {
let ip = ip.octets();
- ((ip[0] as u32) << 24) + ((ip[1] as u32) << 16) + ((ip[2] as u32) << 8) + (ip[3] as u32)
+ u32::from_be_bytes(ip)
}
}
/// assert_eq!(Ipv4Addr::new(13, 12, 11, 10), addr);
/// ```
fn from(ip: u32) -> Ipv4Addr {
- Ipv4Addr::new((ip >> 24) as u8, (ip >> 16) as u8, (ip >> 8) as u8, ip as u8)
+ Ipv4Addr::from(ip.to_be_bytes())
}
}
pub fn segments(&self) -> [u16; 8] {
let arr = &self.inner.s6_addr;
[
- (arr[0] as u16) << 8 | (arr[1] as u16),
- (arr[2] as u16) << 8 | (arr[3] as u16),
- (arr[4] as u16) << 8 | (arr[5] as u16),
- (arr[6] as u16) << 8 | (arr[7] as u16),
- (arr[8] as u16) << 8 | (arr[9] as u16),
- (arr[10] as u16) << 8 | (arr[11] as u16),
- (arr[12] as u16) << 8 | (arr[13] as u16),
- (arr[14] as u16) << 8 | (arr[15] as u16),
+ u16::from_be_bytes([arr[0], arr[1]]),
+ u16::from_be_bytes([arr[2], arr[3]]),
+ u16::from_be_bytes([arr[4], arr[5]]),
+ u16::from_be_bytes([arr[6], arr[7]]),
+ u16::from_be_bytes([arr[8], arr[9]]),
+ u16::from_be_bytes([arr[10], arr[11]]),
+ u16::from_be_bytes([arr[12], arr[13]]),
+ u16::from_be_bytes([arr[14], arr[15]]),
]
}
#[stable(feature = "i128", since = "1.26.0")]
impl From<Ipv6Addr> for u128 {
+ /// Convert an `Ipv6Addr` into a host byte order `u128`.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use std::net::Ipv6Addr;
+ ///
+ /// let addr = Ipv6Addr::new(
+ /// 0x1020, 0x3040, 0x5060, 0x7080,
+ /// 0x90A0, 0xB0C0, 0xD0E0, 0xF00D,
+ /// );
+ /// assert_eq!(0x102030405060708090A0B0C0D0E0F00D_u128, u128::from(addr));
+ /// ```
fn from(ip: Ipv6Addr) -> u128 {
- let ip = ip.segments();
- ((ip[0] as u128) << 112) + ((ip[1] as u128) << 96) + ((ip[2] as u128) << 80) +
- ((ip[3] as u128) << 64) + ((ip[4] as u128) << 48) + ((ip[5] as u128) << 32) +
- ((ip[6] as u128) << 16) + (ip[7] as u128)
+ let ip = ip.octets();
+ u128::from_be_bytes(ip)
}
}
#[stable(feature = "i128", since = "1.26.0")]
impl From<u128> for Ipv6Addr {
+ /// Convert a host byte order `u128` into an `Ipv6Addr`.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use std::net::Ipv6Addr;
+ ///
+ /// let addr = Ipv6Addr::from(0x102030405060708090A0B0C0D0E0F00D_u128);
+ /// assert_eq!(
+ /// Ipv6Addr::new(
+ /// 0x1020, 0x3040, 0x5060, 0x7080,
+ /// 0x90A0, 0xB0C0, 0xD0E0, 0xF00D,
+ /// ),
+ /// addr);
+ /// ```
fn from(ip: u128) -> Ipv6Addr {
- Ipv6Addr::new(
- (ip >> 112) as u16, (ip >> 96) as u16, (ip >> 80) as u16,
- (ip >> 64) as u16, (ip >> 48) as u16, (ip >> 32) as u16,
- (ip >> 16) as u16, ip as u16,
- )
+ Ipv6Addr::from(ip.to_be_bytes())
}
}
/// Truncates `self` to [`self.parent`].
///
- /// Returns `false` and does nothing if [`self.file_name`] is [`None`].
+ /// Returns `false` and does nothing if [`self.parent`] is [`None`].
/// Otherwise, returns `true`.
///
/// [`None`]: ../../std/option/enum.Option.html#variant.None
/// [`self.parent`]: struct.PathBuf.html#method.parent
- /// [`self.file_name`]: struct.PathBuf.html#method.file_name
///
/// # Examples
///
use mem;
use sys;
- if self.get_cwd().is_some() ||
- self.get_gid().is_some() ||
+ if self.get_gid().is_some() ||
self.get_uid().is_some() ||
self.env_saw_path() ||
self.get_closures().len() != 0 {
}
}
+ // Solaris and glibc 2.29+ can set a new working directory, and maybe
+ // others will gain this non-POSIX function too. We'll check for this
+ // weak symbol as soon as it's needed, so we can return early otherwise
+ // to do a manual chdir before exec.
+ weak! {
+ fn posix_spawn_file_actions_addchdir_np(
+ *mut libc::posix_spawn_file_actions_t,
+ *const libc::c_char
+ ) -> libc::c_int
+ }
+ let addchdir = match self.get_cwd() {
+ Some(cwd) => match posix_spawn_file_actions_addchdir_np.get() {
+ Some(f) => Some((f, cwd)),
+ None => return Ok(None),
+ },
+ None => None,
+ };
+
let mut p = Process { pid: 0, status: None };
struct PosixSpawnFileActions(libc::posix_spawn_file_actions_t);
fd,
libc::STDERR_FILENO))?;
}
+ if let Some((f, cwd)) = addchdir {
+ cvt(f(&mut file_actions.0, cwd.as_ptr()))?;
+ }
let mut set: libc::sigset_t = mem::uninitialized();
cvt(libc::sigemptyset(&mut set))?;
self.0.sub_instant(&earlier.0)
}
+ /// Returns the amount of time elapsed from another instant to this one,
+ /// or None if that instant is earlier than this one.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// #![feature(checked_duration_since)]
+ /// use std::time::{Duration, Instant};
+ /// use std::thread::sleep;
+ ///
+ /// let now = Instant::now();
+ /// sleep(Duration::new(1, 0));
+ /// let new_now = Instant::now();
+ /// println!("{:?}", new_now.checked_duration_since(now));
+ /// println!("{:?}", now.checked_duration_since(new_now)); // None
+ /// ```
+ #[unstable(feature = "checked_duration_since", issue = "58402")]
+ pub fn checked_duration_since(&self, earlier: Instant) -> Option<Duration> {
+ if self >= &earlier {
+ Some(self.0.sub_instant(&earlier.0))
+ } else {
+ None
+ }
+ }
+
+ /// Returns the amount of time elapsed from another instant to this one,
+ /// or zero duration if that instant is earlier than this one.
+ ///
+ /// # Examples
+ ///
+ /// ```no_run
+ /// #![feature(checked_duration_since)]
+ /// use std::time::{Duration, Instant};
+ /// use std::thread::sleep;
+ ///
+ /// let now = Instant::now();
+ /// sleep(Duration::new(1, 0));
+ /// let new_now = Instant::now();
+ /// println!("{:?}", new_now.saturating_duration_since(now));
+ /// println!("{:?}", now.saturating_duration_since(new_now)); // 0ns
+ /// ```
+ #[unstable(feature = "checked_duration_since", issue = "58402")]
+ pub fn saturating_duration_since(&self, earlier: Instant) -> Duration {
+ self.checked_duration_since(earlier).unwrap_or(Duration::new(0, 0))
+ }
+
/// Returns the amount of time elapsed since this instant was created.
///
/// # Panics
(a - Duration::new(1, 0)).duration_since(a);
}
+ #[test]
+ fn checked_instant_duration_nopanic() {
+ let a = Instant::now();
+ let ret = (a - Duration::new(1, 0)).checked_duration_since(a);
+ assert_eq!(ret, None);
+ }
+
+ #[test]
+ fn saturating_instant_duration_nopanic() {
+ let a = Instant::now();
+ let ret = (a - Duration::new(1, 0)).saturating_duration_since(a);
+ assert_eq!(ret, Duration::new(0,0));
+ }
+
#[test]
fn system_time_math() {
let a = SystemTime::now();
#![feature(nll)]
#![feature(rustc_attrs)]
#![feature(rustc_diagnostic_macros)]
-#![feature(slice_sort_by_cached_key)]
#![feature(step_trait)]
#![feature(try_trait)]
#![feature(unicode_internals)]
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
# `0.x.0` for Cargo where they were released on `date`.
-date: 2019-01-18
+date: 2019-02-17
rustc: beta
cargo: beta
-Subproject commit b23541340b5941749e5fbb1930e666bbd1375244
+Subproject commit 9a60697044088f6704a40da78dee25eb6d55fd6f
3 | no
| ^^ not found in this scope
-thread '$DIR/failed-doctest-output.rs - OtherStruct (line 17)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:354:13
+thread '$DIR/failed-doctest-output.rs - OtherStruct (line 17)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:351:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
---- $DIR/failed-doctest-output.rs - SomeStruct (line 11) stdout ----
thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:3:1
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
-', src/librustdoc/test.rs:389:17
+', src/librustdoc/test.rs:372:17
failures:
+// compile-flags:-Z unstable-options --generate-redirect-pages
+
use std::ops::Deref;
pub struct Foo;
extern crate issue_21092;
-// @has issue_21092/Bar.t.html
// @has issue_21092/struct.Bar.html
// @has - '//*[@id="associatedtype.Bar"]' 'type Bar = i32'
pub use issue_21092::{Foo, Bar};
fn deref_mut(&mut self) -> &mut Foo { loop {} }
}
-// @has issue_35169_2/Bar.t.html
// @has issue_35169_2/struct.Bar.html
// @has - '//*[@id="by_ref.v"]' 'fn by_ref(&self)'
// @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
fn deref(&self) -> &Foo { loop {} }
}
-// @has issue_35169/Bar.t.html
// @has issue_35169/struct.Bar.html
// @has - '//*[@id="by_ref.v"]' 'fn by_ref(&self)'
// @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
// @has - //pre '() => { ... };'
// @has - //pre '($a:tt) => { ... };'
// @has - //pre '($e:expr) => { ... };'
-// @has macros/macro.my_macro!.html
-// @has - //a 'macro.my_macro.html'
#[macro_export]
macro_rules! my_macro {
() => [];
--- /dev/null
+// compile-flags:--test
+
+/// A check of using various process termination strategies
+///
+/// # Examples
+///
+/// ```rust
+/// assert!(true); // this returns `()`, all is well
+/// ```
+///
+/// You can also simply return `Ok(())`, but you'll need to disambiguate the
+/// type using turbofish, because we cannot infer the type:
+///
+/// ```rust
+/// Ok::<(), &'static str>(())
+/// ```
+///
+/// You can err with anything that implements `Debug`:
+///
+/// ```rust,should_panic
+/// Err("This is returned from `main`, leading to panic")?;
+/// Ok::<(), &'static str>(())
+/// ```
+pub fn check_process_termination() {}
// @has foo/bar/baz/index.html '//a/@href' '../../../src/foo/src-links.rs.html'
pub mod baz {
/// Dox
- // @has foo/bar/baz/baz.v.html
// @has foo/bar/baz/fn.baz.html '//a/@href' '../../../src/foo/src-links.rs.html'
pub fn baz() { }
}
/// Dox
- // @has foo/bar/Foobar.t.html
// @has foo/bar/trait.Foobar.html '//a/@href' '../../src/foo/src-links.rs.html'
pub trait Foobar { fn dummy(&self) { } }
+// compile-flags:-Z unstable-options --generate-redirect-pages
+
// @has structfields/Foo.t.html
// @has - struct.Foo.html
// @has structfields/struct.Foo.html
--- /dev/null
+#![crate_name = "foo"]
+
+// @has foo/macro.bar.html
+// @has foo/macro.bar!.html
+// @!has foo/bar.m.html
+#[macro_export]
+macro_rules! bar {
+ () => {}
+}
+
+// @has foo/struct.Bar.html
+// @!has foo/Bar.t.html
+pub struct Bar;
--- /dev/null
+use std::fmt::Debug;
+
+// @has 'wrapping/fn.foo.html' '//pre[@class="rust fn"]' 'pub fn foo() -> impl Debug'
+// @count - '//pre[@class="rust fn"]/br' 0
+pub fn foo() -> impl Debug {}
fn bar<const X: (), 'a>(_: &'a ()) {
//~^ ERROR lifetime parameters must be declared prior to const parameters
+ //~^^ ERROR const generics in any position are currently unsupported
}
fn main() {}
LL | fn foo<const X: (), T>(_: T) {
| ^
-error: aborting due to 3 previous errors
+error: const generics in any position are currently unsupported
+ --> $DIR/const-param-before-other-params.rs:9:14
+ |
+LL | fn bar<const X: (), 'a>(_: &'a ()) {
+ | ^
+
+error: aborting due to 4 previous errors
--- /dev/null
+#![feature(const_generics)]
+//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
+
+#![deny(non_upper_case_globals)]
+
+fn noop<const x: u32>() {
+ //~^ ERROR const generics in any position are currently unsupported
+}
--- /dev/null
+warning: the feature `const_generics` is incomplete and may cause the compiler to crash
+ --> $DIR/const-parameter-uppercase-lint.rs:1:12
+ |
+LL | #![feature(const_generics)]
+ | ^^^^^^^^^^^^^^
+
+error[E0601]: `main` function not found in crate `const_parameter_uppercase_lint`
+ |
+ = note: consider adding a `main` function to `$DIR/const-parameter-uppercase-lint.rs`
+
+error: const generics in any position are currently unsupported
+ --> $DIR/const-parameter-uppercase-lint.rs:6:15
+ |
+LL | fn noop<const x: u32>() {
+ | ^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0601`.
-error: heap allocations are not allowed in const fn
+error[E0723]: heap allocations are not allowed in const fn (see issue #57563)
--> $DIR/bad_const_fn_body_ice.rs:2:5
|
LL | vec![1, 2, 3] //~ ERROR heap allocations are not allowed in const fn
| ^^^^^^^^^^^^^
|
+ = help: add #![feature(const_fn)] to the crate attributes to enable
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0723`.
-error: unsizing casts are not allowed in const fn
+error[E0723]: unsizing casts are not allowed in const fn (see issue #57563)
--> $DIR/cast_errors.rs:3:41
|
LL | const fn unsize(x: &[u8; 3]) -> &[u8] { x }
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: function pointers in const fn are unstable
+error[E0723]: function pointers in const fn are unstable (see issue #57563)
--> $DIR/cast_errors.rs:5:23
|
LL | const fn closure() -> fn() { || {} }
| ^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: function pointers in const fn are unstable
+error[E0723]: function pointers in const fn are unstable (see issue #57563)
--> $DIR/cast_errors.rs:8:5
|
LL | (|| {}) as fn();
| ^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: function pointers in const fn are unstable
+error[E0723]: function pointers in const fn are unstable (see issue #57563)
--> $DIR/cast_errors.rs:11:28
|
LL | const fn reify(f: fn()) -> unsafe fn() { f }
| ^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: function pointers in const fn are unstable
+error[E0723]: function pointers in const fn are unstable (see issue #57563)
--> $DIR/cast_errors.rs:13:21
|
LL | const fn reify2() { main as unsafe fn(); }
| ^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to 5 previous errors
+For more information about this error, try `rustc --explain E0723`.
-error: function pointers in const fn are unstable
+error[E0723]: function pointers in const fn are unstable (see issue #57563)
--> $DIR/cmp_fn_pointers.rs:1:14
|
LL | const fn cmp(x: fn(), y: fn()) -> bool { //~ ERROR function pointers in const fn are unstable
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0723`.
-error: loops are not allowed in const fn
+error[E0723]: loops are not allowed in const fn (see issue #57563)
--> $DIR/loop_ice.rs:2:5
|
LL | loop {} //~ ERROR loops are not allowed in const fn
| ^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0723`.
LL | const fn into_inner(self) -> T { self.0 } //~ destructors cannot be evaluated
| ^^^^ constant functions cannot evaluate destructors
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:39:36
|
LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 }
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error[E0493]: destructors cannot be evaluated at compile-time
--> $DIR/min_const_fn.rs:44:28
LL | const fn into_inner_lt(self) -> T { self.0 } //~ destructors cannot be evaluated
| ^^^^ constant functions cannot evaluate destructors
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:46:42
|
LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error[E0493]: destructors cannot be evaluated at compile-time
--> $DIR/min_const_fn.rs:51:27
LL | const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructors
| ^^^^ constant functions cannot evaluate destructors
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:53:38
|
LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:58:39
|
LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:76:16
|
LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:78:18
|
LL | const fn foo11_2<T: Send>(t: T) -> T { t }
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: only int, `bool` and `char` operations are stable in const fn
+error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:80:33
|
LL | const fn foo19(f: f32) -> f32 { f * 2.0 }
| ^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: only int, `bool` and `char` operations are stable in const fn
+error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:82:35
|
LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f }
| ^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: only int and `bool` operations are stable in const fn
+error[E0723]: only int and `bool` operations are stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:84:35
|
LL | const fn foo19_3(f: f32) -> f32 { -f }
| ^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: only int, `bool` and `char` operations are stable in const fn
+error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:86:43
|
LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g }
| ^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: cannot access `static` items in const fn
+error[E0723]: cannot access `static` items in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:90:27
|
LL | const fn foo25() -> u32 { BAR } //~ ERROR cannot access `static` items in const fn
| ^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: cannot access `static` items in const fn
+error[E0723]: cannot access `static` items in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:91:36
|
LL | const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot access `static` items
| ^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: casting pointers to ints is unstable in const fn
+error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:92:42
|
LL | const fn foo30(x: *const u32) -> usize { x as usize }
| ^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: casting pointers to ints is unstable in const fn
+error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:94:63
|
LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
| ^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: casting pointers to ints is unstable in const fn
+error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:96:42
|
LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
| ^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: casting pointers to ints is unstable in const fn
+error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:98:63
|
LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
| ^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: `if`, `match`, `&&` and `||` are not stable in const fn
+error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:100:38
|
LL | const fn foo30_4(b: bool) -> usize { if b { 1 } else { 42 } }
| ^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: `if`, `match`, `&&` and `||` are not stable in const fn
+error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:102:29
|
LL | const fn foo30_5(b: bool) { while b { } } //~ ERROR not stable in const fn
| ^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: `if`, `match`, `&&` and `||` are not stable in const fn
+error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:104:44
|
LL | const fn foo36(a: bool, b: bool) -> bool { a && b }
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: `if`, `match`, `&&` and `||` are not stable in const fn
+error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:106:44
|
LL | const fn foo37(a: bool, b: bool) -> bool { a || b }
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:108:14
|
LL | const fn inc(x: &mut i32) { *x += 1 }
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:113:6
|
LL | impl<T: std::fmt::Debug> Foo<T> {
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:118:6
|
LL | impl<T: std::fmt::Debug + Sized> Foo<T> {
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:123:6
|
LL | impl<T: Sync + Sized> Foo<T> {
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: `impl Trait` in const fn is unstable
+error[E0723]: `impl Trait` in const fn is unstable (see issue #57563)
--> $DIR/min_const_fn.rs:129:24
|
LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { AlanTuring(0) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:131:34
|
LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
| ^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:133:22
|
LL | const fn no_apit(_x: impl std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`
| ^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: `impl Trait` in const fn is unstable
+error[E0723]: `impl Trait` in const fn is unstable (see issue #57563)
--> $DIR/min_const_fn.rs:134:23
|
LL | const fn no_rpit() -> impl std::fmt::Debug {} //~ ERROR `impl Trait` in const fn is unstable
| ^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:135:23
|
LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`
| ^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:136:32
|
LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
warning[E0515]: cannot return reference to temporary value
--> $DIR/min_const_fn.rs:136:63
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:141:41
|
LL | const fn really_no_traits_i_mean_it() { (&() as &std::fmt::Debug, ()).1 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: function pointers in const fn are unstable
+error[E0723]: function pointers in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:144:21
|
LL | const fn no_fn_ptrs(_x: fn()) {}
| ^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: function pointers in const fn are unstable
+error[E0723]: function pointers in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:146:27
|
LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
| ^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to 36 previous errors
-Some errors occurred: E0493, E0515.
+Some errors occurred: E0493, E0515, E0723.
For more information about an error, try `rustc --explain E0493`.
LL | const fn into_inner(self) -> T { self.0 } //~ destructors cannot be evaluated
| ^^^^ constant functions cannot evaluate destructors
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:39:36
|
LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 }
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error[E0493]: destructors cannot be evaluated at compile-time
--> $DIR/min_const_fn.rs:44:28
LL | const fn into_inner_lt(self) -> T { self.0 } //~ destructors cannot be evaluated
| ^^^^ constant functions cannot evaluate destructors
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:46:42
|
LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error[E0493]: destructors cannot be evaluated at compile-time
--> $DIR/min_const_fn.rs:51:27
LL | const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructors
| ^^^^ constant functions cannot evaluate destructors
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:53:38
|
LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:58:39
|
LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:76:16
|
LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:78:18
|
LL | const fn foo11_2<T: Send>(t: T) -> T { t }
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: only int, `bool` and `char` operations are stable in const fn
+error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:80:33
|
LL | const fn foo19(f: f32) -> f32 { f * 2.0 }
| ^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: only int, `bool` and `char` operations are stable in const fn
+error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:82:35
|
LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f }
| ^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: only int and `bool` operations are stable in const fn
+error[E0723]: only int and `bool` operations are stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:84:35
|
LL | const fn foo19_3(f: f32) -> f32 { -f }
| ^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: only int, `bool` and `char` operations are stable in const fn
+error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:86:43
|
LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g }
| ^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: cannot access `static` items in const fn
+error[E0723]: cannot access `static` items in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:90:27
|
LL | const fn foo25() -> u32 { BAR } //~ ERROR cannot access `static` items in const fn
| ^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: cannot access `static` items in const fn
+error[E0723]: cannot access `static` items in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:91:36
|
LL | const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot access `static` items
| ^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: casting pointers to ints is unstable in const fn
+error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:92:42
|
LL | const fn foo30(x: *const u32) -> usize { x as usize }
| ^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: casting pointers to ints is unstable in const fn
+error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:94:63
|
LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
| ^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: casting pointers to ints is unstable in const fn
+error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:96:42
|
LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
| ^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: casting pointers to ints is unstable in const fn
+error[E0723]: casting pointers to ints is unstable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:98:63
|
LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
| ^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: `if`, `match`, `&&` and `||` are not stable in const fn
+error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:100:38
|
LL | const fn foo30_4(b: bool) -> usize { if b { 1 } else { 42 } }
| ^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: `if`, `match`, `&&` and `||` are not stable in const fn
+error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:102:29
|
LL | const fn foo30_5(b: bool) { while b { } } //~ ERROR not stable in const fn
| ^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: `if`, `match`, `&&` and `||` are not stable in const fn
+error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:104:44
|
LL | const fn foo36(a: bool, b: bool) -> bool { a && b }
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: `if`, `match`, `&&` and `||` are not stable in const fn
+error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
--> $DIR/min_const_fn.rs:106:44
|
LL | const fn foo37(a: bool, b: bool) -> bool { a || b }
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:108:14
|
LL | const fn inc(x: &mut i32) { *x += 1 }
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:113:6
|
LL | impl<T: std::fmt::Debug> Foo<T> {
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:118:6
|
LL | impl<T: std::fmt::Debug + Sized> Foo<T> {
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:123:6
|
LL | impl<T: Sync + Sized> Foo<T> {
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: `impl Trait` in const fn is unstable
+error[E0723]: `impl Trait` in const fn is unstable (see issue #57563)
--> $DIR/min_const_fn.rs:129:24
|
LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { AlanTuring(0) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:131:34
|
LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
| ^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:133:22
|
LL | const fn no_apit(_x: impl std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`
| ^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: `impl Trait` in const fn is unstable
+error[E0723]: `impl Trait` in const fn is unstable (see issue #57563)
--> $DIR/min_const_fn.rs:134:23
|
LL | const fn no_rpit() -> impl std::fmt::Debug {} //~ ERROR `impl Trait` in const fn is unstable
| ^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:135:23
|
LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`
| ^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:136:32
|
LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:141:41
|
LL | const fn really_no_traits_i_mean_it() { (&() as &std::fmt::Debug, ()).1 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: function pointers in const fn are unstable
+error[E0723]: function pointers in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:144:21
|
LL | const fn no_fn_ptrs(_x: fn()) {}
| ^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: function pointers in const fn are unstable
+error[E0723]: function pointers in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn.rs:146:27
|
LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
| ^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to 36 previous errors
-For more information about this error, try `rustc --explain E0493`.
+Some errors occurred: E0493, E0723.
+For more information about an error, try `rustc --explain E0493`.
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn_dyn.rs:9:5
|
LL | x.0.field;
| ^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn_dyn.rs:12:66
|
LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }
| ^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
warning[E0716]: temporary value dropped while borrowed
--> $DIR/min_const_fn_dyn.rs:12:67
error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0716`.
+Some errors occurred: E0716, E0723.
+For more information about an error, try `rustc --explain E0716`.
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn_dyn.rs:9:5
|
LL | x.0.field;
| ^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: trait bounds other than `Sized` on const fn parameters are unstable
+error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
--> $DIR/min_const_fn_dyn.rs:12:66
|
LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }
| ^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0723`.
-error: function pointers in const fn are unstable
+error[E0723]: function pointers in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn_fn_ptr.rs:11:5
|
LL | x.0.field;
| ^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: function pointers in const fn are unstable
+error[E0723]: function pointers in const fn are unstable (see issue #57563)
--> $DIR/min_const_fn_fn_ptr.rs:14:59
|
LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasPtr { field }) }
| ^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0723`.
-error: can only call other `min_const_fn` within a `min_const_fn`
+error[E0723]: can only call other `min_const_fn` within a `min_const_fn` (see issue #57563)
--> $DIR/min_const_fn_libstd_stability.rs:15:25
|
LL | const fn bar() -> u32 { foo() } //~ ERROR can only call other `min_const_fn`
| ^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: can only call other `min_const_fn` within a `min_const_fn`
+error[E0723]: can only call other `min_const_fn` within a `min_const_fn` (see issue #57563)
--> $DIR/min_const_fn_libstd_stability.rs:22:26
|
LL | const fn bar2() -> u32 { foo2() } //~ ERROR can only call other `min_const_fn`
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: only int, `bool` and `char` operations are stable in const fn
+error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)
--> $DIR/min_const_fn_libstd_stability.rs:26:26
|
LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 } //~ ERROR only int, `bool` and `char` operations
| ^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: can only call other `min_const_fn` within a `min_const_fn`
+error[E0723]: can only call other `min_const_fn` within a `min_const_fn` (see issue #57563)
--> $DIR/min_const_fn_libstd_stability.rs:34:32
|
LL | const fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR can only call other `min_const_fn`
| ^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to 4 previous errors
+For more information about this error, try `rustc --explain E0723`.
-error: can only call other `min_const_fn` within a `min_const_fn`
+error[E0723]: can only call other `min_const_fn` within a `min_const_fn` (see issue #57563)
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:15:41
|
LL | const unsafe fn bar() -> u32 { unsafe { foo() } } //~ ERROR can only call other `min_const_fn`
| ^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: can only call other `min_const_fn` within a `min_const_fn`
+error[E0723]: can only call other `min_const_fn` within a `min_const_fn` (see issue #57563)
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:22:42
|
LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } } //~ ERROR can only call other `min_const_fn`
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: only int, `bool` and `char` operations are stable in const fn
+error[E0723]: only int, `bool` and `char` operations are stable in const fn (see issue #57563)
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:26:33
|
LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 } //~ ERROR only int, `bool` and `char` op
| ^^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: can only call other `min_const_fn` within a `min_const_fn`
+error[E0723]: can only call other `min_const_fn` within a `min_const_fn` (see issue #57563)
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:34:48
|
LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } } //~ ERROR can only call other
| ^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to 4 previous errors
+For more information about this error, try `rustc --explain E0723`.
-error: can only call other `min_const_fn` within a `min_const_fn`
+error[E0723]: can only call other `min_const_fn` within a `min_const_fn` (see issue #57563)
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:15:32
|
LL | const unsafe fn bar() -> u32 { foo() } //~ ERROR can only call other `min_const_fn`
| ^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: can only call other `min_const_fn` within a `min_const_fn`
+error[E0723]: can only call other `min_const_fn` within a `min_const_fn` (see issue #57563)
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:22:33
|
LL | const unsafe fn bar2() -> u32 { foo2() } //~ ERROR can only call other `min_const_fn`
| ^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: can only call other `min_const_fn` within a `min_const_fn`
+error[E0723]: can only call other `min_const_fn` within a `min_const_fn` (see issue #57563)
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:30:39
|
LL | const unsafe fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR can only call other `min_const_fn`
| ^^^^^^^^^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to 3 previous errors
+For more information about this error, try `rustc --explain E0723`.
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/mutable_borrow.rs:3:9
|
LL | let b = &mut a; //~ ERROR mutable references in const fn
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/mutable_borrow.rs:12:13
|
LL | let b = &mut a; //~ ERROR mutable references in const fn
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0723`.
--- /dev/null
+//compile-pass
+
+#![feature(nll)]
+
+fn main() {
+
+ let _: &'static usize = &(loop {}, 1).1;
+}
LL | x => 42, //~ ERROR unimplemented expression type
| ^
-error: `if`, `match`, `&&` and `||` are not stable in const fn
+error[E0723]: `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
--> $DIR/single_variant_match_ice.rs:18:13
|
LL | Prob => 0x1, //~ ERROR `if`, `match`, `&&` and `||` are not stable in const fn
| ^^^^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to 3 previous errors
-For more information about this error, try `rustc --explain E0019`.
+Some errors occurred: E0019, E0723.
+For more information about an error, try `rustc --explain E0019`.
//~^ const generics in any position are currently unsupported
struct Foo<const X: usize>([(); X]); //~ ERROR const generics are unstable
+//~^ const generics in any position are currently unsupported
fn main() {}
LL | fn foo<const X: ()>() {} //~ ERROR const generics are unstable
| ^
-error: aborting due to 3 previous errors
+error: const generics in any position are currently unsupported
+ --> $DIR/feature-gate-const_generics.rs:4:18
+ |
+LL | struct Foo<const X: usize>([(); X]); //~ ERROR const generics are unstable
+ | ^
+
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0658`.
#![deny(no_mangle_generic_items)]
#[no_mangle]
-pub fn foo<T>() {} //~ ERROR functions generic over types must be mangled
+pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
#[no_mangle]
-pub extern fn bar<T>() {} //~ ERROR functions generic over types must be mangled
+pub extern fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
#[no_mangle]
pub fn baz(x: &i32) -> &i32 { x }
-error: functions generic over types must be mangled
+error: functions generic over types or consts must be mangled
--> $DIR/generic-no-mangle.rs:4:1
|
LL | #[no_mangle]
| ------------ help: remove this attribute
-LL | pub fn foo<T>() {} //~ ERROR functions generic over types must be mangled
+LL | pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
| ^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
LL | #![deny(no_mangle_generic_items)]
| ^^^^^^^^^^^^^^^^^^^^^^^
-error: functions generic over types must be mangled
+error: functions generic over types or consts must be mangled
--> $DIR/generic-no-mangle.rs:7:1
|
LL | #[no_mangle]
| ------------ help: remove this attribute
-LL | pub extern fn bar<T>() {} //~ ERROR functions generic over types must be mangled
+LL | pub extern fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
-error: function pointers in const fn are unstable
+error[E0723]: function pointers in const fn are unstable (see issue #57563)
--> $DIR/issue-37550.rs:3:9
|
LL | let x = || t; //~ ERROR function pointers in const fn are unstable
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0723`.
--- /dev/null
+// Regression test for #57979. This situation is meant to be an error.
+// As noted in the issue thread, we decided to forbid nested impl
+// trait of this kind:
+//
+// ```rust
+// fn foo() -> impl Foo<impl Bar> { .. }
+// ```
+//
+// Basically there are two hidden variables here, let's call them `X`
+// and `Y`, and we must prove that:
+//
+// ```
+// X: Foo<Y>
+// Y: Bar
+// ```
+//
+// However, the user is only giving us the return type `X`. It's true
+// that in some cases, we can infer `Y` from `X`, because `X` only
+// implements `Foo` for one type (and indeed the compiler does
+// inference of this kind), but I do recall that we intended to forbid
+// this -- in part because such inference is fragile, and there is not
+// necessarily a way for the user to be more explicit should the
+// inference fail (so you could get stuck with no way to port your
+// code forward if, for example, more impls are added to an existing
+// type).
+//
+// The same seems to apply in this situation. Here there are three impl traits, so we have
+//
+// ```
+// X: IntoIterator<Item = Y>
+// Y: Borrow<Data<Z>>
+// Z: AsRef<[u8]>
+// ```
+
+use std::borrow::Borrow;
+
+pub struct Data<TBody>(TBody);
+
+pub fn collect(_: impl IntoIterator<Item = impl Borrow<Data<impl AsRef<[u8]>>>>) {
+ //~^ ERROR
+ unimplemented!()
+}
--- /dev/null
+error[E0666]: nested `impl Trait` is not allowed
+ --> $DIR/issue-57979.rs:39:61
+ |
+LL | pub fn collect(_: impl IntoIterator<Item = impl Borrow<Data<impl AsRef<[u8]>>>>) {
+ | -----------------^^^^^^^^^^^^^^^^--
+ | | |
+ | | nested `impl Trait` here
+ | outer `impl Trait`
+
+error[E0601]: `main` function not found in crate `issue_57979`
+ |
+ = note: consider adding a `main` function to `$DIR/issue-57979.rs`
+
+error: aborting due to 2 previous errors
+
+Some errors occurred: E0601, E0666.
+For more information about an error, try `rustc --explain E0601`.
#[no_mangle]
//~^ HELP remove this attribute
pub fn defiant<T>(_t: T) {}
-//~^ WARN functions generic over types must be mangled
+//~^ WARN functions generic over types or consts must be mangled
#[no_mangle]
fn rio_grande() {}
//~^ ERROR const items should never be #[no_mangle]
//~| HELP try a static value
#[no_mangle] pub fn val_jean<T>() {}
- //~^ WARN functions generic over types must be mangled
+ //~^ WARN functions generic over types or consts must be mangled
//~| HELP remove this attribute
// ... but we can suggest just-`pub` instead of restricted
//~^ ERROR const items should never be #[no_mangle]
//~| HELP try a static value
#[no_mangle] pub(crate) fn crossfield<T>() {}
- //~^ WARN functions generic over types must be mangled
+ //~^ WARN functions generic over types or consts must be mangled
//~| HELP remove this attribute
}
|
= note: #[deny(no_mangle_const_items)] on by default
-warning: functions generic over types must be mangled
+warning: functions generic over types or consts must be mangled
--> $DIR/suggestions.rs:12:1
|
LL | #[no_mangle]
| |
| help: try a static value: `pub static`
-warning: functions generic over types must be mangled
+warning: functions generic over types or consts must be mangled
--> $DIR/suggestions.rs:25:18
|
LL | #[no_mangle] pub fn val_jean<T>() {}
| |
| help: try a static value: `pub static`
-warning: functions generic over types must be mangled
+warning: functions generic over types or consts must be mangled
--> $DIR/suggestions.rs:33:18
|
LL | #[no_mangle] pub(crate) fn crossfield<T>() {}
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/ranged_ints2_const.rs:11:9
|
LL | let y = &mut x.0; //~ ERROR references in const fn are unstable
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
-error: mutable references in const fn are unstable
+error[E0723]: mutable references in const fn are unstable (see issue #57563)
--> $DIR/ranged_ints2_const.rs:18:9
|
LL | let y = unsafe { &mut x.0 }; //~ ERROR mutable references in const fn are unstable
| ^
+ |
+ = help: add #![feature(const_fn)] to the crate attributes to enable
error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block
--> $DIR/ranged_ints2_const.rs:11:13
error: aborting due to 3 previous errors
-For more information about this error, try `rustc --explain E0133`.
+Some errors occurred: E0133, E0723.
+For more information about an error, try `rustc --explain E0133`.
-Subproject commit 3bda548f81bc268a2e9813ce9168d2e40e8a11bd
+Subproject commit d61b25419bec5a3e839fdb16f720cfb12e52ddf1
# List of people to ping when the status of a tool changed.
MAINTAINERS = {
'miri': '@oli-obk @RalfJung @eddyb',
- 'clippy-driver': '@Manishearth @llogiq @mcarton @oli-obk',
+ 'clippy-driver': '@Manishearth @llogiq @mcarton @oli-obk @phansch',
'rls': '@nrc @Xanewok',
'rustfmt': '@nrc @topecongiro',
'book': '@carols10cents @steveklabnik',
# assume that PR authors are also owners of the repo where the branch lives
relevant_pr_match = re.search(
- 'Auto merge of #([0-9]+) - ([^:]+):[^,]+ r=([^\s]+)',
+ r'Auto merge of #([0-9]+) - ([^:]+):[^,]+, r=(\S+)',
cur_commit_msg,
)
if relevant_pr_match:
pr_reviewer = relevant_pr_match.group(3)
else:
number = '-1'
- relevant_pr_user = '<unknown user>'
+ relevant_pr_user = 'ghost'
relevant_pr_number = '<unknown PR>'
relevant_pr_url = '<unknown>'
- pr_reviewer = '<unknown reviewer>'
+ pr_reviewer = 'ghost'
message = update_latest(
cur_commit,
-Subproject commit f331ff713917f6edb044c7e5c6c28c3845afebe7
+Subproject commit 0d6f53e1a4adbaf7d83cdc0cb54720203fcb522e
rand = { version = "0.5.5", features = ["i128_support"] }
serde = { version = "1.0.82", features = ['derive'] }
serde_json = { version = "1.0.31", features = ["raw_value"] }
-smallvec = { version = "0.6", features = ['union'] }
+smallvec = { version = "0.6", features = ['union', 'may_dangle'] }
scopeguard = { version = "0.3.3", features = ["use_std", "default"]}
byteorder = { version = "1.2.7", features = ["i128"]}
-Subproject commit be135599ef5e54b5219f9adec68e1ee267ea0584
+Subproject commit d6829d62dca64dfe7ceaa96d1a9c1cd36428221d
"im-rc", // MPL-2.0+, cargo
"adler32", // BSD-3-Clause AND Zlib, cargo dep that isn't used
"fortanix-sgx-abi", // MPL-2.0+, libstd but only for `sgx` target
+ "constant_time_eq", // CC0-1.0, rustfmt
];
/// Which crates to check against the whitelist?