]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #58534 - dwijnand:mention-capping-forbid-lints, r=oli-obk
authorkennytm <kennytm@gmail.com>
Tue, 19 Feb 2019 17:13:27 +0000 (01:13 +0800)
committerkennytm <kennytm@gmail.com>
Wed, 20 Feb 2019 03:58:45 +0000 (11:58 +0800)
Mention capping forbid lints

I felt the description of forbid was misleading/incomplete without
mentioning how --cap-lints interacts with it.

162 files changed:
Cargo.lock
src/bootstrap/bin/rustdoc.rs
src/bootstrap/doc.rs
src/ci/docker/README.md
src/ci/docker/dist-arm-linux/Dockerfile
src/ci/docker/dist-arm-linux/arm-linux-gnueabi.config
src/ci/docker/dist-arm-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch [new file with mode: 0644]
src/ci/docker/dist-armhf-linux/Dockerfile
src/ci/docker/dist-armhf-linux/arm-linux-gnueabihf.config
src/ci/docker/dist-armhf-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch [new file with mode: 0644]
src/ci/docker/dist-armv7-linux/Dockerfile
src/ci/docker/dist-armv7-linux/armv7-linux-gnueabihf.config
src/ci/docker/dist-armv7-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch [new file with mode: 0644]
src/ci/docker/dist-powerpc-linux/patches/glibc/2.12.2/002-newer-gcc.patch [new file with mode: 0644]
src/ci/docker/dist-powerpc-linux/powerpc-linux-gnu.config
src/ci/docker/dist-powerpc64-linux/patches/glibc/2.12.2/003-newer-gcc.patch [new file with mode: 0644]
src/ci/docker/dist-powerpc64-linux/powerpc64-linux-gnu.config
src/ci/docker/dist-s390x-linux/patches/glibc/2.12.2/002-newer-gcc.patch [new file with mode: 0644]
src/ci/docker/dist-s390x-linux/s390x-linux-gnu.config
src/ci/docker/dist-x86_64-linux/build-clang.sh
src/ci/docker/dist-x86_64-linux/build-gcc.sh
src/ci/docker/dist-x86_64-linux/build-perl.sh
src/ci/docker/run.sh
src/doc/rustdoc/src/documentation-tests.md
src/etc/generate-deriving-span-tests.py
src/etc/generate-keyword-tests.py
src/liballoc/benches/lib.rs
src/liballoc/boxed.rs
src/liballoc/collections/btree/node.rs
src/liballoc/lib.rs
src/liballoc/slice.rs
src/liballoc/tests/arc.rs
src/liballoc/tests/binary_heap.rs
src/liballoc/tests/btree/map.rs
src/liballoc/tests/btree/mod.rs
src/liballoc/tests/heap.rs
src/liballoc/tests/lib.rs
src/liballoc/tests/rc.rs
src/liballoc/tests/slice.rs
src/liballoc/tests/str.rs
src/liballoc/tests/string.rs
src/liballoc/tests/vec.rs
src/liballoc/tests/vec_deque.rs
src/libcore/lib.rs
src/libcore/macros.rs
src/libcore/mem.rs
src/libcore/slice/mod.rs
src/libcore/tests/cell.rs
src/libcore/tests/fmt/mod.rs
src/libcore/tests/hash/mod.rs
src/libcore/tests/iter.rs
src/libcore/tests/num/bignum.rs
src/libcore/tests/num/dec2flt/mod.rs
src/libcore/tests/num/flt2dec/mod.rs
src/libcore/tests/num/mod.rs
src/libcore/tests/option.rs
src/libcore/tests/ptr.rs
src/libcore/tests/result.rs
src/libcore/tests/slice.rs
src/libcore/tests/time.rs
src/librustc/diagnostics.rs
src/librustc/hir/def.rs
src/librustc/hir/intravisit.rs
src/librustc/hir/lowering.rs
src/librustc/hir/map/mod.rs
src/librustc/hir/mod.rs
src/librustc/hir/pat_util.rs
src/librustc/hir/print.rs
src/librustc/ich/impls_hir.rs
src/librustc/lib.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/reachable.rs
src/librustc/middle/resolve_lifetime.rs
src/librustc_codegen_llvm/lib.rs
src/librustc_codegen_llvm/llvm_util.rs
src/librustc_codegen_ssa/lib.rs
src/librustc_driver/lib.rs
src/librustc_lint/builtin.rs
src/librustc_lint/nonstandard_style.rs
src/librustc_metadata/encoder.rs
src/librustc_metadata/lib.rs
src/librustc_mir/diagnostics.rs
src/librustc_mir/interpret/snapshot.rs
src/librustc_mir/lib.rs
src/librustc_mir/monomorphize/collector.rs
src/librustc_mir/transform/qualify_consts.rs
src/librustc_passes/ast_validation.rs
src/librustc_resolve/lib.rs
src/librustc_typeck/astconv.rs
src/librustc_typeck/check/compare_method.rs
src/librustc_typeck/collect.rs
src/librustc_typeck/diagnostics.rs
src/librustc_typeck/lib.rs
src/librustdoc/clean/auto_trait.rs
src/librustdoc/clean/mod.rs
src/librustdoc/config.rs
src/librustdoc/core.rs
src/librustdoc/html/format.rs
src/librustdoc/html/render.rs
src/librustdoc/html/static/main.js
src/librustdoc/html/static/rustdoc.css
src/librustdoc/html/static/themes/dark.css
src/librustdoc/html/static/themes/light.css
src/librustdoc/lib.rs
src/librustdoc/test.rs
src/libstd/Cargo.toml
src/libstd/error.rs
src/libstd/fs.rs
src/libstd/lib.rs
src/libstd/net/ip.rs
src/libstd/path.rs
src/libstd/sys/unix/process/process_unix.rs
src/libstd/time.rs
src/libsyntax/lib.rs
src/stage0.txt
src/stdsimd
src/test/rustdoc-ui/failed-doctest-output.stdout
src/test/rustdoc/issue-19190.rs
src/test/rustdoc/issue-21092.rs
src/test/rustdoc/issue-35169-2.rs
src/test/rustdoc/issue-35169.rs
src/test/rustdoc/macros.rs
src/test/rustdoc/process-termination.rs [new file with mode: 0644]
src/test/rustdoc/src-links.rs
src/test/rustdoc/structfields.rs
src/test/rustdoc/without-redirect.rs [new file with mode: 0644]
src/test/rustdoc/wrapping.rs [new file with mode: 0644]
src/test/ui/const-generics/const-param-before-other-params.rs
src/test/ui/const-generics/const-param-before-other-params.stderr
src/test/ui/const-generics/const-parameter-uppercase-lint.rs [new file with mode: 0644]
src/test/ui/const-generics/const-parameter-uppercase-lint.stderr [new file with mode: 0644]
src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr
src/test/ui/consts/min_const_fn/cast_errors.stderr
src/test/ui/consts/min_const_fn/cmp_fn_pointers.stderr
src/test/ui/consts/min_const_fn/loop_ice.stderr
src/test/ui/consts/min_const_fn/min_const_fn.nll.stderr
src/test/ui/consts/min_const_fn/min_const_fn.stderr
src/test/ui/consts/min_const_fn/min_const_fn_dyn.nll.stderr
src/test/ui/consts/min_const_fn/min_const_fn_dyn.stderr
src/test/ui/consts/min_const_fn/min_const_fn_fn_ptr.stderr
src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr
src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr
src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr
src/test/ui/consts/min_const_fn/mutable_borrow.stderr
src/test/ui/consts/promote_evaluation_unused_result.rs [new file with mode: 0644]
src/test/ui/consts/single_variant_match_ice.stderr
src/test/ui/feature-gates/feature-gate-const_generics.rs
src/test/ui/feature-gates/feature-gate-const_generics.stderr
src/test/ui/generic/generic-no-mangle.rs
src/test/ui/generic/generic-no-mangle.stderr
src/test/ui/issues/issue-37550.stderr
src/test/ui/issues/issue-57979.rs [new file with mode: 0644]
src/test/ui/issues/issue-57979.stderr [new file with mode: 0644]
src/test/ui/lint/suggestions.rs
src/test/ui/lint/suggestions.stderr
src/test/ui/unsafe/ranged_ints2_const.stderr
src/tools/clippy
src/tools/publish_toolstate.py
src/tools/rls
src/tools/rustc-workspace-hack/Cargo.toml
src/tools/rustfmt
src/tools/tidy/src/deps.rs

