From e9174d1eb2e039cc93eb32959f1cf64a37ccec48 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 30 Oct 2015 09:44:00 +0100 Subject: [PATCH] Imported Upstream version 1.4.0+dfsg1 --- CONTRIBUTING.md | 32 +- COPYRIGHT | 98 - README.md | 31 +- RELEASES.md | 291 +- configure | 82 +- man/rustc.1 | 5 +- mk/cfg/i686-linux-android.mk | 25 + mk/cfg/i686-pc-windows-msvc.mk | 5 - mk/cfg/x86_64-pc-windows-msvc.mk | 5 - mk/clean.mk | 1 - mk/crates.mk | 52 +- mk/docs.mk | 96 +- mk/main.mk | 20 +- mk/platform.mk | 56 +- mk/rt.mk | 35 +- mk/target.mk | 97 +- mk/tests.mk | 18 +- src/compiletest/compiletest.rs | 32 +- src/compiletest/errors.rs | 2 +- src/compiletest/header.rs | 121 +- src/compiletest/procsrv.rs | 8 +- src/compiletest/runtest.rs | 223 +- src/compiletest/util.rs | 2 +- src/doc/README.md | 17 +- src/doc/favicon.inc | 2 +- src/doc/grammar.md | 19 +- src/doc/index.md | 39 +- src/doc/nomicon/atomics.md | 10 +- src/doc/nomicon/coercions.md | 2 +- src/doc/nomicon/concurrency.md | 2 +- src/doc/nomicon/destructors.md | 28 +- src/doc/nomicon/drop-flags.md | 2 +- src/doc/nomicon/dropck.md | 2 +- src/doc/nomicon/exotic-sizes.md | 4 +- src/doc/nomicon/leaking.md | 1 - src/doc/nomicon/lifetimes.md | 2 +- src/doc/nomicon/meet-safe-and-unsafe.md | 4 +- src/doc/nomicon/other-reprs.md | 2 +- src/doc/nomicon/repr-rust.md | 46 +- src/doc/nomicon/safe-unsafe-meaning.md | 6 +- src/doc/nomicon/send-and-sync.md | 6 +- src/doc/nomicon/subtyping.md | 4 +- src/doc/nomicon/transmutes.md | 2 +- src/doc/nomicon/unchecked-uninit.md | 2 +- src/doc/nomicon/vec-alloc.md | 7 +- src/doc/nomicon/vec-drain.md | 14 +- src/doc/nomicon/vec-final.md | 22 +- src/doc/not_found.md | 8 +- src/doc/reference.md | 162 +- src/doc/style/README.md | 2 +- src/doc/style/errors/ergonomics.md | 2 +- src/doc/style/errors/signaling.md | 2 +- .../features/functions-and-methods/input.md | 28 +- src/doc/style/features/modules.md | 20 +- src/doc/style/ownership/builders.md | 2 +- src/doc/trpl/README.md | 6 +- src/doc/trpl/SUMMARY.md | 2 +- src/doc/trpl/advanced-linking.md | 48 +- .../{academic-research.md => bibliography.md} | 15 +- src/doc/trpl/choosing-your-guarantees.md | 12 +- src/doc/trpl/closures.md | 29 + src/doc/trpl/compiler-plugins.md | 4 +- src/doc/trpl/concurrency.md | 102 +- src/doc/trpl/crates-and-modules.md | 54 +- src/doc/trpl/deref-coercions.md | 10 +- src/doc/trpl/documentation.md | 24 +- src/doc/trpl/error-handling.md | 2191 ++++- src/doc/trpl/ffi.md | 61 +- src/doc/trpl/functions.md | 89 +- src/doc/trpl/generics.md | 38 +- src/doc/trpl/glossary.md | 6 + src/doc/trpl/guessing-game.md | 4 +- src/doc/trpl/installing-rust.md | 8 +- src/doc/trpl/lang-items.md | 1 - src/doc/trpl/lifetimes.md | 16 +- src/doc/trpl/loops.md | 4 +- src/doc/trpl/macros.md | 2 +- src/doc/trpl/method-syntax.md | 16 +- src/doc/trpl/mutability.md | 6 +- src/doc/trpl/nightly-rust.md | 4 +- src/doc/trpl/no-stdlib.md | 13 +- src/doc/trpl/operators-and-overloading.md | 52 + src/doc/trpl/patterns.md | 244 +- src/doc/trpl/references-and-borrowing.md | 12 +- src/doc/trpl/rust-inside-other-languages.md | 13 +- src/doc/trpl/strings.md | 2 +- src/doc/trpl/structs.md | 22 +- src/doc/trpl/testing.md | 79 +- src/doc/trpl/the-stack-and-the-heap.md | 272 +- src/doc/trpl/trait-objects.md | 38 + src/doc/trpl/traits.md | 76 +- src/doc/version_info.html.template | 6 +- src/etc/dec2flt_table.py | 134 + src/etc/featureck.py | 14 +- src/etc/make-win-dist.py | 2 +- src/etc/maketest.py | 16 +- src/etc/platform-intrinsics/aarch64.json | 592 ++ src/etc/platform-intrinsics/arm.json | 396 + src/etc/platform-intrinsics/generator.py | 805 ++ src/etc/platform-intrinsics/x86/avx.json | 194 + src/etc/platform-intrinsics/x86/avx2.json | 201 + src/etc/platform-intrinsics/x86/info.json | 28 + src/etc/platform-intrinsics/x86/sse.json | 54 + src/etc/platform-intrinsics/x86/sse2.json | 159 + src/etc/platform-intrinsics/x86/sse3.json | 33 + src/etc/platform-intrinsics/x86/sse41.json | 75 + src/etc/platform-intrinsics/x86/sse42.json | 103 + src/etc/platform-intrinsics/x86/ssse3.json | 68 + src/etc/test-float-parse/_common.rs | 26 + .../test-float-parse/few-ones.rs} | 22 +- .../test-float-parse/huge-pow10.rs} | 14 +- src/etc/test-float-parse/many-digits.rs | 39 + src/etc/test-float-parse/rand-f64.rs | 32 + src/etc/test-float-parse/runtests.py | 399 + src/etc/test-float-parse/short-decimals.rs | 29 + src/etc/test-float-parse/subnorm.rs | 23 + src/etc/test-float-parse/tiny-pow10.rs | 21 + src/etc/test-float-parse/u32-small.rs | 19 + src/etc/test-float-parse/u64-pow2.rs | 28 + src/etc/unicode.py | 163 - src/jemalloc/VERSION | 2 +- src/liballoc/arc.rs | 311 +- src/liballoc/boxed.rs | 60 +- src/liballoc/heap.rs | 393 +- src/liballoc/lib.rs | 28 +- src/liballoc/raw_vec.rs | 10 +- src/liballoc/rc.rs | 361 +- src/liballoc_jemalloc/lib.rs | 97 + src/liballoc_system/lib.rs | 213 + src/libarena/lib.rs | 34 +- src/libbacktrace/ChangeLog | 38 + src/libbacktrace/Makefile.am | 2 + src/libbacktrace/Makefile.in | 72 +- src/libbacktrace/aclocal.m4 | 62 +- src/libbacktrace/backtrace-supported.h.in | 5 + src/libbacktrace/btest.c | 6 + src/libbacktrace/configure | 44 +- src/libbacktrace/configure.ac | 17 + src/libbacktrace/dwarf.c | 34 +- src/libbacktrace/filetype.awk | 2 + src/libbacktrace/pecoff.c | 937 +++ src/libcollections/binary_heap.rs | 48 +- src/libcollections/bit.rs | 2211 ----- src/libcollections/borrow.rs | 111 +- src/libcollections/btree/map.rs | 148 +- src/libcollections/btree/mod.rs | 9 + src/libcollections/btree/node.rs | 48 +- src/libcollections/btree/set.rs | 44 +- src/libcollections/enum_set.rs | 4 +- src/libcollections/fmt.rs | 1 + src/libcollections/lib.rs | 44 +- src/libcollections/linked_list.rs | 18 +- src/libcollections/macros.rs | 6 + src/libcollections/range.rs | 3 +- src/libcollections/slice.rs | 410 +- src/libcollections/str.rs | 533 +- src/libcollections/string.rs | 114 +- src/libcollections/vec.rs | 371 +- src/libcollections/vec_deque.rs | 114 +- src/libcollections/vec_map.rs | 1085 --- src/libcollectionstest/bit/set.rs | 520 -- src/libcollectionstest/bit/vec.rs | 881 -- src/libcollectionstest/btree/set.rs | 52 +- src/libcollectionstest/lib.rs | 29 +- src/libcollectionstest/linked_list.rs | 5 +- src/libcollectionstest/slice.rs | 186 - src/libcollectionstest/str.rs | 614 +- src/libcollectionstest/string.rs | 4 +- src/libcollectionstest/vec.rs | 82 +- src/libcollectionstest/vec_deque.rs | 3 +- src/libcollectionstest/vec_map.rs | 526 -- src/libcore/any.rs | 18 +- src/libcore/array.rs | 66 +- src/libcore/borrow.rs | 109 + src/libcore/cell.rs | 65 +- src/libcore/char.rs | 12 +- src/libcore/clone.rs | 42 - src/libcore/cmp.rs | 81 +- src/libcore/default.rs | 2 +- src/libcore/fmt/builders.rs | 5 +- src/libcore/fmt/mod.rs | 58 +- src/libcore/fmt/num.rs | 11 +- src/libcore/hash/mod.rs | 53 +- src/libcore/hash/sip.rs | 14 +- src/libcore/intrinsics.rs | 9 +- src/libcore/iter.rs | 1005 +-- src/libcore/lib.rs | 64 +- src/libcore/macros.rs | 51 +- src/libcore/marker.rs | 35 +- src/libcore/mem.rs | 72 +- src/libcore/nonzero.rs | 5 +- src/libcore/num/dec2flt/algorithm.rs | 361 + src/libcore/num/dec2flt/mod.rs | 309 + src/libcore/num/dec2flt/num.rs | 95 + src/libcore/num/dec2flt/parse.rs | 133 + src/libcore/num/dec2flt/rawfp.rs | 356 + src/libcore/num/dec2flt/table.rs | 1239 +++ src/libcore/num/f32.rs | 148 +- src/libcore/num/f64.rs | 100 +- src/libcore/num/float_macros.rs | 17 +- src/libcore/num/flt2dec/bignum.rs | 168 +- src/libcore/num/flt2dec/decoder.rs | 7 +- src/libcore/num/flt2dec/mod.rs | 6 +- src/libcore/num/flt2dec/strategy/dragon.rs | 10 +- src/libcore/num/flt2dec/strategy/grisu.rs | 9 +- src/libcore/num/i16.rs | 4 +- src/libcore/num/i32.rs | 4 +- src/libcore/num/i64.rs | 4 +- src/libcore/num/i8.rs | 4 +- src/libcore/num/int_macros.rs | 6 +- src/libcore/num/isize.rs | 4 +- src/libcore/num/mod.rs | 162 +- src/libcore/num/u16.rs | 4 +- src/libcore/num/u32.rs | 4 +- src/libcore/num/u64.rs | 4 +- src/libcore/num/u8.rs | 4 +- src/libcore/num/uint_macros.rs | 6 +- src/libcore/num/usize.rs | 4 +- src/libcore/num/wrapping.rs | 4 +- src/libcore/ops.rs | 50 +- src/libcore/option.rs | 36 +- src/libcore/panicking.rs | 4 +- src/libcore/prelude.rs | 49 - src/libcore/prelude/mod.rs | 15 + src/libcore/prelude/v1.rs | 39 + src/libcore/ptr.rs | 164 +- src/libcore/raw.rs | 2 +- src/libcore/result.rs | 65 +- src/libcore/simd.rs | 94 +- src/libcore/simd_old.rs | 98 + src/libcore/slice.rs | 325 +- src/libcore/str/mod.rs | 176 +- src/libcore/str/pattern.rs | 263 +- src/libcore/{ => sync}/atomic.rs | 0 src/libcore/sync/mod.rs | 15 + src/libcoretest/array.rs | 28 + src/libcoretest/atomic.rs | 4 +- src/libcoretest/char.rs | 69 +- src/libcoretest/cmp.rs | 67 - src/libcoretest/hash/mod.rs | 21 +- src/libcoretest/iter.rs | 259 +- src/libcoretest/lib.rs | 14 +- src/libcoretest/num/dec2flt/mod.rs | 192 + src/libcoretest/num/dec2flt/parse.rs | 52 + src/libcoretest/num/dec2flt/rawfp.rs | 139 + src/libcoretest/num/flt2dec/bignum.rs | 89 + src/libcoretest/num/flt2dec/mod.rs | 18 +- .../num/flt2dec/strategy/dragon.rs | 19 +- src/libcoretest/num/flt2dec/strategy/grisu.rs | 6 +- src/libcoretest/num/mod.rs | 1 + src/libcoretest/num/uint_macros.rs | 32 +- src/libcoretest/option.rs | 9 +- src/libcoretest/ptr.rs | 3 +- src/libcoretest/result.rs | 33 + src/libcoretest/slice.rs | 120 + src/libflate/lib.rs | 6 +- src/libfmt_macros/lib.rs | 221 +- src/libgetopts/lib.rs | 95 +- src/libgraphviz/lib.rs | 250 +- src/liblibc/lib.rs | 107 +- src/liblog/directive.rs | 36 +- src/liblog/lib.rs | 37 +- src/liblog/macros.rs | 6 +- src/librand/chacha.rs | 1 - src/librand/distributions/exponential.rs | 8 +- src/librand/distributions/gamma.rs | 2 +- src/librand/distributions/mod.rs | 1 - src/librand/distributions/normal.rs | 2 +- src/librand/distributions/range.rs | 5 +- src/librand/isaac.rs | 1 - src/librand/lib.rs | 55 +- src/librand/rand_impls.rs | 1 - src/librand/reseeding.rs | 2 - src/librbml/lib.rs | 8 +- src/librustc/README.md | 2 +- src/librustc/diagnostics.rs | 116 +- src/librustc/{ast_map => front/map}/blocks.rs | 49 +- src/librustc/{ast_map => front/map}/mod.rs | 80 +- src/librustc/lib.rs | 38 +- src/librustc/lint/context.rs | 131 +- src/librustc/lint/mod.rs | 65 +- src/librustc/metadata/common.rs | 19 +- src/librustc/metadata/creader.rs | 493 +- src/librustc/metadata/csearch.rs | 203 +- src/librustc/metadata/cstore.rs | 78 +- src/librustc/metadata/decoder.rs | 592 +- src/librustc/metadata/encoder.rs | 460 +- src/librustc/metadata/index.rs | 208 + src/librustc/metadata/inline.rs | 64 + src/librustc/metadata/macro_import.rs | 5 +- src/librustc/metadata/mod.rs | 2 + src/librustc/metadata/tydecode.rs | 1379 ++-- src/librustc/metadata/tyencode.rs | 97 +- src/librustc/middle/astconv_util.rs | 40 +- src/librustc/middle/astencode.rs | 545 +- src/librustc/middle/cfg/construct.rs | 184 +- src/librustc/middle/cfg/graphviz.rs | 2 +- src/librustc/middle/cfg/mod.rs | 3 +- src/librustc/middle/check_const.rs | 211 +- src/librustc/middle/check_loop.rs | 22 +- src/librustc/middle/check_match.rs | 276 +- src/librustc/middle/check_no_asm.rs | 41 + src/librustc/middle/check_rvalues.rs | 13 +- src/librustc/middle/check_static_recursion.rs | 65 +- src/librustc/middle/const_eval.rs | 358 +- src/librustc/middle/dataflow.rs | 19 +- src/librustc/middle/dead.rs | 195 +- src/librustc/middle/def.rs | 52 +- src/librustc/middle/def_id.rs | 62 + src/librustc/middle/dependency_format.rs | 159 +- src/librustc/middle/effect.rs | 43 +- src/librustc/middle/entry.rs | 108 +- src/librustc/middle/expr_use_visitor.rs | 289 +- src/librustc/middle/free_region.rs | 113 +- src/librustc/middle/implicator.rs | 71 +- src/librustc/middle/infer/bivariate.rs | 2 +- src/librustc/middle/infer/combine.rs | 40 +- src/librustc/middle/infer/equate.rs | 2 +- src/librustc/middle/infer/error_reporting.rs | 425 +- src/librustc/middle/infer/freshen.rs | 10 +- src/librustc/middle/infer/glb.rs | 2 +- .../middle/infer/higher_ranked/mod.rs | 83 +- src/librustc/middle/infer/lattice.rs | 2 +- src/librustc/middle/infer/lub.rs | 3 +- src/librustc/middle/infer/mod.rs | 219 +- .../middle/infer/region_inference/mod.rs | 290 +- src/librustc/middle/infer/resolve.rs | 12 +- src/librustc/middle/infer/sub.rs | 2 +- src/librustc/middle/infer/type_variable.rs | 2 +- src/librustc/middle/infer/unify_key.rs | 2 +- src/librustc/middle/intrinsicck.rs | 36 +- src/librustc/middle/lang_items.rs | 46 +- src/librustc/middle/liveness.rs | 251 +- src/librustc/middle/mem_categorization.rs | 148 +- src/librustc/middle/pat_util.rs | 88 +- src/librustc/middle/privacy.rs | 5 +- src/librustc/middle/reachable.rs | 121 +- src/librustc/middle/region.rs | 767 +- src/librustc/middle/resolve_lifetime.rs | 148 +- src/librustc/middle/stability.rs | 155 +- src/librustc/middle/subst.rs | 8 +- src/librustc/middle/traits/coherence.rs | 34 +- src/librustc/middle/traits/error_reporting.rs | 418 +- src/librustc/middle/traits/fulfill.rs | 84 +- src/librustc/middle/traits/mod.rs | 57 +- src/librustc/middle/traits/object_safety.rs | 32 +- src/librustc/middle/traits/project.rs | 99 +- src/librustc/middle/traits/select.rs | 232 +- .../middle/traits/structural_impls.rs | 281 + src/librustc/middle/traits/util.rs | 141 +- src/librustc/middle/ty.rs | 7293 ----------------- .../middle/{ty_match.rs => ty/_match.rs} | 7 +- src/librustc/middle/ty/adjustment.rs | 249 + src/librustc/middle/{ => ty}/cast.rs | 7 +- src/librustc/middle/ty/contents.rs | 269 + src/librustc/middle/ty/context.rs | 960 +++ src/librustc/middle/ty/error.rs | 342 + src/librustc/middle/{ => ty}/fast_reject.rs | 33 +- src/librustc/middle/ty/flags.rs | 205 + src/librustc/middle/ty/fold.rs | 680 ++ src/librustc/middle/ty/ivar.rs | 72 + src/librustc/middle/ty/mod.rs | 2820 +++++++ src/librustc/middle/ty/outlives.rs | 231 + .../middle/{ty_relate/mod.rs => ty/relate.rs} | 38 +- src/librustc/middle/ty/structural_impls.rs | 826 ++ src/librustc/middle/ty/sty.rs | 1212 +++ src/librustc/middle/ty/util.rs | 891 ++ .../middle/{ty_walk.rs => ty/walk.rs} | 0 src/librustc/middle/ty/wf.rs | 546 ++ src/librustc/middle/ty_fold.rs | 995 --- src/librustc/middle/weak_lang_items.rs | 16 +- src/librustc/plugin/build.rs | 14 +- src/librustc/plugin/load.rs | 1 - src/librustc/plugin/registry.rs | 9 +- src/librustc/session/config.rs | 122 +- src/librustc/session/mod.rs | 36 +- src/librustc/session/search_paths.rs | 5 +- src/librustc/util/common.rs | 117 +- src/librustc/util/nodemap.rs | 44 +- src/librustc/util/ppaux.rs | 278 +- src/librustc_back/lib.rs | 7 +- src/librustc_back/svh.rs | 79 +- src/librustc_back/target/apple_base.rs | 2 +- src/librustc_back/target/apple_ios_base.rs | 12 +- src/librustc_back/target/bitrig_base.rs | 2 +- src/librustc_back/target/dragonfly_base.rs | 6 +- src/librustc_back/target/freebsd_base.rs | 2 +- .../target/i686_linux_android.rs | 26 + .../target/i686_pc_windows_msvc.rs | 2 +- .../target/i686_unknown_freebsd.rs | 1 - src/librustc_back/target/linux_base.rs | 2 +- src/librustc_back/target/mod.rs | 42 +- src/librustc_back/target/netbsd_base.rs | 3 +- src/librustc_back/target/openbsd_base.rs | 2 +- src/librustc_back/target/windows_base.rs | 2 +- src/librustc_back/target/windows_msvc_base.rs | 3 +- .../target/x86_64_pc_windows_msvc.rs | 1 + src/librustc_back/tempdir.rs | 7 +- src/librustc_bitflags/lib.rs | 22 +- src/librustc_borrowck/borrowck/check_loans.rs | 78 +- src/librustc_borrowck/borrowck/fragments.rs | 47 +- .../borrowck/gather_loans/gather_moves.rs | 11 +- .../borrowck/gather_loans/mod.rs | 43 +- .../borrowck/gather_loans/move_error.rs | 9 +- src/librustc_borrowck/borrowck/mod.rs | 75 +- src/librustc_borrowck/borrowck/move_data.rs | 9 +- src/librustc_borrowck/diagnostics.rs | 172 +- src/librustc_borrowck/lib.rs | 7 +- src/librustc_data_structures/bitvec.rs | 192 +- src/librustc_data_structures/fnv.rs | 52 + src/librustc_data_structures/graph/mod.rs | 10 + src/librustc_data_structures/ivar.rs | 74 + src/librustc_data_structures/lib.rs | 21 +- .../transitive_relation.rs | 589 ++ src/librustc_data_structures/unify/mod.rs | 2 +- src/librustc_data_structures/unify/tests.rs | 1 - src/librustc_driver/driver.rs | 254 +- src/librustc_driver/lib.rs | 50 +- src/librustc_driver/pretty.rs | 272 +- src/librustc_driver/target_features.rs | 98 + src/librustc_driver/test.rs | 88 +- src/librustc_front/attr.rs | 628 ++ src/librustc_front/fold.rs | 1198 +++ src/librustc_front/hir.rs | 1533 ++++ src/librustc_front/lib.rs | 58 + src/librustc_front/lowering.rs | 1133 +++ src/librustc_front/print/pp.rs | 686 ++ src/librustc_front/print/pprust.rs | 2760 +++++++ src/librustc_front/util.rs | 427 + src/librustc_front/visit.rs | 844 ++ src/librustc_lint/builtin.rs | 772 +- src/librustc_lint/lib.rs | 7 +- src/librustc_llvm/lib.rs | 8 +- src/librustc_mir/build/block.rs | 28 + src/librustc_mir/build/cfg.rs | 88 + src/librustc_mir/build/expr/as_constant.rs | 123 + src/librustc_mir/build/expr/as_lvalue.rs | 131 + src/librustc_mir/build/expr/as_operand.rs | 68 + src/librustc_mir/build/expr/as_rvalue.rs | 220 + src/librustc_mir/build/expr/as_temp.rs | 85 + src/librustc_mir/build/expr/category.rs | 95 + src/librustc_mir/build/expr/into.rs | 282 + src/librustc_mir/build/expr/mod.rs | 79 + src/librustc_mir/build/into.rs | 70 + src/librustc_mir/build/matches/mod.rs | 403 + src/librustc_mir/build/matches/simplify.rs | 131 + src/librustc_mir/build/matches/test.rs | 347 + src/librustc_mir/build/matches/util.rs | 125 + src/librustc_mir/build/misc.rs | 78 + src/librustc_mir/build/mod.rs | 174 + src/librustc_mir/build/scope.rs | 304 + src/librustc_mir/build/stmt.rs | 61 + src/librustc_mir/dump.rs | 225 + src/librustc_mir/graphviz/mod.rs | 157 + src/librustc_mir/hair.rs | 382 + src/librustc_mir/lib.rs | 34 + src/librustc_mir/repr.rs | 689 ++ src/librustc_mir/tcx/block.rs | 114 + src/librustc_mir/tcx/expr.rs | 870 ++ src/librustc_mir/tcx/mod.rs | 184 + src/librustc_mir/tcx/pattern.rs | 291 + src/librustc_mir/tcx/to_ref.rs | 94 + src/librustc_platform_intrinsics/aarch64.rs | 3418 ++++++++ src/librustc_platform_intrinsics/arm.rs | 2088 +++++ src/librustc_platform_intrinsics/lib.rs | 81 + src/librustc_platform_intrinsics/x86.rs | 1113 +++ src/librustc_privacy/diagnostics.rs | 235 + src/librustc_privacy/lib.rs | 498 +- src/librustc_resolve/build_reduced_graph.rs | 139 +- src/librustc_resolve/check_unused.rs | 16 +- src/librustc_resolve/diagnostics.rs | 263 +- src/librustc_resolve/lib.rs | 355 +- src/librustc_resolve/record_exports.rs | 2 +- src/librustc_resolve/resolve_imports.rs | 123 +- src/librustc_trans/back/archive.rs | 7 +- src/librustc_trans/back/link.rs | 118 +- src/librustc_trans/back/linker.rs | 75 +- src/librustc_trans/back/lto.rs | 29 +- src/librustc_trans/back/msvc/registry.rs | 15 +- src/librustc_trans/back/write.rs | 15 +- src/librustc_trans/lib.rs | 9 +- src/librustc_trans/save/dump_csv.rs | 197 +- src/librustc_trans/save/mod.rs | 149 +- src/librustc_trans/save/recorder.rs | 89 +- src/librustc_trans/save/span_utils.rs | 54 +- src/librustc_trans/trans/_match.rs | 251 +- src/librustc_trans/trans/adt.rs | 219 +- src/librustc_trans/trans/asm.rs | 2 +- src/librustc_trans/trans/attributes.rs | 32 +- src/librustc_trans/trans/base.rs | 648 +- src/librustc_trans/trans/cabi_x86_win64.rs | 8 +- src/librustc_trans/trans/callee.rs | 76 +- src/librustc_trans/trans/cleanup.rs | 28 +- src/librustc_trans/trans/closure.rs | 24 +- src/librustc_trans/trans/common.rs | 254 +- src/librustc_trans/trans/consts.rs | 307 +- src/librustc_trans/trans/context.rs | 38 +- src/librustc_trans/trans/controlflow.rs | 45 +- src/librustc_trans/trans/datum.rs | 18 +- .../trans/debuginfo/create_scope_map.rs | 143 +- src/librustc_trans/trans/debuginfo/gdb.rs | 2 +- .../trans/debuginfo/metadata.rs | 274 +- src/librustc_trans/trans/debuginfo/mod.rs | 52 +- .../trans/debuginfo/namespace.rs | 11 +- .../trans/debuginfo/type_names.rs | 45 +- src/librustc_trans/trans/debuginfo/utils.rs | 14 +- src/librustc_trans/trans/declare.rs | 6 +- src/librustc_trans/trans/expr.rs | 798 +- src/librustc_trans/trans/foreign.rs | 73 +- src/librustc_trans/trans/glue.rs | 204 +- src/librustc_trans/trans/inline.rs | 86 +- src/librustc_trans/trans/intrinsic.rs | 548 +- src/librustc_trans/trans/meth.rs | 56 +- src/librustc_trans/trans/mod.rs | 2 - src/librustc_trans/trans/monomorphize.rs | 121 +- src/librustc_trans/trans/tvec.rs | 54 +- src/librustc_trans/trans/type_.rs | 60 +- src/librustc_trans/trans/type_of.rs | 52 +- src/librustc_typeck/astconv.rs | 321 +- src/librustc_typeck/check/_match.rs | 200 +- src/librustc_typeck/check/assoc.rs | 2 +- src/librustc_typeck/check/callee.rs | 47 +- src/librustc_typeck/check/cast.rs | 38 +- src/librustc_typeck/check/closure.rs | 29 +- src/librustc_typeck/check/coercion.rs | 51 +- src/librustc_typeck/check/demand.rs | 6 +- src/librustc_typeck/check/dropck.rs | 286 +- src/librustc_typeck/check/intrinsic.rs | 558 ++ src/librustc_typeck/check/method/confirm.rs | 66 +- src/librustc_typeck/check/method/mod.rs | 35 +- src/librustc_typeck/check/method/probe.rs | 88 +- src/librustc_typeck/check/method/suggest.rs | 42 +- src/librustc_typeck/check/mod.rs | 1594 ++-- src/librustc_typeck/check/op.rs | 190 +- src/librustc_typeck/check/regionck.rs | 681 +- src/librustc_typeck/check/upvar.rs | 59 +- src/librustc_typeck/check/wf.rs | 141 +- src/librustc_typeck/check/wfcheck.rs | 629 ++ src/librustc_typeck/check/writeback.rs | 61 +- src/librustc_typeck/coherence/mod.rs | 105 +- src/librustc_typeck/coherence/orphan.rs | 74 +- src/librustc_typeck/coherence/overlap.rs | 58 +- src/librustc_typeck/coherence/unsafety.rs | 48 +- src/librustc_typeck/collect.rs | 800 +- src/librustc_typeck/diagnostics.rs | 1061 ++- src/librustc_typeck/lib.rs | 54 +- src/librustc_typeck/rscope.rs | 7 +- src/librustc_typeck/variance.rs | 167 +- src/librustc_unicode/char.rs | 145 +- src/librustc_unicode/lib.rs | 19 +- src/librustc_unicode/normalize.rs | 164 - src/librustc_unicode/tables.rs | 5963 +++----------- src/librustc_unicode/u_str.rs | 361 +- src/librustdoc/clean/inline.rs | 66 +- src/librustdoc/clean/mod.rs | 464 +- src/librustdoc/clean/simplify.rs | 6 +- src/librustdoc/core.rs | 37 +- src/librustdoc/doctree.rs | 119 +- src/librustdoc/html/format.rs | 56 +- src/librustdoc/html/highlight.rs | 2 +- src/librustdoc/html/layout.rs | 18 +- src/librustdoc/html/markdown.rs | 90 +- src/librustdoc/html/render.rs | 209 +- src/librustdoc/html/static/main.css | 22 +- src/librustdoc/html/static/main.js | 50 +- src/librustdoc/lib.rs | 15 +- src/librustdoc/passes.rs | 18 +- src/librustdoc/plugins.rs | 2 - src/librustdoc/test.rs | 9 +- src/librustdoc/visit_ast.rs | 107 +- src/libserialize/collection_impls.rs | 31 +- src/libserialize/json.rs | 118 +- src/libserialize/lib.rs | 10 +- src/libserialize/serialize.rs | 4 +- src/libstd/ascii.rs | 105 +- src/libstd/collections/hash/map.rs | 98 +- src/libstd/collections/hash/mod.rs | 8 + src/libstd/collections/hash/set.rs | 111 +- src/libstd/collections/hash/state.rs | 3 +- src/libstd/collections/hash/table.rs | 28 +- src/libstd/collections/mod.rs | 45 +- src/libstd/dynamic_lib.rs | 5 +- src/libstd/env.rs | 55 +- src/libstd/error.rs | 7 +- src/libstd/ffi/c_str.rs | 74 +- src/libstd/ffi/os_str.rs | 41 +- src/libstd/fs.rs | 108 +- src/libstd/io/buffered.rs | 149 +- src/libstd/io/cursor.rs | 2 - src/libstd/io/error.rs | 27 +- src/libstd/io/impls.rs | 23 +- src/libstd/io/lazy.rs | 9 +- src/libstd/io/mod.rs | 159 +- src/libstd/io/stdio.rs | 20 +- src/libstd/io/util.rs | 18 +- src/libstd/lib.rs | 73 +- src/libstd/macros.rs | 35 +- src/libstd/net/addr.rs | 4 +- src/libstd/net/ip.rs | 5 +- src/libstd/net/mod.rs | 12 +- src/libstd/net/parser.rs | 22 +- src/libstd/net/tcp.rs | 45 +- src/libstd/net/udp.rs | 79 +- src/libstd/num/f32.rs | 136 +- src/libstd/num/f64.rs | 81 +- src/libstd/num/i16.rs | 19 - src/libstd/num/i64.rs | 19 - src/libstd/num/mod.rs | 1 - src/libstd/num/u16.rs | 19 - src/libstd/num/u32.rs | 19 - src/libstd/num/u64.rs | 19 - src/libstd/num/uint_macros.rs | 50 - src/libstd/os/android/raw.rs | 3 +- src/libstd/os/dragonfly/raw.rs | 8 +- src/libstd/os/raw.rs | 6 +- src/libstd/panicking.rs | 3 +- src/libstd/path.rs | 101 +- src/libstd/prelude/mod.rs | 4 +- src/libstd/primitive_docs.rs | 2 - src/libstd/process.rs | 3 +- src/libstd/rand/mod.rs | 4 +- src/libstd/rand/os.rs | 14 +- src/libstd/rand/reader.rs | 5 +- src/libstd/rt.rs | 65 + src/libstd/rt/backtrace.rs | 78 - src/libstd/rt/macros.rs | 51 - src/libstd/rt/mod.rs | 177 - src/libstd/sync/condvar.rs | 97 +- src/libstd/sync/future.rs | 232 - src/libstd/sync/mod.rs | 8 +- src/libstd/sync/mpsc/mod.rs | 10 +- src/libstd/sync/mpsc/mpsc_queue.rs | 2 - src/libstd/sync/mpsc/oneshot.rs | 2 - src/libstd/sync/mpsc/select.rs | 10 +- src/libstd/sync/mpsc/shared.rs | 2 - src/libstd/sync/mpsc/spsc_queue.rs | 9 +- src/libstd/sync/mpsc/stream.rs | 11 +- src/libstd/sync/mpsc/sync.rs | 14 +- src/libstd/sync/mutex.rs | 16 +- src/libstd/sync/once.rs | 2 - src/libstd/sync/rwlock.rs | 9 +- src/libstd/sync/semaphore.rs | 3 +- src/libstd/{rt => sys/common}/args.rs | 88 +- src/libstd/{rt => sys/common}/at_exit_imp.rs | 13 +- src/libstd/sys/common/backtrace.rs | 90 +- src/libstd/{rt => sys/common}/dwarf/eh.rs | 4 +- src/libstd/{rt => sys/common}/dwarf/mod.rs | 0 src/libstd/sys/common/gnu/libbacktrace.rs | 206 + .../sys/common/gnu/mod.rs} | 8 +- src/libstd/{rt => sys/common}/libunwind.rs | 2 + src/libstd/sys/common/mod.rs | 53 +- src/libstd/sys/common/net.rs | 107 +- src/libstd/sys/common/poison.rs | 2 - src/libstd/sys/common/remutex.rs | 43 +- src/libstd/sys/common/stack.rs | 311 - src/libstd/sys/common/thread.rs | 7 - src/libstd/sys/common/thread_info.rs | 2 - src/libstd/sys/common/thread_local.rs | 4 +- src/libstd/{rt => sys/common}/unwind/gcc.rs | 10 +- src/libstd/{rt => sys/common}/unwind/mod.rs | 19 +- src/libstd/{rt => sys/common}/unwind/seh.rs | 13 +- .../{rt => sys/common}/unwind/seh64_gnu.rs | 17 +- src/libstd/{rt => sys/common}/util.rs | 21 +- src/libstd/sys/common/wtf8.rs | 31 +- src/libstd/sys/unix/backtrace.rs | 586 -- src/libstd/sys/unix/backtrace/mod.rs | 91 + .../sys/unix/backtrace/printing/dladdr.rs | 41 + .../sys/unix/backtrace/printing/gnu.rs} | 5 +- src/libstd/sys/unix/backtrace/printing/mod.rs | 19 + .../unix/backtrace/tracing/backtrace_fn.rs | 54 + .../sys/unix/backtrace/tracing/gcc_s.rs | 227 + src/libstd/sys/unix/backtrace/tracing/mod.rs | 18 + src/libstd/sys/unix/condvar.rs | 2 - src/libstd/sys/unix/ext/fs.rs | 49 +- src/libstd/sys/unix/ext/io.rs | 7 +- src/libstd/sys/unix/ext/mod.rs | 2 +- src/libstd/sys/unix/ext/process.rs | 19 +- src/libstd/sys/unix/fd.rs | 2 - src/libstd/sys/unix/fs.rs | 60 +- src/libstd/sys/unix/mod.rs | 24 +- src/libstd/sys/unix/mutex.rs | 2 - src/libstd/sys/unix/net.rs | 32 +- src/libstd/sys/unix/os.rs | 32 +- src/libstd/sys/unix/os_str.rs | 2 - src/libstd/sys/unix/pipe.rs | 2 - src/libstd/sys/unix/process.rs | 12 +- src/libstd/sys/unix/rwlock.rs | 2 - src/libstd/sys/unix/stack_overflow.rs | 81 +- src/libstd/sys/unix/stdio.rs | 8 +- src/libstd/sys/unix/sync.rs | 10 +- src/libstd/sys/unix/thread.rs | 11 +- src/libstd/sys/unix/thread_local.rs | 3 +- src/libstd/sys/windows/backtrace.rs | 77 +- src/libstd/sys/windows/c.rs | 30 +- src/libstd/sys/windows/condvar.rs | 2 - src/libstd/sys/windows/ext/fs.rs | 5 +- src/libstd/sys/windows/ext/io.rs | 10 +- src/libstd/sys/windows/ext/mod.rs | 2 +- src/libstd/sys/windows/fs.rs | 32 +- src/libstd/sys/windows/handle.rs | 2 - src/libstd/sys/windows/mod.rs | 12 +- src/libstd/sys/windows/net.rs | 11 +- src/libstd/sys/windows/os.rs | 22 +- src/libstd/sys/windows/pipe.rs | 5 +- .../sys/windows/printing/gnu.rs} | 20 +- src/libstd/sys/windows/printing/msvc.rs | 58 + src/libstd/sys/windows/rwlock.rs | 2 - src/libstd/sys/windows/stack_overflow.rs | 103 +- src/libstd/sys/windows/thread.rs | 13 +- src/libstd/sys/windows/thread_local.rs | 44 +- src/libstd/thread/local.rs | 21 +- src/libstd/thread/mod.rs | 206 +- src/libstd/thread/scoped_tls.rs | 18 +- src/libstd/time/duration.rs | 22 +- src/libsyntax/abi.rs | 2 + src/libsyntax/ast.rs | 121 +- src/libsyntax/ast_util.rs | 95 +- src/libsyntax/attr.rs | 51 +- src/libsyntax/codemap.rs | 48 +- src/libsyntax/config.rs | 28 +- src/libsyntax/diagnostic.rs | 59 +- src/libsyntax/diagnostics/macros.rs | 12 + src/libsyntax/diagnostics/plugin.rs | 2 +- src/libsyntax/entry.rs | 44 + src/libsyntax/ext/asm.rs | 9 +- src/libsyntax/ext/base.rs | 116 +- src/libsyntax/ext/build.rs | 82 +- src/libsyntax/ext/cfg.rs | 3 +- src/libsyntax/ext/concat.rs | 4 +- src/libsyntax/ext/concat_idents.rs | 1 + src/libsyntax/ext/deriving/bounds.rs | 10 +- src/libsyntax/ext/deriving/clone.rs | 8 +- src/libsyntax/ext/deriving/cmp/eq.rs | 1 + src/libsyntax/ext/deriving/cmp/ord.rs | 13 +- src/libsyntax/ext/deriving/cmp/partial_eq.rs | 1 + src/libsyntax/ext/deriving/cmp/partial_ord.rs | 13 +- src/libsyntax/ext/deriving/decodable.rs | 8 +- src/libsyntax/ext/deriving/default.rs | 8 +- src/libsyntax/ext/deriving/encodable.rs | 6 +- src/libsyntax/ext/deriving/generic/mod.rs | 35 +- src/libsyntax/ext/deriving/hash.rs | 8 +- src/libsyntax/ext/deriving/mod.rs | 13 +- src/libsyntax/ext/deriving/primitive.rs | 1 + src/libsyntax/ext/deriving/show.rs | 1 + src/libsyntax/ext/env.rs | 10 +- src/libsyntax/ext/expand.rs | 242 +- src/libsyntax/ext/format.rs | 31 +- src/libsyntax/ext/log_syntax.rs | 1 + src/libsyntax/ext/source_util.rs | 2 +- src/libsyntax/ext/trace_macros.rs | 1 + src/libsyntax/ext/tt/macro_parser.rs | 112 +- src/libsyntax/ext/tt/macro_rules.rs | 30 +- src/libsyntax/ext/tt/transcribe.rs | 2 +- src/libsyntax/feature_gate.rs | 558 +- src/libsyntax/fold.rs | 23 +- src/libsyntax/lib.rs | 9 +- src/libsyntax/parse/lexer/comments.rs | 2 +- src/libsyntax/parse/lexer/mod.rs | 8 +- src/libsyntax/parse/mod.rs | 4 +- src/libsyntax/parse/parser.rs | 176 +- src/libsyntax/parse/token.rs | 20 +- src/libsyntax/print/pprust.rs | 68 +- src/libsyntax/std_inject.rs | 65 +- src/libsyntax/test.rs | 113 +- src/libsyntax/visit.rs | 54 +- src/libterm/lib.rs | 9 +- src/libterm/terminfo/mod.rs | 8 +- src/libterm/terminfo/parm.rs | 102 +- src/libterm/terminfo/parser/compiled.rs | 30 +- src/libtest/lib.rs | 59 +- src/rt/arch/aarch64/macros.S | 11 - src/rt/arch/aarch64/morestack.S | 39 - src/rt/arch/aarch64/record_sp.S | 6 - src/rt/arch/arm/morestack.S | 70 - src/rt/arch/arm/record_sp.S | 56 - src/rt/arch/armv7/morestack.S | 70 - src/rt/arch/armv7/record_sp.S | 56 - src/rt/arch/armv7s/morestack.S | 70 - src/rt/arch/armv7s/record_sp.S | 56 - src/rt/arch/i386/morestack.S | 143 - src/rt/arch/i386/record_sp.S | 4 - src/rt/arch/mips/morestack.S | 43 - src/rt/arch/mips/record_sp.S | 40 - src/rt/arch/mipsel/morestack.S | 43 - src/rt/arch/mipsel/record_sp.S | 40 - src/rt/arch/powerpc/morestack.S | 18 - src/rt/arch/powerpc/record_sp.S | 4 - src/rt/arch/x86_64/morestack.S | 69 - src/rt/arch/x86_64/record_sp.S | 4 - src/rt/hoedown/LICENSE | 2 +- src/rt/hoedown/Makefile | 45 +- src/rt/hoedown/Makefile.win | 5 + src/rt/hoedown/README.md | 3 +- src/rt/hoedown/bin/common.h | 77 +- src/rt/hoedown/bin/hoedown.c | 591 +- src/rt/hoedown/bin/smartypants.c | 315 +- src/rt/hoedown/hoedown.def | 24 +- src/rt/hoedown/src/autolink.c | 20 +- src/rt/hoedown/src/autolink.h | 37 +- src/rt/hoedown/src/buffer.c | 233 +- src/rt/hoedown/src/buffer.h | 101 +- src/rt/hoedown/src/document.c | 919 ++- src/rt/hoedown/src/document.h | 158 +- src/rt/hoedown/src/escape.c | 145 +- src/rt/hoedown/src/escape.h | 13 +- src/rt/hoedown/src/html.c | 386 +- src/rt/hoedown/src/html.h | 70 +- src/rt/hoedown/src/html_smartypants.c | 12 +- src/rt/hoedown/src/stack.c | 66 +- src/rt/hoedown/src/stack.h | 37 +- src/rt/hoedown/src/version.c | 8 +- src/rt/hoedown/src/version.h | 21 +- .../hoedown/test/Tests/Escape character.html | 51 + .../hoedown/test/Tests/Escape character.text | 51 + .../Formatting in Table of Contents.html | 15 + .../Formatting in Table of Contents.text | 5 + src/rt/hoedown/test/Tests/Math.html | 31 + src/rt/hoedown/test/Tests/Math.text | 31 + src/rt/hoedown/test/Tests/Table.html | 66 + src/rt/hoedown/test/Tests/Table.text | 21 + src/rt/hoedown/test/Tests/Underline.html | 1 + src/rt/hoedown/test/Tests/Underline.text | 1 + src/rt/hoedown/test/config.json | 116 + src/rt/hoedown/test/runner.py | 107 + src/rt/hoedown/test/runner.sh | 50 - src/rt/rust_builtin.c | 18 +- src/rustbook/book.rs | 2 +- src/rustbook/build.rs | 14 +- src/rustbook/static/rustbook.css | 4 +- src/rustllvm/ExecutionEngineWrapper.cpp | 16 - src/rustllvm/llvm-auto-clean-trigger | 2 +- src/snapshots.txt | 13 + src/test/auxiliary/allocator-dummy.rs | 55 + .../auxiliary/allocator-dylib.rs} | 8 +- .../auxiliary/allocator-dylib2.rs} | 6 +- src/test/auxiliary/allocator1.rs | 16 + src/test/auxiliary/allocator2.rs | 16 + src/test/auxiliary/allocator3.rs | 19 + src/test/auxiliary/crate_a1.rs | 21 + src/test/auxiliary/crate_a2.rs | 17 + src/test/auxiliary/custom_derive_plugin.rs | 1 + .../auxiliary/custom_derive_plugin_attr.rs | 1 + src/test/auxiliary/fat_drop.rs | 23 + src/test/auxiliary/inherited_stability.rs | 4 +- src/test/auxiliary/internal_unstable.rs | 8 +- src/test/auxiliary/issue-25185-1.rs | 3 + src/test/auxiliary/issue-25467.rs | 20 + src/test/auxiliary/issue13507.rs | 1 - src/test/auxiliary/lang-item-public.rs | 3 - src/test/auxiliary/lint_for_crate.rs | 6 +- src/test/auxiliary/lint_group_plugin_test.rs | 6 +- src/test/auxiliary/lint_output_format.rs | 6 +- src/test/auxiliary/lint_plugin_test.rs | 7 +- src/test/auxiliary/lint_stability.rs | 42 +- src/test/auxiliary/lint_stability_fields.rs | 26 +- src/test/auxiliary/macro_crate_test.rs | 12 - src/test/auxiliary/msvc-data-only-lib.rs | 15 + src/test/auxiliary/needs_allocator.rs | 16 + src/test/auxiliary/stability_cfg2.rs | 2 +- src/test/auxiliary/use_from_trait_xc.rs | 6 + src/test/auxiliary/weak-lang-items.rs | 5 +- src/test/bench/core-set.rs | 13 - src/test/bench/msgsend-ring-mutex-arcs.rs | 11 +- src/test/bench/shootout-fasta-redux.rs | 25 +- src/test/bench/shootout-k-nucleotide.rs | 21 +- src/test/bench/shootout-reverse-complement.rs | 5 +- src/test/bench/shootout-spectralnorm.rs | 7 +- src/test/bench/std-smallintmap.rs | 61 - ...orrowck-loan-of-static-data-issue-27616.rs | 34 + src/test/codegen/extern-functions.rs | 23 + src/test/codegen/intrinsic-no-unnamed-attr.rs | 22 + src/test/codegen/loads.rs | 8 +- src/test/codegen/stores.rs | 4 +- src/test/compile-fail-fulldeps/issue-18986.rs | 2 +- src/test/compile-fail-fulldeps/qquote.rs | 3 +- .../allocator-depends-on-needs-allocators.rs} | 14 +- .../compile-fail/allocator-dylib-is-system.rs | 30 + .../allocator-rust-dylib-is-jemalloc.rs | 29 + ...ed-types-ICE-when-projecting-out-of-err.rs | 5 +- .../compile-fail/associated-types-outlives.rs | 38 + .../compile-fail/associated-types-path-2.rs | 1 - ...related-trait-in-method-without-default.rs | 39 + src/test/compile-fail/borrowck-in-static.rs | 22 + .../borrowck-move-out-of-static-item.rs | 5 +- .../borrowck-struct-update-with-dtor.rs | 7 +- src/test/compile-fail/cast-rfc0401.rs | 2 +- ...cast-to-unsized-trait-object-suggestion.rs | 8 +- ...ure-bounds-static-cant-capture-borrowed.rs | 4 +- .../compile-fail/coerce-unsafe-to-closure.rs | 1 - ...erence-impl-trait-for-trait-object-safe.rs | 19 + .../coherence-impl-trait-for-trait.rs | 5 - src/test/compile-fail/concat.rs | 4 +- .../compile-fail/const-eval-overflow-4b.rs | 2 - src/test/compile-fail/double-import.rs | 4 +- src/test/compile-fail/dropck-object-cycle.rs | 57 + src/test/compile-fail/fat-ptr-cast.rs | 2 +- .../compile-fail/feature-gate-allocator.rs | 13 + .../feature-gate-cfg-target-feature.rs | 21 + .../compile-fail/feature-gate-linked-from.rs | 16 + .../feature-gate-needs-allocator.rs | 14 + .../compile-fail/feature-gate-repr-simd.rs | 14 + .../compile-fail/feature-gate-rustc-attrs.rs | 6 +- .../compile-fail/feature-gate-simd-ffi.rs | 6 +- src/test/compile-fail/fn-variance-1.rs | 2 - src/test/compile-fail/for-expn-2.rs | 2 +- src/test/compile-fail/for-loop-bogosity.rs | 3 - src/test/compile-fail/hygienic-label-1.rs | 4 +- src/test/compile-fail/hygienic-label-3.rs | 4 +- src/test/compile-fail/import-shadow-6.rs | 4 +- .../compile-fail/indexing-requires-a-uint.rs | 1 - .../compile-fail/infinite-instantiation.rs | 2 +- src/test/compile-fail/integral-indexing.rs | 8 - .../intrinsic-invalid-number-of-arguments.rs | 24 + src/test/compile-fail/invalid-plugin-attr.rs | 17 + src/test/compile-fail/issue-11771.rs | 2 - src/test/compile-fail/issue-12997-2.rs | 2 +- src/test/compile-fail/issue-13352.rs | 11 +- src/test/compile-fail/issue-14084.rs | 1 - src/test/compile-fail/issue-15034.rs | 2 +- src/test/compile-fail/issue-16250.rs | 4 +- src/test/compile-fail/issue-16747.rs | 2 +- src/test/compile-fail/issue-17001.rs | 15 + .../compile-fail/issue-17718-static-move.rs | 6 +- src/test/compile-fail/issue-17994.rs | 13 + src/test/compile-fail/issue-18389.rs | 5 +- src/test/compile-fail/issue-18959.rs | 3 +- src/test/compile-fail/issue-1920-1.rs | 22 + src/test/compile-fail/issue-1920-2.rs | 20 + src/test/compile-fail/issue-1920-3.rs | 24 + src/test/compile-fail/issue-19380.rs | 2 +- src/test/compile-fail/issue-19538.rs | 3 +- src/test/compile-fail/issue-19660.rs | 4 +- src/test/compile-fail/issue-20005.rs | 1 + src/test/compile-fail/issue-20427.rs | 2 + src/test/compile-fail/issue-20605.rs | 3 - src/test/compile-fail/issue-20692.rs | 23 + src/test/compile-fail/issue-21449.rs | 15 + src/test/compile-fail/issue-2149.rs | 1 - src/test/compile-fail/issue-22638.rs | 67 + src/test/compile-fail/issue-22645.rs | 4 +- src/test/compile-fail/issue-22872.rs | 36 + src/test/compile-fail/issue-23024.rs | 23 + src/test/compile-fail/issue-23041.rs | 3 +- src/test/compile-fail/issue-23046.rs | 30 + src/test/compile-fail/issue-24013.rs | 2 +- src/test/compile-fail/issue-24352.rs | 1 - src/test/compile-fail/issue-24682.rs | 31 + src/test/compile-fail/issue-27592.rs | 29 + .../issue-27815.rs} | 17 +- src/test/compile-fail/issue-27831.rs | 34 + src/test/compile-fail/issue-28098.rs | 35 + .../compile-fail/issue-28105.rs} | 15 +- .../compile-fail/issue-28109.rs} | 17 +- src/test/compile-fail/issue-28113.rs | 15 + src/test/compile-fail/issue-28344.rs | 21 + src/test/compile-fail/issue-28568.rs | 23 + src/test/compile-fail/issue-3907-2.rs | 3 +- src/test/compile-fail/issue-4736.rs | 2 +- src/test/compile-fail/issue-7970a.rs | 14 + src/test/compile-fail/issue-7970b.rs | 14 + src/test/compile-fail/issue-8208.rs | 12 +- .../kindck-inherited-copy-bound.rs | 4 +- src/test/compile-fail/lang-item-missing.rs | 4 +- src/test/compile-fail/lint-ctypes.rs | 9 +- src/test/compile-fail/lint-dead-code-1.rs | 3 - src/test/compile-fail/lint-missing-doc.rs | 21 + .../compile-fail/lint-stability-fields.rs | 24 +- src/test/compile-fail/lint-stability.rs | 46 +- .../loops-reject-duplicate-labels-2.rs | 2 +- .../macro-backtrace-invalid-internals.rs | 18 +- .../compile-fail/macro-backtrace-nested.rs | 4 +- .../compile-fail/macro-backtrace-println.rs | 9 +- .../compile-fail/macro-match-nonterminal.rs | 2 +- .../compile-fail/method-macro-backtrace.rs | 2 +- src/test/compile-fail/missing-stability.rs | 2 +- src/test/compile-fail/no-core-gated.rs | 13 + src/test/compile-fail/no-std-inject.rs | 17 + .../compile-fail/no_owned_box_lang_item.rs | 3 - .../non-constant-in-const-path.rs | 18 + .../compile-fail/object-safety-generics.rs | 5 +- .../compile-fail/object-safety-issue-22040.rs | 7 +- .../object-safety-mentions-Self.rs | 10 +- .../compile-fail/object-safety-no-static.rs | 5 +- .../compile-fail/object-safety-sized-2.rs | 5 +- src/test/compile-fail/object-safety-sized.rs | 5 +- .../object-safety-supertrait-mentions-Self.rs | 2 +- src/test/compile-fail/privacy1.rs | 4 +- src/test/compile-fail/privacy2.rs | 4 +- src/test/compile-fail/privacy3.rs | 4 +- src/test/compile-fail/privacy4.rs | 4 +- src/test/compile-fail/privacy5.rs | 18 +- ...c-type-in-supertrait-outlives-container.rs | 2 +- ...gions-close-associated-type-into-object.rs | 9 +- .../regions-close-object-into-object-1.rs | 2 +- .../regions-close-object-into-object-2.rs | 2 +- .../regions-close-object-into-object-3.rs | 2 +- .../regions-close-object-into-object-4.rs | 2 +- .../regions-close-object-into-object-5.rs | 11 +- src/test/compile-fail/regions-enum-not-wf.rs | 14 +- ...regions-implied-bounds-projection-gap-1.rs | 40 + ...regions-implied-bounds-projection-gap-2.rs | 33 + ...regions-implied-bounds-projection-gap-3.rs | 33 + ...regions-implied-bounds-projection-gap-4.rs | 33 + ...ions-implied-bounds-projection-gap-hr-1.rs | 39 + ...s-outlives-nominal-type-enum-region-rev.rs | 29 + ...gions-outlives-nominal-type-enum-region.rs | 29 + ...ons-outlives-nominal-type-enum-type-rev.rs | 29 + ...regions-outlives-nominal-type-enum-type.rs | 29 + ...outlives-nominal-type-struct-region-rev.rs | 29 + ...ons-outlives-nominal-type-struct-region.rs | 29 + ...s-outlives-nominal-type-struct-type-rev.rs | 29 + ...gions-outlives-nominal-type-struct-type.rs | 29 + ...ons-outlives-projection-container-hrtb.rs} | 11 +- ...gions-outlives-projection-container-wc.rs} | 3 +- ... regions-outlives-projection-container.rs} | 13 +- .../regions-outlives-projection-hrtype.rs | 36 + .../regions-outlives-projection-trait-def.rs | 31 + .../compile-fail/regions-outlives-scalar.rs | 23 + .../compile-fail/regions-struct-not-wf.rs | 11 +- .../compile-fail/regions-wf-trait-object.rs | 21 + .../reject-specialized-drops-8142.rs | 8 +- src/test/compile-fail/required-lang-item.rs | 4 +- .../compile-fail/rfc1214-warn-and-error.rs | 37 + .../send-is-not-static-ensures-scoping.rs | 14 +- .../compile-fail/shift-various-bad-types.rs | 3 - src/test/compile-fail/simd-binop.rs | 37 - .../simd-intrinsic-declaration-type.rs | 68 + .../simd-intrinsic-generic-arithmetic.rs | 102 + .../simd-intrinsic-generic-cast.rs | 51 + .../simd-intrinsic-generic-comparison.rs | 75 + .../simd-intrinsic-generic-elements.rs | 97 + .../simd-intrinsic-single-nominal-type.rs | 33 + .../simd-type-generic-monomorphisation.rs | 21 + src/test/compile-fail/simd-type.rs | 11 +- .../stability-attribute-sanity.rs | 13 +- .../compile-fail/static-items-cant-move.rs | 6 +- src/test/compile-fail/str-idx.rs | 1 - src/test/compile-fail/str-mut-idx.rs | 1 - src/test/compile-fail/struct-field-privacy.rs | 4 +- .../structure-constructor-type-mismatch.rs | 51 +- .../compile-fail/suggest-private-fields.rs | 4 +- src/test/compile-fail/test-warns-dead-code.rs | 17 + .../trait-as-struct-constructor.rs | 2 +- ...ait-bounds-on-structs-and-enums-in-fns.rs} | 25 +- ...it-bounds-on-structs-and-enums-in-impls.rs | 35 + .../trait-bounds-on-structs-and-enums.rs | 17 - src/test/compile-fail/trait-object-safety.rs | 3 +- src/test/compile-fail/trait-test-2.rs | 6 +- .../traits-issue-23003-overflow.rs | 15 +- .../compile-fail/traits-negative-impls.rs | 15 +- src/test/compile-fail/two-allocators-2.rs | 21 + src/test/compile-fail/two-allocators-3.rs | 22 + src/test/compile-fail/two-allocators.rs | 19 + .../compile-fail/ty_binding_span.rs} | 13 +- src/test/compile-fail/type-macros-fail.rs | 22 + .../type-mismatch-same-crate-name.rs | 33 + ...rameter-defaults-referencing-Self-ppaux.rs | 3 +- .../unboxed-closures-unsafe-extern-fn.rs | 1 - .../unboxed-closures-wrong-abi.rs | 1 - ...boxed-closures-wrong-arg-type-extern-fn.rs | 1 - src/test/compile-fail/unresolved-import.rs | 16 +- .../unspecified-self-in-trait-ref.rs | 30 + src/test/compile-fail/use-from-trait-xc.rs | 9 + src/test/compile-fail/use-from-trait.rs | 13 + .../compile-fail/variance-regions-direct.rs | 4 +- .../compile-fail/warn-pub-extern-crate.rs | 18 + src/test/compile-fail/weak-lang-item.rs | 1 - src/test/compile-fail/wf-array-elem-sized.rs | 21 + src/test/compile-fail/wf-const-type.rs | 24 + src/test/compile-fail/wf-enum-bound.rs | 26 + .../wf-enum-fields-struct-variant.rs} | 23 +- src/test/compile-fail/wf-enum-fields.rs | 26 + src/test/compile-fail/wf-fn-where-clause.rs | 24 + .../wf-impl-associated-type-region.rs | 24 + .../wf-impl-associated-type-trait.rs | 33 + src/test/compile-fail/wf-in-fn-arg.rs | 24 + src/test/compile-fail/wf-in-fn-ret.rs | 24 + src/test/compile-fail/wf-in-fn-type-arg.rs | 22 + src/test/compile-fail/wf-in-fn-type-ret.rs | 22 + src/test/compile-fail/wf-in-fn-type-static.rs | 32 + .../compile-fail/wf-in-fn-where-clause.rs | 25 + .../compile-fail/wf-in-obj-type-static.rs | 28 + src/test/compile-fail/wf-in-obj-type-trait.rs | 24 + .../wf-inherent-impl-method-where-clause.rs | 27 + .../wf-inherent-impl-where-clause.rs | 26 + src/test/compile-fail/wf-object-safe.rs | 20 + .../wf-outlives-ty-in-fn-or-trait.rs | 32 + src/test/compile-fail/wf-static-type.rs | 24 + src/test/compile-fail/wf-struct-bound.rs | 26 + src/test/compile-fail/wf-struct-field.rs | 26 + .../wf-trait-associated-type-bound.rs | 24 + .../wf-trait-associated-type-region.rs | 24 + .../wf-trait-associated-type-trait.rs} | 25 +- src/test/compile-fail/wf-trait-bound.rs | 25 + .../compile-fail/wf-trait-default-fn-arg.rs | 29 + .../compile-fail/wf-trait-default-fn-ret.rs | 30 + .../wf-trait-default-fn-where-clause.rs | 29 + src/test/compile-fail/wf-trait-fn-arg.rs | 27 + src/test/compile-fail/wf-trait-fn-ret.rs | 27 + .../compile-fail/wf-trait-fn-where-clause.rs | 27 + src/test/compile-fail/wf-trait-superbound.rs | 23 + .../where-clauses-not-parameter.rs | 45 - src/test/parse-fail/bad-lit-suffixes.rs | 8 +- src/test/parse-fail/better-expected.rs | 2 +- src/test/parse-fail/empty-impl-semicolon.rs | 2 +- .../macro-repeat.rs} | 12 +- src/test/parse-fail/multitrait.rs | 2 +- .../removed-syntax-closure-lifetime.rs | 3 +- .../parse-fail/removed-syntax-fixed-vec.rs | 2 +- .../parse-fail/removed-syntax-mut-vec-ty.rs | 2 +- .../parse-fail/removed-syntax-ptr-lifetime.rs | 2 +- .../parse-fail/removed-syntax-uniq-mut-ty.rs | 2 +- ...{trait-keyword.rs => tuple-float-index.rs} | 7 +- src/test/parse-fail/virtual-structs.rs | 5 +- src/test/pretty/blank-lines.rs | 2 + .../block-comment-multiple-asterisks.rs | 2 + .../block-comment-trailing-whitespace.rs | 2 + .../block-comment-trailing-whitespace2.rs | 2 + src/test/pretty/block-disambig.rs | 2 + src/test/pretty/doc-comments.rs | 2 + src/test/pretty/empty-impl.pp | 5 - src/test/pretty/empty-impl.rs | 2 + src/test/pretty/empty-lines.rs | 2 + src/test/pretty/for-comment.rs | 2 + src/test/pretty/import-renames.rs | 16 + src/test/pretty/issue-4264.pp | 4 +- src/test/pretty/issue-4264.rs | 2 +- src/test/pretty/unary-op-disambig.rs | 2 + src/test/run-fail-fulldeps/qquote.rs | 7 +- ...owing-simd-lsh-3.rs => overflowing-pow.rs} | 11 +- src/test/run-fail/overflowing-simd-lsh-4.rs | 49 - src/test/run-fail/overflowing-simd-rsh-2.rs | 23 - src/test/run-fail/overflowing-simd-rsh-4.rs | 49 - src/test/run-fail/rt-set-exit-status-panic.rs | 25 - .../run-fail/rt-set-exit-status-panic2.rs | 44 - src/test/run-fail/rt-set-exit-status.rs | 23 - .../run-make/alloc-extern-crates/fakealloc.rs | 3 +- .../allow-warnings-cmdline-stability/bar.rs | 2 +- src/test/run-make/execution-engine/test.rs | 11 +- src/test/run-make/link-path-order/main.rs | 2 +- .../mismatching-target-triples/bar.rs | 5 +- .../mismatching-target-triples/foo.rs | 5 +- src/test/run-make/no-duplicate-libs/bar.rs | 1 - src/test/run-make/no-duplicate-libs/foo.rs | 1 - src/test/run-make/no-stack-check/Makefile | 25 - .../pretty-expanded-hygiene/input.pp.rs | 4 +- .../run-make/pretty-expanded-hygiene/input.rs | 4 +- .../pretty-print-path-suffix/Makefile | 6 +- src/test/run-make/simd-ffi/simd.rs | 16 +- .../run-make/symbols-are-reasonable/Makefile | 2 +- src/test/run-make/target-specs/Makefile | 3 - src/test/run-make/target-specs/foo.rs | 4 +- .../run-make/use-extern-for-plugins/bar.rs | 4 +- .../run-make/use-extern-for-plugins/baz.rs | 4 +- src/test/run-pass-fulldeps/compiler-calls.rs | 5 +- src/test/run-pass-fulldeps/macro-crate.rs | 7 - src/test/run-pass-fulldeps/qquote.rs | 8 +- src/test/run-pass/allocator-default.rs | 20 + src/test/run-pass/allocator-jemalloc.rs | 22 + src/test/run-pass/allocator-override.rs | 28 + src/test/run-pass/allocator-system.rs | 19 + ...ted-types-projection-to-unrelated-trait.rs | 3 +- src/test/run-pass/backtrace-debuginfo-aux.rs | 6 +- src/test/run-pass/backtrace-debuginfo.rs | 50 +- src/test/run-pass/backtrace.rs | 7 +- src/test/run-pass/binary-heap-panic-safe.rs | 2 +- src/test/run-pass/bitv-perf-test.rs | 25 - src/test/run-pass/cleanup-arm-conditional.rs | 10 - src/test/run-pass/cleanup-shortcircuit.rs | 10 - src/test/run-pass/derive-no-std.rs | 3 +- src/test/run-pass/deriving-hash.rs | 6 +- src/test/run-pass/down-with-thread-dtors.rs | 9 + src/test/run-pass/dropck_legal_cycles.rs | 11 +- src/test/run-pass/dst-coerce-rc.rs | 5 +- src/test/run-pass/enum-null-pointer-opt.rs | 7 + src/test/run-pass/exit-flushes.rs | 25 + src/test/run-pass/extern_fat_drop.rs | 23 + .../for-loop-macro.rs} | 16 +- src/test/run-pass/for-loop-no-std.rs | 7 +- src/test/run-pass/foreign-call-no-runtime.rs | 32 +- .../foreign-int-types.rs} | 5 +- src/test/run-pass/format-no-std.rs | 3 +- src/test/run-pass/fsu-moves-and-copies.rs | 6 +- src/test/run-pass/import-glob-1.rs | 34 + src/test/run-pass/import-rename.rs | 21 + src/test/run-pass/issue-11709.rs | 8 +- src/test/run-pass/issue-11736.rs | 35 - src/test/run-pass/issue-14254.rs | 2 +- src/test/run-pass/issue-16530.rs | 10 +- src/test/run-pass/issue-17170.rs | 4 +- src/test/run-pass/issue-17897.rs | 6 +- src/test/run-pass/issue-18083.rs | 32 + src/test/run-pass/issue-18188.rs | 12 +- src/test/run-pass/issue-19102.rs | 20 + src/test/run-pass/issue-20803.rs | 19 + src/test/run-pass/issue-21058.rs | 4 +- src/test/run-pass/issue-2190-1.rs | 7 +- .../issue-22992-2.rs} | 18 +- src/test/run-pass/issue-22992.rs | 85 + src/test/run-pass/issue-23208.rs | 35 + .../{issue-24258.rs => issue-23304-1.rs} | 26 +- src/test/run-pass/issue-23304-2.rs | 17 + src/test/run-pass/issue-23442.rs | 31 + src/test/run-pass/issue-23808.rs | 68 + .../issue-25467.rs} | 9 +- src/test/run-pass/issue-26205.rs | 39 + .../issue-27054-primitive-binary-ops.rs | 14 + src/test/run-pass/issue-27583.rs | 56 + src/test/run-pass/issue-27639.rs | 19 + src/test/run-pass/issue-27859.rs | 27 + src/test/run-pass/issue-27890.rs | 16 + src/test/run-pass/issue-27997.rs | 48 + src/test/run-pass/issue-28181.rs | 15 + src/test/run-pass/issue-28550.rs | 25 + src/test/run-pass/issue-28871.rs | 33 + src/test/run-pass/issue-4865-1.rs | 41 + src/test/run-pass/issue-4865-2.rs | 33 + src/test/run-pass/issue-4865-3.rs | 25 + src/test/run-pass/issue-5708.rs | 2 +- .../run-pass/minmax-stability-issue-23687.rs | 10 - src/test/run-pass/msvc-data-only.rs | 17 + src/test/run-pass/no-core-1.rs | 22 + src/test/run-pass/no-std-1.rs | 19 + src/test/run-pass/no-std-2.rs | 19 + src/test/run-pass/no-std-3.rs | 26 + .../out-of-stack-new-thread-no-split.rs | 50 - src/test/run-pass/out-of-stack-no-split.rs | 47 - src/test/run-pass/out-of-stack.rs | 39 +- .../run-pass/project-defer-unification.rs | 105 + src/test/run-pass/raw-fat-ptr.rs | 127 + .../regions-early-bound-trait-param.rs | 7 +- ...n-outlives-static-outlives-free-region.rs} | 20 +- src/test/run-pass/segfault-no-out-of-stack.rs | 13 +- .../run-pass/send-is-not-static-par-for.rs | 14 +- src/test/run-pass/simd-binop.rs | 76 - src/test/run-pass/simd-generics.rs | 10 +- .../simd-intrinsic-generic-arithmetic.rs | 111 + .../run-pass/simd-intrinsic-generic-cast.rs | 128 + .../simd-intrinsic-generic-comparison.rs | 113 + .../simd-intrinsic-generic-elements.rs | 132 + src/test/run-pass/simd-shift-near-oflo.rs | 154 - src/test/run-pass/simd-size-align.rs | 44 +- src/test/run-pass/simd-type.rs | 4 +- src/test/run-pass/smallest-hello-world.rs | 6 +- .../run-pass/std-sync-right-kind-impls.rs | 2 +- src/test/run-pass/struct-aliases.rs | 38 + src/test/run-pass/sync-send-in-std.rs | 31 + .../sync-send-iterators-in-libcollections.rs | 21 +- .../sync-send-iterators-in-libcore.rs | 3 +- src/test/run-pass/test-main-not-dead-attr.rs | 18 + src/test/run-pass/test-main-not-dead.rs | 15 + .../run-pass/test-runner-hides-buried-main.rs | 24 + src/test/run-pass/test-runner-hides-start.rs | 16 + .../tls-dtors-are-run-in-a-static-binary.rs | 30 + src/test/run-pass/type-macros-hlist.rs | 89 + src/test/run-pass/type-macros-simple.rs | 19 + src/test/run-pass/typeid-intrinsic.rs | 13 +- src/test/run-pass/ufcs-polymorphic-paths.rs | 40 +- src/test/run-pass/unfold-cross-crate.rs | 36 - .../uninstantiable-struct.rs} | 3 +- src/test/run-pass/use.rs | 7 +- src/test/run-pass/variadic-ffi.rs | 1 + src/test/run-pass/vec-macro-no-std.rs | 4 +- src/test/run-pass/while-let.rs | 2 +- .../run-pass/zero-sized-tuple-struct.rs} | 14 +- src/test/rustdoc/issue-23511.rs | 2 - src/test/rustdoc/issue-27759.rs | 25 + src/test/rustdoc/issue-27862.rs | 15 + src/test/rustdoc/variadic.rs | 14 + src/test/rustdoc/viewpath-rename.rs | 28 + 1270 files changed, 78927 insertions(+), 47763 deletions(-) create mode 100644 mk/cfg/i686-linux-android.mk rename src/doc/trpl/{academic-research.md => bibliography.md} (89%) create mode 100644 src/etc/dec2flt_table.py create mode 100644 src/etc/platform-intrinsics/aarch64.json create mode 100644 src/etc/platform-intrinsics/arm.json create mode 100644 src/etc/platform-intrinsics/generator.py create mode 100644 src/etc/platform-intrinsics/x86/avx.json create mode 100644 src/etc/platform-intrinsics/x86/avx2.json create mode 100644 src/etc/platform-intrinsics/x86/info.json create mode 100644 src/etc/platform-intrinsics/x86/sse.json create mode 100644 src/etc/platform-intrinsics/x86/sse2.json create mode 100644 src/etc/platform-intrinsics/x86/sse3.json create mode 100644 src/etc/platform-intrinsics/x86/sse41.json create mode 100644 src/etc/platform-intrinsics/x86/sse42.json create mode 100644 src/etc/platform-intrinsics/x86/ssse3.json create mode 100644 src/etc/test-float-parse/_common.rs rename src/{test/run-fail/overflowing-simd-lsh-1.rs => etc/test-float-parse/few-ones.rs} (63%) rename src/{test/run-pass/issue-23037.rs => etc/test-float-parse/huge-pow10.rs} (70%) create mode 100644 src/etc/test-float-parse/many-digits.rs create mode 100644 src/etc/test-float-parse/rand-f64.rs create mode 100644 src/etc/test-float-parse/runtests.py create mode 100644 src/etc/test-float-parse/short-decimals.rs create mode 100644 src/etc/test-float-parse/subnorm.rs create mode 100644 src/etc/test-float-parse/tiny-pow10.rs create mode 100644 src/etc/test-float-parse/u32-small.rs create mode 100644 src/etc/test-float-parse/u64-pow2.rs create mode 100644 src/liballoc_jemalloc/lib.rs create mode 100644 src/liballoc_system/lib.rs create mode 100644 src/libbacktrace/pecoff.c delete mode 100644 src/libcollections/bit.rs delete mode 100644 src/libcollections/vec_map.rs delete mode 100644 src/libcollectionstest/bit/set.rs delete mode 100644 src/libcollectionstest/bit/vec.rs delete mode 100644 src/libcollectionstest/vec_map.rs create mode 100644 src/libcore/borrow.rs create mode 100644 src/libcore/num/dec2flt/algorithm.rs create mode 100644 src/libcore/num/dec2flt/mod.rs create mode 100644 src/libcore/num/dec2flt/num.rs create mode 100644 src/libcore/num/dec2flt/parse.rs create mode 100644 src/libcore/num/dec2flt/rawfp.rs create mode 100644 src/libcore/num/dec2flt/table.rs delete mode 100644 src/libcore/prelude.rs create mode 100644 src/libcore/prelude/mod.rs create mode 100644 src/libcore/prelude/v1.rs create mode 100644 src/libcore/simd_old.rs rename src/libcore/{ => sync}/atomic.rs (100%) create mode 100644 src/libcore/sync/mod.rs create mode 100644 src/libcoretest/array.rs create mode 100644 src/libcoretest/num/dec2flt/mod.rs create mode 100644 src/libcoretest/num/dec2flt/parse.rs create mode 100644 src/libcoretest/num/dec2flt/rawfp.rs rename src/librustc/{ast_map => front/map}/blocks.rs (87%) rename src/librustc/{ast_map => front/map}/mod.rs (95%) create mode 100644 src/librustc/metadata/index.rs create mode 100644 src/librustc/metadata/inline.rs create mode 100644 src/librustc/middle/check_no_asm.rs create mode 100644 src/librustc/middle/def_id.rs create mode 100644 src/librustc/middle/traits/structural_impls.rs delete mode 100644 src/librustc/middle/ty.rs rename src/librustc/middle/{ty_match.rs => ty/_match.rs} (93%) create mode 100644 src/librustc/middle/ty/adjustment.rs rename src/librustc/middle/{ => ty}/cast.rs (92%) create mode 100644 src/librustc/middle/ty/contents.rs create mode 100644 src/librustc/middle/ty/context.rs create mode 100644 src/librustc/middle/ty/error.rs rename src/librustc/middle/{ => ty}/fast_reject.rs (79%) create mode 100644 src/librustc/middle/ty/flags.rs create mode 100644 src/librustc/middle/ty/fold.rs create mode 100644 src/librustc/middle/ty/ivar.rs create mode 100644 src/librustc/middle/ty/mod.rs create mode 100644 src/librustc/middle/ty/outlives.rs rename src/librustc/middle/{ty_relate/mod.rs => ty/relate.rs} (95%) create mode 100644 src/librustc/middle/ty/structural_impls.rs create mode 100644 src/librustc/middle/ty/sty.rs create mode 100644 src/librustc/middle/ty/util.rs rename src/librustc/middle/{ty_walk.rs => ty/walk.rs} (100%) create mode 100644 src/librustc/middle/ty/wf.rs delete mode 100644 src/librustc/middle/ty_fold.rs create mode 100644 src/librustc_back/target/i686_linux_android.rs create mode 100644 src/librustc_data_structures/fnv.rs create mode 100644 src/librustc_data_structures/ivar.rs create mode 100644 src/librustc_data_structures/transitive_relation.rs create mode 100644 src/librustc_driver/target_features.rs create mode 100644 src/librustc_front/attr.rs create mode 100644 src/librustc_front/fold.rs create mode 100644 src/librustc_front/hir.rs create mode 100644 src/librustc_front/lib.rs create mode 100644 src/librustc_front/lowering.rs create mode 100644 src/librustc_front/print/pp.rs create mode 100644 src/librustc_front/print/pprust.rs create mode 100644 src/librustc_front/util.rs create mode 100644 src/librustc_front/visit.rs create mode 100644 src/librustc_mir/build/block.rs create mode 100644 src/librustc_mir/build/cfg.rs create mode 100644 src/librustc_mir/build/expr/as_constant.rs create mode 100644 src/librustc_mir/build/expr/as_lvalue.rs create mode 100644 src/librustc_mir/build/expr/as_operand.rs create mode 100644 src/librustc_mir/build/expr/as_rvalue.rs create mode 100644 src/librustc_mir/build/expr/as_temp.rs create mode 100644 src/librustc_mir/build/expr/category.rs create mode 100644 src/librustc_mir/build/expr/into.rs create mode 100644 src/librustc_mir/build/expr/mod.rs create mode 100644 src/librustc_mir/build/into.rs create mode 100644 src/librustc_mir/build/matches/mod.rs create mode 100644 src/librustc_mir/build/matches/simplify.rs create mode 100644 src/librustc_mir/build/matches/test.rs create mode 100644 src/librustc_mir/build/matches/util.rs create mode 100644 src/librustc_mir/build/misc.rs create mode 100644 src/librustc_mir/build/mod.rs create mode 100644 src/librustc_mir/build/scope.rs create mode 100644 src/librustc_mir/build/stmt.rs create mode 100644 src/librustc_mir/dump.rs create mode 100644 src/librustc_mir/graphviz/mod.rs create mode 100644 src/librustc_mir/hair.rs create mode 100644 src/librustc_mir/lib.rs create mode 100644 src/librustc_mir/repr.rs create mode 100644 src/librustc_mir/tcx/block.rs create mode 100644 src/librustc_mir/tcx/expr.rs create mode 100644 src/librustc_mir/tcx/mod.rs create mode 100644 src/librustc_mir/tcx/pattern.rs create mode 100644 src/librustc_mir/tcx/to_ref.rs create mode 100644 src/librustc_platform_intrinsics/aarch64.rs create mode 100644 src/librustc_platform_intrinsics/arm.rs create mode 100755 src/librustc_platform_intrinsics/lib.rs create mode 100644 src/librustc_platform_intrinsics/x86.rs create mode 100644 src/librustc_privacy/diagnostics.rs create mode 100644 src/librustc_typeck/check/intrinsic.rs create mode 100644 src/librustc_typeck/check/wfcheck.rs delete mode 100644 src/librustc_unicode/normalize.rs delete mode 100644 src/libstd/num/i16.rs delete mode 100644 src/libstd/num/i64.rs delete mode 100644 src/libstd/num/u16.rs delete mode 100644 src/libstd/num/u32.rs delete mode 100644 src/libstd/num/u64.rs delete mode 100644 src/libstd/num/uint_macros.rs create mode 100644 src/libstd/rt.rs delete mode 100644 src/libstd/rt/backtrace.rs delete mode 100644 src/libstd/rt/macros.rs delete mode 100644 src/libstd/rt/mod.rs delete mode 100644 src/libstd/sync/future.rs rename src/libstd/{rt => sys/common}/args.rs (53%) rename src/libstd/{rt => sys/common}/at_exit_imp.rs (88%) rename src/libstd/{rt => sys/common}/dwarf/eh.rs (99%) rename src/libstd/{rt => sys/common}/dwarf/mod.rs (100%) create mode 100644 src/libstd/sys/common/gnu/libbacktrace.rs rename src/{test/compile-fail/array-old-syntax-2.rs => libstd/sys/common/gnu/mod.rs} (81%) rename src/libstd/{rt => sys/common}/libunwind.rs (99%) delete mode 100644 src/libstd/sys/common/stack.rs rename src/libstd/{rt => sys/common}/unwind/gcc.rs (97%) rename src/libstd/{rt => sys/common}/unwind/mod.rs (97%) rename src/libstd/{rt => sys/common}/unwind/seh.rs (95%) rename src/libstd/{rt => sys/common}/unwind/seh64_gnu.rs (93%) rename src/libstd/{rt => sys/common}/util.rs (71%) delete mode 100644 src/libstd/sys/unix/backtrace.rs create mode 100644 src/libstd/sys/unix/backtrace/mod.rs create mode 100644 src/libstd/sys/unix/backtrace/printing/dladdr.rs rename src/{test/compile-fail/gated-simd.rs => libstd/sys/unix/backtrace/printing/gnu.rs} (83%) create mode 100644 src/libstd/sys/unix/backtrace/printing/mod.rs create mode 100644 src/libstd/sys/unix/backtrace/tracing/backtrace_fn.rs create mode 100644 src/libstd/sys/unix/backtrace/tracing/gcc_s.rs create mode 100644 src/libstd/sys/unix/backtrace/tracing/mod.rs rename src/{test/run-make/no-stack-check/flag.rs => libstd/sys/windows/printing/gnu.rs} (59%) create mode 100644 src/libstd/sys/windows/printing/msvc.rs create mode 100644 src/libsyntax/entry.rs delete mode 100644 src/rt/arch/aarch64/macros.S delete mode 100644 src/rt/arch/aarch64/morestack.S delete mode 100644 src/rt/arch/aarch64/record_sp.S delete mode 100644 src/rt/arch/arm/morestack.S delete mode 100644 src/rt/arch/arm/record_sp.S delete mode 100644 src/rt/arch/armv7/morestack.S delete mode 100644 src/rt/arch/armv7/record_sp.S delete mode 100644 src/rt/arch/armv7s/morestack.S delete mode 100644 src/rt/arch/armv7s/record_sp.S delete mode 100644 src/rt/arch/i386/morestack.S delete mode 100644 src/rt/arch/i386/record_sp.S delete mode 100644 src/rt/arch/mips/morestack.S delete mode 100644 src/rt/arch/mips/record_sp.S delete mode 100644 src/rt/arch/mipsel/morestack.S delete mode 100644 src/rt/arch/mipsel/record_sp.S delete mode 100644 src/rt/arch/powerpc/morestack.S delete mode 100644 src/rt/arch/powerpc/record_sp.S delete mode 100644 src/rt/arch/x86_64/morestack.S delete mode 100644 src/rt/arch/x86_64/record_sp.S create mode 100644 src/rt/hoedown/test/Tests/Escape character.html create mode 100644 src/rt/hoedown/test/Tests/Escape character.text create mode 100644 src/rt/hoedown/test/Tests/Formatting in Table of Contents.html create mode 100644 src/rt/hoedown/test/Tests/Formatting in Table of Contents.text create mode 100644 src/rt/hoedown/test/Tests/Math.html create mode 100644 src/rt/hoedown/test/Tests/Math.text create mode 100644 src/rt/hoedown/test/Tests/Table.html create mode 100644 src/rt/hoedown/test/Tests/Table.text create mode 100644 src/rt/hoedown/test/Tests/Underline.html create mode 100644 src/rt/hoedown/test/Tests/Underline.text create mode 100644 src/rt/hoedown/test/config.json create mode 100755 src/rt/hoedown/test/runner.py delete mode 100755 src/rt/hoedown/test/runner.sh create mode 100644 src/test/auxiliary/allocator-dummy.rs rename src/{libstd/num/int_macros.rs => test/auxiliary/allocator-dylib.rs} (75%) rename src/{libcollectionstest/bit/mod.rs => test/auxiliary/allocator-dylib2.rs} (82%) create mode 100644 src/test/auxiliary/allocator1.rs create mode 100644 src/test/auxiliary/allocator2.rs create mode 100644 src/test/auxiliary/allocator3.rs create mode 100644 src/test/auxiliary/crate_a1.rs create mode 100644 src/test/auxiliary/crate_a2.rs create mode 100644 src/test/auxiliary/fat_drop.rs create mode 100644 src/test/auxiliary/issue-25467.rs create mode 100644 src/test/auxiliary/msvc-data-only-lib.rs create mode 100644 src/test/auxiliary/needs_allocator.rs delete mode 100644 src/test/bench/std-smallintmap.rs create mode 100644 src/test/borrowck-loan-of-static-data-issue-27616.rs create mode 100644 src/test/codegen/extern-functions.rs create mode 100644 src/test/codegen/intrinsic-no-unnamed-attr.rs rename src/test/{run-fail/overflowing-simd-lsh-2.rs => compile-fail/allocator-depends-on-needs-allocators.rs} (63%) create mode 100644 src/test/compile-fail/allocator-dylib-is-system.rs create mode 100644 src/test/compile-fail/allocator-rust-dylib-is-jemalloc.rs create mode 100644 src/test/compile-fail/associated-types-outlives.rs create mode 100644 src/test/compile-fail/associated-types-projection-to-unrelated-trait-in-method-without-default.rs create mode 100644 src/test/compile-fail/borrowck-in-static.rs create mode 100644 src/test/compile-fail/coherence-impl-trait-for-trait-object-safe.rs create mode 100644 src/test/compile-fail/dropck-object-cycle.rs create mode 100644 src/test/compile-fail/feature-gate-allocator.rs create mode 100644 src/test/compile-fail/feature-gate-cfg-target-feature.rs create mode 100644 src/test/compile-fail/feature-gate-linked-from.rs create mode 100644 src/test/compile-fail/feature-gate-needs-allocator.rs create mode 100644 src/test/compile-fail/feature-gate-repr-simd.rs create mode 100644 src/test/compile-fail/intrinsic-invalid-number-of-arguments.rs create mode 100644 src/test/compile-fail/invalid-plugin-attr.rs create mode 100644 src/test/compile-fail/issue-17001.rs create mode 100644 src/test/compile-fail/issue-17994.rs create mode 100644 src/test/compile-fail/issue-1920-1.rs create mode 100644 src/test/compile-fail/issue-1920-2.rs create mode 100644 src/test/compile-fail/issue-1920-3.rs create mode 100644 src/test/compile-fail/issue-20692.rs create mode 100644 src/test/compile-fail/issue-21449.rs create mode 100644 src/test/compile-fail/issue-22638.rs create mode 100644 src/test/compile-fail/issue-22872.rs create mode 100644 src/test/compile-fail/issue-23024.rs create mode 100644 src/test/compile-fail/issue-23046.rs create mode 100644 src/test/compile-fail/issue-24682.rs create mode 100644 src/test/compile-fail/issue-27592.rs rename src/test/{run-fail/overflowing-simd-rsh-1.rs => compile-fail/issue-27815.rs} (62%) create mode 100644 src/test/compile-fail/issue-27831.rs create mode 100644 src/test/compile-fail/issue-28098.rs rename src/{libstd/num/isize.rs => test/compile-fail/issue-28105.rs} (67%) rename src/{libstd/num/usize.rs => test/compile-fail/issue-28109.rs} (66%) create mode 100644 src/test/compile-fail/issue-28113.rs create mode 100644 src/test/compile-fail/issue-28344.rs create mode 100644 src/test/compile-fail/issue-28568.rs create mode 100644 src/test/compile-fail/issue-7970a.rs create mode 100644 src/test/compile-fail/issue-7970b.rs create mode 100644 src/test/compile-fail/no-core-gated.rs create mode 100644 src/test/compile-fail/no-std-inject.rs create mode 100644 src/test/compile-fail/non-constant-in-const-path.rs create mode 100644 src/test/compile-fail/regions-implied-bounds-projection-gap-1.rs create mode 100644 src/test/compile-fail/regions-implied-bounds-projection-gap-2.rs create mode 100644 src/test/compile-fail/regions-implied-bounds-projection-gap-3.rs create mode 100644 src/test/compile-fail/regions-implied-bounds-projection-gap-4.rs create mode 100644 src/test/compile-fail/regions-implied-bounds-projection-gap-hr-1.rs create mode 100644 src/test/compile-fail/regions-outlives-nominal-type-enum-region-rev.rs create mode 100644 src/test/compile-fail/regions-outlives-nominal-type-enum-region.rs create mode 100644 src/test/compile-fail/regions-outlives-nominal-type-enum-type-rev.rs create mode 100644 src/test/compile-fail/regions-outlives-nominal-type-enum-type.rs create mode 100644 src/test/compile-fail/regions-outlives-nominal-type-struct-region-rev.rs create mode 100644 src/test/compile-fail/regions-outlives-nominal-type-struct-region.rs create mode 100644 src/test/compile-fail/regions-outlives-nominal-type-struct-type-rev.rs create mode 100644 src/test/compile-fail/regions-outlives-nominal-type-struct-type.rs rename src/test/compile-fail/{regions-assoc-type-outlives-container-hrtb.rs => regions-outlives-projection-container-hrtb.rs} (82%) rename src/test/compile-fail/{regions-assoc-type-outlives-container-wc.rs => regions-outlives-projection-container-wc.rs} (93%) rename src/test/compile-fail/{regions-assoc-type-outlives-container.rs => regions-outlives-projection-container.rs} (82%) create mode 100644 src/test/compile-fail/regions-outlives-projection-hrtype.rs create mode 100644 src/test/compile-fail/regions-outlives-projection-trait-def.rs create mode 100644 src/test/compile-fail/regions-outlives-scalar.rs create mode 100644 src/test/compile-fail/regions-wf-trait-object.rs create mode 100644 src/test/compile-fail/rfc1214-warn-and-error.rs delete mode 100644 src/test/compile-fail/simd-binop.rs create mode 100644 src/test/compile-fail/simd-intrinsic-declaration-type.rs create mode 100644 src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs create mode 100644 src/test/compile-fail/simd-intrinsic-generic-cast.rs create mode 100644 src/test/compile-fail/simd-intrinsic-generic-comparison.rs create mode 100644 src/test/compile-fail/simd-intrinsic-generic-elements.rs create mode 100644 src/test/compile-fail/simd-intrinsic-single-nominal-type.rs create mode 100644 src/test/compile-fail/simd-type-generic-monomorphisation.rs create mode 100644 src/test/compile-fail/test-warns-dead-code.rs rename src/{libstd/num/float_macros.rs => test/compile-fail/trait-bounds-on-structs-and-enums-in-fns.rs} (66%) create mode 100644 src/test/compile-fail/trait-bounds-on-structs-and-enums-in-impls.rs create mode 100644 src/test/compile-fail/two-allocators-2.rs create mode 100644 src/test/compile-fail/two-allocators-3.rs create mode 100644 src/test/compile-fail/two-allocators.rs rename src/{libstd/num/i8.rs => test/compile-fail/ty_binding_span.rs} (68%) create mode 100644 src/test/compile-fail/type-macros-fail.rs create mode 100644 src/test/compile-fail/type-mismatch-same-crate-name.rs create mode 100644 src/test/compile-fail/unspecified-self-in-trait-ref.rs create mode 100644 src/test/compile-fail/warn-pub-extern-crate.rs create mode 100644 src/test/compile-fail/wf-array-elem-sized.rs create mode 100644 src/test/compile-fail/wf-const-type.rs create mode 100644 src/test/compile-fail/wf-enum-bound.rs rename src/{libstd/thunk.rs => test/compile-fail/wf-enum-fields-struct-variant.rs} (61%) create mode 100644 src/test/compile-fail/wf-enum-fields.rs create mode 100644 src/test/compile-fail/wf-fn-where-clause.rs create mode 100644 src/test/compile-fail/wf-impl-associated-type-region.rs create mode 100644 src/test/compile-fail/wf-impl-associated-type-trait.rs create mode 100644 src/test/compile-fail/wf-in-fn-arg.rs create mode 100644 src/test/compile-fail/wf-in-fn-ret.rs create mode 100644 src/test/compile-fail/wf-in-fn-type-arg.rs create mode 100644 src/test/compile-fail/wf-in-fn-type-ret.rs create mode 100644 src/test/compile-fail/wf-in-fn-type-static.rs create mode 100644 src/test/compile-fail/wf-in-fn-where-clause.rs create mode 100644 src/test/compile-fail/wf-in-obj-type-static.rs create mode 100644 src/test/compile-fail/wf-in-obj-type-trait.rs create mode 100644 src/test/compile-fail/wf-inherent-impl-method-where-clause.rs create mode 100644 src/test/compile-fail/wf-inherent-impl-where-clause.rs create mode 100644 src/test/compile-fail/wf-object-safe.rs create mode 100644 src/test/compile-fail/wf-outlives-ty-in-fn-or-trait.rs create mode 100644 src/test/compile-fail/wf-static-type.rs create mode 100644 src/test/compile-fail/wf-struct-bound.rs create mode 100644 src/test/compile-fail/wf-struct-field.rs create mode 100644 src/test/compile-fail/wf-trait-associated-type-bound.rs create mode 100644 src/test/compile-fail/wf-trait-associated-type-region.rs rename src/test/{run-make/no-stack-check/attr.rs => compile-fail/wf-trait-associated-type-trait.rs} (58%) create mode 100644 src/test/compile-fail/wf-trait-bound.rs create mode 100644 src/test/compile-fail/wf-trait-default-fn-arg.rs create mode 100644 src/test/compile-fail/wf-trait-default-fn-ret.rs create mode 100644 src/test/compile-fail/wf-trait-default-fn-where-clause.rs create mode 100644 src/test/compile-fail/wf-trait-fn-arg.rs create mode 100644 src/test/compile-fail/wf-trait-fn-ret.rs create mode 100644 src/test/compile-fail/wf-trait-fn-where-clause.rs create mode 100644 src/test/compile-fail/wf-trait-superbound.rs delete mode 100644 src/test/compile-fail/where-clauses-not-parameter.rs rename src/test/{compile-fail/future_not_copyable.rs => parse-fail/macro-repeat.rs} (69%) rename src/test/parse-fail/{trait-keyword.rs => tuple-float-index.rs} (77%) delete mode 100644 src/test/pretty/empty-impl.pp create mode 100644 src/test/pretty/import-renames.rs rename src/test/run-fail/{overflowing-simd-lsh-3.rs => overflowing-pow.rs} (69%) delete mode 100644 src/test/run-fail/overflowing-simd-lsh-4.rs delete mode 100644 src/test/run-fail/overflowing-simd-rsh-2.rs delete mode 100644 src/test/run-fail/overflowing-simd-rsh-4.rs delete mode 100644 src/test/run-fail/rt-set-exit-status-panic.rs delete mode 100644 src/test/run-fail/rt-set-exit-status-panic2.rs delete mode 100644 src/test/run-fail/rt-set-exit-status.rs delete mode 100644 src/test/run-make/no-stack-check/Makefile create mode 100644 src/test/run-pass/allocator-default.rs create mode 100644 src/test/run-pass/allocator-jemalloc.rs create mode 100644 src/test/run-pass/allocator-override.rs create mode 100644 src/test/run-pass/allocator-system.rs delete mode 100644 src/test/run-pass/bitv-perf-test.rs create mode 100644 src/test/run-pass/exit-flushes.rs create mode 100644 src/test/run-pass/extern_fat_drop.rs rename src/test/{compile-fail/marker-no-copy.rs => run-pass/for-loop-macro.rs} (65%) rename src/test/{compile-fail/warn-foreign-int-types.rs => run-pass/foreign-int-types.rs} (73%) create mode 100644 src/test/run-pass/import-glob-1.rs create mode 100644 src/test/run-pass/import-rename.rs delete mode 100644 src/test/run-pass/issue-11736.rs create mode 100644 src/test/run-pass/issue-18083.rs create mode 100644 src/test/run-pass/issue-19102.rs create mode 100644 src/test/run-pass/issue-20803.rs rename src/test/{run-fail/overflowing-simd-rsh-3.rs => run-pass/issue-22992-2.rs} (64%) create mode 100644 src/test/run-pass/issue-22992.rs create mode 100644 src/test/run-pass/issue-23208.rs rename src/test/run-pass/{issue-24258.rs => issue-23304-1.rs} (56%) create mode 100644 src/test/run-pass/issue-23304-2.rs create mode 100644 src/test/run-pass/issue-23442.rs create mode 100644 src/test/run-pass/issue-23808.rs rename src/test/{parse-fail/array-old-syntax-1.rs => run-pass/issue-25467.rs} (75%) create mode 100644 src/test/run-pass/issue-26205.rs create mode 100644 src/test/run-pass/issue-27054-primitive-binary-ops.rs create mode 100644 src/test/run-pass/issue-27583.rs create mode 100644 src/test/run-pass/issue-27639.rs create mode 100644 src/test/run-pass/issue-27859.rs create mode 100644 src/test/run-pass/issue-27890.rs create mode 100644 src/test/run-pass/issue-27997.rs create mode 100644 src/test/run-pass/issue-28181.rs create mode 100644 src/test/run-pass/issue-28550.rs create mode 100644 src/test/run-pass/issue-28871.rs create mode 100644 src/test/run-pass/issue-4865-1.rs create mode 100644 src/test/run-pass/issue-4865-2.rs create mode 100644 src/test/run-pass/issue-4865-3.rs create mode 100644 src/test/run-pass/msvc-data-only.rs create mode 100644 src/test/run-pass/no-core-1.rs create mode 100644 src/test/run-pass/no-std-1.rs create mode 100644 src/test/run-pass/no-std-2.rs create mode 100644 src/test/run-pass/no-std-3.rs delete mode 100644 src/test/run-pass/out-of-stack-new-thread-no-split.rs delete mode 100644 src/test/run-pass/out-of-stack-no-split.rs create mode 100644 src/test/run-pass/project-defer-unification.rs create mode 100644 src/test/run-pass/raw-fat-ptr.rs rename src/{libstd/num/i32.rs => test/run-pass/regions-free-region-outlives-static-outlives-free-region.rs} (68%) delete mode 100644 src/test/run-pass/simd-binop.rs create mode 100644 src/test/run-pass/simd-intrinsic-generic-arithmetic.rs create mode 100755 src/test/run-pass/simd-intrinsic-generic-cast.rs create mode 100644 src/test/run-pass/simd-intrinsic-generic-comparison.rs create mode 100644 src/test/run-pass/simd-intrinsic-generic-elements.rs delete mode 100644 src/test/run-pass/simd-shift-near-oflo.rs create mode 100644 src/test/run-pass/sync-send-in-std.rs create mode 100644 src/test/run-pass/test-main-not-dead-attr.rs create mode 100644 src/test/run-pass/test-main-not-dead.rs create mode 100644 src/test/run-pass/test-runner-hides-buried-main.rs create mode 100644 src/test/run-pass/test-runner-hides-start.rs create mode 100644 src/test/run-pass/tls-dtors-are-run-in-a-static-binary.rs create mode 100644 src/test/run-pass/type-macros-hlist.rs create mode 100644 src/test/run-pass/type-macros-simple.rs delete mode 100644 src/test/run-pass/unfold-cross-crate.rs rename src/test/{compile-fail/static-recursion-gate-2.rs => run-pass/uninstantiable-struct.rs} (88%) rename src/{libstd/num/u8.rs => test/run-pass/zero-sized-tuple-struct.rs} (68%) create mode 100644 src/test/rustdoc/issue-27759.rs create mode 100644 src/test/rustdoc/issue-27862.rs create mode 100644 src/test/rustdoc/variadic.rs create mode 100644 src/test/rustdoc/viewpath-rename.rs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 22a23de070..f81bb0bd69 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,6 +10,7 @@ links to the major sections: * [Writing Documentation](#writing-documentation) * [Issue Triage](#issue-triage) * [Out-of-tree Contributions](#out-of-tree-contributions) +* [Helpful Links and Information](#helpful-links-and-information) If you have questions, please make a post on [internals.rust-lang.org][internals] or hop on [#rust-internals][pound-rust-internals]. @@ -17,8 +18,8 @@ hop on [#rust-internals][pound-rust-internals]. As a reminder, all contributors are expected to follow our [Code of Conduct][coc]. [pound-rust-internals]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals -[internals]: http://internals.rust-lang.org -[coc]: http://www.rust-lang.org/conduct.html +[internals]: https://internals.rust-lang.org +[coc]: https://www.rust-lang.org/conduct.html ## Feature Requests @@ -207,6 +208,31 @@ it to [Crates.io](http://crates.io). Easier said than done, but very, very valuable! [pound-rust]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust -[users]: http://users.rust-lang.org/ +[users]: https://users.rust-lang.org/ [so]: http://stackoverflow.com/questions/tagged/rust [community-library]: https://github.com/rust-lang/rfcs/labels/A-community-library + +## Helpful Links and Information + +For people new to Rust, and just starting to contribute, or even for +more seasoned developers, some useful places to look for information +are: + +* The [Rust Internals forum][rif], a place to ask questions and + discuss Rust's internals +* The [generated documentation for rust's compiler][gdfrustc] +* The [rust referance][rr], even though it doesn't specifically talk about Rust's internals, its a great reasource nontheless +* Although out of date, [Tom Lee's great blog article][tlgba] is very helpful +* [rustaceans.org][ro] is helpful, but mostly dedicated to IRC +* The [Rust Compiler Testing Docs][rctd] +* For @bors, [this cheetsheat][cheetsheat] is helpful (Remember to replace `@homu` with `@bors` in the commands that you use.) +* **Google**! +* Don't be afraid to ask! The Rust community is friendly and helpful. + +[gdfrustc]: http://manishearth.github.io/rust-internals-docs/rustc/ +[rif]: http://internals.rust-lang.org +[rr]: https://doc.rust-lang.org/book/README.html +[tlgba]: http://tomlee.co/2014/04/03/a-more-detailed-tour-of-the-rust-compiler/ +[ro]: http://www.rustaceans.org/ +[rctd]: ./COMPILER_TESTS.md +[cheetsheat]: http://buildbot.rust-lang.org/homu/ diff --git a/COPYRIGHT b/COPYRIGHT index d4ad98e6e8..0eac7ac9de 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -22,104 +22,6 @@ The Rust Project includes packages written by third parties. The following third party packages are included, and carry their own copyright notices and license terms: -* Two header files that are part of the Valgrind - package. These files are found at src/rt/valgrind/valgrind.h and - src/rt/valgrind/memcheck.h, within this distribution. These files - are redistributed under the following terms, as noted in - them: - - for src/rt/valgrind/valgrind.h: - - This file is part of Valgrind, a dynamic binary - instrumentation framework. - - Copyright (C) 2000-2010 Julian Seward. All rights - reserved. - - Redistribution and use in source and binary forms, with - or without modification, are permitted provided that the - following conditions are met: - - 1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - - 2. The origin of this software must not be - misrepresented; you must not claim that you wrote the - original software. If you use this software in a - product, an acknowledgment in the product - documentation would be appreciated but is not - required. - - 3. Altered source versions must be plainly marked as - such, and must not be misrepresented as being the - original software. - - 4. The name of the author may not be used to endorse or - promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - OF SUCH DAMAGE. - - for src/rt/valgrind/memcheck.h: - - This file is part of MemCheck, a heavyweight Valgrind - tool for detecting memory errors. - - Copyright (C) 2000-2010 Julian Seward. All rights - reserved. - - Redistribution and use in source and binary forms, with - or without modification, are permitted provided that the - following conditions are met: - - 1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - - 2. The origin of this software must not be - misrepresented; you must not claim that you wrote the - original software. If you use this software in a - product, an acknowledgment in the product - documentation would be appreciated but is not - required. - - 3. Altered source versions must be plainly marked as - such, and must not be misrepresented as being the - original software. - - 4. The name of the author may not be used to endorse or - promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - OF SUCH DAMAGE. - * The src/rt/miniz.c file, carrying an implementation of RFC1950/RFC1951 DEFLATE, by Rich Geldreich . All uses of this file are diff --git a/README.md b/README.md index 9e54704a5e..67285da2e3 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ as standard libraries, tools and documentation for Rust. Read ["Installing Rust"] from [The Book]. -["Installing Rust"]: http://doc.rust-lang.org/book/installing-rust.html -[The Book]: http://doc.rust-lang.org/book/index.html +["Installing Rust"]: https://doc.rust-lang.org/book/installing-rust.html +[The Book]: https://doc.rust-lang.org/book/index.html ## Building from Source @@ -65,6 +65,9 @@ Read ["Installing Rust"] from [The Book]. tools. ```sh + # Update package mirrors (may be needed if you have a fresh install of MSYS2) + $ pacman -Sy pacman-mirrors + # Choose one based on platform: $ pacman -S mingw-w64-i686-toolchain $ pacman -S mingw-w64-x86_64-toolchain @@ -82,6 +85,28 @@ Read ["Installing Rust"] from [The Book]. $ make && make install ``` +## Building Documentation + +If you’d like to build the documentation, it’s almost the same: + +```sh +./configure +$ make docs +``` + +Building the documentation requires building the compiler, so the above +details will apply. Once you have the compiler built, you can + +```sh +$ make docs NO_REBUILD=1 +``` + +To make sure you don’t re-build the compiler because you made a change +to some documentation. + +The generated documentation will appear in a top-level `doc` directory, +created by the `make` rule. + ## Notes Since the Rust compiler is written in Rust, it must be built by a @@ -117,7 +142,7 @@ The Rust community congregates in a few places: [Stack Overflow]: http://stackoverflow.com/questions/tagged/rust [/r/rust]: http://reddit.com/r/rust -[users.rust-lang.org]: http://users.rust-lang.org/ +[users.rust-lang.org]: https://users.rust-lang.org/ ## Contributing diff --git a/RELEASES.md b/RELEASES.md index 7a13cfd61c..76246640ca 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,4 +1,173 @@ -Version 1.3.0 (September 2015) +Version 1.4.0 (October 2015) +============================ + +* ~1200 changes, numerous bugfixes + +Highlights +---------- + +* Windows builds targeting the 64-bit MSVC ABI and linker (instead of + GNU) are now supported and recommended for use. + +Breaking Changes +---------------- + +* [Several changes have been made to fix type soundness and improve + the behavior of associated types][sound]. See [RFC 1214]. Although + we have mostly introduced these changes as warnings this release, to + become errors next release, there are still some scenarios that will + see immediate breakage. +* [The `str::lines` and `BufRead::lines` iterators treat `\r\n` as + line breaks in addition to `\n`][crlf]. +* [Loans of `'static` lifetime extend to the end of a function][stat]. + +Language +-------- + +* `use` statements that import multiple items [can now rename + them][i], as in `use foo::{bar as kitten, baz as puppy}`. +* [Binops work correctly on fat pointers][binfat]. +* `pub extern crate`, which does not behave as expected, [issues a + warning][pec] until a better solution is found. + +Libraries +--------- + +* [Many APIs were stabilized][stab]: `>::into_string`, + [`Arc::downgrade`], [`Arc::get_mut`], [`Arc::make_mut`], + [`Arc::try_unwrap`], [`Box::from_raw`], [`Box::into_raw`], [`CStr::to_str`], + [`CStr::to_string_lossy`], [`CString::from_raw`], [`CString::into_raw`], + [`IntoRawFd::into_raw_fd`], [`IntoRawFd`], + `IntoRawHandle::into_raw_handle`, `IntoRawHandle`, + `IntoRawSocket::into_raw_socket`, `IntoRawSocket`, [`Rc::downgrade`], + [`Rc::get_mut`], [`Rc::make_mut`], [`Rc::try_unwrap`], [`Result::expect`], + [`String::into_boxed_str`], [`TcpStream::read_timeout`], + [`TcpStream::set_read_timeout`], [`TcpStream::set_write_timeout`], + [`TcpStream::write_timeout`], [`UdpSocket::read_timeout`], + [`UdpSocket::set_read_timeout`], [`UdpSocket::set_write_timeout`], + [`UdpSocket::write_timeout`], `Vec::append`, `Vec::split_off`, + [`VecDeque::append`], [`VecDeque::retain`], [`VecDeque::split_off`], + [`rc::Weak::upgrade`], [`rc::Weak`], [`slice::Iter::as_slice`], + [`slice::IterMut::into_slice`], [`str::CharIndices::as_str`], + [`str::Chars::as_str`], [`str::split_at_mut`], [`str::split_at`], + [`sync::Weak::upgrade`], [`sync::Weak`], [`thread::park_timeout`], + [`thread::sleep`]. +* [Some APIs were deprecated][dep]: `BTreeMap::with_b`, + `BTreeSet::with_b`, `Option::as_mut_slice`, `Option::as_slice`, + `Result::as_mut_slice`, `Result::as_slice`, `f32::from_str_radix`, + `f64::from_str_radix`. +* [Reverse-searching strings is faster with the 'two-way' + algorithm][s]. +* [`std::io::copy` allows `?Sized` arguments][cc]. +* The `Windows`, `Chunks`, and `ChunksMut` iterators over slices all + [override `count`, `nth` and `last` with an O(1) + implementation][it]. +* [`Default` is implemented for arrays up to `[T; 32]`][d]. +* [`IntoRawFd` has been added to the Unix-specific prelude, + `IntoRawSocket` and `IntoRawHandle` to the Windows-specific + prelude][pr]. +* [`Extend` and `FromIterator` and + `Result<&T>`][into]. +* [`HashMap` and `HashSet` implement `Extend<&T>` where `T: + Copy`][ext] as part of [RFC 839]. +* [`BinaryHeap` implements `Debug`][bh2]. +* [`Borrow` and `BorrowMut` are implemented for fixed-size + arrays][bm]. +* [`extern fn`s of with the "Rust" and "C" ABIs implement common + traits including `Eq`, `Ord`, `Debug`, `Hash`][fp]. +* [String comparison is faster][faststr]. +* `&mut T` where `T: Write` [also implements `Write`][mutw]. +* [A stable regression in `VecDec::push_back` that caused panics for + zero-sized types was fixed][vd]. +* [Function pointers implement traits for up to 12 parameters][fp2]. + +Miscellaneous +------------- + +* The compiler [no longer uses the 'morestack' feature to prevent + stack overflow][mm]. Instead it uses guard pages and stack + probes (though stack probes are not yet implemented on any platform + but Windows). +* [The compiler matches traits faster when projections are involved][p]. +* The 'improper_ctypes' lint [no longer warns about use of `isize` and + `usize`][ffi]. +* [Cargo now displays useful information about what its doing during + `cargo update`][cu]. + +[`Arc::downgrade`]: http://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html#method.downgrade +[`Arc::make_mut`]: http://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html#method.make_mut +[`Arc::get_mut`]: http://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html#method.get_mut +[`Arc::try_unwrap`]: http://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html#method.try_unwrap +[`Box::from_raw`]: http://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html#method.from_raw +[`Box::into_raw`]: http://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html#method.into_raw +[`CStr::to_str`]: http://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.to_str +[`CStr::to_string_lossy`]: http://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.to_string_lossy +[`CString::from_raw`]: http://doc.rust-lang.org/nightly/std/ffi/struct.CString.html#method.from_raw +[`CString::into_raw`]: http://doc.rust-lang.org/nightly/std/ffi/struct.CString.html#method.into_raw +[`IntoRawFd::into_raw_fd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.IntoRawFd.html#tymethod.into_raw_fd +[`IntoRawFd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.IntoRawFd.html +[`Rc::downgrade`]: http://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html#method.downgrade +[`Rc::get_mut`]: http://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html#method.get_mut +[`Rc::make_mut`]: http://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html#method.make_mut +[`Rc::try_unwrap`]: http://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html#method.try_unwrap +[`Result::expect`]: http://doc.rust-lang.org/nightly/core/result/enum.Result.html#method.expect +[`String::into_boxed_str`]: http://doc.rust-lang.org/nightly/collections/string/struct.String.html#method.into_boxed_str +[`TcpStream::read_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.read_timeout +[`TcpStream::set_read_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.set_read_timeout +[`TcpStream::write_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.write_timeout +[`TcpStream::set_write_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.set_write_timeout +[`UdpSocket::read_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.read_timeout +[`UdpSocket::set_read_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.set_read_timeout +[`UdpSocket::write_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.write_timeout +[`UdpSocket::set_write_timeout`]: http://doc.rust-lang.org/nightly/std/net/struct.TcpStream.html#method.set_write_timeout +[`VecDeque::append`]: http://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.append +[`VecDeque::retain`]: http://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.retain +[`VecDeque::split_off`]: http://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.split_off +[`rc::Weak::upgrade`]: http://doc.rust-lang.org/nightly/std/rc/struct.Weak.html#method.upgrade +[`rc::Weak`]: http://doc.rust-lang.org/nightly/std/rc/struct.Weak.html +[`slice::Iter::as_slice`]: http://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#method.as_slice +[`slice::IterMut::into_slice`]: http://doc.rust-lang.org/nightly/std/slice/struct.IterMut.html#method.into_slice +[`str::CharIndices::as_str`]: http://doc.rust-lang.org/nightly/std/str/struct.CharIndices.html#method.as_str +[`str::Chars::as_str`]: http://doc.rust-lang.org/nightly/std/str/struct.Chars.html#method.as_str +[`str::split_at_mut`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_at_mut +[`str::split_at`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_at +[`sync::Weak::upgrade`]: http://doc.rust-lang.org/nightly/std/sync/struct.Weak.html#method.upgrade +[`sync::Weak`]: http://doc.rust-lang.org/nightly/std/sync/struct.Weak.html +[`thread::park_timeout`]: http://doc.rust-lang.org/nightly/std/thread/fn.park_timeout.html +[`thread::sleep`]: http://doc.rust-lang.org/nightly/std/thread/fn.sleep.html +[bh2]: https://github.com/rust-lang/rust/pull/28156 +[binfat]: https://github.com/rust-lang/rust/pull/28270 +[bm]: https://github.com/rust-lang/rust/pull/28197 +[cc]: https://github.com/rust-lang/rust/pull/27531 +[crlf]: https://github.com/rust-lang/rust/pull/28034 +[cu]: https://github.com/rust-lang/cargo/pull/1931 +[d]: https://github.com/rust-lang/rust/pull/27825 +[dep]: https://github.com/rust-lang/rust/pull/28339 +[es]: https://github.com/rust-lang/rust/pull/27956 +[ext]: https://github.com/rust-lang/rust/pull/28094 +[faststr]: https://github.com/rust-lang/rust/pull/28338 +[ffi]: https://github.com/rust-lang/rust/pull/28779 +[fp]: https://github.com/rust-lang/rust/pull/28268 +[fp2]: https://github.com/rust-lang/rust/pull/28560 +[i]: https://github.com/rust-lang/rust/pull/27451 +[into]: https://github.com/rust-lang/rust/pull/28039 +[it]: https://github.com/rust-lang/rust/pull/27652 +[mm]: https://github.com/rust-lang/rust/pull/27338 +[mutw]: https://github.com/rust-lang/rust/pull/28368 +[sound]: https://github.com/rust-lang/rust/pull/27641 +[p]: https://github.com/rust-lang/rust/pull/27866 +[pec]: https://github.com/rust-lang/rust/pull/28486 +[pr]: https://github.com/rust-lang/rust/pull/27896 +[RFC 839]: https://github.com/rust-lang/rfcs/blob/master/text/0839-embrace-extend-extinguish.md +[RFC 1214]: https://github.com/rust-lang/rfcs/blob/master/text/1214-projections-lifetimes-and-wf.md +[s]: https://github.com/rust-lang/rust/pull/27474 +[stab]: https://github.com/rust-lang/rust/pull/28339 +[stat]: https://github.com/rust-lang/rust/pull/28321 +[vd]: https://github.com/rust-lang/rust/pull/28494 + +Version 1.3.0 (2015-09-17) ============================== * ~900 changes, numerous bugfixes @@ -142,7 +311,7 @@ Misc [`Error`]: http://doc.rust-lang.org/nightly/std/error/trait.Error.html [`File`]: http://doc.rust-lang.org/nightly/std/fs/struct.File.html [`Hash`]: http://doc.rust-lang.org/nightly/std/hash/trait.Hash.html -[`Hasher`]: http://doc.rust-lang.org/nightly/std/hash/trait.Hash.html +[`Hasher`]: http://doc.rust-lang.org/nightly/std/hash/trait.Hasher.html [`Send`]: http://doc.rust-lang.org/nightly/std/marker/trait.Send.html [`SliceConcatExt`]: http://doc.rust-lang.org/nightly/std/slice/trait.SliceConcatExt.html [`Stdin`]: http://doc.rust-lang.org/nightly/std/io/struct.Stdin.html @@ -204,8 +373,8 @@ Misc [win4]: https://github.com/rust-lang/rust/pull/27210 [xp]: https://github.com/rust-lang/rust/pull/26569 -Version 1.2.0 (August 2015) -=========================== +Version 1.2.0 (2015-08-07) +========================== * ~1200 changes, numerous bugfixes @@ -308,51 +477,51 @@ Misc * Fat pointers are now [passed in pairs of immediate arguments][fat], resulting in faster compile times and smaller code. -[`Extend`]: http://doc.rust-lang.org/nightly/std/iter/trait.Extend.html +[`Extend`]: https://doc.rust-lang.org/nightly/std/iter/trait.Extend.html [extend-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0839-embrace-extend-extinguish.md -[`iter::once`]: http://doc.rust-lang.org/nightly/std/iter/fn.once.html -[`iter::empty`]: http://doc.rust-lang.org/nightly/std/iter/fn.empty.html -[`matches`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.matches -[`rmatches`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.rmatches -[`Cell`]: http://doc.rust-lang.org/nightly/std/cell/struct.Cell.html -[`RefCell`]: http://doc.rust-lang.org/nightly/std/cell/struct.RefCell.html -[`wrapping_add`]: http://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_add -[`wrapping_sub`]: http://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_sub -[`wrapping_mul`]: http://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_mul -[`wrapping_div`]: http://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_div -[`wrapping_rem`]: http://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_rem -[`wrapping_neg`]: http://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_neg -[`wrapping_shl`]: http://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_shl -[`wrapping_shr`]: http://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_shr -[`Wrapping`]: http://doc.rust-lang.org/nightly/std/num/struct.Wrapping.html -[`fmt::Formatter`]: http://doc.rust-lang.org/nightly/std/fmt/struct.Formatter.html -[`fmt::Write`]: http://doc.rust-lang.org/nightly/std/fmt/trait.Write.html -[`io::Write`]: http://doc.rust-lang.org/nightly/std/io/trait.Write.html -[`debug_struct`]: http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html#method.debug_struct -[`debug_tuple`]: http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html#method.debug_tuple -[`debug_list`]: http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html#method.debug_list -[`debug_set`]: http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html#method.debug_set -[`debug_map`]: http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html#method.debug_map -[`Debug`]: http://doc.rust-lang.org/nightly/std/fmt/trait.Debug.html -[strup]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.to_uppercase -[strlow]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.to_lowercase -[`to_uppercase`]: http://doc.rust-lang.org/nightly/std/primitive.char.html#method.to_uppercase -[`to_lowercase`]: http://doc.rust-lang.org/nightly/std/primitive.char.html#method.to_lowercase -[`PoisonError`]: http://doc.rust-lang.org/nightly/std/sync/struct.PoisonError.html -[`RwLock`]: http://doc.rust-lang.org/nightly/std/sync/struct.RwLock.html -[`Mutex`]: http://doc.rust-lang.org/nightly/std/sync/struct.Mutex.html -[`FromRawFd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.FromRawFd.html -[`AsRawFd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.AsRawFd.html -[`Stdio`]: http://doc.rust-lang.org/nightly/std/process/struct.Stdio.html -[`ChildStdin`]: http://doc.rust-lang.org/nightly/std/process/struct.ChildStdin.html -[`ChildStdout`]: http://doc.rust-lang.org/nightly/std/process/struct.ChildStdout.html -[`ChildStderr`]: http://doc.rust-lang.org/nightly/std/process/struct.ChildStderr.html -[`io::ErrorKind`]: http://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html +[`iter::once`]: https://doc.rust-lang.org/nightly/std/iter/fn.once.html +[`iter::empty`]: https://doc.rust-lang.org/nightly/std/iter/fn.empty.html +[`matches`]: https://doc.rust-lang.org/nightly/std/primitive.str.html#method.matches +[`rmatches`]: https://doc.rust-lang.org/nightly/std/primitive.str.html#method.rmatches +[`Cell`]: https://doc.rust-lang.org/nightly/std/cell/struct.Cell.html +[`RefCell`]: https://doc.rust-lang.org/nightly/std/cell/struct.RefCell.html +[`wrapping_add`]: https://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_add +[`wrapping_sub`]: https://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_sub +[`wrapping_mul`]: https://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_mul +[`wrapping_div`]: https://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_div +[`wrapping_rem`]: https://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_rem +[`wrapping_neg`]: https://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_neg +[`wrapping_shl`]: https://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_shl +[`wrapping_shr`]: https://doc.rust-lang.org/nightly/std/primitive.i8.html#method.wrapping_shr +[`Wrapping`]: https://doc.rust-lang.org/nightly/std/num/struct.Wrapping.html +[`fmt::Formatter`]: https://doc.rust-lang.org/nightly/std/fmt/struct.Formatter.html +[`fmt::Write`]: https://doc.rust-lang.org/nightly/std/fmt/trait.Write.html +[`io::Write`]: https://doc.rust-lang.org/nightly/std/io/trait.Write.html +[`debug_struct`]: https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html#method.debug_struct +[`debug_tuple`]: https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html#method.debug_tuple +[`debug_list`]: https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html#method.debug_list +[`debug_set`]: https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html#method.debug_set +[`debug_map`]: https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html#method.debug_map +[`Debug`]: https://doc.rust-lang.org/nightly/std/fmt/trait.Debug.html +[strup]: https://doc.rust-lang.org/nightly/std/primitive.str.html#method.to_uppercase +[strlow]: https://doc.rust-lang.org/nightly/std/primitive.str.html#method.to_lowercase +[`to_uppercase`]: https://doc.rust-lang.org/nightly/std/primitive.char.html#method.to_uppercase +[`to_lowercase`]: https://doc.rust-lang.org/nightly/std/primitive.char.html#method.to_lowercase +[`PoisonError`]: https://doc.rust-lang.org/nightly/std/sync/struct.PoisonError.html +[`RwLock`]: https://doc.rust-lang.org/nightly/std/sync/struct.RwLock.html +[`Mutex`]: https://doc.rust-lang.org/nightly/std/sync/struct.Mutex.html +[`FromRawFd`]: https://doc.rust-lang.org/nightly/std/os/unix/io/trait.FromRawFd.html +[`AsRawFd`]: https://doc.rust-lang.org/nightly/std/os/unix/io/trait.AsRawFd.html +[`Stdio`]: https://doc.rust-lang.org/nightly/std/process/struct.Stdio.html +[`ChildStdin`]: https://doc.rust-lang.org/nightly/std/process/struct.ChildStdin.html +[`ChildStdout`]: https://doc.rust-lang.org/nightly/std/process/struct.ChildStdout.html +[`ChildStderr`]: https://doc.rust-lang.org/nightly/std/process/struct.ChildStderr.html +[`io::ErrorKind`]: https://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html [debugfmt]: https://www.reddit.com/r/rust/comments/3ceaui/psa_produces_prettyprinted_debug_output/ -[`DerefMut`]: http://doc.rust-lang.org/nightly/std/ops/trait.DerefMut.html -[`mem::align_of`]: http://doc.rust-lang.org/nightly/std/mem/fn.align_of.html +[`DerefMut`]: https://doc.rust-lang.org/nightly/std/ops/trait.DerefMut.html +[`mem::align_of`]: https://doc.rust-lang.org/nightly/std/mem/fn.align_of.html [align]: https://github.com/rust-lang/rust/pull/25646 -[`mem::min_align_of`]: http://doc.rust-lang.org/nightly/std/mem/fn.min_align_of.html +[`mem::min_align_of`]: https://doc.rust-lang.org/nightly/std/mem/fn.min_align_of.html [typos]: https://github.com/rust-lang/rust/pull/26087 [nop]: https://github.com/rust-lang/rust/pull/26336 [fat]: https://github.com/rust-lang/rust/pull/26411 @@ -362,7 +531,7 @@ Misc [ad]: https://github.com/rust-lang/rust/pull/27382 [win]: https://github.com/rust-lang/rust/pull/25350 -Version 1.1.0 (June 2015) +Version 1.1.0 (2015-06-25) ========================= * ~850 changes, numerous bugfixes @@ -443,14 +612,14 @@ Misc * [The `drop_with_repr_extern` lint warns about mixing `repr(C)` with `Drop`][drop]. -[`str::split_whitespace`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_whitespace -[`FromRawFd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.FromRawFd.html -[`AsRawFd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.AsRawFd.html -[`std::os::unix::symlink`]: http://doc.rust-lang.org/nightly/std/os/unix/fs/fn.symlink.html -[`IntoIterator`]: http://doc.rust-lang.org/nightly/std/iter/trait.IntoIterator.html -[`From`]: http://doc.rust-lang.org/nightly/std/convert/trait.From.html +[`str::split_whitespace`]: https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_whitespace +[`FromRawFd`]: https://doc.rust-lang.org/nightly/std/os/unix/io/trait.FromRawFd.html +[`AsRawFd`]: https://doc.rust-lang.org/nightly/std/os/unix/io/trait.AsRawFd.html +[`std::os::unix::symlink`]: https://doc.rust-lang.org/nightly/std/os/unix/fs/fn.symlink.html +[`IntoIterator`]: https://doc.rust-lang.org/nightly/std/iter/trait.IntoIterator.html +[`From`]: https://doc.rust-lang.org/nightly/std/convert/trait.From.html [rf]: https://github.com/rust-lang/rust/pull/24491 -[err-index]: http://doc.rust-lang.org/error-index.html +[err-index]: https://doc.rust-lang.org/error-index.html [sk]: https://github.com/rust-lang/rust/pull/24615 [pre]: https://github.com/rust-lang/rust/pull/25323 [file]: https://github.com/rust-lang/rust/pull/24598 @@ -464,16 +633,16 @@ Misc [pie]: https://github.com/rust-lang/rust/pull/24953 [abs]: https://github.com/rust-lang/rust/pull/25441 [c]: https://github.com/rust-lang/rust/pull/25496 -[`Cloned`]: http://doc.rust-lang.org/nightly/std/iter/struct.Cloned.html -[`Incoming`]: http://doc.rust-lang.org/nightly/std/net/struct.Incoming.html +[`Cloned`]: https://doc.rust-lang.org/nightly/std/iter/struct.Cloned.html +[`Incoming`]: https://doc.rust-lang.org/nightly/std/net/struct.Incoming.html [inc]: https://github.com/rust-lang/rust/pull/25522 [bh]: https://github.com/rust-lang/rust/pull/25856 -[`BinaryHeap`]: http://doc.rust-lang.org/nightly/std/collections/struct.BinaryHeap.html +[`BinaryHeap`]: https://doc.rust-lang.org/nightly/std/collections/struct.BinaryHeap.html [ll]: https://github.com/rust-lang/rust/pull/26022 -[`split_off`]: http://doc.rust-lang.org/nightly/collections/linked_list/struct.LinkedList.html#method.split_off +[`split_off`]: https://doc.rust-lang.org/nightly/collections/linked_list/struct.LinkedList.html#method.split_off [drop]: https://github.com/rust-lang/rust/pull/24935 -Version 1.0.0 (May 2015) +Version 1.0.0 (2015-05-15) ======================== * ~1500 changes, numerous bugfixes @@ -714,7 +883,7 @@ Version 1.0.0-alpha.2 (February 2015) [drop]: https://github.com/rust-lang/rust/pull/21972 [drop-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0769-sound-generic-drop.md [feat]: https://github.com/rust-lang/rust/pull/21248 -[feat-forum]: http://users.rust-lang.org/t/psa-important-info-about-rustcs-new-feature-staging/82/5 +[feat-forum]: https://users.rust-lang.org/t/psa-important-info-about-rustcs-new-feature-staging/82/5 [feat-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md [fmt]: https://github.com/rust-lang/rust/pull/21457 [into]: https://github.com/rust-lang/rust/pull/20790 @@ -915,7 +1084,7 @@ Version 1.0.0-alpha (January 2015) [objsafe]: https://github.com/rust-lang/rfcs/blob/master/text/0255-object-safety.md [assoc]: https://github.com/rust-lang/rfcs/blob/master/text/0195-associated-items.md [ints]: https://github.com/rust-lang/rfcs/pull/544#issuecomment-68760871 -[trpl]: http://doc.rust-lang.org/book/index.html +[trpl]: https://doc.rust-lang.org/book/index.html [rbe]: http://rustbyexample.com/ diff --git a/configure b/configure index 2c8d78598b..2d03b5f6f4 100755 --- a/configure +++ b/configure @@ -602,11 +602,16 @@ valopt python "" "set path to python" valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located" valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple" valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path (deprecated)" +valopt i686-linux-android-ndk "" "i686-linux-android NDK standalone path" valopt arm-linux-androideabi-ndk "" "arm-linux-androideabi NDK standalone path" valopt aarch64-linux-android-ndk "" "aarch64-linux-android NDK standalone path" valopt release-channel "dev" "the name of the release channel to build" valopt musl-root "/usr/local" "MUSL root installation directory" +# Used on systems where "cc" and "ar" are unavailable +valopt default-linker "cc" "the default linker" +valopt default-ar "ar" "the default ar" + # Many of these are saved below during the "writing configuration" step # (others are conditionally saved). opt_nosave manage-submodules 1 "let the build manage the git submodules" @@ -880,6 +885,28 @@ then CFG_DISABLE_JEMALLOC=1 fi +# default gcc version under OpenBSD maybe too old, try using egcc, which is a +# gcc version from ports +if [ $CFG_OSTYPE = unknown-openbsd ] +then + if [ $("$CFG_GCC" --version 2>&1 | grep -c ' 4\.[0-6]') -ne 0 ]; then + step_msg "older GCC found, try with egcc instead" + + # probe again but using egcc + probe CFG_GCC egcc + + # and use egcc/eg++ for CC/CXX too if it was found + # (but user setting has priority) + if [ -n "$CFG_GCC" ]; then + CC="${CC:-egcc}" + CXX="${CXX:-eg++}" + fi + fi + + step_msg "on OpenBSD, disabling jemalloc" + CFG_DISABLE_JEMALLOC=1 +fi + # OS X 10.9, gcc is actually clang. This can cause some confusion in the build # system, so if we find that gcc is clang, we should just use clang directly. if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ] @@ -951,7 +978,7 @@ then LLVM_VERSION=$($LLVM_CONFIG --version) case $LLVM_VERSION in - (3.[5-7]*) + (3.[5-8]*) msg "found ok version of LLVM: $LLVM_VERSION" ;; (*) @@ -1025,7 +1052,7 @@ then esac else case $CFG_CLANG_VERSION in - (3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7*) + (3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7* | 3.8*) step_msg "found ok version of CLANG: $CFG_CLANG_VERSION" ;; (*) @@ -1164,27 +1191,56 @@ do # # Consequently here we try to detect when that happens and print an # error if it does. - if $CFG_PYTHON -c 'import sys; print sys.argv[1]' `pwd` | grep '^/' + if $CFG_PYTHON -c 'import sys; print sys.argv[1]' `pwd` | grep '^/' > /dev/null then - err "python is silently translating windows paths to MSYS paths \ - and the build will fail if this python is used.\n\n \ - Either an official python install must be used or an \ - alternative python package in MinGW must be used." + err " + +python is silently translating windows paths to MSYS paths \ +and the build will fail if this python is used. + +Either an official python install must be used or an \ +alternative python package in MinGW must be used. + +If you are building under msys2 try installing the mingw-w64-x86_64-python2 \ +package instead of python2: + +$ pacman -R python2 && pacman -S mingw-w64-x86_64-python2 +" fi # MSVC requires cmake because that's how we're going to build LLVM probe_need CFG_CMAKE cmake + # There are three builds of cmake on windows: MSVC, MinGW and Cygwin + # The Cygwin build does not have generators for Visual Studio, so + # detect that here and error. + if ! "$CFG_CMAKE" --help | sed -n '/^Generators/,$p' | grep 'Visual Studio' > /dev/null + then + err " + +cmake does not support Visual Studio generators. + +This is likely due to it being an msys/cygwin build of cmake, \ +rather than the required windows version, built using MinGW \ +or Visual Studio. + +If you are building under msys2 try installing the mingw-w64-x86_64-cmake \ +package instead of cmake: + +$ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake +" + fi + # Use the REG program to figure out where VS is installed # We need to figure out where cl.exe and link.exe are, so we do some # munging and some probing here. We also look for the default # INCLUDE and LIB variables for MSVC so we can set those in the # build system as well. - install=$(reg QUERY \ + install=$(cmd //c reg QUERY \ 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0' \ -v InstallDir) if [ -z "$install" ]; then - install=$(reg QUERY \ + install=$(cmd //c reg QUERY \ 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \ -v InstallDir) fi @@ -1217,9 +1273,9 @@ do eval CFG_MSVC_LINK_$bits="\"$bindir/link.exe\"" vcvarsall="${CFG_MSVC_ROOT}/VC/vcvarsall.bat" - include_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %INCLUDE%") + include_path=$(cmd //V:ON //c "$vcvarsall" $msvc_part \& echo !INCLUDE!) need_ok "failed to learn about MSVC's INCLUDE" - lib_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %LIB%") + lib_path=$(cmd //V:ON //c "$vcvarsall" $msvc_part \& echo !LIB!) need_ok "failed to learn about MSVC's LIB" eval CFG_MSVC_INCLUDE_PATH_${bits}="\"$include_path\"" @@ -1428,9 +1484,10 @@ do LLVM_BUILD_DIR= LLVM_INST_DIR=$CFG_LLVM_ROOT do_reconfigure=0 + # Check that LLVm FileCheck is available. Needed for the tests + need_cmd $LLVM_INST_DIR/bin/FileCheck fi - if [ ${do_reconfigure} -ne 0 ] then # because git is hilarious, it might have put the module index @@ -1688,6 +1745,7 @@ putvar CFG_LIBDIR_RELATIVE putvar CFG_DISABLE_MANAGE_SUBMODULES putvar CFG_AARCH64_LINUX_ANDROID_NDK putvar CFG_ARM_LINUX_ANDROIDEABI_NDK +putvar CFG_I686_LINUX_ANDROID_NDK putvar CFG_MANDIR # Avoid spurious warnings from clang by feeding it original source on diff --git a/man/rustc.1 b/man/rustc.1 index 0cb1c5dc32..3ac79ecae6 100644 --- a/man/rustc.1 +++ b/man/rustc.1 @@ -41,7 +41,7 @@ look for anything here (the default) .RE .TP \fB\-l\fR [\fIKIND\fR=]\fINAME\fR -Link the generated crate(s) to the specified native library \fINAME\fR. +Link the generated crate(s) to the specified library \fINAME\fR. The optional \fIKIND\fR can be one of \fIstatic\fR, \fIdylib\fR, or \fIframework\fR. If omitted, \fIdylib\fR is assumed. @@ -113,7 +113,8 @@ Print version info and exit. Use verbose output. .TP \fB\-\-extern\fR \fINAME\fR=\fIPATH\fR -Specify where an external rust library is located. +Specify where an external rust library is located. These should match +\fIextern\fR declarations in the crate's source code. .TP \fB\-\-sysroot\fR \fIPATH\fR Override the system root. diff --git a/mk/cfg/i686-linux-android.mk b/mk/cfg/i686-linux-android.mk new file mode 100644 index 0000000000..2843a8e9be --- /dev/null +++ b/mk/cfg/i686-linux-android.mk @@ -0,0 +1,25 @@ +# i686-linux-android configuration +CC_i686-linux-android=$(CFG_I686_LINUX_ANDROID_NDK)/bin/i686-linux-android-gcc +CXX_i686-linux-android=$(CFG_I686_LINUX_ANDROID_NDK)/bin/i686-linux-android-g++ +CPP_i686-linux-android=$(CFG_I686_LINUX_ANDROID_NDK)/bin/i686-linux-android-gcc -E +AR_i686-linux-android=$(CFG_I686_LINUX_ANDROID_NDK)/bin/i686-linux-android-ar +CFG_LIB_NAME_i686-linux-android=lib$(1).so +CFG_STATIC_LIB_NAME_i686-linux-android=lib$(1).a +CFG_LIB_GLOB_i686-linux-android=lib$(1)-*.so +CFG_LIB_DSYM_GLOB_i686-linux-android=lib$(1)-*.dylib.dSYM +CFG_JEMALLOC_CFLAGS_i686-linux-android := -D__i686__ -DANDROID -D__ANDROID__ $(CFLAGS) +CFG_GCCISH_CFLAGS_i686-linux-android := -Wall -g -fPIC -D__i686__ -DANDROID -D__ANDROID__ $(CFLAGS) +CFG_GCCISH_CXXFLAGS_i686-linux-android := -fno-rtti $(CXXFLAGS) +CFG_GCCISH_LINK_FLAGS_i686-linux-android := -shared -fPIC -ldl -g -lm -lsupc++ +CFG_GCCISH_DEF_FLAG_i686-linux-android := -Wl,--export-dynamic,--dynamic-list= +CFG_LLC_FLAGS_i686-linux-android := +CFG_INSTALL_NAME_i686-linux-android = +CFG_EXE_SUFFIX_i686-linux-android := +CFG_WINDOWSY_i686-linux-android := +CFG_UNIXY_i686-linux-android := 1 +CFG_LDPATH_i686-linux-android := +CFG_RUN_i686-linux-android= +CFG_RUN_TARG_i686-linux-android= +RUSTC_FLAGS_i686-linux-android := +RUSTC_CROSS_FLAGS_i686-linux-android := +CFG_GNU_TRIPLE_i686-linux-android := i686-linux-android diff --git a/mk/cfg/i686-pc-windows-msvc.mk b/mk/cfg/i686-pc-windows-msvc.mk index bb1280688a..4c8f110373 100644 --- a/mk/cfg/i686-pc-windows-msvc.mk +++ b/mk/cfg/i686-pc-windows-msvc.mk @@ -22,8 +22,3 @@ CFG_LDPATH_i686-pc-windows-msvc := CFG_RUN_i686-pc-windows-msvc=$(2) CFG_RUN_TARG_i686-pc-windows-msvc=$(call CFG_RUN_i686-pc-windows-msvc,,$(2)) CFG_GNU_TRIPLE_i686-pc-windows-msvc := i686-pc-win32 - -# All windows nightiles are currently a GNU triple, so this MSVC triple is not -# bootstrapping from itself. This is relevant during stage0, and other parts of -# the build system take this into account. -BOOTSTRAP_FROM_i686-pc-windows-msvc := i686-pc-windows-gnu diff --git a/mk/cfg/x86_64-pc-windows-msvc.mk b/mk/cfg/x86_64-pc-windows-msvc.mk index 6f12836f05..65cf28f685 100644 --- a/mk/cfg/x86_64-pc-windows-msvc.mk +++ b/mk/cfg/x86_64-pc-windows-msvc.mk @@ -22,8 +22,3 @@ CFG_LDPATH_x86_64-pc-windows-msvc := CFG_RUN_x86_64-pc-windows-msvc=$(2) CFG_RUN_TARG_x86_64-pc-windows-msvc=$(call CFG_RUN_x86_64-pc-windows-msvc,,$(2)) CFG_GNU_TRIPLE_x86_64-pc-windows-msvc := x86_64-pc-win32 - -# All windows nightiles are currently a GNU triple, so this MSVC triple is not -# bootstrapping from itself. This is relevant during stage0, and other parts of -# the build system take this into account. -BOOTSTRAP_FROM_x86_64-pc-windows-msvc := x86_64-pc-windows-gnu diff --git a/mk/clean.mk b/mk/clean.mk index c04ef89ebc..bb79e2186a 100644 --- a/mk/clean.mk +++ b/mk/clean.mk @@ -101,7 +101,6 @@ define CLEAN_TARGET_STAGE_N clean$(1)_T_$(2)_H_$(3): \ $$(foreach crate,$$(CRATES),clean$(1)_T_$(2)_H_$(3)-lib-$$(crate)) \ $$(foreach tool,$$(TOOLS) $$(DEBUGGER_BIN_SCRIPTS_ALL),clean$(1)_T_$(2)_H_$(3)-tool-$$(tool)) - $$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a $$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libcompiler-rt.a $(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/librun_pass_stage* # For unix $(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/run_pass_stage* # For windows diff --git a/mk/crates.mk b/mk/crates.mk index 165079e2e6..b424c1d877 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -52,41 +52,44 @@ TARGET_CRATES := libc std flate arena term \ serialize getopts collections test rand \ log graphviz core rbml alloc \ - rustc_unicode rustc_bitflags -RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \ + rustc_unicode rustc_bitflags \ + alloc_system +RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \ rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \ - rustc_data_structures + rustc_data_structures rustc_front rustc_platform_intrinsics HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros -CRATES := $(TARGET_CRATES) $(HOST_CRATES) TOOLS := compiletest rustdoc rustc rustbook error-index-generator DEPS_core := DEPS_libc := core DEPS_rustc_unicode := core -DEPS_alloc := core libc native:jemalloc +DEPS_alloc := core libc alloc_system DEPS_std := core libc rand alloc collections rustc_unicode \ - native:rust_builtin native:backtrace native:rustrt_native \ - rustc_bitflags + native:rust_builtin native:backtrace \ + alloc_system DEPS_graphviz := std -DEPS_syntax := std term serialize log fmt_macros arena libc +DEPS_syntax := std term serialize log fmt_macros arena libc rustc_bitflags DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \ - rustc_typeck rustc_resolve log syntax serialize rustc_llvm \ - rustc_trans rustc_privacy rustc_lint + rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \ + rustc_trans rustc_privacy rustc_lint rustc_front DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \ - log syntax serialize rustc_llvm -DEPS_rustc_typeck := rustc syntax -DEPS_rustc_borrowck := rustc log graphviz syntax -DEPS_rustc_resolve := rustc log syntax -DEPS_rustc_privacy := rustc log syntax + log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics +DEPS_rustc_mir := rustc rustc_front syntax +DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics +DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax +DEPS_rustc_resolve := rustc rustc_front log syntax +DEPS_rustc_privacy := rustc rustc_front log syntax DEPS_rustc_lint := rustc log syntax DEPS_rustc := syntax flate arena serialize getopts rbml \ log graphviz rustc_llvm rustc_back rustc_data_structures -DEPS_rustc_llvm := native:rustllvm libc std -DEPS_rustc_back := std syntax rustc_llvm flate log libc +DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags +DEPS_rustc_platform_intrinsics := rustc rustc_llvm +DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc +DEPS_rustc_front := std syntax log serialize DEPS_rustc_data_structures := std log serialize DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \ - test rustc_lint + test rustc_lint rustc_front DEPS_rustc_bitflags := core DEPS_flate := std native:miniz DEPS_arena := std @@ -102,6 +105,7 @@ DEPS_test := std getopts serialize rbml term native:rust_test_helpers DEPS_rand := core DEPS_log := std DEPS_fmt_macros = std +DEPS_alloc_system := core libc TOOL_DEPS_compiletest := test getopts TOOL_DEPS_rustdoc := rustdoc @@ -121,14 +125,26 @@ ONLY_RLIB_rand := 1 ONLY_RLIB_collections := 1 ONLY_RLIB_rustc_unicode := 1 ONLY_RLIB_rustc_bitflags := 1 +ONLY_RLIB_alloc_system := 1 # Documented-by-default crates DOC_CRATES := std alloc collections core libc rustc_unicode +ifeq ($(CFG_DISABLE_JEMALLOC),) +TARGET_CRATES += alloc_jemalloc +DEPS_std += alloc_jemalloc +DEPS_alloc_jemalloc := core libc native:jemalloc +ONLY_RLIB_alloc_jemalloc := 1 +else +RUSTFLAGS_rustc_back := --cfg disable_jemalloc +endif + ################################################################################ # You should not need to edit below this line ################################################################################ +CRATES := $(TARGET_CRATES) $(HOST_CRATES) + # This macro creates some simple definitions for each crate being built, just # some munging of all of the parameters above. # diff --git a/mk/docs.mk b/mk/docs.mk index a8ab6d55d7..644fbde323 100644 --- a/mk/docs.mk +++ b/mk/docs.mk @@ -13,9 +13,6 @@ # # The DOCS variable is their names (with no file extension). # -# PDF_DOCS lists the targets for which PDF documentation should be -# build. -# # RUSTDOC_FLAGS_xyz variables are extra arguments to pass to the # rustdoc invocation for xyz. # @@ -35,8 +32,6 @@ DOCS += guide-crates guide-error-handling guide-ffi guide-macros guide \ guide-testing -PDF_DOCS := reference - RUSTDOC_DEPS_reference := doc/full-toc.inc RUSTDOC_FLAGS_reference := --html-in-header=doc/full-toc.inc @@ -48,17 +43,10 @@ L10N_LANGS := ja RUSTDOC_HTML_OPTS_NO_CSS = --html-before-content=doc/version_info.html \ --html-in-header=doc/favicon.inc \ --html-after-content=doc/footer.inc \ - --markdown-playground-url='http://play.rust-lang.org/' + --markdown-playground-url='https://play.rust-lang.org/' RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css -PANDOC_BASE_OPTS := --standalone --toc --number-sections -PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --from=markdown --to=latex \ - --include-before-body=doc/version.tex \ - --include-before-body=doc/footer.tex \ - --include-in-header=doc/uptack.tex -PANDOC_EPUB_OPTS = $(PANDOC_BASE_OPTS) --to=epub - # The rustdoc executable... RUSTDOC_EXE = $(HBIN2_H_$(CFG_BUILD))/rustdoc$(X_$(CFG_BUILD)) # ...with rpath included in case --disable-rpath was provided to @@ -89,30 +77,10 @@ else HTML_DEPS := endif -# Check for xelatex - -ifneq ($(CFG_XELATEX),) - CFG_LATEX := $(CFG_XELATEX) - XELATEX = 1 - else - $(info cfg: no xelatex found, disabling LaTeX docs) - NO_PDF_DOCS = 1 -endif - -ifeq ($(CFG_PANDOC),) -$(info cfg: no pandoc found, omitting PDF and EPUB docs) -ONLY_HTML_DOCS = 1 -endif - - ###################################################################### # Rust version ###################################################################### -doc/version.tex: $(MKFILE_DEPS) $(wildcard $(D)/*.*) | doc/ - @$(call E, version-stamp: $@) - $(Q)echo "$(CFG_VERSION)" >$@ - HTML_DEPS += doc/version_info.html doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \ $(wildcard $(D)/*.*) | doc/ @@ -121,10 +89,10 @@ doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \ s/SHORT_HASH/$(CFG_SHORT_VER_HASH)/; \ s/STAMP/$(CFG_VER_HASH)/;" $< >$@ -GENERATED += doc/version.tex doc/version_info.html +GENERATED += doc/version_info.html ###################################################################### -# Docs, from rustdoc and sometimes pandoc +# Docs from rustdoc ###################################################################### doc/: @@ -150,26 +118,12 @@ doc/footer.inc: $(D)/footer.inc | doc/ $(Q)cp -PRp $< $@ 2> /dev/null # The (english) documentation for each doc item. - -define DEF_SHOULD_BUILD_PDF_DOC -SHOULD_BUILD_PDF_DOC_$(1) = 1 -endef -$(foreach docname,$(PDF_DOCS),$(eval $(call DEF_SHOULD_BUILD_PDF_DOC,$(docname)))) - -doc/footer.tex: $(D)/footer.inc | doc/ - @$(call E, pandoc: $@) - $(CFG_PANDOC) --from=html --to=latex $< --output=$@ - -doc/uptack.tex: $(D)/uptack.tex | doc/ - $(Q)cp $< $@ - -# HTML (rustdoc) DOC_TARGETS += doc/not_found.html doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/ @$(call E, rustdoc: $@) $(Q)$(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) \ --markdown-no-toc \ - --markdown-css http://doc.rust-lang.org/rust.css $< + --markdown-css https://doc.rust-lang.org/rust.css $< define DEF_DOC @@ -179,47 +133,6 @@ doc/$(1).html: $$(D)/$(1).md $$(HTML_DEPS) $$(RUSTDOC_DEPS_$(1)) | doc/ @$$(call E, rustdoc: $$@) $$(Q)$$(RUSTDOC) $$(RUSTDOC_HTML_OPTS) $$(RUSTDOC_FLAGS_$(1)) $$< -ifneq ($(ONLY_HTML_DOCS),1) - -# EPUB (pandoc directly) -DOC_TARGETS += doc/$(1).epub -doc/$(1).epub: $$(D)/$(1).md | doc/ - @$$(call E, pandoc: $$@) - $$(CFG_PANDOC) $$(PANDOC_EPUB_OPTS) $$< --output=$$@ - -# PDF (md =(pandoc)=> tex =(pdflatex)=> pdf) -DOC_TARGETS += doc/$(1).tex -doc/$(1).tex: $$(D)/$(1).md doc/uptack.tex doc/footer.tex doc/version.tex | doc/ - @$$(call E, pandoc: $$@) - $$(CFG_PANDOC) $$(PANDOC_TEX_OPTS) $$< --output=$$@ - -ifneq ($(NO_PDF_DOCS),1) -ifeq ($$(SHOULD_BUILD_PDF_DOC_$(1)),1) -DOC_TARGETS += doc/$(1).pdf -ifneq ($(XELATEX),1) -doc/$(1).pdf: doc/$(1).tex - @$$(call E, latex compiler: $$@) - $$(Q)$$(CFG_LATEX) \ - -interaction=batchmode \ - -output-directory=doc \ - $$< -else -# The version of xelatex on the snap bots seemingly ingores -output-directory -# So we'll output to . and move to the doc directory manually. -# This will leave some intermediate files in the build directory. -doc/$(1).pdf: doc/$(1).tex - @$$(call E, latex compiler: $$@) - $$(Q)$$(CFG_LATEX) \ - -interaction=batchmode \ - -output-directory=. \ - $$< - $$(Q)mv ./$(1).pdf $$@ -endif # XELATEX -endif # SHOULD_BUILD_PDF_DOCS_$(1) -endif # NO_PDF_DOCS - -endif # ONLY_HTML_DOCS - endef $(foreach docname,$(DOCS),$(eval $(call DEF_DOC,$(docname)))) @@ -278,6 +191,7 @@ ifdef CFG_DISABLE_DOCS endif docs: $(DOC_TARGETS) +doc: docs compiler-docs: $(COMPILER_DOC_TARGETS) trpl: doc/book/index.html diff --git a/mk/main.mk b/mk/main.mk index 99b0797e24..f13355517d 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -13,12 +13,12 @@ ###################################################################### # The version number -CFG_RELEASE_NUM=1.3.0 +CFG_RELEASE_NUM=1.4.0 # An optional number to put after the label, e.g. '.2' -> '-beta.2' # NB Make sure it starts with a dot to conform to semver pre-release # versions (section 9) -CFG_PRERELEASE_VERSION=.3 +CFG_PRERELEASE_VERSION=.4 # Append a version-dependent hash to each library, so we can install different # versions in the same place @@ -163,7 +163,7 @@ endif # that the snapshot will be generated with a statically linked rustc so we only # have to worry about the distribution of one file (with its native dynamic # dependencies) -RUSTFLAGS_STAGE0 += -C prefer-dynamic +RUSTFLAGS_STAGE0 += -C prefer-dynamic -C no-stack-check RUSTFLAGS_STAGE1 += -C prefer-dynamic RUST_LIB_FLAGS_ST2 += -C prefer-dynamic RUST_LIB_FLAGS_ST3 += -C prefer-dynamic @@ -172,6 +172,18 @@ RUST_LIB_FLAGS_ST3 += -C prefer-dynamic # by not emitting them. RUSTFLAGS_STAGE0 += -Z no-landing-pads +# Enable MIR to "always build" for crates where this works. This is +# just temporary while MIR is being actively built up -- it's just a +# poor man's unit testing infrastructure. Anyway we only want this for +# stage1/stage2. +define ADD_MIR_FLAG +RUSTFLAGS1_$(1) += -Z always-build-mir +RUSTFLAGS2_$(1) += -Z always-build-mir +endef +$(foreach crate,$(TARGET_CRATES),$(eval $(call ADD_MIR_FLAG,$(crate)))) +$(foreach crate,$(RUSTC_CRATES),$(eval $(call ADD_MIR_FLAG,$(crate)))) +$(foreach crate,$(HOST_CRATES),$(eval $(call ADD_MIR_FLAG,$(crate)))) + # platform-specific auto-configuration include $(CFG_SRC_DIR)mk/platform.mk @@ -294,7 +306,7 @@ LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version) LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir) LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir) LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir) -LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))" +LLVM_LIBDIR_RUSTFLAGS_$(1)=-L native="$$(LLVM_LIBDIR_$(1))" LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags) ifeq ($$(findstring freebsd,$(1)),freebsd) # On FreeBSD, it may search wrong headers (that are for pre-installed LLVM), diff --git a/mk/platform.mk b/mk/platform.mk index 60fe22cb32..fcb6a5b50d 100644 --- a/mk/platform.mk +++ b/mk/platform.mk @@ -113,8 +113,7 @@ CFG_RLIB_GLOB=lib$(1)-*.rlib include $(wildcard $(CFG_SRC_DIR)mk/cfg/*.mk) define ADD_INSTALLED_OBJECTS - INSTALLED_OBJECTS_$(1) += $$(call CFG_STATIC_LIB_NAME_$(1),morestack) \ - $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt) + INSTALLED_OBJECTS_$(1) += $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt) endef $(foreach target,$(CFG_TARGET), \ @@ -238,56 +237,3 @@ endef $(foreach target,$(CFG_TARGET), \ $(eval $(call CFG_MAKE_TOOLCHAIN,$(target)))) - -# There are more comments about this available in the target specification for -# Windows MSVC in the compiler, but the gist of it is that we use `llvm-ar.exe` -# instead of `lib.exe` for assembling archives, so we need to inject this custom -# dependency here. -define ADD_LLVM_AR_TO_MSVC_DEPS -ifeq ($$(findstring msvc,$(1)),msvc) -NATIVE_TOOL_DEPS_core_T_$(1) += llvm-ar.exe -INSTALLED_BINS_$(1) += llvm-ar.exe -endif -endef - -$(foreach target,$(CFG_TARGET), \ - $(eval $(call ADD_LLVM_AR_TO_MSVC_DEPS,$(target)))) - -# When working with MSVC on windows, each DLL needs to explicitly declare its -# interface to the outside world through some means. The options for doing so -# include: -# -# 1. A custom attribute on each function itself -# 2. A linker argument saying what to export -# 3. A file which lists all symbols that need to be exported -# -# The Rust compiler takes care (1) for us for all Rust code by annotating all -# public-facing functions with dllexport, but we have a few native dependencies -# which need to cross the DLL boundary. The most important of these dependencies -# is LLVM which is linked into `rustc_llvm.dll` but primarily used from -# `rustc_trans.dll`. This means that many of LLVM's C API functions need to be -# exposed from `rustc_llvm.dll` to be forwarded over the boundary. -# -# Unfortunately, at this time, LLVM does not handle this sort of exportation on -# Windows for us, so we're forced to do it ourselves if we want it (which seems -# like the path of least resistance right now). To do this we generate a `.DEF` -# file [1] which we then custom-pass to the linker when building the rustc_llvm -# crate. This DEF file list all symbols that are exported from -# `src/librustc_llvm/lib.rs` and is generated by a small python script. -# -# Fun times! -# -# [1]: https://msdn.microsoft.com/en-us/library/28d6s79h.aspx -define ADD_RUSTC_LLVM_DEF_TO_MSVC -ifeq ($$(findstring msvc,$(1)),msvc) -RUSTFLAGS_rustc_llvm_T_$(1) += -C link-args="-DEF:$(1)/rt/rustc_llvm.def" -CUSTOM_DEPS_rustc_llvm_T_$(1) += $(1)/rt/rustc_llvm.def - -$(1)/rt/rustc_llvm.def: $$(S)src/etc/mklldef.py $$(S)src/librustc_llvm/lib.rs - $$(CFG_PYTHON) $$^ $$@ rustc_llvm-$$(CFG_FILENAME_EXTRA) -endif -endef - -$(foreach target,$(CFG_TARGET), \ - $(eval $(call ADD_RUSTC_LLVM_DEF_TO_MSVC,$(target)))) - diff --git a/mk/rt.mk b/mk/rt.mk index 69277e774e..1f60aaed47 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -35,8 +35,7 @@ # that's per-target so you're allowed to conditionally add files based on the # target. ################################################################################ -NATIVE_LIBS := rust_builtin hoedown morestack miniz \ - rustrt_native rust_test_helpers +NATIVE_LIBS := rust_builtin hoedown miniz rust_test_helpers # $(1) is the target triple define NATIVE_LIBRARIES @@ -53,10 +52,7 @@ NATIVE_DEPS_hoedown_$(1) := hoedown/src/autolink.c \ NATIVE_DEPS_miniz_$(1) = miniz.c NATIVE_DEPS_rust_builtin_$(1) := rust_builtin.c \ rust_android_dummy.c -NATIVE_DEPS_rustrt_native_$(1) := arch/$$(HOST_$(1))/record_sp.S NATIVE_DEPS_rust_test_helpers_$(1) := rust_test_helpers.c -NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S - ################################################################################ # You shouldn't find it that necessary to edit anything below this line. @@ -188,8 +184,6 @@ $$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS) EXTRA_CFLAGS="-g1 -ffunction-sections -fdata-sections" $$(Q)$$(MAKE) -C "$$(JEMALLOC_BUILD_DIR_$(1))" build_lib_static -ifeq ($$(CFG_DISABLE_JEMALLOC),) -RUSTFLAGS_alloc := --cfg jemalloc ifeq ($(1),$$(CFG_BUILD)) ifneq ($$(CFG_JEMALLOC_ROOT),) $$(JEMALLOC_LIB_$(1)): $$(CFG_JEMALLOC_ROOT)/libjemalloc_pic.a @@ -203,10 +197,6 @@ else $$(JEMALLOC_LIB_$(1)): $$(JEMALLOC_LOCAL_$(1)) $$(Q)cp $$< $$@ endif -else -$$(JEMALLOC_LIB_$(1)): $$(MKFILE_DEPS) - $$(Q)touch $$@ -endif ################################################################################ # compiler-rt @@ -269,8 +259,10 @@ BACKTRACE_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),backtrace) BACKTRACE_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(BACKTRACE_NAME_$(1)) BACKTRACE_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/libbacktrace -# We don't use this on platforms that aren't linux-based, so just make the file -# available, the compilation of libstd won't actually build it. +# We don't use this on platforms that aren't linux-based (with the exception of +# msys2/mingw builds on windows, which use it to read the dwarf debug +# information) so just make the file available, the compilation of libstd won't +# actually build it. ifeq ($$(findstring darwin,$$(OSTYPE_$(1))),darwin) # See comment above $$(BACKTRACE_LIB_$(1)): @@ -283,7 +275,7 @@ $$(BACKTRACE_LIB_$(1)): touch $$@ else -ifeq ($$(CFG_WINDOWSY_$(1)),1) +ifeq ($$(findstring msvc,$(1)),msvc) # See comment above $$(BACKTRACE_LIB_$(1)): touch $$@ @@ -306,16 +298,25 @@ endif # ./configure script. This is done to force libbacktrace to *not* use the # atomic/sync functionality because it pulls in unnecessary dependencies and we # never use it anyway. +# +# We also use `env PWD=` to clear the PWD environment variable, and then +# execute the command in a new shell. This is necessary to workaround a +# buildbot/msys2 bug: the shell is launched with PWD set to a windows-style path, +# which results in all further uses of `pwd` also printing a windows-style path, +# which breaks libbacktrace's configure script. Clearing PWD within the same +# shell is not sufficient. + $$(BACKTRACE_BUILD_DIR_$(1))/Makefile: $$(BACKTRACE_DEPS) $$(MKFILE_DEPS) @$$(call E, configure: libbacktrace for $(1)) $$(Q)rm -rf $$(BACKTRACE_BUILD_DIR_$(1)) $$(Q)mkdir -p $$(BACKTRACE_BUILD_DIR_$(1)) - $$(Q)(cd $$(BACKTRACE_BUILD_DIR_$(1)) && \ + $$(Q)(cd $$(BACKTRACE_BUILD_DIR_$(1)) && env \ + PWD= \ CC="$$(CC_$(1))" \ AR="$$(AR_$(1))" \ RANLIB="$$(AR_$(1)) s" \ CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1):-Werror=) -fno-stack-protector" \ - $(S)src/libbacktrace/configure --target=$(1) --host=$(CFG_BUILD)) + $(S)src/libbacktrace/configure --build=$(CFG_GNU_TRIPLE_$(CFG_BUILD)) --host=$(CFG_GNU_TRIPLE_$(1))) $$(Q)echo '#undef HAVE_ATOMIC_FUNCTIONS' >> \ $$(BACKTRACE_BUILD_DIR_$(1))/config.h $$(Q)echo '#undef HAVE_SYNC_FUNCTIONS' >> \ @@ -327,7 +328,7 @@ $$(BACKTRACE_LIB_$(1)): $$(BACKTRACE_BUILD_DIR_$(1))/Makefile $$(MKFILE_DEPS) INCDIR=$(S)src/libbacktrace $$(Q)cp $$(BACKTRACE_BUILD_DIR_$(1))/.libs/libbacktrace.a $$@ -endif # endif for windowsy +endif # endif for msvc endif # endif for ios endif # endif for darwin diff --git a/mk/target.mk b/mk/target.mk index c2de9af39c..d6fa55bf7f 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -13,6 +13,10 @@ # this exists can be found on issue #2400 export CFG_COMPILER_HOST_TRIPLE +# Used as defaults for the runtime ar and cc tools +export CFG_DEFAULT_LINKER +export CFG_DEFAULT_AR + # The standard libraries should be held up to a higher standard than any old # code, make sure that these common warnings are denied by default. These can # be overridden during development temporarily. For stage0, we allow warnings @@ -37,10 +41,7 @@ CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4) := \ $$(foreach dep,$$(NATIVE_DEPS_$(4)), \ $$(RT_OUTPUT_DIR_$(2))/$$(call CFG_STATIC_LIB_NAME_$(2),$$(dep))) \ $$(foreach dep,$$(NATIVE_DEPS_$(4)_T_$(2)), \ - $$(RT_OUTPUT_DIR_$(2))/$$(dep)) \ - $$(foreach dep,$$(NATIVE_TOOL_DEPS_$(4)_T_$(2)), \ - $$(TBIN$(1)_T_$(3)_H_$(3))/$$(dep)) \ - $$(CUSTOM_DEPS_$(4)_T_$(2)) + $$(RT_OUTPUT_DIR_$(2))/$$(dep)) endef $(foreach host,$(CFG_HOST), \ @@ -56,8 +57,7 @@ $(foreach host,$(CFG_HOST), \ # 1. The immediate dependencies are the rust source files # 2. Each rust crate dependency is listed (based on their stamp files), # as well as all native dependencies (listed in RT_OUTPUT_DIR) -# 3. The stage (n-1) compiler is required through the TSREQ dependency, along -# with the morestack library +# 3. The stage (n-1) compiler is required through the TSREQ dependency # 4. When actually executing the rule, the first thing we do is to clean out # old libs and rlibs via the REMOVE_ALL_OLD_GLOB_MATCHES macro # 5. Finally, we get around to building the actual crate. It's just one @@ -93,7 +93,8 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \ $$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \ $$(LLVM_STDCPP_RUSTFLAGS_$(2)) \ $$(RUSTFLAGS_$(4)) \ - $$(RUSTFLAGS_$(4)_T_$(2)) \ + $$(RUSTFLAGS$(1)_$(4)) \ + $$(RUSTFLAGS$(1)_$(4)_T_$(2)) \ --out-dir $$(@D) \ -C extra-filename=-$$(CFG_FILENAME_EXTRA) \ $$< @@ -143,9 +144,6 @@ SNAPSHOT_RUSTC_POST_CLEANUP=$(HBIN0_H_$(CFG_BUILD))/rustc$(X_$(CFG_BUILD)) define TARGET_HOST_RULES -$$(TBIN$(1)_T_$(2)_H_$(3))/: - mkdir -p $$@ - $$(TLIB$(1)_T_$(2)_H_$(3))/: mkdir -p $$@ @@ -153,11 +151,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/%: $$(RT_OUTPUT_DIR_$(2))/% \ | $$(TLIB$(1)_T_$(2)_H_$(3))/ $$(SNAPSHOT_RUSTC_POST_CLEANUP) @$$(call E, cp: $$@) $$(Q)cp $$< $$@ - -$$(TBIN$(1)_T_$(2)_H_$(3))/%: $$(CFG_LLVM_INST_DIR_$(2))/bin/% \ - | $$(TBIN$(1)_T_$(2)_H_$(3))/ $$(SNAPSHOT_RUSTC_POST_CLEANUP) - @$$(call E, cp: $$@) - $$(Q)cp $$< $$@ endef $(foreach source,$(CFG_HOST), \ @@ -181,77 +174,3 @@ $(foreach host,$(CFG_HOST), \ $(foreach stage,$(STAGES), \ $(foreach tool,$(TOOLS), \ $(eval $(call TARGET_TOOL,$(stage),$(target),$(host),$(tool))))))) - -# We have some triples which are bootstrapped from other triples, and this means -# that we need to fixup some of the native tools that a triple depends on. -# -# For example, MSVC requires the llvm-ar.exe executable to manage archives, but -# it bootstraps from the GNU Windows triple. This means that the compiler will -# add this directory to PATH when executing new processes: -# -# $SYSROOT/rustlib/x86_64-pc-windows-gnu/bin -# -# Unfortunately, however, the GNU triple is not known about in stage0, so the -# tools are actually located in: -# -# $SYSROOT/rustlib/x86_64-pc-windows-msvc/bin -# -# To remedy this problem, the rules below copy all native tool dependencies into -# the bootstrap triple's location in stage 0 so the bootstrap compiler can find -# the right sets of tools. Later stages (1+) will have the right host triple for -# the compiler, so there's no need to worry there. -# -# $(1) - stage -# $(2) - triple that's being used as host/target -# $(3) - triple snapshot is built for -# $(4) - crate -# $(5) - tool -define MOVE_TOOLS_TO_SNAPSHOT_HOST_DIR -ifneq (,$(3)) -$$(TLIB$(1)_T_$(2)_H_$(2))/stamp.$(4): $$(HLIB$(1)_H_$(2))/rustlib/$(3)/bin/$(5) - -$$(HLIB$(1)_H_$(2))/rustlib/$(3)/bin/$(5): $$(TBIN$(1)_T_$(2)_H_$(2))/$(5) - mkdir -p $$(@D) - cp $$< $$@ -endif -endef - -$(foreach target,$(CFG_TARGET), \ - $(foreach crate,$(CRATES), \ - $(foreach tool,$(NATIVE_TOOL_DEPS_$(crate)_T_$(target)), \ - $(eval $(call MOVE_TOOLS_TO_SNAPSHOT_HOST_DIR,0,$(target),$(BOOTSTRAP_FROM_$(target)),$(crate),$(tool)))))) - -# For MSVC targets we need to set up some environment variables for the linker -# to work correctly when building Rust crates. These two variables are: -# -# - LIB tells the linker the default search path for finding system libraries, -# for example kernel32.dll -# - PATH needs to be modified to ensure that MSVC's link.exe is first in the -# path instead of MinGW's /usr/bin/link.exe (entirely unrelated) -# -# The values for these variables are detected by the configure script. -define SETUP_LIB_MSVC_ENV_VARS -ifeq ($$(findstring msvc,$(2)),msvc) -$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \ - export LIB := $$(CFG_MSVC_LIB_PATH_$$(HOST_$(2))) -$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \ - export PATH := $$(CFG_MSVC_BINDIR_$$(HOST_$(2))):$$(PATH) -endif -endef -define SETUP_TOOL_MSVC_ENV_VARS -ifeq ($$(findstring msvc,$(2)),msvc) -$$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \ - export LIB := $$(CFG_MSVC_LIB_PATH_$$(HOST_$(2))) -$$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \ - export PATH := $$(CFG_MSVC_BINDIR_$$(HOST_$(2))):$$(PATH) -endif -endef - -$(foreach host,$(CFG_HOST), \ - $(foreach target,$(CFG_TARGET), \ - $(foreach crate,$(CRATES), \ - $(eval $(call SETUP_LIB_MSVC_ENV_VARS,0,$(target),$(host),$(crate)))))) -$(foreach host,$(CFG_HOST), \ - $(foreach target,$(CFG_TARGET), \ - $(foreach tool,$(TOOLS), \ - $(eval $(call SETUP_TOOL_MSVC_ENV_VARS,0,$(target),$(host),$(tool)))))) diff --git a/mk/tests.mk b/mk/tests.mk index 9341166beb..e0984cfe86 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -22,7 +22,8 @@ $(eval $(call RUST_CRATE,coretest)) DEPS_collectionstest := $(eval $(call RUST_CRATE,collectionstest)) -TEST_TARGET_CRATES = $(filter-out core rustc_unicode,$(TARGET_CRATES)) \ +TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system \ + alloc_jemalloc,$(TARGET_CRATES)) \ collectionstest coretest TEST_DOC_CRATES = $(DOC_CRATES) TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve \ @@ -95,7 +96,8 @@ ifdef CFG_WINDOWSY_$(1) $$(if $$(findstring stage3,$$(1)), \ stage3/$$(CFG_LIBDIR_RELATIVE), \ )))))/rustlib/$$(CFG_BUILD)/lib - CFG_RUN_TEST_$(1)=$$(call CFG_RUN_$(1),$$(call CFG_TESTLIB_$(1),$$(1),$$(4)),$$(1)) + CFG_RUN_TEST_$(1)=$$(TARGET_RPATH_VAR$$(2)_T_$$(3)_H_$$(4)) \ + $$(call CFG_RUN_$(1),$$(call CFG_TESTLIB_$(1),$$(1),$$(4)),$$(1)) endif # Run the compiletest runner itself under valgrind @@ -267,9 +269,10 @@ tidy-basic: .PHONY: tidy-binaries tidy-binaries: @$(call E, check: binaries) - $(Q)find $(S)src -type f -perm +a+x \ + $(Q)find $(S)src -type f \ + \( -perm -u+x -or -perm -g+x -or -perm -o+x \) \ -not -name '*.rs' -and -not -name '*.py' \ - -and -not -name '*.sh' \ + -and -not -name '*.sh' -and -not -name '*.pp' \ | grep '^$(S)src/jemalloc' -v \ | grep '^$(S)src/libuv' -v \ | grep '^$(S)src/llvm' -v \ @@ -596,6 +599,10 @@ CTEST_DISABLE_debuginfo-gdb = CTEST_DISABLE_debuginfo-lldb = "lldb tests are disabled on android" endif +ifeq ($(findstring msvc,$(CFG_TARGET)),msvc) +CTEST_DISABLE_debuginfo-gdb = "gdb tests are disabled on MSVC" +endif + # CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that # test group to be disabled *unless* the target is able to build a # compiler (i.e. when the target triple is in the set of of host @@ -1049,7 +1056,8 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \ $$(MAKE) \ $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \ $(3)/test/run-make/$$* \ - "$$(CC_$(3)) $$(CFG_GCCISH_CFLAGS_$(3))" \ + $$(CC_$(3)) \ + "$$(CFG_GCCISH_CFLAGS_$(3))" \ $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \ "$$(TESTNAME)" \ $$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3)) \ diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index 36c6763910..f508798a8b 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -19,6 +19,7 @@ #![feature(str_char)] #![feature(test)] #![feature(vec_push_all)] +#![feature(path_components_peek)] #![deny(warnings)] @@ -177,7 +178,7 @@ pub fn log_config(config: &Config) { logv(c, format!("filter: {}", opt_str(&config.filter .as_ref() - .map(|re| re.to_string())))); + .map(|re| re.to_owned())))); logv(c, format!("runtool: {}", opt_str(&config.runtool))); logv(c, format!("host-rustcflags: {}", opt_str(&config.host_rustcflags))); @@ -204,19 +205,16 @@ pub fn opt_str<'a>(maybestr: &'a Option) -> &'a str { pub fn opt_str2(maybestr: Option) -> String { match maybestr { - None => "(none)".to_string(), + None => "(none)".to_owned(), Some(s) => s, } } pub fn run_tests(config: &Config) { if config.target.contains("android") { - match config.mode { - DebugInfoGdb => { - println!("{} debug-info test uses tcp 5039 port.\ - please reserve it", config.target); - } - _ =>{} + if let DebugInfoGdb = config.mode { + println!("{} debug-info test uses tcp 5039 port.\ + please reserve it", config.target); } // android debug-info test uses remote debugger @@ -288,10 +286,10 @@ pub fn is_test(config: &Config, testfile: &Path) -> bool { // Pretty-printer does not work with .rc files yet let valid_extensions = match config.mode { - Pretty => vec!(".rs".to_string()), - _ => vec!(".rc".to_string(), ".rs".to_string()) + Pretty => vec!(".rs".to_owned()), + _ => vec!(".rc".to_owned(), ".rs".to_owned()) }; - let invalid_prefixes = vec!(".".to_string(), "#".to_string(), "~".to_string()); + let invalid_prefixes = vec!(".".to_owned(), "#".to_owned(), "~".to_owned()); let name = testfile.file_name().unwrap().to_str().unwrap(); let mut valid = false; @@ -363,7 +361,7 @@ fn extract_gdb_version(full_version_line: Option) -> Option { full_version_line.char_at(pos + 3).is_digit(10) { continue } - return Some(full_version_line[pos..pos+3].to_string()); + return Some(full_version_line[pos..pos+3].to_owned()); } println!("Could not extract GDB version from line '{}'", full_version_line); @@ -385,9 +383,8 @@ fn extract_lldb_version(full_version_line: Option) -> Option { // We are only interested in the major version number, so this function // will return `Some("179")` and `Some("300")` respectively. - match full_version_line { - Some(ref full_version_line) - if !full_version_line.trim().is_empty() => { + if let Some(ref full_version_line) = full_version_line { + if !full_version_line.trim().is_empty() { let full_version_line = full_version_line.trim(); for (pos, l) in full_version_line.char_indices() { @@ -409,8 +406,7 @@ fn extract_lldb_version(full_version_line: Option) -> Option { } println!("Could not extract LLDB version from line '{}'", full_version_line); - None - }, - _ => None + } } + None } diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index 4b2a3e0283..a3ad022ebd 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -76,7 +76,7 @@ fn parse_expected(last_nonfollow_error: Option, let letters = line[kind_start..].chars(); let msg = letters.skip_while(|c| c.is_whitespace()) .skip_while(|c| !c.is_whitespace()) - .collect::().trim().to_string(); + .collect::().trim().to_owned(); let (which, line) = if follow { assert!(adjusts == 0, "use either //~| or //~^, not both."); diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index a648e51497..9de46cef74 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -67,10 +67,9 @@ pub fn load_props(testfile: &Path) -> TestProps { let mut pretty_compare_only = false; let mut forbid_output = Vec::new(); iter_header(testfile, &mut |ln| { - match parse_error_pattern(ln) { - Some(ep) => error_patterns.push(ep), - None => () - }; + if let Some(ep) = parse_error_pattern(ln) { + error_patterns.push(ep); + } if compile_flags.is_none() { compile_flags = parse_compile_flags(ln); @@ -108,24 +107,20 @@ pub fn load_props(testfile: &Path) -> TestProps { pretty_compare_only = parse_pretty_compare_only(ln); } - match parse_aux_build(ln) { - Some(ab) => { aux_builds.push(ab); } - None => {} + if let Some(ab) = parse_aux_build(ln) { + aux_builds.push(ab); } - match parse_exec_env(ln) { - Some(ee) => { exec_env.push(ee); } - None => {} + if let Some(ee) = parse_exec_env(ln) { + exec_env.push(ee); } - match parse_check_line(ln) { - Some(cl) => check_lines.push(cl), - None => () - }; + if let Some(cl) = parse_check_line(ln) { + check_lines.push(cl); + } - match parse_forbid_output(ln) { - Some(of) => forbid_output.push(of), - None => (), + if let Some(of) = parse_forbid_output(ln) { + forbid_output.push(of); } true @@ -134,8 +129,8 @@ pub fn load_props(testfile: &Path) -> TestProps { for key in vec!["RUST_TEST_NOCAPTURE", "RUST_TEST_THREADS"] { match env::var(key) { Ok(val) => - if exec_env.iter().find(|&&(ref x, _)| *x == key.to_string()).is_none() { - exec_env.push((key.to_string(), val)) + if exec_env.iter().find(|&&(ref x, _)| *x == key).is_none() { + exec_env.push((key.to_owned(), val)) }, Err(..) => {} } @@ -153,7 +148,7 @@ pub fn load_props(testfile: &Path) -> TestProps { check_stdout: check_stdout, no_prefer_dynamic: no_prefer_dynamic, pretty_expanded: pretty_expanded, - pretty_mode: pretty_mode.unwrap_or("normal".to_string()), + pretty_mode: pretty_mode.unwrap_or("normal".to_owned()), pretty_compare_only: pretty_compare_only, forbid_output: forbid_output, } @@ -182,22 +177,21 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool { return true; } - match config.gdb_version { - Some(ref actual_version) => { - if line.contains("min-gdb-version") { - let min_version = line.trim() - .split(' ') - .last() - .expect("Malformed GDB version directive"); - // Ignore if actual version is smaller the minimum required - // version - gdb_version_to_int(actual_version) < - gdb_version_to_int(min_version) - } else { - false - } + if let Some(ref actual_version) = config.gdb_version { + if line.contains("min-gdb-version") { + let min_version = line.trim() + .split(' ') + .last() + .expect("Malformed GDB version directive"); + // Ignore if actual version is smaller the minimum required + // version + gdb_version_to_int(actual_version) < + gdb_version_to_int(min_version) + } else { + false } - None => false + } else { + false } } @@ -210,22 +204,21 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool { return true; } - match config.lldb_version { - Some(ref actual_version) => { - if line.contains("min-lldb-version") { - let min_version = line.trim() - .split(' ') - .last() - .expect("Malformed lldb version directive"); - // Ignore if actual version is smaller the minimum required - // version - lldb_version_to_int(actual_version) < - lldb_version_to_int(min_version) - } else { - false - } + if let Some(ref actual_version) = config.lldb_version { + if line.contains("min-lldb-version") { + let min_version = line.trim() + .split(' ') + .last() + .expect("Malformed lldb version directive"); + // Ignore if actual version is smaller the minimum required + // version + lldb_version_to_int(actual_version) < + lldb_version_to_int(min_version) + } else { + false } - None => false + } else { + false } } @@ -316,11 +309,11 @@ fn parse_exec_env(line: &str) -> Option<(String, String)> { // nv is either FOO or FOO=BAR let mut strs: Vec = nv .splitn(2, '=') - .map(|s| s.to_string()) + .map(str::to_owned) .collect(); match strs.len() { - 1 => (strs.pop().unwrap(), "".to_string()), + 1 => (strs.pop().unwrap(), "".to_owned()), 2 => { let end = strs.pop().unwrap(); (strs.pop().unwrap(), end) @@ -331,33 +324,31 @@ fn parse_exec_env(line: &str) -> Option<(String, String)> { } fn parse_pp_exact(line: &str, testfile: &Path) -> Option { - match parse_name_value_directive(line, "pp-exact") { - Some(s) => Some(PathBuf::from(&s)), - None => { + if let Some(s) = parse_name_value_directive(line, "pp-exact") { + Some(PathBuf::from(&s)) + } else { if parse_name_directive(line, "pp-exact") { - testfile.file_name().map(|s| PathBuf::from(s)) + testfile.file_name().map(PathBuf::from) } else { None } - } } } fn parse_name_directive(line: &str, directive: &str) -> bool { // This 'no-' rule is a quick hack to allow pretty-expanded and no-pretty-expanded to coexist - line.contains(directive) && !line.contains(&("no-".to_string() + directive)) + line.contains(directive) && !line.contains(&("no-".to_owned() + directive)) } pub fn parse_name_value_directive(line: &str, directive: &str) -> Option { let keycolon = format!("{}:", directive); - match line.find(&keycolon) { - Some(colon) => { - let value = line[(colon + keycolon.len()) .. line.len()].to_string(); - debug!("{}: {}", directive, value); - Some(value) - } - None => None + if let Some(colon) = line.find(&keycolon) { + let value = line[(colon + keycolon.len()) .. line.len()].to_owned(); + debug!("{}: {}", directive, value); + Some(value) + } else { + None } } diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs index b30efaa6c2..66fa0dfecd 100644 --- a/src/compiletest/procsrv.rs +++ b/src/compiletest/procsrv.rs @@ -17,17 +17,15 @@ fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) { // Need to be sure to put both the lib_path and the aux path in the dylib // search path for the child. let mut path = DynamicLibrary::search_path(); - match aux_path { - Some(p) => path.insert(0, PathBuf::from(p)), - None => {} + if let Some(p) = aux_path { + path.insert(0, PathBuf::from(p)) } path.insert(0, PathBuf::from(lib_path)); // Add the new dylib search path var let var = DynamicLibrary::envvar(); let newpath = DynamicLibrary::create_path(&path); - let newpath = newpath.to_str().unwrap().to_string(); - cmd.env(var, &newpath); + cmd.env(var, newpath); } pub struct Result {pub status: ExitStatus, pub out: String, pub err: String} diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 5b62f29b82..12f560be45 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -25,7 +25,7 @@ use std::fs::{self, File}; use std::io::BufReader; use std::io::prelude::*; use std::net::TcpStream; -use std::path::{Path, PathBuf}; +use std::path::{Path, PathBuf, Component}; use std::process::{Command, Output, ExitStatus}; pub fn run(config: Config, testfile: &Path) { @@ -165,9 +165,9 @@ fn run_valgrind_test(config: &Config, props: &TestProps, testfile: &Path) { fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) { if props.pp_exact.is_some() { - logv(config, "testing for exact pretty-printing".to_string()); + logv(config, "testing for exact pretty-printing".to_owned()); } else { - logv(config, "testing for converging pretty-printing".to_string()); + logv(config, "testing for converging pretty-printing".to_owned()); } let rounds = @@ -183,7 +183,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) { let proc_res = print_source(config, props, testfile, - srcs[round].to_string(), + srcs[round].to_owned(), &props.pretty_mode); if !proc_res.status.success() { @@ -209,9 +209,9 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) { if props.pp_exact.is_some() { // Now we have to care about line endings - let cr = "\r".to_string(); - actual = actual.replace(&cr, "").to_string(); - expected = expected.replace(&cr, "").to_string(); + let cr = "\r".to_owned(); + actual = actual.replace(&cr, "").to_owned(); + expected = expected.replace(&cr, "").to_owned(); } compare_source(&expected, &actual); @@ -253,7 +253,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) { make_pp_args(config, props, testfile, - pretty_type.to_string()), + pretty_type.to_owned()), props.exec_env.clone(), &config.compile_lib_path, Some(aux_dir.to_str().unwrap()), @@ -266,17 +266,17 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) { pretty_type: String) -> ProcArgs { let aux_dir = aux_output_dir_name(config, testfile); // FIXME (#9639): This needs to handle non-utf8 paths - let mut args = vec!("-".to_string(), - "-Zunstable-options".to_string(), - "--pretty".to_string(), + let mut args = vec!("-".to_owned(), + "-Zunstable-options".to_owned(), + "--unpretty".to_owned(), pretty_type, format!("--target={}", config.target), - "-L".to_string(), - aux_dir.to_str().unwrap().to_string()); + "-L".to_owned(), + aux_dir.to_str().unwrap().to_owned()); args.extend(split_maybe_args(&config.target_rustcflags)); args.extend(split_maybe_args(&props.compile_flags)); return ProcArgs { - prog: config.rustc_path.to_str().unwrap().to_string(), + prog: config.rustc_path.to_str().unwrap().to_owned(), args: args, }; } @@ -313,19 +313,18 @@ actual:\n\ &*config.target }; // FIXME (#9639): This needs to handle non-utf8 paths - let mut args = vec!("-".to_string(), - "-Zno-trans".to_string(), - "--crate-type=lib".to_string(), + let mut args = vec!("-".to_owned(), + "-Zno-trans".to_owned(), format!("--target={}", target), - "-L".to_string(), - config.build_base.to_str().unwrap().to_string(), - "-L".to_string(), - aux_dir.to_str().unwrap().to_string()); + "-L".to_owned(), + config.build_base.to_str().unwrap().to_owned(), + "-L".to_owned(), + aux_dir.to_str().unwrap().to_owned()); args.extend(split_maybe_args(&config.target_rustcflags)); args.extend(split_maybe_args(&props.compile_flags)); // FIXME (#9639): This needs to handle non-utf8 paths return ProcArgs { - prog: config.rustc_path.to_str().unwrap().to_string(), + prog: config.rustc_path.to_str().unwrap().to_owned(), args: args, }; } @@ -388,24 +387,24 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) { &config.adb_path, None, &[ - "push".to_string(), - exe_file.to_str().unwrap().to_string(), + "push".to_owned(), + exe_file.to_str().unwrap().to_owned(), config.adb_test_dir.clone() ], - vec!(("".to_string(), "".to_string())), - Some("".to_string())) + vec!(("".to_owned(), "".to_owned())), + Some("".to_owned())) .expect(&format!("failed to exec `{:?}`", config.adb_path)); procsrv::run("", &config.adb_path, None, &[ - "forward".to_string(), - "tcp:5039".to_string(), - "tcp:5039".to_string() + "forward".to_owned(), + "tcp:5039".to_owned(), + "tcp:5039".to_owned() ], - vec!(("".to_string(), "".to_string())), - Some("".to_string())) + vec!(("".to_owned(), "".to_owned())), + Some("".to_owned())) .expect(&format!("failed to exec `{:?}`", config.adb_path)); let adb_arg = format!("export LD_LIBRARY_PATH={}; \ @@ -422,12 +421,12 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) { , None, &[ - "shell".to_string(), + "shell".to_owned(), adb_arg.clone() ], - vec!(("".to_string(), - "".to_string())), - Some("".to_string())) + vec!(("".to_owned(), + "".to_owned())), + Some("".to_owned())) .expect(&format!("failed to exec `{:?}`", config.adb_path)); loop { //waiting 1 second for gdbserver start @@ -438,16 +437,16 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) { } let tool_path = match config.android_cross_path.to_str() { - Some(x) => x.to_string(), + Some(x) => x.to_owned(), None => fatal("cannot find android cross path") }; let debugger_script = make_out_name(config, testfile, "debugger.script"); // FIXME (#9639): This needs to handle non-utf8 paths let debugger_opts = - vec!("-quiet".to_string(), - "-batch".to_string(), - "-nx".to_string(), + vec!("-quiet".to_owned(), + "-batch".to_owned(), + "-nx".to_owned(), format!("-command={}", debugger_script.to_str().unwrap())); let mut gdb_path = tool_path; @@ -460,7 +459,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) { &gdb_path, None, &debugger_opts, - vec!(("".to_string(), "".to_string())), + vec!(("".to_owned(), "".to_owned())), None) .expect(&format!("failed to exec `{:?}`", gdb_path)); let cmdline = { @@ -489,7 +488,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) { let rust_pp_module_abs_path = rust_src_root.join(rust_pp_module_rel_path) .to_str() .unwrap() - .to_string(); + .to_owned(); // write debugger script let mut script_str = String::with_capacity(2048); script_str.push_str(&format!("set charset {}\n", charset())); @@ -555,17 +554,17 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) { // FIXME (#9639): This needs to handle non-utf8 paths let debugger_opts = - vec!("-quiet".to_string(), - "-batch".to_string(), - "-nx".to_string(), + vec!("-quiet".to_owned(), + "-batch".to_owned(), + "-nx".to_owned(), format!("-command={}", debugger_script.to_str().unwrap())); let proc_args = ProcArgs { - prog: debugger().to_string(), + prog: debugger().to_owned(), args: debugger_opts, }; - let environment = vec![("PYTHONPATH".to_string(), rust_pp_module_abs_path)]; + let environment = vec![("PYTHONPATH".to_owned(), rust_pp_module_abs_path)]; debugger_run_result = compose_and_run(config, testfile, @@ -651,7 +650,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path) let rust_pp_module_abs_path = rust_src_root.join(rust_pp_module_rel_path) .to_str() .unwrap() - .to_string(); + .to_owned(); script_str.push_str(&format!("command script import {}\n", &rust_pp_module_abs_path[..])[..]); @@ -791,9 +790,9 @@ fn cleanup_debug_info_options(options: &Option) -> Option { // Remove options that are either unwanted (-O) or may lead to duplicates due to RUSTFLAGS. let options_to_remove = [ - "-O".to_string(), - "-g".to_string(), - "--debuginfo".to_string() + "-O".to_owned(), + "-g".to_owned(), + "--debuginfo".to_owned() ]; let new_options = split_maybe_args(options).into_iter() @@ -813,7 +812,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String]) s .trim() .split("[...]") - .map(|x| x.to_string()) + .map(str::to_owned) .collect() }).collect(); // check if each line in props.check_lines appears in the @@ -953,6 +952,9 @@ fn check_expected_errors(expected_errors: Vec, // filename:line1:col1: line2:col2: *warning:* msg // where line1:col1: is the starting point, line2:col2: // is the ending point, and * represents ANSI color codes. + // + // This pattern is ambiguous on windows, because filename may contain + // a colon, so any path prefix must be detected and removed first. for line in proc_res.stderr.lines() { let mut was_expected = false; let mut prev = 0; @@ -1007,7 +1009,16 @@ fn check_expected_errors(expected_errors: Vec, } } -fn is_compiler_error_or_warning(line: &str) -> bool { +fn is_compiler_error_or_warning(mut line: &str) -> bool { + // Remove initial prefix which may contain a colon + let mut components = Path::new(line).components(); + if let Some(Component::Prefix(_)) = components.peek() { + components.next(); + } + + // Safe as path was originally constructed from a &str ^ + line = components.as_path().to_str().unwrap(); + let mut i = 0; return scan_until_char(line, ':', &mut i) && @@ -1128,8 +1139,8 @@ fn compile_test(config: &Config, props: &TestProps, testfile: &Path) -> ProcRes { let aux_dir = aux_output_dir_name(config, testfile); // FIXME (#9639): This needs to handle non-utf8 paths - let link_args = vec!("-L".to_string(), - aux_dir.to_str().unwrap().to_string()); + let link_args = vec!("-L".to_owned(), + aux_dir.to_str().unwrap().to_owned()); let args = make_compile_args(config, props, link_args, @@ -1143,14 +1154,14 @@ fn document(config: &Config, props: &TestProps, let out_dir = output_base_name(config, testfile); let _ = fs::remove_dir_all(&out_dir); ensure_dir(&out_dir); - let mut args = vec!["-L".to_string(), - aux_dir.to_str().unwrap().to_string(), - "-o".to_string(), - out_dir.to_str().unwrap().to_string(), - testfile.to_str().unwrap().to_string()]; + let mut args = vec!["-L".to_owned(), + aux_dir.to_str().unwrap().to_owned(), + "-o".to_owned(), + out_dir.to_str().unwrap().to_owned(), + testfile.to_str().unwrap().to_owned()]; args.extend(split_maybe_args(&props.compile_flags)); let args = ProcArgs { - prog: config.rustdoc_path.to_str().unwrap().to_string(), + prog: config.rustdoc_path.to_str().unwrap().to_owned(), args: args, }; (compose_and_run_compiler(config, props, testfile, args, None), out_dir) @@ -1189,8 +1200,8 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps, let aux_dir = aux_output_dir_name(config, testfile); // FIXME (#9639): This needs to handle non-utf8 paths - let extra_link_args = vec!["-L".to_string(), - aux_dir.to_str().unwrap().to_string()]; + let extra_link_args = vec!["-L".to_owned(), + aux_dir.to_str().unwrap().to_owned()]; for rel_ab in &props.aux_builds { let abs_ab = config.aux_base.join(rel_ab); @@ -1208,9 +1219,9 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps, // however, that if the library is built with `force_host` then it's // ok to be a dylib as the host should always support dylibs. if config.target.contains("musl") && !aux_props.force_host { - vec!("--crate-type=lib".to_string()) + vec!("--crate-type=lib".to_owned()) } else { - vec!("--crate-type=dylib".to_string()) + vec!("--crate-type=dylib".to_owned()) } }; crate_type.extend(extra_link_args.clone()); @@ -1290,26 +1301,26 @@ fn make_compile_args(config: &Config, &*config.target }; // FIXME (#9639): This needs to handle non-utf8 paths - let mut args = vec!(testfile.to_str().unwrap().to_string(), - "-L".to_string(), - config.build_base.to_str().unwrap().to_string(), + let mut args = vec!(testfile.to_str().unwrap().to_owned(), + "-L".to_owned(), + config.build_base.to_str().unwrap().to_owned(), format!("--target={}", target)); args.push_all(&extras); if !props.no_prefer_dynamic { - args.push("-C".to_string()); - args.push("prefer-dynamic".to_string()); + args.push("-C".to_owned()); + args.push("prefer-dynamic".to_owned()); } let path = match xform_file { TargetLocation::ThisFile(path) => { - args.push("-o".to_string()); + args.push("-o".to_owned()); path } TargetLocation::ThisDirectory(path) => { - args.push("--out-dir".to_string()); + args.push("--out-dir".to_owned()); path } }; - args.push(path.to_str().unwrap().to_string()); + args.push(path.to_str().unwrap().to_owned()); if props.force_host { args.extend(split_maybe_args(&config.host_rustcflags)); } else { @@ -1317,7 +1328,7 @@ fn make_compile_args(config: &Config, } args.extend(split_maybe_args(&props.compile_flags)); return ProcArgs { - prog: config.rustc_path.to_str().unwrap().to_string(), + prog: config.rustc_path.to_str().unwrap().to_owned(), args: args, }; } @@ -1347,7 +1358,7 @@ fn make_run_args(config: &Config, props: &TestProps, testfile: &Path) let exe_file = make_exe_name(config, testfile); // FIXME (#9639): This needs to handle non-utf8 paths - args.push(exe_file.to_str().unwrap().to_string()); + args.push(exe_file.to_str().unwrap().to_owned()); // Add the arguments in the run_flags directive args.extend(split_maybe_args(&props.run_flags)); @@ -1368,7 +1379,7 @@ fn split_maybe_args(argstr: &Option) -> Vec { if s.chars().all(|c| c.is_whitespace()) { None } else { - Some(s.to_string()) + Some(s.to_owned()) } }).collect() } @@ -1503,7 +1514,7 @@ fn _arm_exec_compiled_test(config: &Config, // get bare program string let mut tvec: Vec = args.prog .split('/') - .map(|ts| ts.to_string()) + .map(str::to_owned) .collect(); let prog_short = tvec.pop().unwrap(); @@ -1512,12 +1523,12 @@ fn _arm_exec_compiled_test(config: &Config, &config.adb_path, None, &[ - "push".to_string(), + "push".to_owned(), args.prog.clone(), config.adb_test_dir.clone() ], - vec!(("".to_string(), "".to_string())), - Some("".to_string())) + vec!(("".to_owned(), "".to_owned())), + Some("".to_owned())) .expect(&format!("failed to exec `{}`", config.adb_path)); if config.verbose { @@ -1533,7 +1544,7 @@ fn _arm_exec_compiled_test(config: &Config, let mut runargs = Vec::new(); // run test via adb_run_wrapper - runargs.push("shell".to_string()); + runargs.push("shell".to_owned()); for (key, val) in env { runargs.push(format!("{}={}", key, val)); } @@ -1542,19 +1553,19 @@ fn _arm_exec_compiled_test(config: &Config, runargs.push(format!("{}", prog_short)); for tv in &args.args { - runargs.push(tv.to_string()); + runargs.push(tv.to_owned()); } procsrv::run("", &config.adb_path, None, &runargs, - vec!(("".to_string(), "".to_string())), Some("".to_string())) + vec!(("".to_owned(), "".to_owned())), Some("".to_owned())) .expect(&format!("failed to exec `{}`", config.adb_path)); // get exitcode of result runargs = Vec::new(); - runargs.push("shell".to_string()); - runargs.push("cat".to_string()); + runargs.push("shell".to_owned()); + runargs.push("cat".to_owned()); runargs.push(format!("{}/{}.exitcode", config.adb_test_dir, prog_short)); let procsrv::Result{ out: exitcode_out, err: _, status: _ } = @@ -1562,8 +1573,8 @@ fn _arm_exec_compiled_test(config: &Config, &config.adb_path, None, &runargs, - vec!(("".to_string(), "".to_string())), - Some("".to_string())) + vec!(("".to_owned(), "".to_owned())), + Some("".to_owned())) .expect(&format!("failed to exec `{}`", config.adb_path)); let mut exitcode: i32 = 0; @@ -1577,8 +1588,8 @@ fn _arm_exec_compiled_test(config: &Config, // get stdout of result runargs = Vec::new(); - runargs.push("shell".to_string()); - runargs.push("cat".to_string()); + runargs.push("shell".to_owned()); + runargs.push("cat".to_owned()); runargs.push(format!("{}/{}.stdout", config.adb_test_dir, prog_short)); let procsrv::Result{ out: stdout_out, err: _, status: _ } = @@ -1586,14 +1597,14 @@ fn _arm_exec_compiled_test(config: &Config, &config.adb_path, None, &runargs, - vec!(("".to_string(), "".to_string())), - Some("".to_string())) + vec!(("".to_owned(), "".to_owned())), + Some("".to_owned())) .expect(&format!("failed to exec `{}`", config.adb_path)); // get stderr of result runargs = Vec::new(); - runargs.push("shell".to_string()); - runargs.push("cat".to_string()); + runargs.push("shell".to_owned()); + runargs.push("cat".to_owned()); runargs.push(format!("{}/{}.stderr", config.adb_test_dir, prog_short)); let procsrv::Result{ out: stderr_out, err: _, status: _ } = @@ -1601,8 +1612,8 @@ fn _arm_exec_compiled_test(config: &Config, &config.adb_path, None, &runargs, - vec!(("".to_string(), "".to_string())), - Some("".to_string())) + vec!(("".to_owned(), "".to_owned())), + Some("".to_owned())) .expect(&format!("failed to exec `{}`", config.adb_path)); dump_output(config, @@ -1630,15 +1641,15 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) { &config.adb_path, None, &[ - "push".to_string(), + "push".to_owned(), file.to_str() .unwrap() - .to_string(), - config.adb_test_dir.to_string(), + .to_owned(), + config.adb_test_dir.to_owned(), ], - vec!(("".to_string(), - "".to_string())), - Some("".to_string())) + vec!(("".to_owned(), + "".to_owned())), + Some("".to_owned())) .expect(&format!("failed to exec `{}`", config.adb_path)); if config.verbose { @@ -1656,10 +1667,10 @@ fn compile_test_and_save_ir(config: &Config, props: &TestProps, testfile: &Path) -> ProcRes { let aux_dir = aux_output_dir_name(config, testfile); // FIXME (#9639): This needs to handle non-utf8 paths - let mut link_args = vec!("-L".to_string(), - aux_dir.to_str().unwrap().to_string()); - let llvm_args = vec!("--emit=llvm-ir".to_string(), - "--crate-type=lib".to_string()); + let mut link_args = vec!("-L".to_owned(), + aux_dir.to_str().unwrap().to_owned()); + let llvm_args = vec!("--emit=llvm-ir".to_owned(), + "--crate-type=lib".to_owned()); link_args.extend(llvm_args); let args = make_compile_args(config, props, @@ -1676,9 +1687,9 @@ fn check_ir_with_filecheck(config: &Config, testfile: &Path) -> ProcRes { let prog = config.llvm_bin_path.as_ref().unwrap().join("FileCheck"); let proc_args = ProcArgs { // FIXME (#9639): This needs to handle non-utf8 paths - prog: prog.to_str().unwrap().to_string(), + prog: prog.to_str().unwrap().to_owned(), args: vec!(format!("-input-file={}", irfile.to_str().unwrap()), - testfile.to_str().unwrap().to_string()) + testfile.to_str().unwrap().to_owned()) }; compose_and_run(config, testfile, proc_args, Vec::new(), "", None, None) } diff --git a/src/compiletest/util.rs b/src/compiletest/util.rs index 13d6c029ff..fbafee102e 100644 --- a/src/compiletest/util.rs +++ b/src/compiletest/util.rs @@ -73,7 +73,7 @@ pub fn make_new_path(path: &str) -> String { Ok(curr) => { format!("{}{}{}", path, path_div(), curr) } - Err(..) => path.to_string() + Err(..) => path.to_owned() } } diff --git a/src/doc/README.md b/src/doc/README.md index 3b12ffe8f1..c09f28ae4f 100644 --- a/src/doc/README.md +++ b/src/doc/README.md @@ -1,11 +1,5 @@ # Rust documentations -## Dependencies - -[Pandoc](http://johnmacfarlane.net/pandoc/installing.html), a universal -document converter, is required to generate docs as HTML from Rust's -source code. - ## Building To generate all the docs, just run `make docs` from the root of the repository. @@ -26,15 +20,12 @@ To generate an HTML version of a doc from Markdown manually, you can do something like: ~~~~ -pandoc --from=markdown --to=html5 --number-sections -o reference.html reference.md +rustdoc reference.md ~~~~ (`reference.md` being the Rust Reference Manual.) -The syntax for pandoc flavored markdown can be found at: - -- http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown - -A nice quick reference (for non-pandoc markdown) is at: +An overview of how to use the `rustdoc` command is available [in the docs][1]. +Further details are available from the command line by with `rustdoc --help`. -- http://kramdown.gettalong.org/quickref.html +[1]: https://github.com/rust-lang/rust/blob/master/src/doc/trpl/documentation.md diff --git a/src/doc/favicon.inc b/src/doc/favicon.inc index 51609a660d..8f881657bd 100644 --- a/src/doc/favicon.inc +++ b/src/doc/favicon.inc @@ -1 +1 @@ - + diff --git a/src/doc/grammar.md b/src/doc/grammar.md index 3aa89cba03..3ae93b8f27 100644 --- a/src/doc/grammar.md +++ b/src/doc/grammar.md @@ -281,7 +281,7 @@ type_path_tail : '<' type_expr [ ',' type_expr ] + '>' ## Macros ```antlr -expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')' ';' +expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')' ';' | "macro_rules" '!' ident '{' macro_rule * '}' ; macro_rule : '(' matcher * ')' "=>" '(' transcriber * ')' ';' ; matcher : '(' matcher * ')' | '[' matcher * ']' @@ -306,7 +306,7 @@ transcriber : '(' transcriber * ')' | '[' transcriber * ']' ```antlr item : vis ? mod_item | fn_item | type_item | struct_item | enum_item - | const_item | static_item | trait_item | impl_item | extern_block ; + | const_item | static_item | trait_item | impl_item | extern_block_item ; ``` ### Type Parameters @@ -636,31 +636,31 @@ lambda_expr : '|' ident_list '|' expr ; ### While loops ```antlr -while_expr : [ lifetime ':' ] "while" no_struct_literal_expr '{' block '}' ; +while_expr : [ lifetime ':' ] ? "while" no_struct_literal_expr '{' block '}' ; ``` ### Infinite loops ```antlr -loop_expr : [ lifetime ':' ] "loop" '{' block '}'; +loop_expr : [ lifetime ':' ] ? "loop" '{' block '}'; ``` ### Break expressions ```antlr -break_expr : "break" [ lifetime ]; +break_expr : "break" [ lifetime ] ?; ``` ### Continue expressions ```antlr -continue_expr : "continue" [ lifetime ]; +continue_expr : "continue" [ lifetime ] ?; ``` ### For expressions ```antlr -for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ; +for_expr : [ lifetime ':' ] ? "for" pat "in" no_struct_literal_expr '{' block '}' ; ``` ### If expressions @@ -688,13 +688,12 @@ match_pat : pat [ '|' pat ] * [ "if" expr ] ? ; ```antlr if_let_expr : "if" "let" pat '=' expr '{' block '}' else_tail ? ; -else_tail : "else" [ if_expr | if_let_expr | '{' block '}' ] ; ``` ### While let loops ```antlr -while_let_expr : "while" "let" pat '=' expr '{' block '}' ; +while_let_expr : [ lifetime ':' ] ? "while" "let" pat '=' expr '{' block '}' ; ``` ### Return expressions @@ -754,8 +753,6 @@ return_expr : "return" expr ? ; ```antlr closure_type := [ 'unsafe' ] [ '<' lifetime-list '>' ] '|' arg-list '|' [ ':' bound-list ] [ '->' type ] -procedure_type := 'proc' [ '<' lifetime-list '>' ] '(' arg-list ')' - [ ':' bound-list ] [ '->' type ] lifetime-list := lifetime | lifetime ',' lifetime-list arg-list := ident ':' type | ident ':' type ',' arg-list bound-list := bound | bound '+' bound-list diff --git a/src/doc/index.md b/src/doc/index.md index c1f9ea6b3b..1e667d3600 100644 --- a/src/doc/index.md +++ b/src/doc/index.md @@ -20,13 +20,30 @@ series of small examples. [rbe]: http://rustbyexample.com/ -# The Standard Library +# Language Reference + +Rust does not have an exact specification yet, but an effort to describe as much of +the language in as much detail as possible is in [the reference](reference.html). + +# Standard Library Reference We have [API documentation for the entire standard library](std/index.html). There's a list of crates on the left with more specific sections, or you can use the search bar at the top to search for something if you know its name. +# Tools + +[Cargo](https://crates.io) is the Rust's package manager providing access to libraries +beyond the standard one, and its website contains lots of good documentation. + +[`rustdoc`](book/documentation.html) is the Rust's documentation generator, a tool converting +annotated source code into HTML docs. + +A bunch of non-official tools are available, such as [Racer](https://github.com/phildawes/racer) +(code completion engine), or [rustfmt](https://github.com/nrc/rustfmt) (source code formatter), +or text editor plugins. + # Community & Getting Help If you need help with something, or just want to talk about Rust with others, @@ -54,25 +71,10 @@ There is an active [subreddit](https://reddit.com/r/rust) with lots of discussion and news about Rust. There is also a [user forum](https://users.rust-lang.org), for all -user-oriented discussion, and a [developer +user-oriented discussion, and a [developer forum](https://internals.rust-lang.org/), where the development of Rust itself is discussed. -# Specification - -Rust does not have an exact specification, but an effort to describe as much of -the language in as much detail as possible is in [the reference](reference.html). - -# Tools - -Rust is still a young language, so there isn't a ton of tooling yet, but the -tools we have are really nice. - -[Cargo](https://crates.io) is Rust's package manager, and its website contains -lots of good documentation. - -[`rustdoc`](book/documentation.html) is used to generate documentation for Rust code. - # FAQs There are questions that are asked quite often, so we've made FAQs for them: @@ -95,5 +97,4 @@ languages: - [Russian](https://github.com/kgv/rust_book_ru) - [Korean](https://github.com/rust-kr/doc.rust-kr.org) - [Chinese](https://github.com/KaiserY/rust-book-chinese) -- [Spanish](https://github.com/goyox86/elpr) - +- [Spanish](https://goyox86.github.io/elpr) diff --git a/src/doc/nomicon/atomics.md b/src/doc/nomicon/atomics.md index 2d567e39f8..08f0de4f00 100644 --- a/src/doc/nomicon/atomics.md +++ b/src/doc/nomicon/atomics.md @@ -127,7 +127,7 @@ fundamentally unsynchronized and compilers are free to aggressively optimize them. In particular, data accesses are free to be reordered by the compiler on the assumption that the program is single-threaded. The hardware is also free to propagate the changes made in data accesses to other threads as lazily and -inconsistently as it wants. Mostly critically, data accesses are how data races +inconsistently as it wants. Most critically, data accesses are how data races happen. Data accesses are very friendly to the hardware and compiler, but as we've seen they offer *awful* semantics to try to write synchronized code with. Actually, that's too weak. @@ -210,18 +210,18 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::thread; fn main() { - let lock = Arc::new(AtomicBool::new(true)); // value answers "am I locked?" + let lock = Arc::new(AtomicBool::new(false)); // value answers "am I locked?" // ... distribute lock to threads somehow ... - // Try to acquire the lock by setting it to false - while !lock.compare_and_swap(true, false, Ordering::Acquire) { } + // Try to acquire the lock by setting it to true + while lock.compare_and_swap(false, true, Ordering::Acquire) { } // broke out of the loop, so we successfully acquired the lock! // ... scary data accesses ... // ok we're done, release the lock - lock.store(true, Ordering::Release); + lock.store(false, Ordering::Release); } ``` diff --git a/src/doc/nomicon/coercions.md b/src/doc/nomicon/coercions.md index 2e33a6729d..1d2897ce3b 100644 --- a/src/doc/nomicon/coercions.md +++ b/src/doc/nomicon/coercions.md @@ -22,7 +22,7 @@ Coercion is allowed between the following types: for all pointer types (including smart pointers like Box and Rc). Unsize is only implemented automatically, and enables the following transformations: -* `[T, ..n]` => `[T]` +* `[T; n]` => `[T]` * `T` => `Trait` where `T: Trait` * `Foo<..., T, ...>` => `Foo<..., U, ...>` where: * `T: Unsize` diff --git a/src/doc/nomicon/concurrency.md b/src/doc/nomicon/concurrency.md index 9dcbecdd5b..802f3204cd 100644 --- a/src/doc/nomicon/concurrency.md +++ b/src/doc/nomicon/concurrency.md @@ -7,7 +7,7 @@ an abstraction over them in a relatively uncontroversial way. Message passing, green threads, and async APIs are all diverse enough that any abstraction over them tends to involve trade-offs that we weren't willing to commit to for 1.0. -However the way Rust models concurrency makes it relatively easy design your own +However the way Rust models concurrency makes it relatively easy to design your own concurrency paradigm as a library and have everyone else's code Just Work with yours. Just require the right lifetimes and Send and Sync where appropriate and you're off to the races. Or rather, off to the... not... having... races. diff --git a/src/doc/nomicon/destructors.md b/src/doc/nomicon/destructors.md index 568f7c07f5..91abdab977 100644 --- a/src/doc/nomicon/destructors.md +++ b/src/doc/nomicon/destructors.md @@ -26,13 +26,16 @@ this is totally fine. For instance, a custom implementation of `Box` might write `Drop` like this: ```rust -#![feature(heap_api, core_intrinsics, unique)] +#![feature(alloc, heap_api, core_intrinsics, unique)] + +extern crate alloc; -use std::rt::heap; use std::ptr::Unique; use std::intrinsics::drop_in_place; use std::mem; +use alloc::heap; + struct Box{ ptr: Unique } impl Drop for Box { @@ -45,22 +48,26 @@ impl Drop for Box { } } } +# fn main() {} ``` and this works fine because when Rust goes to drop the `ptr` field it just sees -a [Unique][] that has no actual `Drop` implementation. Similarly nothing can +a [Unique] that has no actual `Drop` implementation. Similarly nothing can use-after-free the `ptr` because when drop exits, it becomes inacessible. However this wouldn't work: ```rust -#![feature(heap_api, core_intrinsics, unique)] +#![feature(alloc, heap_api, core_intrinsics, unique)] + +extern crate alloc; -use std::rt::heap; use std::ptr::Unique; use std::intrinsics::drop_in_place; use std::mem; +use alloc::heap; + struct Box{ ptr: Unique } impl Drop for Box { @@ -87,6 +94,7 @@ impl Drop for SuperBox { } } } +# fn main() {} ``` After we deallocate the `box`'s ptr in SuperBox's destructor, Rust will @@ -120,7 +128,7 @@ enum Link { will have its inner Box field dropped if and only if an instance stores the Next variant. -In general this works really nice because you don't need to worry about +In general this works really nicely because you don't need to worry about adding/removing drops when you refactor your data layout. Still there's certainly many valid usecases for needing to do trickier things with destructors. @@ -129,13 +137,16 @@ The classic safe solution to overriding recursive drop and allowing moving out of Self during `drop` is to use an Option: ```rust -#![feature(heap_api, core_intrinsics, unique)] +#![feature(alloc, heap_api, core_intrinsics, unique)] + +extern crate alloc; -use std::rt::heap; use std::ptr::Unique; use std::intrinsics::drop_in_place; use std::mem; +use alloc::heap; + struct Box{ ptr: Unique } impl Drop for Box { @@ -165,6 +176,7 @@ impl Drop for SuperBox { } } } +# fn main() {} ``` However this has fairly odd semantics: you're saying that a field that *should* diff --git a/src/doc/nomicon/drop-flags.md b/src/doc/nomicon/drop-flags.md index 1e81c97479..5655c5d245 100644 --- a/src/doc/nomicon/drop-flags.md +++ b/src/doc/nomicon/drop-flags.md @@ -1,7 +1,7 @@ % Drop Flags The examples in the previous section introduce an interesting problem for Rust. -We have seen that's possible to conditionally initialize, deinitialize, and +We have seen that it's possible to conditionally initialize, deinitialize, and reinitialize locations of memory totally safely. For Copy types, this isn't particularly notable since they're just a random pile of bits. However types with destructors are a different story: Rust needs to know whether to call a diff --git a/src/doc/nomicon/dropck.md b/src/doc/nomicon/dropck.md index df09d1a174..98d269ff76 100644 --- a/src/doc/nomicon/dropck.md +++ b/src/doc/nomicon/dropck.md @@ -1,7 +1,7 @@ % Drop Check We have seen how lifetimes provide us some fairly simple rules for ensuring -that never read dangling references. However up to this point we have only ever +that we never read dangling references. However up to this point we have only ever interacted with the *outlives* relationship in an inclusive manner. That is, when we talked about `'a: 'b`, it was ok for `'a` to live *exactly* as long as `'b`. At first glance, this seems to be a meaningless distinction. Nothing ever diff --git a/src/doc/nomicon/exotic-sizes.md b/src/doc/nomicon/exotic-sizes.md index 0b653a7ad3..e8637e38ac 100644 --- a/src/doc/nomicon/exotic-sizes.md +++ b/src/doc/nomicon/exotic-sizes.md @@ -85,8 +85,8 @@ support values. Safe code need not worry about ZSTs, but *unsafe* code must be careful about the consequence of types with no size. In particular, pointer offsets are no-ops, and standard allocators (including jemalloc, the one used by default in Rust) -generally consider passing in `0` for the size of an allocation as Undefined -Behaviour. +may return `nullptr` when a zero-sized allocation is requested, which is +indistinguishable from out of memory. diff --git a/src/doc/nomicon/leaking.md b/src/doc/nomicon/leaking.md index 1aa78e112e..0441db2752 100644 --- a/src/doc/nomicon/leaking.md +++ b/src/doc/nomicon/leaking.md @@ -155,7 +155,6 @@ impl Rc { impl Drop for Rc { fn drop(&mut self) { unsafe { - let inner = &mut ; (*self.ptr).ref_count -= 1; if (*self.ptr).ref_count == 0 { // drop the data and then free it diff --git a/src/doc/nomicon/lifetimes.md b/src/doc/nomicon/lifetimes.md index 6f711d52ea..58272a1bc3 100644 --- a/src/doc/nomicon/lifetimes.md +++ b/src/doc/nomicon/lifetimes.md @@ -52,7 +52,7 @@ likely desugar to the following: } ``` -Wow. That’s... awful. Let’s all take a moment to thank Rust for making this easier. +Wow. That's... awful. Let's all take a moment to thank Rust for making this easier. Actually passing references to outer scopes will cause Rust to infer a larger lifetime: diff --git a/src/doc/nomicon/meet-safe-and-unsafe.md b/src/doc/nomicon/meet-safe-and-unsafe.md index 15e49c747b..52582e8750 100644 --- a/src/doc/nomicon/meet-safe-and-unsafe.md +++ b/src/doc/nomicon/meet-safe-and-unsafe.md @@ -60,8 +60,8 @@ Unlike C, Undefined Behaviour is pretty limited in scope in Rust. All the core language cares about is preventing the following things: * Dereferencing null or dangling pointers -* Reading [uninitialized memory][] -* Breaking the [pointer aliasing rules][] +* Reading [uninitialized memory] +* Breaking the [pointer aliasing rules] * Producing invalid primitive values: * dangling/null references * a `bool` that isn't 0 or 1 diff --git a/src/doc/nomicon/other-reprs.md b/src/doc/nomicon/other-reprs.md index 93ef2c13cd..71da743f35 100644 --- a/src/doc/nomicon/other-reprs.md +++ b/src/doc/nomicon/other-reprs.md @@ -26,7 +26,7 @@ still consumes a byte of space. * DSTs, tuples, and tagged unions are not a concept in C and as such are never FFI safe. -* **If the type would have any [drop flags][], they will still be added** +* **If the type would have any [drop flags], they will still be added** * This is equivalent to one of `repr(u*)` (see the next section) for enums. The chosen size is the default enum size for the target platform's C ABI. Note that diff --git a/src/doc/nomicon/repr-rust.md b/src/doc/nomicon/repr-rust.md index c8a372be76..e038ae5639 100644 --- a/src/doc/nomicon/repr-rust.md +++ b/src/doc/nomicon/repr-rust.md @@ -36,9 +36,9 @@ struct A { } ``` -will be 32-bit aligned assuming these primitives are aligned to their size. -It will therefore have a size that is a multiple of 32-bits. It will potentially -*really* become: +will be 32-bit aligned on an architecture that aligns these primitives to their +respective sizes. The whole struct will therefore have a size that is a multiple +of 32-bits. It will potentially become: ```rust struct A { @@ -50,10 +50,10 @@ struct A { } ``` -There is *no indirection* for these types; all data is stored contiguously as -you would expect in C. However with the exception of arrays (which are densely -packed and in-order), the layout of data is not by default specified in Rust. -Given the two following struct definitions: +There is *no indirection* for these types; all data is stored within the struct, +as you would expect in C. However with the exception of arrays (which are +densely packed and in-order), the layout of data is not by default specified in +Rust. Given the two following struct definitions: ```rust struct A { @@ -62,18 +62,17 @@ struct A { } struct B { - x: i32, + a: i32, b: u64, } ``` Rust *does* guarantee that two instances of A have their data laid out in -exactly the same way. However Rust *does not* guarantee that an instance of A -has the same field ordering or padding as an instance of B (in practice there's -no particular reason why they wouldn't, other than that its not currently -guaranteed). +exactly the same way. However Rust *does not* currently guarantee that an +instance of A has the same field ordering or padding as an instance of B, though +in practice there's no reason why they wouldn't. -With A and B as written, this is basically nonsensical, but several other +With A and B as written, this point would seem to be pedantic, but several other features of Rust make it desirable for the language to play with data layout in complex ways. @@ -133,18 +132,21 @@ struct FooRepr { } ``` -And indeed this is approximately how it would be laid out in general -(modulo the size and position of `tag`). However there are several cases where -such a representation is inefficient. The classic case of this is Rust's -"null pointer optimization". Given a pointer that is known to not be null -(e.g. `&u32`), an enum can *store* a discriminant bit *inside* the pointer -by using null as a special value. The net result is that -`size_of::>() == size_of::<&T>()` +And indeed this is approximately how it would be laid out in general (modulo the +size and position of `tag`). + +However there are several cases where such a representation is inefficient. The +classic case of this is Rust's "null pointer optimization": an enum consisting +of a single outer unit variant (e.g. `None`) and a (potentially nested) non- +nullable pointer variant (e.g. `&T`) makes the tag unnecessary, because a null +pointer value can safely be interpreted to mean that the unit variant is chosen +instead. The net result is that, for example, `size_of::>() == +size_of::<&T>()`. -There are many types in Rust that are, or contain, "not null" pointers such as +There are many types in Rust that are, or contain, non-nullable pointers such as `Box`, `Vec`, `String`, `&T`, and `&mut T`. Similarly, one can imagine nested enums pooling their tags into a single discriminant, as they are by -definition known to have a limited range of valid values. In principle enums can +definition known to have a limited range of valid values. In principle enums could use fairly elaborate algorithms to cache bits throughout nested types with special constrained representations. As such it is *especially* desirable that we leave enum layout unspecified today. diff --git a/src/doc/nomicon/safe-unsafe-meaning.md b/src/doc/nomicon/safe-unsafe-meaning.md index 2f15b7050e..3cb02d31b1 100644 --- a/src/doc/nomicon/safe-unsafe-meaning.md +++ b/src/doc/nomicon/safe-unsafe-meaning.md @@ -35,7 +35,7 @@ unchecked contracts: There is also `#[unsafe_no_drop_flag]`, which is a special case that exists for historical reasons and is in the process of being phased out. See the section on -[drop flags][] for details. +[drop flags] for details. Some examples of unsafe functions: @@ -44,7 +44,7 @@ Some examples of unsafe functions: * `ptr::offset` is an intrinsic that invokes Undefined Behaviour if it is not "in bounds" as defined by LLVM. * `mem::transmute` reinterprets some value as having the given type, - bypassing type safety in arbitrary ways. (see [conversions][] for details) + bypassing type safety in arbitrary ways. (see [conversions] for details) * All FFI functions are `unsafe` because they can do arbitrary things. C being an obvious culprit, but generally any language can do something that Rust isn't happy about. @@ -125,7 +125,7 @@ unsafe impl UnsafeOrd for MyType { But it's probably not the implementation you want. Rust has traditionally avoided making traits unsafe because it makes Unsafe -pervasive, which is not desirable. Send and Sync are unsafe is because thread +pervasive, which is not desirable. The reason Send and Sync are unsafe is because thread safety is a *fundamental property* that unsafe code cannot possibly hope to defend against in the same way it would defend against a bad Ord implementation. The only way to possibly defend against thread-unsafety would be to *not use diff --git a/src/doc/nomicon/send-and-sync.md b/src/doc/nomicon/send-and-sync.md index 334d5c9dd5..9ab60d03fc 100644 --- a/src/doc/nomicon/send-and-sync.md +++ b/src/doc/nomicon/send-and-sync.md @@ -3,15 +3,15 @@ Not everything obeys inherited mutability, though. Some types allow you to multiply alias a location in memory while mutating it. Unless these types use synchronization to manage this access, they are absolutely not thread safe. Rust -captures this with through the `Send` and `Sync` traits. +captures this through the `Send` and `Sync` traits. * A type is Send if it is safe to send it to another thread. * A type is Sync if it is safe to share between threads (`&T` is Send). Send and Sync are fundamental to Rust's concurrency story. As such, a substantial amount of special tooling exists to make them work right. First and -foremost, they're [unsafe traits][]. This means that they are unsafe to -implement, and other unsafe code can that they are correctly +foremost, they're [unsafe traits]. This means that they are unsafe to +implement, and other unsafe code can assume that they are correctly implemented. Since they're *marker traits* (they have no associated items like methods), correctly implemented simply means that they have the intrinsic properties an implementor should have. Incorrectly implementing Send or Sync can diff --git a/src/doc/nomicon/subtyping.md b/src/doc/nomicon/subtyping.md index 3c57297f32..65dcb6a94e 100644 --- a/src/doc/nomicon/subtyping.md +++ b/src/doc/nomicon/subtyping.md @@ -93,8 +93,8 @@ fn main() { The signature of `overwrite` is clearly valid: it takes mutable references to two values of the same type, and overwrites one with the other. If `&mut T` was -variant over T, then `&mut &'a str` would be a subtype of `&mut &'static str`, -since `&'a str` is a subtype of `&'static str`. Therefore the lifetime of +variant over T, then `&mut &'static str` would be a subtype of `&mut &'a str`, +since `&'static str` is a subtype of `&'a str`. Therefore the lifetime of `forever_str` would successfully be "shrunk" down to the shorter lifetime of `string`, and `overwrite` would be called successfully. `string` would subsequently be dropped, and `forever_str` would point to freed memory when we diff --git a/src/doc/nomicon/transmutes.md b/src/doc/nomicon/transmutes.md index f19dda0d8b..2b34ad0a9f 100644 --- a/src/doc/nomicon/transmutes.md +++ b/src/doc/nomicon/transmutes.md @@ -21,7 +21,7 @@ same size. The ways to cause Undefined Behaviour with this are mind boggling. * No you can't do it * No you're not special * Transmuting to a reference without an explicitly provided lifetime - produces an [unbounded lifetime][] + produces an [unbounded lifetime] `mem::transmute_copy` somehow manages to be *even more* wildly unsafe than this. It copies `size_of` bytes out of an `&T` and interprets them as a `U`. diff --git a/src/doc/nomicon/unchecked-uninit.md b/src/doc/nomicon/unchecked-uninit.md index da9fb294a1..5ae1818dc6 100644 --- a/src/doc/nomicon/unchecked-uninit.md +++ b/src/doc/nomicon/unchecked-uninit.md @@ -77,7 +77,7 @@ contain any `Drop` types. However when working with uninitialized memory you need to be ever-vigilant for Rust trying to drop values you make like this before they're fully initialized. Every control path through that variable's scope must initialize the value -before it ends, if has a destructor. +before it ends, if it has a destructor. *[This includes code panicking](unwinding.html)*. And that's about it for working with uninitialized memory! Basically nothing diff --git a/src/doc/nomicon/vec-alloc.md b/src/doc/nomicon/vec-alloc.md index fc7feba235..c2ae1a4eb6 100644 --- a/src/doc/nomicon/vec-alloc.md +++ b/src/doc/nomicon/vec-alloc.md @@ -9,7 +9,7 @@ This is perfectly fine because we already have `cap == 0` as our sentinel for no allocation. We don't even need to handle it specially in almost any code because we usually need to check if `cap > len` or `len > 0` anyway. The traditional Rust value to put here is `0x01`. The standard library actually exposes this -as `std::rt::heap::EMPTY`. There are quite a few places where we'll +as `alloc::heap::EMPTY`. There are quite a few places where we'll want to use `heap::EMPTY` because there's no real allocation to talk about but `null` would make the compiler do bad things. @@ -20,11 +20,12 @@ the `heap` API anyway, so let's just get that dependency over with. So: ```rust,ignore -#![feature(heap_api)] +#![feature(alloc, heap_api)] -use std::rt::heap::EMPTY; use std::mem; +use alloc::heap::EMPTY; + impl Vec { fn new() -> Self { assert!(mem::size_of::() != 0, "We're not ready to handle ZSTs"); diff --git a/src/doc/nomicon/vec-drain.md b/src/doc/nomicon/vec-drain.md index 4521bbdd05..6e732ee107 100644 --- a/src/doc/nomicon/vec-drain.md +++ b/src/doc/nomicon/vec-drain.md @@ -129,14 +129,16 @@ impl<'a, T> Drop for Drain<'a, T> { impl Vec { pub fn drain(&mut self) -> Drain { - // this is a mem::forget safety thing. If Drain is forgotten, we just - // leak the whole Vec's contents. Also we need to do this eventually - // anyway, so why not do it now? - self.len = 0; - unsafe { + let iter = RawValIter::new(&self); + + // this is a mem::forget safety thing. If Drain is forgotten, we just + // leak the whole Vec's contents. Also we need to do this *eventually* + // anyway, so why not do it now? + self.len = 0; + Drain { - iter: RawValIter::new(&self), + iter: iter, vec: PhantomData, } } diff --git a/src/doc/nomicon/vec-final.md b/src/doc/nomicon/vec-final.md index 847957e2ea..52c22f6507 100644 --- a/src/doc/nomicon/vec-final.md +++ b/src/doc/nomicon/vec-final.md @@ -2,17 +2,16 @@ ```rust #![feature(unique)] -#![feature(heap_api)] +#![feature(alloc, heap_api)] + +extern crate alloc; use std::ptr::{Unique, self}; -use std::rt::heap; use std::mem; use std::ops::{Deref, DerefMut}; use std::marker::PhantomData; - - - +use alloc::heap; struct RawVec { ptr: Unique, @@ -155,13 +154,16 @@ impl Vec { } pub fn drain(&mut self) -> Drain { - // this is a mem::forget safety thing. If this is forgotten, we just - // leak the whole Vec's contents. Also we need to do this *eventually* - // anyway, so why not do it now? - self.len = 0; unsafe { + let iter = RawValIter::new(&self); + + // this is a mem::forget safety thing. If Drain is forgotten, we just + // leak the whole Vec's contents. Also we need to do this *eventually* + // anyway, so why not do it now? + self.len = 0; + Drain { - iter: RawValIter::new(&self), + iter: iter, vec: PhantomData, } } diff --git a/src/doc/not_found.md b/src/doc/not_found.md index 0efdf45c64..5d632ebc68 100644 --- a/src/doc/not_found.md +++ b/src/doc/not_found.md @@ -21,12 +21,12 @@ Some things that might be helpful to you though: # Reference -* [The Rust official site](http://rust-lang.org) -* [The Rust reference](http://doc.rust-lang.org/reference.html) +* [The Rust official site](https://www.rust-lang.org) +* [The Rust reference](https://doc.rust-lang.org/reference.html) # Docs -* [The standard library](http://doc.rust-lang.org/std/) +* [The standard library](https://doc.rust-lang.org/std/) "#, root_path = vec![".."; cx.current.len()].join("/"), - path = if ast_util::is_local(it.def_id) { + path = if it.def_id.is_local() { cx.current.join("/") } else { let path = &cache.external_paths[&it.def_id]; @@ -1951,8 +1976,8 @@ fn render_assoc_item(w: &mut fmt::Formatter, meth: &clean::Item, link: AssocItemLink) -> fmt::Result { fn method(w: &mut fmt::Formatter, it: &clean::Item, - unsafety: ast::Unsafety, - constness: ast::Constness, + unsafety: hir::Unsafety, + constness: hir::Constness, abi: abi::Abi, g: &clean::Generics, selfty: &clean::SelfTy, @@ -1985,7 +2010,7 @@ fn render_assoc_item(w: &mut fmt::Formatter, meth: &clean::Item, } match meth.inner { clean::TyMethodItem(ref m) => { - method(w, meth, m.unsafety, ast::Constness::NotConst, + method(w, meth, m.unsafety, hir::Constness::NotConst, m.abi, &m.generics, &m.self_, &m.decl, link) } clean::MethodItem(ref m) => { @@ -2003,7 +2028,7 @@ fn render_assoc_item(w: &mut fmt::Formatter, meth: &clean::Item, } } -fn item_struct(w: &mut fmt::Formatter, it: &clean::Item, +fn item_struct(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, s: &clean::Struct) -> fmt::Result { try!(write!(w, "
"));
     try!(render_attributes(w, it));
@@ -2016,7 +2041,7 @@ fn item_struct(w: &mut fmt::Formatter, it: &clean::Item,
                        true));
     try!(write!(w, "
")); - try!(document(w, it)); + try!(document(w, cx, it)); let mut fields = s.fields.iter().filter(|f| { match f.inner { clean::StructFieldItem(clean::HiddenStructField) => false, @@ -2033,16 +2058,16 @@ fn item_struct(w: &mut fmt::Formatter, it: &clean::Item, {name}", stab = field.stability_class(), name = field.name.as_ref().unwrap())); - try!(document(w, field)); + try!(document(w, cx, field)); try!(write!(w, "")); } try!(write!(w, "")); } } - render_assoc_items(w, it.def_id, AssocItemRender::All) + render_assoc_items(w, cx, it.def_id, AssocItemRender::All) } -fn item_enum(w: &mut fmt::Formatter, it: &clean::Item, +fn item_enum(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, e: &clean::Enum) -> fmt::Result { try!(write!(w, "
"));
     try!(render_attributes(w, it));
@@ -2095,13 +2120,13 @@ fn item_enum(w: &mut fmt::Formatter, it: &clean::Item,
     }
     try!(write!(w, "
")); - try!(document(w, it)); + try!(document(w, cx, it)); if !e.variants.is_empty() { try!(write!(w, "

Variants

\n")); for variant in &e.variants { try!(write!(w, "")); } try!(write!(w, "
{name}", name = variant.name.as_ref().unwrap())); - try!(document(w, variant)); + try!(document(w, cx, variant)); match variant.inner { clean::VariantItem(ref var) => { match var.kind { @@ -2123,7 +2148,7 @@ fn item_enum(w: &mut fmt::Formatter, it: &clean::Item, {f}", v = variant.name.as_ref().unwrap(), f = field.name.as_ref().unwrap())); - try!(document(w, field)); + try!(document(w, cx, field)); try!(write!(w, "
")); @@ -2138,7 +2163,7 @@ fn item_enum(w: &mut fmt::Formatter, it: &clean::Item, try!(write!(w, "")); } - try!(render_assoc_items(w, it.def_id, AssocItemRender::All)); + try!(render_assoc_items(w, cx, it.def_id, AssocItemRender::All)); Ok(()) } @@ -2224,7 +2249,7 @@ fn render_struct(w: &mut fmt::Formatter, it: &clean::Item, #[derive(Copy, Clone)] enum AssocItemLink { Anchor, - GotoSource(ast::DefId), + GotoSource(DefId), } enum AssocItemRender<'a> { @@ -2233,7 +2258,8 @@ enum AssocItemRender<'a> { } fn render_assoc_items(w: &mut fmt::Formatter, - it: ast::DefId, + cx: &Context, + it: DefId, what: AssocItemRender) -> fmt::Result { let c = cache(); let v = match c.impls.get(&it) { @@ -2256,7 +2282,7 @@ fn render_assoc_items(w: &mut fmt::Formatter, } }; for i in &non_trait { - try!(render_impl(w, i, AssocItemLink::Anchor, render_header)); + try!(render_impl(w, cx, i, AssocItemLink::Anchor, render_header)); } } if let AssocItemRender::DerefFor { .. } = what { @@ -2272,7 +2298,7 @@ fn render_assoc_items(w: &mut fmt::Formatter, } }); if let Some(impl_) = deref_impl { - try!(render_deref_methods(w, impl_)); + try!(render_deref_methods(w, cx, impl_)); } try!(write!(w, "

Trait \ Implementations

")); @@ -2281,7 +2307,7 @@ fn render_assoc_items(w: &mut fmt::Formatter, }); for i in &manual { let did = i.trait_did().unwrap(); - try!(render_impl(w, i, AssocItemLink::GotoSource(did), true)); + try!(render_impl(w, cx, i, AssocItemLink::GotoSource(did), true)); } if !derived.is_empty() { try!(write!(w, "

\ @@ -2289,14 +2315,14 @@ fn render_assoc_items(w: &mut fmt::Formatter,

")); for i in &derived { let did = i.trait_did().unwrap(); - try!(render_impl(w, i, AssocItemLink::GotoSource(did), true)); + try!(render_impl(w, cx, i, AssocItemLink::GotoSource(did), true)); } } } Ok(()) } -fn render_deref_methods(w: &mut fmt::Formatter, impl_: &Impl) -> fmt::Result { +fn render_deref_methods(w: &mut fmt::Formatter, cx: &Context, impl_: &Impl) -> fmt::Result { let deref_type = impl_.impl_.trait_.as_ref().unwrap(); let target = impl_.impl_.items.iter().filter_map(|item| { match item.inner { @@ -2306,12 +2332,12 @@ fn render_deref_methods(w: &mut fmt::Formatter, impl_: &Impl) -> fmt::Result { }).next().expect("Expected associated type binding"); let what = AssocItemRender::DerefFor { trait_: deref_type, type_: target }; match *target { - clean::ResolvedPath { did, .. } => render_assoc_items(w, did, what), + clean::ResolvedPath { did, .. } => render_assoc_items(w, cx, did, what), _ => { if let Some(prim) = target.primitive_type() { if let Some(c) = cache().primitive_locations.get(&prim) { - let did = ast::DefId { krate: *c, node: prim.to_node_id() }; - try!(render_assoc_items(w, did, what)); + let did = DefId { krate: *c, node: prim.to_node_id() }; + try!(render_assoc_items(w, cx, did, what)); } } Ok(()) @@ -2322,7 +2348,7 @@ fn render_deref_methods(w: &mut fmt::Formatter, impl_: &Impl) -> fmt::Result { // Render_header is false when we are rendering a `Deref` impl and true // otherwise. If render_header is false, we will avoid rendering static // methods, since they are not accessible for the type implementing `Deref` -fn render_impl(w: &mut fmt::Formatter, i: &Impl, link: AssocItemLink, +fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLink, render_header: bool) -> fmt::Result { if render_header { try!(write!(w, "

{}

", i.impl_)); @@ -2331,7 +2357,7 @@ fn render_impl(w: &mut fmt::Formatter, i: &Impl, link: AssocItemLink, } } - fn doctraititem(w: &mut fmt::Formatter, item: &clean::Item, + fn doctraititem(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item, link: AssocItemLink, render_static: bool) -> fmt::Result { match item.inner { clean::MethodItem(..) | clean::TyMethodItem(..) => { @@ -2381,7 +2407,7 @@ fn render_impl(w: &mut fmt::Formatter, i: &Impl, link: AssocItemLink, if is_static_method(item) && !render_static { Ok(()) } else { - document(w, item) + document(w, cx, item) } } else { Ok(()) @@ -2398,11 +2424,12 @@ fn render_impl(w: &mut fmt::Formatter, i: &Impl, link: AssocItemLink, try!(write!(w, "
")); for trait_item in &i.impl_.items { - try!(doctraititem(w, trait_item, link, render_header)); + try!(doctraititem(w, cx, trait_item, link, render_header)); } fn render_default_items(w: &mut fmt::Formatter, - did: ast::DefId, + cx: &Context, + did: DefId, t: &clean::Trait, i: &clean::Impl, render_static: bool) -> fmt::Result { @@ -2413,7 +2440,7 @@ fn render_impl(w: &mut fmt::Formatter, i: &Impl, link: AssocItemLink, None => {} } - try!(doctraititem(w, trait_item, AssocItemLink::GotoSource(did), render_static)); + try!(doctraititem(w, cx, trait_item, AssocItemLink::GotoSource(did), render_static)); } Ok(()) } @@ -2424,7 +2451,7 @@ fn render_impl(w: &mut fmt::Formatter, i: &Impl, link: AssocItemLink, // for them work. if let Some(clean::ResolvedPath { did, .. }) = i.impl_.trait_ { if let Some(t) = cache().traits.get(&did) { - try!(render_default_items(w, did, t, &i.impl_, render_header)); + try!(render_default_items(w, cx, did, t, &i.impl_, render_header)); } } @@ -2432,7 +2459,7 @@ fn render_impl(w: &mut fmt::Formatter, i: &Impl, link: AssocItemLink, Ok(()) } -fn item_typedef(w: &mut fmt::Formatter, it: &clean::Item, +fn item_typedef(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, t: &clean::Typedef) -> fmt::Result { try!(write!(w, "
type {}{}{where_clause} = {type_};
", it.name.as_ref().unwrap(), @@ -2440,7 +2467,7 @@ fn item_typedef(w: &mut fmt::Formatter, it: &clean::Item, where_clause = WhereClause(&t.generics), type_ = t.type_)); - document(w, it) + document(w, cx, it) } impl<'a> fmt::Display for Sidebar<'a> { @@ -2511,19 +2538,19 @@ impl<'a> fmt::Display for Source<'a> { } } -fn item_macro(w: &mut fmt::Formatter, it: &clean::Item, +fn item_macro(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, t: &clean::Macro) -> fmt::Result { try!(w.write_str(&highlight::highlight(&t.source, Some("macro"), None))); - document(w, it) + document(w, cx, it) } -fn item_primitive(w: &mut fmt::Formatter, +fn item_primitive(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, _p: &clean::PrimitiveType) -> fmt::Result { - try!(document(w, it)); - render_assoc_items(w, it.def_id, AssocItemRender::All) + try!(document(w, cx, it)); + render_assoc_items(w, cx, it.def_id, AssocItemRender::All) } fn get_basic_keywords() -> &'static str { diff --git a/src/librustdoc/html/static/main.css b/src/librustdoc/html/static/main.css index 774d413fff..e6b653cbd5 100644 --- a/src/librustdoc/html/static/main.css +++ b/src/librustdoc/html/static/main.css @@ -104,7 +104,7 @@ h3.impl, h3.method, h4.method, h3.type, h4.type { h3.impl, h3.method, h3.type { margin-top: 15px; } -h1, h2, h3, h4, section.sidebar, a.source, .search-input, .content table :not(code)>a, .collapse-toggle { +h1, h2, h3, h4, .sidebar, a.source, .search-input, .content table :not(code)>a, .collapse-toggle { font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; } @@ -189,11 +189,16 @@ nav.sub { padding: 0 10px; margin-bottom: 14px; } -.block h2 { +.block h2, .block h3 { margin-top: 0; margin-bottom: 8px; text-align: center; } +.block ul, .block li { + margin: 0; + padding: 0; + list-style: none; +} .block a { display: block; @@ -355,6 +360,10 @@ nav.sub { margin-left: 20px; } +.content .stability code { + font-size: 90%; +} + nav { border-bottom: 1px solid #e0e0e0; padding-bottom: 10px; @@ -377,7 +386,7 @@ nav.main .separator { nav.sum { text-align: right; } nav.sub form { display: inline; } -nav, .content { +nav.sub, .content { margin-left: 230px; } @@ -387,11 +396,11 @@ a { background: transparent; } -.docblock a { +.docblock a, .stability a { color: #4e8bca; } -.docblock a:hover { +.docblock a:hover, .stability a { text-decoration: underline; } @@ -403,6 +412,7 @@ a { .content span.method, .content a.method, .block a.current.method { color: #8c6067; } .content span.tymethod, .content a.tymethod, .block a.current.tymethod { color: #8c6067; } .content .fnname { color: #8c6067; } +.block a.current.crate { font-weight: 500; } .search-input { width: 100%; @@ -485,7 +495,7 @@ body.blur > :not(#help) { } #help dd { margin: 5px 33px; } #help .infos { padding-left: 0; } -#help h1 { margin-top: 0; } +#help h1, #help h2 { margin-top: 0; } #help > div div { width: 50%; float: left; diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 1d2cc38b4f..9d84d4ea3c 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -230,6 +230,28 @@ } } + function typePassesFilter(filter, type) { + // No filter + if (filter < 0) return true; + + // Exact match + if (filter === type) return true; + + // Match related items + var name = itemTypes[type]; + switch (itemTypes[filter]) { + case "constant": + return (name == "associatedconstant"); + case "fn": + return (name == "method" || name == "tymethod"); + case "type": + return (name == "primitive"); + } + + // No match + return false; + } + // quoted values mean literal search var nSearchWords = searchWords.length; if ((val.charAt(0) === "\"" || val.charAt(0) === "'") && @@ -239,7 +261,7 @@ for (var i = 0; i < nSearchWords; ++i) { if (searchWords[i] === val) { // filter type: ... queries - if (typeFilter < 0 || typeFilter === searchIndex[i].ty) { + if (typePassesFilter(typeFilter, searchIndex[i].ty)) { results.push({id: i, index: -1}); } } @@ -285,7 +307,7 @@ searchWords[j].replace(/_/g, "").indexOf(val) > -1) { // filter type: ... queries - if (typeFilter < 0 || typeFilter === searchIndex[j].ty) { + if (typePassesFilter(typeFilter, searchIndex[j].ty)) { results.push({ id: j, index: searchWords[j].replace(/_/g, "").indexOf(val), @@ -295,7 +317,7 @@ } else if ( (lev_distance = levenshtein(searchWords[j], val)) <= MAX_LEV_DISTANCE) { - if (typeFilter < 0 || typeFilter === searchIndex[j].ty) { + if (typePassesFilter(typeFilter, searchIndex[j].ty)) { results.push({ id: j, index: 0, @@ -451,11 +473,9 @@ var matches, type, query, raw = $('.search-input').val(); query = raw; - matches = query.match(/^(fn|mod|struct|enum|trait|t(ype)?d(ef)?)\s*:\s*/i); + matches = query.match(/^(fn|mod|struct|enum|trait|type|const|macro)\s*:\s*/i); if (matches) { - type = matches[1].replace(/^td$/, 'typedef') - .replace(/^tdef$/, 'typedef') - .replace(/^typed$/, 'typedef'); + type = matches[1].replace(/^const$/, 'constant'); query = query.substring(matches[0].length); } @@ -753,7 +773,8 @@ if (rootPath === '../') { var sidebar = $('.sidebar'); var div = $('
').attr('class', 'block crate'); - div.append($('

').text('Crates')); + div.append($('

').text('Crates')); + var ul = $('