index 963bbcf0f0429b59a0164a95b6f5e7b981aa02b2..9d766680609e0e0c42cc5a087f6d8a19aebb35d4 100644 (file)
@@ -56,6 +56,15 @@ dependencies = [
  "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"
@@ -69,19 +78,6 @@ dependencies = [
  "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"
@@ -138,6 +134,15 @@ name = "bitflags"
 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"
@@ -198,7 +203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[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)",
@@ -250,7 +255,7 @@ dependencies = [
  "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)",
@@ -506,6 +511,11 @@ dependencies = [
  "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"
@@ -752,6 +762,16 @@ dependencies = [
  "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"
@@ -813,11 +833,6 @@ dependencies = [
  "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"
@@ -1150,7 +1165,7 @@ dependencies = [
 
 [[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)",
@@ -1364,7 +1379,7 @@ dependencies = [
 
 [[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)",
@@ -2047,7 +2062,7 @@ dependencies = [
 
 [[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)",
@@ -2057,8 +2072,8 @@ dependencies = [
  "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]]
@@ -2190,6 +2205,17 @@ dependencies = [
  "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"
@@ -2258,31 +2284,33 @@ dependencies = [
  "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)",
@@ -2295,7 +2323,7 @@ dependencies = [
 
 [[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)",
@@ -2303,8 +2331,8 @@ dependencies = [
  "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)",
 ]
 
@@ -2315,10 +2343,10 @@ source = "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)",
@@ -2331,7 +2359,7 @@ source = "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)",
@@ -2345,7 +2373,7 @@ version = "0.7.0"
 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]]
@@ -2392,20 +2420,20 @@ dependencies = [
 
 [[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)",
@@ -2415,16 +2443,16 @@ dependencies = [
 
 [[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)",
@@ -2434,34 +2462,34 @@ dependencies = [
 
 [[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)",
@@ -2469,29 +2497,29 @@ dependencies = [
 
 [[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)",
 ]
@@ -2907,8 +2935,8 @@ name = "rustc_save_analysis"
 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",
@@ -3024,24 +3052,24 @@ dependencies = [
 
 [[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)",
@@ -3049,6 +3077,8 @@ dependencies = [
  "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]]
@@ -3089,6 +3119,11 @@ name = "scoped-tls"
 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"
@@ -3748,6 +3783,11 @@ name = "unicode-xid"
 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"
@@ -3932,9 +3972,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "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"
@@ -3942,11 +3982,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "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"
@@ -3965,6 +4006,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "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"
@@ -3989,13 +4031,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "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"
@@ -4032,7 +4074,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "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"
@@ -4055,7 +4097,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "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"
@@ -4124,7 +4166,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "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"
@@ -4139,26 +4181,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "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"
@@ -4172,6 +4215,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "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"
@@ -4233,6 +4277,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "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"
index dec74e60c71f3523348a506f1bac18d0ec05a5e7..aeb15821b0bb742c32e35d8cccb2e70fd048f675 100644 (file)
@@ -16,6 +16,7 @@ fn main() {
     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;
 
@@ -54,9 +55,22 @@ fn main() {
     // 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 {
index d14b23e5988cbb85266875a5dee55de259e19eef..660f9b9ef578adeecd41f28f0798aa03c1c771a2 100644 (file)
@@ -517,6 +517,7 @@ fn run(self, builder: &Builder) {
             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);
@@ -581,7 +582,9 @@ fn run(self, builder: &Builder) {
         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);
@@ -650,9 +653,9 @@ fn run(self, builder: &Builder) {
         // 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);
index 8d4dbc399986fa1865208170018d51c450ef3f0b..34320ab4411e2d70640efd7e55f2e62011f230a7 100644 (file)
@@ -131,13 +131,15 @@ $category > $option = $value -- $comment
 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`
@@ -145,6 +147,8 @@ For targets: `arm-unknown-linux-gnueabi`
 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 -- (+)
@@ -152,8 +156,8 @@ For targets: `arm-unknown-linux-gnueabihf`
 - 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`
@@ -161,6 +165,8 @@ For targets: `arm-unknown-linux-gnueabihf`
 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 -- (+)
@@ -169,8 +175,8 @@ For targets: `armv7-unknown-linux-gnueabihf`
 - 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
@@ -204,7 +210,7 @@ For targets: `powerpc-unknown-linux-gnu`
 - 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`
@@ -221,7 +227,7 @@ For targets: `powerpc64-unknown-linux-gnu`
 - 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.
@@ -232,12 +238,12 @@ For targets: `s390x-unknown-linux-gnu`
 
 - 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
index 6ddc5c1e04ae35223c38a6002ac6ef996f23a3e0..48851ae232c99c481ba7482e5758b17e98bab6c9 100644 (file)
@@ -16,6 +16,7 @@ RUN sh /scripts/rustbuild-setup.sh
 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
 
index f73ad069550e15f871d48a9293aea9bce61249c5..4185112d8be90f28c34da0d0242fe36f1452f989 100644 (file)
@@ -3,6 +3,7 @@
 # Crosstool-NG Configuration
 #
 CT_CONFIGURE_has_make381=y
+CT_CONFIGURE_has_xz=y
 CT_MODULES=y
 
 #
@@ -44,14 +45,16 @@ CT_CONNECT_TIMEOUT=10
 # 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
@@ -391,8 +394,8 @@ CT_CC_CORE_PASS_1_NEEDED=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
@@ -407,8 +410,9 @@ CT_CC_GCC_4_5_or_later=y
 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
@@ -420,7 +424,7 @@ CT_CC_GCC_USE_GMP_MPFR=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=""
@@ -492,7 +496,6 @@ CT_GETTEXT_NEEDED=y
 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
@@ -500,7 +503,6 @@ CT_GETTEXT=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"
@@ -526,15 +528,13 @@ CT_MPFR_V_3_1_3=y
 # 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
diff --git a/src/ci/docker/dist-arm-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch b/src/ci/docker/dist-arm-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch
new file mode 100644 (file)
index 0000000..871d522
--- /dev/null
@@ -0,0 +1,48 @@
+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 *);
index e4d4b2feeec40270c84f97b3277bfc4dfd6bb911..d1dd9faaa103526b51cc3d2f99756d8eb745524f 100644 (file)
@@ -16,6 +16,7 @@ RUN sh /scripts/rustbuild-setup.sh
 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
 
index 1feeef15557498d7d0be00e216370aa2416b2a2b..bebbcd1670a5e154bb5674a67af6054ac3ee7d2f 100644 (file)
@@ -3,6 +3,7 @@
 # Crosstool-NG Configuration
 #
 CT_CONFIGURE_has_make381=y
+CT_CONFIGURE_has_xz=y
 CT_MODULES=y
 
 #
@@ -44,14 +45,16 @@ CT_CONNECT_TIMEOUT=10
 # 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
@@ -392,8 +395,8 @@ CT_CC_CORE_PASS_1_NEEDED=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
@@ -408,8 +411,9 @@ CT_CC_GCC_4_5_or_later=y
 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
@@ -421,7 +425,7 @@ CT_CC_GCC_USE_GMP_MPFR=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=""
@@ -493,7 +497,6 @@ CT_GETTEXT_NEEDED=y
 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
@@ -501,7 +504,6 @@ CT_GETTEXT=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"
@@ -527,15 +529,13 @@ CT_MPFR_V_3_1_3=y
 # 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
diff --git a/src/ci/docker/dist-armhf-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch b/src/ci/docker/dist-armhf-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch
new file mode 100644 (file)
index 0000000..871d522
--- /dev/null
@@ -0,0 +1,48 @@
+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 *);
index 99fe7bd7b8f7871fc5aa607f00ec2fb2103bfcb5..170b8134d3edcd8ac32931c06416e472f5f0253e 100644 (file)
@@ -16,6 +16,7 @@ RUN sh /scripts/rustbuild-setup.sh
 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
 
index 79d6c77c41152115f176d175483453b85983c408..5cccfd8444d3536a8c501e48f8782a958e795fd9 100644 (file)
@@ -3,6 +3,7 @@
 # Crosstool-NG Configuration
 #
 CT_CONFIGURE_has_make381=y
+CT_CONFIGURE_has_xz=y
 CT_MODULES=y
 
 #
@@ -44,14 +45,16 @@ CT_CONNECT_TIMEOUT=10
 # 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
@@ -155,12 +158,6 @@ CT_ARCH_EXCLUSIVE_WITH_CPU=y
 # 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
@@ -311,8 +308,6 @@ CT_LIBC="glibc"
 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
@@ -400,8 +395,8 @@ CT_CC_CORE_PASS_1_NEEDED=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
@@ -416,8 +411,9 @@ CT_CC_GCC_4_5_or_later=y
 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
@@ -429,7 +425,7 @@ CT_CC_GCC_USE_GMP_MPFR=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=""
@@ -501,7 +497,6 @@ CT_GETTEXT_NEEDED=y
 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
@@ -509,7 +504,6 @@ CT_GETTEXT=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"
@@ -535,15 +529,13 @@ CT_MPFR_V_3_1_3=y
 # 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
diff --git a/src/ci/docker/dist-armv7-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch b/src/ci/docker/dist-armv7-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch
new file mode 100644 (file)
index 0000000..871d522
--- /dev/null
@@ -0,0 +1,48 @@
+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 *);
diff --git a/src/ci/docker/dist-powerpc-linux/patches/glibc/2.12.2/002-newer-gcc.patch b/src/ci/docker/dist-powerpc-linux/patches/glibc/2.12.2/002-newer-gcc.patch
new file mode 100644 (file)
index 0000000..a96b488
--- /dev/null
@@ -0,0 +1,26 @@
+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.]*\)],
index 984a0a0304e4754b3e16b0beb60c97e233088725..7df41da2bf76e87cc5f3fe670b252b6850318578 100644 (file)
@@ -359,8 +359,8 @@ CT_CC_CORE_PASS_1_NEEDED=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
@@ -375,8 +375,9 @@ CT_CC_GCC_4_5_or_later=y
 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
@@ -388,7 +389,7 @@ CT_CC_GCC_USE_GMP_MPFR=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=""
@@ -460,7 +461,6 @@ CT_GETTEXT_NEEDED=y
 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
@@ -468,7 +468,6 @@ CT_GETTEXT=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"
@@ -494,15 +493,13 @@ CT_MPFR_V_3_1_3=y
 # 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
diff --git a/src/ci/docker/dist-powerpc64-linux/patches/glibc/2.12.2/003-newer-gcc.patch b/src/ci/docker/dist-powerpc64-linux/patches/glibc/2.12.2/003-newer-gcc.patch
new file mode 100644 (file)
index 0000000..a96b488
--- /dev/null
@@ -0,0 +1,26 @@
+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.]*\)],
index c2d02ee85cf25cb4e43c89c60895d5cb22757cbf..4aab4f4fd44457eccf86ed90e8290bdd59f1e6e1 100644 (file)
@@ -359,8 +359,8 @@ CT_CC_CORE_PASS_1_NEEDED=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
@@ -375,8 +375,9 @@ CT_CC_GCC_4_5_or_later=y
 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
@@ -388,7 +389,7 @@ CT_CC_GCC_USE_GMP_MPFR=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=""
@@ -460,7 +461,6 @@ CT_GETTEXT_NEEDED=y
 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
@@ -468,7 +468,6 @@ CT_GETTEXT=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"
@@ -494,15 +493,10 @@ CT_MPFR_V_3_1_3=y
 # 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
diff --git a/src/ci/docker/dist-s390x-linux/patches/glibc/2.12.2/002-newer-gcc.patch b/src/ci/docker/dist-s390x-linux/patches/glibc/2.12.2/002-newer-gcc.patch
new file mode 100644 (file)
index 0000000..a96b488
--- /dev/null
@@ -0,0 +1,26 @@
+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.]*\)],
index fa5e4510987f1ca682a642234f52353481e77e1f..cd1c41b02e3122e53059ac6a9a5565cd8952cb62 100644 (file)
@@ -339,8 +339,8 @@ CT_CC_CORE_PASS_1_NEEDED=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
@@ -355,8 +355,9 @@ CT_CC_GCC_4_5_or_later=y
 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
@@ -368,7 +369,7 @@ CT_CC_GCC_USE_GMP_MPFR=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=""
@@ -440,7 +441,6 @@ CT_GETTEXT_NEEDED=y
 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
@@ -448,7 +448,6 @@ CT_GETTEXT=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"
@@ -474,15 +473,13 @@ CT_MPFR_V_3_1_3=y
 # 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
index ff5b50123fd37a7e7cff1ebf9fcb8fafcd9a3338..ac681b71686229cedb957e8f95b1337e2297c06a 100755 (executable)
@@ -4,26 +4,14 @@ set -ex
 
 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
 
@@ -39,20 +27,21 @@ 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
index 9f3ae55cb3fe63118e868b86a151a2cd90fc7fa3..7f6e94d326ddf3012e8bf1257b5b99f727c4f1cb 100755 (executable)
@@ -3,9 +3,9 @@ set -ex
 
 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.
index a6c3d5cb683a8b8e2fdabfae6e6697d8bd39ca18..a678d353d52f5881f69ffde98d10dfac6ceeb465 100755 (executable)
@@ -11,7 +11,8 @@ cd perl-5.28.0
 # 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
index ad6188568cff2ce9f87b7b228c3d17816e13974c..25d4d73c7fe039290b63616b099e2d0181d7f080 100755 (executable)
@@ -20,9 +20,9 @@ travis_time_start
 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}')
index dcc13f53493f443f051cfa5a88687f4d901f533f..242167aa917864ddf545cf73646dad4343a71397 100644 (file)
@@ -236,6 +236,23 @@ appears to the reader as the initial idea but works with doc tests:
 /// ```
 ```
 
+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:
index 3d35ae07fbd682d1d9cc00f4098d5c11d0e5d9fe..1c525101c76f66ac40d4e709eca2428c589449d3 100755 (executable)
@@ -8,14 +8,12 @@ derives have spans that point to the fields, rather than the
 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}
@@ -63,19 +61,11 @@ def create_test_case(type, trait, super_traits, error_count):
 
     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)
@@ -86,8 +76,6 @@ def write_file(name, string):
     # mark file read-only
     os.chmod(test_file, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH)
 
-    return 1
-
 
 ENUM = 1
 STRUCT = 2
@@ -110,15 +98,11 @@ for (trait, supers, errs) in [('Clone', [], 1),
                               ('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))
index 9936ce71b76bc845764276572295314eb216893b..bc046a8f42d0b6676ac64b8a29d3e71dc539132d 100755 (executable)
@@ -15,7 +15,7 @@ import datetime
 import stat
 
 
-template = """
+template = """\
 // This file was auto-generated using 'src/etc/generate-keyword-tests.py %s'
 
 fn main() {
@@ -35,7 +35,7 @@ for kw in sys.argv[1:]:
         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)
index 08c69ee6e85079aa8abb498f964b64d5a3a7f57e..a1884b7d548523a59423c7bbfffe285ffcf37529 100644 (file)
@@ -1,5 +1,4 @@
 #![feature(repr_simd)]
-#![feature(slice_sort_by_cached_key)]
 #![feature(test)]
 
 extern crate rand;
index 51549f92d4dbf02e50a2a48c21ff8339988c2e3b..0cd2373c7f0215c19d9924522610eac7294f3d02 100644 (file)
@@ -202,10 +202,15 @@ pub fn into_raw_non_null(b: Box<T>) -> NonNull<T> {
     #[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,
index eb0667228d1fff347f64b859fede02b99e8dc88f..fc1c18789247104ad53c992d9fa3e216d6fe2ca1 100644 (file)
@@ -453,7 +453,7 @@ pub fn ascend(self) -> Result<
                     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 {
@@ -1143,7 +1143,7 @@ pub fn descend(self) -> NodeRef<BorrowType, K, V, marker::LeafOrInternal> {
         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
index 95b9dacf8565aa5ea9357e26bded9031129ac3d6..440ce8ac5e842d47ad5ee631f4ecdfa56bbb6c40 100644 (file)
 #![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)]
 
index c4f4a80a017df80aed003097f3252e0bea645b67..f4b2d463778a99dede8d43748159c11d12df656a 100644 (file)
@@ -257,6 +257,10 @@ pub fn sort_by<F>(&mut self, mut compare: F)
     /// 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).
@@ -312,7 +316,6 @@ pub fn sort_by_key<K, F>(&mut self, mut f: F)
     /// # Examples
     ///
     /// ```
-    /// #![feature(slice_sort_by_cached_key)]
     /// let mut v = [-5i32, 4, 32, -3, 2];
     ///
     /// v.sort_by_cached_key(|k| k.to_string());
@@ -320,7 +323,7 @@ pub fn sort_by_key<K, F>(&mut self, mut f: F)
     /// ```
     ///
     /// [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
index 7c5a8926126e36dd3f63904aa6f9fabdc06a6170..2759b1b1cac2769696f43075f2ab6e756318cab1 100644 (file)
@@ -1,5 +1,3 @@
-#![cfg(not(miri))]
-
 use std::any::Any;
 use std::sync::{Arc, Weak};
 use std::cell::RefCell;
index c1a1c5d88781ffaa0ba7702c4307d66ab97be574..1d4a3edc1ac42c2d4e05f71df6bc43766ecd666f 100644 (file)
@@ -282,7 +282,7 @@ fn drain<'new>(d: Drain<'static, &'static str>) -> Drain<'new, &'new str> {
 //
 // 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);
 
index aaf504073285dd187e1b9488306cdb5c059af7dd..f14750089c9560fdf2d6446f30ac355e67d12ef5 100644 (file)
@@ -9,7 +9,10 @@
 #[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 {
@@ -69,7 +72,10 @@ fn test_basic_small() {
 
 #[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();
@@ -91,7 +97,10 @@ fn test<T>(size: usize, mut iter: T)
 
 #[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();
@@ -127,7 +136,10 @@ fn test_values_mut() {
 
 #[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();
@@ -214,6 +226,7 @@ fn test_range_equal_empty_cases() {
 
 #[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)));
@@ -221,6 +234,7 @@ fn test_range_equal_excluded() {
 
 #[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)));
@@ -228,6 +242,7 @@ fn test_range_backwards_1() {
 
 #[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)));
@@ -235,6 +250,7 @@ fn test_range_backwards_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)));
@@ -242,6 +258,7 @@ fn test_range_backwards_3() {
 
 #[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)));
@@ -249,7 +266,10 @@ fn test_range_backwards_4() {
 
 #[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>) {
@@ -286,7 +306,10 @@ fn test_range_borrowed_key() {
 
 #[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 {
@@ -305,7 +328,10 @@ fn test_range() {
 
 #[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 {
@@ -479,7 +505,10 @@ fn cmp(&self, _: &Self) -> Ordering {
 #[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 {
@@ -631,6 +660,7 @@ fn $name() {
 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)> {
index 653b3f5bcb49d7b62d7b57135f9c346a6da80aa6..4c704d0f8c28fa7106bc3364133e9c44c57471b5 100644 (file)
@@ -1,5 +1,3 @@
-#![cfg(not(miri))]
-
 mod map;
 mod set;
 
index 7bc1aac7c8b59643723339646360a8abaf439564..c225ebfa96b91d36f127a71656e61970d19d3088 100644 (file)
@@ -1,5 +1,3 @@
-#![cfg(not(miri))]
-
 use std::alloc::{Global, Alloc, Layout, System};
 
 /// Issue #45955.
index 2b63ac5c7d2f990707c31f476610206544396e98..2361a7db1f7a79e10066a096edf841b961f41278 100644 (file)
@@ -4,7 +4,6 @@
 #![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)]
index 1be01d1a7ce1a1bbd279007e260df0651f85b7bf..18f82e804100823bec0e4e9c92dc55e7e444efd4 100644 (file)
@@ -1,5 +1,3 @@
-#![cfg(not(miri))]
-
 use std::any::Any;
 use std::rc::{Rc, Weak};
 use std::cell::RefCell;
index 2a9fdfa9324d5218f70bdb59102dcd17db627b49..feba46b0fad78466af3496fb3ab98bfa9807d68f 100644 (file)
@@ -1,5 +1,3 @@
-#![cfg(not(miri))]
-
 use std::cell::Cell;
 use std::cmp::Ordering::{self, Equal, Greater, Less};
 use std::mem;
@@ -260,6 +258,7 @@ fn test_swap_remove() {
 
 #[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);
@@ -391,6 +390,7 @@ fn test_reverse() {
 }
 
 #[test]
+#[cfg(not(miri))] // Miri does not support entropy
 fn test_sort() {
     let mut rng = thread_rng();
 
@@ -467,6 +467,7 @@ fn test_sort() {
 }
 
 #[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 {
@@ -631,6 +632,7 @@ fn test_insert() {
 
 #[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);
@@ -655,6 +657,7 @@ fn test_remove() {
 
 #[test]
 #[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
 fn test_remove_fail() {
     let mut a = vec![1];
     let _ = a.remove(0);
@@ -936,6 +939,7 @@ fn test_windowsator() {
 
 #[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);
@@ -960,6 +964,7 @@ fn test_chunksator() {
 
 #[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);
@@ -984,6 +989,7 @@ fn test_chunks_exactator() {
 
 #[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);
@@ -1008,6 +1014,7 @@ fn test_rchunksator() {
 
 #[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);
@@ -1032,6 +1039,7 @@ fn test_rchunks_exactator() {
 
 #[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);
@@ -1084,6 +1092,7 @@ macro_rules! t {
 
 #[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);
@@ -1093,6 +1102,7 @@ fn test_overflow_does_not_cause_segfault() {
 
 #[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);
@@ -1268,6 +1278,7 @@ fn test_mut_chunks_rev() {
 
 #[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);
@@ -1300,6 +1311,7 @@ fn test_mut_chunks_exact_rev() {
 
 #[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);
@@ -1332,6 +1344,7 @@ fn test_mut_rchunks_rev() {
 
 #[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);
@@ -1364,6 +1377,7 @@ fn test_mut_rchunks_exact_rev() {
 
 #[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);
@@ -1397,6 +1411,7 @@ fn test_box_slice_clone() {
 #[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};
@@ -1461,6 +1476,7 @@ fn test_copy_from_slice() {
 
 #[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];
@@ -1469,6 +1485,7 @@ fn test_copy_from_slice_dst_longer() {
 
 #[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];
@@ -1588,6 +1605,7 @@ macro_rules! test {
 
 #[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| {
index a1dc763f6d8ffc2d928b9f8185e912a37fb4a512..b33a56421888831bf0607d4832f77f92f84d5891 100644 (file)
@@ -31,7 +31,6 @@ fn test_rfind() {
 }
 
 #[test]
-#[cfg(not(miri))]
 fn test_collect() {
     let empty = "";
     let s: String = empty.chars().collect();
@@ -119,7 +118,6 @@ fn test_concat_for_different_types() {
 #[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"]);
@@ -148,7 +146,6 @@ fn test_join_for_different_types() {
 #[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"], "-");
@@ -162,7 +159,6 @@ fn test_join_for_different_lengths_with_long_separator() {
     assert_eq!("~~~~~".len(), 15);
 
     let empty: &[&str] = &[];
-    #[cfg(not(miri))]
     test_join!("", empty, "~~~~~");
     test_join!("a", ["a"], "~~~~~");
     test_join!("a~~~~~b", ["a", "b"], "~~~~~");
@@ -170,7 +166,7 @@ fn test_join_for_different_lengths_with_long_separator() {
 }
 
 #[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)});
@@ -243,7 +239,6 @@ fn test_replacen() {
 #[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");
@@ -303,7 +298,6 @@ fn test_replace_pattern() {
 // 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.
@@ -357,6 +351,7 @@ macro_rules! assert_range_eq {
     //  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");
     }
@@ -366,6 +361,7 @@ fn assert_range_eq_can_fail_by_panic() {
     //  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");
     }
@@ -413,6 +409,7 @@ fn pass() {
 
                 #[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;
@@ -421,6 +418,7 @@ fn index_fail() {
 
                 #[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;
@@ -490,6 +488,7 @@ fn simple_unicode() {
 
     #[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;
@@ -515,6 +514,7 @@ fn half_a_million_letter_x() -> String {
 
     #[test]
     #[should_panic]
+    #[cfg(not(miri))] // Miri does not support panics
     fn test_slice_fail() {
         &"中华Việt Nam"[0..2];
     }
@@ -666,12 +666,14 @@ mod boundary {
     // 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];
     }
@@ -686,7 +688,7 @@ fn test_str_slice_rangetoinclusive_ok() {
 
 #[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];
@@ -702,7 +704,7 @@ fn test_str_slicemut_rangetoinclusive_ok() {
 
 #[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;
@@ -892,7 +894,7 @@ fn test_as_bytes() {
 
 #[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.)
@@ -982,7 +984,7 @@ fn test_split_at_mut() {
 
 #[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);
@@ -1078,7 +1080,7 @@ fn test_rev_iterator() {
 }
 
 #[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) {
@@ -1090,7 +1092,7 @@ fn test_chars_decoding() {
 }
 
 #[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) {
@@ -1320,7 +1322,6 @@ fn t(s: &str, sep: &str, u: &[&str]) {
 }
 
 #[test]
-#[cfg(not(miri))]
 fn test_str_default() {
     use std::default::Default;
 
@@ -1380,7 +1381,7 @@ fn test_bool_from_str() {
     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() {
@@ -1391,7 +1392,7 @@ fn check_contains_all_substrings(s: &str) {
 }
 
 #[test]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri is too slow
 fn strslice_issue_16589() {
     assert!("bananas".contains("nana"));
 
@@ -1401,7 +1402,6 @@ fn strslice_issue_16589() {
 }
 
 #[test]
-#[cfg(not(miri))]
 fn strslice_issue_16878() {
     assert!(!"1234567ah012345678901ah".contains("hah"));
     assert!(!"00abc01234567890123456789abc".contains("bcabc"));
@@ -1409,7 +1409,7 @@ fn strslice_issue_16878() {
 
 
 #[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);
@@ -1547,7 +1547,6 @@ fn trim_ws() {
 
 #[test]
 fn to_lowercase() {
-    #[cfg(not(miri))]
     assert_eq!("".to_lowercase(), "");
     assert_eq!("AÉDžaé ".to_lowercase(), "aédžaé ");
 
@@ -1581,7 +1580,6 @@ fn to_lowercase() {
 
 #[test]
 fn to_uppercase() {
-    #[cfg(not(miri))]
     assert_eq!("".to_uppercase(), "");
     assert_eq!("aéDžßfiᾀ".to_uppercase(), "AÉDŽSSFIἈΙ");
 }
@@ -1613,7 +1611,6 @@ fn test_cow_from() {
 }
 
 #[test]
-#[cfg(not(miri))]
 fn test_repeat() {
     assert_eq!("".repeat(3), "");
     assert_eq!("abc".repeat(0), "");
index e6ca54c4088653b9420fe7e055f2c0c05d4003b2..7e93d84fe3b97b1578dad9e6ebd9eb2324ab83c4 100644 (file)
@@ -1,5 +1,3 @@
-#![cfg(not(miri))]
-
 use std::borrow::Cow;
 use std::collections::CollectionAllocErr::*;
 use std::mem::size_of;
@@ -233,6 +231,7 @@ fn test_split_off_empty() {
 
 #[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);
@@ -241,6 +240,7 @@ fn test_split_off_past_end() {
 
 #[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);
@@ -289,6 +289,7 @@ fn test_str_truncate_invalid_len() {
 
 #[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);
@@ -323,6 +324,7 @@ fn remove() {
 
 #[test]
 #[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
 fn remove_bad() {
     "ศ".to_string().remove(1);
 }
@@ -358,11 +360,13 @@ fn insert() {
 
 #[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');
 }
@@ -443,6 +447,7 @@ fn test_replace_range() {
 
 #[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, "");
@@ -459,6 +464,7 @@ fn test_replace_range_inclusive_range() {
 
 #[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");
@@ -466,6 +472,7 @@ fn test_replace_range_out_of_bounds() {
 
 #[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");
@@ -525,6 +532,7 @@ fn test_reserve_exact() {
 }
 
 #[test]
+#[cfg(not(miri))] // Miri does not support signalling OOM
 fn test_try_reserve() {
 
     // These are the interesting cases:
@@ -602,6 +610,7 @@ fn test_try_reserve() {
 }
 
 #[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.
index 545332bcd6a2f3985c5243bcb08b7f3417e7ce7f..6e4ca1d90e642dd31bf20bfd5e3efc00c56e0256 100644 (file)
@@ -368,6 +368,7 @@ fn drop(&mut self) {
 
 #[test]
 #[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
 fn test_vec_truncate_fail() {
     struct BadElem(i32);
     impl Drop for BadElem {
@@ -391,6 +392,7 @@ fn test_index() {
 
 #[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];
@@ -398,6 +400,7 @@ fn test_index_out_of_bounds() {
 
 #[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..];
@@ -405,6 +408,7 @@ fn test_slice_out_of_bounds_1() {
 
 #[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];
@@ -412,6 +416,7 @@ fn test_slice_out_of_bounds_2() {
 
 #[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];
@@ -419,6 +424,7 @@ fn test_slice_out_of_bounds_3() {
 
 #[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];
@@ -426,6 +432,7 @@ fn test_slice_out_of_bounds_4() {
 
 #[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];
@@ -433,6 +440,7 @@ fn test_slice_out_of_bounds_5() {
 
 #[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);
@@ -503,6 +511,7 @@ fn test_drain_items_zero_sized() {
 
 #[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);
@@ -576,6 +585,7 @@ fn test_drain_max_vec_size() {
 
 #[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);
@@ -605,6 +615,7 @@ fn test_splice_inclusive_range() {
 
 #[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];
@@ -613,6 +624,7 @@ fn test_splice_out_of_bounds() {
 
 #[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];
index b47e7c867e675441de41e2bccb9a567e8be8b149..e0cb0e7a9e70c532ccd3f915b5afffa2d1d45514 100644 (file)
@@ -108,7 +108,7 @@ fn test_index() {
 
 #[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 {
@@ -907,24 +907,20 @@ fn test_append() {
     // 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,
@@ -948,7 +944,10 @@ fn construct_vec_deque(
         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`.
@@ -1125,7 +1124,7 @@ fn test_reserve_exact_2() {
 }
 
 #[test]
-#[cfg(not(miri))]
+#[cfg(not(miri))] // Miri does not support signalling OOM
 fn test_try_reserve() {
 
     // These are the interesting cases:
@@ -1227,7 +1226,7 @@ fn test_try_reserve() {
 }
 
 #[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.
index 227fb22bc7d93bac88546244fc4be9c2b94e07d3..f2165c676fd44091cd8b6aae99d3f220f9198de8 100644 (file)
 #![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)]
index b9b235969dad8d980d85e31b342f9b90a70d3dea..fdbfa56000b8ebbc32c5fafea80c1e78cee8f152 100644 (file)
@@ -563,11 +563,11 @@ macro_rules! unimplemented {
 
 /// 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.
index 3f7455aeb59b9bcfef22fabdb5f9b4c7cb0c2351..43afc9a522a303da2bc16941fcf1a57e9c328b1a 100644 (file)
@@ -1045,17 +1045,34 @@ fn deref_mut(&mut self) -> &mut T {
 /// 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*
@@ -1065,7 +1082,8 @@ fn deref_mut(&mut self) -> &mut T {
 /// #![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);
@@ -1075,6 +1093,7 @@ fn deref_mut(&mut self) -> &mut T {
 /// ```
 ///
 /// 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}`
@@ -1134,6 +1153,22 @@ pub fn set(&mut self, val: T) -> &mut T {
         }
     }
 
+    /// 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.
@@ -1141,7 +1176,8 @@ pub fn set(&mut self, val: T) -> &mut T {
     /// # 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 {
@@ -1149,21 +1185,14 @@ 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
@@ -1174,41 +1203,26 @@ pub unsafe fn get_ref(&self) -> &T {
     /// # 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
index acca9748372ca15b521a7e4c82a37aa481f1092b..a628fd0cfa4b2a1831e261776cc073b36a8692c5 100644 (file)
@@ -1563,6 +1563,10 @@ pub fn sort_unstable_by<F>(&mut self, mut compare: F)
     /// 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
     ///
     /// ```
index 73bdaab5861e6bb3f62a7309f0f9360c0bf696b8..b16416022c04e700197081fcdaa016d4fb565655 100644 (file)
@@ -1,5 +1,3 @@
-#![cfg(not(miri))]
-
 use core::cell::*;
 use core::default::Default;
 use std::mem::drop;
@@ -111,6 +109,7 @@ fn double_borrow_single_release_no_borrow_mut() {
 
 #[test]
 #[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
 fn discard_doesnt_unborrow() {
     let x = RefCell::new(0);
     let _b = x.borrow();
@@ -351,6 +350,7 @@ fn refcell_ref_coercion() {
 
 #[test]
 #[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
 fn refcell_swap_borrows() {
     let x = RefCell::new(0);
     let _b = x.borrow();
@@ -360,6 +360,7 @@ fn refcell_swap_borrows() {
 
 #[test]
 #[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
 fn refcell_replace_borrows() {
     let x = RefCell::new(0);
     let _b = x.borrow();
index b10b63fc484cb820985485f35cb9201c64503d0b..df1deeaeb97b789c84387f2f69a9d26e06183d31 100644 (file)
@@ -1,10 +1,9 @@
-#![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();
@@ -14,6 +13,7 @@ fn test_format_flags() {
 }
 
 #[test]
+#[cfg(not(miri))] // Miri cannot print pointers
 fn test_pointer_formats_data_pointer() {
     let b: &[u8] = b"";
     let s: &str = "";
index bf3039a7e51e8c33c9c503ae48ebfc495fd3d2a0..1000088e6b0633c5489e9eeee91c4e2af1c1a289 100644 (file)
@@ -1,5 +1,3 @@
-#![cfg(not(miri))]
-
 mod sip;
 
 use std::hash::{Hash, Hasher};
@@ -75,9 +73,11 @@ fn hash<T: Hash>(t: &T) -> u64 {
     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);
 }
 
index 51a6017de1b5fead95d446117fa7f452118da28f..9b76a4af98824a46052bd62c1cf9f552b4e98b90 100644 (file)
@@ -190,7 +190,6 @@ fn test_iterator_step_by() {
 }
 
 #[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));
@@ -209,7 +208,6 @@ fn test_iterator_step_by_nth() {
 }
 
 #[test]
-#[cfg(not(miri))]
 fn test_iterator_step_by_nth_overflow() {
     #[cfg(target_pointer_width = "8")]
     type Bigger = u16;
@@ -255,14 +253,13 @@ fn nth(&mut self, n: usize) -> Option<Self::Item> {
 
 #[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 {
@@ -1417,7 +1414,7 @@ fn test_rposition() {
 
 #[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),
@@ -1657,7 +1654,6 @@ fn test_range_inclusive_nth() {
 }
 
 #[test]
-#[cfg(not(miri))]
 fn test_range_step() {
     #![allow(deprecated)]
 
@@ -1681,7 +1677,6 @@ fn test_range_step() {
 }
 
 #[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));
@@ -1689,7 +1684,6 @@ fn test_step_by_skip() {
 }
 
 #[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]);
index b873f1dd0652f82855570caaf898692f2bac3354..956c22c998219ead7c9b65b0eb793c6f2d1b5137 100644 (file)
@@ -3,6 +3,7 @@
 
 #[test]
 #[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
 fn test_from_u64_overflow() {
     Big::from_u64(0x1000000);
 }
@@ -19,12 +20,14 @@ fn test_add() {
 
 #[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));
 }
@@ -42,6 +45,7 @@ fn test_add_small() {
 
 #[test]
 #[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
 fn test_add_small_overflow() {
     Big::from_u64(0xffffff).add_small(1);
 }
@@ -57,12 +61,14 @@ fn test_sub() {
 
 #[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));
 }
@@ -76,6 +82,7 @@ fn test_mul_small() {
 
 #[test]
 #[should_panic]
+#[cfg(not(miri))] // Miri does not support panics
 fn test_mul_small_overflow() {
     Big::from_u64(0x800000).mul_small(2);
 }
@@ -94,12 +101,14 @@ fn test_mul_pow2() {
 
 #[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);
 }
@@ -118,12 +127,14 @@ fn test_mul_pow5() {
 
 #[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);
 }
@@ -141,12 +152,14 @@ fn test_mul_digits() {
 
 #[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]);
 }
@@ -206,6 +219,7 @@ fn test_get_bit() {
 
 #[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);
 }
index 8f1cd32c3563c3d80df2c61fc609fdbbd0909f08..faeaabbf95adacb75d7edd518f11ffdba021a087 100644 (file)
@@ -52,6 +52,7 @@ fn large() {
 }
 
 #[test]
+#[cfg(not(miri))] // Miri is too slow
 fn subnormals() {
     test_literal!(5e-324);
     test_literal!(91e-324);
@@ -63,6 +64,7 @@ fn subnormals() {
 }
 
 #[test]
+#[cfg(not(miri))] // Miri is too slow
 fn infinity() {
     test_literal!(1e400);
     test_literal!(1e309);
index fed9ce73b2a8e1ce1a9f5f71a4f43391d9917aa3..d362c7994d8066e0dd707a027c866ac1bed1f9ee 100644 (file)
@@ -1,3 +1,5 @@
+#![cfg(not(miri))] // Miri does not implement ldexp, which most tests here need
+
 use std::prelude::v1::*;
 use std::{str, i16, f32, f64, fmt};
 
index ab638e06cc10dbcfc31d65d5c3ed9b4426234763..a17c094679ea854623356691df94479bdb17670e 100644 (file)
@@ -1,5 +1,3 @@
-#![cfg(not(miri))]
-
 use core::convert::{TryFrom, TryInto};
 use core::cmp::PartialEq;
 use core::fmt::Debug;
index 1ba886ce037ee0eaf426c42e6b2b2241abade460..87ce2720c5918209a4a6f85b375f63d9fc6e5967 100644 (file)
@@ -69,7 +69,7 @@ fn test_option_dance() {
 }
 
 #[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);
@@ -130,7 +130,7 @@ fn test_unwrap() {
 
 #[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();
@@ -138,7 +138,7 @@ fn test_unwrap_panic1() {
 
 #[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();
index 5784559082266336e030a0050ac452cd0881ffe0..2c53e4832a8cc20086f33b023f3264e40d99c172 100644 (file)
@@ -1,5 +1,3 @@
-#![cfg(not(miri))]
-
 use core::ptr::*;
 use core::cell::RefCell;
 
@@ -42,6 +40,7 @@ struct Pair {
 }
 
 #[test]
+#[cfg(not(miri))] // This test performs invalid OOB pointer arithmetic
 fn test_is_null() {
     let p: *const isize = null();
     assert!(p.is_null());
@@ -147,6 +146,7 @@ fn test_as_ref() {
 }
 
 #[test]
+#[cfg(not(miri))] // This test is UB according to Stacked Borrows
 fn test_as_mut() {
     unsafe {
         let p: *mut isize = null_mut();
@@ -208,6 +208,7 @@ fn test_ptr_addition() {
 }
 
 #[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];
@@ -251,6 +252,7 @@ fn test_unsized_nonnull() {
 
 #[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]
@@ -290,6 +292,7 @@ fn drop(&mut self) {
 }
 
 #[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.
@@ -304,6 +307,7 @@ fn align_offset_zst() {
 }
 
 #[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.
@@ -320,6 +324,7 @@ fn align_offset_stride1() {
 }
 
 #[test]
+#[cfg(not(miri))] // Miri is too slow
 fn align_offset_weird_strides() {
     #[repr(packed)]
     struct A3(u16, u8);
index 7bfd396f68d1700212979c8f6d2c9a217527d99b..bbc85685176671ad20051ddc28fa2a50014b4718 100644 (file)
@@ -117,7 +117,7 @@ fn handler(msg: &'static str) -> isize {
 
 #[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." {
@@ -139,7 +139,7 @@ pub fn test_expect_ok() {
 }
 #[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");
@@ -153,7 +153,7 @@ pub fn test_expect_err_err() {
 }
 #[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");
index 04d646ea01d038842c2709ce328d633a17fd1f9f..31d16e0e320571c28897f4b30feb266e3bc86ba0 100644 (file)
@@ -782,7 +782,7 @@ macro_rules! assert_range_eq {
     //  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]);
     }
@@ -792,7 +792,7 @@ fn assert_range_eq_can_fail_by_panic() {
     //  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]);
     }
@@ -842,7 +842,7 @@ fn pass() {
 
                 #[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;
@@ -851,7 +851,7 @@ fn index_fail() {
 
                 #[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;
@@ -1015,7 +1015,7 @@ fn test_rotate_right() {
 
 #[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;
@@ -1171,7 +1171,7 @@ fn each_alignment_reversed() {
 }
 
 #[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>() };
@@ -1187,7 +1187,6 @@ fn test_align_to_simple() {
 }
 
 #[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::<()>() };
@@ -1196,7 +1195,7 @@ fn test_align_to_zst() {
 }
 
 #[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);
@@ -1208,7 +1207,6 @@ fn test_align_to_non_trivial() {
 }
 
 #[test]
-#[cfg(not(miri))]
 fn test_align_to_empty_mid() {
     use core::mem;
 
@@ -1306,7 +1304,7 @@ fn test_copy_within() {
 
 #[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.
@@ -1315,7 +1313,7 @@ fn test_copy_within_panics_src_too_long() {
 
 #[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.
@@ -1323,7 +1321,7 @@ fn test_copy_within_panics_dest_too_long() {
 }
 #[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.
index d39bd06930a36a83eb715a47733384ee5a993d82..09aae4583482f83e41bd6574e453fedaf0500c60 100644 (file)
@@ -1,5 +1,3 @@
-#![cfg(not(miri))]
-
 use core::time::Duration;
 
 #[test]
@@ -109,12 +107,14 @@ fn checked_sub() {
 
 #[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);
 }
index f46ff6f6062c2648037fbc0ecfe2ac3a665c6ea8..00f9fa3a938d6b7c9bb148152a99f2b96cac1201 100644 (file)
@@ -408,11 +408,7 @@ fn bar(x: &str, y: &str) -> &str { }
 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##"
index b15bea017762ea277a443d94a2e1160cbf7d03c0..f6d864f5b404dc82a0cc1023f96557b64290efdf 100644 (file)
@@ -52,13 +52,13 @@ pub enum Def {
     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
index 9436c600c9fd3a06c20f269d3a93a02ce6f8163d..4a2bc213fea80d0c0c86809ad71322e63ef8d3ef 100644 (file)
@@ -334,6 +334,7 @@ fn visit_generic_arg(&mut self, generic_arg: &'v GenericArg) {
         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) {
@@ -752,6 +753,7 @@ pub fn walk_generic_param<'v, V: Visitor<'v>>(visitor: &mut V, param: &'v Generi
     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, &param.bounds);
 }
@@ -951,7 +953,7 @@ pub fn walk_stmt<'v, V: Visitor<'v>>(visitor: &mut V, statement: &'v Stmt) {
     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)
index 84487c40f874508f4d6ad469d941139d1109266f..9f48a628274db4721a482e6fe8f70bcddee6d295 100644 (file)
@@ -36,7 +36,7 @@
 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;
@@ -1172,13 +1172,10 @@ fn lower_generic_arg(&mut self,
             ast::GenericArg::Lifetime(lt) => GenericArg::Lifetime(self.lower_lifetime(&lt)),
             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,
+                })
             }
         }
     }
@@ -2520,14 +2517,10 @@ fn lower_generic_param(&mut self,
 
                 (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()),
+                })
             }
         };
 
@@ -4663,7 +4656,7 @@ fn lower_expr(&mut self, e: &Expr) -> hir::Expr {
                         hir::Stmt {
                             id: node_id,
                             hir_id,
-                            node: hir::StmtKind::Item(P(item_id)),
+                            node: hir::StmtKind::Item(item_id),
                             span: s.span,
                         }
                     })
@@ -4693,7 +4686,7 @@ fn lower_expr(&mut self, e: &Expr) -> hir::Expr {
                         hir::Stmt {
                             id: node_id,
                             hir_id,
-                            node: hir::StmtKind::Item(P(item_id)),
+                            node: hir::StmtKind::Item(item_id),
                             span: s.span,
                         }
                     })
index b6cf4c1b84d0c6454b91bfb8374518c31eef8756..e933e4b7180c49c525460f394a28a4f6c206e17b 100644 (file)
@@ -398,6 +398,7 @@ pub fn describe_def(&self, node_id: NodeId) -> Option<Def> {
                 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)),
                 })
             }
         }
index d774359fa79ec2fb8f9b242cab2416ddd6d79943..deb2eb33b0f0b34a85c5ab7d3f990f5c10275127 100644 (file)
@@ -389,10 +389,17 @@ pub fn with_generic_args<F, R>(&self, f: F) -> R
     }
 }
 
+#[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 {
@@ -400,6 +407,7 @@ pub fn span(&self) -> Span {
         match self {
             GenericArg::Lifetime(l) => l.span,
             GenericArg::Type(t) => t.span,
+            GenericArg::Const(c) => c.span,
         }
     }
 
@@ -407,6 +415,7 @@ pub fn id(&self) -> NodeId {
         match self {
             GenericArg::Lifetime(l) => l.id,
             GenericArg::Type(t) => t.id,
+            GenericArg::Const(c) => c.value.id,
         }
     }
 }
@@ -448,6 +457,7 @@ pub fn inputs(&self) -> &[Ty] {
                         }
                         break;
                     }
+                    GenericArg::Const(_) => {}
                 }
             }
         }
@@ -464,6 +474,7 @@ pub fn own_counts(&self) -> GenericParamCount {
             match arg {
                 GenericArg::Lifetime(_) => own_counts.lifetimes += 1,
                 GenericArg::Type(_) => own_counts.types += 1,
+                GenericArg::Const(_) => own_counts.consts += 1,
             };
         }
 
@@ -528,6 +539,9 @@ pub enum GenericParamKind {
     Type {
         default: Option<P<Ty>>,
         synthetic: Option<SyntheticTyParamKind>,
+    },
+    Const {
+        ty: P<Ty>,
     }
 }
 
@@ -548,6 +562,7 @@ pub struct GenericParam {
 pub struct GenericParamCount {
     pub lifetimes: usize,
     pub types: usize,
+    pub consts: usize,
 }
 
 /// Represents lifetimes and type parameters attached to a declaration
@@ -582,6 +597,7 @@ pub fn own_counts(&self) -> GenericParamCount {
             match param.kind {
                 GenericParamKind::Lifetime { .. } => own_counts.lifetimes += 1,
                 GenericParamKind::Type { .. } => own_counts.types += 1,
+                GenericParamKind::Const { .. } => own_counts.consts += 1,
             };
         }
 
@@ -1159,8 +1175,9 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 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>),
@@ -1302,7 +1319,7 @@ pub fn is_fn_or_closure(self) -> bool {
 /// 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,
index e2df290a455c4afb6f0118072d003f8b87e4f451..312351ab850c2ee1a5ac76c07b4699b153e688b5 100644 (file)
@@ -64,19 +64,6 @@ pub fn is_refutable(&self) -> bool {
         }
     }
 
-    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)
index 9b6fcf259be14ba49f0373fbc0a5be44db5c6216..ece649cf1b882f86839dc5eb50a5e77f16a1fba2 100644 (file)
@@ -1007,8 +1007,8 @@ pub fn print_stmt(&mut self, st: &hir::Stmt) -> io::Result<()> {
                 }
                 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()?;
@@ -1711,31 +1711,25 @@ fn print_generic_args(&mut self,
                 }
             };
 
-            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.:
@@ -2106,7 +2100,12 @@ pub fn print_generic_params(&mut self, generic_params: &[GenericParam]) -> io::R
     }
 
     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 = ":";
@@ -2133,6 +2132,10 @@ pub fn print_generic_param(&mut self, param: &GenericParam) -> io::Result<()> {
                     _ => Ok(()),
                 }
             }
+            GenericParamKind::Const { ref ty } => {
+                self.word_space(":")?;
+                self.print_type(ty)
+            }
         }
     }
 
index b10e89373259798624d97801c4f5939b5967094b..727c441b0e8dba59e462567d577b13bcc00dc993 100644 (file)
@@ -179,9 +179,15 @@ fn hash_stable<W: StableHasherResult>(&self,
     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 {
@@ -231,6 +237,9 @@ fn hash_stable<W: StableHasherResult>(&self,
                 default.hash_stable(hcx, hasher);
                 synthetic.hash_stable(hcx, hasher);
             }
+            hir::GenericParamKind::Const { ref ty } => {
+                ty.hash_stable(hcx, hasher);
+            }
         }
     }
 }
index bfe59eda06e6fc44a3d519fc8da4ecd88dfede4c..3d79b6777fa8b3c0bdd70cfe427419992e5070b0 100644 (file)
@@ -47,7 +47,6 @@
 #![feature(rustc_diagnostic_macros)]
 #![feature(rustc_attrs)]
 #![feature(slice_patterns)]
-#![feature(slice_sort_by_cached_key)]
 #![feature(specialization)]
 #![feature(unboxed_closures)]
 #![feature(thread_local)]
index 231dcc9bfd272af8d1db2709639b5ceb4e89529a..56e7d789356989f7ab1027209686df687657b329 100644 (file)
@@ -704,7 +704,7 @@ pub fn cat_def(&self,
                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))
             }
index 99d0c5e88d6385aeecc58226ad4e99d0ee0de229..0562fddb2b5233926bed78a1950cc5d766bcdf5a 100644 (file)
@@ -315,8 +315,11 @@ fn propagate_node(&mut self, node: &Node<'tcx>,
             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,
+                );
             }
         }
     }
index 5f7b9cc33660f95191937e15d15573612d058579..08da74f47d450eed321978173dc969e7c38e5659 100644 (file)
@@ -527,23 +527,20 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
                 } 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,
@@ -708,7 +705,7 @@ fn visit_ty(&mut self, ty: &'tcx hir::Ty) {
 
                 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 { .. } => {
@@ -725,12 +722,13 @@ fn visit_ty(&mut self, ty: &'tcx hir::Ty) {
                                 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 {
@@ -788,23 +786,20 @@ fn visit_trait_item(&mut self, trait_item: &'tcx hir::TraitItem) {
                 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,
@@ -842,24 +837,21 @@ fn visit_impl_item(&mut self, impl_item: &'tcx hir::ImplItem) {
             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,
@@ -874,19 +866,19 @@ fn visit_impl_item(&mut self, impl_item: &'tcx hir::ImplItem) {
                 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,
@@ -950,6 +942,10 @@ fn visit_generics(&mut self, generics: &'tcx hir::Generics) {
                         self.visit_ty(&ty);
                     }
                 }
+                GenericParamKind::Const { ref ty, .. } => {
+                    walk_list!(self, visit_param_bound, &param.bounds);
+                    self.visit_ty(&ty);
+                }
             }
         }
         for predicate in &generics.where_clause.predicates {
@@ -1395,6 +1391,10 @@ fn add_bounds(set: &mut Set1<hir::LifetimeName>, bounds: &[hir::GenericBound]) {
                     Set1::Many => Set1::Many,
                 })
             }
+            GenericParamKind::Const { .. } => {
+                // Generic consts don't impose any constraints.
+                None
+            }
         })
         .collect()
 }
@@ -1703,25 +1703,22 @@ fn visit_early_late<F>(
             }
         }
 
-        let mut type_count = 0;
-        let lifetimes = generics
-            .params
-            .iter()
-            .filter_map(|param| match param.kind {
-                GenericParamKind::Lifetime { .. } => {
-                    if self.map.late_bound.contains(&param.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(&param.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,
@@ -2011,6 +2008,9 @@ fn visit_segment_args(&mut self, def: Def, depth: usize, generic_args: &'tcx hir
                     }
                     i += 1;
                 }
+                GenericArg::Const(ct) => {
+                    self.visit_anon_const(&ct.value);
+                }
             }
         }
 
@@ -2768,8 +2768,9 @@ fn insert_late_bound_lifetimes(
         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());
index b605badc153f0e27acb016aee6ac0b72f88e678b..e344f8732f820b2c1beb6c7fdce1efd2542b99da 100644 (file)
@@ -17,7 +17,6 @@
 #![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)]
index b46e6ef84b98b4740eec5d7f706a221c7388a8c5..ecca45a4d4281889d3f75d78351de265f49eda73 100644 (file)
@@ -100,9 +100,11 @@ unsafe fn configure_llvm(sess: &Session) {
     ("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")),
index a083bd5d8d18aa1e1e7da7f626b25d8c04906449..9e1744451465d310872a4b50030e31c6b3063c71 100644 (file)
@@ -6,7 +6,6 @@
 #![feature(libc)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(in_band_lifetimes)]
-#![feature(slice_sort_by_cached_key)]
 #![feature(nll)]
 #![allow(unused_attributes)]
 #![allow(dead_code)]
index 990ad4ada01a2dcd22c629ebe9fa12eb33eb25dd..e022d3a3818a5caae987c3a606bc20c672cfd349 100644 (file)
@@ -10,7 +10,6 @@
 #![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)]
index 28e01bd9793fd9813201801c2bf5b2714326d7f9..925cde5b5cc8b3d48057b3399ca707bacda789fe 100644 (file)
@@ -907,11 +907,13 @@ fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
                     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",
@@ -1791,14 +1793,15 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx hir::Item) {
 
             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, &param_name, &param.bounds, infer_static
index c2dd9a3d1b84f0aa2d7bdb1b543c124c9a9bfef4..7c66289703ac8f88eb6c0a5589d329a52fbf0da5 100644 (file)
@@ -455,6 +455,16 @@ fn check_pat(&mut self, cx: &LateContext<'_, '_>, p: &hir::Pat) {
             }
         }
     }
+
+    fn check_generic_param(&mut self, cx: &LateContext<'_, '_>, param: &hir::GenericParam) {
+        if let GenericParamKind::Const { .. } = param.kind {
+            NonUpperCaseGlobals::check_upper_case(
+                cx,
+                "const parameter",
+                &param.name.ident(),
+            );
+        }
+    }
 }
 
 #[cfg(test)]
index 40d3ee9cc0b11266db0d27565fa03a6e288d5771..776adc077fc085a934c654edf6a4f4ed4b540c54 100644 (file)
@@ -1331,6 +1331,29 @@ fn encode_info_for_ty_param(&mut self,
         }
     }
 
+    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;
@@ -1684,6 +1707,11 @@ fn encode_info_for_generics(&mut self, generics: &hir::Generics) {
                     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);
+                }
             }
         }
     }
index a3490b7fea5b592b84219065158aac07c86959eb..b4f68399d9febc59aaca4163b6dd1b186e515234 100644 (file)
@@ -6,7 +6,6 @@
 #![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)]
index 31aa3c2782697184f614251c22b43003ecb54b33..4df3004a9ada6296f79aadb40c3c5f53cd5ade55 100644 (file)
@@ -2370,6 +2370,37 @@ fn foo() -> i32 { 22 }
 ```
 "##,
 
+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! {
index ee295116ba9625f3169e92b9cca8c2d7e8953029..0168e1301fa7af6db7fadec8de40621db0a7eb2c 100644 (file)
@@ -101,9 +101,8 @@ macro_rules! __impl_snapshot_field {
 // 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
@@ -115,18 +114,17 @@ 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>,
         {
@@ -139,7 +137,7 @@ fn snapshot(&self, __ctx: &'a Ctx) -> Self::Item {
                 } = *self;
 
                 $struct_name {
-                    $( $field: __impl_snapshot_field!($field, __ctx $(, $delegate)*) ),*
+                    $( $field: __impl_snapshot_field!($field, __ctx $(, $delegate)?) ),*
                 }
             }
         }
index 909f96956695dabd9c73d22cd09115d203c64b2d..e0fee10cd008c90be3828ef42baa4c783984a9cb 100644 (file)
@@ -7,7 +7,6 @@
 #![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)]
index a76aa7454cbe4c6e72eeb510415b842f51db5b29..e68702bfe3ae028ba0cec8ca948dd173c8741487 100644 (file)
@@ -1090,7 +1090,10 @@ fn create_mono_items_for_default_impls<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
             for param in &generics.params {
                 match param.kind {
                     hir::GenericParamKind::Lifetime { .. } => {}
-                    hir::GenericParamKind::Type { .. } => return,
+                    hir::GenericParamKind::Type { .. } |
+                    hir::GenericParamKind::Const { .. } => {
+                        return
+                    }
                 }
             }
 
index 51168f650aeb774d9afea7bf15c6287654c70537..285c674643f2e58cdcd2be4b45b1454a7b77f5bb 100644 (file)
@@ -1480,7 +1480,17 @@ fn run_pass<'a, 'tcx>(&self,
                         // 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)
index bf5514c5335f0dbfe4768ec63464f208bac84dca..606ae2741283240a973bfb136ac36fc36b8a3114 100644 (file)
@@ -616,7 +616,7 @@ fn visit_generic_args(&mut self, _: Span, generic_args: &'a GenericArgs) {
                 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_));
                 }
             }
         }
index fbed1145cd156089da8e95330e8a3023297cb9cc..1a7744786d80eefcd6cccc9462200d2b500ed9b3 100644 (file)
@@ -4,7 +4,6 @@
 #![feature(label_break_value)]
 #![feature(nll)]
 #![feature(rustc_diagnostic_macros)]
-#![feature(slice_sort_by_cached_key)]
 
 #![recursion_limit="256"]
 
index 23e9cd55cdce7f552fff4cfbb1cb05c07c18e61e..cde6eb22bb8aed7cd1e28555b9c9cae1b52230cb 100644 (file)
@@ -500,19 +500,20 @@ pub fn create_substs_for_generic_args<'a, 'b>(
                                 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) => {
@@ -524,12 +525,7 @@ pub fn create_substs_for_generic_args<'a, 'b>(
                     (None, Some(&param)) => {
                         // 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();
                     }
@@ -1459,9 +1455,10 @@ pub fn prohibit_generics<'a, T: IntoIterator<Item = &'a hir::PathSegment>>(
         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;
@@ -1480,10 +1477,18 @@ pub fn prohibit_generics<'a, T: IntoIterator<Item = &'a hir::PathSegment>>(
                              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;
                     }
                 }
index 05ca54df2984b8eab95210201ecceb274fa33d59..5f1c2efb6a457cec6510611b842c60a0cdbe4547 100644 (file)
@@ -840,7 +840,8 @@ fn nested_visit_map<'this>(
                         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(&param.bounds)
                                     } else {
index 4a2d526263c03cb5ae82952e588ca75e7cba2891..84de38beafad9dde00490d6eb1d0b20c87a8c8b4 100644 (file)
@@ -132,6 +132,10 @@ fn visit_generics(&mut self, generics: &'tcx hir::Generics) {
                     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);
@@ -1041,6 +1045,22 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx ty
                     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,
             }),
     );
@@ -1301,10 +1321,10 @@ fn type_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Ty<'tcx> {
         },
 
         Node::GenericParam(param) => match &param.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),
         },
 
index 71767fcfd49339ad5256d7c9b8a0e45209fe21d7..3c4a0760f3ee2ca4ef1f434bfa70aa4dc068156f 100644 (file)
@@ -1326,6 +1326,10 @@ fn main() {
 ```
 "##,
 
+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
index 7055218577c5c8accb30895dbbff87adb7d455c0..2dcb48692f6bdb5060f8512184d0f38b26af6aab 100644 (file)
@@ -67,7 +67,6 @@
 #![feature(refcell_replace_swap)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(slice_patterns)]
-#![feature(slice_sort_by_cached_key)]
 #![feature(never_type)]
 
 #![recursion_limit="256"]
index b99181c0d4f9e0fafa5ec4dd5e8778c373ec141d..8796cfa01e0ea282a5c39b113c3f7e7ef1ff9091 100644 (file)
@@ -773,6 +773,7 @@ fn param_env_to_generics<'b, 'c, 'cx>(
                     }
                 }
                 GenericParamDefKind::Lifetime => {}
+                GenericParamDefKind::Const { .. } => {}
             }
         }
 
index d12b5021ca9fae5902c5fe3fbdfd0d7bc8939c6e..ea9034ae3a1e02718949aad9576bcef90c42f3a9 100644 (file)
@@ -165,7 +165,12 @@ fn clean(&self, cx: &DocContext) -> Crate {
         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);
                     }
                 }
@@ -1253,6 +1258,15 @@ fn clean(&self, _: &DocContext) -> Lifetime {
     }
 }
 
+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())
@@ -1418,6 +1432,10 @@ pub enum GenericParamDefKind {
         default: Option<Type>,
         synthetic: Option<hir::SyntheticTyParamKind>,
     },
+    Const {
+        did: DefId,
+        ty: Type,
+    },
 }
 
 #[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Eq, Debug, Hash)]
@@ -1430,7 +1448,10 @@ pub struct GenericParamDef {
 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(),
         }
     }
@@ -1486,7 +1507,7 @@ fn clean(&self, cx: &DocContext) -> GenericParamDef {
                 };
                 (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),
@@ -1494,6 +1515,12 @@ fn clean(&self, cx: &DocContext) -> GenericParamDef {
                     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 {
@@ -1533,6 +1560,7 @@ fn is_impl_trait(param: &hir::GenericParam) -> bool {
                     GenericParamDefKind::Type { did, ref bounds, .. } => {
                         cx.impl_trait_bounds.borrow_mut().insert(did, bounds.clone());
                     }
+                    GenericParamDefKind::Const { .. } => unreachable!(),
                 }
                 param
             })
@@ -1566,6 +1594,7 @@ fn is_impl_trait(param: &hir::GenericParam) -> bool {
                                         break
                                     }
                                 }
+                                GenericParamDefKind::Const { .. } => {}
                             }
                         }
                     }
@@ -2544,6 +2573,7 @@ fn clean(&self, cx: &DocContext) -> Type {
                     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() {
@@ -2552,7 +2582,7 @@ fn clean(&self, cx: &DocContext) -> Type {
                                     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);
                                                 }
@@ -2577,7 +2607,7 @@ fn clean(&self, cx: &DocContext) -> Type {
                                     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);
                                                 }
@@ -2595,10 +2625,32 @@ fn clean(&self, cx: &DocContext) -> Type {
                                     }
                                     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)
             }
@@ -3190,6 +3242,9 @@ fn clean(&self, cx: &DocContext) -> GenericArgs {
                     GenericArg::Type(ty) => {
                         types.push(ty.clean(cx));
                     }
+                    GenericArg::Const(..) => {
+                        unimplemented!() // FIXME(const_generics)
+                    }
                 }
             }
             GenericArgs::AngleBracketed {
index ec4ee2d66a59928e5af12bb0cc780a1fb891fcd4..91fbe877cb7d9f7fa661e60c0fa4b29d9e65646e 100644 (file)
@@ -192,6 +192,8 @@ pub struct RenderOptions {
     /// 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 {
@@ -436,6 +438,7 @@ pub fn from_matches(matches: &getopts::Matches) -> Result<Options, isize> {
         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);
 
@@ -480,6 +483,7 @@ pub fn from_matches(matches: &getopts::Matches) -> Result<Options, isize> {
                 markdown_css,
                 markdown_playground_url,
                 generate_search_filter,
+                generate_redirect_pages,
             }
         })
     }
index e90127ca162d2c22dd95b5819cf43ee9a4d292d6..59820e4e5d1aeebe33358731a1a0c13975b915b8 100644 (file)
@@ -65,6 +65,8 @@ pub struct DocContext<'a, 'tcx: 'a, 'rcx: 'a> {
     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>,
@@ -85,14 +87,18 @@ pub fn sess(&self) -> &session::Session {
     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
     }
 
@@ -212,7 +218,7 @@ pub fn generics_to_path_params(&self, generics: ty::Generics) -> hir::GenericArg
                         name: hir::LifetimeName::Param(name),
                     }));
                 }
-                ty::GenericParamDefKind::Type {..} => {
+                ty::GenericParamDefKind::Type { .. } => {
                     args.push(hir::GenericArg::Type(self.ty_param_to_ty(param.clone())));
                 }
             }
@@ -527,6 +533,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
                 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(),
index 35555f61bd150980491510c37aa8f8820aaa2a40..df7835214ebb6d3183a90ab3cbd43ae29b10dd88 100644 (file)
 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.
@@ -138,6 +141,16 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 
                 Ok(())
             }
+            clean::GenericParamDefKind::Const { ref ty, .. } => {
+                f.write_str("const ")?;
+                f.write_str(&self.name)?;
+
+                if f.alternate() {
+                    write!(f, ": {:#}", ty)
+                } else {
+                    write!(f, ":&nbsp;{}", ty)
+                }
+            }
         }
     }
 }
@@ -665,7 +678,11 @@ fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter, use_absolute: bool) -> fmt:
             }
         }
         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_ {
@@ -834,7 +851,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 
 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 { "&amp;" };
         let mut args = String::new();
         let mut args_plain = String::new();
@@ -889,6 +906,8 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
             }
         }
 
+        let mut args_plain = format!("({})", args_plain);
+
         if decl.variadic {
             args.push_str(",<br> ...");
             args_plain.push_str(", ...");
@@ -907,13 +926,8 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
             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>{}", "&nbsp;".repeat(indent + 4));
             let close_pad = format!("<br>{}", "&nbsp;".repeat(indent));
             format!("({args}{close}){arrow}",
index e660d27d74b4cf416cb7ababd012da123d5fa8c8..d037154272db6cdfbb384ffb08e2f841cd8c28c9 100644 (file)
@@ -148,6 +148,8 @@ struct SharedContext {
     /// 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 {
@@ -516,6 +518,7 @@ pub fn run(mut krate: clean::Crate,
         resource_suffix,
         static_root_path,
         generate_search_filter,
+        generate_redirect_pages,
         ..
     } = options;
 
@@ -545,6 +548,7 @@ pub fn run(mut krate: clean::Crate,
         resource_suffix,
         static_root_path,
         generate_search_filter,
+        generate_redirect_pages,
     };
 
     // If user passed in `--playground-url` arg, we fill in crate name here
@@ -1746,7 +1750,8 @@ fn generics(&mut self, generics: &clean::Generics) {
         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());
                 }
             }
@@ -2246,17 +2251,18 @@ fn item<F>(&mut self, item: clean::Item, all: &mut AllTypes, mut f: F) -> Result
                 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 {
@@ -2781,8 +2787,7 @@ fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: usize, idx2: usize) -> Ordering
                        <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),
@@ -2979,14 +2984,16 @@ fn item_static(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
 
 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,
@@ -3002,7 +3009,7 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
            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,
            })?;
@@ -3417,16 +3424,18 @@ fn method(w: &mut fmt::Formatter,
                 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)
@@ -3444,7 +3453,7 @@ fn method(w: &mut fmt::Formatter,
                generics = *g,
                decl = Function {
                    decl: d,
-                   name_len: head_len,
+                   header_len,
                    indent,
                    asyncness: header.asyncness,
                },
index 840f943a5972df50aecf8febffb4aaaa7f9e8d2c..1849e53d937aded2c276208d53e1e0f6e2683d4c 100644 (file)
@@ -1196,7 +1196,7 @@ if (!DOMTokenList.prototype.remove) {
                 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);
                     });
@@ -1213,7 +1213,7 @@ if (!DOMTokenList.prototype.remove) {
                     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) {
@@ -1597,7 +1597,7 @@ if (!DOMTokenList.prototype.remove) {
                 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");
index 4ec8637cc71f6f4f906bbf395afe347922ee03d8..787f3c7f48004f342502e9a19b7279a89d357868 100644 (file)
@@ -424,7 +424,8 @@ h4 > code, h3 > code, .invisible > code {
 
 .docblock table {
        margin: .5em 0;
-       width: 100%;
+       width: calc(100% - 2px);
+       border: 1px dashed;
 }
 
 .docblock table td {
@@ -657,7 +658,7 @@ a {
        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 {
index 333fe76a8a4a9a331fa86dff8f5fea6f62a87525..e756ab60ccc6d28e3def52300cf4caffdfaf4a28 100644 (file)
@@ -68,20 +68,10 @@ pre {
        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 {
@@ -190,15 +180,15 @@ a.test-arrow {
        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;
index 19ae67b29881f4e915a3ccd8cfe727178217ef61..a294f6f2ff12326aba5961de5041297e7d551461 100644 (file)
@@ -67,21 +67,11 @@ pre {
 }
 
 .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,
@@ -191,15 +181,15 @@ a.test-arrow {
        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;
index ddb730672d2947ac6cf9ca8f5f9a74dd3bd7b54b..43b366535159ce468a075f512c9888107267a36d 100644 (file)
@@ -7,7 +7,6 @@
 #![feature(box_syntax)]
 #![feature(nll)]
 #![feature(set_stdio)]
-#![feature(slice_sort_by_cached_key)]
 #![feature(test)]
 #![feature(vec_remove_item)]
 #![feature(ptr_offset_from)]
@@ -346,6 +345,11 @@ fn opts() -> Vec<RustcOptGroup> {
                        "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")
+        }),
     ]
 }
 
index 0b9fbc81da626a600824de2922d6e15ab1890dba..2195b90e1dc165f933c7a2b6ae8cee2eb8c5ba66 100644 (file)
@@ -5,12 +5,11 @@
 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;
@@ -21,7 +20,6 @@
 use testing;
 
 use std::env;
-use std::ffi::OsString;
 use std::io::prelude::*;
 use std::io;
 use std::path::PathBuf;
@@ -265,7 +263,7 @@ fn path(&self) -> &std::path::Path {
         }
     }
 
-    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()),
@@ -304,7 +302,6 @@ fn path(&self) -> &std::path::Path {
                                 .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()));
@@ -336,7 +333,7 @@ fn path(&self) -> &std::path::Path {
             Err(_) | Ok(Err(CompileIncomplete::Errored(_))) => Err(())
         };
 
-        (libdir, outdir, compile_result)
+        (outdir, compile_result)
     });
 
     match (compile_result, compile_fail) {
@@ -362,21 +359,7 @@ fn path(&self) -> &std::path::Path {
     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 {
@@ -534,13 +517,19 @@ pub fn make_test(s: &str,
         }
     }
 
-    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);
index 92876f7f2d804a6608a941426183799995ba3a3c..7d60a170422b3c3aa252191ba290937835345bf3 100644 (file)
@@ -47,7 +47,7 @@ fortanix-sgx-abi = { version = "0.3.2", features = ['rustc-dep-of-std'] }
 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"]
@@ -66,3 +66,8 @@ wasm_syscall = []
 # 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 = []
index 6348b411a4c641a08d1e678db1260d7adc4033cc..ef8c97bebdffdbfca227fdcea7c9d6c3959c564d 100644 (file)
@@ -718,7 +718,7 @@ pub fn downcast<T: Error + 'static>(self: Box<Self>) -> Result<Box<T>, Box<dyn E
     /// ```
     ///
     /// [`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 {
@@ -793,7 +793,7 @@ pub fn iter_chain(&self) -> 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(),
@@ -804,13 +804,13 @@ pub fn iter_sources(&self) -> ErrorIter {
 /// 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);
 
index f1e8619fc8ffce412769d147a03e09cab6d8053d..def51c79a8562cc73d55a9f07c232348dc4c8501 100644 (file)
@@ -254,10 +254,13 @@ fn initial_buffer_size(file: &File) -> usize {
 /// ```
 #[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.
@@ -296,10 +299,13 @@ pub fn read<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
 /// ```
 #[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.
@@ -326,7 +332,10 @@ pub fn read_to_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
 /// ```
 #[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 {
index 4f900e8cbad2d17be96337255645854191900459..f849daf2079671a9f92d1718311d03238ebf926d 100644 (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))]
index d19cc482c15f996cec15dca7e167f3685dca5d65..c856129016814d922541b7b81ea7d7b6799b3922 100644 (file)
@@ -329,6 +329,8 @@ impl Ipv4Addr {
     /// ```
     #[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(
@@ -392,6 +394,7 @@ pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
     /// ```
     #[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()
     }
 
@@ -618,9 +621,13 @@ pub fn is_documentation(&self) -> bool {
     /// ```
     #[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].
@@ -639,9 +646,13 @@ pub fn to_ipv6_compatible(&self) -> Ipv6Addr {
     /// ```
     #[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],
+        ])
     }
 }
 
@@ -784,7 +795,7 @@ impl From<Ipv4Addr> for u32 {
     /// ```
     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)
     }
 }
 
@@ -801,7 +812,7 @@ impl From<u32> for Ipv4Addr {
     /// 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())
     }
 }
 
@@ -909,14 +920,14 @@ pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16,
     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]]),
         ]
     }
 
@@ -1382,21 +1393,43 @@ fn from_inner(addr: c::in6_addr) -> Ipv6Addr {
 
 #[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())
     }
 }
 
index 0f1d627fa1e85547a9926261fef5d01e087d90ee..0a9796d1a9c209fd0d1ac075280016be922afe56 100644 (file)
@@ -1230,12 +1230,11 @@ fn _push(&mut self, path: &Path) {
 
     /// 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
     ///
index 12d3e9b13b1156120f73b5f983c330f97c17dd77..6fbbbb349b171a9a86e30ca8118abc18bc425391 100644 (file)
@@ -281,8 +281,7 @@ fn posix_spawn(&mut self, stdio: &ChildPipes, envp: Option<&CStringArray>)
         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 {
@@ -301,6 +300,24 @@ fn posix_spawn(&mut self, stdio: &ChildPipes, envp: Option<&CStringArray>)
             }
         }
 
+        // 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);
@@ -345,6 +362,9 @@ fn drop(&mut self) {
                                                            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))?;
index 47a963bcca9f2388b3252252b828fa54501c0f92..e1c2b2b1d4f3079532be68437cac7fd1510e6ab9 100644 (file)
@@ -218,6 +218,52 @@ pub fn duration_since(&self, earlier: Instant) -> Duration {
         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
@@ -626,6 +672,20 @@ fn instant_duration_panic() {
         (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();
index 36488b3a69f07c4bd984d34490fdb735acaced72..a6145d5dcb38c6234146c2657111c267dff28918 100644 (file)
@@ -14,7 +14,6 @@
 #![feature(nll)]
 #![feature(rustc_attrs)]
 #![feature(rustc_diagnostic_macros)]
-#![feature(slice_sort_by_cached_key)]
 #![feature(step_trait)]
 #![feature(try_trait)]
 #![feature(unicode_internals)]
index 36d30b7d27342642d2e703ef8074a2ddbf4303ce..a93ee6bc604a4bd0e2f8ff2cfd20087cb8644fc5 100644 (file)
@@ -12,7 +12,7 @@
 # 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
 
index b23541340b5941749e5fbb1930e666bbd1375244..9a60697044088f6704a40da78dee25eb6d55fd6f 160000 (submodule)
@@ -1 +1 @@
-Subproject commit b23541340b5941749e5fbb1930e666bbd1375244
+Subproject commit 9a60697044088f6704a40da78dee25eb6d55fd6f
index 8af05e9ca97b1d60fd9557cb76d290c9e1bb6491..b7617ec556d2083651f881f0bb8f0adb0165c88d 100644 (file)
@@ -12,7 +12,7 @@ error[E0425]: cannot find value `no` in this scope
 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 ----
@@ -21,7 +21,7 @@ thread '$DIR/failed-doctest-output.rs - SomeStruct (line 11)' panicked at 'test
 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:
index a7c25538f7c44682206ab708aad233d3b4252347..c6bac51c5740dcd6da42b9af545f843a53724fcd 100644 (file)
@@ -1,3 +1,5 @@
+// compile-flags:-Z unstable-options --generate-redirect-pages
+
 use std::ops::Deref;
 
 pub struct Foo;
index 14f547abd9a68b59bd7a1715c723911773ec82f2..b054145a4831a6d681516b560c1c19ec072162bb 100644 (file)
@@ -3,7 +3,6 @@
 
 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};
index 0caead100d666216df186129e038a874ead479f1..33f7646ced68b4ef1f13442ff2b4cd3f23edc2cc 100644 (file)
@@ -23,7 +23,6 @@ impl DerefMut for 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)'
index 0978b103076fefd9d6ced159bfb4b20a26bf353b..04fffc40572a6b5515cfad66c6f99b924c78261f 100644 (file)
@@ -18,7 +18,6 @@ impl Deref for Bar {
     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)'
index c66a2c845bfd8a30fec1370b8fbcb4d8a1d522c6..fb4f02ad16052a8bc3f0c746733f9df62fdd14e7 100644 (file)
@@ -2,8 +2,6 @@
 // @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 {
     () => [];
diff --git a/src/test/rustdoc/process-termination.rs b/src/test/rustdoc/process-termination.rs
new file mode 100644 (file)
index 0000000..3225879
--- /dev/null
@@ -0,0 +1,24 @@
+// 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() {}
index 902a319a7b90659f5004be06681a75f3d0293648..353ce10243e0055d8ee570b77bf4d9f8e786d076 100644 (file)
@@ -14,13 +14,11 @@ pub mod bar {
     // @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) { } }
 
index 35cea8afe21469ec06872afba6059b30b88efa3f..235f0e852da2ca9dd4bb49bb34a8877de71c7406 100644 (file)
@@ -1,3 +1,5 @@
+// compile-flags:-Z unstable-options --generate-redirect-pages
+
 // @has structfields/Foo.t.html
 // @has - struct.Foo.html
 // @has structfields/struct.Foo.html
diff --git a/src/test/rustdoc/without-redirect.rs b/src/test/rustdoc/without-redirect.rs
new file mode 100644 (file)
index 0000000..a076f8a
--- /dev/null
@@ -0,0 +1,13 @@
+#![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;
diff --git a/src/test/rustdoc/wrapping.rs b/src/test/rustdoc/wrapping.rs
new file mode 100644 (file)
index 0000000..8d8221b
--- /dev/null
@@ -0,0 +1,5 @@
+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 {}
index 3f120cbc4d337e32abedb1554320fc28ccadf09c..47f826789e03e2d75b6494e8c142d8d1982aa0b3 100644 (file)
@@ -8,6 +8,7 @@ fn foo<const X: (), T>(_: T) {
 
 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() {}
index aedcaf52e2688a34deb25296b008a8f6fefc801a..a43415d0e5a43227cb1201632793c712e7e43e53 100644 (file)
@@ -22,5 +22,11 @@ error: const generics in any position are currently unsupported
 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
 
diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.rs b/src/test/ui/const-generics/const-parameter-uppercase-lint.rs
new file mode 100644 (file)
index 0000000..37fe9af
--- /dev/null
@@ -0,0 +1,8 @@
+#![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
+}
diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr b/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr
new file mode 100644 (file)
index 0000000..9683e91
--- /dev/null
@@ -0,0 +1,19 @@
+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`.
index f6b704370b6f239890fa5d0add31898aaff8e74d..62f678790d21fdb56cd50dabafda4eeac712fb86 100644 (file)
@@ -1,10 +1,12 @@
-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`.
index ba980b7aacb6c095689714be2b94a93622ee6468..b5af3e7ee46655ca8d5c44f3aa342a1584102305 100644 (file)
@@ -1,32 +1,43 @@
-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`.
index a050c10e02cf931655454f341bc31af9baff3714..d84e2651d4fc42ac5f1390aca3139bb7e6942ca7 100644 (file)
@@ -1,8 +1,11 @@
-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`.
index 1424cea65afd55dd11ac835a708fbac534212c71..716e8380c45da23a2ebad6861a53c38cb742335c 100644 (file)
@@ -1,8 +1,11 @@
-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`.
index 763c69e8050309a045a5dbd60402b3f64ac47190..feb4960e0c7463f2d618483aaead279a98806c87 100644 (file)
@@ -4,11 +4,13 @@ error[E0493]: destructors cannot be evaluated at compile-time
 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
@@ -16,11 +18,13 @@ error[E0493]: destructors cannot be evaluated at compile-time
 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
@@ -28,173 +32,229 @@ error[E0493]: destructors cannot be evaluated at compile-time
 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
@@ -208,25 +268,31 @@ LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
    = 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`.
index 52c60c57b8fb359b4d552e0e6a555f4860aedda9..e095ccaf20e29a106b46008ea1872e9ec06049be 100644 (file)
@@ -4,11 +4,13 @@ error[E0493]: destructors cannot be evaluated at compile-time
 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
@@ -16,11 +18,13 @@ error[E0493]: destructors cannot be evaluated at compile-time
 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
@@ -28,192 +32,255 @@ error[E0493]: destructors cannot be evaluated at compile-time
 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`.
index 6dbe9b1c6ab1028ec79d40130feff1378832006a..2800d622f5353c0947ac80779ca5f5058fc3cc17 100644 (file)
@@ -1,14 +1,18 @@
-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
@@ -24,4 +28,5 @@ LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }
 
 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`.
index 8179cf795b48c199f738f78ac28a3890fd0be8f6..8ff963722cf1519aac0a63523da678ab6f1b03c1 100644 (file)
@@ -1,14 +1,19 @@
-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`.
index c1cb19180a5ee3f9f90433bf9ada1cdf31d4519c..8838ababe2c0e99adb0eb85a66da361ded04ca42 100644 (file)
@@ -1,14 +1,19 @@
-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`.
index 9640105d25c549c75b39dcd6e7cf2e12b19f151e..1e6f698b3c8e3f11acdc379bb0d89c7c21a7db05 100644 (file)
@@ -1,26 +1,35 @@
-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`.
index 049c25e71913d01b598d5ca74b97ddffc366eefd..07d10984392d809d067dc84f6fb40b5807850455 100644 (file)
@@ -1,26 +1,35 @@
-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`.
index 89509f813e10737a31c28e6edcdc0048f838008d..7cb8c6e62ec60ac3f2dd7c45b642d89bffc3fbaa 100644 (file)
@@ -1,20 +1,27 @@
-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`.
index 5ce0f30dc6e1f27bfc7e5578a016a80cc8f26343..e5a3502a3dc52770eb0484a7ff93a24227e20c63 100644 (file)
@@ -1,14 +1,19 @@
-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`.
diff --git a/src/test/ui/consts/promote_evaluation_unused_result.rs b/src/test/ui/consts/promote_evaluation_unused_result.rs
new file mode 100644 (file)
index 0000000..d199e34
--- /dev/null
@@ -0,0 +1,8 @@
+//compile-pass
+
+#![feature(nll)]
+
+fn main() {
+
+    let _: &'static usize = &(loop {}, 1).1;
+}
index f5c2cb5e0e9dcb95931e6e7d07a0cea6f4ac8967..5272062ccfc14e959ac07beccbd05c9165a0494a 100644 (file)
@@ -10,12 +10,15 @@ error[E0019]: constant contains unimplemented expression type
 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`.
index a8a4ed5772299a152a1443c96fc97d2d407e3571..907e00b11e556de804542779b70276ce5ccf75a2 100644 (file)
@@ -2,5 +2,6 @@ fn foo<const X: ()>() {} //~ ERROR const generics are unstable
 //~^ 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() {}
index 905cc07b6a17550a24e529af57a44d9d036d378b..3ab1aa2367f1c637eecf4d3428f6204da7d6492b 100644 (file)
@@ -20,6 +20,12 @@ error: const generics in any position are currently unsupported
 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`.
index 15e662a41de22dd87f9d20f358c10519824689f0..994aebc7f6e3e9082f14bb7ab93e1394e6f862a3 100644 (file)
@@ -1,10 +1,10 @@
 #![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 }
index 639ee19910155c44c65ea973b80ed154f193c0bd..3da39f1dc17cbe8f028a5bde5bd3323b65fda82e 100644 (file)
@@ -1,9 +1,9 @@
-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
@@ -12,12 +12,12 @@ 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
index d2b03416cb73cb923de830cf930bcd8dfd6a2362..97160af43bee4eb1796c59fa0d0f7f6fb89d55c0 100644 (file)
@@ -1,8 +1,11 @@
-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`.
diff --git a/src/test/ui/issues/issue-57979.rs b/src/test/ui/issues/issue-57979.rs
new file mode 100644 (file)
index 0000000..abd46b6
--- /dev/null
@@ -0,0 +1,42 @@
+// 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!()
+}
diff --git a/src/test/ui/issues/issue-57979.stderr b/src/test/ui/issues/issue-57979.stderr
new file mode 100644 (file)
index 0000000..488f30a
--- /dev/null
@@ -0,0 +1,17 @@
+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`.
index a497953d73a05efd9a25e1dae0045131934beaf8..67bd6dd501bd8f6b3c3ed458c861caf860026def 100644 (file)
@@ -10,7 +10,7 @@
 #[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() {}
@@ -23,7 +23,7 @@ mod badlands {
     //~^ 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
@@ -31,7 +31,7 @@ mod badlands {
     //~^ 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
 }
 
index c70f17f95d02803b48af9739d445195a65bfa68b..1e4eabc9db0f76a08deedb6dce6a37e70090d3a6 100644 (file)
@@ -54,7 +54,7 @@ LL | #[no_mangle] const DISCOVERY: usize = 1;
    |
    = 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]
@@ -73,7 +73,7 @@ LL |     #[no_mangle] pub const DAUNTLESS: bool = true;
    |                  |
    |                  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>() {}
@@ -89,7 +89,7 @@ LL |     #[no_mangle] pub(crate) const VETAR: bool = true;
    |                  |
    |                  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>() {}
index 39a55190b17deed7328383bfe2bbe25c6a154aa3..fb3841948f11fd490f4c9a3c722171606202db22 100644 (file)
@@ -1,14 +1,18 @@
-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
@@ -20,4 +24,5 @@ LL |     let y = &mut x.0; //~ ERROR references in const fn are unstable
 
 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`.
index 3bda548f81bc268a2e9813ce9168d2e40e8a11bd..d61b25419bec5a3e839fdb16f720cfb12e52ddf1 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 3bda548f81bc268a2e9813ce9168d2e40e8a11bd
+Subproject commit d61b25419bec5a3e839fdb16f720cfb12e52ddf1
index 75b1db8045d2557307a8633304c2aba82dd0ca54..abcf14d90be1548af62915afe14538d4b33e88ee 100755 (executable)
@@ -15,7 +15,7 @@ except ImportError:
 # 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',
@@ -171,7 +171,7 @@ if __name__ == '__main__':
 
     # 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:
@@ -182,10 +182,10 @@ if __name__ == '__main__':
         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,
index f331ff713917f6edb044c7e5c6c28c3845afebe7..0d6f53e1a4adbaf7d83cdc0cb54720203fcb522e 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f331ff713917f6edb044c7e5c6c28c3845afebe7
+Subproject commit 0d6f53e1a4adbaf7d83cdc0cb54720203fcb522e
index f943ac9815ac6d9e27f89a65ddb4db884c9d47a2..157b73117073886af3ffabacd17198652f3bb7d6 100644 (file)
@@ -60,7 +60,7 @@ parking_lot = { version = "0.6", features = ['nightly'] }
 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"]}
 
index be135599ef5e54b5219f9adec68e1ee267ea0584..d6829d62dca64dfe7ceaa96d1a9c1cd36428221d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit be135599ef5e54b5219f9adec68e1ee267ea0584
+Subproject commit d6829d62dca64dfe7ceaa96d1a9c1cd36428221d
index 17c36b80f3a7c6fa492a26e3460827db4f8fbb9a..94dd5478e5297474ee7c30006387ebb4128f1b7b 100644 (file)
@@ -45,6 +45,7 @@
     "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?