]> git.lizzy.rs Git - rust.git/commitdiff
rollup merge of #23662: steveklabnik/gh23421
authorAlex Crichton <alex@alexcrichton.com>
Tue, 24 Mar 2015 21:50:48 +0000 (14:50 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 24 Mar 2015 21:50:48 +0000 (14:50 -0700)
I assume since both shifts say the same thing, I should fix both of them, but then I realized I don't strictly know about left shift.

Fixes #23421

r? @pnkfelix

2066 files changed:
configure
src/compiletest/compiletest.rs
src/compiletest/header.rs
src/compiletest/runtest.rs
src/doc/intro.md
src/doc/reference.md
src/doc/trpl/SUMMARY.md
src/doc/trpl/associated-types.md [new file with mode: 0644]
src/doc/trpl/compound-data-types.md
src/doc/trpl/concurrency.md
src/doc/trpl/crates-and-modules.md
src/doc/trpl/documentation.md
src/doc/trpl/ffi.md
src/doc/trpl/iterators.md
src/doc/trpl/method-syntax.md
src/doc/trpl/more-strings.md
src/doc/trpl/ownership.md
src/doc/trpl/pointers.md
src/doc/trpl/standard-input.md
src/doc/trpl/testing.md
src/doc/trpl/traits.md
src/doc/trpl/unsafe.md
src/etc/libc.c
src/liballoc/arc.rs
src/liballoc/boxed.rs
src/liballoc/heap.rs
src/liballoc/lib.rs
src/liballoc/rc.rs
src/libarena/lib.rs
src/libcollections/binary_heap.rs
src/libcollections/bit.rs
src/libcollections/borrow.rs
src/libcollections/btree/map.rs
src/libcollections/btree/node.rs
src/libcollections/btree/set.rs
src/libcollections/fmt.rs
src/libcollections/lib.rs
src/libcollections/linked_list.rs
src/libcollections/slice.rs
src/libcollections/str.rs
src/libcollections/string.rs
src/libcollections/vec.rs
src/libcollections/vec_deque.rs
src/libcollections/vec_map.rs
src/libcollectionstest/btree/set.rs
src/libcollectionstest/lib.rs
src/libcollectionstest/slice.rs
src/libcollectionstest/str.rs
src/libcore/any.rs
src/libcore/array.rs
src/libcore/cell.rs
src/libcore/cmp.rs
src/libcore/convert.rs [new file with mode: 0644]
src/libcore/error.rs
src/libcore/finally.rs
src/libcore/fmt/mod.rs
src/libcore/fmt/num.rs
src/libcore/hash/mod.rs
src/libcore/intrinsics.rs
src/libcore/iter.rs
src/libcore/lib.rs
src/libcore/macros.rs
src/libcore/marker.rs
src/libcore/mem.rs
src/libcore/num/f32.rs
src/libcore/num/f64.rs
src/libcore/num/i16.rs
src/libcore/num/i32.rs
src/libcore/num/i64.rs
src/libcore/num/i8.rs
src/libcore/num/int_macros.rs
src/libcore/num/isize.rs
src/libcore/num/mod.rs
src/libcore/num/u16.rs
src/libcore/num/u32.rs
src/libcore/num/u64.rs
src/libcore/num/u8.rs
src/libcore/num/uint_macros.rs
src/libcore/num/usize.rs
src/libcore/ops.rs
src/libcore/option.rs
src/libcore/prelude.rs
src/libcore/ptr.rs
src/libcore/raw.rs
src/libcore/result.rs
src/libcore/simd.rs
src/libcore/slice.rs
src/libcore/str/mod.rs
src/libcore/str/pattern.rs
src/libcoretest/lib.rs
src/libcoretest/mem.rs
src/libcoretest/ptr.rs
src/libcoretest/str.rs
src/libflate/lib.rs
src/libgraphviz/lib.rs
src/liblibc/lib.rs
src/liblog/lib.rs
src/librand/distributions/exponential.rs
src/librand/distributions/gamma.rs
src/librand/distributions/mod.rs
src/librand/distributions/normal.rs
src/librand/distributions/range.rs
src/librand/isaac.rs
src/librand/lib.rs
src/librand/reseeding.rs
src/librbml/lib.rs
src/librustc/lib.rs
src/librustc/lint/builtin.rs
src/librustc/lint/context.rs
src/librustc/metadata/cstore.rs
src/librustc/metadata/encoder.rs
src/librustc/metadata/filesearch.rs
src/librustc/metadata/loader.rs
src/librustc/middle/astencode.rs
src/librustc/middle/check_match.rs
src/librustc/middle/const_eval.rs
src/librustc/middle/dead.rs
src/librustc/middle/effect.rs
src/librustc/middle/expr_use_visitor.rs
src/librustc/middle/infer/combine.rs
src/librustc/middle/infer/region_inference/mod.rs
src/librustc/middle/liveness.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/pat_util.rs
src/librustc/middle/reachable.rs
src/librustc/middle/stability.rs
src/librustc/middle/traits/error_reporting.rs
src/librustc/middle/traits/mod.rs
src/librustc/middle/traits/project.rs
src/librustc/middle/traits/select.rs
src/librustc/middle/traits/util.rs
src/librustc/middle/ty.rs
src/librustc/session/config.rs
src/librustc/session/search_paths.rs
src/librustc_back/archive.rs
src/librustc_back/fs.rs
src/librustc_back/lib.rs
src/librustc_back/rpath.rs
src/librustc_back/target/mod.rs
src/librustc_bitflags/lib.rs
src/librustc_borrowck/borrowck/move_data.rs
src/librustc_borrowck/lib.rs
src/librustc_driver/driver.rs
src/librustc_driver/lib.rs
src/librustc_lint/builtin.rs
src/librustc_lint/lib.rs
src/librustc_llvm/lib.rs
src/librustc_privacy/lib.rs
src/librustc_trans/back/link.rs
src/librustc_trans/lib.rs
src/librustc_trans/save/mod.rs
src/librustc_trans/trans/_match.rs
src/librustc_trans/trans/asm.rs
src/librustc_trans/trans/base.rs
src/librustc_trans/trans/callee.rs
src/librustc_trans/trans/closure.rs
src/librustc_trans/trans/common.rs
src/librustc_trans/trans/consts.rs
src/librustc_trans/trans/datum.rs
src/librustc_trans/trans/debuginfo.rs
src/librustc_trans/trans/expr.rs
src/librustc_trans/trans/intrinsic.rs
src/librustc_trans/trans/meth.rs
src/librustc_typeck/astconv.rs
src/librustc_typeck/check/_match.rs
src/librustc_typeck/check/closure.rs
src/librustc_typeck/check/coercion.rs
src/librustc_typeck/check/demand.rs
src/librustc_typeck/check/method/probe.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/upvar.rs
src/librustc_typeck/check/vtable.rs
src/librustc_typeck/coherence/mod.rs
src/librustc_typeck/coherence/unsafety.rs
src/librustc_typeck/collect.rs
src/librustc_typeck/lib.rs
src/librustdoc/clean/mod.rs
src/librustdoc/externalfiles.rs
src/librustdoc/html/format.rs
src/librustdoc/html/markdown.rs
src/librustdoc/html/render.rs
src/librustdoc/lib.rs
src/librustdoc/markdown.rs
src/librustdoc/test.rs
src/librustdoc/visit_ast.rs
src/libserialize/hex.rs
src/libserialize/json.rs
src/libserialize/lib.rs
src/libserialize/serialize.rs
src/libstd/array.rs [new file with mode: 0644]
src/libstd/collections/hash/map.rs
src/libstd/collections/hash/set.rs
src/libstd/collections/mod.rs
src/libstd/env.rs
src/libstd/ffi/c_str.rs
src/libstd/ffi/os_str.rs
src/libstd/fs/mod.rs
src/libstd/fs/tempdir.rs
src/libstd/io/buffered.rs
src/libstd/io/cursor.rs
src/libstd/io/lazy.rs
src/libstd/io/mod.rs
src/libstd/lib.rs
src/libstd/macros.rs
src/libstd/net/addr.rs
src/libstd/net/ip.rs
src/libstd/net/mod.rs
src/libstd/net/tcp.rs
src/libstd/net/udp.rs
src/libstd/num/f32.rs
src/libstd/num/f64.rs
src/libstd/num/mod.rs
src/libstd/old_io/buffered.rs
src/libstd/old_io/comm_adapters.rs
src/libstd/old_io/extensions.rs
src/libstd/old_io/fs.rs
src/libstd/old_io/mem.rs
src/libstd/old_io/mod.rs
src/libstd/old_io/net/ip.rs
src/libstd/old_io/net/pipe.rs
src/libstd/old_io/net/tcp.rs
src/libstd/old_io/net/udp.rs
src/libstd/old_io/pipe.rs
src/libstd/old_io/process.rs
src/libstd/old_io/stdio.rs
src/libstd/old_io/tempfile.rs
src/libstd/old_io/timer.rs
src/libstd/old_path/mod.rs
src/libstd/old_path/windows.rs
src/libstd/os.rs
src/libstd/path.rs
src/libstd/prelude/v1.rs
src/libstd/process.rs
src/libstd/rand/mod.rs
src/libstd/rand/reader.rs
src/libstd/rt/at_exit_imp.rs
src/libstd/rt/mod.rs
src/libstd/sync/condvar.rs
src/libstd/sync/future.rs
src/libstd/sync/mpsc/mod.rs
src/libstd/sync/mpsc/select.rs
src/libstd/sync/mutex.rs
src/libstd/sync/poison.rs
src/libstd/sync/rwlock.rs
src/libstd/sync/semaphore.rs
src/libstd/sync/task_pool.rs
src/libstd/sys/common/helper_thread.rs
src/libstd/sys/common/thread_info.rs
src/libstd/sys/common/wtf8.rs
src/libstd/sys/unix/fs2.rs
src/libstd/sys/unix/os.rs
src/libstd/sys/unix/thread.rs
src/libstd/sys/windows/fs2.rs
src/libstd/sys/windows/mod.rs
src/libstd/sys/windows/os.rs
src/libstd/thread.rs [deleted file]
src/libstd/thread/local.rs [new file with mode: 0644]
src/libstd/thread/mod.rs [new file with mode: 0644]
src/libstd/thread/scoped.rs [new file with mode: 0644]
src/libstd/thread_local/mod.rs [deleted file]
src/libstd/thread_local/scoped.rs [deleted file]
src/libsyntax/codemap.rs
src/libsyntax/ext/base.rs
src/libsyntax/ext/deriving/mod.rs
src/libsyntax/ext/format.rs
src/libsyntax/ext/quote.rs
src/libsyntax/ext/source_util.rs
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/feature_gate.rs
src/libsyntax/lib.rs
src/libsyntax/parse/lexer/mod.rs
src/libsyntax/parse/obsolete.rs
src/libsyntax/parse/parser.rs
src/libsyntax/print/pprust.rs
src/libterm/lib.rs
src/libterm/terminfo/mod.rs
src/libterm/terminfo/parser/compiled.rs
src/libterm/terminfo/searcher.rs
src/libterm/win.rs
src/libtest/lib.rs
src/libunicode/char.rs
src/libunicode/lib.rs
src/libunicode/u_str.rs
src/rustbook/book.rs
src/rustbook/build.rs
src/rustbook/error.rs
src/rustbook/main.rs
src/rustbook/subcommand.rs
src/snapshots.txt
src/test/auxiliary/anon-extern-mod-cross-crate-1.rs
src/test/auxiliary/check_static_recursion_foreign_helper.rs
src/test/auxiliary/extern-crosscrate-source.rs
src/test/auxiliary/foreign_lib.rs
src/test/auxiliary/issue-11224.rs
src/test/auxiliary/issue-2631-a.rs
src/test/auxiliary/issue-3012-1.rs
src/test/auxiliary/issue13507.rs
src/test/auxiliary/issue_16723_multiple_items_syntax_ext.rs
src/test/auxiliary/issue_3907.rs
src/test/auxiliary/issue_5844_aux.rs
src/test/auxiliary/linkage-visibility.rs
src/test/auxiliary/lint_for_crate.rs
src/test/auxiliary/lint_group_plugin_test.rs
src/test/auxiliary/lint_plugin_test.rs
src/test/auxiliary/logging_right_crate.rs
src/test/auxiliary/macro_crate_MacroRulesTT.rs
src/test/auxiliary/macro_crate_test.rs
src/test/auxiliary/plugin_args.rs
src/test/auxiliary/plugin_crate_outlive_expansion_phase.rs
src/test/auxiliary/plugin_with_plugin_lib.rs
src/test/auxiliary/private_trait_xc.rs
src/test/auxiliary/procedural_mbe_matching.rs
src/test/auxiliary/rlib_crate_test.rs
src/test/auxiliary/roman_numerals.rs
src/test/auxiliary/svh-a-base.rs
src/test/auxiliary/svh-a-change-lit.rs
src/test/auxiliary/svh-a-change-significant-cfg.rs
src/test/auxiliary/svh-a-change-trait-bound.rs
src/test/auxiliary/svh-a-change-type-arg.rs
src/test/auxiliary/svh-a-change-type-ret.rs
src/test/auxiliary/svh-a-change-type-static.rs
src/test/auxiliary/svh-a-comment.rs
src/test/auxiliary/svh-a-doc.rs
src/test/auxiliary/svh-a-macro.rs
src/test/auxiliary/svh-a-no-change.rs
src/test/auxiliary/svh-a-redundant-cfg.rs
src/test/auxiliary/svh-a-whitespace.rs
src/test/auxiliary/syntax_extension_with_dll_deps_2.rs
src/test/auxiliary/trait_impl_conflict.rs
src/test/auxiliary/typeck-default-trait-impl-cross-crate-coherence-lib.rs
src/test/auxiliary/typeid-intrinsic.rs
src/test/auxiliary/typeid-intrinsic2.rs
src/test/auxiliary/weak-lang-items.rs
src/test/bench/core-map.rs
src/test/bench/core-set.rs
src/test/bench/core-std.rs
src/test/bench/msgsend-pipes-shared.rs
src/test/bench/msgsend-pipes.rs
src/test/bench/msgsend-ring-mutex-arcs.rs
src/test/bench/noise.rs
src/test/bench/shootout-binarytrees.rs
src/test/bench/shootout-fannkuch-redux.rs
src/test/bench/shootout-fasta-redux.rs
src/test/bench/shootout-fasta.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/bench/shootout-k-nucleotide.rs
src/test/bench/shootout-mandelbrot.rs
src/test/bench/shootout-meteor.rs
src/test/bench/shootout-nbody.rs
src/test/bench/shootout-pfib.rs
src/test/bench/shootout-reverse-complement.rs
src/test/bench/shootout-spectralnorm.rs
src/test/bench/std-smallintmap.rs
src/test/bench/sudoku.rs
src/test/bench/task-perf-alloc-unwind.rs
src/test/compile-fail/borrowck-overloaded-call.rs
src/test/compile-fail/borrowck-overloaded-index-2.rs [deleted file]
src/test/compile-fail/borrowck-overloaded-index-and-overloaded-deref.rs
src/test/compile-fail/borrowck-overloaded-index-autoderef.rs
src/test/compile-fail/borrowck-overloaded-index-move-from-vec.rs [new file with mode: 0644]
src/test/compile-fail/borrowck-overloaded-index-move-index.rs [new file with mode: 0644]
src/test/compile-fail/borrowck-overloaded-index-ref-index.rs [new file with mode: 0644]
src/test/compile-fail/borrowck-overloaded-index.rs [deleted file]
src/test/compile-fail/coerce-unsafe-to-closure.rs
src/test/compile-fail/coherence-default-trait-impl.rs
src/test/compile-fail/deriving-is-deprecated.rs [deleted file]
src/test/compile-fail/dst-index.rs
src/test/compile-fail/extern-wrong-value-type.rs
src/test/compile-fail/feature-gate-unboxed-closures-manual-impls.rs
src/test/compile-fail/fn-trait-formatting.rs
src/test/compile-fail/fn-variance-1.rs
src/test/compile-fail/hrtb-precedence-of-plus-error-message.rs [deleted file]
src/test/compile-fail/internal-unstable-noallow.rs
src/test/compile-fail/internal-unstable-thread-local.rs
src/test/compile-fail/internal-unstable.rs
src/test/compile-fail/issue-14845.rs
src/test/compile-fail/issue-15094.rs
src/test/compile-fail/issue-16538.rs
src/test/compile-fail/issue-18400.rs
src/test/compile-fail/issue-20225.rs
src/test/compile-fail/issue-5543.rs [deleted file]
src/test/compile-fail/kindck-impl-type-params.rs
src/test/compile-fail/lint-dead-code-3.rs
src/test/compile-fail/lint-output-format.rs
src/test/compile-fail/lint-stability-fields.rs
src/test/compile-fail/lint-stability.rs
src/test/compile-fail/lint-unnecessary-casts.rs [deleted file]
src/test/compile-fail/liveness-unused.rs
src/test/compile-fail/match-ref-mut-invariance.rs [new file with mode: 0644]
src/test/compile-fail/match-ref-mut-let-invariance.rs [new file with mode: 0644]
src/test/compile-fail/object-safety-by-value-self.rs
src/test/compile-fail/overloaded-calls-bad.rs
src/test/compile-fail/overloaded-calls-nontuple.rs
src/test/compile-fail/recursion_limit.rs
src/test/compile-fail/regions-close-object-into-object-5.rs
src/test/compile-fail/regions-close-over-type-parameter-1.rs
src/test/compile-fail/regions-trait-object-subtyping.rs [new file with mode: 0644]
src/test/compile-fail/trivial_casts.rs [new file with mode: 0644]
src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs
src/test/compile-fail/unboxed-closures-fnmut-as-fn.rs
src/test/compile-fail/unboxed-closures-recursive-fn-using-fn-mut.rs
src/test/compile-fail/unboxed-closures-unsafe-extern-fn.rs
src/test/compile-fail/unboxed-closures-wrong-abi.rs
src/test/compile-fail/unboxed-closures-wrong-arg-type-extern-fn.rs
src/test/compile-fail/vector-cast-weirdness.rs
src/test/debuginfo/constant-debug-locs.rs
src/test/debuginfo/function-arg-initialization.rs
src/test/debuginfo/function-prologue-stepping-no-stack-check.rs
src/test/debuginfo/function-prologue-stepping-regular.rs
src/test/debuginfo/issue13213.rs
src/test/debuginfo/simd.rs
src/test/debuginfo/type-names.rs
src/test/parse-fail/obsolete-for-sized.rs [deleted file]
src/test/pretty/default-trait-impl.rs
src/test/pretty/path-type-bounds.rs
src/test/run-fail/extern-panic.rs
src/test/run-fail/rt-set-exit-status-panic.rs
src/test/run-fail/rt-set-exit-status-panic2.rs
src/test/run-fail/rt-set-exit-status.rs
src/test/run-make/allow-warnings-cmdline-stability/foo.rs
src/test/run-make/cannot-read-embedded-idents/create_and_compile.rs
src/test/run-make/extern-fn-reachable/main.rs
src/test/run-make/intrinsic-unreachable/exit-unreachable.rs
src/test/run-make/issue-19371/foo.rs
src/test/run-make/link-path-order/main.rs
src/test/run-make/lto-syntax-extension/main.rs
src/test/run-make/no-duplicate-libs/bar.rs
src/test/run-make/no-duplicate-libs/foo.rs
src/test/run-make/rustdoc-default-impl/foo.rs
src/test/run-make/save-analysis/foo.rs
src/test/run-make/symbols-are-reasonable/lib.rs
src/test/run-make/unicode-input/multiple_files.rs
src/test/run-make/unicode-input/span_length.rs
src/test/run-make/volatile-intrinsics/main.rs
src/test/run-pass-fulldeps/compiler-calls.rs
src/test/run-pass-fulldeps/issue-16992.rs
src/test/run-pass-fulldeps/issue-18763-quote-token-tree.rs
src/test/run-pass-fulldeps/quote-tokens.rs
src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs
src/test/run-pass-fulldeps/syntax-extension-with-dll-deps.rs
src/test/run-pass-valgrind/cleanup-stdin.rs
src/test/run-pass/alias-uninit-value.rs
src/test/run-pass/alloca-from-derived-tydesc.rs
src/test/run-pass/anon-extern-mod-cross-crate-2.rs
src/test/run-pass/anon-extern-mod.rs
src/test/run-pass/argument-passing.rs
src/test/run-pass/arith-2.rs
src/test/run-pass/arith-unsigned.rs
src/test/run-pass/artificial-block.rs
src/test/run-pass/as-precedence.rs
src/test/run-pass/asm-concat-src.rs
src/test/run-pass/asm-in-out-operand.rs
src/test/run-pass/asm-out-assign.rs
src/test/run-pass/assign-assign.rs
src/test/run-pass/assignability-trait.rs
src/test/run-pass/associated-types-basic.rs
src/test/run-pass/associated-types-binding-in-trait.rs
src/test/run-pass/associated-types-binding-in-where-clause.rs
src/test/run-pass/associated-types-bound.rs
src/test/run-pass/associated-types-conditional-dispatch.rs
src/test/run-pass/associated-types-constant-type.rs
src/test/run-pass/associated-types-doubleendediterator-object.rs
src/test/run-pass/associated-types-duplicate-binding-in-env-hrtb.rs
src/test/run-pass/associated-types-duplicate-binding-in-env.rs
src/test/run-pass/associated-types-enum-field-named.rs
src/test/run-pass/associated-types-enum-field-numbered.rs
src/test/run-pass/associated-types-eq-obj.rs
src/test/run-pass/associated-types-in-default-method.rs
src/test/run-pass/associated-types-in-fn.rs
src/test/run-pass/associated-types-in-impl-generics.rs
src/test/run-pass/associated-types-in-inherent-method.rs
src/test/run-pass/associated-types-issue-20220.rs
src/test/run-pass/associated-types-issue-20371.rs
src/test/run-pass/associated-types-issue-21212.rs
src/test/run-pass/associated-types-iterator-binding.rs
src/test/run-pass/associated-types-nested-projections.rs
src/test/run-pass/associated-types-normalize-in-bounds-binding.rs
src/test/run-pass/associated-types-normalize-in-bounds-ufcs.rs
src/test/run-pass/associated-types-normalize-in-bounds.rs
src/test/run-pass/associated-types-normalize-unifield-struct.rs
src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where-clause.rs
src/test/run-pass/associated-types-projection-from-known-type-in-impl.rs
src/test/run-pass/associated-types-projection-in-object-type.rs
src/test/run-pass/associated-types-projection-in-supertrait.rs
src/test/run-pass/associated-types-projection-in-where-clause.rs
src/test/run-pass/associated-types-qualified-path-with-trait-with-type-parameters.rs
src/test/run-pass/associated-types-ref-from-struct.rs
src/test/run-pass/associated-types-ref-in-struct-literal.rs
src/test/run-pass/associated-types-region-erasure-issue-20582.rs
src/test/run-pass/associated-types-resolve-lifetime.rs
src/test/run-pass/associated-types-return.rs
src/test/run-pass/associated-types-simple.rs
src/test/run-pass/associated-types-stream.rs
src/test/run-pass/associated-types-struct-field-named.rs
src/test/run-pass/associated-types-struct-field-numbered.rs
src/test/run-pass/associated-types-sugar-path.rs
src/test/run-pass/astconv-cycle-between-trait-and-type.rs
src/test/run-pass/attr-before-view-item.rs
src/test/run-pass/attr-before-view-item2.rs
src/test/run-pass/attr-main-2.rs
src/test/run-pass/attr-main.rs
src/test/run-pass/attr-mix-new.rs
src/test/run-pass/attr-no-drop-flag-size.rs
src/test/run-pass/attr-start.rs
src/test/run-pass/attr.rs
src/test/run-pass/auto-loop.rs
src/test/run-pass/auto-ref-sliceable.rs
src/test/run-pass/autobind.rs
src/test/run-pass/autoderef-and-borrow-method-receiver.rs
src/test/run-pass/autoderef-method-on-trait.rs
src/test/run-pass/autoderef-method-priority.rs
src/test/run-pass/autoderef-method-twice-but-not-thrice.rs
src/test/run-pass/autoderef-method-twice.rs
src/test/run-pass/autoderef-method.rs
src/test/run-pass/autoref-intermediate-types-issue-3585.rs
src/test/run-pass/backtrace.rs
src/test/run-pass/big-literals.rs
src/test/run-pass/binary-minus-without-space.rs
src/test/run-pass/bind-by-move.rs
src/test/run-pass/bind-field-short-with-modifiers.rs
src/test/run-pass/bitv-perf-test.rs
src/test/run-pass/blind-item-mixed-crate-use-item.rs
src/test/run-pass/blind-item-mixed-use-item.rs
src/test/run-pass/block-arg-call-as.rs
src/test/run-pass/block-expr-precedence.rs
src/test/run-pass/block-fn-coerce.rs
src/test/run-pass/bool-not.rs
src/test/run-pass/bool.rs
src/test/run-pass/borrow-by-val-method-receiver.rs
src/test/run-pass/borrow-tuple-fields.rs
src/test/run-pass/borrowck-assign-to-subfield.rs
src/test/run-pass/borrowck-binding-mutbl.rs
src/test/run-pass/borrowck-borrow-from-expr-block.rs
src/test/run-pass/borrowck-borrow-of-mut-base-ptr-safe.rs
src/test/run-pass/borrowck-closures-two-imm.rs
src/test/run-pass/borrowck-field-sensitivity.rs
src/test/run-pass/borrowck-fixed-length-vecs.rs
src/test/run-pass/borrowck-freeze-frozen-mut.rs
src/test/run-pass/borrowck-lend-args.rs
src/test/run-pass/borrowck-macro-interaction-issue-6304.rs
src/test/run-pass/borrowck-move-by-capture-ok.rs
src/test/run-pass/borrowck-mut-vec-as-imm-slice.rs
src/test/run-pass/borrowck-pat-reassign-no-binding.rs
src/test/run-pass/borrowck-rvalues-mutable.rs
src/test/run-pass/borrowck-scope-of-deref-issue-4666.rs
src/test/run-pass/borrowck-static-item-in-fn.rs
src/test/run-pass/borrowck-trait-lifetime.rs
src/test/run-pass/borrowck-uniq-via-ref.rs
src/test/run-pass/borrowck-univariant-enum.rs
src/test/run-pass/borrowck-use-mut-borrow.rs
src/test/run-pass/borrowed-ptr-pattern-2.rs
src/test/run-pass/borrowed-ptr-pattern-3.rs
src/test/run-pass/borrowed-ptr-pattern-infallible.rs
src/test/run-pass/borrowed-ptr-pattern-option.rs
src/test/run-pass/borrowed-ptr-pattern.rs
src/test/run-pass/box-new.rs
src/test/run-pass/break-value.rs
src/test/run-pass/break.rs
src/test/run-pass/bug-7183-generics.rs
src/test/run-pass/bug-7295.rs
src/test/run-pass/builtin-superkinds-capabilities-transitive.rs
src/test/run-pass/builtin-superkinds-capabilities-xc.rs
src/test/run-pass/builtin-superkinds-capabilities.rs
src/test/run-pass/builtin-superkinds-in-metadata.rs
src/test/run-pass/builtin-superkinds-phantom-typaram.rs
src/test/run-pass/builtin-superkinds-self-type.rs
src/test/run-pass/builtin-superkinds-simple.rs
src/test/run-pass/builtin-superkinds-typaram.rs
src/test/run-pass/by-value-self-in-mut-slot.rs
src/test/run-pass/c-stack-as-value.rs
src/test/run-pass/c-stack-returning-int64.rs
src/test/run-pass/call-closure-from-overloaded-op.rs
src/test/run-pass/can-copy-pod.rs
src/test/run-pass/cancel-clean-via-immediate-rvalue-ref.rs
src/test/run-pass/capture-clauses-boxed-closures.rs
src/test/run-pass/capture-clauses-unboxed-closures.rs
src/test/run-pass/capturing-logging.rs
src/test/run-pass/cast-in-array-size.rs
src/test/run-pass/cast-region-to-uint.rs
src/test/run-pass/cast.rs
src/test/run-pass/cci_capture_clause.rs
src/test/run-pass/cci_nested_exe.rs
src/test/run-pass/cell-does-not-clone.rs
src/test/run-pass/cfg-attr-cfg.rs
src/test/run-pass/cfg-attr-crate.rs
src/test/run-pass/cfg-family.rs
src/test/run-pass/cfg-macros-foo.rs
src/test/run-pass/cfg-macros-notfoo.rs
src/test/run-pass/cfg-match-arm.rs
src/test/run-pass/cfg-target-family.rs
src/test/run-pass/cfg_inner_static.rs
src/test/run-pass/cfgs-on-items.rs
src/test/run-pass/char.rs
src/test/run-pass/check-static-mut-slices.rs
src/test/run-pass/check-static-recursion-foreign.rs
src/test/run-pass/check-static-slice.rs
src/test/run-pass/child-outlives-parent.rs
src/test/run-pass/class-dtor.rs
src/test/run-pass/class-exports.rs
src/test/run-pass/class-method-cross-crate.rs
src/test/run-pass/class-methods-cross-crate.rs
src/test/run-pass/class-methods.rs
src/test/run-pass/class-poly-methods-cross-crate.rs
src/test/run-pass/class-poly-methods.rs
src/test/run-pass/class-str-field.rs
src/test/run-pass/class-typarams.rs
src/test/run-pass/classes-cross-crate.rs
src/test/run-pass/classes-self-referential.rs
src/test/run-pass/classes-simple-cross-crate.rs
src/test/run-pass/classes-simple-method.rs
src/test/run-pass/classes-simple.rs
src/test/run-pass/cleanup-arm-conditional.rs
src/test/run-pass/cleanup-rvalue-during-if-and-while.rs
src/test/run-pass/cleanup-rvalue-temp-during-incomplete-alloc.rs
src/test/run-pass/cleanup-shortcircuit.rs
src/test/run-pass/clone-with-exterior.rs
src/test/run-pass/closure-bounds-can-capture-chan.rs
src/test/run-pass/closure-inference.rs
src/test/run-pass/closure-inference2.rs
src/test/run-pass/closure-reform.rs
src/test/run-pass/cmp-default.rs
src/test/run-pass/coerce-expect-unsized.rs
src/test/run-pass/coerce-match-calls.rs
src/test/run-pass/coerce-match.rs
src/test/run-pass/coerce-overloaded-autoderef.rs
src/test/run-pass/coerce-reborrow-imm-ptr-arg.rs
src/test/run-pass/coerce-reborrow-imm-ptr-rcvr.rs
src/test/run-pass/coerce-reborrow-imm-vec-arg.rs
src/test/run-pass/coerce-reborrow-imm-vec-rcvr.rs
src/test/run-pass/coerce-reborrow-mut-ptr-arg.rs
src/test/run-pass/coerce-reborrow-mut-ptr-rcvr.rs
src/test/run-pass/coerce-reborrow-mut-vec-arg.rs
src/test/run-pass/coerce-reborrow-mut-vec-rcvr.rs
src/test/run-pass/coerce-unify-return.rs
src/test/run-pass/coherence-bigint-int.rs
src/test/run-pass/coherence-bigint-vecint.rs
src/test/run-pass/coherence-blanket.rs
src/test/run-pass/coherence-covered-type-parameter.rs
src/test/run-pass/coherence-cow-1.rs
src/test/run-pass/coherence-cow-2.rs
src/test/run-pass/coherence-impl-in-fn.rs
src/test/run-pass/coherence-iterator-vec-any-elem.rs
src/test/run-pass/coherence-iterator-vec.rs
src/test/run-pass/coherence-local-1.rs
src/test/run-pass/coherence-local-2.rs
src/test/run-pass/coherence-multidispatch-tuple.rs
src/test/run-pass/coherence-negative-impls-safe.rs
src/test/run-pass/colorful-write-macros.rs
src/test/run-pass/comm.rs
src/test/run-pass/compare-generic-enums.rs
src/test/run-pass/concat.rs
src/test/run-pass/conditional-compile-arch.rs
src/test/run-pass/conditional-compile.rs
src/test/run-pass/conditional-debug-macro-off.rs
src/test/run-pass/const-autoderef.rs
src/test/run-pass/const-big-enum.rs
src/test/run-pass/const-binops.rs
src/test/run-pass/const-block-cross-crate-fn.rs
src/test/run-pass/const-block-item-macro-codegen.rs
src/test/run-pass/const-block-item.rs
src/test/run-pass/const-block.rs
src/test/run-pass/const-bound.rs
src/test/run-pass/const-cast-ptr-int.rs
src/test/run-pass/const-cast.rs
src/test/run-pass/const-const.rs
src/test/run-pass/const-contents.rs
src/test/run-pass/const-cross-crate-const.rs
src/test/run-pass/const-cross-crate-extern.rs
src/test/run-pass/const-deref.rs
src/test/run-pass/const-enum-byref-self.rs
src/test/run-pass/const-enum-byref.rs
src/test/run-pass/const-enum-cast.rs
src/test/run-pass/const-enum-ptr.rs
src/test/run-pass/const-enum-struct.rs
src/test/run-pass/const-enum-struct2.rs
src/test/run-pass/const-enum-structlike.rs
src/test/run-pass/const-enum-tuple.rs
src/test/run-pass/const-enum-tuple2.rs
src/test/run-pass/const-enum-tuplestruct.rs
src/test/run-pass/const-enum-tuplestruct2.rs
src/test/run-pass/const-enum-vec-index.rs
src/test/run-pass/const-enum-vec-ptr.rs
src/test/run-pass/const-enum-vector.rs
src/test/run-pass/const-expr-in-fixed-length-vec.rs
src/test/run-pass/const-expr-in-vec-repeat.rs
src/test/run-pass/const-extern-function.rs
src/test/run-pass/const-fn-val.rs
src/test/run-pass/const-negative.rs
src/test/run-pass/const-nullary-enum.rs
src/test/run-pass/const-nullary-univariant-enum.rs
src/test/run-pass/const-region-ptrs-noncopy.rs
src/test/run-pass/const-str-ptr.rs
src/test/run-pass/const-struct-offsets.rs
src/test/run-pass/const-tuple-struct.rs
src/test/run-pass/const-unit-struct.rs
src/test/run-pass/const-vec-of-fns.rs
src/test/run-pass/const-vec-syntax.rs
src/test/run-pass/consts-in-patterns.rs
src/test/run-pass/copy-out-of-array-1.rs
src/test/run-pass/core-run-destroy.rs
src/test/run-pass/crate-leading-sep.rs
src/test/run-pass/crate-method-reexport-grrrrrrr.rs
src/test/run-pass/crate-name-attr-used.rs
src/test/run-pass/create-dir-all-bare.rs [new file with mode: 0644]
src/test/run-pass/cross-crate-const-pat.rs
src/test/run-pass/cross-crate-newtype-struct-pat.rs
src/test/run-pass/cycle-generic-bound.rs
src/test/run-pass/cycle-trait-type-trait.rs
src/test/run-pass/dead-code-leading-underscore.rs
src/test/run-pass/deep.rs
src/test/run-pass/default-method-parsing.rs
src/test/run-pass/deprecated-no-split-stack.rs [deleted file]
src/test/run-pass/deref-mut-on-ref.rs
src/test/run-pass/deref-on-ref.rs
src/test/run-pass/deref-rc.rs
src/test/run-pass/deref.rs
src/test/run-pass/derive-no-std.rs
src/test/run-pass/deriving-bounds.rs
src/test/run-pass/deriving-clone-enum.rs
src/test/run-pass/deriving-clone-generic-enum.rs
src/test/run-pass/deriving-clone-generic-struct.rs
src/test/run-pass/deriving-clone-generic-tuple-struct.rs
src/test/run-pass/deriving-clone-struct.rs
src/test/run-pass/deriving-clone-tuple-struct.rs
src/test/run-pass/deriving-cmp-generic-enum.rs
src/test/run-pass/deriving-cmp-generic-struct-enum.rs
src/test/run-pass/deriving-cmp-generic-struct.rs
src/test/run-pass/deriving-cmp-generic-tuple-struct.rs
src/test/run-pass/deriving-cmp-shortcircuit.rs
src/test/run-pass/deriving-default-box.rs
src/test/run-pass/deriving-encodable-decodable-box.rs
src/test/run-pass/deriving-encodable-decodable-cell-refcell.rs
src/test/run-pass/deriving-enum-single-variant.rs
src/test/run-pass/deriving-global.rs
src/test/run-pass/deriving-hash.rs
src/test/run-pass/deriving-in-macro.rs
src/test/run-pass/deriving-meta-multiple.rs
src/test/run-pass/deriving-meta.rs
src/test/run-pass/deriving-primitive.rs
src/test/run-pass/deriving-rand.rs
src/test/run-pass/deriving-via-extension-hash-enum.rs
src/test/run-pass/deriving-via-extension-hash-struct.rs
src/test/run-pass/destructure-array-1.rs
src/test/run-pass/die-macro.rs
src/test/run-pass/div-mod.rs
src/test/run-pass/double-ref.rs
src/test/run-pass/drop-on-empty-block-exit.rs
src/test/run-pass/drop-on-ret.rs
src/test/run-pass/drop-struct-as-object.rs
src/test/run-pass/drop-uninhabited-enum.rs
src/test/run-pass/drop-with-type-ascription-1.rs
src/test/run-pass/drop-with-type-ascription-2.rs
src/test/run-pass/dropck_tarena_sound_drop.rs
src/test/run-pass/dst-coercions.rs
src/test/run-pass/dst-deref-mut.rs
src/test/run-pass/dst-deref.rs
src/test/run-pass/dst-index.rs
src/test/run-pass/dst-raw.rs
src/test/run-pass/dst-struct-sole.rs
src/test/run-pass/dst-struct.rs
src/test/run-pass/dst-trait.rs
src/test/run-pass/dupe-first-attr.rc
src/test/run-pass/duplicated-external-mods.rs
src/test/run-pass/early-ret-binop-add.rs
src/test/run-pass/early-vtbl-resolution.rs
src/test/run-pass/else-if.rs
src/test/run-pass/empty-allocation-non-null.rs
src/test/run-pass/empty-allocation-rvalue-non-null.rs
src/test/run-pass/empty-mutable-vec.rs
src/test/run-pass/enum-alignment.rs
src/test/run-pass/enum-clike-ffi-as-int.rs
src/test/run-pass/enum-discr.rs
src/test/run-pass/enum-discrim-autosizing.rs
src/test/run-pass/enum-discrim-manual-sizing.rs
src/test/run-pass/enum-discrim-range-overflow.rs
src/test/run-pass/enum-disr-val-pretty.rs
src/test/run-pass/enum-export-inheritance.rs
src/test/run-pass/enum-null-pointer-opt.rs
src/test/run-pass/enum-nullable-const-null-with-fields.rs
src/test/run-pass/enum-nullable-simplifycfg-misopt.rs
src/test/run-pass/enum-variants.rs
src/test/run-pass/enum-vec-initializer.rs
src/test/run-pass/env-home-dir.rs
src/test/run-pass/env-vars.rs
src/test/run-pass/eq-multidispatch.rs
src/test/run-pass/estr-uniq.rs
src/test/run-pass/exec-env.rs
src/test/run-pass/explicit-i-suffix.rs
src/test/run-pass/explicit-self-closures.rs
src/test/run-pass/explicit-self-generic.rs
src/test/run-pass/explicit-self-objects-uniq.rs
src/test/run-pass/explicit-self.rs
src/test/run-pass/explicit_self_xcrate_exe.rs
src/test/run-pass/exponential-notation.rs
src/test/run-pass/export-abstract-tag.rs
src/test/run-pass/export-glob-imports-target.rs
src/test/run-pass/export-multi.rs
src/test/run-pass/export-tag-variant.rs
src/test/run-pass/expr-block-fn.rs
src/test/run-pass/expr-block-generic-unique2.rs
src/test/run-pass/expr-block-generic.rs
src/test/run-pass/expr-block-slot.rs
src/test/run-pass/expr-block-unique.rs
src/test/run-pass/expr-block.rs
src/test/run-pass/expr-copy.rs
src/test/run-pass/expr-empty-ret.rs
src/test/run-pass/expr-fn.rs
src/test/run-pass/expr-if-generic.rs
src/test/run-pass/expr-if-panic-all.rs
src/test/run-pass/expr-if-panic.rs
src/test/run-pass/expr-if-unique.rs
src/test/run-pass/expr-if.rs
src/test/run-pass/expr-match-generic-unique1.rs
src/test/run-pass/expr-match-generic-unique2.rs
src/test/run-pass/expr-match-generic.rs
src/test/run-pass/expr-match-panic-all.rs
src/test/run-pass/expr-match-panic.rs
src/test/run-pass/expr-match-unique.rs
src/test/run-pass/expr-match.rs
src/test/run-pass/expr-scope.rs
src/test/run-pass/ext-expand-inner-exprs.rs
src/test/run-pass/exterior.rs
src/test/run-pass/extern-1.rs
src/test/run-pass/extern-call-deep.rs
src/test/run-pass/extern-call-deep2.rs
src/test/run-pass/extern-call-direct.rs
src/test/run-pass/extern-call-indirect.rs
src/test/run-pass/extern-call-scrub.rs
src/test/run-pass/extern-calling-convention-test.rs
src/test/run-pass/extern-compare-with-return-type.rs
src/test/run-pass/extern-crosscrate.rs
src/test/run-pass/extern-foreign-crate.rs
src/test/run-pass/extern-methods.rs
src/test/run-pass/extern-mod-abi.rs
src/test/run-pass/extern-mod-ordering-exe.rs
src/test/run-pass/extern-mod-syntax.rs
src/test/run-pass/extern-pass-char.rs
src/test/run-pass/extern-pass-double.rs
src/test/run-pass/extern-pass-empty.rs
src/test/run-pass/extern-pass-u32.rs
src/test/run-pass/extern-pass-u64.rs
src/test/run-pass/extern-pub.rs
src/test/run-pass/extern-return-TwoU16s.rs
src/test/run-pass/extern-return-TwoU32s.rs
src/test/run-pass/extern-return-TwoU64s.rs
src/test/run-pass/extern-return-TwoU8s.rs
src/test/run-pass/extern-rust.rs
src/test/run-pass/extern-take-value.rs
src/test/run-pass/extoption_env-not-defined.rs
src/test/run-pass/field-destruction-order.rs
src/test/run-pass/filter-block-view-items.rs
src/test/run-pass/fixed_length_copy.rs
src/test/run-pass/fixup-deref-mut.rs
src/test/run-pass/float-nan.rs
src/test/run-pass/float2.rs
src/test/run-pass/floatlits.rs
src/test/run-pass/fn-abi.rs
src/test/run-pass/fn-bare-assign.rs
src/test/run-pass/fn-bare-coerce-to-block.rs
src/test/run-pass/fn-bare-size.rs
src/test/run-pass/fn-bare-spawn.rs
src/test/run-pass/fn-coerce-field.rs
src/test/run-pass/fn-item-type-cast.rs
src/test/run-pass/fn-item-type-coerce.rs
src/test/run-pass/fn-lval.rs
src/test/run-pass/fn-pattern-expected-type.rs
src/test/run-pass/fn-type-infer.rs
src/test/run-pass/for-destruct.rs
src/test/run-pass/for-loop-goofiness.rs
src/test/run-pass/for-loop-into-iterator.rs
src/test/run-pass/for-loop-no-std.rs
src/test/run-pass/for-loop-panic.rs
src/test/run-pass/foreach-external-iterators-break.rs
src/test/run-pass/foreach-external-iterators-hashmap-break-restart.rs
src/test/run-pass/foreach-external-iterators-hashmap.rs
src/test/run-pass/foreach-external-iterators-loop.rs
src/test/run-pass/foreach-external-iterators-nested.rs
src/test/run-pass/foreach-external-iterators.rs
src/test/run-pass/foreach-nested.rs
src/test/run-pass/foreign-call-no-runtime.rs
src/test/run-pass/foreign-dupe.rs
src/test/run-pass/foreign-fn-linkname.rs
src/test/run-pass/foreign-fn-with-byval.rs
src/test/run-pass/foreign-mod-unused-const.rs
src/test/run-pass/foreign-no-abi.rs
src/test/run-pass/foreign-struct.rs
src/test/run-pass/foreign2.rs
src/test/run-pass/format-nan.rs
src/test/run-pass/format-no-std.rs
src/test/run-pass/format-ref-cell.rs
src/test/run-pass/fsu-moves-and-copies.rs
src/test/run-pass/fun-call-variants.rs
src/test/run-pass/fun-indirect-call.rs
src/test/run-pass/func-arg-incomplete-pattern.rs
src/test/run-pass/func-arg-ref-pattern.rs
src/test/run-pass/func-arg-wild-pattern.rs
src/test/run-pass/generic-default-type-params-cross-crate.rs
src/test/run-pass/generic-exterior-unique.rs
src/test/run-pass/generic-extern-mangle.rs
src/test/run-pass/generic-fn-infer.rs
src/test/run-pass/generic-fn-twice.rs
src/test/run-pass/generic-ivec-leak.rs
src/test/run-pass/generic-newtype-struct.rs
src/test/run-pass/generic-object.rs
src/test/run-pass/generic-static-methods.rs
src/test/run-pass/generic-tag-corruption.rs
src/test/run-pass/generic-tag-local.rs
src/test/run-pass/generic-tag.rs
src/test/run-pass/generic-type-synonym.rs
src/test/run-pass/generic-type.rs
src/test/run-pass/generic-unique.rs
src/test/run-pass/getopts_ref.rs
src/test/run-pass/global-scope.rs
src/test/run-pass/guards-not-exhaustive.rs
src/test/run-pass/guards.rs
src/test/run-pass/hashmap-memory.rs
src/test/run-pass/hrtb-binder-levels-in-object-types.rs
src/test/run-pass/hrtb-debruijn-object-types-in-closures.rs
src/test/run-pass/hrtb-fn-like-trait-object.rs
src/test/run-pass/hrtb-fn-like-trait.rs
src/test/run-pass/hrtb-opt-in-copy.rs
src/test/run-pass/hrtb-parse.rs
src/test/run-pass/hrtb-precedence-of-plus-where-clause.rs
src/test/run-pass/hrtb-precedence-of-plus.rs
src/test/run-pass/hrtb-resolve-lifetime.rs
src/test/run-pass/hrtb-trait-object-paren-notation.rs
src/test/run-pass/hrtb-trait-object-passed-to-closure.rs
src/test/run-pass/huge-largest-array.rs
src/test/run-pass/hygiene-dodging-1.rs
src/test/run-pass/hygienic-labels.rs
src/test/run-pass/i32-sub.rs
src/test/run-pass/i8-incr.rs
src/test/run-pass/if-let.rs
src/test/run-pass/if-ret.rs
src/test/run-pass/ignore-all-the-things.rs
src/test/run-pass/impl-implicit-trait.rs
src/test/run-pass/impl-inherent-non-conflict.rs
src/test/run-pass/impl-inherent-prefer-over-trait.rs
src/test/run-pass/impl-not-adjacent-to-type.rs
src/test/run-pass/impl-privacy-xc-1.rs
src/test/run-pass/import-crate-with-invalid-spans.rs
src/test/run-pass/import-from.rs
src/test/run-pass/import-glob-crate.rs
src/test/run-pass/import-in-block.rs
src/test/run-pass/import-trailing-comma.rs
src/test/run-pass/inconsistent-lifetime-mismatch.rs
src/test/run-pass/infer-container-across-object-cast.rs [deleted file]
src/test/run-pass/infer-fn-tail-expr.rs
src/test/run-pass/inferred-suffix-in-pattern-range.rs
src/test/run-pass/inherent-trait-method-order.rs
src/test/run-pass/init-large-type.rs
src/test/run-pass/init-res-into-things.rs
src/test/run-pass/inner-attrs-on-impl.rs
src/test/run-pass/inner-static.rs
src/test/run-pass/instantiable.rs
src/test/run-pass/int.rs
src/test/run-pass/integer-literal-radix.rs
src/test/run-pass/integer-literal-suffix-inference-2.rs
src/test/run-pass/integer-literal-suffix-inference.rs
src/test/run-pass/into-iterator-type-inference-shift.rs
src/test/run-pass/intrinsic-alignment.rs
src/test/run-pass/intrinsic-assume.rs
src/test/run-pass/intrinsic-atomics-cc.rs
src/test/run-pass/intrinsic-atomics.rs
src/test/run-pass/intrinsic-move-val.rs
src/test/run-pass/intrinsic-return-address.rs
src/test/run-pass/intrinsic-uninit.rs
src/test/run-pass/intrinsic-unreachable.rs
src/test/run-pass/intrinsics-integer.rs
src/test/run-pass/intrinsics-math.rs
src/test/run-pass/invoke-external-foreign.rs
src/test/run-pass/irrefutable-unit.rs
src/test/run-pass/issue-10025.rs
src/test/run-pass/issue-10028.rs
src/test/run-pass/issue-10031.rs
src/test/run-pass/issue-10228.rs
src/test/run-pass/issue-10392.rs
src/test/run-pass/issue-10456.rs
src/test/run-pass/issue-10626.rs
src/test/run-pass/issue-10638.rs
src/test/run-pass/issue-10682.rs
src/test/run-pass/issue-10683.rs
src/test/run-pass/issue-10714.rs
src/test/run-pass/issue-10718.rs
src/test/run-pass/issue-10734.rs
src/test/run-pass/issue-10763.rs
src/test/run-pass/issue-10764.rs
src/test/run-pass/issue-10767.rs
src/test/run-pass/issue-10802.rs
src/test/run-pass/issue-10806.rs
src/test/run-pass/issue-10853.rs
src/test/run-pass/issue-10902.rs
src/test/run-pass/issue-11085.rs
src/test/run-pass/issue-1112.rs
src/test/run-pass/issue-11205.rs
src/test/run-pass/issue-11224.rs
src/test/run-pass/issue-11225-1.rs
src/test/run-pass/issue-11225-2.rs
src/test/run-pass/issue-11384.rs
src/test/run-pass/issue-11529.rs
src/test/run-pass/issue-11552.rs
src/test/run-pass/issue-11577.rs
src/test/run-pass/issue-11612.rs
src/test/run-pass/issue-11677.rs
src/test/run-pass/issue-11709.rs
src/test/run-pass/issue-11736.rs
src/test/run-pass/issue-11820.rs
src/test/run-pass/issue-11869.rs
src/test/run-pass/issue-11881.rs
src/test/run-pass/issue-11940.rs
src/test/run-pass/issue-11958.rs
src/test/run-pass/issue-12133-1.rs
src/test/run-pass/issue-12133-2.rs
src/test/run-pass/issue-12133-3.rs
src/test/run-pass/issue-12285.rs
src/test/run-pass/issue-1251.rs
src/test/run-pass/issue-1257.rs
src/test/run-pass/issue-12612.rs
src/test/run-pass/issue-12660.rs
src/test/run-pass/issue-12677.rs
src/test/run-pass/issue-12684.rs
src/test/run-pass/issue-12699.rs
src/test/run-pass/issue-12729.rs
src/test/run-pass/issue-12860.rs
src/test/run-pass/issue-12909.rs
src/test/run-pass/issue-13105.rs
src/test/run-pass/issue-13167.rs
src/test/run-pass/issue-13204.rs
src/test/run-pass/issue-13214.rs
src/test/run-pass/issue-13259-windows-tcb-trash.rs
src/test/run-pass/issue-13264.rs
src/test/run-pass/issue-13304.rs
src/test/run-pass/issue-13323.rs
src/test/run-pass/issue-13352.rs
src/test/run-pass/issue-13405.rs
src/test/run-pass/issue-13494.rs
src/test/run-pass/issue-13507-2.rs
src/test/run-pass/issue-13620.rs
src/test/run-pass/issue-13655.rs
src/test/run-pass/issue-13665.rs
src/test/run-pass/issue-13703.rs
src/test/run-pass/issue-13763.rs
src/test/run-pass/issue-13775.rs
src/test/run-pass/issue-13808.rs
src/test/run-pass/issue-13837.rs
src/test/run-pass/issue-13867.rs
src/test/run-pass/issue-13872.rs
src/test/run-pass/issue-14021.rs
src/test/run-pass/issue-14082.rs
src/test/run-pass/issue-14254.rs
src/test/run-pass/issue-14308.rs
src/test/run-pass/issue-14330.rs
src/test/run-pass/issue-14393.rs
src/test/run-pass/issue-14399.rs
src/test/run-pass/issue-14421.rs
src/test/run-pass/issue-14422.rs
src/test/run-pass/issue-14456.rs
src/test/run-pass/issue-1451.rs
src/test/run-pass/issue-14589.rs
src/test/run-pass/issue-1460.rs
src/test/run-pass/issue-14837.rs
src/test/run-pass/issue-14865.rs
src/test/run-pass/issue-14901.rs
src/test/run-pass/issue-14919.rs
src/test/run-pass/issue-14933.rs
src/test/run-pass/issue-14936.rs
src/test/run-pass/issue-14940.rs
src/test/run-pass/issue-14958.rs
src/test/run-pass/issue-14959.rs
src/test/run-pass/issue-15043.rs
src/test/run-pass/issue-15080.rs
src/test/run-pass/issue-15104.rs
src/test/run-pass/issue-15108.rs
src/test/run-pass/issue-15129.rs
src/test/run-pass/issue-15149.rs
src/test/run-pass/issue-15221.rs
src/test/run-pass/issue-15261.rs
src/test/run-pass/issue-15444.rs
src/test/run-pass/issue-15562.rs
src/test/run-pass/issue-15673.rs
src/test/run-pass/issue-15689-1.rs
src/test/run-pass/issue-15689-2.rs
src/test/run-pass/issue-15730.rs
src/test/run-pass/issue-15734.rs
src/test/run-pass/issue-15763.rs
src/test/run-pass/issue-15774.rs
src/test/run-pass/issue-15793.rs
src/test/run-pass/issue-15858.rs
src/test/run-pass/issue-15881-model-lexer-dotdotdot.rs
src/test/run-pass/issue-15924.rs
src/test/run-pass/issue-16151.rs
src/test/run-pass/issue-16256.rs
src/test/run-pass/issue-16441.rs
src/test/run-pass/issue-16452.rs
src/test/run-pass/issue-16530.rs
src/test/run-pass/issue-16560.rs
src/test/run-pass/issue-16596.rs
src/test/run-pass/issue-1660.rs
src/test/run-pass/issue-16643.rs
src/test/run-pass/issue-16648.rs
src/test/run-pass/issue-16739.rs
src/test/run-pass/issue-16774.rs
src/test/run-pass/issue-16783.rs
src/test/run-pass/issue-16922.rs
src/test/run-pass/issue-1696.rs
src/test/run-pass/issue-1701.rs
src/test/run-pass/issue-17068.rs
src/test/run-pass/issue-17074.rs
src/test/run-pass/issue-17121.rs
src/test/run-pass/issue-17216.rs
src/test/run-pass/issue-17233.rs
src/test/run-pass/issue-17302.rs
src/test/run-pass/issue-17322.rs
src/test/run-pass/issue-17351.rs
src/test/run-pass/issue-17361.rs
src/test/run-pass/issue-17662.rs
src/test/run-pass/issue-17718-parse-const.rs
src/test/run-pass/issue-17718-static-unsafe-interior.rs
src/test/run-pass/issue-17718.rs
src/test/run-pass/issue-17732.rs
src/test/run-pass/issue-17734.rs
src/test/run-pass/issue-17771.rs
src/test/run-pass/issue-17816.rs
src/test/run-pass/issue-17877.rs
src/test/run-pass/issue-17897.rs
src/test/run-pass/issue-17904.rs
src/test/run-pass/issue-18110.rs
src/test/run-pass/issue-18188.rs
src/test/run-pass/issue-1821.rs
src/test/run-pass/issue-18232.rs
src/test/run-pass/issue-18352.rs
src/test/run-pass/issue-18353.rs
src/test/run-pass/issue-18412.rs
src/test/run-pass/issue-18425.rs
src/test/run-pass/issue-18501.rs
src/test/run-pass/issue-18514.rs
src/test/run-pass/issue-18539.rs
src/test/run-pass/issue-18619.rs
src/test/run-pass/issue-18652.rs
src/test/run-pass/issue-1866.rs
src/test/run-pass/issue-18661.rs
src/test/run-pass/issue-18685.rs
src/test/run-pass/issue-18711.rs
src/test/run-pass/issue-18738.rs
src/test/run-pass/issue-18767.rs
src/test/run-pass/issue-18859.rs
src/test/run-pass/issue-18906.rs
src/test/run-pass/issue-19037.rs
src/test/run-pass/issue-19098.rs
src/test/run-pass/issue-19121.rs
src/test/run-pass/issue-19127.rs
src/test/run-pass/issue-19129-1.rs
src/test/run-pass/issue-19129-2.rs
src/test/run-pass/issue-19244.rs
src/test/run-pass/issue-19293.rs
src/test/run-pass/issue-19340-1.rs
src/test/run-pass/issue-19340-2.rs
src/test/run-pass/issue-19398.rs
src/test/run-pass/issue-19479.rs
src/test/run-pass/issue-19499.rs
src/test/run-pass/issue-19631.rs
src/test/run-pass/issue-19632.rs
src/test/run-pass/issue-1974.rs
src/test/run-pass/issue-19811-escape-unicode.rs
src/test/run-pass/issue-19850.rs
src/test/run-pass/issue-19982.rs
src/test/run-pass/issue-20009.rs
src/test/run-pass/issue-20091.rs
src/test/run-pass/issue-20313.rs
src/test/run-pass/issue-20343.rs
src/test/run-pass/issue-20389.rs
src/test/run-pass/issue-20396.rs
src/test/run-pass/issue-20414.rs
src/test/run-pass/issue-20454.rs
src/test/run-pass/issue-20575.rs
src/test/run-pass/issue-20644.rs
src/test/run-pass/issue-20676.rs
src/test/run-pass/issue-2074.rs
src/test/run-pass/issue-20763-1.rs
src/test/run-pass/issue-20763-2.rs
src/test/run-pass/issue-20797.rs
src/test/run-pass/issue-21033.rs
src/test/run-pass/issue-21058.rs
src/test/run-pass/issue-21245.rs
src/test/run-pass/issue-21296.rs
src/test/run-pass/issue-21306.rs
src/test/run-pass/issue-21350.rs
src/test/run-pass/issue-21361.rs
src/test/run-pass/issue-21363.rs
src/test/run-pass/issue-21384.rs
src/test/run-pass/issue-21402.rs
src/test/run-pass/issue-21475.rs
src/test/run-pass/issue-21520.rs
src/test/run-pass/issue-21634.rs
src/test/run-pass/issue-21655.rs
src/test/run-pass/issue-21721.rs
src/test/run-pass/issue-21726.rs
src/test/run-pass/issue-21891.rs
src/test/run-pass/issue-2190-1.rs
src/test/run-pass/issue-21909.rs
src/test/run-pass/issue-22036.rs
src/test/run-pass/issue-2214.rs
src/test/run-pass/issue-22356.rs
src/test/run-pass/issue-22426.rs
src/test/run-pass/issue-22536-copy-mustnt-zero.rs
src/test/run-pass/issue-22577.rs
src/test/run-pass/issue-22629.rs
src/test/run-pass/issue-22777.rs
src/test/run-pass/issue-22828.rs
src/test/run-pass/issue-2284.rs
src/test/run-pass/issue-2288.rs
src/test/run-pass/issue-2311-2.rs
src/test/run-pass/issue-2311.rs
src/test/run-pass/issue-2312.rs
src/test/run-pass/issue-2316-c.rs
src/test/run-pass/issue-23435.rs
src/test/run-pass/issue-2380-b.rs
src/test/run-pass/issue-2383.rs
src/test/run-pass/issue-2414-c.rs
src/test/run-pass/issue-2428.rs
src/test/run-pass/issue-2445-b.rs
src/test/run-pass/issue-2445.rs
src/test/run-pass/issue-2463.rs
src/test/run-pass/issue-2472.rs
src/test/run-pass/issue-2487-a.rs
src/test/run-pass/issue-2502.rs
src/test/run-pass/issue-2526-a.rs
src/test/run-pass/issue-2550.rs
src/test/run-pass/issue-2611-3.rs
src/test/run-pass/issue-2631-b.rs
src/test/run-pass/issue-2633-2.rs
src/test/run-pass/issue-2642.rs
src/test/run-pass/issue-2708.rs
src/test/run-pass/issue-2718.rs
src/test/run-pass/issue-2723-b.rs
src/test/run-pass/issue-2734.rs
src/test/run-pass/issue-2735-2.rs
src/test/run-pass/issue-2735-3.rs
src/test/run-pass/issue-2735.rs
src/test/run-pass/issue-2748-a.rs
src/test/run-pass/issue-2748-b.rs
src/test/run-pass/issue-2804-2.rs
src/test/run-pass/issue-2804.rs
src/test/run-pass/issue-2895.rs
src/test/run-pass/issue-2904.rs
src/test/run-pass/issue-2936.rs
src/test/run-pass/issue-3012-2.rs
src/test/run-pass/issue-3026.rs
src/test/run-pass/issue-3037.rs
src/test/run-pass/issue-3052.rs
src/test/run-pass/issue-3091.rs
src/test/run-pass/issue-3121.rs
src/test/run-pass/issue-3149.rs
src/test/run-pass/issue-3220.rs
src/test/run-pass/issue-3290.rs
src/test/run-pass/issue-333.rs
src/test/run-pass/issue-3424.rs
src/test/run-pass/issue-3429.rs
src/test/run-pass/issue-3500.rs
src/test/run-pass/issue-3559.rs
src/test/run-pass/issue-3563-2.rs
src/test/run-pass/issue-3563-3.rs
src/test/run-pass/issue-3574.rs
src/test/run-pass/issue-3609.rs
src/test/run-pass/issue-3656.rs
src/test/run-pass/issue-3753.rs
src/test/run-pass/issue-3874.rs
src/test/run-pass/issue-3878.rs
src/test/run-pass/issue-3888-2.rs
src/test/run-pass/issue-3895.rs
src/test/run-pass/issue-3935.rs
src/test/run-pass/issue-3979-2.rs
src/test/run-pass/issue-3979-generics.rs
src/test/run-pass/issue-3979-xcrate.rs
src/test/run-pass/issue-3979.rs
src/test/run-pass/issue-3991.rs
src/test/run-pass/issue-4016.rs
src/test/run-pass/issue-4036.rs
src/test/run-pass/issue-4107.rs
src/test/run-pass/issue-4208.rs
src/test/run-pass/issue-4228.rs
src/test/run-pass/issue-4333.rs
src/test/run-pass/issue-4387.rs
src/test/run-pass/issue-4446.rs
src/test/run-pass/issue-4448.rs
src/test/run-pass/issue-4464.rs
src/test/run-pass/issue-4542.rs
src/test/run-pass/issue-4545.rs
src/test/run-pass/issue-4734.rs
src/test/run-pass/issue-4735.rs
src/test/run-pass/issue-4759-1.rs
src/test/run-pass/issue-4759.rs
src/test/run-pass/issue-4830.rs
src/test/run-pass/issue-4875.rs
src/test/run-pass/issue-5192.rs
src/test/run-pass/issue-5239-2.rs
src/test/run-pass/issue-5243.rs
src/test/run-pass/issue-5315.rs
src/test/run-pass/issue-5353.rs
src/test/run-pass/issue-5518.rs
src/test/run-pass/issue-5521.rs
src/test/run-pass/issue-5530.rs
src/test/run-pass/issue-5550.rs
src/test/run-pass/issue-5554.rs
src/test/run-pass/issue-5572.rs
src/test/run-pass/issue-5708.rs
src/test/run-pass/issue-5718.rs
src/test/run-pass/issue-5741.rs
src/test/run-pass/issue-5754.rs
src/test/run-pass/issue-5791.rs
src/test/run-pass/issue-5884.rs
src/test/run-pass/issue-5900.rs
src/test/run-pass/issue-5917.rs
src/test/run-pass/issue-5950.rs
src/test/run-pass/issue-5988.rs
src/test/run-pass/issue-5997.rs
src/test/run-pass/issue-6117.rs
src/test/run-pass/issue-6128.rs
src/test/run-pass/issue-6130.rs
src/test/run-pass/issue-6153.rs
src/test/run-pass/issue-6157.rs
src/test/run-pass/issue-6318.rs
src/test/run-pass/issue-6334.rs
src/test/run-pass/issue-6341.rs
src/test/run-pass/issue-6449.rs
src/test/run-pass/issue-6470.rs
src/test/run-pass/issue-6557.rs
src/test/run-pass/issue-6892.rs
src/test/run-pass/issue-6898.rs
src/test/run-pass/issue-6919.rs
src/test/run-pass/issue-7178.rs
src/test/run-pass/issue-7222.rs
src/test/run-pass/issue-7268.rs
src/test/run-pass/issue-7344.rs
src/test/run-pass/issue-7519-match-unit-in-arg.rs
src/test/run-pass/issue-7575.rs
src/test/run-pass/issue-7607-2.rs
src/test/run-pass/issue-7660.rs
src/test/run-pass/issue-7663.rs
src/test/run-pass/issue-7673-cast-generically-implemented-trait.rs
src/test/run-pass/issue-7784.rs
src/test/run-pass/issue-7899.rs
src/test/run-pass/issue-8044.rs
src/test/run-pass/issue-8171-default-method-self-inherit-builtin-trait.rs
src/test/run-pass/issue-8248.rs
src/test/run-pass/issue-8249.rs
src/test/run-pass/issue-8259.rs
src/test/run-pass/issue-8351-1.rs
src/test/run-pass/issue-8351-2.rs
src/test/run-pass/issue-8391.rs
src/test/run-pass/issue-8398.rs
src/test/run-pass/issue-8401.rs
src/test/run-pass/issue-8460.rs
src/test/run-pass/issue-8498.rs
src/test/run-pass/issue-8506.rs
src/test/run-pass/issue-8578.rs
src/test/run-pass/issue-868.rs
src/test/run-pass/issue-8709.rs
src/test/run-pass/issue-8783.rs
src/test/run-pass/issue-8827.rs
src/test/run-pass/issue-8851.rs
src/test/run-pass/issue-8860.rs
src/test/run-pass/issue-8898.rs
src/test/run-pass/issue-9110.rs
src/test/run-pass/issue-9123.rs
src/test/run-pass/issue-9188.rs
src/test/run-pass/issue-9249.rs
src/test/run-pass/issue-9259.rs
src/test/run-pass/issue-9382.rs
src/test/run-pass/issue-9394-inherited-trait-calls.rs
src/test/run-pass/issue-9396.rs
src/test/run-pass/issue-9719.rs
src/test/run-pass/issue-979.rs
src/test/run-pass/issue-9906.rs
src/test/run-pass/issue-9918.rs
src/test/run-pass/issue-9942.rs
src/test/run-pass/issue-9951.rs
src/test/run-pass/issue-9968.rs
src/test/run-pass/issue2170exe.rs
src/test/run-pass/issue22346.rs
src/test/run-pass/issue_3136_b.rs
src/test/run-pass/issue_9155.rs
src/test/run-pass/istr.rs
src/test/run-pass/item-attributes.rs
src/test/run-pass/item-name-overload.rs
src/test/run-pass/iter-cloned-type-inference.rs
src/test/run-pass/ivec-pass-by-value.rs
src/test/run-pass/ivec-tag.rs
src/test/run-pass/keyword-changes-2012-07-31.rs
src/test/run-pass/kindck-implicit-close-over-mut-var.rs
src/test/run-pass/kindck-owned-trait-contains-1.rs
src/test/run-pass/kinds-in-metadata.rs
src/test/run-pass/labeled-break.rs
src/test/run-pass/large-records.rs
src/test/run-pass/last-use-in-block.rs
src/test/run-pass/last-use-in-cap-clause.rs
src/test/run-pass/leak-unique-as-tydesc.rs
src/test/run-pass/let-destruct-ref.rs
src/test/run-pass/let-var-hygiene.rs
src/test/run-pass/linkage-visibility.rs
src/test/run-pass/lint-non-camel-case-with-trailing-underscores.rs
src/test/run-pass/lint-non-uppercase-statics-lowercase-mut-statics.rs
src/test/run-pass/list.rs
src/test/run-pass/liveness-assign-imm-local-after-loop.rs
src/test/run-pass/liveness-assign-imm-local-after-ret.rs
src/test/run-pass/liveness-move-in-loop.rs
src/test/run-pass/log_syntax-trace_macros-macro-locations.rs
src/test/run-pass/logging-enabled-debug.rs
src/test/run-pass/logging-enabled.rs
src/test/run-pass/logging-right-crate.rs
src/test/run-pass/logging-separate-lines.rs
src/test/run-pass/logging_before_rt_started.rs
src/test/run-pass/long-while.rs
src/test/run-pass/loop-break-cont-1.rs
src/test/run-pass/loop-diverges.rs
src/test/run-pass/loop-label-shadowing.rs
src/test/run-pass/loop-labeled-break-value.rs
src/test/run-pass/loop-no-reinit-needed-post-bot.rs
src/test/run-pass/loop-scope.rs
src/test/run-pass/macro-block-nonterminal.rs
src/test/run-pass/macro-crate-def-only.rs
src/test/run-pass/macro-crate-use.rs
src/test/run-pass/macro-deep_expansion.rs
src/test/run-pass/macro-delimiter-significance.rs
src/test/run-pass/macro-interpolation.rs
src/test/run-pass/macro-invocation-in-count-expr-fixed-array-type.rs
src/test/run-pass/macro-method-issue-4621.rs
src/test/run-pass/macro-nt-list.rs
src/test/run-pass/macro-of-higher-order.rs
src/test/run-pass/macro-pat.rs
src/test/run-pass/macro-path.rs
src/test/run-pass/macro-with-attrs1.rs
src/test/run-pass/macro-with-attrs2.rs
src/test/run-pass/macro-with-braces-in-expr-position.rs
src/test/run-pass/macro_with_super_2.rs
src/test/run-pass/match-arm-statics.rs
src/test/run-pass/match-borrowed_str.rs
src/test/run-pass/match-bot-2.rs
src/test/run-pass/match-enum-struct-0.rs
src/test/run-pass/match-enum-struct-1.rs
src/test/run-pass/match-implicit-copy-unique.rs
src/test/run-pass/match-in-macro.rs
src/test/run-pass/match-naked-record-expr.rs
src/test/run-pass/match-naked-record.rs
src/test/run-pass/match-path.rs
src/test/run-pass/match-pattern-bindings.rs
src/test/run-pass/match-pattern-simple.rs
src/test/run-pass/match-phi.rs
src/test/run-pass/match-pipe-binding.rs
src/test/run-pass/match-range-static.rs
src/test/run-pass/match-ref-binding-in-guard-3256.rs
src/test/run-pass/match-ref-binding-mut-option.rs
src/test/run-pass/match-ref-binding-mut.rs
src/test/run-pass/match-ref-binding.rs
src/test/run-pass/match-static-const-rename.rs
src/test/run-pass/match-str.rs
src/test/run-pass/match-struct-0.rs
src/test/run-pass/match-tag.rs
src/test/run-pass/match-value-binding-in-guard-3291.rs
src/test/run-pass/match-vec-alternatives.rs
src/test/run-pass/match-vec-rvalue.rs
src/test/run-pass/method-attributes.rs
src/test/run-pass/method-early-bound-lifetimes-on-self.rs
src/test/run-pass/method-mut-self-modifies-mut-slice-lvalue.rs
src/test/run-pass/method-normalize-bounds-issue-20604.rs
src/test/run-pass/method-projection.rs
src/test/run-pass/method-recursive-blanket-impl.rs
src/test/run-pass/method-self-arg-aux1.rs
src/test/run-pass/method-self-arg-aux2.rs
src/test/run-pass/method-self-arg-trait.rs
src/test/run-pass/method-self-arg.rs
src/test/run-pass/method-two-trait-defer-resolution-1.rs
src/test/run-pass/method-two-trait-defer-resolution-2.rs
src/test/run-pass/method-two-traits-distinguished-via-where-clause.rs
src/test/run-pass/method-where-clause.rs
src/test/run-pass/mid-path-type-params.rs
src/test/run-pass/mod-inside-fn.rs
src/test/run-pass/mod-view-items.rs
src/test/run-pass/module-qualified-struct-destructure.rs
src/test/run-pass/monad.rs
src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs
src/test/run-pass/move-1-unique.rs
src/test/run-pass/move-2-unique.rs
src/test/run-pass/move-2.rs
src/test/run-pass/move-3-unique.rs
src/test/run-pass/move-4-unique.rs
src/test/run-pass/move-4.rs
src/test/run-pass/move-arg-2-unique.rs
src/test/run-pass/move-arg-2.rs
src/test/run-pass/move-arg.rs
src/test/run-pass/move-guard-const.rs
src/test/run-pass/move-nullary-fn.rs
src/test/run-pass/move-out-of-field.rs
src/test/run-pass/move-scalar.rs
src/test/run-pass/moves-based-on-type-capture-clause.rs
src/test/run-pass/moves-based-on-type-cross-crate.rs
src/test/run-pass/multi-let.rs
src/test/run-pass/multidispatch1.rs
src/test/run-pass/multidispatch2.rs
src/test/run-pass/multiline-comment.rs
src/test/run-pass/multiple-trait-bounds.rs
src/test/run-pass/mut-function-arguments.rs
src/test/run-pass/mut-in-ident-patterns.rs
src/test/run-pass/mut-vstore-expr.rs
src/test/run-pass/mutability-inherits-through-fixed-length-vec.rs
src/test/run-pass/mutual-recursion-group.rs
src/test/run-pass/namespaced-enum-emulate-flat-xc.rs
src/test/run-pass/namespaced-enum-emulate-flat.rs
src/test/run-pass/namespaced-enum-glob-import-xcrate.rs
src/test/run-pass/namespaced-enum-glob-import.rs
src/test/run-pass/namespaced-enums-xcrate.rs
src/test/run-pass/namespaced-enums.rs
src/test/run-pass/negative.rs
src/test/run-pass/nested-block-comment.rs
src/test/run-pass/nested-class.rs
src/test/run-pass/nested-enum-same-names.rs
src/test/run-pass/nested-exhaustive-match.rs
src/test/run-pass/nested-function-names-issue-8587.rs
src/test/run-pass/nested_item_main.rs
src/test/run-pass/new-box-syntax.rs
src/test/run-pass/new-unicode-escapes.rs
src/test/run-pass/new-unsafe-pointers.rs
src/test/run-pass/newlambdas-ret-infer.rs
src/test/run-pass/newlambdas-ret-infer2.rs
src/test/run-pass/newlambdas.rs
src/test/run-pass/newtype-polymorphic.rs
src/test/run-pass/newtype-struct-drop-run.rs
src/test/run-pass/newtype-struct-with-dtor.rs
src/test/run-pass/newtype-struct-xc-2.rs
src/test/run-pass/newtype-struct-xc.rs
src/test/run-pass/nil-decl-in-foreign.rs
src/test/run-pass/nil-pattern.rs
src/test/run-pass/no-landing-pads.rs
src/test/run-pass/non-built-in-quote.rs
src/test/run-pass/non-legacy-modes.rs
src/test/run-pass/nondrop-cycle.rs
src/test/run-pass/nul-characters.rs
src/test/run-pass/nullable-pointer-ffi-compat.rs
src/test/run-pass/nullable-pointer-iotareduction.rs
src/test/run-pass/nullable-pointer-size.rs
src/test/run-pass/nullary-or-pattern.rs
src/test/run-pass/numeric-method-autoexport.rs
src/test/run-pass/object-lifetime-default-default-to-static.rs
src/test/run-pass/object-lifetime-default-from-ref-struct.rs
src/test/run-pass/object-lifetime-default-from-rptr-box.rs
src/test/run-pass/object-lifetime-default-from-rptr-mut.rs
src/test/run-pass/object-lifetime-default-from-rptr-struct.rs
src/test/run-pass/object-lifetime-default-from-rptr.rs
src/test/run-pass/object-method-numbering.rs
src/test/run-pass/object-one-type-two-traits.rs
src/test/run-pass/object-safety-sized-self-by-value-self.rs
src/test/run-pass/object-safety-sized-self-generic-method.rs
src/test/run-pass/object-safety-sized-self-return-Self.rs
src/test/run-pass/objects-coerce-freeze-borrored.rs
src/test/run-pass/objects-owned-object-borrowed-method-headerless.rs
src/test/run-pass/objects-owned-object-owned-method.rs
src/test/run-pass/once-move-out-on-heap.rs
src/test/run-pass/one-tuple.rs
src/test/run-pass/operator-associativity.rs
src/test/run-pass/operator-overloading.rs
src/test/run-pass/option-ext.rs
src/test/run-pass/option-unwrap.rs
src/test/run-pass/or-pattern.rs
src/test/run-pass/order-drop-with-match.rs
src/test/run-pass/osx-frameworks.rs
src/test/run-pass/out-of-stack-new-thread-no-split.rs
src/test/run-pass/out-of-stack-no-split.rs
src/test/run-pass/out-of-stack.rs
src/test/run-pass/out-pointer-aliasing.rs
src/test/run-pass/output-slot-variants.rs
src/test/run-pass/overloaded-autoderef-indexing.rs
src/test/run-pass/overloaded-autoderef-order.rs
src/test/run-pass/overloaded-autoderef-vtable.rs
src/test/run-pass/overloaded-autoderef-xcrate.rs
src/test/run-pass/overloaded-autoderef.rs
src/test/run-pass/overloaded-calls-object-one-arg.rs
src/test/run-pass/overloaded-calls-object-two-args.rs
src/test/run-pass/overloaded-calls-object-zero-args.rs
src/test/run-pass/overloaded-calls-param-vtables.rs
src/test/run-pass/overloaded-calls-simple.rs
src/test/run-pass/overloaded-calls-zero-args.rs
src/test/run-pass/overloaded-deref-count.rs
src/test/run-pass/overloaded-deref.rs
src/test/run-pass/overloaded-index-assoc-list.rs
src/test/run-pass/overloaded-index-autoderef.rs
src/test/run-pass/overloaded-index-in-field.rs
src/test/run-pass/overloaded-index.rs
src/test/run-pass/owned-implies-static.rs
src/test/run-pass/packed-struct-borrow-element.rs
src/test/run-pass/packed-struct-generic-layout.rs
src/test/run-pass/packed-struct-generic-size.rs
src/test/run-pass/packed-struct-layout.rs
src/test/run-pass/packed-struct-match.rs
src/test/run-pass/packed-struct-size-xc.rs
src/test/run-pass/packed-struct-size.rs
src/test/run-pass/packed-tuple-struct-layout.rs
src/test/run-pass/packed-tuple-struct-size.rs
src/test/run-pass/panic-in-dtor-drops-fields.rs
src/test/run-pass/parameterized-trait-with-bounds.rs
src/test/run-pass/parse-assoc-type-lt.rs
src/test/run-pass/parse-complex-macro-invoc-op.rs
src/test/run-pass/path.rs
src/test/run-pass/pattern-bound-var-in-for-each.rs
src/test/run-pass/placement-new-arena.rs
src/test/run-pass/pred-not-bool.rs
src/test/run-pass/priv-impl-prim-ty.rs
src/test/run-pass/privacy-ns.rs
src/test/run-pass/privacy-reexport.rs
src/test/run-pass/privacy1.rs
src/test/run-pass/private-class-field.rs
src/test/run-pass/private-method.rs
src/test/run-pass/process-remove-from-env.rs
src/test/run-pass/process-spawn-with-unicode-params.rs
src/test/run-pass/ptr-coercion.rs
src/test/run-pass/pub-extern-privacy.rs
src/test/run-pass/pub-item-inside-macro.rs
src/test/run-pass/pub-method-inside-macro.rs
src/test/run-pass/pub-use-xcrate.rs
src/test/run-pass/pub_use_mods_xcrate_exe.rs
src/test/run-pass/pure-sum.rs
src/test/run-pass/range-type-infer.rs
src/test/run-pass/range.rs
src/test/run-pass/ranges-precedence.rs
src/test/run-pass/readalias.rs
src/test/run-pass/realloc-16687.rs
src/test/run-pass/rec-extend.rs
src/test/run-pass/rec-tup.rs
src/test/run-pass/rec.rs
src/test/run-pass/record-pat.rs
src/test/run-pass/reexport-should-still-link.rs
src/test/run-pass/reexport-star.rs
src/test/run-pass/reexported-static-methods-cross-crate.rs
src/test/run-pass/regions-addr-of-interior-of-unique-box.rs
src/test/run-pass/regions-assoc-type-region-bound.rs
src/test/run-pass/regions-assoc-type-static-bound.rs
src/test/run-pass/regions-borrow-evec-fixed.rs
src/test/run-pass/regions-borrow-evec-uniq.rs
src/test/run-pass/regions-borrow-uniq.rs
src/test/run-pass/regions-bot.rs
src/test/run-pass/regions-close-over-type-parameter-successfully.rs
src/test/run-pass/regions-copy-closure.rs
src/test/run-pass/regions-creating-enums2.rs
src/test/run-pass/regions-creating-enums5.rs
src/test/run-pass/regions-debruijn-of-object.rs
src/test/run-pass/regions-dependent-addr-of.rs
src/test/run-pass/regions-dependent-autofn.rs
src/test/run-pass/regions-dependent-autoslice.rs
src/test/run-pass/regions-dependent-let-ref.rs
src/test/run-pass/regions-early-bound-lifetime-in-assoc-fn.rs
src/test/run-pass/regions-early-bound-trait-param.rs
src/test/run-pass/regions-early-bound-used-in-bound-method.rs
src/test/run-pass/regions-early-bound-used-in-bound.rs
src/test/run-pass/regions-early-bound-used-in-type-param.rs
src/test/run-pass/regions-escape-into-other-fn.rs
src/test/run-pass/regions-expl-self.rs
src/test/run-pass/regions-fn-subtyping-2.rs
src/test/run-pass/regions-fn-subtyping.rs
src/test/run-pass/regions-infer-borrow-scope-addr-of.rs
src/test/run-pass/regions-infer-borrow-scope-view.rs
src/test/run-pass/regions-infer-borrow-scope-within-loop-ok.rs
src/test/run-pass/regions-infer-borrow-scope.rs
src/test/run-pass/regions-infer-call-2.rs
src/test/run-pass/regions-infer-call.rs
src/test/run-pass/regions-infer-contravariance-due-to-ret.rs
src/test/run-pass/regions-infer-reborrow-ref-mut-recurse.rs
src/test/run-pass/regions-infer-region-in-fn-but-not-type.rs
src/test/run-pass/regions-infer-static-from-proc.rs
src/test/run-pass/regions-issue-21422.rs
src/test/run-pass/regions-issue-22246.rs
src/test/run-pass/regions-lifetime-nonfree-late-bound.rs
src/test/run-pass/regions-lifetime-static-items-enclosing-scopes.rs
src/test/run-pass/regions-link-fn-args.rs
src/test/run-pass/regions-mock-tcx.rs
src/test/run-pass/regions-mock-trans.rs
src/test/run-pass/regions-no-bound-in-argument-cleanup.rs
src/test/run-pass/regions-no-variance-from-fn-generics.rs
src/test/run-pass/regions-nullary-variant.rs
src/test/run-pass/regions-params.rs
src/test/run-pass/regions-reassign-let-bound-pointer.rs
src/test/run-pass/regions-reassign-match-bound-pointer.rs
src/test/run-pass/regions-refcell.rs
src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs
src/test/run-pass/regions-return-interior-of-option.rs
src/test/run-pass/regions-scope-chain-example.rs
src/test/run-pass/regions-static-closure.rs
src/test/run-pass/regions-trait-object-1.rs
src/test/run-pass/regions-variance-contravariant-use-contravariant.rs
src/test/run-pass/regions-variance-covariant-use-covariant.rs
src/test/run-pass/rename-directory.rs
src/test/run-pass/repeat-expr-in-static.rs
src/test/run-pass/resolve-issue-2428.rs
src/test/run-pass/resource-in-struct.rs
src/test/run-pass/ret-none.rs
src/test/run-pass/return-from-closure.rs
src/test/run-pass/return-nil.rs
src/test/run-pass/running-with-no-runtime.rs
src/test/run-pass/rust-log-filter.rs
src/test/run-pass/segfault-no-out-of-stack.rs
src/test/run-pass/self-impl.rs
src/test/run-pass/self-in-mut-slot-default-method.rs
src/test/run-pass/self-in-mut-slot-immediate-value.rs
src/test/run-pass/self-re-assign.rs
src/test/run-pass/self-shadowing-import.rs
src/test/run-pass/self-type-param.rs
src/test/run-pass/send-is-not-static-par-for.rs
src/test/run-pass/send-resource.rs
src/test/run-pass/send-type-inference.rs
src/test/run-pass/send_str_hashmap.rs
src/test/run-pass/send_str_treemap.rs
src/test/run-pass/sendable-class.rs
src/test/run-pass/sendfn-is-a-block.rs
src/test/run-pass/sepcomp-cci.rs
src/test/run-pass/sepcomp-extern.rs
src/test/run-pass/sepcomp-fns-backwards.rs
src/test/run-pass/sepcomp-fns.rs
src/test/run-pass/sepcomp-lib.rs
src/test/run-pass/sepcomp-statics.rs
src/test/run-pass/sepcomp-unwind.rs
src/test/run-pass/seq-compare.rs
src/test/run-pass/shift-various-types.rs
src/test/run-pass/shift.rs
src/test/run-pass/signal-exit-status.rs
src/test/run-pass/signed-shift-const-eval.rs
src/test/run-pass/sigpipe-should-be-ignored.rs
src/test/run-pass/simd-binop.rs
src/test/run-pass/simd-generics.rs
src/test/run-pass/simd-issue-10604.rs
src/test/run-pass/simd-size-align.rs
src/test/run-pass/simd-type.rs
src/test/run-pass/simple-generic-match.rs
src/test/run-pass/simple-generic-tag.rs
src/test/run-pass/single-derive-attr-with-gate.rs
src/test/run-pass/sized-borrowed-pointer.rs
src/test/run-pass/sized-owned-pointer.rs
src/test/run-pass/slice-2.rs
src/test/run-pass/slice-panic-1.rs
src/test/run-pass/slice-panic-2.rs
src/test/run-pass/slice.rs
src/test/run-pass/small-enum-range-edge.rs
src/test/run-pass/smallest-hello-world.rs
src/test/run-pass/snake-case-no-lowercase-equivalent.rs
src/test/run-pass/spawn-fn.rs
src/test/run-pass/spawn-types.rs
src/test/run-pass/stable-addr-of.rs
src/test/run-pass/stat.rs
src/test/run-pass/static-assert.rs
src/test/run-pass/static-fn-inline-xc.rs
src/test/run-pass/static-fn-trait-xc.rs
src/test/run-pass/static-function-pointer-xc.rs
src/test/run-pass/static-function-pointer.rs
src/test/run-pass/static-impl.rs
src/test/run-pass/static-method-in-trait-with-tps-intracrate.rs
src/test/run-pass/static-method-xcrate.rs
src/test/run-pass/static-methods-in-traits.rs
src/test/run-pass/static-methods-in-traits2.rs
src/test/run-pass/static-mut-foreign.rs
src/test/run-pass/static-mut-xc.rs
src/test/run-pass/std-sync-right-kind-impls.rs
src/test/run-pass/str-multiline.rs
src/test/run-pass/string-escapes.rs
src/test/run-pass/struct-aliases-xcrate.rs
src/test/run-pass/struct-aliases.rs
src/test/run-pass/struct-destructuring-cross-crate.rs
src/test/run-pass/struct-like-variant-construct.rs
src/test/run-pass/struct-like-variant-match.rs
src/test/run-pass/struct-new-as-field-name.rs
src/test/run-pass/struct-order-of-eval-1.rs
src/test/run-pass/struct-order-of-eval-2.rs
src/test/run-pass/struct-order-of-eval-3.rs
src/test/run-pass/struct-order-of-eval-4.rs
src/test/run-pass/struct-variant-field-visibility.rs
src/test/run-pass/struct_variant_xc.rs
src/test/run-pass/struct_variant_xc_match.rs
src/test/run-pass/super.rs
src/test/run-pass/supertrait-default-generics.rs
src/test/run-pass/supported-cast.rs
src/test/run-pass/svh-add-comment.rs
src/test/run-pass/svh-add-doc.rs
src/test/run-pass/svh-add-macro.rs
src/test/run-pass/svh-add-nothing.rs
src/test/run-pass/svh-add-redundant-cfg.rs
src/test/run-pass/svh-add-whitespace.rs
src/test/run-pass/swap-1.rs
src/test/run-pass/swap-2.rs
src/test/run-pass/swap-overlapping.rs
src/test/run-pass/sync-send-iterators-in-libcollections.rs
src/test/run-pass/syntax-extension-cfg.rs
src/test/run-pass/syntax-extension-source-utils.rs
src/test/run-pass/syntax-trait-polarity.rs
src/test/run-pass/tag-align-dyn-u64.rs
src/test/run-pass/tag-align-dyn-variants.rs
src/test/run-pass/tag-align-u64.rs
src/test/run-pass/tag-exports.rs
src/test/run-pass/tag-in-block.rs
src/test/run-pass/tag-variant-disr-type-mismatch.rs
src/test/run-pass/tag-variant-disr-val.rs
src/test/run-pass/tag.rs
src/test/run-pass/tail-call-arg-leak.rs
src/test/run-pass/tail-direct.rs
src/test/run-pass/task-comm-0.rs
src/test/run-pass/task-comm-1.rs
src/test/run-pass/task-comm-10.rs
src/test/run-pass/task-comm-11.rs
src/test/run-pass/task-comm-12.rs
src/test/run-pass/task-comm-13.rs
src/test/run-pass/task-comm-14.rs
src/test/run-pass/task-comm-15.rs
src/test/run-pass/task-comm-17.rs
src/test/run-pass/task-comm-3.rs
src/test/run-pass/task-comm-5.rs
src/test/run-pass/task-comm-6.rs
src/test/run-pass/task-comm-7.rs
src/test/run-pass/task-comm-9.rs
src/test/run-pass/task-comm-chan-nil.rs
src/test/run-pass/task-life-0.rs
src/test/run-pass/task-spawn-move-and-copy.rs
src/test/run-pass/task-stderr.rs
src/test/run-pass/tcp-accept-stress.rs
src/test/run-pass/tcp-connect-timeouts.rs
src/test/run-pass/tcp-stress.rs
src/test/run-pass/tempfile.rs
src/test/run-pass/terminate-in-initializer.rs
src/test/run-pass/test-fn-signature-verification-for-explicit-return-type.rs
src/test/run-pass/threads.rs
src/test/run-pass/trailing-comma.rs
src/test/run-pass/trait-bounds-basic.rs
src/test/run-pass/trait-bounds-impl-comparison-duplicates.rs
src/test/run-pass/trait-bounds-in-arc.rs
src/test/run-pass/trait-bounds-on-structs-and-enums.rs
src/test/run-pass/trait-bounds-recursion.rs
src/test/run-pass/trait-bounds.rs
src/test/run-pass/trait-cache-issue-18209.rs
src/test/run-pass/trait-coercion.rs
src/test/run-pass/trait-composition-trivial.rs
src/test/run-pass/trait-default-method-bound-subst.rs
src/test/run-pass/trait-default-method-bound-subst2.rs
src/test/run-pass/trait-default-method-bound-subst3.rs
src/test/run-pass/trait-default-method-bound-subst4.rs
src/test/run-pass/trait-default-method-bound.rs
src/test/run-pass/trait-default-method-xc-2.rs
src/test/run-pass/trait-default-method-xc.rs
src/test/run-pass/trait-false-ambiguity-where-clause-builtin-bound.rs
src/test/run-pass/trait-generic.rs
src/test/run-pass/trait-impl-2.rs
src/test/run-pass/trait-impl.rs
src/test/run-pass/trait-inheritance-auto-xc-2.rs
src/test/run-pass/trait-inheritance-auto-xc.rs
src/test/run-pass/trait-inheritance-auto.rs
src/test/run-pass/trait-inheritance-call-bound-inherited.rs
src/test/run-pass/trait-inheritance-call-bound-inherited2.rs
src/test/run-pass/trait-inheritance-cast-without-call-to-supertrait.rs
src/test/run-pass/trait-inheritance-cast.rs
src/test/run-pass/trait-inheritance-cross-trait-call-xc.rs
src/test/run-pass/trait-inheritance-cross-trait-call.rs
src/test/run-pass/trait-inheritance-diamond.rs
src/test/run-pass/trait-inheritance-multiple-inheritors.rs
src/test/run-pass/trait-inheritance-multiple-params.rs
src/test/run-pass/trait-inheritance-num.rs
src/test/run-pass/trait-inheritance-num0.rs
src/test/run-pass/trait-inheritance-num1.rs
src/test/run-pass/trait-inheritance-num2.rs
src/test/run-pass/trait-inheritance-num3.rs
src/test/run-pass/trait-inheritance-num5.rs
src/test/run-pass/trait-inheritance-overloading-xc-exe.rs
src/test/run-pass/trait-inheritance-self-in-supertype.rs
src/test/run-pass/trait-inheritance-simple.rs
src/test/run-pass/trait-inheritance-static.rs
src/test/run-pass/trait-inheritance-static2.rs
src/test/run-pass/trait-inheritance-subst.rs
src/test/run-pass/trait-inheritance-subst2.rs
src/test/run-pass/trait-inheritance-visibility.rs
src/test/run-pass/trait-inheritance2.rs
src/test/run-pass/trait-object-generics.rs
src/test/run-pass/trait-object-with-lifetime-bound.rs
src/test/run-pass/trait-safety-ok-cc.rs
src/test/run-pass/trait-safety-ok.rs
src/test/run-pass/trait-where-clause-vs-impl.rs
src/test/run-pass/traits-assoc-type-in-supertrait.rs
src/test/run-pass/traits-conditional-dispatch.rs
src/test/run-pass/traits-conditional-model-fn.rs
src/test/run-pass/traits-default-method-macro.rs
src/test/run-pass/traits-default-method-mut.rs
src/test/run-pass/traits-issue-22019.rs
src/test/run-pass/traits-issue-22110.rs
src/test/run-pass/traits-issue-22655.rs
src/test/run-pass/traits-issue-23003.rs
src/test/run-pass/traits-multidispatch-infer-convert-target.rs
src/test/run-pass/traits-repeated-supertrait.rs
src/test/run-pass/trans-tag-static-padding.rs
src/test/run-pass/transmute-non-immediate-to-immediate.rs
src/test/run-pass/trivial_casts.rs [new file with mode: 0644]
src/test/run-pass/tup.rs
src/test/run-pass/tuple-index-fat-types.rs
src/test/run-pass/tuple-index.rs
src/test/run-pass/tuple-struct-trivial.rs
src/test/run-pass/tydesc-name.rs
src/test/run-pass/type-id-higher-rank.rs
src/test/run-pass/type-in-nested-module.rs
src/test/run-pass/type-namespace.rs
src/test/run-pass/type-param-constraints.rs
src/test/run-pass/type-param.rs
src/test/run-pass/type-params-in-for-each.rs
src/test/run-pass/type-ptr.rs
src/test/run-pass/type-sizes.rs
src/test/run-pass/type-use-i1-versus-i8.rs
src/test/run-pass/typeck-macro-interaction-issue-8852.rs
src/test/run-pass/typeck_type_placeholder_1.rs
src/test/run-pass/typeid-intrinsic.rs
src/test/run-pass/typestate-cfg-nesting.rs
src/test/run-pass/typestate-multi-decl.rs
src/test/run-pass/u32-decr.rs
src/test/run-pass/u8-incr-decr.rs
src/test/run-pass/u8-incr.rs
src/test/run-pass/ufcs-polymorphic-paths.rs
src/test/run-pass/ufcs-trait-object.rs
src/test/run-pass/ufcs-type-params.rs
src/test/run-pass/uint.rs
src/test/run-pass/unboxed-closures-all-traits.rs
src/test/run-pass/unboxed-closures-by-ref.rs
src/test/run-pass/unboxed-closures-call-fn-autoderef.rs
src/test/run-pass/unboxed-closures-call-sugar-autoderef.rs
src/test/run-pass/unboxed-closures-counter-not-moved.rs
src/test/run-pass/unboxed-closures-cross-crate.rs
src/test/run-pass/unboxed-closures-direct-sugary-call.rs
src/test/run-pass/unboxed-closures-drop.rs
src/test/run-pass/unboxed-closures-extern-fn-hr.rs
src/test/run-pass/unboxed-closures-extern-fn.rs
src/test/run-pass/unboxed-closures-fn-as-fnmut-and-fnonce.rs
src/test/run-pass/unboxed-closures-fnmut-as-fnonce.rs
src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-bound.rs
src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-object-type.rs
src/test/run-pass/unboxed-closures-infer-argument-types-with-bound-regions-from-expected-bound.rs
src/test/run-pass/unboxed-closures-infer-fnmut-calling-fnmut.rs
src/test/run-pass/unboxed-closures-infer-fnmut-move.rs
src/test/run-pass/unboxed-closures-infer-fnmut.rs
src/test/run-pass/unboxed-closures-infer-fnonce-move.rs
src/test/run-pass/unboxed-closures-infer-fnonce.rs
src/test/run-pass/unboxed-closures-infer-kind.rs
src/test/run-pass/unboxed-closures-infer-recursive-fn.rs
src/test/run-pass/unboxed-closures-infer-upvar.rs
src/test/run-pass/unboxed-closures-manual-impl.rs
src/test/run-pass/unboxed-closures-monomorphization.rs
src/test/run-pass/unboxed-closures-move-mutable.rs
src/test/run-pass/unboxed-closures-move-some-upvars-in-by-ref-closure.rs
src/test/run-pass/unboxed-closures-prelude.rs
src/test/run-pass/unboxed-closures-simple.rs
src/test/run-pass/unboxed-closures-single-word-env.rs
src/test/run-pass/unboxed-closures-static-call-fn-once.rs
src/test/run-pass/unboxed-closures-sugar-object.rs
src/test/run-pass/unboxed-closures-unique-type-id.rs
src/test/run-pass/unboxed-closures-zero-args.rs
src/test/run-pass/unfold-cross-crate.rs
src/test/run-pass/unify-return-ty.rs
src/test/run-pass/uninit-empty-types.rs
src/test/run-pass/uniq-self-in-mut-slot.rs
src/test/run-pass/unique-assign-copy.rs
src/test/run-pass/unique-assign-drop.rs
src/test/run-pass/unique-assign-generic.rs
src/test/run-pass/unique-assign.rs
src/test/run-pass/unique-autoderef-field.rs
src/test/run-pass/unique-autoderef-index.rs
src/test/run-pass/unique-cmp.rs
src/test/run-pass/unique-containing-tag.rs
src/test/run-pass/unique-create.rs
src/test/run-pass/unique-decl-init-copy.rs
src/test/run-pass/unique-decl-init.rs
src/test/run-pass/unique-decl-move.rs
src/test/run-pass/unique-decl.rs
src/test/run-pass/unique-deref.rs
src/test/run-pass/unique-destructure.rs
src/test/run-pass/unique-drop-complex.rs
src/test/run-pass/unique-fn-arg-move.rs
src/test/run-pass/unique-fn-arg-mut.rs
src/test/run-pass/unique-fn-arg.rs
src/test/run-pass/unique-fn-ret.rs
src/test/run-pass/unique-generic-assign.rs
src/test/run-pass/unique-in-vec-copy.rs
src/test/run-pass/unique-in-vec.rs
src/test/run-pass/unique-init.rs
src/test/run-pass/unique-kinds.rs
src/test/run-pass/unique-match-discrim.rs
src/test/run-pass/unique-move-drop.rs
src/test/run-pass/unique-move-temp.rs
src/test/run-pass/unique-move.rs
src/test/run-pass/unique-mutable.rs
src/test/run-pass/unique-object-move.rs
src/test/run-pass/unique-pat-2.rs
src/test/run-pass/unique-pat.rs
src/test/run-pass/unique-rec.rs
src/test/run-pass/unique-send-2.rs
src/test/run-pass/unique-send.rs
src/test/run-pass/unique-swap.rs
src/test/run-pass/unit-like-struct-drop-run.rs
src/test/run-pass/unit.rs
src/test/run-pass/unnamed_argument_mode.rs
src/test/run-pass/unreachable-code-1.rs
src/test/run-pass/unreachable-code.rs
src/test/run-pass/unsafe-coercion.rs
src/test/run-pass/unsafe-fn-called-from-unsafe-blk.rs
src/test/run-pass/unsafe-fn-called-from-unsafe-fn.rs
src/test/run-pass/unsafe-pointer-assignability.rs
src/test/run-pass/unsized.rs
src/test/run-pass/unsized2.rs
src/test/run-pass/unsized3.rs
src/test/run-pass/unused-move-capture.rs
src/test/run-pass/unused-move.rs
src/test/run-pass/unwind-unique.rs
src/test/run-pass/use-crate-name-alias.rs
src/test/run-pass/use-import-export.rs
src/test/run-pass/use-mod.rs
src/test/run-pass/use-trait-before-def.rs
src/test/run-pass/use.rs
src/test/run-pass/use_inline_dtor.rs
src/test/run-pass/utf8_chars.rs
src/test/run-pass/variadic-ffi.rs
src/test/run-pass/variance-intersection-of-ref-and-opt-ref.rs
src/test/run-pass/variance-trait-matching.rs
src/test/run-pass/variance-vec-covariant.rs
src/test/run-pass/variant-attributes.rs
src/test/run-pass/variant-structs-trivial.rs
src/test/run-pass/vec-concat.rs
src/test/run-pass/vec-dst.rs
src/test/run-pass/vec-fixed-length.rs
src/test/run-pass/vec-growth.rs
src/test/run-pass/vec-macro-no-std.rs
src/test/run-pass/vec-macro-repeat.rs
src/test/run-pass/vec-macro-rvalue-scope.rs
src/test/run-pass/vec-macro-with-brackets.rs
src/test/run-pass/vec-macro-with-trailing-comma.rs
src/test/run-pass/vec-matching-autoslice.rs
src/test/run-pass/vec-matching-fixed.rs
src/test/run-pass/vec-matching-fold.rs
src/test/run-pass/vec-matching.rs
src/test/run-pass/vec-push.rs
src/test/run-pass/vec-repeat-with-cast.rs
src/test/run-pass/vec-slice-drop.rs
src/test/run-pass/vec-slice.rs
src/test/run-pass/vec-tail-matching.rs
src/test/run-pass/vec-to_str.rs
src/test/run-pass/vec.rs
src/test/run-pass/vector-no-ann-2.rs
src/test/run-pass/vector-sort-panic-safe.rs
src/test/run-pass/visible-private-types-feature-gate.rs
src/test/run-pass/wait-forked-but-failed-child.rs
src/test/run-pass/warn-ctypes-inhibit.rs
src/test/run-pass/weak-lang-item.rs
src/test/run-pass/wf-bound-region-in-object-type.rs
src/test/run-pass/where-clause-bounds-inconsistency.rs
src/test/run-pass/where-clause-early-bound-lifetimes.rs
src/test/run-pass/where-clause-method-substituion.rs
src/test/run-pass/where-clause-region-outlives.rs
src/test/run-pass/where-clauses-lifetimes.rs
src/test/run-pass/where-clauses-unboxed-closures.rs
src/test/run-pass/where-for-self.rs
src/test/run-pass/while-flow-graph.rs
src/test/run-pass/while-label.rs
src/test/run-pass/while-let.rs
src/test/run-pass/while-prelude-drop.rs
src/test/run-pass/writealias.rs
src/test/run-pass/x86stdcall2.rs
src/test/run-pass/xcrate-address-insignificant.rs
src/test/run-pass/xcrate-static-addresses.rs
src/test/run-pass/xcrate-trait-lifetime-param.rs
src/test/run-pass/xcrate-unit-struct.rs
src/test/run-pass/zero-size-type-destructors.rs
src/test/run-pass/zero_sized_subslice_match.rs

index fdc28eee8c8ef679db84c2a6ab0bd142fb724607..683c7fd0563961c3056d115319eefcf878cc36f4 100755 (executable)
--- a/configure
+++ b/configure
@@ -479,10 +479,19 @@ esac
 # Detect 64 bit linux systems with 32 bit userland and force 32 bit compilation
 if [ $CFG_OSTYPE = unknown-linux-gnu -a $CFG_CPUTYPE = x86_64 ]
 then
-    file -L "$SHELL" | grep -q "x86[_-]64"
-    if [ $? != 0 ]; then
-        CFG_CPUTYPE=i686
+    # $SHELL does not exist in standard 'sh', so probably only exists
+    # if configure is running in an interactive bash shell. /usr/bin/env
+    # exists *everywhere*.
+    BIN_TO_PROBE="$SHELL"
+    if [ -z "$BIN_TO_PROBE" -a -e "/usr/bin/env" ]; then
+       BIN_TO_PROBE="/usr/bin/env"
     fi
+    if [ -n "$BIN_TO_PROBE" ]; then
+       file -L "$BIN_TO_PROBE" | grep -q "x86[_-]64"
+       if [ $? != 0 ]; then
+            CFG_CPUTYPE=i686
+       fi
+     fi
 fi
 
 
index 01c4e99b77c70a25daa503a95ac2f1d45a093f0d..1ee5917ac9c91b7dbdc734d4f114ed9b2dea7454 100644 (file)
@@ -20,6 +20,8 @@
 #![feature(std_misc)]
 #![feature(test)]
 #![feature(path_ext)]
+#![feature(convert)]
+#![feature(str_char)]
 
 #![deny(warnings)]
 
@@ -115,7 +117,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
 
     fn opt_path(m: &getopts::Matches, nm: &str) -> PathBuf {
         match m.opt_str(nm) {
-            Some(s) => PathBuf::new(&s),
+            Some(s) => PathBuf::from(&s),
             None => panic!("no option (=path) found for {}", nm),
         }
     }
@@ -130,10 +132,10 @@ fn opt_path(m: &getopts::Matches, nm: &str) -> PathBuf {
         compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
         run_lib_path: matches.opt_str("run-lib-path").unwrap(),
         rustc_path: opt_path(matches, "rustc-path"),
-        clang_path: matches.opt_str("clang-path").map(|s| PathBuf::new(&s)),
+        clang_path: matches.opt_str("clang-path").map(|s| PathBuf::from(&s)),
         valgrind_path: matches.opt_str("valgrind-path"),
         force_valgrind: matches.opt_present("force-valgrind"),
-        llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| PathBuf::new(&s)),
+        llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| PathBuf::from(&s)),
         src_base: opt_path(matches, "src-base"),
         build_base: opt_path(matches, "build-base"),
         aux_base: opt_path(matches, "aux-base"),
@@ -141,7 +143,7 @@ fn opt_path(m: &getopts::Matches, nm: &str) -> PathBuf {
         mode: matches.opt_str("mode").unwrap().parse().ok().expect("invalid mode"),
         run_ignored: matches.opt_present("ignored"),
         filter: filter,
-        logfile: matches.opt_str("logfile").map(|s| PathBuf::new(&s)),
+        logfile: matches.opt_str("logfile").map(|s| PathBuf::from(&s)),
         runtool: matches.opt_str("runtool"),
         host_rustcflags: matches.opt_str("host-rustcflags"),
         target_rustcflags: matches.opt_str("target-rustcflags"),
index 29123173f5baec5dbf3fa9c3a61065f0b009c503..461b5af6204edced4155e7ace9b3f5ab533c3c2c 100644 (file)
@@ -40,8 +40,8 @@ pub struct TestProps {
     pub check_stdout: bool,
     // Don't force a --crate-type=dylib flag on the command line
     pub no_prefer_dynamic: bool,
-    // Don't run --pretty expanded when running pretty printing tests
-    pub no_pretty_expanded: bool,
+    // Run --pretty expanded when running pretty printing tests
+    pub pretty_expanded: bool,
     // Which pretty mode are we testing with, default to 'normal'
     pub pretty_mode: String,
     // Only compare pretty output and don't try compiling
@@ -62,7 +62,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
     let mut force_host = false;
     let mut check_stdout = false;
     let mut no_prefer_dynamic = false;
-    let mut no_pretty_expanded = false;
+    let mut pretty_expanded = false;
     let mut pretty_mode = None;
     let mut pretty_compare_only = false;
     let mut forbid_output = Vec::new();
@@ -96,8 +96,8 @@ pub fn load_props(testfile: &Path) -> TestProps {
             no_prefer_dynamic = parse_no_prefer_dynamic(ln);
         }
 
-        if !no_pretty_expanded {
-            no_pretty_expanded = parse_no_pretty_expanded(ln);
+        if !pretty_expanded {
+            pretty_expanded = parse_pretty_expanded(ln);
         }
 
         if pretty_mode.is_none() {
@@ -152,7 +152,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
         force_host: force_host,
         check_stdout: check_stdout,
         no_prefer_dynamic: no_prefer_dynamic,
-        no_pretty_expanded: no_pretty_expanded,
+        pretty_expanded: pretty_expanded,
         pretty_mode: pretty_mode.unwrap_or("normal".to_string()),
         pretty_compare_only: pretty_compare_only,
         forbid_output: forbid_output,
@@ -295,8 +295,8 @@ fn parse_no_prefer_dynamic(line: &str) -> bool {
     parse_name_directive(line, "no-prefer-dynamic")
 }
 
-fn parse_no_pretty_expanded(line: &str) -> bool {
-    parse_name_directive(line, "no-pretty-expanded")
+fn parse_pretty_expanded(line: &str) -> bool {
+    parse_name_directive(line, "pretty-expanded")
 }
 
 fn parse_pretty_mode(line: &str) -> Option<String> {
@@ -328,10 +328,10 @@ fn parse_exec_env(line: &str) -> Option<(String, String)> {
 
 fn parse_pp_exact(line: &str, testfile: &Path) -> Option<PathBuf> {
     match parse_name_value_directive(line, "pp-exact") {
-      Some(s) => Some(PathBuf::new(&s)),
+      Some(s) => Some(PathBuf::from(&s)),
       None => {
         if parse_name_directive(line, "pp-exact") {
-            testfile.file_name().map(|s| PathBuf::new(s))
+            testfile.file_name().map(|s| PathBuf::from(s))
         } else {
             None
         }
@@ -340,7 +340,8 @@ fn parse_pp_exact(line: &str, testfile: &Path) -> Option<PathBuf> {
 }
 
 fn parse_name_directive(line: &str, directive: &str) -> bool {
-    line.contains(directive)
+    // 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))
 }
 
 pub fn parse_name_value_directive(line: &str, directive: &str)
index a754bd950f7f6006709fac0e228eda7cb706c8ec..1666124b46a6185febf95b484ba3546645abbeab 100644 (file)
@@ -245,7 +245,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
     if !proc_res.status.success() {
         fatal_proc_rec("pretty-printed source does not typecheck", &proc_res);
     }
-    if props.no_pretty_expanded { return }
+    if !props.pretty_expanded { return }
 
     // additionally, run `--pretty expanded` and try to build it.
     let proc_res = print_source(config, props, testfile, srcs[round].clone(), "expanded");
@@ -1440,7 +1440,7 @@ fn aux_output_dir_name(config: &Config, testfile: &Path) -> PathBuf {
 }
 
 fn output_testname(testfile: &Path) -> PathBuf {
-    PathBuf::new(testfile.file_stem().unwrap())
+    PathBuf::from(testfile.file_stem().unwrap())
 }
 
 fn output_base_name(config: &Config, testfile: &Path) -> PathBuf {
index 51280e58854761e0f8ae80f6311e064963c628b8..b711085ddbd9c298cd5b641d4d4711617d02224a 100644 (file)
@@ -446,16 +446,16 @@ It gives us this error:
 error: aborting due to previous error
 ```
 
-It mentions that "captured outer variable in an `FnMut` closure".
-Because we declared the closure as a moving closure, and it referred
-to `numbers`, the closure will try to take ownership of the
-vector. But the closure itself is created in a loop, and hence we will
-actually create three closures, one for every iteration of the
-loop. This means that all three of those closures would try to own
-`numbers`, which is impossible -- `numbers` must have just one
-owner. Rust detects this and gives us the error: we claim that
-`numbers` has ownership, but our code tries to make three owners. This
-may cause a safety problem, so Rust disallows it.
+This is a little confusing because there are two closures here: the one passed
+to `map`, and the one passed to `thread::scoped`. In this case, the closure for
+`thread::scoped` is attempting to reference `numbers`, a `Vec<i32>`. This
+closure is a `FnOnce` closure, as that’s what `thread::scoped` takes as an
+argument. `FnOnce` closures take ownership of their environment. That’s fine,
+but there’s one detail: because of `map`, we’re going to make three of these
+closures. And since all three try to take ownership of `numbers`, that would be
+a problem. That’s what it means by ‘cannot move out of captured outer
+variable’: our `thread::scoped` closure wants to take ownership, and it can’t,
+because the closure for `map` won’t let it.
 
 What to do here? Rust has two types that helps us: `Arc<T>` and `Mutex<T>`.
 *Arc* stands for "atomically reference counted". In other words, an Arc will
index 6e6c56d3df20de5198fffa6c72ecfec8472e70cd..32088b2ab67bf9dbed624557bd0e12ad30eb23e6 100644 (file)
@@ -816,8 +816,7 @@ may optionally begin with any number of `attributes` that apply to the
 containing module. Attributes on the anonymous crate module define important
 metadata that influences the behavior of the compiler.
 
-```{.rust}
-# #![allow(unused_attribute)]
+```no_run
 // Crate name
 #![crate_name = "projx"]
 
@@ -1020,6 +1019,7 @@ Use declarations support a number of convenient shortcuts:
 An example of `use` declarations:
 
 ```
+# #![feature(core)]
 use std::iter::range_step;
 use std::option::Option::{Some, None};
 use std::collections::hash_map::{self, HashMap};
@@ -1080,6 +1080,7 @@ declarations.
 An example of what will and will not work for `use` items:
 
 ```
+# #![feature(core)]
 # #![allow(unused_imports)]
 use foo::core::iter;  // good: foo is at the root of the crate
 use foo::baz::foobaz;    // good: foo is at the root of the crate
@@ -1781,6 +1782,7 @@ functions, with the exception that they may not have a body and are instead
 terminated by a semicolon.
 
 ```
+# #![feature(libc)]
 extern crate libc;
 use libc::{c_char, FILE};
 
index 76f8b6c97381818dc3a79b4e7aa87696d58a8377..70c74825a072cd7fac01e1b772f70ad659d7dba1 100644 (file)
@@ -22,6 +22,7 @@
     * [More Strings](more-strings.md)
     * [Patterns](patterns.md)
     * [Method Syntax](method-syntax.md)
+    * [Associated Types](associated-types.md)
     * [Closures](closures.md)
     * [Iterators](iterators.md)
     * [Generics](generics.md)
diff --git a/src/doc/trpl/associated-types.md b/src/doc/trpl/associated-types.md
new file mode 100644 (file)
index 0000000..f36c2c5
--- /dev/null
@@ -0,0 +1,202 @@
+% Associated Types
+
+Associated types are a powerful part of Rust's type system. They're related to
+the idea of a 'type family', in other words, grouping multiple types together. That
+description is a bit abstract, so let's dive right into an example. If you want
+to write a `Graph` trait, you have two types to be generic over: the node type
+and the edge type. So you might write a trait, `Graph<N, E>`, that looks like
+this:
+
+```rust
+trait Graph<N, E> {
+    fn has_edge(&self, &N, &N) -> bool;
+    fn edges(&self, &N) -> Vec<E>;
+    // etc
+}
+```
+
+While this sort of works, it ends up being awkward. For example, any function
+that wants to take a `Graph` as a parameter now _also_ needs to be generic over
+the `N`ode and `E`dge types too:
+
+```rust,ignore
+fn distance<N, E, G: Graph<N, E>>(graph: &G, start: &N, end: &N) -> u32 { ... }
+```
+
+Our distance calculation works regardless of our `Edge` type, so the `E` stuff in
+this signature is just a distraction.
+
+What we really want to say is that a certain `E`dge and `N`ode type come together
+to form each kind of `Graph`. We can do that with associated types:
+
+```rust
+trait Graph {
+    type N;
+    type E;
+
+    fn has_edge(&self, &Self::N, &Self::N) -> bool;
+    fn edges(&self, &Self::N) -> Vec<Self::E>;
+    // etc
+}
+```
+
+Now, our clients can be abstract over a given `Graph`:
+
+```rust,ignore
+fn distance<G: Graph>(graph: &G, start: &G::N, end: &G::N) -> uint { ... }
+```
+
+No need to deal with the `E`dge type here!
+
+Let's go over all this in more detail.
+
+## Defining associated types
+
+Let's build that `Graph` trait. Here's the definition:
+
+```rust
+trait Graph {
+    type N;
+    type E;
+
+    fn has_edge(&self, &Self::N, &Self::N) -> bool;
+    fn edges(&self, &Self::N) -> Vec<Self::E>;
+}
+```
+
+Simple enough. Associated types use the `type` keyword, and go inside the body
+of the trait, with the functions.
+
+These `type` declarations can have all the same thing as functions do. For example,
+if we wanted our `N` type to implement `Display`, so we can print the nodes out,
+we could do this:
+
+```rust
+use std::fmt;
+
+trait Graph {
+    type N: fmt::Display;
+    type E;
+
+    fn has_edge(&self, &Self::N, &Self::N) -> bool;
+    fn edges(&self, &Self::N) -> Vec<Self::E>;
+}
+```
+
+## Implementing associated types
+
+Just like any trait, traits that use associated types use the `impl` keyword to
+provide implementations. Here's a simple implementation of Graph:
+
+```rust
+# trait Graph {
+#     type N;
+#     type E;
+#     fn has_edge(&self, &Self::N, &Self::N) -> bool;
+#     fn edges(&self, &Self::N) -> Vec<Self::E>;
+# }
+struct Node;
+
+struct Edge;
+
+struct MyGraph;
+
+impl Graph for MyGraph {
+    type N = Node;
+    type E = Edge;
+
+    fn has_edge(&self, n1: &Node, n2: &Node) -> bool {
+        true
+    }
+
+    fn edges(&self, n: &Node) -> Vec<Edge> {
+        Vec::new()
+    }
+}
+```
+
+This silly implementation always returns `true` and an empty `Vec<Edge>`, but it
+gives you an idea of how to implement this kind of thing. We first need three
+`struct`s, one for the graph, one for the node, and one for the edge. If it made
+more sense to use a different type, that would work as well, we're just going to
+use `struct`s for all three here.
+
+Next is the `impl` line, which is just like implementing any other trait.
+
+From here, we use `=` to define our associated types. The name the trait uses
+goes on the left of the `=`, and the concrete type we're `impl`ementing this
+for goes on the right. Finally, we use the concrete types in our function
+declarations.
+
+## Trait objects with associated types
+
+There’s one more bit of syntax we should talk about: trait objects. If you
+try to create a trait object from an associated type, like this:
+
+```rust,ignore
+# trait Graph {
+#     type N;
+#     type E;
+#     fn has_edge(&self, &Self::N, &Self::N) -> bool;
+#     fn edges(&self, &Self::N) -> Vec<Self::E>;
+# }
+# struct Node;
+# struct Edge;
+# struct MyGraph;
+# impl Graph for MyGraph {
+#     type N = Node;
+#     type E = Edge;
+#     fn has_edge(&self, n1: &Node, n2: &Node) -> bool {
+#         true
+#     }
+#     fn edges(&self, n: &Node) -> Vec<Edge> {
+#         Vec::new()
+#     }
+# }
+let graph = MyGraph;
+let obj = Box::new(graph) as Box<Graph>;
+```
+
+You’ll get two errors:
+
+```text
+error: the value of the associated type `E` (from the trait `main::Graph`) must
+be specified [E0191]
+let obj = Box::new(graph) as Box<Graph>;
+          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+24:44 error: the value of the associated type `N` (from the trait
+`main::Graph`) must be specified [E0191]
+let obj = Box::new(graph) as Box<Graph>;
+          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+```
+
+We can’t create a trait object like this, becuase we don’t know the associated
+types. Instead, we can write this:
+
+```rust
+# trait Graph {
+#     type N;
+#     type E;
+#     fn has_edge(&self, &Self::N, &Self::N) -> bool;
+#     fn edges(&self, &Self::N) -> Vec<Self::E>;
+# }
+# struct Node;
+# struct Edge;
+# struct MyGraph;
+# impl Graph for MyGraph {
+#     type N = Node;
+#     type E = Edge;
+#     fn has_edge(&self, n1: &Node, n2: &Node) -> bool {
+#         true
+#     }
+#     fn edges(&self, n: &Node) -> Vec<Edge> {
+#         Vec::new()
+#     }
+# }
+let graph = MyGraph;
+let obj = Box::new(graph) as Box<Graph<N=Node, E=Edge>>;
+```
+
+The `N=Node` syntax allows us to provide a concrete type, `Node`, for the `N`
+type parameter. Same with `E=Edge`. If we didn’t proide this constraint, we
+couldn’t be sure which `impl` to match this trait object to.
index e09922fd390a9b037cedaab162908449a42d2eb2..d531a22d0e0dd55d2b2a0d5d913b88f9d3912c73 100644 (file)
@@ -47,7 +47,7 @@ This pattern is very powerful, and we'll see it repeated more later.
 
 There are also a few things you can do with a tuple as a whole, without
 destructuring. You can assign one tuple into another, if they have the same
-contained types and arity. Tuples have the same arity when they have the same
+contained types and [arity]. Tuples have the same arity when they have the same
 length.
 
 ```rust
@@ -196,8 +196,9 @@ Now, we have actual names, rather than positions. Good names are important,
 and with a struct, we have actual names.
 
 There _is_ one case when a tuple struct is very useful, though, and that's a
-tuple struct with only one element. We call this a *newtype*, because it lets
-you create a new type that's similar to another one:
+tuple struct with only one element. We call this the *newtype* pattern, because
+it allows you to create a new type, distinct from that of its contained value
+and expressing its own semantic meaning:
 
 ```{rust}
 struct Inches(i32);
@@ -216,7 +217,7 @@ destructuring `let`, as we discussed previously in 'tuples.' In this case, the
 
 Finally, Rust has a "sum type", an *enum*. Enums are an incredibly useful
 feature of Rust, and are used throughout the standard library. An `enum` is
-a type which ties a set of alternates to a specific name. For example, below
+a type which relates a set of alternates to a specific name. For example, below
 we define `Character` to be either a `Digit` or something else. These
 can be used via their fully scoped names: `Character::Other` (more about `::`
 below).
@@ -228,8 +229,8 @@ enum Character {
 }
 ```
 
-An `enum` variant can be defined as most normal types. Below are some example
-types which also would be allowed in an `enum`.
+Most normal types are allowed as the variant components of an `enum`. Here are
+some examples:
 
 ```rust
 struct Empty;
@@ -239,15 +240,15 @@ struct Status { Health: i32, Mana: i32, Attack: i32, Defense: i32 }
 struct HeightDatabase(Vec<i32>);
 ```
 
-So you see that depending on the sub-datastructure, the `enum` variant, same as
-a struct, may or may not hold data. That is, in `Character`, `Digit` is a name
-tied to an `i32` where `Other` is just a name. However, the fact that they are
-distinct makes this very useful.
+You see that, depending on its type, an `enum` variant may or may not hold data.
+In `Character`, for instance, `Digit` gives a meaningful name for an `i32`
+value, where `Other` is only a name. However, the fact that they represent
+distinct categories of `Character` is a very useful property.
 
-As with structures, enums don't by default have access to operators such as
-compare ( `==` and `!=`), binary operations (`*` and `+`), and order
-(`<` and `>=`). As such, using the previous `Character` type, the
-following code is invalid:
+As with structures, the variants of an enum by default are not comparable with
+equality operators (`==`, `!=`), have no ordering (`<`, `>=`, etc.), and do not
+support other binary operations such as `*` and `+`. As such, the following code
+is invalid for the example `Character` type:
 
 ```{rust,ignore}
 // These assignments both succeed
@@ -265,9 +266,10 @@ let four_equals_ten = four == ten;
 ```
 
 This may seem rather limiting, but it's a limitation which we can overcome.
-There are two ways: by implementing equality ourselves, or by using the
-[`match`][match] keyword. We don't know enough about Rust to implement equality
-yet, but we can use the `Ordering` enum from the standard library, which does:
+There are two ways: by implementing equality ourselves, or by pattern matching
+variants with [`match`][match] expressions, which you'll learn in the next
+chapter. We don't know enough about Rust to implement equality yet, but we can
+use the `Ordering` enum from the standard library, which does:
 
 ```
 enum Ordering {
@@ -277,9 +279,8 @@ enum Ordering {
 }
 ```
 
-Because we did not define `Ordering`, we must import it (from the std
-library) with the `use` keyword. Here's an example of how `Ordering` is
-used:
+Because `Ordering` has already been defined for us, we will import it with the
+`use` keyword. Here's an example of how it is used:
 
 ```{rust}
 use std::cmp::Ordering;
@@ -313,17 +314,17 @@ the standard library if you need them.
 
 Okay, let's talk about the actual code in the example. `cmp` is a function that
 compares two things, and returns an `Ordering`. We return either
-`Ordering::Less`, `Ordering::Greater`, or `Ordering::Equal`, depending on if
-the two values are less, greater, or equal. Note that each variant of the
-`enum` is namespaced under the `enum` itself: it's `Ordering::Greater` not
-`Greater`.
+`Ordering::Less`, `Ordering::Greater`, or `Ordering::Equal`, depending on
+whether the first value is less than, greater than, or equal to the second. Note
+that each variant of the `enum` is namespaced under the `enum` itself: it's
+`Ordering::Greater`, not `Greater`.
 
 The `ordering` variable has the type `Ordering`, and so contains one of the
 three values. We then do a bunch of `if`/`else` comparisons to check which
 one it is.
 
-This `Ordering::Greater` notation is too long. Let's use `use` to import the
-`enum` variants instead. This will avoid full scoping:
+This `Ordering::Greater` notation is too long. Let's use another form of `use`
+to import the `enum` variants instead. This will avoid full scoping:
 
 ```{rust}
 use std::cmp::Ordering::{self, Equal, Less, Greater};
@@ -347,16 +348,18 @@ fn main() {
 ```
 
 Importing variants is convenient and compact, but can also cause name conflicts,
-so do this with caution. It's considered good style to rarely import variants
-for this reason.
+so do this with caution. For this reason, it's normally considered better style
+to `use` an enum rather than its variants directly.
 
-As you can see, `enum`s are quite a powerful tool for data representation, and are
-even more useful when they're [generic][generics] across types. Before we
-get to generics, though, let's talk about how to use them with pattern matching, a
-tool that will let us deconstruct this sum type (the type theory term for enums)
-in a very elegant way and avoid all these messy `if`/`else`s.
+As you can see, `enum`s are quite a powerful tool for data representation, and
+are even more useful when they're [generic][generics] across types. Before we
+get to generics, though, let's talk about how to use enums with pattern
+matching, a tool that will let us deconstruct sum types (the type theory term
+for enums) like `Ordering` in a very elegant way that avoids all these messy
+and brittle `if`/`else`s.
 
 
+[arity]: ./glossary.html#arity
 [match]: ./match.html
 [game]: ./guessing-game.html#comparing-guesses
 [generics]: ./generics.html
index 4a16db63950ddd0ff76983b8df988bea5b5ffc91..79cb3117c0ef2ea7c249ca5303f0eadaa1f0a860 100644 (file)
@@ -40,14 +40,14 @@ us enforce that it can't leave the current thread.
 
 ### `Sync`
 
-The second of these two trait is called [`Sync`](../std/marker/trait.Sync.html).
+The second of these traits is called [`Sync`](../std/marker/trait.Sync.html).
 When a type `T` implements `Sync`, it indicates to the compiler that something
 of this type has no possibility of introducing memory unsafety when used from
 multiple threads concurrently.
 
 For example, sharing immutable data with an atomic reference count is
 threadsafe. Rust provides a type like this, `Arc<T>`, and it implements `Sync`,
-so that it could be safely shared between threads.
+so it is safe to share between threads.
 
 These two traits allow you to use the type system to make strong guarantees
 about the properties of your code under concurrency. Before we demonstrate
@@ -69,7 +69,7 @@ fn main() {
 }
 ```
 
-The `Thread::scoped()` method accepts a closure, which is executed in a new
+The `thread::scoped()` method accepts a closure, which is executed in a new
 thread. It's called `scoped` because this thread returns a join guard:
 
 ```
@@ -88,6 +88,7 @@ When `guard` goes out of scope, it will block execution until the thread is
 finished. If we didn't want this behaviour, we could use `thread::spawn()`:
 
 ```
+# #![feature(old_io, std_misc)]
 use std::thread;
 use std::old_io::timer;
 use std::time::Duration;
@@ -146,6 +147,7 @@ As an example, here is a Rust program that would have a data race in many
 languages. It will not compile:
 
 ```ignore
+# #![feature(old_io, std_misc)]
 use std::thread;
 use std::old_io::timer;
 use std::time::Duration;
@@ -185,6 +187,7 @@ only one person at a time can mutate what's inside. For that, we can use the
 but for a different reason:
 
 ```ignore
+# #![feature(old_io, std_misc)]
 use std::thread;
 use std::old_io::timer;
 use std::time::Duration;
@@ -208,10 +211,10 @@ Here's the error:
 
 ```text
 <anon>:11:9: 11:22 error: the trait `core::marker::Send` is not implemented for the type `std::sync::mutex::MutexGuard<'_, collections::vec::Vec<u32>>` [E0277]
-<anon>:11         Thread::spawn(move || {
+<anon>:11         thread::spawn(move || {
                   ^~~~~~~~~~~~~
 <anon>:11:9: 11:22 note: `std::sync::mutex::MutexGuard<'_, collections::vec::Vec<u32>>` cannot be sent between threads safely
-<anon>:11         Thread::spawn(move || {
+<anon>:11         thread::spawn(move || {
                   ^~~~~~~~~~~~~
 ```
 
@@ -229,6 +232,7 @@ guard across thread boundaries, which gives us our error.
 We can use `Arc<T>` to fix this. Here's the working version:
 
 ```
+# #![feature(old_io, std_misc)]
 use std::sync::{Arc, Mutex};
 use std::thread;
 use std::old_io::timer;
@@ -254,6 +258,7 @@ handle is then moved into the new thread. Let's examine the body of the
 thread more closely:
 
 ```
+# #![feature(old_io, std_misc)]
 # use std::sync::{Arc, Mutex};
 # use std::thread;
 # use std::old_io::timer;
@@ -322,7 +327,6 @@ While this channel is just sending a generic signal, we can send any data that
 is `Send` over the channel!
 
 ```
-use std::sync::{Arc, Mutex};
 use std::thread;
 use std::sync::mpsc;
 
index 65ff42ffdcef411804fc99d4a1967b1632d0a637..0cc54c9b16598b10eb2e8b945cc6224b6fbea20b 100644 (file)
@@ -1,6 +1,6 @@
 % Crates and Modules
 
-When a project starts getting large, it's considered good software
+When a project starts getting large, it's considered good software
 engineering practice to split it up into a bunch of smaller pieces, and then
 fit them together. It's also important to have a well-defined interface, so
 that some of your functionality is private, and some is public. To facilitate
@@ -24,23 +24,23 @@ in different languages. To keep things simple, we'll stick to "greetings" and
 two languages for those phrases to be in. We'll use this module layout:
 
 ```text
-                                +-----------+
-                            +---| greetings |
-                            |   +-----------+
-              +---------+   |
-              | english |---+
-              +---------+   |   +-----------+
-              |             +---| farewells |
-+---------+   |                 +-----------+
+                                    +-----------+
+                                +---| greetings |
+                                |   +-----------+
+                  +---------+   |
+              +---| english |---+
+              |   +---------+   |   +-----------+
+              |                 +---| farewells |
++---------+   |                     +-----------+
 | phrases |---+
-+---------+   |                  +-----------+
-              |              +---| greetings |
-              +----------+   |   +-----------+
-              | japanese |---+
-              +----------+   |
-                             |   +-----------+
-                             +---| farewells |
-                                 +-----------+
++---------+   |                     +-----------+
+              |                 +---| greetings |
+              |   +----------+  |   +-----------+
+              +---| japanese |--+
+                  +----------+  |
+                                |   +-----------+
+                                +---| farewells |
+                                    +-----------+
 ```
 
 In this example, `phrases` is the name of our crate. All of the rest are
@@ -76,25 +76,19 @@ To define each of our modules, we use the `mod` keyword. Let's make our
 `src/lib.rs` look like this:
 
 ```
-// in src/lib.rs
-
 mod english {
     mod greetings {
-
     }
 
     mod farewells {
-
     }
 }
 
 mod japanese {
     mod greetings {
-
     }
 
     mod farewells {
-
     }
 }
 ```
@@ -145,11 +139,7 @@ mod english;
 ```
 
 If we do that, Rust will expect to find either a `english.rs` file, or a
-`english/mod.rs` file with the contents of our module:
-
-```{rust,ignore}
-// contents of our module go here
-```
+`english/mod.rs` file with the contents of our module.
 
 Note that in these files, you don't need to re-declare the module: that's
 already been done with the initial `mod` declaration.
@@ -181,10 +171,7 @@ $ tree .
 `src/lib.rs` is our crate root, and looks like this:
 
 ```{rust,ignore}
-// in src/lib.rs
-
 mod english;
-
 mod japanese;
 ```
 
@@ -195,10 +182,7 @@ chosen the second. Both `src/english/mod.rs` and `src/japanese/mod.rs` look
 like this:
 
 ```{rust,ignore}
-// both src/english/mod.rs and src/japanese/mod.rs
-
 mod greetings;
-
 mod farewells;
 ```
 
@@ -214,8 +198,6 @@ both empty at the moment. Let's add some functions.
 Put this in `src/english/greetings.rs`:
 
 ```rust
-// in src/english/greetings.rs
-
 fn hello() -> String {
     "Hello!".to_string()
 }
@@ -224,8 +206,6 @@ fn hello() -> String {
 Put this in `src/english/farewells.rs`:
 
 ```rust
-// in src/english/farewells.rs
-
 fn goodbye() -> String {
     "Goodbye.".to_string()
 }
@@ -248,8 +228,6 @@ about the module system.
 Put this in `src/japanese/farewells.rs`:
 
 ```rust
-// in src/japanese/farewells.rs
-
 fn goodbye() -> String {
     "さようなら".to_string()
 }
@@ -265,11 +243,9 @@ another crate.
 We have a library crate. Let's make an executable crate that imports and uses
 our library.
 
-Make a `src/main.rs` and put this in it: (it won't quite compile yet)
+Make a `src/main.rs` and put this in it (it won't quite compile yet):
 
 ```rust,ignore
-// in src/main.rs
-
 extern crate phrases;
 
 fn main() {
@@ -320,8 +296,6 @@ keyword. Let's focus on the `english` module first, so let's reduce our `src/mai
 to just this:
 
 ```{rust,ignore}
-// in src/main.rs
-
 extern crate phrases;
 
 fn main() {
@@ -333,28 +307,20 @@ fn main() {
 In our `src/lib.rs`, let's add `pub` to the `english` module declaration:
 
 ```{rust,ignore}
-// in src/lib.rs
-
 pub mod english;
-
 mod japanese;
 ```
 
 And in our `src/english/mod.rs`, let's make both `pub`:
 
 ```{rust,ignore}
-// in src/english/mod.rs
-
 pub mod greetings;
-
 pub mod farewells;
 ```
 
 In our `src/english/greetings.rs`, let's add `pub` to our `fn` declaration:
 
 ```{rust,ignore}
-// in src/english/greetings.rs
-
 pub fn hello() -> String {
     "Hello!".to_string()
 }
@@ -363,8 +329,6 @@ pub fn hello() -> String {
 And also in `src/english/farewells.rs`:
 
 ```{rust,ignore}
-// in src/english/farewells.rs
-
 pub fn goodbye() -> String {
     "Goodbye.".to_string()
 }
@@ -400,8 +364,6 @@ Rust has a `use` keyword, which allows us to import names into our local scope.
 Let's change our `src/main.rs` to look like this:
 
 ```{rust,ignore}
-// in src/main.rs
-
 extern crate phrases;
 
 use phrases::english::greetings;
@@ -430,7 +392,7 @@ fn main() {
 }
 ```
 
-But it is not idiomatic. This is significantly more likely to introducing a
+But it is not idiomatic. This is significantly more likely to introduce a
 naming conflict. In our short program, it's not a big deal, but as it grows, it
 becomes a problem. If we have conflicting names, Rust will give a compilation
 error. For example, if we made the `japanese` functions public, and tried to do
@@ -460,21 +422,19 @@ Could not compile `phrases`.
 ```
 
 If we're importing multiple names from the same module, we don't have to type it out
-twice. Rust has a shortcut syntax for writing this:
+twice. Instead of this:
 
 ```{rust,ignore}
 use phrases::english::greetings;
 use phrases::english::farewells;
 ```
 
-You use curly braces:
+We can use this shortcut:
 
 ```{rust,ignore}
 use phrases::english::{greetings, farewells};
 ```
 
-These two declarations are equivalent, but the second is a lot less typing.
-
 ## Re-exporting with `pub use`
 
 You don't just use `use` to shorten identifiers. You can also use it inside of your crate
@@ -484,8 +444,6 @@ interface that may not directly map to your internal code organization.
 Let's look at an example. Modify your `src/main.rs` to read like this:
 
 ```{rust,ignore}
-// in src/main.rs
-
 extern crate phrases;
 
 use phrases::english::{greetings,farewells};
@@ -503,18 +461,13 @@ fn main() {
 Then, modify your `src/lib.rs` to make the `japanese` mod public:
 
 ```{rust,ignore}
-// in src/lib.rs
-
 pub mod english;
-
 pub mod japanese;
 ```
 
 Next, make the two functions public, first in `src/japanese/greetings.rs`:
 
 ```{rust,ignore}
-// in src/japanese/greetings.rs
-
 pub fn hello() -> String {
     "こんにちは".to_string()
 }
@@ -523,8 +476,6 @@ pub fn hello() -> String {
 And then in `src/japanese/farewells.rs`:
 
 ```{rust,ignore}
-// in src/japanese/farewells.rs
-
 pub fn goodbye() -> String {
     "さようなら".to_string()
 }
@@ -533,13 +484,10 @@ pub fn goodbye() -> String {
 Finally, modify your `src/japanese/mod.rs` to read like this:
 
 ```{rust,ignore}
-// in src/japanese/mod.rs
-
 pub use self::greetings::hello;
 pub use self::farewells::goodbye;
 
 mod greetings;
-
 mod farewells;
 ```
 
index 8e5b3b6a7f0afa2f25c1b7938de9cf525d9ecd45..54821e3ce304d5dfc05045c397e56260116bc416 100644 (file)
@@ -237,14 +237,17 @@ fn main() {
 }
 ```
 
-Here's the full algorithm:
-
-1. Given a code block, if it does not contain `fn main()`, it is wrapped in
-   `fn main() { your_code }`
-2. Given that result, if it contains no `extern crate` directives but it also
-   contains the name of the crate being tested, then `extern crate <name>` is
-   injected at the top.
-3. Some common allow attributes are added for documentation examples at the top.
+Here's the full algorithm rustdoc uses to postprocess examples:
+
+1. Any leading `#![foo]` attributes are left intact as crate attributes.
+2. Some common `allow` attributes are inserted, including
+   `unused_variables`, `unused_assignments`, `unused_mut`,
+   `unused_attributes`, and `dead_code`. Small examples often trigger
+   these lints.
+3. If the example does not contain `extern crate`, then `extern crate
+   <mycrate>;` is inserted.
+2. Finally, if the example does not contain `fn main`, the remainder of the
+   text is wrapped in `fn main() { your_code }`
 
 Sometimes, this isn't enough, though. For example, all of these code samples
 with `///` we've been talking about? The raw text:
@@ -333,6 +336,42 @@ By repeating all parts of the example, you can ensure that your example still
 compiles, while only showing the parts that are relevant to that part of your
 explanation.
 
+### Documenting macros
+
+Here’s an example of documenting a macro:
+
+```
+/// Panic with a given message unless an expression evaluates to true.
+///
+/// # Examples
+///
+/// ```
+/// # #[macro_use] extern crate foo;
+/// # fn main() {
+/// panic_unless!(1 + 1 == 2, “Math is broken.”);
+/// # }
+/// ```
+///
+/// ```should_fail
+/// # #[macro_use] extern crate foo;
+/// # fn main() {
+/// panic_unless!(true == false, “I’m broken.”);
+/// # }
+/// ```
+#[macro_export]
+macro_rules! panic_unless {
+    ($condition:expr, $($rest:expr),+) => ({ if ! $condition { panic!($($rest),+); } });
+}
+# fn main() {}
+```
+
+You’ll note three things: we need to add our own `extern crate` line, so that
+we can add the `#[macro_use]` attribute. Second, we’ll need to add our own
+`main()` as well. Finally, a judicious use of `#` to comment out those two
+things, so they don’t show up in the output.
+
+### Running documentation tests
+
 To run the tests, either
 
 ```bash
index 018f35337f3c0b376f86c23b571e93f6ebc2603a..695279e2d5bb6983cd34a3c6903633969fa2992a 100644 (file)
@@ -12,6 +12,7 @@ The following is a minimal example of calling a foreign function which will
 compile if snappy is installed:
 
 ```no_run
+# #![feature(libc)]
 extern crate libc;
 use libc::size_t;
 
@@ -45,6 +46,7 @@ keeping the binding correct at runtime.
 The `extern` block can be extended to cover the entire snappy API:
 
 ```no_run
+# #![feature(libc)]
 extern crate libc;
 use libc::{c_int, size_t};
 
@@ -80,6 +82,7 @@ length is number of elements currently contained, and the capacity is the total
 the allocated memory. The length is less than or equal to the capacity.
 
 ```
+# #![feature(libc)]
 # extern crate libc;
 # use libc::{c_int, size_t};
 # unsafe fn snappy_validate_compressed_buffer(_: *const u8, _: size_t) -> c_int { 0 }
@@ -104,6 +107,7 @@ required capacity to hold the compressed output. The vector can then be passed t
 the true length after compression for setting the length.
 
 ```
+# #![feature(libc)]
 # extern crate libc;
 # use libc::{size_t, c_int};
 # unsafe fn snappy_compress(a: *const u8, b: size_t, c: *mut u8,
@@ -130,6 +134,7 @@ Decompression is similar, because snappy stores the uncompressed size as part of
 format and `snappy_uncompressed_length` will retrieve the exact buffer size required.
 
 ```
+# #![feature(libc)]
 # extern crate libc;
 # use libc::{size_t, c_int};
 # unsafe fn snappy_uncompress(compressed: *const u8,
@@ -408,6 +413,7 @@ global state. In order to access these variables, you declare them in `extern`
 blocks with the `static` keyword:
 
 ```no_run
+# #![feature(libc)]
 extern crate libc;
 
 #[link(name = "readline")]
@@ -426,6 +432,7 @@ interface. To do this, statics can be declared with `mut` so we can mutate
 them.
 
 ```no_run
+# #![feature(libc)]
 extern crate libc;
 
 use std::ffi::CString;
@@ -458,6 +465,7 @@ calling foreign functions. Some foreign functions, most notably the Windows API,
 conventions. Rust provides a way to tell the compiler which convention to use:
 
 ```
+# #![feature(libc)]
 extern crate libc;
 
 #[cfg(all(target_os = "win32", target_arch = "x86"))]
index 33dc1ba07ca86e63cd26fa2d8ce99d3d0e9f232c..8d7b1c3bd83932dbaab824ac5752d1ca87f64d1e 100644 (file)
@@ -246,6 +246,7 @@ These two basic iterators should serve you well. There are some more
 advanced iterators, including ones that are infinite. Like `count`:
 
 ```rust
+# #![feature(core)]
 std::iter::count(1, 5);
 ```
 
@@ -294,6 +295,7 @@ has no side effect on the original iterator. Let's try it out with our infinite
 iterator from before, `count()`:
 
 ```rust
+# #![feature(core)]
 for i in std::iter::count(1, 5).take(5) {
     println!("{}", i);
 }
index 0ca42c3b12db2d4282bfaae449ee6508b8357b0c..8cb16f7ab33406422659b3d3a57eb82a7de220ec 100644 (file)
@@ -23,6 +23,7 @@ the ability to use this *method call syntax* via the `impl` keyword.
 Here's how it works:
 
 ```{rust}
+# #![feature(core)]
 struct Circle {
     x: f64,
     y: f64,
@@ -87,6 +88,7 @@ original example, `foo.bar().baz()`? This is called 'method chaining', and we
 can do it by returning `self`.
 
 ```
+# #![feature(core)]
 struct Circle {
     x: f64,
     y: f64,
@@ -164,6 +166,7 @@ have method overloading, named arguments, or variable arguments. We employ
 the builder pattern instead. It looks like this:
 
 ```
+# #![feature(core)]
 struct Circle {
     x: f64,
     y: f64,
index 6567cd448f998611ee7bdaecc9a8067fddec7921..c46f84caa860cbcd681f4019634eadaeddbd433b 100644 (file)
@@ -12,7 +12,7 @@ Additionally, strings are not null-terminated and can contain null bytes.
 
 Rust has two main types of strings: `&str` and `String`.
 
-# &str
+# `&str`
 
 The first kind is a `&str`. This is pronounced a 'string slice'.
 String literals are of the type `&str`:
@@ -36,7 +36,36 @@ Like vector slices, string slices are simply a pointer plus a length. This
 means that they're a 'view' into an already-allocated string, such as a
 string literal or a `String`.
 
-# String
+## `str`
+
+You may occasionally see references to a `str` type, without the `&`. While
+this type does exist, it’s not something you want to use yourself. Sometimes,
+people confuse `str` for `String`, and write this:
+
+```rust
+struct S {
+    s: str,
+}
+```
+
+This leads to ugly errors:
+
+```text
+error: the trait `core::marker::Sized` is not implemented for the type `str` [E0277]
+note: `str` does not have a constant size known at compile-time
+```
+
+Instead, this `struct` should be
+
+```rust
+struct S {
+    s: String,
+}
+```
+
+So let’s talk about `String`s.
+
+# `String`
 
 A `String` is a heap-allocated string. This string is growable, and is
 also guaranteed to be UTF-8. `String`s are commonly created by
@@ -148,6 +177,7 @@ Rust provides iterators for each of these situations:
 Usually, the `graphemes()` method on `&str` is what you want:
 
 ```
+# #![feature(unicode)]
 let s = "u͔n͈̰̎i̙̮͚̦c͚̉o̼̩̰͗d͔̆̓ͥé";
 
 for l in s.graphemes(true) {
index 6aced23ede08effc8c9f3f01b5c110cb5e6a421a..b851f19d22dc39327da7ad296619121c8e5faa7c 100644 (file)
@@ -513,8 +513,8 @@ Otherwise, it is an error to elide an output lifetime.
 
 ### Examples
 
-Here are some examples of functions with elided lifetimes, and the version of
-what the elided lifetimes are expand to:
+Here are some examples of functions with elided lifetimes.  We've paired each
+example of an elided lifetime with its expanded form.
 
 ```{rust,ignore}
 fn print(s: &str); // elided
index 39106aaf85751c3efeb31b2ce6ebf8357a302879..bd9b449fc087e7db4c0aab4b0cba53656063f2a2 100644 (file)
@@ -498,13 +498,10 @@ they go out of scope:
 However, boxes do _not_ use reference counting or garbage collection. Boxes are
 what's called an *affine type*. This means that the Rust compiler, at compile
 time, determines when the box comes into and goes out of scope, and inserts the
-appropriate calls there. Furthermore, boxes are a specific kind of affine type,
-known as a *region*. You can read more about regions [in this paper on the
-Cyclone programming
-language](http://www.cs.umd.edu/projects/cyclone/papers/cyclone-regions.pdf).
+appropriate calls there.
 
-You don't need to fully grok the theory of affine types or regions to grok
-boxes, though. As a rough approximation, you can treat this Rust code:
+You don't need to fully grok the theory of affine types to grok boxes, though.
+As a rough approximation, you can treat this Rust code:
 
 ```{rust}
 {
index 794b1df7563de7cde12943cf122762f1265806e5..a296e1311e6d16472e1df9427dfee03c8971fec1 100644 (file)
@@ -5,7 +5,7 @@ we haven't seen before. Here's a simple program that reads some input,
 and then prints it back out:
 
 ```{rust,ignore}
-fn main() {
+corefn main() {
     println!("Type something!");
 
     let input = std::old_io::stdin().read_line().ok().expect("Failed to read line");
@@ -28,6 +28,7 @@ Since writing the fully qualified name all the time is annoying, we can use
 the `use` statement to import it in:
 
 ```{rust}
+# #![feature(old_io)]
 use std::old_io::stdin;
 
 stdin();
@@ -37,6 +38,7 @@ However, it's considered better practice to not import individual functions, but
 to import the module, and only use one level of qualification:
 
 ```{rust}
+# #![feature(old_io)]
 use std::old_io;
 
 old_io::stdin();
@@ -115,8 +117,9 @@ doesn't work, so we're okay with that. In most cases, we would want to handle
 the error case explicitly. `expect()` allows us to give an error message if
 this crash happens.
 
-We will cover the exact details of how all of this works later in the Guide.
-For now, this gives you enough of a basic understanding to work with.
+We will cover the exact details of how all of this works later in the Guide in
+[Error Handling]. For now, this gives you enough of a basic understanding to
+work with.
 
 Back to the code we were working on! Here's a refresher:
 
@@ -157,3 +160,6 @@ here.
 
 That's all you need to get basic input from the standard input! It's not too
 complicated, but there are a number of small parts.
+
+
+[Error Handling]: ./error-handling.html
index 72e9ec9f7509ad9ccab80dba6298a07d30f7c8cf..8fb08e1c6cfdea4f529e051e98cdd66b3e1b169f 100644 (file)
@@ -546,6 +546,8 @@ is an opaque "black box" to the optimizer and so forces it to consider any
 argument as used.
 
 ```rust
+# #![feature(test)]
+
 extern crate test;
 
 # fn main() {
index 676f1cc425ad4f3962487eb0ccc747b02e1bde63..fe26fc5e1eb200a71cd45f74b8c826dfb7f7a573 100644 (file)
@@ -4,6 +4,7 @@ Do you remember the `impl` keyword, used to call a function with method
 syntax?
 
 ```{rust}
+# #![feature(core)]
 struct Circle {
     x: f64,
     y: f64,
@@ -21,6 +22,7 @@ Traits are similar, except that we define a trait with just the method
 signature, then implement the trait for that struct. Like this:
 
 ```{rust}
+# #![feature(core)]
 struct Circle {
     x: f64,
     y: f64,
@@ -84,6 +86,7 @@ which implements `HasArea` will have an `.area()` method.
 Here's an extended example of how this works:
 
 ```{rust}
+# #![feature(core)]
 trait HasArea {
     fn area(&self) -> f64;
 }
@@ -225,6 +228,7 @@ If we add a `use` line right above `main` and make the right things public,
 everything is fine:
 
 ```{rust}
+# #![feature(core)]
 use shapes::HasArea;
 
 mod shapes {
@@ -408,6 +412,7 @@ but instead, we found a floating-point variable. We need a different bound. `Flo
 to the rescue:
 
 ```
+# #![feature(std_misc)]
 use std::num::Float;
 
 fn inverse<T: Float>(x: T) -> Result<T, String> {
@@ -423,6 +428,7 @@ from the `Float` trait. Both `f32` and `f64` implement `Float`, so our function
 works just fine:
 
 ```
+# #![feature(std_misc)]
 # use std::num::Float;
 # fn inverse<T: Float>(x: T) -> Result<T, String> {
 #     if x == Float::zero() { return Err("x cannot be zero!".to_string()) }
index 11f0b8e1ddbf96df73378f4169fae121551fea85..2116976d55a4d56764bad679633c3cbb27d14533 100644 (file)
@@ -187,6 +187,7 @@ As an example, we give a reimplementation of owned boxes by wrapping
 reimplementation is as safe as the `Box` type.
 
 ```
+# #![feature(libc)]
 #![feature(unsafe_destructor)]
 
 extern crate libc;
@@ -443,6 +444,7 @@ The function marked `#[start]` is passed the command line parameters
 in the same format as C:
 
 ```
+# #![feature(libc)]
 #![feature(lang_items, start, no_std)]
 #![no_std]
 
@@ -470,6 +472,7 @@ correct ABI and the correct name, which requires overriding the
 compiler's name mangling too:
 
 ```ignore
+# #![feature(libc)]
 #![feature(no_std)]
 #![no_std]
 #![no_main]
@@ -526,6 +529,7 @@ As an example, here is a program that will calculate the dot product of two
 vectors provided from C, using idiomatic Rust practices.
 
 ```
+# #![feature(libc, core)]
 #![feature(lang_items, start, no_std)]
 #![no_std]
 
@@ -650,6 +654,7 @@ and one for deallocation. A freestanding program that uses the `Box`
 sugar for dynamic allocations via `malloc` and `free`:
 
 ```
+# #![feature(libc)]
 #![feature(lang_items, box_syntax, start, no_std)]
 #![no_std]
 
index 2bf919d7e2cce794e2378feb49cda5cfd2c31907..249b5d22b6b23ad763df4d8a586abb33ae82cc79 100644 (file)
@@ -165,6 +165,16 @@ void posix88_consts() {
   put_const(S_IWUSR, int);
   put_const(S_IRUSR, int);
 
+  put_const(S_IRWXG, int);
+  put_const(S_IXGRP, int);
+  put_const(S_IWGRP, int);
+  put_const(S_IRGRP, int);
+
+  put_const(S_IRWXO, int);
+  put_const(S_IXOTH, int);
+  put_const(S_IWOTH, int);
+  put_const(S_IROTH, int);
+
 #ifdef F_OK
   put_const(F_OK, int);
 #endif
index 8528be2860cca2624f820c46349daaf942ac4445..c9bbc0d74cddc8d745dedf6c2382767e0ceacbd8 100644 (file)
@@ -95,6 +95,7 @@
 /// task.
 ///
 /// ```
+/// # #![feature(alloc, core)]
 /// use std::sync::Arc;
 /// use std::thread;
 ///
@@ -127,8 +128,8 @@ unsafe impl<T: Sync + Send> Sync for Arc<T> { }
 
 /// A weak pointer to an `Arc`.
 ///
-/// Weak pointers will not keep the data inside of the `Arc` alive, and can be used to break cycles
-/// between `Arc` pointers.
+/// Weak pointers will not keep the data inside of the `Arc` alive, and can be
+/// used to break cycles between `Arc` pointers.
 #[unsafe_no_drop_flag]
 #[unstable(feature = "alloc",
            reason = "Weak pointers may not belong in this module.")]
@@ -185,6 +186,7 @@ pub fn new(data: T) -> Arc<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// let five = Arc::new(5);
@@ -216,8 +218,8 @@ fn inner(&self) -> &ArcInner<T> {
     unsafe fn drop_slow(&mut self) {
         let ptr = *self._ptr;
 
-        // Destroy the data at this time, even though we may not free the box allocation itself
-        // (there may still be weak pointers lying around).
+        // Destroy the data at this time, even though we may not free the box
+        // allocation itself (there may still be weak pointers lying around).
         drop(ptr::read(&self.inner().data));
 
         if self.inner().weak.fetch_sub(1, Release) == 1 {
@@ -246,6 +248,7 @@ impl<T> Clone for Arc<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// let five = Arc::new(5);
@@ -283,12 +286,13 @@ fn deref(&self) -> &T {
 impl<T: Send + Sync + Clone> Arc<T> {
     /// Make a mutable reference from the given `Arc<T>`.
     ///
-    /// This is also referred to as a copy-on-write operation because the inner data is cloned if
-    /// the reference count is greater than one.
+    /// This is also referred to as a copy-on-write operation because the inner
+    /// data is cloned if the reference count is greater than one.
     ///
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// let mut five = Arc::new(5);
@@ -298,16 +302,18 @@ impl<T: Send + Sync + Clone> Arc<T> {
     #[inline]
     #[unstable(feature = "alloc")]
     pub fn make_unique(&mut self) -> &mut T {
-        // Note that we hold a strong reference, which also counts as a weak reference, so we only
-        // clone if there is an additional reference of either kind.
+        // Note that we hold a strong reference, which also counts as a weak
+        // reference, so we only clone if there is an additional reference of
+        // either kind.
         if self.inner().strong.load(SeqCst) != 1 ||
            self.inner().weak.load(SeqCst) != 1 {
             *self = Arc::new((**self).clone())
         }
-        // This unsafety is ok because we're guaranteed that the pointer returned is the *only*
-        // pointer that will ever be returned to T. Our reference count is guaranteed to be 1 at
-        // this point, and we required the Arc itself to be `mut`, so we're returning the only
-        // possible reference to the inner data.
+        // This unsafety is ok because we're guaranteed that the pointer
+        // returned is the *only* pointer that will ever be returned to T. Our
+        // reference count is guaranteed to be 1 at this point, and we required
+        // the Arc itself to be `mut`, so we're returning the only possible
+        // reference to the inner data.
         let inner = unsafe { &mut **self._ptr };
         &mut inner.data
     }
@@ -318,12 +324,14 @@ pub fn make_unique(&mut self) -> &mut T {
 impl<T: Sync + Send> Drop for Arc<T> {
     /// Drops the `Arc<T>`.
     ///
-    /// This will decrement the strong reference count. If the strong reference count becomes zero
-    /// and the only other references are `Weak<T>` ones, `drop`s the inner value.
+    /// This will decrement the strong reference count. If the strong reference
+    /// count becomes zero and the only other references are `Weak<T>` ones,
+    /// `drop`s the inner value.
     ///
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// {
@@ -342,29 +350,32 @@ impl<T: Sync + Send> Drop for Arc<T> {
     /// ```
     #[inline]
     fn drop(&mut self) {
-        // This structure has #[unsafe_no_drop_flag], so this drop glue may run more than once (but
-        // it is guaranteed to be zeroed after the first if it's run more than once)
+        // This structure has #[unsafe_no_drop_flag], so this drop glue may run
+        // more than once (but it is guaranteed to be zeroed after the first if
+        // it's run more than once)
         let ptr = *self._ptr;
         if ptr.is_null() { return }
 
-        // Because `fetch_sub` is already atomic, we do not need to synchronize with other threads
-        // unless we are going to delete the object. This same logic applies to the below
-        // `fetch_sub` to the `weak` count.
+        // Because `fetch_sub` is already atomic, we do not need to synchronize
+        // with other threads unless we are going to delete the object. This
+        // same logic applies to the below `fetch_sub` to the `weak` count.
         if self.inner().strong.fetch_sub(1, Release) != 1 { return }
 
-        // This fence is needed to prevent reordering of use of the data and deletion of the data.
-        // Because it is marked `Release`, the decreasing of the reference count synchronizes with
-        // this `Acquire` fence. This means that use of the data happens before decreasing the
-        // reference count, which happens before this fence, which happens before the deletion of
-        // the data.
+        // This fence is needed to prevent reordering of use of the data and
+        // deletion of the data.  Because it is marked `Release`, the decreasing
+        // of the reference count synchronizes with this `Acquire` fence. This
+        // means that use of the data happens before decreasing the reference
+        // count, which happens before this fence, which happens before the
+        // deletion of the data.
         //
         // As explained in the [Boost documentation][1],
         //
-        // > It is important to enforce any possible access to the object in one thread (through an
-        // > existing reference) to *happen before* deleting the object in a different thread. This
-        // > is achieved by a "release" operation after dropping a reference (any access to the
-        // > object through this reference must obviously happened before), and an "acquire"
-        // > operation before deleting the object.
+        // > It is important to enforce any possible access to the object in one
+        // > thread (through an existing reference) to *happen before* deleting
+        // > the object in a different thread. This is achieved by a "release"
+        // > operation after dropping a reference (any access to the object
+        // > through this reference must obviously happened before), and an
+        // > "acquire" operation before deleting the object.
         //
         // [1]: (www.boost.org/doc/libs/1_55_0/doc/html/atomic/usage_examples.html)
         atomic::fence(Acquire);
@@ -382,11 +393,13 @@ impl<T: Sync + Send> Weak<T> {
     ///
     /// Upgrades the `Weak<T>` reference to an `Arc<T>`, if possible.
     ///
-    /// Returns `None` if there were no strong references and the data was destroyed.
+    /// Returns `None` if there were no strong references and the data was
+    /// destroyed.
     ///
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// let five = Arc::new(5);
@@ -396,8 +409,8 @@ impl<T: Sync + Send> Weak<T> {
     /// let strong_five: Option<Arc<_>> = weak_five.upgrade();
     /// ```
     pub fn upgrade(&self) -> Option<Arc<T>> {
-        // We use a CAS loop to increment the strong count instead of a fetch_add because once the
-        // count hits 0 is must never be above 0.
+        // We use a CAS loop to increment the strong count instead of a
+        // fetch_add because once the count hits 0 is must never be above 0.
         let inner = self.inner();
         loop {
             let n = inner.strong.load(SeqCst);
@@ -424,6 +437,7 @@ impl<T: Sync + Send> Clone for Weak<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// let weak_five = Arc::new(5).downgrade();
@@ -448,6 +462,7 @@ impl<T: Sync + Send> Drop for Weak<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::sync::Arc;
     ///
     /// {
@@ -472,8 +487,9 @@ fn drop(&mut self) {
         // see comments above for why this check is here
         if ptr.is_null() { return }
 
-        // If we find out that we were the last weak pointer, then its time to deallocate the data
-        // entirely. See the discussion in Arc::drop() about the memory orderings
+        // If we find out that we were the last weak pointer, then its time to
+        // deallocate the data entirely. See the discussion in Arc::drop() about
+        // the memory orderings
         if self.inner().weak.fetch_sub(1, Release) == 1 {
             atomic::fence(Acquire);
             unsafe { deallocate(ptr as *mut u8, size_of::<ArcInner<T>>(),
index 6bdfe2b15516751a6ab860bc74962db9949f943d..8b18fbf554a4cad6218fb0bf99b79135c637aa1b 100644 (file)
@@ -65,6 +65,7 @@
 /// The following two examples are equivalent:
 ///
 /// ```
+/// # #![feature(alloc)]
 /// #![feature(box_syntax)]
 /// use std::boxed::HEAP;
 ///
@@ -135,6 +136,7 @@ pub unsafe fn from_raw(raw: *mut T) -> Self {
 ///
 /// # Examples
 /// ```
+/// # #![feature(alloc)]
 /// use std::boxed;
 ///
 /// let seventeen = Box::new(17u32);
@@ -178,6 +180,7 @@ fn clone(&self) -> Box<T> { box {(**self).clone()} }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc, core)]
     /// let x = Box::new(5);
     /// let mut y = Box::new(10);
     ///
index aaf6e76237ca5669b7d6266f4b4ff853ed7dfec0..3733350412e499a8c4d3623cf6fea8aeea403bc6 100644 (file)
@@ -26,6 +26,9 @@ pub unsafe fn allocate(size: usize, align: usize) -> *mut u8 {
 ///
 /// On failure, return a null pointer and leave the original allocation intact.
 ///
+/// If the allocation was relocated, the memory at the passed-in pointer is
+/// undefined after the call.
+///
 /// Behavior is undefined if the requested size is 0 or the alignment is not a
 /// power of 2. The alignment must be no larger than the largest supported page
 /// size on the platform.
index 34c0686fe37ae866698cf29db2465410a2729868..541de2d37fbe0cf68f47a6c51d6c9df8e96a2203 100644 (file)
@@ -66,6 +66,7 @@
 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
        html_root_url = "http://doc.rust-lang.org/nightly/")]
+#![doc(test(no_crate_inject))]
 
 #![feature(no_std)]
 #![no_std]
index 855235e89c880041b1510fbf1243191d0074408d..eb3c5c167268bfe143f68dbef5fb449e6443b8b9 100644 (file)
@@ -32,6 +32,7 @@
 //! and have the `Owner` remain allocated as long as any `Gadget` points at it.
 //!
 //! ```rust
+//! # #![feature(alloc, collections)]
 //! use std::rc::Rc;
 //!
 //! struct Owner {
 //!
 //!     drop(gadget_owner);
 //!
-//!     // Despite dropping gadget_owner, we're still able to print out the name of
-//!     // the Owner of the Gadgets. This is because we've only dropped the
+//!     // Despite dropping gadget_owner, we're still able to print out the name
+//!     // of the Owner of the Gadgets. This is because we've only dropped the
 //!     // reference count object, not the Owner it wraps. As long as there are
-//!     // other `Rc<T>` objects pointing at the same Owner, it will remain allocated. Notice
-//!     // that the `Rc<T>` wrapper around Gadget.owner gets automatically dereferenced
-//!     // for us.
+//!     // other `Rc<T>` objects pointing at the same Owner, it will remain
+//!     // allocated. Notice that the `Rc<T>` wrapper around Gadget.owner gets
+//!     // automatically dereferenced for us.
 //!     println!("Gadget {} owned by {}", gadget1.id, gadget1.owner.name);
 //!     println!("Gadget {} owned by {}", gadget2.id, gadget2.owner.name);
 //!
 //! }
 //! ```
 //!
-//! If our requirements change, and we also need to be able to traverse from Owner → Gadget, we
-//! will run into problems: an `Rc<T>` pointer from Owner → Gadget introduces a cycle between the
-//! objects. This means that their reference counts can never reach 0, and the objects will remain
-//! allocated: a memory leak. In order to get around this, we can use `Weak<T>` pointers. These
-//! pointers don't contribute to the total count.
+//! If our requirements change, and we also need to be able to traverse from
+//! Owner → Gadget, we will run into problems: an `Rc<T>` pointer from Owner
+//! → Gadget introduces a cycle between the objects. This means that their
+//! reference counts can never reach 0, and the objects will remain allocated: a
+//! memory leak. In order to get around this, we can use `Weak<T>` pointers.
+//! These pointers don't contribute to the total count.
 //!
-//! Rust actually makes it somewhat difficult to produce this loop in the first place: in order to
-//! end up with two objects that point at each other, one of them needs to be mutable. This is
-//! problematic because `Rc<T>` enforces memory safety by only giving out shared references to the
-//! object it wraps, and these don't allow direct mutation. We need to wrap the part of the object
-//! we wish to mutate in a `RefCell`, which provides *interior mutability*: a method to achieve
-//! mutability through a shared reference. `RefCell` enforces Rust's borrowing rules at runtime.
-//! Read the `Cell` documentation for more details on interior mutability.
+//! Rust actually makes it somewhat difficult to produce this loop in the first
+//! place: in order to end up with two objects that point at each other, one of
+//! them needs to be mutable. This is problematic because `Rc<T>` enforces
+//! memory safety by only giving out shared references to the object it wraps,
+//! and these don't allow direct mutation. We need to wrap the part of the
+//! object we wish to mutate in a `RefCell`, which provides *interior
+//! mutability*: a method to achieve mutability through a shared reference.
+//! `RefCell` enforces Rust's borrowing rules at runtime.  Read the `Cell`
+//! documentation for more details on interior mutability.
 //!
 //! ```rust
+//! # #![feature(alloc)]
 //! use std::rc::Rc;
 //! use std::rc::Weak;
 //! use std::cell::RefCell;
 //!     for gadget_opt in gadget_owner.gadgets.borrow().iter() {
 //!
 //!         // gadget_opt is a Weak<Gadget>. Since weak pointers can't guarantee
-//!         // that their object is still allocated, we need to call upgrade() on them
-//!         // to turn them into a strong reference. This returns an Option, which
-//!         // contains a reference to our object if it still exists.
+//!         // that their object is still allocated, we need to call upgrade()
+//!         // on them to turn them into a strong reference. This returns an
+//!         // Option, which contains a reference to our object if it still
+//!         // exists.
 //!         let gadget = gadget_opt.upgrade().unwrap();
 //!         println!("Gadget {} owned by {}", gadget.id, gadget.owner.name);
 //!     }
@@ -178,8 +184,8 @@ struct RcBox<T> {
 #[unsafe_no_drop_flag]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct Rc<T> {
-    // FIXME #12808: strange names to try to avoid interfering with field accesses of the contained
-    // type via Deref
+    // FIXME #12808: strange names to try to avoid interfering with field
+    // accesses of the contained type via Deref
     _ptr: NonZero<*mut RcBox<T>>,
 }
 
@@ -201,9 +207,10 @@ impl<T> Rc<T> {
     pub fn new(value: T) -> Rc<T> {
         unsafe {
             Rc {
-                // there is an implicit weak pointer owned by all the strong pointers, which
-                // ensures that the weak destructor never frees the allocation while the strong
-                // destructor is running, even if the weak pointer is stored inside the strong one.
+                // there is an implicit weak pointer owned by all the strong
+                // pointers, which ensures that the weak destructor never frees
+                // the allocation while the strong destructor is running, even
+                // if the weak pointer is stored inside the strong one.
                 _ptr: NonZero::new(boxed::into_raw(box RcBox {
                     value: value,
                     strong: Cell::new(1),
@@ -218,6 +225,7 @@ pub fn new(value: T) -> Rc<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// let five = Rc::new(5);
@@ -242,11 +250,13 @@ pub fn weak_count<T>(this: &Rc<T>) -> usize { this.weak() - 1 }
 #[unstable(feature = "alloc")]
 pub fn strong_count<T>(this: &Rc<T>) -> usize { this.strong() }
 
-/// Returns true if there are no other `Rc` or `Weak<T>` values that share the same inner value.
+/// Returns true if there are no other `Rc` or `Weak<T>` values that share the
+/// same inner value.
 ///
 /// # Examples
 ///
 /// ```
+/// # #![feature(alloc)]
 /// use std::rc;
 /// use std::rc::Rc;
 ///
@@ -267,6 +277,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
 /// # Examples
 ///
 /// ```
+/// # #![feature(alloc)]
 /// use std::rc::{self, Rc};
 ///
 /// let x = Rc::new(3);
@@ -301,6 +312,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(alloc)]
 /// use std::rc::{self, Rc};
 ///
 /// let mut x = Rc::new(3);
@@ -324,12 +336,13 @@ pub fn get_mut<'a, T>(rc: &'a mut Rc<T>) -> Option<&'a mut T> {
 impl<T: Clone> Rc<T> {
     /// Make a mutable reference from the given `Rc<T>`.
     ///
-    /// This is also referred to as a copy-on-write operation because the inner data is cloned if
-    /// the reference count is greater than one.
+    /// This is also referred to as a copy-on-write operation because the inner
+    /// data is cloned if the reference count is greater than one.
     ///
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// let mut five = Rc::new(5);
@@ -342,10 +355,11 @@ pub fn make_unique(&mut self) -> &mut T {
         if !is_unique(self) {
             *self = Rc::new((**self).clone())
         }
-        // This unsafety is ok because we're guaranteed that the pointer returned is the *only*
-        // pointer that will ever be returned to T. Our reference count is guaranteed to be 1 at
-        // this point, and we required the `Rc<T>` itself to be `mut`, so we're returning the only
-        // possible reference to the inner value.
+        // This unsafety is ok because we're guaranteed that the pointer
+        // returned is the *only* pointer that will ever be returned to T. Our
+        // reference count is guaranteed to be 1 at this point, and we required
+        // the `Rc<T>` itself to be `mut`, so we're returning the only possible
+        // reference to the inner value.
         let inner = unsafe { &mut **self._ptr };
         &mut inner.value
     }
@@ -366,12 +380,14 @@ fn deref(&self) -> &T {
 impl<T> Drop for Rc<T> {
     /// Drops the `Rc<T>`.
     ///
-    /// This will decrement the strong reference count. If the strong reference count becomes zero
-    /// and the only other references are `Weak<T>` ones, `drop`s the inner value.
+    /// This will decrement the strong reference count. If the strong reference
+    /// count becomes zero and the only other references are `Weak<T>` ones,
+    /// `drop`s the inner value.
     ///
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// {
@@ -396,8 +412,8 @@ fn drop(&mut self) {
                 if self.strong() == 0 {
                     ptr::read(&**self); // destroy the contained object
 
-                    // remove the implicit "strong weak" pointer now that we've destroyed the
-                    // contents.
+                    // remove the implicit "strong weak" pointer now that we've
+                    // destroyed the contents.
                     self.dec_weak();
 
                     if self.weak() == 0 {
@@ -420,6 +436,7 @@ impl<T> Clone for Rc<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// let five = Rc::new(5);
@@ -618,7 +635,8 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 
 /// A weak version of `Rc<T>`.
 ///
-/// Weak references do not count when determining if the inner value should be dropped.
+/// Weak references do not count when determining if the inner value should be
+/// dropped.
 ///
 /// See the [module level documentation](./index.html) for more.
 #[unsafe_no_drop_flag]
@@ -643,11 +661,13 @@ impl<T> Weak<T> {
     ///
     /// Upgrades the `Weak<T>` reference to an `Rc<T>`, if possible.
     ///
-    /// Returns `None` if there were no strong references and the data was destroyed.
+    /// Returns `None` if there were no strong references and the data was
+    /// destroyed.
     ///
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// let five = Rc::new(5);
@@ -676,6 +696,7 @@ impl<T> Drop for Weak<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// {
@@ -699,8 +720,8 @@ fn drop(&mut self) {
             let ptr = *self._ptr;
             if !ptr.is_null() {
                 self.dec_weak();
-                // the weak count starts at 1, and will only go to zero if all the strong pointers
-                // have disappeared.
+                // the weak count starts at 1, and will only go to zero if all
+                // the strong pointers have disappeared.
                 if self.weak() == 0 {
                     deallocate(ptr as *mut u8, size_of::<RcBox<T>>(),
                                min_align_of::<RcBox<T>>())
@@ -721,6 +742,7 @@ impl<T> Clone for Weak<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(alloc)]
     /// use std::rc::Rc;
     ///
     /// let weak_five = Rc::new(5).downgrade();
index 1b0356b88b08dcdb9e3bf1a386f67052170b22f1..7843be0b483ebd8750e7eab20e73ae1014ea04b7 100644 (file)
@@ -429,7 +429,8 @@ unsafe fn destroy(&mut self, len: usize) {
         // Destroy the next chunk.
         let next = self.next;
         let size = calculate_size::<T>(self.capacity);
-        deallocate(self as *mut TypedArenaChunk<T> as *mut u8, size,
+        let self_ptr: *mut TypedArenaChunk<T> = self;
+        deallocate(self_ptr as *mut u8, size,
                    mem::min_align_of::<TypedArenaChunk<T>>());
         if !next.is_null() {
             let capacity = (*next).capacity;
index 11c8656c994b29da5771ed3bf58e3f445aa82314..6edee82dc30afe6e5d26ef498761197a9fb15739 100644 (file)
@@ -216,6 +216,7 @@ pub fn with_capacity(capacity: usize) -> BinaryHeap<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BinaryHeap;
     /// let heap = BinaryHeap::from_vec(vec![9, 1, 2, 7, 3, 2]);
     /// ```
@@ -235,6 +236,7 @@ pub fn from_vec(vec: Vec<T>) -> BinaryHeap<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BinaryHeap;
     /// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4]);
     ///
@@ -255,6 +257,7 @@ pub fn iter(&self) -> Iter<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BinaryHeap;
     /// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4]);
     ///
@@ -360,6 +363,7 @@ pub fn shrink_to_fit(&mut self) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::from_vec(vec![1, 3]);
     ///
@@ -405,6 +409,7 @@ pub fn push(&mut self, item: T) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::new();
     /// heap.push(1);
@@ -436,6 +441,7 @@ pub fn push_pop(&mut self, mut item: T) -> T {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BinaryHeap;
     /// let mut heap = BinaryHeap::new();
     ///
@@ -461,6 +467,7 @@ pub fn replace(&mut self, mut item: T) -> Option<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BinaryHeap;
     /// let heap = BinaryHeap::from_vec(vec![1, 2, 3, 4, 5, 6, 7]);
     /// let vec = heap.into_vec();
@@ -478,6 +485,7 @@ pub fn into_vec(self) -> Vec<T> { self.data }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BinaryHeap;
     ///
     /// let mut heap = BinaryHeap::from_vec(vec![1, 2, 4, 5, 7]);
index 90fbe04d3482f9f73fbcea9d4c1d90bea4cb4207..377b52a3dbe292d4380c10816327493f3480e5f4 100644 (file)
@@ -38,6 +38,7 @@
 //! [sieve]: http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
 //!
 //! ```
+//! # #![feature(collections, core)]
 //! use std::collections::{BitSet, BitVec};
 //! use std::num::Float;
 //! use std::iter;
@@ -134,6 +135,7 @@ fn match_words <'a,'b>(a: &'a BitVec, b: &'b BitVec) -> (MatchWords<'a>, MatchWo
 /// # Examples
 ///
 /// ```
+/// # #![feature(collections)]
 /// use std::collections::BitVec;
 ///
 /// let mut bv = BitVec::from_elem(10, false);
@@ -169,6 +171,8 @@ pub struct BitVec {
 impl Index<usize> for BitVec {
     type Output = bool;
 
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, i: &usize) -> &bool {
         if self.get(*i).expect("index out of bounds") {
@@ -177,6 +181,16 @@ fn index(&self, i: &usize) -> &bool {
             &FALSE
         }
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, i: usize) -> &bool {
+        if self.get(i).expect("index out of bounds") {
+            &TRUE
+        } else {
+            &FALSE
+        }
+    }
 }
 
 /// Computes how many blocks are needed to store that many bits
@@ -250,6 +264,7 @@ fn fix_last_block(&mut self) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     /// let mut bv = BitVec::new();
     /// ```
@@ -264,6 +279,7 @@ pub fn new() -> BitVec {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::from_elem(10, false);
@@ -304,6 +320,7 @@ pub fn with_capacity(nbits: usize) -> BitVec {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let bv = BitVec::from_bytes(&[0b10100000, 0b00010010]);
@@ -346,6 +363,7 @@ pub fn from_bytes(bytes: &[u8]) -> BitVec {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let bv = BitVec::from_fn(5, |i| { i % 2 == 0 });
@@ -364,6 +382,7 @@ pub fn from_fn<F>(len: usize, mut f: F) -> BitVec where F: FnMut(usize) -> bool
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let bv = BitVec::from_bytes(&[0b01100000]);
@@ -396,6 +415,7 @@ pub fn get(&self, i: usize) -> Option<bool> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::from_elem(5, false);
@@ -420,6 +440,7 @@ pub fn set(&mut self, i: usize, x: bool) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let before = 0b01100000;
@@ -440,6 +461,7 @@ pub fn set_all(&mut self) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let before = 0b01100000;
@@ -468,6 +490,7 @@ pub fn negate(&mut self) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let a   = 0b01100100;
@@ -498,6 +521,7 @@ pub fn union(&mut self, other: &BitVec) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let a   = 0b01100100;
@@ -528,6 +552,7 @@ pub fn intersect(&mut self, other: &BitVec) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let a   = 0b01100100;
@@ -557,6 +582,7 @@ pub fn difference(&mut self, other: &BitVec) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::from_elem(5, true);
@@ -581,6 +607,7 @@ pub fn all(&self) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let bv = BitVec::from_bytes(&[0b01110100, 0b10010010]);
@@ -597,6 +624,7 @@ pub fn iter(&self) -> Iter {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::from_elem(10, false);
@@ -614,6 +642,7 @@ pub fn none(&self) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::from_elem(10, false);
@@ -635,6 +664,7 @@ pub fn any(&self) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::from_elem(3, true);
@@ -682,6 +712,7 @@ fn bit(bit_vec: &BitVec, byte: usize, bit: usize) -> u8 {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let bv = BitVec::from_bytes(&[0b10100000]);
@@ -702,6 +733,7 @@ pub fn eq_vec(&self, v: &[bool]) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::from_bytes(&[0b01001011]);
@@ -728,6 +760,7 @@ pub fn truncate(&mut self, len: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::from_elem(3, false);
@@ -758,6 +791,7 @@ pub fn reserve(&mut self, additional: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::from_elem(3, false);
@@ -780,6 +814,7 @@ pub fn reserve_exact(&mut self, additional: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::new();
@@ -801,6 +836,7 @@ pub fn capacity(&self) -> usize {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::from_bytes(&[0b01001011]);
@@ -851,6 +887,7 @@ pub fn grow(&mut self, n: usize, value: bool) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::from_bytes(&[0b01001001]);
@@ -881,6 +918,7 @@ pub fn pop(&mut self) -> Option<bool> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitVec;
     ///
     /// let mut bv = BitVec::new();
@@ -1091,6 +1129,7 @@ fn into_iter(self) -> Iter<'a> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(collections)]
 /// use std::collections::{BitSet, BitVec};
 ///
 /// // It's a regular set
@@ -1187,6 +1226,7 @@ impl BitSet {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitSet;
     ///
     /// let mut s = BitSet::new();
@@ -1203,6 +1243,7 @@ pub fn new() -> BitSet {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitSet;
     ///
     /// let mut s = BitSet::with_capacity(100);
@@ -1220,6 +1261,7 @@ pub fn with_capacity(nbits: usize) -> BitSet {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::{BitVec, BitSet};
     ///
     /// let bv = BitVec::from_bytes(&[0b01100000]);
@@ -1249,6 +1291,7 @@ pub fn from_bitv(bit_vec: BitVec) -> BitSet {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitSet;
     ///
     /// let mut s = BitSet::with_capacity(100);
@@ -1270,6 +1313,7 @@ pub fn capacity(&self) -> usize {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitSet;
     ///
     /// let mut s = BitSet::new();
@@ -1296,6 +1340,7 @@ pub fn reserve_len(&mut self, len: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitSet;
     ///
     /// let mut s = BitSet::new();
@@ -1316,6 +1361,7 @@ pub fn reserve_len_exact(&mut self, len: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitSet;
     ///
     /// let mut s = BitSet::new();
@@ -1336,6 +1382,7 @@ pub fn into_bit_vec(self) -> BitVec {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitSet;
     ///
     /// let mut s = BitSet::new();
@@ -1382,6 +1429,7 @@ fn other_op<F>(&mut self, other: &BitSet, mut f: F) where F: FnMut(u32, u32) ->
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BitSet;
     ///
     /// let mut s = BitSet::new();
@@ -1414,6 +1462,7 @@ pub fn shrink_to_fit(&mut self) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::{BitVec, BitSet};
     ///
     /// let s = BitSet::from_bit_vec(BitVec::from_bytes(&[0b01001010]));
@@ -1435,6 +1484,7 @@ pub fn iter(&self) -> bit_set::Iter {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::{BitVec, BitSet};
     ///
     /// let a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b01101000]));
@@ -1465,6 +1515,7 @@ fn or(w1: u32, w2: u32) -> u32 { w1 | w2 }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::{BitVec, BitSet};
     ///
     /// let a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b01101000]));
@@ -1495,6 +1546,7 @@ fn bitand(w1: u32, w2: u32) -> u32 { w1 & w2 }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::{BitSet, BitVec};
     ///
     /// let a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b01101000]));
@@ -1533,6 +1585,7 @@ fn diff(w1: u32, w2: u32) -> u32 { w1 & !w2 }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::{BitSet, BitVec};
     ///
     /// let a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b01101000]));
@@ -1562,6 +1615,7 @@ fn bitxor(w1: u32, w2: u32) -> u32 { w1 ^ w2 }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::{BitSet, BitVec};
     ///
     /// let a   = 0b01101000;
@@ -1585,6 +1639,7 @@ pub fn union_with(&mut self, other: &BitSet) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::{BitSet, BitVec};
     ///
     /// let a   = 0b01101000;
@@ -1609,6 +1664,7 @@ pub fn intersect_with(&mut self, other: &BitSet) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::{BitSet, BitVec};
     ///
     /// let a   = 0b01101000;
@@ -1641,6 +1697,7 @@ pub fn difference_with(&mut self, other: &BitSet) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::{BitSet, BitVec};
     ///
     /// let a   = 0b01101000;
@@ -1792,12 +1849,16 @@ struct TwoBitPositions<'a> {
     next_idx: usize
 }
 
+#[derive(Clone)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct Union<'a>(TwoBitPositions<'a>);
+#[derive(Clone)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct Intersection<'a>(Take<TwoBitPositions<'a>>);
+#[derive(Clone)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct Difference<'a>(TwoBitPositions<'a>);
+#[derive(Clone)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct SymmetricDifference<'a>(TwoBitPositions<'a>);
 
index 4bedbdeb368769a4b2565a184f4168ec85dfb0ec..88d59f699d183030c7c2f665ee3ecd2bd813813a 100644 (file)
@@ -14,6 +14,7 @@
 
 use core::clone::Clone;
 use core::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd};
+use core::convert::AsRef;
 use core::hash::{Hash, Hasher};
 use core::marker::Sized;
 use core::ops::Deref;
@@ -291,10 +292,9 @@ fn hash<H: Hasher>(&self, state: &mut H) {
 }
 
 /// Trait for moving into a `Cow`
-#[stable(feature = "rust1", since = "1.0.0")]
+#[unstable(feature = "into_cow", reason = "may be replaced by `convert::Into`")]
 pub trait IntoCow<'a, B: ?Sized> where B: ToOwned {
     /// Moves `self` into `Cow`
-    #[stable(feature = "rust1", since = "1.0.0")]
     fn into_cow(self) -> Cow<'a, B>;
 }
 
@@ -304,3 +304,10 @@ fn into_cow(self) -> Cow<'a, B> {
         self
     }
 }
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a, T: Clone> AsRef<T> for Cow<'a, T> {
+    fn as_ref(&self) -> &T {
+        self
+    }
+}
index a9e1ce8d7ce50db9a5c0b3c3a5c75b561c0ba754..c2f6fbc0b2602cb62c537c23d9c2eb3c9e3905c9 100644 (file)
@@ -78,6 +78,7 @@ pub struct BTreeMap<K, V> {
 }
 
 /// An abstract base over-which all other BTree iterators are built.
+#[derive(Clone)]
 struct AbsIter<T> {
     traversals: VecDeque<T>,
     size: usize,
@@ -124,26 +125,26 @@ pub struct RangeMut<'a, K: 'a, V: 'a> {
 }
 
 /// A view into a single entry in a map, which may either be vacant or occupied.
-#[unstable(feature = "collections",
-           reason = "precise API still under development")]
+#[stable(feature = "rust1", since = "1.0.0")]
 pub enum Entry<'a, K:'a, V:'a> {
     /// A vacant Entry
+    #[stable(feature = "rust1", since = "1.0.0")]
     Vacant(VacantEntry<'a, K, V>),
+
     /// An occupied Entry
+    #[stable(feature = "rust1", since = "1.0.0")]
     Occupied(OccupiedEntry<'a, K, V>),
 }
 
 /// A vacant Entry.
-#[unstable(feature = "collections",
-           reason = "precise API still under development")]
+#[stable(feature = "rust1", since = "1.0.0")]
 pub struct VacantEntry<'a, K:'a, V:'a> {
     key: K,
     stack: stack::SearchStack<'a, K, V, node::handle::Edge, node::handle::Leaf>,
 }
 
 /// An occupied Entry.
-#[unstable(feature = "collections",
-           reason = "precise API still under development")]
+#[stable(feature = "rust1", since = "1.0.0")]
 pub struct OccupiedEntry<'a, K:'a, V:'a> {
     stack: stack::SearchStack<'a, K, V, node::handle::KV, node::handle::LeafOrInternal>,
 }
@@ -264,7 +265,7 @@ pub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool where K: Borrow<Q>, Q: Or
     ///     Some(x) => *x = "b",
     ///     None => (),
     /// }
-    /// assert_eq!(map[1], "b");
+    /// assert_eq!(map[&1], "b");
     /// ```
     // See `get` for implementation notes, this is basically a copy-paste with mut's added
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -326,7 +327,7 @@ pub fn get_mut<Q: ?Sized>(&mut self, key: &Q) -> Option<&mut V> where K: Borrow<
     ///
     /// map.insert(37, "b");
     /// assert_eq!(map.insert(37, "c"), Some("b"));
-    /// assert_eq!(map[37], "c");
+    /// assert_eq!(map[&37], "c");
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn insert(&mut self, mut key: K, mut value: V) -> Option<V> {
@@ -914,12 +915,27 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     }
 }
 
+#[cfg(stage0)]
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<K: Ord, Q: ?Sized, V> Index<Q> for BTreeMap<K, V>
     where K: Borrow<Q>, Q: Ord
 {
     type Output = V;
 
+    #[inline]
+    fn index(&self, key: &Q) -> &V {
+        self.get(key).expect("no entry found for key")
+    }
+}
+
+#[cfg(not(stage0))]
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a, K: Ord, Q: ?Sized, V> Index<&'a Q> for BTreeMap<K, V>
+    where K: Borrow<Q>, Q: Ord
+{
+    type Output = V;
+
+    #[inline]
     fn index(&self, key: &Q) -> &V {
         self.get(key).expect("no entry found for key")
     }
@@ -1025,6 +1041,9 @@ fn next_back(&mut self) -> Option<(K, V)> {
     }
 }
 
+impl<'a, K, V> Clone for Iter<'a, K, V> {
+    fn clone(&self) -> Iter<'a, K, V> { Iter { inner: self.inner.clone() } }
+}
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, K, V> Iterator for Iter<'a, K, V> {
     type Item = (&'a K, &'a V);
@@ -1067,6 +1086,9 @@ fn next_back(&mut self) -> Option<(K, V)> { self.inner.next_back() }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<K, V> ExactSizeIterator for IntoIter<K, V> {}
 
+impl<'a, K, V> Clone for Keys<'a, K, V> {
+    fn clone(&self) -> Keys<'a, K, V> { Keys { inner: self.inner.clone() } }
+}
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, K, V> Iterator for Keys<'a, K, V> {
     type Item = &'a K;
@@ -1082,6 +1104,9 @@ fn next_back(&mut self) -> Option<(&'a K)> { self.inner.next_back() }
 impl<'a, K, V> ExactSizeIterator for Keys<'a, K, V> {}
 
 
+impl<'a, K, V> Clone for Values<'a, K, V> {
+    fn clone(&self) -> Values<'a, K, V> { Values { inner: self.inner.clone() } }
+}
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, K, V> Iterator for Values<'a, K, V> {
     type Item = &'a V;
@@ -1096,6 +1121,9 @@ fn next_back(&mut self) -> Option<(&'a V)> { self.inner.next_back() }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, K, V> ExactSizeIterator for Values<'a, K, V> {}
 
+impl<'a, K, V> Clone for Range<'a, K, V> {
+    fn clone(&self) -> Range<'a, K, V> { Range { inner: self.inner.clone() } }
+}
 impl<'a, K, V> Iterator for Range<'a, K, V> {
     type Item = (&'a K, &'a V);
 
@@ -1115,9 +1143,9 @@ fn next_back(&mut self) -> Option<(&'a K, &'a mut V)> { self.inner.next_back() }
 }
 
 impl<'a, K: Ord, V> Entry<'a, K, V> {
-    #[unstable(feature = "collections",
-               reason = "matches collection reform v2 specification, waiting for dust to settle")]
     /// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant
+    #[unstable(feature = "std_misc",
+               reason = "will soon be replaced by or_insert")]
     pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, K, V>> {
         match self {
             Occupied(entry) => Ok(entry.into_mut()),
@@ -1269,6 +1297,7 @@ pub fn into_iter(self) -> IntoIter<K, V> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::BTreeMap;
     ///
     /// let mut a = BTreeMap::new();
@@ -1291,6 +1320,7 @@ fn first<A, B>((a, _): (A, B)) -> A { a }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::BTreeMap;
     ///
     /// let mut a = BTreeMap::new();
@@ -1478,6 +1508,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BTreeMap;
     /// use std::collections::Bound::{Included, Unbounded};
     ///
@@ -1504,6 +1535,7 @@ pub fn range<'a>(&'a self, min: Bound<&K>, max: Bound<&K>) -> Range<'a, K, V> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BTreeMap;
     /// use std::collections::Bound::{Included, Excluded};
     ///
@@ -1529,6 +1561,7 @@ pub fn range_mut<'a>(&'a mut self, min: Bound<&K>, max: Bound<&K>) -> RangeMut<'
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BTreeMap;
     /// use std::collections::btree_map::Entry;
     ///
index bfac3b2df5a5cba8cc1a200ed9be1053bea87f53..23eafa41d8a01d4075737d74cae3b39171b6a5cd 100644 (file)
@@ -1326,6 +1326,7 @@ trait TraversalImpl {
 
 /// A `TraversalImpl` that actually is backed by two iterators. This works in the non-moving case,
 /// as no deallocation needs to be done.
+#[derive(Clone)]
 struct ElemsAndEdges<Elems, Edges>(Elems, Edges);
 
 impl<K, V, E, Elems: DoubleEndedIterator, Edges: DoubleEndedIterator>
@@ -1404,6 +1405,7 @@ fn drop(&mut self) {
 }
 
 /// An abstraction over all the different kinds of traversals a node supports
+#[derive(Clone)]
 struct AbsTraversal<Impl> {
     inner: Impl,
     head_is_edge: bool,
@@ -1522,6 +1524,7 @@ fn search_linear<Q: ?Sized>(&self, key: &Q) -> (usize, bool)
             }
 
             /// Returns a sub-slice with elements starting with `min_key`.
+            #[cfg(stage0)]
             pub fn slice_from(self, min_key: &K) -> $NodeSlice<'a, K, V> {
                 //  _______________
                 // |_1_|_3_|_5_|_7_|
@@ -1549,7 +1552,37 @@ pub fn slice_from(self, min_key: &K) -> $NodeSlice<'a, K, V> {
                 }
             }
 
+            /// Returns a sub-slice with elements starting with `min_key`.
+            #[cfg(not(stage0))]
+            pub fn slice_from(self, min_key: &K) -> $NodeSlice<'a, K, V> {
+                //  _______________
+                // |_1_|_3_|_5_|_7_|
+                // |   |   |   |   |
+                // 0 0 1 1 2 2 3 3 4  index
+                // |   |   |   |   |
+                // \___|___|___|___/  slice_from(&0); pos = 0
+                //     \___|___|___/  slice_from(&2); pos = 1
+                //     |___|___|___/  slice_from(&3); pos = 1; result.head_is_edge = false
+                //         \___|___/  slice_from(&4); pos = 2
+                //             \___/  slice_from(&6); pos = 3
+                //                \|/ slice_from(&999); pos = 4
+                let (pos, pos_is_kv) = self.search_linear(min_key);
+                $NodeSlice {
+                    has_edges: self.has_edges,
+                    edges: if !self.has_edges {
+                        self.edges
+                    } else {
+                        self.edges.$index(pos ..)
+                    },
+                    keys: &self.keys[pos ..],
+                    vals: self.vals.$index(pos ..),
+                    head_is_edge: !pos_is_kv,
+                    tail_is_edge: self.tail_is_edge,
+                }
+            }
+
             /// Returns a sub-slice with elements up to and including `max_key`.
+            #[cfg(stage0)]
             pub fn slice_to(self, max_key: &K) -> $NodeSlice<'a, K, V> {
                 //  _______________
                 // |_1_|_3_|_5_|_7_|
@@ -1577,6 +1610,36 @@ pub fn slice_to(self, max_key: &K) -> $NodeSlice<'a, K, V> {
                     tail_is_edge: !pos_is_kv,
                 }
             }
+
+            /// Returns a sub-slice with elements up to and including `max_key`.
+            #[cfg(not(stage0))]
+            pub fn slice_to(self, max_key: &K) -> $NodeSlice<'a, K, V> {
+                //  _______________
+                // |_1_|_3_|_5_|_7_|
+                // |   |   |   |   |
+                // 0 0 1 1 2 2 3 3 4  index
+                // |   |   |   |   |
+                //\|/  |   |   |   |  slice_to(&0); pos = 0
+                // \___/   |   |   |  slice_to(&2); pos = 1
+                // \___|___|   |   |  slice_to(&3); pos = 1; result.tail_is_edge = false
+                // \___|___/   |   |  slice_to(&4); pos = 2
+                // \___|___|___/   |  slice_to(&6); pos = 3
+                // \___|___|___|___/  slice_to(&999); pos = 4
+                let (pos, pos_is_kv) = self.search_linear(max_key);
+                let pos = pos + if pos_is_kv { 1 } else { 0 };
+                $NodeSlice {
+                    has_edges: self.has_edges,
+                    edges: if !self.has_edges {
+                        self.edges
+                    } else {
+                        self.edges.$index(.. (pos + 1))
+                    },
+                    keys: &self.keys[..pos],
+                    vals: self.vals.$index(.. pos),
+                    head_is_edge: self.head_is_edge,
+                    tail_is_edge: !pos_is_kv,
+                }
+            }
         }
 
         impl<'a, K: 'a, V: 'a> $NodeSlice<'a, K, V> {
index 5616d36ce0ba9ffadb9a1619b0616218a0fab4c7..08ee5801482fdb44e81a4531142527c987315401 100644 (file)
@@ -116,6 +116,7 @@ impl<T> BTreeSet<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::BTreeSet;
     ///
     /// let set: BTreeSet<usize> = [1, 2, 3, 4].iter().cloned().collect();
@@ -137,6 +138,7 @@ pub fn iter(&self) -> Iter<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::BTreeSet;
     ///
     /// let set: BTreeSet<usize> = [1, 2, 3, 4].iter().cloned().collect();
@@ -162,6 +164,7 @@ impl<T: Ord> BTreeSet<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::BTreeSet;
     /// use std::collections::Bound::{Included, Unbounded};
     ///
@@ -190,6 +193,7 @@ impl<T: Ord> BTreeSet<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::BTreeSet;
     ///
     /// let mut a = BTreeSet::new();
@@ -213,6 +217,7 @@ pub fn difference<'a>(&'a self, other: &'a BTreeSet<T>) -> Difference<'a, T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::BTreeSet;
     ///
     /// let mut a = BTreeSet::new();
@@ -237,6 +242,7 @@ pub fn symmetric_difference<'a>(&'a self, other: &'a BTreeSet<T>)
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::BTreeSet;
     ///
     /// let mut a = BTreeSet::new();
@@ -261,6 +267,7 @@ pub fn intersection<'a>(&'a self, other: &'a BTreeSet<T>)
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::BTreeSet;
     ///
     /// let mut a = BTreeSet::new();
@@ -333,6 +340,7 @@ pub fn clear(&mut self) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::BTreeSet;
     ///
     /// let set: BTreeSet<_> = [1, 2, 3].iter().cloned().collect();
@@ -350,6 +358,7 @@ pub fn contains<Q: ?Sized>(&self, value: &Q) -> bool where T: Borrow<Q>, Q: Ord
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::BTreeSet;
     ///
     /// let a: BTreeSet<_> = [1, 2, 3].iter().cloned().collect();
@@ -371,6 +380,7 @@ pub fn is_disjoint(&self, other: &BTreeSet<T>) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::BTreeSet;
     ///
     /// let sup: BTreeSet<_> = [1, 2, 3].iter().cloned().collect();
@@ -413,6 +423,7 @@ pub fn is_subset(&self, other: &BTreeSet<T>) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::BTreeSet;
     ///
     /// let sub: BTreeSet<_> = [1, 2].iter().cloned().collect();
@@ -628,6 +639,9 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     }
 }
 
+impl<'a, T> Clone for Iter<'a, T> {
+    fn clone(&self) -> Iter<'a, T> { Iter { iter: self.iter.clone() } }
+}
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T> Iterator for Iter<'a, T> {
     type Item = &'a T;
@@ -658,6 +672,9 @@ fn next_back(&mut self) -> Option<T> { self.iter.next_back() }
 impl<T> ExactSizeIterator for IntoIter<T> {}
 
 
+impl<'a, T> Clone for Range<'a, T> {
+    fn clone(&self) -> Range<'a, T> { Range { iter: self.iter.clone() } }
+}
 impl<'a, T> Iterator for Range<'a, T> {
     type Item = &'a T;
 
@@ -677,6 +694,11 @@ fn cmp_opt<T: Ord>(x: Option<&T>, y: Option<&T>,
     }
 }
 
+impl<'a, T> Clone for Difference<'a, T> {
+    fn clone(&self) -> Difference<'a, T> {
+        Difference { a: self.a.clone(), b: self.b.clone() }
+    }
+}
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T: Ord> Iterator for Difference<'a, T> {
     type Item = &'a T;
@@ -692,6 +714,11 @@ fn next(&mut self) -> Option<&'a T> {
     }
 }
 
+impl<'a, T> Clone for SymmetricDifference<'a, T> {
+    fn clone(&self) -> SymmetricDifference<'a, T> {
+        SymmetricDifference { a: self.a.clone(), b: self.b.clone() }
+    }
+}
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T: Ord> Iterator for SymmetricDifference<'a, T> {
     type Item = &'a T;
@@ -707,6 +734,11 @@ fn next(&mut self) -> Option<&'a T> {
     }
 }
 
+impl<'a, T> Clone for Intersection<'a, T> {
+    fn clone(&self) -> Intersection<'a, T> {
+        Intersection { a: self.a.clone(), b: self.b.clone() }
+    }
+}
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T: Ord> Iterator for Intersection<'a, T> {
     type Item = &'a T;
@@ -728,6 +760,11 @@ fn next(&mut self) -> Option<&'a T> {
     }
 }
 
+impl<'a, T> Clone for Union<'a, T> {
+    fn clone(&self) -> Union<'a, T> {
+        Union { a: self.a.clone(), b: self.b.clone() }
+    }
+}
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T: Ord> Iterator for Union<'a, T> {
     type Item = &'a T;
index 3af7485b237efc9c14782f39b511890739c9e67a..b106f4adbc708219524bf1a368cdac19211c7689 100644 (file)
 //! like:
 //!
 //! ```
+//! # #![feature(core, std_misc)]
 //! use std::fmt;
 //! use std::f64;
 //! use std::num::Float;
 //! Example usage is:
 //!
 //! ```
+//! # #![feature(old_io)]
 //! # #![allow(unused_must_use)]
 //! use std::io::Write;
 //! let mut w = Vec::new();
 //! off, some example usage is:
 //!
 //! ```
+//! # #![feature(old_io)]
 //! use std::fmt;
 //! use std::io::{self, Write};
 //!
index c4a014967633321e10a765c2c9a53edfe87bb738..6a65c991c95037b5d45be79dd7c191277a74960a 100644 (file)
        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
        html_root_url = "http://doc.rust-lang.org/nightly/",
        html_playground_url = "http://play.rust-lang.org/")]
+#![doc(test(no_crate_inject))]
 
+#![allow(trivial_casts)]
+#![allow(trivial_numeric_casts)]
 #![feature(alloc)]
 #![feature(box_syntax)]
 #![feature(box_patterns)]
@@ -36,7 +39,8 @@
 #![feature(unsafe_no_drop_flag)]
 #![feature(step_by)]
 #![feature(str_char)]
-#![cfg_attr(test, feature(rand, rustc_private, test))]
+#![feature(convert)]
+#![cfg_attr(test, feature(rand, rustc_private, test, hash, collections))]
 #![cfg_attr(test, allow(deprecated))] // rand
 
 #![feature(no_std)]
index 9e0a6d0438100b0d7e9382197b394eba90f0f2e3..908c78a17f4f96ef2743f5b9a52dc3e56a5d4952 100644 (file)
@@ -235,6 +235,7 @@ pub fn new() -> LinkedList<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::LinkedList;
     ///
     /// let mut a = LinkedList::new();
@@ -483,6 +484,7 @@ pub fn back_mut(&mut self) -> Option<&mut T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::LinkedList;
     ///
     /// let mut dl = LinkedList::new();
@@ -530,6 +532,7 @@ pub fn pop_front(&mut self) -> Option<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::LinkedList;
     ///
     /// let mut d = LinkedList::new();
@@ -548,6 +551,7 @@ pub fn push_back(&mut self, elt: T) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::LinkedList;
     ///
     /// let mut d = LinkedList::new();
@@ -573,6 +577,7 @@ pub fn pop_back(&mut self) -> Option<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::LinkedList;
     ///
     /// let mut d = LinkedList::new();
@@ -765,6 +770,7 @@ impl<'a, A> IterMut<'a, A> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::LinkedList;
     ///
     /// let mut list: LinkedList<_> = vec![1, 3, 4].into_iter().collect();
@@ -792,6 +798,7 @@ pub fn insert_next(&mut self, elt: A) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::LinkedList;
     ///
     /// let mut list: LinkedList<_> = vec![1, 2, 3].into_iter().collect();
@@ -832,6 +839,8 @@ impl<A> DoubleEndedIterator for IntoIter<A> {
     fn next_back(&mut self) -> Option<A> { self.list.pop_back() }
 }
 
+impl<A> ExactSizeIterator for IntoIter<A> {}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<A> FromIterator<A> for LinkedList<A> {
     fn from_iter<T: IntoIterator<Item=A>>(iter: T) -> LinkedList<A> {
index 45864153dd799598783557075b2e5115be246e79..2a668b0869d2529ab61a18611a59ba5bc5d976bf 100644 (file)
@@ -14,6 +14,7 @@
 //! Slices are a view into a block of memory represented as a pointer and a length.
 //!
 //! ```rust
+//! # #![feature(core)]
 //! // slicing a Vec
 //! let vec = vec!(1, 2, 3);
 //! let int_slice = vec.as_slice();
@@ -88,6 +89,7 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use alloc::boxed::Box;
+use core::convert::AsRef;
 use core::clone::Clone;
 use core::cmp::Ordering::{self, Greater, Less};
 use core::cmp::{self, Ord, PartialEq};
@@ -270,6 +272,7 @@ pub fn sort_by<F>(&mut self, compare: F) where F: FnMut(&T, &T) -> Ordering {
     /// # Examples
     ///
     /// ```rust
+    /// # #![feature(collections)]
     /// let mut a = [1, 2, 3, 4, 5];
     /// let b = vec![6, 7, 8];
     /// let num_moved = a.move_from(b, 0, 3);
@@ -560,6 +563,7 @@ pub fn as_ptr(&self) -> *const T {
     /// found; the fourth could match any position in `[1,4]`.
     ///
     /// ```rust
+    /// # #![feature(core)]
     /// let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
     /// let s = s.as_slice();
     ///
@@ -842,6 +846,7 @@ pub fn to_vec(&self) -> Vec<T> where T: Clone {
     /// # Examples
     ///
     /// ```rust
+    /// # #![feature(collections)]
     /// let v = [1, 2, 3];
     /// let mut perms = v.permutations();
     ///
@@ -853,6 +858,7 @@ pub fn to_vec(&self) -> Vec<T> where T: Clone {
     /// Iterating through permutations one by one.
     ///
     /// ```rust
+    /// # #![feature(collections)]
     /// let v = [1, 2, 3];
     /// let mut perms = v.permutations();
     ///
@@ -874,6 +880,7 @@ pub fn permutations(&self) -> Permutations<T> where T: Clone {
     /// # Example
     ///
     /// ```rust
+    /// # #![feature(collections)]
     /// let mut dst = [0, 0, 0];
     /// let src = [1, 2];
     ///
@@ -921,6 +928,7 @@ pub fn sort(&mut self) where T: Ord {
     /// found; the fourth could match any position in `[1,4]`.
     ///
     /// ```rust
+    /// # #![feature(core)]
     /// let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
     /// let s = s.as_slice();
     ///
@@ -950,6 +958,7 @@ pub fn binary_search_elem(&self, x: &T) -> Result<usize, usize> where T: Ord {
     /// # Example
     ///
     /// ```rust
+    /// # #![feature(collections)]
     /// let v: &mut [_] = &mut [0, 1, 2];
     /// v.next_permutation();
     /// let b: &mut [_] = &mut [0, 2, 1];
@@ -972,6 +981,7 @@ pub fn next_permutation(&mut self) -> bool where T: Ord {
     /// # Example
     ///
     /// ```rust
+    /// # #![feature(collections)]
     /// let v: &mut [_] = &mut [1, 0, 2];
     /// v.prev_permutation();
     /// let b: &mut [_] = &mut [0, 2, 1];
@@ -1088,23 +1098,23 @@ pub trait SliceConcatExt<T: ?Sized, U> {
     fn connect(&self, sep: &T) -> U;
 }
 
-impl<T: Clone, V: AsSlice<T>> SliceConcatExt<T, Vec<T>> for [V] {
+impl<T: Clone, V: AsRef<[T]>> SliceConcatExt<T, Vec<T>> for [V] {
     fn concat(&self) -> Vec<T> {
-        let size = self.iter().fold(0, |acc, v| acc + v.as_slice().len());
+        let size = self.iter().fold(0, |acc, v| acc + v.as_ref().len());
         let mut result = Vec::with_capacity(size);
         for v in self {
-            result.push_all(v.as_slice())
+            result.push_all(v.as_ref())
         }
         result
     }
 
     fn connect(&self, sep: &T) -> Vec<T> {
-        let size = self.iter().fold(0, |acc, v| acc + v.as_slice().len());
+        let size = self.iter().fold(0, |acc, v| acc + v.as_ref().len());
         let mut result = Vec::with_capacity(size + self.len());
         let mut first = true;
         for v in self {
             if first { first = false } else { result.push(sep.clone()) }
-            result.push_all(v.as_slice())
+            result.push_all(v.as_ref())
         }
         result
     }
index 3a289e4ef37389b6838671f60aa0109bff6c6fda..ca2786e843e97031c56e1d37d7b63aa443d096ab 100644 (file)
 use core::iter::{Iterator, IteratorExt, Extend};
 use core::option::Option::{self, Some, None};
 use core::result::Result;
-use core::slice::AsSlice;
 use core::str as core_str;
 use unicode::str::{UnicodeStr, Utf16Encoder};
 
+use core::convert::AsRef;
 use vec_deque::VecDeque;
 use borrow::{Borrow, ToOwned};
 use string::String;
@@ -74,8 +74,8 @@
 
 pub use core::str::{FromStr, Utf8Error, Str};
 pub use core::str::{Lines, LinesAny, MatchIndices, SplitStr, CharRange};
-pub use core::str::{Split, SplitTerminator};
-pub use core::str::{SplitN, RSplitN};
+pub use core::str::{Split, SplitTerminator, SplitN};
+pub use core::str::{RSplit, RSplitN};
 pub use core::str::{from_utf8, CharEq, Chars, CharIndices, Bytes};
 pub use core::str::{from_utf8_unchecked, from_c_str, ParseBoolError};
 pub use unicode::str::{Words, Graphemes, GraphemeIndices};
 Section: Creating a string
 */
 
-impl<S: Str> SliceConcatExt<str, String> for [S] {
+impl<S: AsRef<str>> SliceConcatExt<str, String> for [S] {
     fn concat(&self) -> String {
-        let s = self.as_slice();
-
-        if s.is_empty() {
+        if self.is_empty() {
             return String::new();
         }
 
         // `len` calculation may overflow but push_str will check boundaries
-        let len = s.iter().map(|s| s.as_slice().len()).sum();
+        let len = self.iter().map(|s| s.as_ref().len()).sum();
         let mut result = String::with_capacity(len);
 
-        for s in s {
-            result.push_str(s.as_slice())
+        for s in self {
+            result.push_str(s.as_ref())
         }
 
         result
     }
 
     fn connect(&self, sep: &str) -> String {
-        let s = self.as_slice();
-
-        if s.is_empty() {
+        if self.is_empty() {
             return String::new();
         }
 
         // concat is faster
         if sep.is_empty() {
-            return s.concat();
+            return self.concat();
         }
 
         // this is wrong without the guarantee that `self` is non-empty
         // `len` calculation may overflow but push_str but will check boundaries
-        let len = sep.len() * (s.len() - 1)
-            + s.iter().map(|s| s.as_slice().len()).sum();
+        let len = sep.len() * (self.len() - 1)
+            + self.iter().map(|s| s.as_ref().len()).sum();
         let mut result = String::with_capacity(len);
         let mut first = true;
 
-        for s in s {
+        for s in self {
             if first {
                 first = false;
             } else {
                 result.push_str(sep);
             }
-            result.push_str(s.as_slice());
+            result.push_str(s.as_ref());
         }
         result
     }
@@ -548,6 +544,7 @@ pub fn contains<'a, P: Pattern<'a>>(&'a self, pat: P) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// assert!("hello".contains_char('e'));
     ///
     /// assert!(!"hello".contains_char('z'));
@@ -699,23 +696,48 @@ pub fn split_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitTerminator
         core_str::StrExt::split_terminator(&self[..], pat)
     }
 
-    /// An iterator over substrings of `self`, separated by characters matched by a pattern,
+    /// An iterator over substrings of `self`, separated by a pattern,
     /// starting from the end of the string.
     ///
-    /// Restricted to splitting at most `count` times.
+    /// # Examples
     ///
-    /// The pattern can be a simple `&str`, or a closure that determines the split.
+    /// Simple patterns:
+    ///
+    /// ```
+    /// let v: Vec<&str> = "Mary had a little lamb".rsplit(' ').collect();
+    /// assert_eq!(v, ["lamb", "little", "a", "had", "Mary"]);
+    ///
+    /// let v: Vec<&str> = "lion::tiger::leopard".rsplit("::").collect();
+    /// assert_eq!(v, ["leopard", "tiger", "lion"]);
+    /// ```
+    ///
+    /// More complex patterns with a lambda:
+    ///
+    /// ```
+    /// let v: Vec<&str> = "abc1def2ghi".rsplit(|c: char| c.is_numeric()).collect();
+    /// assert_eq!(v, ["ghi", "def", "abc"]);
+    /// ```
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn rsplit<'a, P: Pattern<'a>>(&'a self, pat: P) -> RSplit<'a, P>
+        where P::Searcher: ReverseSearcher<'a>
+    {
+        core_str::StrExt::rsplit(&self[..], pat)
+    }
+
+    /// An iterator over substrings of `self`, separated by a pattern,
+    /// starting from the end of the string, restricted to splitting
+    /// at most `count` times.
     ///
     /// # Examples
     ///
-    /// Simple `&str` patterns:
+    /// Simple patterns:
     ///
     /// ```
     /// let v: Vec<&str> = "Mary had a little lamb".rsplitn(2, ' ').collect();
     /// assert_eq!(v, ["lamb", "little", "Mary had a"]);
     ///
-    /// let v: Vec<&str> = "lionXXtigerXleopard".rsplitn(2, 'X').collect();
-    /// assert_eq!(v, ["leopard", "tiger", "lionX"]);
+    /// let v: Vec<&str> = "lion::tiger::leopard".rsplitn(1, "::").collect();
+    /// assert_eq!(v, ["leopard", "lion::tiger"]);
     /// ```
     ///
     /// More complex patterns with a lambda:
@@ -725,7 +747,9 @@ pub fn split_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitTerminator
     /// assert_eq!(v, ["ghi", "abc1def"]);
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn rsplitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> RSplitN<'a, P> {
+    pub fn rsplitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> RSplitN<'a, P>
+        where P::Searcher: ReverseSearcher<'a>
+    {
         core_str::StrExt::rsplitn(&self[..], count, pat)
     }
 
@@ -739,6 +763,7 @@ pub fn rsplitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> RSplitN<'a
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let v: Vec<(usize, usize)> = "abcXXXabcYYYabc".match_indices("abc").collect();
     /// assert_eq!(v, [(0,3), (6,9), (12,15)]);
     ///
@@ -761,6 +786,7 @@ pub fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let v: Vec<&str> = "abcXXXabcYYYabc".split_str("abc").collect();
     /// assert_eq!(v, ["", "XXX", "YYY", ""]);
     ///
@@ -869,6 +895,7 @@ pub fn slice_to(&self, end: usize) -> &str {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let s = "Löwe 老虎 Léopard";
     ///
     /// assert_eq!(s.slice_chars(0, 4), "Löwe");
@@ -1019,6 +1046,7 @@ pub fn trim_right_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
     /// # Examples
     ///
     /// ```
+    /// # #![feature(str_char)]
     /// let s = "Löwe 老虎 Léopard";
     /// assert!(s.is_char_boundary(0));
     /// // start of `老`
@@ -1055,6 +1083,7 @@ pub fn is_char_boundary(&self, index: usize) -> bool {
     /// done by `.chars()` or `.char_indices()`.
     ///
     /// ```
+    /// # #![feature(str_char, core)]
     /// use std::str::CharRange;
     ///
     /// let s = "中华Việt Nam";
@@ -1105,6 +1134,7 @@ pub fn char_range_at(&self, start: usize) -> CharRange {
     /// done by `.chars().rev()` or `.char_indices()`.
     ///
     /// ```
+    /// # #![feature(str_char, core)]
     /// use std::str::CharRange;
     ///
     /// let s = "中华Việt Nam";
@@ -1148,6 +1178,7 @@ pub fn char_range_at_reverse(&self, start: usize) -> CharRange {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(str_char)]
     /// let s = "abπc";
     /// assert_eq!(s.char_at(1), 'b');
     /// assert_eq!(s.char_at(2), 'π');
@@ -1172,6 +1203,7 @@ pub fn char_at(&self, i: usize) -> char {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(str_char)]
     /// let s = "abπc";
     /// assert_eq!(s.char_at_reverse(1), 'a');
     /// assert_eq!(s.char_at_reverse(2), 'b');
@@ -1286,6 +1318,7 @@ pub fn rfind<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize>
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let s = "Löwe 老虎 Léopard";
     ///
     /// assert_eq!(s.find_str("老虎 L"), Some(6));
@@ -1307,6 +1340,7 @@ pub fn find_str<'a, P: Pattern<'a>>(&'a self, needle: P) -> Option<usize> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(str_char)]
     /// let s = "Löwe 老虎 Léopard";
     /// let (c, s1) = s.slice_shift_char().unwrap();
     ///
@@ -1335,6 +1369,7 @@ pub fn slice_shift_char(&self) -> Option<(char, &str)> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let string = "a\nb\nc";
     /// let lines: Vec<&str> = string.lines().collect();
     ///
@@ -1434,6 +1469,7 @@ pub fn parse<F: FromStr>(&self) -> Result<F, F::Err> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(unicode, core)]
     /// let gr1 = "a\u{310}e\u{301}o\u{308}\u{332}".graphemes(true).collect::<Vec<&str>>();
     /// let b: &[_] = &["a\u{310}", "e\u{301}", "o\u{308}\u{332}"];
     ///
@@ -1456,6 +1492,7 @@ pub fn graphemes(&self, is_extended: bool) -> Graphemes {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(unicode, core)]
     /// let gr_inds = "a̐éö̲\r\n".grapheme_indices(true).collect::<Vec<(usize, &str)>>();
     /// let b: &[_] = &[(0, "a̐"), (3, "é"), (6, "ö̲"), (11, "\r\n")];
     ///
@@ -1475,6 +1512,7 @@ pub fn grapheme_indices(&self, is_extended: bool) -> GraphemeIndices {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(str_words)]
     /// let some_words = " Mary   had\ta little  \n\t lamb";
     /// let v: Vec<&str> = some_words.words().collect();
     ///
index cd6f27bf65f6e5ab2e96fae662080cce247f503e..a61eaecd2b1ea36dcf2b892b05c0df9a6eac7f50 100644 (file)
@@ -25,6 +25,7 @@
 use core::ops::{self, Deref, Add, Index};
 use core::ptr;
 use core::slice;
+use core::str::Pattern;
 use unicode::str as unicode_str;
 use unicode::str::Utf16Item;
 
@@ -90,6 +91,7 @@ pub fn with_capacity(capacity: usize) -> String {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections, core)]
     /// let s = String::from_str("hello");
     /// assert_eq!(s.as_slice(), "hello");
     /// ```
@@ -122,6 +124,7 @@ pub fn from_str(_: &str) -> String {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::str::Utf8Error;
     ///
     /// let hello_vec = vec![104, 101, 108, 108, 111];
@@ -350,6 +353,7 @@ pub unsafe fn from_utf8_unchecked(bytes: Vec<u8>) -> String {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let s = String::from_str("hello");
     /// let bytes = s.into_bytes();
     /// assert_eq!(bytes, [104, 101, 108, 108, 111]);
@@ -365,6 +369,7 @@ pub fn into_bytes(self) -> Vec<u8> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut s = String::from_str("foo");
     /// s.push_str("bar");
     /// assert_eq!(s, "foobar");
@@ -441,6 +446,7 @@ pub fn reserve_exact(&mut self, additional: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut s = String::from_str("foo");
     /// s.reserve(100);
     /// assert!(s.capacity() >= 100);
@@ -458,6 +464,7 @@ pub fn shrink_to_fit(&mut self) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut s = String::from_str("abc");
     /// s.push('1');
     /// s.push('2');
@@ -493,6 +500,7 @@ pub fn push(&mut self, ch: char) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let s = String::from_str("hello");
     /// let b: &[_] = &[104, 101, 108, 108, 111];
     /// assert_eq!(s.as_bytes(), b);
@@ -513,6 +521,7 @@ pub fn as_bytes(&self) -> &[u8] {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut s = String::from_str("hello");
     /// s.truncate(2);
     /// assert_eq!(s, "he");
@@ -530,6 +539,7 @@ pub fn truncate(&mut self, new_len: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut s = String::from_str("foo");
     /// assert_eq!(s.pop(), Some('o'));
     /// assert_eq!(s.pop(), Some('o'));
@@ -567,6 +577,7 @@ pub fn pop(&mut self) -> Option<char> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut s = String::from_str("foo");
     /// assert_eq!(s.remove(0), 'f');
     /// assert_eq!(s.remove(1), 'o');
@@ -629,6 +640,7 @@ pub fn insert(&mut self, idx: usize, ch: char) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut s = String::from_str("hello");
     /// unsafe {
     ///     let vec = s.as_mut_vec();
@@ -765,6 +777,25 @@ fn extend<I: IntoIterator<Item=&'a str>>(&mut self, iterable: I) {
     }
 }
 
+/// A convenience impl that delegates to the impl for `&str`
+impl<'a, 'b> Pattern<'a> for &'b String {
+    type Searcher = <&'b str as Pattern<'a>>::Searcher;
+
+    fn into_searcher(self, haystack: &'a str) -> <&'b str as Pattern<'a>>::Searcher {
+        self[..].into_searcher(haystack)
+    }
+
+    #[inline]
+    fn is_contained_in(self, haystack: &'a str) -> bool {
+        self[..].is_contained_in(haystack)
+    }
+
+    #[inline]
+    fn is_prefix_of(self, haystack: &'a str) -> bool {
+        self[..].is_prefix_of(haystack)
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl PartialEq for String {
     #[inline]
@@ -814,6 +845,7 @@ fn ne(&self, other: &Cow<'a, str>) -> bool { PartialEq::ne(&**self, &**other) }
 }
 
 #[unstable(feature = "collections", reason = "waiting on Str stabilization")]
+#[allow(deprecated)]
 impl Str for String {
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -870,34 +902,66 @@ fn add(mut self, other: &str) -> String {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl ops::Index<ops::Range<usize>> for String {
     type Output = str;
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::Range<usize>) -> &str {
         &self[..][*index]
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::Range<usize>) -> &str {
+        &self[..][index]
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl ops::Index<ops::RangeTo<usize>> for String {
     type Output = str;
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::RangeTo<usize>) -> &str {
         &self[..][*index]
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::RangeTo<usize>) -> &str {
+        &self[..][index]
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl ops::Index<ops::RangeFrom<usize>> for String {
     type Output = str;
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::RangeFrom<usize>) -> &str {
         &self[..][*index]
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::RangeFrom<usize>) -> &str {
+        &self[..][index]
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl ops::Index<ops::RangeFull> for String {
     type Output = str;
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, _index: &ops::RangeFull) -> &str {
         unsafe { mem::transmute(&*self.vec) }
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, _index: ops::RangeFull) -> &str {
+        unsafe { mem::transmute(&*self.vec) }
+    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -930,6 +994,7 @@ fn deref<'b>(&'b self) -> &'b String {
 /// # Examples
 ///
 /// ```
+/// # #![feature(collections)]
 /// use std::string::as_string;
 ///
 /// fn string_consumer(s: String) {
@@ -973,6 +1038,27 @@ fn to_string(&self) -> String {
     }
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<str> for String {
+    fn as_ref(&self) -> &str {
+        self
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> From<&'a str> for String {
+    fn from(s: &'a str) -> String {
+        s.to_string()
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl Into<Vec<u8>> for String {
+    fn into(self) -> Vec<u8> {
+        self.into_bytes()
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl IntoCow<'static, str> for String {
     #[inline]
@@ -989,6 +1075,7 @@ fn into_cow(self) -> Cow<'a, str> {
     }
 }
 
+#[allow(deprecated)]
 impl<'a> Str for Cow<'a, str> {
     #[inline]
     fn as_slice<'b>(&'b self) -> &'b str {
index b0e8dc7d0b6226d004480ffd3d7f85a2b6ff88c8..af2daabc2d02ca080d5756c0bb9f12aa89d2826a 100644 (file)
@@ -8,7 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! A growable list type with heap-allocated contents, written `Vec<T>` but pronounced 'vector.'
+//! A growable list type with heap-allocated contents, written `Vec<T>` but
+//! pronounced 'vector.'
 //!
 //! Vectors have `O(1)` indexing, push (to the end) and pop (from the end).
 //!
@@ -73,6 +74,7 @@
 /// # Examples
 ///
 /// ```
+/// # #![feature(collections)]
 /// let mut vec = Vec::new();
 /// vec.push(1);
 /// vec.push(2);
 ///
 /// # Capacity and reallocation
 ///
-/// The capacity of a vector is the amount of space allocated for any future elements that will be
-/// added onto the vector. This is not to be confused with the *length* of a vector, which
-/// specifies the number of actual elements within the vector. If a vector's length exceeds its
-/// capacity, its capacity will automatically be increased, but its elements will have to be
+/// The capacity of a vector is the amount of space allocated for any future
+/// elements that will be added onto the vector. This is not to be confused with
+/// the *length* of a vector, which specifies the number of actual elements
+/// within the vector. If a vector's length exceeds its capacity, its capacity
+/// will automatically be increased, but its elements will have to be
 /// reallocated.
 ///
-/// For example, a vector with capacity 10 and length 0 would be an empty vector with space for 10
-/// more elements. Pushing 10 or fewer elements onto the vector will not change its capacity or
-/// cause reallocation to occur. However, if the vector's length is increased to 11, it will have
-/// to reallocate, which can be slow. For this reason, it is recommended to use
-/// `Vec::with_capacity` whenever possible to specify how big the vector is expected to get.
+/// For example, a vector with capacity 10 and length 0 would be an empty vector
+/// with space for 10 more elements. Pushing 10 or fewer elements onto the
+/// vector will not change its capacity or cause reallocation to occur. However,
+/// if the vector's length is increased to 11, it will have to reallocate, which
+/// can be slow. For this reason, it is recommended to use `Vec::with_capacity`
+/// whenever possible to specify how big the vector is expected to get.
 #[unsafe_no_drop_flag]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct Vec<T> {
@@ -345,6 +349,7 @@ pub fn reserve_exact(&mut self, additional: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut vec = Vec::with_capacity(10);
     /// vec.push_all(&[1, 2, 3]);
     /// assert_eq!(vec.capacity(), 10);
@@ -400,6 +405,7 @@ pub fn into_boxed_slice(mut self) -> Box<[T]> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut vec = vec![1, 2, 3, 4];
     /// vec.truncate(2);
     /// assert_eq!(vec, [1, 2]);
@@ -565,6 +571,7 @@ pub fn insert(&mut self, index: usize, element: T) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut v = vec![1, 2, 3];
     /// assert_eq!(v.remove(1), 2);
     /// assert_eq!(v, [1, 3]);
@@ -696,6 +703,7 @@ pub fn pop(&mut self) -> Option<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut vec = vec![1, 2, 3];
     /// let mut vec2 = vec![4, 5, 6];
     /// vec.append(&mut vec2);
@@ -732,6 +740,7 @@ pub fn append(&mut self, other: &mut Self) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut v = vec!["a".to_string(), "b".to_string()];
     /// for s in v.drain() {
     ///     // s has type String, not &String
@@ -813,6 +822,7 @@ pub fn is_empty(&self) -> bool { self.len() == 0 }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections, core)]
     /// let v = vec![0, 1, 2];
     /// let w = v.map_in_place(|i| i + 3);
     /// assert_eq!(w.as_slice(), [3, 4, 5].as_slice());
@@ -1015,6 +1025,7 @@ pub fn map_in_place<U, F>(self, mut f: F) -> Vec<U> where F: FnMut(T) -> U {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut vec = vec![1,2,3];
     /// let vec2 = vec.split_off(1);
     /// assert_eq!(vec, [1]);
@@ -1053,6 +1064,7 @@ impl<T: Clone> Vec<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut vec = vec!["hello"];
     /// vec.resize(3, "world");
     /// assert_eq!(vec, ["hello", "world", "world"]);
@@ -1081,6 +1093,7 @@ pub fn resize(&mut self, new_len: usize, value: T) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// let mut vec = vec![1];
     /// vec.push_all(&[2, 3, 4]);
     /// assert_eq!(vec, [1, 2, 3, 4]);
@@ -1186,8 +1199,8 @@ pub fn dedup(&mut self) {
 
             // Avoid bounds checks by using unsafe pointers.
             let p = self.as_mut_ptr();
-            let mut r = 1;
-            let mut w = 1;
+            let mut r: usize = 1;
+            let mut w: usize = 1;
 
             while r < ln {
                 let p_r = p.offset(r as isize);
@@ -1323,90 +1336,178 @@ fn hash<H: hash::Hasher>(&self, state: &mut H) {
 impl<T> Index<usize> for Vec<T> {
     type Output = T;
 
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &usize) -> &T {
         // NB built-in indexing via `&[T]`
         &(**self)[*index]
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: usize) -> &T {
+        // NB built-in indexing via `&[T]`
+        &(**self)[index]
+    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> IndexMut<usize> for Vec<T> {
+
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, index: &usize) -> &mut T {
         // NB built-in indexing via `&mut [T]`
         &mut (**self)[*index]
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, index: usize) -> &mut T {
+        // NB built-in indexing via `&mut [T]`
+        &mut (**self)[index]
+    }
 }
 
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Index<ops::Range<usize>> for Vec<T> {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::Range<usize>) -> &[T] {
         Index::index(&**self, index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::Range<usize>) -> &[T] {
+        Index::index(&**self, index)
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Index<ops::RangeTo<usize>> for Vec<T> {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::RangeTo<usize>) -> &[T] {
         Index::index(&**self, index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::RangeTo<usize>) -> &[T] {
+        Index::index(&**self, index)
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Index<ops::RangeFrom<usize>> for Vec<T> {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::RangeFrom<usize>) -> &[T] {
         Index::index(&**self, index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::RangeFrom<usize>) -> &[T] {
+        Index::index(&**self, index)
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Index<ops::RangeFull> for Vec<T> {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, _index: &ops::RangeFull) -> &[T] {
-        self.as_slice()
+        self
+    }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, _index: ops::RangeFull) -> &[T] {
+        self
     }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<ops::Range<usize>> for Vec<T> {
+
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, index: &ops::Range<usize>) -> &mut [T] {
         IndexMut::index_mut(&mut **self, index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, index: ops::Range<usize>) -> &mut [T] {
+        IndexMut::index_mut(&mut **self, index)
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<ops::RangeTo<usize>> for Vec<T> {
+
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, index: &ops::RangeTo<usize>) -> &mut [T] {
         IndexMut::index_mut(&mut **self, index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, index: ops::RangeTo<usize>) -> &mut [T] {
+        IndexMut::index_mut(&mut **self, index)
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<ops::RangeFrom<usize>> for Vec<T> {
+
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, index: &ops::RangeFrom<usize>) -> &mut [T] {
         IndexMut::index_mut(&mut **self, index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, index: ops::RangeFrom<usize>) -> &mut [T] {
+        IndexMut::index_mut(&mut **self, index)
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<ops::RangeFull> for Vec<T> {
+
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, _index: &ops::RangeFull) -> &mut [T] {
         self.as_mut_slice()
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, _index: ops::RangeFull) -> &mut [T] {
+        self.as_mut_slice()
+    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Deref for Vec<T> {
     type Target = [T];
 
-    fn deref(&self) -> &[T] { self.as_slice() }
+    fn deref(&self) -> &[T] {
+        unsafe {
+            let p = *self.ptr;
+            assume(p != 0 as *mut T);
+            slice::from_raw_parts(p, self.len)
+        }
+    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -1548,12 +1649,14 @@ fn cmp(&self, other: &Vec<T>) -> Ordering {
     }
 }
 
+#[allow(deprecated)]
 impl<T> AsSlice<T> for Vec<T> {
     /// Returns a slice into `self`.
     ///
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// fn foo(slice: &[i32]) {}
     ///
     /// let vec = vec![1, 2];
@@ -1562,11 +1665,7 @@ impl<T> AsSlice<T> for Vec<T> {
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn as_slice(&self) -> &[T] {
-        unsafe {
-            let p = *self.ptr;
-            assume(p != 0 as *mut T);
-            slice::from_raw_parts(p, self.len)
-        }
+        self
     }
 }
 
@@ -1614,6 +1713,46 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     }
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<T> AsRef<Vec<T>> for Vec<T> {
+    fn as_ref(&self) -> &Vec<T> {
+        self
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<T> Into<Vec<T>> for Vec<T> {
+    fn into(self) -> Vec<T> {
+        self
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<T> AsRef<[T]> for Vec<T> {
+    fn as_ref(&self) -> &[T] {
+        self
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a, T: Clone> From<&'a [T]> for Vec<T> {
+    #[cfg(not(test))]
+    fn from(s: &'a [T]) -> Vec<T> {
+        s.to_vec()
+    }
+    #[cfg(test)]
+    fn from(s: &'a [T]) -> Vec<T> {
+        ::slice::to_vec(s)
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> From<&'a str> for Vec<u8> {
+    fn from(s: &'a str) -> Vec<u8> {
+        From::from(s.as_bytes())
+    }
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 // Clone-on-write
 ////////////////////////////////////////////////////////////////////////////////
index 56ca74dab1f0fd6d040e3b6bb6ed92cb68b4676e..af9db46f810b96b4a3fac3fcb3e97ef50f4cfb1f 100644 (file)
@@ -257,6 +257,7 @@ pub fn get_mut(&mut self, i: usize) -> Option<&mut T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf = VecDeque::new();
@@ -284,6 +285,7 @@ pub fn swap(&mut self, i: usize, j: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let buf: VecDeque<i32> = VecDeque::with_capacity(10);
@@ -307,6 +309,7 @@ pub fn capacity(&self) -> usize { self.cap - 1 }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf: VecDeque<i32> = vec![1].into_iter().collect();
@@ -328,6 +331,7 @@ pub fn reserve_exact(&mut self, additional: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf: VecDeque<i32> = vec![1].into_iter().collect();
@@ -403,6 +407,7 @@ pub fn reserve(&mut self, additional: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf = VecDeque::with_capacity(15);
@@ -489,6 +494,7 @@ pub fn shrink_to_fit(&mut self) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf = VecDeque::new();
@@ -512,6 +518,7 @@ pub fn truncate(&mut self, len: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf = VecDeque::new();
@@ -535,6 +542,7 @@ pub fn iter(&self) -> Iter<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf = VecDeque::new();
@@ -556,7 +564,7 @@ pub fn iter_mut(&mut self) -> IterMut<T> {
         }
     }
 
-    /// Consumes the list into an iterator yielding elements by value.
+    /// Consumes the list into a front-to-back iterator yielding elements by value.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn into_iter(self) -> IntoIter<T> {
         IntoIter {
@@ -644,6 +652,7 @@ pub fn is_empty(&self) -> bool { self.len() == 0 }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let mut v = VecDeque::new();
@@ -882,6 +891,7 @@ fn is_contiguous(&self) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf = VecDeque::new();
@@ -915,6 +925,7 @@ pub fn swap_back_remove(&mut self, index: usize) -> Option<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf = VecDeque::new();
@@ -948,6 +959,7 @@ pub fn swap_front_remove(&mut self, index: usize) -> Option<T> {
     ///
     /// # Examples
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf = VecDeque::new();
@@ -1321,6 +1333,7 @@ pub fn remove(&mut self, i: usize) -> Option<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf: VecDeque<_> = vec![1,2,3].into_iter().collect();
@@ -1383,6 +1396,7 @@ pub fn split_off(&mut self, at: usize) -> Self {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf: VecDeque<_> = vec![1, 2, 3].into_iter().collect();
@@ -1407,6 +1421,7 @@ impl<T: Clone> VecDeque<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecDeque;
     ///
     /// let mut buf = VecDeque::new();
@@ -1573,6 +1588,7 @@ fn next_back(&mut self) -> Option<&'a mut T> {
 impl<'a, T> ExactSizeIterator for IterMut<'a, T> {}
 
 /// A by-value VecDeque iterator
+#[derive(Clone)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct IntoIter<T> {
     inner: VecDeque<T>,
@@ -1689,18 +1705,32 @@ fn hash<H: Hasher>(&self, state: &mut H) {
 impl<A> Index<usize> for VecDeque<A> {
     type Output = A;
 
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, i: &usize) -> &A {
         self.get(*i).expect("Out of bounds access")
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, i: usize) -> &A {
+        self.get(i).expect("Out of bounds access")
+    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<A> IndexMut<usize> for VecDeque<A> {
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, i: &usize) -> &mut A {
         self.get_mut(*i).expect("Out of bounds access")
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, i: usize) -> &mut A {
+        self.get_mut(i).expect("Out of bounds access")
+    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
index 6e67d8763273d7c0156473b126b4662d061911f3..c994064d34724e8917c809c7a20f23725b5b6f66 100644 (file)
@@ -34,6 +34,7 @@
 /// # Examples
 ///
 /// ```
+/// # #![feature(collections)]
 /// use std::collections::VecMap;
 ///
 /// let mut months = VecMap::new();
@@ -67,26 +68,28 @@ pub struct VecMap<V> {
 }
 
 /// A view into a single entry in a map, which may either be vacant or occupied.
-#[unstable(feature = "collections",
-           reason = "precise API still under development")]
+
+#[stable(feature = "rust1", since = "1.0.0")]
 pub enum Entry<'a, V:'a> {
     /// A vacant Entry
+    #[stable(feature = "rust1", since = "1.0.0")]
     Vacant(VacantEntry<'a, V>),
+
     /// An occupied Entry
+    #[stable(feature = "rust1", since = "1.0.0")]
     Occupied(OccupiedEntry<'a, V>),
 }
 
 /// A vacant Entry.
-#[unstable(feature = "collections",
-           reason = "precise API still under development")]
+
+#[stable(feature = "rust1", since = "1.0.0")]
 pub struct VacantEntry<'a, V:'a> {
     map: &'a mut VecMap<V>,
     index: usize,
 }
 
 /// An occupied Entry.
-#[unstable(feature = "collections",
-           reason = "precise API still under development")]
+#[stable(feature = "rust1", since = "1.0.0")]
 pub struct OccupiedEntry<'a, V:'a> {
     map: &'a mut VecMap<V>,
     index: usize,
@@ -132,6 +135,7 @@ impl<V> VecMap<V> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     /// let mut map: VecMap<&str> = VecMap::new();
     /// ```
@@ -144,6 +148,7 @@ pub fn new() -> VecMap<V> { VecMap { v: vec![] } }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     /// let mut map: VecMap<&str> = VecMap::with_capacity(10);
     /// ```
@@ -158,6 +163,7 @@ pub fn with_capacity(capacity: usize) -> VecMap<V> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     /// let map: VecMap<String> = VecMap::with_capacity(10);
     /// assert!(map.capacity() >= 10);
@@ -177,6 +183,7 @@ pub fn capacity(&self) -> usize {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     /// let mut map: VecMap<&str> = VecMap::new();
     /// map.reserve_len(10);
@@ -201,6 +208,7 @@ pub fn reserve_len(&mut self, len: usize) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     /// let mut map: VecMap<&str> = VecMap::new();
     /// map.reserve_len_exact(10);
@@ -240,6 +248,7 @@ fn second<A, B>((_, b): (A, B)) -> B { b }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut map = VecMap::new();
@@ -268,6 +277,7 @@ pub fn iter<'r>(&'r self) -> Iter<'r, V> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut map = VecMap::new();
@@ -299,6 +309,7 @@ pub fn iter_mut<'r>(&'r mut self) -> IterMut<'r, V> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut map = VecMap::new();
@@ -325,6 +336,7 @@ fn filter<A>((i, v): (usize, Option<A>)) -> Option<(usize, A)> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut a = VecMap::new();
@@ -360,6 +372,7 @@ pub fn append(&mut self, other: &mut Self) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut a = VecMap::new();
@@ -416,6 +429,7 @@ pub fn split_off(&mut self, at: usize) -> Self {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut map = VecMap::new();
@@ -443,6 +457,7 @@ fn filter<A>((i, v): (usize, Option<A>)) -> Option<(usize, A)> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut a = VecMap::new();
@@ -460,6 +475,7 @@ pub fn len(&self) -> usize {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut a = VecMap::new();
@@ -477,6 +493,7 @@ pub fn is_empty(&self) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut a = VecMap::new();
@@ -492,6 +509,7 @@ pub fn clear(&mut self) { self.v.clear() }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut map = VecMap::new();
@@ -516,6 +534,7 @@ pub fn get(&self, key: &usize) -> Option<&V> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut map = VecMap::new();
@@ -534,6 +553,7 @@ pub fn contains_key(&self, key: &usize) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut map = VecMap::new();
@@ -562,6 +582,7 @@ pub fn get_mut(&mut self, key: &usize) -> Option<&mut V> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut map = VecMap::new();
@@ -587,6 +608,7 @@ pub fn insert(&mut self, key: usize, value: V) -> Option<V> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     ///
     /// let mut map = VecMap::new();
@@ -608,6 +630,7 @@ pub fn remove(&mut self, key: &usize) -> Option<V> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(collections)]
     /// use std::collections::VecMap;
     /// use std::collections::vec_map::Entry;
     ///
@@ -651,7 +674,7 @@ pub fn entry(&mut self, key: usize) -> Entry<V> {
 
 impl<'a, V> Entry<'a, V> {
     #[unstable(feature = "collections",
-               reason = "matches collection reform v2 specification, waiting for dust to settle")]
+               reason = "will soon be replaced by or_insert")]
     /// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant
     pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, V>> {
         match self {
@@ -798,6 +821,7 @@ fn extend<I: IntoIterator<Item=(usize, V)>>(&mut self, iter: I) {
     }
 }
 
+#[cfg(stage0)]
 impl<V> Index<usize> for VecMap<V> {
     type Output = V;
 
@@ -807,10 +831,49 @@ fn index<'a>(&'a self, i: &usize) -> &'a V {
     }
 }
 
+#[cfg(not(stage0))]
+impl<V> Index<usize> for VecMap<V> {
+    type Output = V;
+
+    #[inline]
+    fn index<'a>(&'a self, i: usize) -> &'a V {
+        self.get(&i).expect("key not present")
+    }
+}
+
+#[cfg(not(stage0))]
+impl<'a,V> Index<&'a usize> for VecMap<V> {
+    type Output = V;
+
+    #[inline]
+    fn index(&self, i: &usize) -> &V {
+        self.get(i).expect("key not present")
+    }
+}
+
+#[cfg(stage0)]
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<V> IndexMut<usize> for VecMap<V> {
+    #[inline]
+    fn index_mut(&mut self, i: &usize) -> &mut V {
+        self.get_mut(&i).expect("key not present")
+    }
+}
+
+#[cfg(not(stage0))]
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<V> IndexMut<usize> for VecMap<V> {
     #[inline]
-    fn index_mut<'a>(&'a mut self, i: &usize) -> &'a mut V {
+    fn index_mut(&mut self, i: usize) -> &mut V {
+        self.get_mut(&i).expect("key not present")
+    }
+}
+
+#[cfg(not(stage0))]
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a, V> IndexMut<&'a usize> for VecMap<V> {
+    #[inline]
+    fn index_mut(&mut self, i: &usize) -> &mut V {
         self.get_mut(i).expect("key not present")
     }
 }
index 488f0d756d329ef2374a097a83315ec99077298c..234cd6e0fd21ec23994810de197661005891dc0a 100644 (file)
@@ -43,8 +43,6 @@ struct Counter<'a, 'b> {
 }
 
 impl<'a, 'b, 'c> FnMut<(&'c i32,)> for Counter<'a, 'b> {
-    type Output = bool;
-
     extern "rust-call" fn call_mut(&mut self, (&x,): (&'c i32,)) -> bool {
         assert_eq!(x, self.expected[*self.i]);
         *self.i += 1;
@@ -52,6 +50,14 @@ extern "rust-call" fn call_mut(&mut self, (&x,): (&'c i32,)) -> bool {
     }
 }
 
+impl<'a, 'b, 'c> FnOnce<(&'c i32,)> for Counter<'a, 'b> {
+    type Output = bool;
+
+    extern "rust-call" fn call_once(mut self, args: (&'c i32,)) -> bool {
+        self.call_mut(args)
+    }
+}
+
 fn check<F>(a: &[i32], b: &[i32], expected: &[i32], f: F) where
     // FIXME Replace Counter with `Box<FnMut(_) -> _>`
     F: FnOnce(&BTreeSet<i32>, &BTreeSet<i32>, Counter) -> bool,
index 7f029340d25949bc44f7a18fcc7877a3d4da6eaf..f03a073e274e389712b6f994c74228073dda25b1 100644 (file)
@@ -20,6 +20,8 @@
 #![feature(unboxed_closures)]
 #![feature(unicode)]
 #![feature(unsafe_destructor)]
+#![feature(into_cow)]
+#![cfg_attr(test, feature(str_char))]
 
 #[macro_use] extern crate log;
 
index 0c3c82eea780f4db568ef80bd506dfcc33c2ca0e..4168fe88a4b562bd7d09e259abba3535a869e355 100644 (file)
@@ -1428,7 +1428,7 @@ fn zero_1kb_set_memory(b: &mut Bencher) {
             let mut v = Vec::<u8>::with_capacity(1024);
             unsafe {
                 let vp = v.as_mut_ptr();
-                ptr::set_memory(vp, 0, 1024);
+                ptr::write_bytes(vp, 0, 1024);
                 v.set_len(1024);
             }
             v
index 79c2d719862a9e014849518573432df247c6a32c..5cfa800905415dd855554be725c97731ac513448 100644 (file)
@@ -910,6 +910,34 @@ fn test_split_char_iterator_no_trailing() {
     assert_eq!(split, ["", "Märy häd ä little lämb", "Little lämb"]);
 }
 
+#[test]
+fn test_rsplit() {
+    let data = "\nMäry häd ä little lämb\nLittle lämb\n";
+
+    let split: Vec<&str> = data.rsplit(' ').collect();
+    assert_eq!(split, ["lämb\n", "lämb\nLittle", "little", "ä", "häd", "\nMäry"]);
+
+    let split: Vec<&str> = data.rsplit("lämb").collect();
+    assert_eq!(split, ["\n", "\nLittle ", "\nMäry häd ä little "]);
+
+    let split: Vec<&str> = data.rsplit(|c: char| c == 'ä').collect();
+    assert_eq!(split, ["mb\n", "mb\nLittle l", " little l", "d ", "ry h", "\nM"]);
+}
+
+#[test]
+fn test_rsplitn() {
+    let data = "\nMäry häd ä little lämb\nLittle lämb\n";
+
+    let split: Vec<&str> = data.rsplitn(1, ' ').collect();
+    assert_eq!(split, ["lämb\n", "\nMäry häd ä little lämb\nLittle"]);
+
+    let split: Vec<&str> = data.rsplitn(1, "lämb").collect();
+    assert_eq!(split, ["\n", "\nMäry häd ä little lämb\nLittle "]);
+
+    let split: Vec<&str> = data.rsplitn(1, |c: char| c == 'ä').collect();
+    assert_eq!(split, ["mb\n", "\nMäry häd ä little lämb\nLittle l"]);
+}
+
 #[test]
 fn test_words() {
     let data = "\n \tMäry   häd\tä  little lämb\nLittle lämb\n";
index 3938a610668b7c979046fbf5d763a27a9375be68..c94d8e2ed0c8d8d5ee79f0743ff6a826c30968cd 100644 (file)
 // Any trait
 ///////////////////////////////////////////////////////////////////////////////
 
-/// The `Any` trait is implemented by all `'static` types, and can be used for
-/// dynamic typing
+/// A type to emulate dynamic typing. See the [module-level documentation][mod] for more details.
 ///
-/// Every type with no non-`'static` references implements `Any`, so `Any` can
-/// be used as a trait object to emulate the effects dynamic typing.
+/// Every type with no non-`'static` references implements `Any`.
+///
+/// [mod]: ../index.html
 #[stable(feature = "rust1", since = "1.0.0")]
 pub trait Any: 'static {
     /// Get the `TypeId` of `self`
index edb11df54894c8ec502755d6c9978e8483ce0e3a..b2c23f051d5f1d1b96dd9eecd3b71915717c4078 100644 (file)
@@ -14,6 +14,8 @@
 
 #![unstable(feature = "core")] // not yet reviewed
 
+#![doc(primitive = "array")]
+
 use clone::Clone;
 use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
 use fmt;
index e3a7f23851cde3905ecc061368c2a00340330626..9e6dbce0325935da3737fe1c10cbf511c7afaa68 100644 (file)
@@ -220,6 +220,7 @@ pub fn set(&self, value: T) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::cell::Cell;
     ///
     /// let c = Cell::new(5);
@@ -712,7 +713,11 @@ pub fn new(value: T) -> UnsafeCell<T> {
     /// ```
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn get(&self) -> *mut T { &self.value as *const T as *mut T }
+    pub fn get(&self) -> *mut T {
+        // FIXME(#23542) Replace with type ascription.
+        #![allow(trivial_casts)]
+        &self.value as *const T as *mut T
+    }
 
     /// Unwraps the value
     ///
index b37bad5f7546c21094828cf36e6c54e70593d210..9ab8ab8672dfac71670014abe794beab39f3c505 100644 (file)
@@ -19,7 +19,8 @@
 //! could do the following:
 //!
 //! ```
-//! use core::num::SignedInt;
+//! # #![feature(core)]
+//! use std::num::SignedInt;
 //!
 //! struct FuzzyNum {
 //!     num: i32,
@@ -398,6 +399,7 @@ pub fn max<T: Ord>(v1: T, v2: T) -> T {
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::cmp;
 ///
 /// assert_eq!(Some(1), cmp::partial_min(1, 2));
@@ -407,6 +409,7 @@ pub fn max<T: Ord>(v1: T, v2: T) -> T {
 /// When comparison is impossible:
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::cmp;
 ///
 /// let result = cmp::partial_min(std::f64::NAN, 1.0);
@@ -429,6 +432,7 @@ pub fn partial_min<T: PartialOrd>(v1: T, v2: T) -> Option<T> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::cmp;
 ///
 /// assert_eq!(Some(2), cmp::partial_max(1, 2));
@@ -438,6 +442,7 @@ pub fn partial_min<T: PartialOrd>(v1: T, v2: T) -> Option<T> {
 /// When comparison is impossible:
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::cmp;
 ///
 /// let result = cmp::partial_max(std::f64::NAN, 1.0);
diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs
new file mode 100644 (file)
index 0000000..65a226d
--- /dev/null
@@ -0,0 +1,113 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Traits for conversions between types.
+//!
+//! The traits in this module provide a general way to talk about
+//! conversions from one type to another. They follow the standard
+//! Rust conventions of `as`/`to`/`into`/`from`.
+
+#![unstable(feature = "convert",
+            reason = "recently added, experimental traits")]
+
+use marker::Sized;
+
+/// A cheap, reference-to-reference conversion.
+pub trait AsRef<T: ?Sized> {
+    /// Perform the conversion.
+    fn as_ref(&self) -> &T;
+}
+
+/// A cheap, mutable reference-to-mutable reference conversion.
+pub trait AsMut<T: ?Sized> {
+    /// Perform the conversion.
+    fn as_mut(&mut self) -> &mut T;
+}
+
+/// A conversion that consumes `self`, which may or may not be
+/// expensive.
+pub trait Into<T>: Sized {
+    /// Perform the conversion.
+    fn into(self) -> T;
+}
+
+/// Construct `Self` via a conversion.
+pub trait From<T> {
+    /// Perform the conversion.
+    fn from(T) -> Self;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// GENERIC IMPLS
+////////////////////////////////////////////////////////////////////////////////
+
+// As implies Into
+impl<'a, T: ?Sized, U: ?Sized> Into<&'a U> for &'a T where T: AsRef<U> {
+    fn into(self) -> &'a U {
+        self.as_ref()
+    }
+}
+
+// As lifts over &
+impl<'a, T: ?Sized, U: ?Sized> AsRef<U> for &'a T where T: AsRef<U> {
+    fn as_ref(&self) -> &U {
+        <T as AsRef<U>>::as_ref(*self)
+    }
+}
+
+// As lifts over &mut
+impl<'a, T: ?Sized, U: ?Sized> AsRef<U> for &'a mut T where T: AsRef<U> {
+    fn as_ref(&self) -> &U {
+        <T as AsRef<U>>::as_ref(*self)
+    }
+}
+
+// AsMut implies Into
+impl<'a, T: ?Sized, U: ?Sized> Into<&'a mut U> for &'a mut T where T: AsMut<U> {
+    fn into(self) -> &'a mut U {
+        (*self).as_mut()
+    }
+}
+
+// AsMut lifts over &mut
+impl<'a, T: ?Sized, U: ?Sized> AsMut<U> for &'a mut T where T: AsMut<U> {
+    fn as_mut(&mut self) -> &mut U {
+        (*self).as_mut()
+    }
+}
+
+// From implies Into
+impl<T, U> Into<U> for T where U: From<T> {
+    fn into(self) -> U {
+        U::from(self)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// CONCRETE IMPLS
+////////////////////////////////////////////////////////////////////////////////
+
+impl<T> AsRef<[T]> for [T] {
+    fn as_ref(&self) -> &[T] {
+        self
+    }
+}
+
+impl<T> AsMut<[T]> for [T] {
+    fn as_mut(&mut self) -> &mut [T] {
+        self
+    }
+}
+
+impl AsRef<str> for str {
+    fn as_ref(&self) -> &str {
+        self
+    }
+}
index 161f6c78921630e68c952fdeb90de7fe4627620c..d7b4c9411fb4efc0bfbd9f715dc5ab7cb2df5356 100644 (file)
@@ -48,6 +48,7 @@
 //! For example,
 //!
 //! ```
+//! # #![feature(os, old_io, old_path)]
 //! use std::error::FromError;
 //! use std::old_io::{File, IoError};
 //! use std::os::{MemoryMap, MapError};
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use prelude::*;
-use fmt::Display;
+use fmt::{Debug, Display};
 
 /// Base functionality for all errors in Rust.
-#[unstable(feature = "core",
-           reason = "the exact API of this trait may change")]
-pub trait Error: Display {
-    /// A short description of the error; usually a static string.
+#[stable(feature = "rust1", since = "1.0.0")]
+pub trait Error: Debug + Display + Send {
+    /// A short description of the error.
+    ///
+    /// The description should not contain newlines or sentence-ending
+    /// punctuation, to facilitate embedding in larger user-facing
+    /// strings.
+    #[stable(feature = "rust1", since = "1.0.0")]
     fn description(&self) -> &str;
 
     /// The lower-level cause of this error, if any.
+    #[stable(feature = "rust1", since = "1.0.0")]
     fn cause(&self) -> Option<&Error> { None }
 }
 
index 19cd34cdb0933e71f0a9470d9d6dae718146d6f2..93a7d2bb17b92237a305a8b5ac033060b51a12b1 100644 (file)
@@ -19,6 +19,7 @@
 //! # Examples
 //!
 //! ```
+//! # #![feature(core)]
 //! # #![feature(unboxed_closures)]
 //!
 //! use std::finally::Finally;
@@ -70,6 +71,7 @@ fn finally<G>(&mut self, mut dtor: G) -> T where G: FnMut() {
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::finally::try_finally;
 ///
 /// struct State<'a> { buffer: &'a mut [u8], len: usize }
index 741cf7b47fa1e10236b031425a6926bc96c81b25..aa0d0a1539a30e045ba424a52b1f4861da689629 100644 (file)
@@ -624,6 +624,7 @@ pub fn precision(&self) -> Option<usize> { self.precision }
     /// # Examples
     ///
     /// ```rust
+    /// # #![feature(debug_builders, core)]
     /// use std::fmt;
     ///
     /// struct Foo {
@@ -655,6 +656,7 @@ pub fn debug_struct<'b>(&'b mut self, name: &str) -> DebugStruct<'b, 'a> {
     /// # Examples
     ///
     /// ```rust
+    /// # #![feature(debug_builders, core)]
     /// use std::fmt;
     ///
     /// struct Foo(i32, String);
@@ -683,6 +685,7 @@ pub fn debug_tuple<'b>(&'b mut self, name: &str) -> DebugTuple<'b, 'a> {
     /// # Examples
     ///
     /// ```rust
+    /// # #![feature(debug_builders, core)]
     /// use std::fmt;
     ///
     /// struct Foo(Vec<i32>);
@@ -712,6 +715,7 @@ pub fn debug_set<'b>(&'b mut self, name: &str) -> DebugSet<'b, 'a> {
     /// # Examples
     ///
     /// ```rust
+    /// # #![feature(debug_builders, core)]
     /// use std::fmt;
     ///
     /// struct Foo(Vec<(String, i32)>);
@@ -829,6 +833,8 @@ fn fmt(&self, f: &mut Formatter) -> Result {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> Pointer for *mut T {
     fn fmt(&self, f: &mut Formatter) -> Result {
+        // FIXME(#23542) Replace with type ascription.
+        #![allow(trivial_casts)]
         Pointer::fmt(&(*self as *const T), f)
     }
 }
@@ -836,6 +842,8 @@ fn fmt(&self, f: &mut Formatter) -> Result {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T> Pointer for &'a T {
     fn fmt(&self, f: &mut Formatter) -> Result {
+        // FIXME(#23542) Replace with type ascription.
+        #![allow(trivial_casts)]
         Pointer::fmt(&(*self as *const T), f)
     }
 }
@@ -843,6 +851,8 @@ fn fmt(&self, f: &mut Formatter) -> Result {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T> Pointer for &'a mut T {
     fn fmt(&self, f: &mut Formatter) -> Result {
+        // FIXME(#23542) Replace with type ascription.
+        #![allow(trivial_casts)]
         Pointer::fmt(&(&**self as *const T), f)
     }
 }
index fe22ee60da688ef25d403d4041a27d335d2c149f..56d2eabc095a3f0f4aa538481a590fe12504df55 100644 (file)
@@ -13,6 +13,7 @@
 // FIXME: #6220 Implement floating point formatting
 
 #![allow(unsigned_negation)]
+#![allow(trivial_numeric_casts)]
 
 use fmt;
 use iter::IteratorExt;
@@ -146,6 +147,7 @@ fn digit(&self, x: u8) -> u8 {
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::fmt::radix;
 /// assert_eq!(format!("{}", radix(55, 36)), "1j".to_string());
 /// ```
index fdc0020dfcd618cb289e990f0ae45cfe6998a3ca..2feb2f8b1e36372d8121b54f2167b631c2d04879 100644 (file)
@@ -16,6 +16,7 @@
 //! # Examples
 //!
 //! ```rust
+//! # #![feature(hash)]
 //! use std::hash::{hash, Hash, SipHasher};
 //!
 //! #[derive(Hash)]
@@ -35,6 +36,7 @@
 //! the trait `Hash`:
 //!
 //! ```rust
+//! # #![feature(hash)]
 //! use std::hash::{hash, Hash, Hasher, SipHasher};
 //!
 //! struct Person {
@@ -90,7 +92,7 @@ fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) where Self: Sized {
 #[stable(feature = "rust1", since = "1.0.0")]
 pub trait Hasher {
     /// Completes a round of hashing, producing the output hash generated.
-    #[unstable(feature = "hash", reason = "module was recently redesigned")]
+    #[stable(feature = "rust1", since = "1.0.0")]
     fn finish(&self) -> u64;
 
     /// Writes some data into this `Hasher`
@@ -180,6 +182,8 @@ fn hash<H: Hasher>(&self, state: &mut H) {
                 }
 
                 fn hash_slice<H: Hasher>(data: &[$ty], state: &mut H) {
+                    // FIXME(#23542) Replace with type ascription.
+                    #![allow(trivial_casts)]
                     let newlen = data.len() * ::$ty::BYTES as usize;
                     let ptr = data.as_ptr() as *const u8;
                     state.write(unsafe { slice::from_raw_parts(ptr, newlen) })
index 1462d07652d08d6f52c1719237b74a4fc23a152b..1f1044b0b21520d0148877edbe132faf6e9c5a6e 100644 (file)
 
 use marker::Sized;
 
+#[cfg(stage0)] pub use self::copy_memory as copy;
+#[cfg(stage0)] pub use self::set_memory as write_bytes;
+#[cfg(stage0)] pub use self::copy_nonoverlapping_memory as copy_nonoverlapping;
+
 extern "rust-intrinsic" {
 
     // NB: These intrinsics take unsafe pointers because they mutate aliased
     /// Copies `count * size_of<T>` bytes from `src` to `dst`. The source
     /// and destination may *not* overlap.
     ///
-    /// `copy_nonoverlapping_memory` is semantically equivalent to C's `memcpy`.
+    /// `copy_nonoverlapping` is semantically equivalent to C's `memcpy`.
     ///
     /// # Safety
     ///
     /// A safe swap function:
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::mem;
     /// use std::ptr;
     ///
     ///         let mut t: T = mem::uninitialized();
     ///
     ///         // Perform the swap, `&mut` pointers never alias
-    ///         ptr::copy_nonoverlapping_memory(&mut t, &*x, 1);
-    ///         ptr::copy_nonoverlapping_memory(x, &*y, 1);
-    ///         ptr::copy_nonoverlapping_memory(y, &t, 1);
+    ///         ptr::copy_nonoverlapping(&mut t, &*x, 1);
+    ///         ptr::copy_nonoverlapping(x, &*y, 1);
+    ///         ptr::copy_nonoverlapping(y, &t, 1);
     ///
     ///         // y and t now point to the same thing, but we need to completely forget `tmp`
     ///         // because it's no longer relevant.
     /// }
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[cfg(not(stage0))]
+    pub fn copy_nonoverlapping<T>(dst: *mut T, src: *const T, count: usize);
+
+    /// dox
+    #[stable(feature = "rust1", since = "1.0.0")]
+    #[cfg(stage0)]
     pub fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: usize);
 
     /// Copies `count * size_of<T>` bytes from `src` to `dst`. The source
     /// and destination may overlap.
     ///
-    /// `copy_memory` is semantically equivalent to C's `memmove`.
+    /// `copy` is semantically equivalent to C's `memmove`.
     ///
     /// # Safety
     ///
     /// Efficiently create a Rust vector from an unsafe buffer:
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::ptr;
     ///
     /// unsafe fn from_buf_raw<T>(ptr: *const T, elts: uint) -> Vec<T> {
     ///     let mut dst = Vec::with_capacity(elts);
     ///     dst.set_len(elts);
-    ///     ptr::copy_memory(dst.as_mut_ptr(), ptr, elts);
+    ///     ptr::copy(dst.as_mut_ptr(), ptr, elts);
     ///     dst
     /// }
     /// ```
     ///
+    #[cfg(not(stage0))]
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn copy<T>(dst: *mut T, src: *const T, count: usize);
+
+    /// dox
+    #[cfg(stage0)]
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn copy_memory<T>(dst: *mut T, src: *const T, count: usize);
 
     /// Invokes memset on the specified pointer, setting `count * size_of::<T>()`
     /// bytes of memory starting at `dst` to `c`.
+    #[cfg(not(stage0))]
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn write_bytes<T>(dst: *mut T, val: u8, count: usize);
+
+    /// dox
+    #[cfg(stage0)]
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn set_memory<T>(dst: *mut T, val: u8, count: usize);
 
index 4f8b1c21ab2e517bd5112ac9fea70a44b5824420..5f5b8ef73ef54edf1702e92c64369b5e318a38d6 100644 (file)
@@ -334,6 +334,7 @@ fn enumerate(self) -> Enumerate<Self> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let xs = [100, 200, 300];
     /// let mut it = xs.iter().cloned().peekable();
     /// assert_eq!(*it.peek().unwrap(), 100);
@@ -465,6 +466,7 @@ fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let xs = [2, 3];
     /// let ys = [0, 1, 0, 1, 2];
     /// let it = xs.iter().flat_map(|&x| std::iter::count(0, 1).take(x));
@@ -521,6 +523,7 @@ fn fuse(self) -> Fuse<Self> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::iter::AdditiveIterator;
     ///
     /// let a = [1, 4, 2, 3, 8, 9, 6];
@@ -563,6 +566,7 @@ fn by_ref(&mut self) -> &mut Self { self }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let a = [1, 2, 3, 4, 5];
     /// let b: Vec<_> = a.iter().cloned().collect();
     /// assert_eq!(a, b);
@@ -579,6 +583,7 @@ fn collect<B: FromIterator<Self::Item>>(self) -> B {
     /// do not.
     ///
     /// ```
+    /// # #![feature(core)]
     /// let vec = vec![1, 2, 3, 4];
     /// let (even, odd): (Vec<_>, Vec<_>) = vec.into_iter().partition(|&n| n % 2 == 0);
     /// assert_eq!(even, [2, 4]);
@@ -648,6 +653,7 @@ fn all<F>(&mut self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let a = [1, 2, 3, 4, 5];
     /// let mut it = a.iter();
     /// assert!(it.any(|x| *x == 3));
@@ -668,6 +674,7 @@ fn any<F>(&mut self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let a = [1, 2, 3, 4, 5];
     /// let mut it = a.iter();
     /// assert_eq!(it.find(|&x| *x == 3).unwrap(), &3);
@@ -690,6 +697,7 @@ fn find<P>(&mut self, mut predicate: P) -> Option<Self::Item> where
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let a = [1, 2, 3, 4, 5];
     /// let mut it = a.iter();
     /// assert_eq!(it.position(|x| *x == 3).unwrap(), 2);
@@ -718,6 +726,7 @@ fn position<P>(&mut self, mut predicate: P) -> Option<usize> where
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let a = [1, 2, 2, 4, 5];
     /// let mut it = a.iter();
     /// assert_eq!(it.rposition(|x| *x == 2).unwrap(), 2);
@@ -795,6 +804,7 @@ fn min(self) -> Option<Self::Item> where Self::Item: Ord
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::iter::MinMaxResult::{NoElements, OneElement, MinMax};
     ///
     /// let a: [i32; 0] = [];
@@ -860,7 +870,8 @@ fn min_max(mut self) -> MinMaxResult<Self::Item> where Self::Item: Ord
     /// # Examples
     ///
     /// ```
-    /// use core::num::SignedInt;
+    /// # #![feature(core)]
+    /// use std::num::SignedInt;
     ///
     /// let a = [-3, 0, 1, 5, -10];
     /// assert_eq!(*a.iter().max_by(|x| x.abs()).unwrap(), -10);
@@ -890,7 +901,8 @@ fn max_by<B: Ord, F>(self, mut f: F) -> Option<Self::Item> where
     /// # Examples
     ///
     /// ```
-    /// use core::num::SignedInt;
+    /// # #![feature(core)]
+    /// use std::num::SignedInt;
     ///
     /// let a = [-3, 0, 1, 5, -10];
     /// assert_eq!(*a.iter().min_by(|x| x.abs()).unwrap(), 0);
@@ -940,6 +952,7 @@ fn rev(self) -> Rev<Self> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let a = [(1, 2), (3, 4)];
     /// let (left, right): (Vec<_>, Vec<_>) = a.iter().cloned().unzip();
     /// assert_eq!([1, 3], left);
@@ -1146,6 +1159,7 @@ pub trait AdditiveIterator<A> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::iter::AdditiveIterator;
     ///
     /// let a = [1, 2, 3, 4, 5];
@@ -1188,6 +1202,7 @@ pub trait MultiplicativeIterator<A> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::iter::{count, MultiplicativeIterator};
     ///
     /// fn factorial(n: usize) -> usize {
@@ -1248,6 +1263,7 @@ impl<T: Clone> MinMaxResult<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::iter::MinMaxResult::{self, NoElements, OneElement, MinMax};
     ///
     /// let r: MinMaxResult<i32> = NoElements;
@@ -2292,6 +2308,7 @@ fn idx(&mut self, index: usize) -> Option<I::Item> {
 /// An iterator that yields sequential Fibonacci numbers, and stops on overflow.
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::iter::Unfold;
 /// use std::num::Int; // For `.checked_add()`
 ///
@@ -2693,6 +2710,7 @@ pub struct RangeStepInclusive<A> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::iter::range_step_inclusive;
 ///
 /// for i in range_step_inclusive(0, 10, 2) {
index 29cc11d5a60a18e7ad7062c4c36c6aa8f33bca1e..a2b13584270940317f8935b3a7674d5e4d841b22 100644 (file)
@@ -56,6 +56,7 @@
        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
        html_root_url = "http://doc.rust-lang.org/nightly/",
        html_playground_url = "http://play.rust-lang.org/")]
+#![doc(test(no_crate_inject))]
 
 #![feature(no_std)]
 #![no_std]
 pub mod cmp;
 pub mod clone;
 pub mod default;
+pub mod convert;
 
 /* Core types and methods on primitives */
 
index c647b037944aec0c401ac1fe14c618024f2effec..40e32f4171a2d509900ccc4f685374710dfbef1f 100644 (file)
@@ -231,6 +231,7 @@ macro_rules! writeln {
 /// Iterators:
 ///
 /// ```
+/// # #![feature(core)]
 /// fn divide_by_three(x: u32) -> u32 { // one of the poorest implementations of x/3
 ///     for i in std::iter::count(0, 1) {
 ///         if 3*i < i { panic!("u32 overflow"); }
index 1b866501b8ea1a3d0fb62d347f1af1af990ddabf..88c10e3661e7a7714bea28e9c8f7d6788cbcf743 100644 (file)
@@ -39,6 +39,8 @@ pub unsafe trait Send : MarkerTrait {
     // empty.
 }
 
+unsafe impl Send for .. { }
+
 impl<T> !Send for *const T { }
 impl<T> !Send for *mut T { }
 impl !Send for Managed { }
@@ -203,6 +205,8 @@ pub unsafe trait Sync : MarkerTrait {
     // Empty
 }
 
+unsafe impl Sync for .. { }
+
 impl<T> !Sync for *const T { }
 impl<T> !Sync for *mut T { }
 impl !Sync for Managed { }
@@ -270,6 +274,7 @@ fn clone(&self) -> $t<T> {
 /// any methods, but instead is used to gate access to data.
 ///
 /// FIXME. Better documentation needed here!
+#[stable(feature = "rust1", since = "1.0.0")]
 pub trait MarkerTrait : PhantomFn<Self,Self> { }
 //                                    ~~~~~ <-- FIXME(#22806)?
 //
@@ -319,6 +324,7 @@ impl<T:?Sized> MarkerTrait for T { }
 /// `MarkerTrait`:
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::marker::MarkerTrait;
 /// trait Even : MarkerTrait { }
 /// ```
index 551f97ead12d8262f1f2f30860ea91a410e9eb74..1e6fb51a8a528e9d75bac0d6fa36da598104f057 100644 (file)
@@ -313,6 +313,8 @@ pub fn drop<T>(_x: T) { }
 #[inline]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
+    // FIXME(#23542) Replace with type ascription.
+    #![allow(trivial_casts)]
     ptr::read(src as *const T as *const U)
 }
 
index ae1b5f65eeb52575cf30acd04ecbeb1ca8ce78d9..d211b0f9928cd2db17e276f8c72611462ff97b5e 100644 (file)
@@ -282,7 +282,8 @@ fn trunc(self) -> f32 {
     /// The fractional part of the number, satisfying:
     ///
     /// ```
-    /// use core::num::Float;
+    /// # #![feature(core)]
+    /// use std::num::Float;
     ///
     /// let x = 1.65f32;
     /// assert!(x == x.trunc() + x.fract())
index 4a73c1e8fcf45415849f0c0e3af32497818e35f4..1421fdd72f2335c09855183f991cedc228d9b754 100644 (file)
@@ -289,7 +289,8 @@ fn trunc(self) -> f64 {
     /// The fractional part of the number, satisfying:
     ///
     /// ```
-    /// use core::num::Float;
+    /// # #![feature(core)]
+    /// use std::num::Float;
     ///
     /// let x = 1.65f64;
     /// assert!(x == x.trunc() + x.fract())
index 5ea60d0d96d29f44943a0c751cf760d7c7deef0c..efafce3fdefb04537a4b455af99ee20941e00ed9 100644 (file)
@@ -12,5 +12,6 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 #![doc(primitive = "i16")]
+#![allow(trivial_numeric_casts)]
 
 int_module! { i16, 16 }
index 7d9faa998c12e87769a8519d416b7085d802dcbf..72b0236a8d2a4c12814ab55febe6f2cda730bbbe 100644 (file)
@@ -12,5 +12,6 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 #![doc(primitive = "i32")]
+#![allow(trivial_numeric_casts)]
 
 int_module! { i32, 32 }
index 5a70911387b9b7192ab7a86fae52a90e77ddaa7b..a64a4febd5a963448fab5c413646509871a896a6 100644 (file)
@@ -12,5 +12,6 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 #![doc(primitive = "i64")]
+#![allow(trivial_numeric_casts)]
 
 int_module! { i64, 64 }
index 1d7d78ffa6c2352a20ad49cbfda99a0b3fc7ce17..459814875ee0ee1686bfe88b502784a9139ce70a 100644 (file)
@@ -12,5 +12,6 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 #![doc(primitive = "i8")]
+#![allow(trivial_numeric_casts)]
 
 int_module! { i8, 8 }
index fe0d6d13c4c06483649bdbf737fe89c68048cf43..675f568a96099e7c8728f498d5168845c64d5292 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![doc(hidden)]
+#![allow(trivial_numeric_casts)]
 
 macro_rules! int_module { ($T:ty, $bits:expr) => (
 
index 0fd0d90b12501ea87b257bb523b56a1c6d0f1b47..9af51a36748263a2474b26e4c9fc5f7878afe3c8 100644 (file)
@@ -16,6 +16,7 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 #![doc(primitive = "isize")]
+#![allow(trivial_numeric_casts)]
 
 #[cfg(target_pointer_width = "32")]
 int_module! { isize, 32 }
index 17ef0ecb1c0da6feb4905230334690661eadd29d..0eec875afc3bb15a47e1734bb62468f2bc6d8479 100644 (file)
@@ -14,6 +14,7 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 #![allow(missing_docs)]
+#![allow(trivial_numeric_casts)]
 
 use self::wrapping::{OverflowingOps, WrappingOps};
 
@@ -85,6 +86,7 @@ pub trait Int
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// let n = 0b01001100u8;
@@ -100,6 +102,7 @@ pub trait Int
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// let n = 0b01001100u8;
@@ -119,6 +122,7 @@ fn count_zeros(self) -> u32 {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// let n = 0b0101000u16;
@@ -135,6 +139,7 @@ fn count_zeros(self) -> u32 {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// let n = 0b0101000u16;
@@ -151,6 +156,7 @@ fn count_zeros(self) -> u32 {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// let n = 0x0123456789ABCDEFu64;
@@ -168,6 +174,7 @@ fn count_zeros(self) -> u32 {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// let n = 0x0123456789ABCDEFu64;
@@ -392,6 +399,7 @@ fn saturating_sub(self, other: Self) -> Self {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Int;
     ///
     /// assert_eq!(2.pow(4), 16);
@@ -787,6 +795,7 @@ pub fn min_value() -> $T { (-1 as $T) << ($BITS - 1) }
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b01001100u8;
@@ -803,6 +812,7 @@ pub fn count_ones(self) -> u32 { (self as $UnsignedT).count_ones() }
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b01001100u8;
@@ -822,6 +832,7 @@ pub fn count_zeros(self) -> u32 {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b0101000u16;
@@ -841,6 +852,7 @@ pub fn leading_zeros(self) -> u32 {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b0101000u16;
@@ -860,6 +872,7 @@ pub fn trailing_zeros(self) -> u32 {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0x0123456789ABCDEFu64;
@@ -881,6 +894,7 @@ pub fn rotate_left(self, n: u32) -> $T {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0x0123456789ABCDEFu64;
@@ -1112,6 +1126,7 @@ pub fn saturating_sub(self, other: $T) -> $T {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// assert_eq!(2.pow(4), 16);
@@ -1277,6 +1292,7 @@ pub fn max_value() -> $T { -1 }
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b01001100u8;
@@ -1295,6 +1311,7 @@ pub fn count_ones(self) -> u32 {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b01001100u8;
@@ -1314,6 +1331,7 @@ pub fn count_zeros(self) -> u32 {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b0101000u16;
@@ -1333,6 +1351,7 @@ pub fn leading_zeros(self) -> u32 {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0b0101000u16;
@@ -1352,6 +1371,7 @@ pub fn trailing_zeros(self) -> u32 {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0x0123456789ABCDEFu64;
@@ -1375,6 +1395,7 @@ pub fn rotate_left(self, n: u32) -> $T {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// let n = 0x0123456789ABCDEFu64;
@@ -1606,6 +1627,7 @@ pub fn saturating_sub(self, other: $T) -> $T {
         /// # Examples
         ///
         /// ```rust
+        /// # #![feature(core)]
         /// use std::num::Int;
         ///
         /// assert_eq!(2.pow(4), 16);
@@ -2266,6 +2288,7 @@ impl FromPrimitive for $T {
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::num;
 ///
 /// let twenty: f32 = num::cast(0x14).unwrap();
index 21635799a77a26a458619bcd3b3431ce2ae0c7ba..289c5dbd08ea0eb02bf6c028ff2ec62e79ca4e80 100644 (file)
@@ -12,5 +12,6 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 #![doc(primitive = "u16")]
+#![allow(trivial_numeric_casts)]
 
 uint_module! { u16, i16, 16 }
index 7d520770503d4b2507cb483afc8bcf04204ca443..6d0b6b0e5eaf9799a4f472bbc2efbbff8c8ea2c5 100644 (file)
@@ -12,5 +12,6 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 #![doc(primitive = "u32")]
+#![allow(trivial_numeric_casts)]
 
 uint_module! { u32, i32, 32 }
index f10822077dc7511e3e44d12596e6e2198e0e941d..bf8747fdb6e2f45461a50eeea9795a97e85ecb33 100644 (file)
@@ -12,5 +12,6 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 #![doc(primitive = "u64")]
+#![allow(trivial_numeric_casts)]
 
 uint_module! { u64, i64, 64 }
index 3d6922b07b19407b325941dd14888e4fea334214..05199735d4acb3f6aee6963963896308dab95ebd 100644 (file)
@@ -12,5 +12,6 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 #![doc(primitive = "u8")]
+#![allow(trivial_numeric_casts)]
 
 uint_module! { u8, i8, 8 }
index d0c4885ad00b77ebbfaef418cb230976e6955f21..c22f31cc57ea84efba5238460fee13f32afd64ee 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![doc(hidden)]
+#![allow(trivial_numeric_casts)]
 
 macro_rules! uint_module { ($T:ty, $T_SIGNED:ty, $bits:expr) => (
 
index 602ef4fe45e734e0f1a931a2a50c98ce98e0511a..82dd3312782c554fdebaadb100d1d1c7df08d90f 100644 (file)
@@ -16,5 +16,6 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 #![doc(primitive = "usize")]
+#![allow(trivial_numeric_casts)]
 
 uint_module! { usize, isize, ::isize::BITS }
index 6324e8fa874439bf54d850809716a54146753534..fee40115f39525bcca9651cce1cfc47cb3cc3ae6 100644 (file)
@@ -898,7 +898,7 @@ macro_rules! shr_impl_all {
 /// impl Index<Bar> for Foo {
 ///     type Output = Foo;
 ///
-///     fn index<'a>(&'a self, _index: &Bar) -> &'a Foo {
+///     fn index<'a>(&'a self, _index: Bar) -> &'a Foo {
 ///         println!("Indexing!");
 ///         self
 ///     }
@@ -917,8 +917,14 @@ pub trait Index<Idx: ?Sized> {
     type Output: ?Sized;
 
     /// The method for the indexing (`Foo[Bar]`) operation
+    #[cfg(stage0)]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn index<'a>(&'a self, index: &Idx) -> &'a Self::Output;
+
+    /// The method for the indexing (`Foo[Bar]`) operation
+    #[cfg(not(stage0))]
+    #[stable(feature = "rust1", since = "1.0.0")]
+    fn index<'a>(&'a self, index: Idx) -> &'a Self::Output;
 }
 
 /// The `IndexMut` trait is used to specify the functionality of indexing
@@ -939,13 +945,13 @@ pub trait Index<Idx: ?Sized> {
 /// impl Index<Bar> for Foo {
 ///     type Output = Foo;
 ///
-///     fn index<'a>(&'a self, _index: &Bar) -> &'a Foo {
+///     fn index<'a>(&'a self, _index: Bar) -> &'a Foo {
 ///         self
 ///     }
 /// }
 ///
 /// impl IndexMut<Bar> for Foo {
-///     fn index_mut<'a>(&'a mut self, _index: &Bar) -> &'a mut Foo {
+///     fn index_mut<'a>(&'a mut self, _index: Bar) -> &'a mut Foo {
 ///         println!("Indexing!");
 ///         self
 ///     }
@@ -960,8 +966,14 @@ pub trait Index<Idx: ?Sized> {
 #[stable(feature = "rust1", since = "1.0.0")]
 pub trait IndexMut<Idx: ?Sized>: Index<Idx> {
     /// The method for the indexing (`Foo[Bar]`) operation
+    #[cfg(stage0)]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn index_mut<'a>(&'a mut self, index: &Idx) -> &'a mut Self::Output;
+
+    /// The method for the indexing (`Foo[Bar]`) operation
+    #[cfg(not(stage0))]
+    #[stable(feature = "rust1", since = "1.0.0")]
+    fn index_mut<'a>(&'a mut self, index: Idx) -> &'a mut Self::Output;
 }
 
 /// An unbounded range.
@@ -1136,6 +1148,7 @@ fn deref_mut(&mut self) -> &mut T { *self }
 #[lang="fn"]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_paren_sugar]
+#[cfg(stage0)]
 pub trait Fn<Args> {
     /// The returned type after the call operator is used.
     type Output;
@@ -1144,10 +1157,21 @@ pub trait Fn<Args> {
     extern "rust-call" fn call(&self, args: Args) -> Self::Output;
 }
 
+/// A version of the call operator that takes an immutable receiver.
+#[lang="fn"]
+#[stable(feature = "rust1", since = "1.0.0")]
+#[rustc_paren_sugar]
+#[cfg(not(stage0))]
+pub trait Fn<Args> : FnMut<Args> {
+    /// This is called when the call operator is used.
+    extern "rust-call" fn call(&self, args: Args) -> Self::Output;
+}
+
 /// A version of the call operator that takes a mutable receiver.
 #[lang="fn_mut"]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_paren_sugar]
+#[cfg(stage0)]
 pub trait FnMut<Args> {
     /// The returned type after the call operator is used.
     type Output;
@@ -1156,6 +1180,16 @@ pub trait FnMut<Args> {
     extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
 }
 
+/// A version of the call operator that takes a mutable receiver.
+#[lang="fn_mut"]
+#[stable(feature = "rust1", since = "1.0.0")]
+#[rustc_paren_sugar]
+#[cfg(not(stage0))]
+pub trait FnMut<Args> : FnOnce<Args> {
+    /// This is called when the call operator is used.
+    extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
+}
+
 /// A version of the call operator that takes a by-value receiver.
 #[lang="fn_once"]
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -1168,6 +1202,7 @@ pub trait FnOnce<Args> {
     extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
 }
 
+#[cfg(stage0)]
 impl<F: ?Sized, A> FnMut<A> for F
     where F : Fn<A>
 {
@@ -1178,6 +1213,7 @@ extern "rust-call" fn call_mut(&mut self, args: A) -> <F as Fn<A>>::Output {
     }
 }
 
+#[cfg(stage0)]
 impl<F,A> FnOnce<A> for F
     where F : FnMut<A>
 {
index 455c68d4319d670ae952fd374a0da4b307b65a4b..a565b137cc852a5f84cd33885f87f0a954cd3e13 100644 (file)
 use ops::{Deref, FnOnce};
 use result::Result::{Ok, Err};
 use result::Result;
+#[allow(deprecated)]
 use slice::AsSlice;
 use slice;
 
@@ -275,6 +276,7 @@ pub fn as_mut<'r>(&'r mut self) -> Option<&'r mut T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let mut x = Some("Diamonds");
     /// {
     ///     let v = x.as_mut_slice();
@@ -470,6 +472,7 @@ pub fn map_or_else<U, D: FnOnce() -> U, F: FnOnce(T) -> U>(self, def: D, f: F) -
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let x = Some("foo");
     /// assert_eq!(x.ok_or(0), Ok("foo"));
     ///
@@ -491,6 +494,7 @@ pub fn ok_or<E>(self, err: E) -> Result<T, E> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let x = Some("foo");
     /// assert_eq!(x.ok_or_else(|| 0), Ok("foo"));
     ///
@@ -532,6 +536,7 @@ pub fn iter(&self) -> Iter<T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// let mut x = Some(4);
     /// match x.iter_mut().next() {
     ///     Some(&mut ref mut v) => *v = 42,
@@ -701,6 +706,19 @@ pub fn or_else<F: FnOnce() -> Option<T>>(self, f: F) -> Option<T> {
     pub fn take(&mut self) -> Option<T> {
         mem::replace(self, None)
     }
+
+    /// Convert from `Option<T>` to `&[T]` (without copying)
+    #[inline]
+    #[unstable(feature = "as_slice", since = "unsure of the utility here")]
+    pub fn as_slice<'a>(&'a self) -> &'a [T] {
+        match *self {
+            Some(ref x) => slice::ref_slice(x),
+            None => {
+                let result: &[_] = &[];
+                result
+            }
+        }
+    }
 }
 
 impl<'a, T: Clone, D: Deref<Target=T>> Option<D> {
@@ -752,6 +770,9 @@ pub fn unwrap_or_default(self) -> T {
 
 #[unstable(feature = "core",
            reason = "waiting on the stability of the trait itself")]
+#[deprecated(since = "1.0.0",
+             reason = "use the inherent method instead")]
+#[allow(deprecated)]
 impl<T> AsSlice<T> for Option<T> {
     /// Convert from `Option<T>` to `&[T]` (without copying)
     #[inline]
index 4bf7f85284cfe94148cef8507d7d80c415921bb0..424829939b92e89fbea8898bdcb7b71ff09dba54 100644 (file)
@@ -36,6 +36,7 @@
 pub use char::CharExt;
 pub use clone::Clone;
 pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
+pub use convert::{AsRef, AsMut, Into, From};
 pub use iter::{Extend, IteratorExt};
 pub use iter::{Iterator, DoubleEndedIterator};
 pub use iter::{ExactSizeIterator};
index 1cbea057e88420c5cfdc8329616dd72fb389b274..9b3ee3ef5e0c28fb1a402d0b6100bf1af5ad2288 100644 (file)
 //! Working with unsafe pointers in Rust is uncommon,
 //! typically limited to a few patterns.
 //!
-//! Use the [`null` function](fn.null.html) to create null pointers,
-//! the [`is_null`](trait.PtrExt.html#tymethod.is_null)
-//! methods of the [`PtrExt` trait](trait.PtrExt.html) to check for null.
-//! The `PtrExt` trait is imported by the prelude, so `is_null` etc.
-//! work everywhere. The `PtrExt` also defines the `offset` method,
-//! for pointer math.
+//! Use the [`null` function](fn.null.html) to create null pointers, and
+//! the `is_null` method of the `*const T` type  to check for null.
+//! The `*const T` type also defines the `offset` method, for pointer math.
 //!
 //! # Common ways to create unsafe pointers
 //!
@@ -52,6 +49,7 @@
 //! the raw pointer. It doesn't destroy `T` or deallocate any memory.
 //!
 //! ```
+//! # #![feature(alloc)]
 //! use std::boxed;
 //!
 //! unsafe {
@@ -70,6 +68,7 @@
 //! ## 3. Get it from C.
 //!
 //! ```
+//! # #![feature(libc)]
 //! extern crate libc;
 //!
 //! use std::mem;
 // FIXME #19649: intrinsic docs don't render, so these have no docs :(
 
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use intrinsics::copy_nonoverlapping_memory as copy_nonoverlapping;
+pub use intrinsics::copy_nonoverlapping;
 
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use intrinsics::copy_memory as copy;
+pub use intrinsics::copy;
 
 #[stable(feature = "rust1", since = "1.0.0")]
-pub use intrinsics::set_memory as write_bytes;
-
-extern "rust-intrinsic" {
-    #[unstable(feature = "core")]
-    #[deprecated(since = "1.0.0", reason = "renamed to `copy_nonoverlapping`")]
-    pub fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: usize);
-    #[unstable(feature = "core")]
-    #[deprecated(since = "1.0.0", reason = "renamed to `copy`")]
-    pub fn copy_memory<T>(dst: *mut T, src: *const T, count: usize);
-
-    #[unstable(feature = "core",
-               reason = "uncertain about naming and semantics")]
-    #[deprecated(since = "1.0.0", reason = "renamed to `write_bytes`")]
-    pub fn set_memory<T>(dst: *mut T, val: u8, count: usize);
-}
+pub use intrinsics::write_bytes;
 
 /// Creates a null raw pointer.
 ///
@@ -544,7 +529,7 @@ impl<T: ?Sized> Unique<T> {
     /// Create a new `Unique`.
     #[unstable(feature = "unique")]
     pub unsafe fn new(ptr: *mut T) -> Unique<T> {
-        Unique { pointer: NonZero::new(ptr as *const T), _marker: PhantomData }
+        Unique { pointer: NonZero::new(ptr), _marker: PhantomData }
     }
 
     /// Dereference the content.
index 35dfc7626872705f3378f8c3a0ad17161a6d9cee..8502a9c53c4a88cc4a0b24fd3dc0d98e08eeca35 100644 (file)
@@ -48,6 +48,7 @@
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::raw::{self, Repr};
 ///
 /// let slice: &[u16] = &[1, 2, 3, 4];
@@ -106,6 +107,7 @@ pub struct Closure {
 /// # Examples
 ///
 /// ```
+/// # #![feature(core)]
 /// use std::mem;
 /// use std::raw;
 ///
index bc8d53e2a5765efc6b7737b00d0e6acb3776eed0..62e1bcd827ae7ccbac2b0a2c20965d84aa0f94d8 100644 (file)
@@ -95,6 +95,7 @@
 //! by the [`Writer`](../io/trait.Writer.html) trait:
 //!
 //! ```
+//! # #![feature(old_io)]
 //! use std::old_io::IoError;
 //!
 //! trait Writer {
 //! something like this:
 //!
 //! ```{.ignore}
+//! # #![feature(old_io)]
 //! use std::old_io::*;
 //! use std::old_path::Path;
 //!
 //! a marginally useful message indicating why:
 //!
 //! ```{.no_run}
+//! # #![feature(old_io, old_path)]
 //! use std::old_io::*;
 //! use std::old_path::Path;
 //!
 //! You might also simply assert success:
 //!
 //! ```{.no_run}
+//! # #![feature(old_io, old_path)]
 //! # use std::old_io::*;
 //! # use std::old_path::Path;
 //!
 //! Or propagate the error up the call stack with `try!`:
 //!
 //! ```
+//! # #![feature(old_io, old_path)]
 //! # use std::old_io::*;
 //! # use std::old_path::Path;
 //! fn write_message() -> Result<(), IoError> {
 //! It replaces this:
 //!
 //! ```
+//! # #![feature(old_io, old_path)]
 //! use std::old_io::*;
 //! use std::old_path::Path;
 //!
 //! With this:
 //!
 //! ```
+//! # #![feature(old_io, old_path)]
 //! use std::old_io::*;
 //! use std::old_path::Path;
 //!
            FromIterator, ExactSizeIterator, IntoIterator};
 use ops::{FnMut, FnOnce};
 use option::Option::{self, None, Some};
+#[allow(deprecated)]
 use slice::AsSlice;
 use slice;
 
@@ -408,9 +416,24 @@ pub fn as_mut(&mut self) -> Result<&mut T, &mut E> {
         }
     }
 
+    /// Convert from `Result<T, E>` to `&[T]` (without copying)
+    #[inline]
+    #[unstable(feature = "as_slice", since = "unsure of the utility here")]
+    pub fn as_slice(&self) -> &[T] {
+        match *self {
+            Ok(ref x) => slice::ref_slice(x),
+            Err(_) => {
+                // work around lack of implicit coercion from fixed-size array to slice
+                let emp: &[_] = &[];
+                emp
+            }
+        }
+    }
+
     /// Convert from `Result<T, E>` to `&mut [T]` (without copying)
     ///
     /// ```
+    /// # #![feature(core)]
     /// let mut x: Result<&str, u32> = Ok("Gold");
     /// {
     ///     let v = x.as_mut_slice();
@@ -452,6 +475,7 @@ pub fn as_mut_slice(&mut self) -> &mut [T] {
     /// ignoring I/O and parse errors:
     ///
     /// ```
+    /// # #![feature(old_io)]
     /// use std::old_io::*;
     ///
     /// let mut buffer: &[u8] = b"1\n2\n3\n4\n";
@@ -788,10 +812,14 @@ pub fn unwrap_err(self) -> E {
 // Trait implementations
 /////////////////////////////////////////////////////////////////////////////
 
+#[unstable(feature = "core",
+           reason = "waiting on the stability of the trait itself")]
+#[deprecated(since = "1.0.0",
+             reason = "use inherent method instead")]
+#[allow(deprecated)]
 impl<T, E> AsSlice<T> for Result<T, E> {
     /// Convert from `Result<T, E>` to `&[T]` (without copying)
     #[inline]
-    #[stable(feature = "rust1", since = "1.0.0")]
     fn as_slice<'a>(&'a self) -> &'a [T] {
         match *self {
             Ok(ref x) => slice::ref_slice(x),
index 0058971faf0796d45727470afdac4e56a734947a..21cff3021abea400af1831356fe2644b384e1bf0 100644 (file)
@@ -19,7 +19,7 @@
 //! provided beyond this module.
 //!
 //! ```rust
-//!
+//! # #![feature(core)]
 //! fn main() {
 //!     use std::simd::f32x4;
 //!     let a = f32x4(40.0, 41.0, 42.0, 43.0);
index 907b2eba80c5b872a1f5fc1fb9964901c73c1251..fce29abed7300c161c416be5f78b8f379cb92594 100644 (file)
@@ -263,6 +263,7 @@ fn get_mut(&mut self, index: usize) -> Option<&mut T> {
     #[inline]
     fn as_mut_slice(&mut self) -> &mut [T] { self }
 
+    #[cfg(stage0)]
     #[inline]
     fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
         unsafe {
@@ -273,6 +274,17 @@ fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
         }
     }
 
+    #[cfg(not(stage0))]
+    #[inline]
+    fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
+        unsafe {
+            let self2: &mut [T] = mem::transmute_copy(&self);
+
+            (ops::IndexMut::index_mut(self, ops::RangeTo { end: mid } ),
+             ops::IndexMut::index_mut(self2, ops::RangeFrom { start: mid } ))
+        }
+    }
+
     #[inline]
     fn iter_mut<'a>(&'a mut self) -> IterMut<'a, T> {
         unsafe {
@@ -495,25 +507,45 @@ fn clone_from_slice(&mut self, src: &[T]) -> usize where T: Clone {
 impl<T> ops::Index<usize> for [T] {
     type Output = T;
 
+    #[cfg(stage0)]
     fn index(&self, &index: &usize) -> &T {
         assert!(index < self.len());
 
         unsafe { mem::transmute(self.repr().data.offset(index as isize)) }
     }
+
+    #[cfg(not(stage0))]
+    fn index(&self, index: usize) -> &T {
+        assert!(index < self.len());
+
+        unsafe { mem::transmute(self.repr().data.offset(index as isize)) }
+    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<usize> for [T] {
+    #[cfg(stage0)]
+    #[inline]
     fn index_mut(&mut self, &index: &usize) -> &mut T {
         assert!(index < self.len());
 
         unsafe { mem::transmute(self.repr().data.offset(index as isize)) }
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, index: usize) -> &mut T {
+        assert!(index < self.len());
+
+        unsafe { mem::transmute(self.repr().data.offset(index as isize)) }
+    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Index<ops::Range<usize>> for [T] {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::Range<usize>) -> &[T] {
         assert!(index.start <= index.end);
@@ -525,34 +557,72 @@ fn index(&self, index: &ops::Range<usize>) -> &[T] {
             )
         }
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::Range<usize>) -> &[T] {
+        assert!(index.start <= index.end);
+        assert!(index.end <= self.len());
+        unsafe {
+            from_raw_parts (
+                self.as_ptr().offset(index.start as isize),
+                index.end - index.start
+            )
+        }
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Index<ops::RangeTo<usize>> for [T] {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::RangeTo<usize>) -> &[T] {
         self.index(&ops::Range{ start: 0, end: index.end })
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::RangeTo<usize>) -> &[T] {
+        self.index(ops::Range{ start: 0, end: index.end })
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Index<ops::RangeFrom<usize>> for [T] {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::RangeFrom<usize>) -> &[T] {
         self.index(&ops::Range{ start: index.start, end: self.len() })
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::RangeFrom<usize>) -> &[T] {
+        self.index(ops::Range{ start: index.start, end: self.len() })
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::Index<RangeFull> for [T] {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, _index: &RangeFull) -> &[T] {
         self
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, _index: RangeFull) -> &[T] {
+        self
+    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<ops::Range<usize>> for [T] {
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, index: &ops::Range<usize>) -> &mut [T] {
         assert!(index.start <= index.end);
@@ -564,28 +634,64 @@ fn index_mut(&mut self, index: &ops::Range<usize>) -> &mut [T] {
             )
         }
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, index: ops::Range<usize>) -> &mut [T] {
+        assert!(index.start <= index.end);
+        assert!(index.end <= self.len());
+        unsafe {
+            from_raw_parts_mut(
+                self.as_mut_ptr().offset(index.start as isize),
+                index.end - index.start
+            )
+        }
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<ops::RangeTo<usize>> for [T] {
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, index: &ops::RangeTo<usize>) -> &mut [T] {
         self.index_mut(&ops::Range{ start: 0, end: index.end })
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, index: ops::RangeTo<usize>) -> &mut [T] {
+        self.index_mut(ops::Range{ start: 0, end: index.end })
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<ops::RangeFrom<usize>> for [T] {
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, index: &ops::RangeFrom<usize>) -> &mut [T] {
         let len = self.len();
         self.index_mut(&ops::Range{ start: index.start, end: len })
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, index: ops::RangeFrom<usize>) -> &mut [T] {
+        let len = self.len();
+        self.index_mut(ops::Range{ start: index.start, end: len })
+    }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> ops::IndexMut<RangeFull> for [T] {
+
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, _index: &RangeFull) -> &mut [T] {
         self
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, _index: RangeFull) -> &mut [T] {
+        self
+    }
 }
 
 
@@ -596,24 +702,29 @@ fn index_mut(&mut self, _index: &RangeFull) -> &mut [T] {
 /// Data that is viewable as a slice.
 #[unstable(feature = "core",
            reason = "will be replaced by slice syntax")]
+#[deprecated(since = "1.0.0",
+             reason = "use std::convert::AsRef<[T]> instead")]
 pub trait AsSlice<T> {
     /// Work with `self` as a slice.
     fn as_slice<'a>(&'a self) -> &'a [T];
 }
 
 #[unstable(feature = "core", reason = "trait is experimental")]
+#[allow(deprecated)]
 impl<T> AsSlice<T> for [T] {
     #[inline(always)]
     fn as_slice<'a>(&'a self) -> &'a [T] { self }
 }
 
 #[unstable(feature = "core", reason = "trait is experimental")]
+#[allow(deprecated)]
 impl<'a, T, U: ?Sized + AsSlice<T>> AsSlice<T> for &'a U {
     #[inline(always)]
     fn as_slice(&self) -> &[T] { AsSlice::as_slice(*self) }
 }
 
 #[unstable(feature = "core", reason = "trait is experimental")]
+#[allow(deprecated)]
 impl<'a, T, U: ?Sized + AsSlice<T>> AsSlice<T> for &'a mut U {
     #[inline(always)]
     fn as_slice(&self) -> &[T] { AsSlice::as_slice(*self) }
@@ -763,37 +874,69 @@ unsafe impl<'a, T: Sync> Send for Iter<'a, T> {}
 #[unstable(feature = "core")]
 impl<'a, T> ops::Index<ops::Range<usize>> for Iter<'a, T> {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::Range<usize>) -> &[T] {
         self.as_slice().index(index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::Range<usize>) -> &[T] {
+        self.as_slice().index(index)
+    }
 }
 
 #[unstable(feature = "core")]
 impl<'a, T> ops::Index<ops::RangeTo<usize>> for Iter<'a, T> {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::RangeTo<usize>) -> &[T] {
         self.as_slice().index(index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::RangeTo<usize>) -> &[T] {
+        self.as_slice().index(index)
+    }
 }
 
 #[unstable(feature = "core")]
 impl<'a, T> ops::Index<ops::RangeFrom<usize>> for Iter<'a, T> {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::RangeFrom<usize>) -> &[T] {
         self.as_slice().index(index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::RangeFrom<usize>) -> &[T] {
+        self.as_slice().index(index)
+    }
 }
 
 #[unstable(feature = "core")]
 impl<'a, T> ops::Index<RangeFull> for Iter<'a, T> {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, _index: &RangeFull) -> &[T] {
         self.as_slice()
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, _index: RangeFull) -> &[T] {
+        self.as_slice()
+    }
 }
 
 impl<'a, T> Iter<'a, T> {
@@ -856,63 +999,126 @@ unsafe impl<'a, T: Send> Send for IterMut<'a, T> {}
 #[unstable(feature = "core")]
 impl<'a, T> ops::Index<ops::Range<usize>> for IterMut<'a, T> {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::Range<usize>) -> &[T] {
         self.index(&RangeFull).index(index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::Range<usize>) -> &[T] {
+        self.index(RangeFull).index(index)
+    }
 }
 #[unstable(feature = "core")]
 impl<'a, T> ops::Index<ops::RangeTo<usize>> for IterMut<'a, T> {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::RangeTo<usize>) -> &[T] {
         self.index(&RangeFull).index(index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::RangeTo<usize>) -> &[T] {
+        self.index(RangeFull).index(index)
+    }
 }
 #[unstable(feature = "core")]
 impl<'a, T> ops::Index<ops::RangeFrom<usize>> for IterMut<'a, T> {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, index: &ops::RangeFrom<usize>) -> &[T] {
         self.index(&RangeFull).index(index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, index: ops::RangeFrom<usize>) -> &[T] {
+        self.index(RangeFull).index(index)
+    }
 }
 #[unstable(feature = "core")]
 impl<'a, T> ops::Index<RangeFull> for IterMut<'a, T> {
     type Output = [T];
+
+    #[cfg(stage0)]
     #[inline]
     fn index(&self, _index: &RangeFull) -> &[T] {
         make_slice!(T => &[T]: self.ptr, self.end)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index(&self, _index: RangeFull) -> &[T] {
+        make_slice!(T => &[T]: self.ptr, self.end)
+    }
 }
 
 #[unstable(feature = "core")]
 impl<'a, T> ops::IndexMut<ops::Range<usize>> for IterMut<'a, T> {
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, index: &ops::Range<usize>) -> &mut [T] {
         self.index_mut(&RangeFull).index_mut(index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, index: ops::Range<usize>) -> &mut [T] {
+        self.index_mut(RangeFull).index_mut(index)
+    }
 }
 #[unstable(feature = "core")]
 impl<'a, T> ops::IndexMut<ops::RangeTo<usize>> for IterMut<'a, T> {
+
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, index: &ops::RangeTo<usize>) -> &mut [T] {
         self.index_mut(&RangeFull).index_mut(index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, index: ops::RangeTo<usize>) -> &mut [T] {
+        self.index_mut(RangeFull).index_mut(index)
+    }
 }
 #[unstable(feature = "core")]
 impl<'a, T> ops::IndexMut<ops::RangeFrom<usize>> for IterMut<'a, T> {
+
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, index: &ops::RangeFrom<usize>) -> &mut [T] {
         self.index_mut(&RangeFull).index_mut(index)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, index: ops::RangeFrom<usize>) -> &mut [T] {
+        self.index_mut(RangeFull).index_mut(index)
+    }
 }
 #[unstable(feature = "core")]
 impl<'a, T> ops::IndexMut<RangeFull> for IterMut<'a, T> {
+
+    #[cfg(stage0)]
     #[inline]
     fn index_mut(&mut self, _index: &RangeFull) -> &mut [T] {
         make_mut_slice!(T => &mut [T]: self.ptr, self.end)
     }
+
+    #[cfg(not(stage0))]
+    #[inline]
+    fn index_mut(&mut self, _index: RangeFull) -> &mut [T] {
+        make_mut_slice!(T => &mut [T]: self.ptr, self.end)
+    }
 }
 
 
@@ -1491,6 +1697,7 @@ pub unsafe fn from_raw_parts_mut<'a, T>(p: *mut T, len: usize) -> &'a mut [T] {
 /// # Examples
 ///
 /// ```
+/// #![feature(core)]
 /// use std::slice;
 ///
 /// // manifest a slice out of thin air!
index e8181395b5c1e5a19538eb3eef1942014577daa4..36c3eb33c77a24aa6ff58976418e367db395a546 100644 (file)
@@ -29,7 +29,7 @@
 use marker::Sized;
 use mem;
 use num::Int;
-use ops::{Fn, FnMut};
+use ops::{Fn, FnMut, FnOnce};
 use option::Option::{self, None, Some};
 use raw::{Repr, Slice};
 use result::Result::{self, Ok, Err};
@@ -111,7 +111,24 @@ fn size_hint(&self) -> (usize, Option<usize>) {
                 self.0.size_hint()
             }
         }
-    }
+    };
+    (pattern reverse $te:ty : $ti:ty) => {
+        #[stable(feature = "rust1", since = "1.0.0")]
+        impl<'a, P: Pattern<'a>> Iterator for $ti
+            where P::Searcher: ReverseSearcher<'a>
+        {
+            type Item = $te;
+
+            #[inline]
+            fn next(&mut self) -> Option<$te> {
+                self.0.next()
+            }
+            #[inline]
+            fn size_hint(&self) -> (usize, Option<usize>) {
+                self.0.size_hint()
+            }
+        }
+    };
 }
 
 /// A trait to abstract the idea of creating a new instance of a type from a
@@ -244,7 +261,7 @@ pub unsafe fn from_utf8_unchecked<'a>(v: &'a [u8]) -> &'a str {
              reason = "use std::ffi::c_str_to_bytes + str::from_utf8")]
 pub unsafe fn from_c_str(s: *const i8) -> &'static str {
     let s = s as *const u8;
-    let mut len = 0;
+    let mut len: usize = 0;
     while *s.offset(len as isize) != 0 {
         len += 1;
     }
@@ -524,6 +541,7 @@ fn next_back(&mut self) -> Option<(usize, char)> {
 #[derive(Copy, Clone)]
 struct BytesDeref;
 
+#[cfg(stage0)]
 impl<'a> Fn<(&'a u8,)> for BytesDeref {
     type Output = u8;
 
@@ -533,6 +551,32 @@ extern "rust-call" fn call(&self, (ptr,): (&'a u8,)) -> u8 {
     }
 }
 
+#[cfg(not(stage0))]
+impl<'a> Fn<(&'a u8,)> for BytesDeref {
+    #[inline]
+    extern "rust-call" fn call(&self, (ptr,): (&'a u8,)) -> u8 {
+        *ptr
+    }
+}
+
+#[cfg(not(stage0))]
+impl<'a> FnMut<(&'a u8,)> for BytesDeref {
+    #[inline]
+    extern "rust-call" fn call_mut(&mut self, (ptr,): (&'a u8,)) -> u8 {
+        Fn::call(&*self, (ptr,))
+    }
+}
+
+#[cfg(not(stage0))]
+impl<'a> FnOnce<(&'a u8,)> for BytesDeref {
+    type Output = u8;
+
+    #[inline]
+    extern "rust-call" fn call_once(self, (ptr,): (&'a u8,)) -> u8 {
+        Fn::call(&self, (ptr,))
+    }
+}
+
 /// An iterator over the substrings of a string, separated by `sep`.
 struct CharSplits<'a, P: Pattern<'a>> {
     /// The slice remaining to be iterated
@@ -550,7 +594,26 @@ struct CharSplitsN<'a, P: Pattern<'a>> {
     iter: CharSplits<'a, P>,
     /// The number of splits remaining
     count: usize,
-    invert: bool,
+}
+
+/// An iterator over the substrings of a string, separated by a
+/// pattern, in reverse order.
+struct RCharSplits<'a, P: Pattern<'a>> {
+    /// The slice remaining to be iterated
+    start: usize,
+    end: usize,
+    matcher: P::Searcher,
+    /// Whether an empty string at the end of iteration is allowed
+    allow_final_empty: bool,
+    finished: bool,
+}
+
+/// An iterator over the substrings of a string, separated by a
+/// pattern, splitting at most `count` times, in reverse order.
+struct RCharSplitsN<'a, P: Pattern<'a>> {
+    iter: RCharSplits<'a, P>,
+    /// The number of splits remaining
+    count: usize,
 }
 
 /// An iterator over the lines of a string, separated by `\n`.
@@ -631,21 +694,74 @@ fn next_back(&mut self) -> Option<&'a str> {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<'a, P: Pattern<'a>> Iterator for CharSplitsN<'a, P>
-where P::Searcher: DoubleEndedSearcher<'a> {
+impl<'a, P: Pattern<'a>> Iterator for CharSplitsN<'a, P> {
     type Item = &'a str;
 
     #[inline]
     fn next(&mut self) -> Option<&'a str> {
         if self.count != 0 {
             self.count -= 1;
-            if self.invert { self.iter.next_back() } else { self.iter.next() }
+            self.iter.next()
         } else {
             self.iter.get_end()
         }
     }
 }
 
+impl<'a, P: Pattern<'a>> RCharSplits<'a, P> {
+    #[inline]
+    fn get_remainder(&mut self) -> Option<&'a str> {
+        if !self.finished && (self.allow_final_empty || self.end - self.start > 0) {
+            self.finished = true;
+            unsafe {
+                let string = self.matcher.haystack().slice_unchecked(self.start, self.end);
+                Some(string)
+            }
+        } else {
+            None
+        }
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a, P: Pattern<'a>> Iterator for RCharSplits<'a, P>
+    where P::Searcher: ReverseSearcher<'a>
+{
+    type Item = &'a str;
+
+    #[inline]
+    fn next(&mut self) -> Option<&'a str> {
+        if self.finished { return None }
+
+        let haystack = self.matcher.haystack();
+        match self.matcher.next_match_back() {
+            Some((a, b)) => unsafe {
+                let elt = haystack.slice_unchecked(b, self.end);
+                self.end = a;
+                Some(elt)
+            },
+            None => self.get_remainder(),
+        }
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a, P: Pattern<'a>> Iterator for RCharSplitsN<'a, P>
+    where P::Searcher: ReverseSearcher<'a>
+{
+    type Item = &'a str;
+
+    #[inline]
+    fn next(&mut self) -> Option<&'a str> {
+        if self.count != 0 {
+            self.count -= 1;
+            self.iter.next()
+        } else {
+            self.iter.get_remainder()
+        }
+    }
+}
+
 /// The internal state of an iterator that searches for matches of a substring
 /// within a larger string using two-way search
 #[derive(Clone)]
@@ -1203,6 +1319,7 @@ fn partial_cmp(&self, other: &str) -> Option<Ordering> {
     /// // byte 100 is outside the string
     /// // &s[3 .. 100];
     /// ```
+    #[cfg(stage0)]
     #[stable(feature = "rust1", since = "1.0.0")]
     impl ops::Index<ops::Range<usize>> for str {
         type Output = str;
@@ -1219,6 +1336,49 @@ fn index(&self, index: &ops::Range<usize>) -> &str {
         }
     }
 
+    /// Returns a slice of the given string from the byte range
+    /// [`begin`..`end`).
+    ///
+    /// This operation is `O(1)`.
+    ///
+    /// Panics when `begin` and `end` do not point to valid characters
+    /// or point beyond the last character of the string.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// let s = "Löwe 老虎 Léopard";
+    /// assert_eq!(&s[0 .. 1], "L");
+    ///
+    /// assert_eq!(&s[1 .. 9], "öwe 老");
+    ///
+    /// // these will panic:
+    /// // byte 2 lies within `ö`:
+    /// // &s[2 ..3];
+    ///
+    /// // byte 8 lies within `老`
+    /// // &s[1 .. 8];
+    ///
+    /// // byte 100 is outside the string
+    /// // &s[3 .. 100];
+    /// ```
+    #[cfg(not(stage0))]
+    #[stable(feature = "rust1", since = "1.0.0")]
+    impl ops::Index<ops::Range<usize>> for str {
+        type Output = str;
+        #[inline]
+        fn index(&self, index: ops::Range<usize>) -> &str {
+            // is_char_boundary checks that the index is in [0, .len()]
+            if index.start <= index.end &&
+               self.is_char_boundary(index.start) &&
+               self.is_char_boundary(index.end) {
+                unsafe { self.slice_unchecked(index.start, index.end) }
+            } else {
+                super::slice_error_fail(self, index.start, index.end)
+            }
+        }
+    }
+
     /// Returns a slice of the string from the beginning to byte
     /// `end`.
     ///
@@ -1229,6 +1389,8 @@ fn index(&self, index: &ops::Range<usize>) -> &str {
     #[stable(feature = "rust1", since = "1.0.0")]
     impl ops::Index<ops::RangeTo<usize>> for str {
         type Output = str;
+
+        #[cfg(stage0)]
         #[inline]
         fn index(&self, index: &ops::RangeTo<usize>) -> &str {
             // is_char_boundary checks that the index is in [0, .len()]
@@ -1238,6 +1400,17 @@ fn index(&self, index: &ops::RangeTo<usize>) -> &str {
                 super::slice_error_fail(self, 0, index.end)
             }
         }
+
+        #[cfg(not(stage0))]
+        #[inline]
+        fn index(&self, index: ops::RangeTo<usize>) -> &str {
+            // is_char_boundary checks that the index is in [0, .len()]
+            if self.is_char_boundary(index.end) {
+                unsafe { self.slice_unchecked(0, index.end) }
+            } else {
+                super::slice_error_fail(self, 0, index.end)
+            }
+        }
     }
 
     /// Returns a slice of the string from `begin` to its end.
@@ -1249,6 +1422,8 @@ fn index(&self, index: &ops::RangeTo<usize>) -> &str {
     #[stable(feature = "rust1", since = "1.0.0")]
     impl ops::Index<ops::RangeFrom<usize>> for str {
         type Output = str;
+
+        #[cfg(stage0)]
         #[inline]
         fn index(&self, index: &ops::RangeFrom<usize>) -> &str {
             // is_char_boundary checks that the index is in [0, .len()]
@@ -1258,15 +1433,34 @@ fn index(&self, index: &ops::RangeFrom<usize>) -> &str {
                 super::slice_error_fail(self, index.start, self.len())
             }
         }
+
+        #[cfg(not(stage0))]
+        #[inline]
+        fn index(&self, index: ops::RangeFrom<usize>) -> &str {
+            // is_char_boundary checks that the index is in [0, .len()]
+            if self.is_char_boundary(index.start) {
+                unsafe { self.slice_unchecked(index.start, self.len()) }
+            } else {
+                super::slice_error_fail(self, index.start, self.len())
+            }
+        }
     }
 
     #[stable(feature = "rust1", since = "1.0.0")]
     impl ops::Index<ops::RangeFull> for str {
         type Output = str;
+
+        #[cfg(stage0)]
         #[inline]
         fn index(&self, _index: &ops::RangeFull) -> &str {
             self
         }
+
+        #[cfg(not(stage0))]
+        #[inline]
+        fn index(&self, _index: ops::RangeFull) -> &str {
+            self
+        }
     }
 }
 
@@ -1275,16 +1469,20 @@ fn index(&self, _index: &ops::RangeFull) -> &str {
            reason = "Instead of taking this bound generically, this trait will be \
                      replaced with one of slicing syntax (&foo[..]), deref coercions, or \
                      a more generic conversion trait")]
+#[deprecated(since = "1.0.0",
+             reason = "use std::convert::AsRef<str> instead")]
 pub trait Str {
     /// Work with `self` as a slice.
     fn as_slice<'a>(&'a self) -> &'a str;
 }
 
+#[allow(deprecated)]
 impl Str for str {
     #[inline]
     fn as_slice<'a>(&'a self) -> &'a str { self }
 }
 
+#[allow(deprecated)]
 impl<'a, S: ?Sized> Str for &'a S where S: Str {
     #[inline]
     fn as_slice(&self) -> &str { Str::as_slice(*self) }
@@ -1293,23 +1491,7 @@ fn as_slice(&self) -> &str { Str::as_slice(*self) }
 /// Return type of `StrExt::split`
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct Split<'a, P: Pattern<'a>>(CharSplits<'a, P>);
-#[stable(feature = "rust1", since = "1.0.0")]
-impl<'a, P: Pattern<'a>> Iterator for Split<'a, P> {
-    type Item = &'a str;
-
-    #[inline]
-    fn next(&mut self) -> Option<&'a str> {
-        self.0.next()
-    }
-}
-#[stable(feature = "rust1", since = "1.0.0")]
-impl<'a, P: Pattern<'a>> DoubleEndedIterator for Split<'a, P>
-where P::Searcher: DoubleEndedSearcher<'a> {
-    #[inline]
-    fn next_back(&mut self) -> Option<&'a str> {
-        self.0.next_back()
-    }
-}
+delegate_iter!{pattern &'a str : Split<'a, P>}
 
 /// Return type of `StrExt::split_terminator`
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -1321,10 +1503,15 @@ fn next_back(&mut self) -> Option<&'a str> {
 pub struct SplitN<'a, P: Pattern<'a>>(CharSplitsN<'a, P>);
 delegate_iter!{pattern forward &'a str : SplitN<'a, P>}
 
+/// Return type of `StrExt::rsplit`
+#[stable(feature = "rust1", since = "1.0.0")]
+pub struct RSplit<'a, P: Pattern<'a>>(RCharSplits<'a, P>);
+delegate_iter!{pattern reverse &'a str : RSplit<'a, P>}
+
 /// Return type of `StrExt::rsplitn`
 #[stable(feature = "rust1", since = "1.0.0")]
-pub struct RSplitN<'a, P: Pattern<'a>>(CharSplitsN<'a, P>);
-delegate_iter!{pattern forward &'a str : RSplitN<'a, P>}
+pub struct RSplitN<'a, P: Pattern<'a>>(RCharSplitsN<'a, P>);
+delegate_iter!{pattern reverse &'a str : RSplitN<'a, P>}
 
 /// Methods for string slices
 #[allow(missing_docs)]
@@ -1340,7 +1527,10 @@ pub trait StrExt {
     fn split<'a, P: Pattern<'a>>(&'a self, pat: P) -> Split<'a, P>;
     fn splitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> SplitN<'a, P>;
     fn split_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitTerminator<'a, P>;
-    fn rsplitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> RSplitN<'a, P>;
+    fn rsplit<'a, P: Pattern<'a>>(&'a self, pat: P) -> RSplit<'a, P>
+        where P::Searcher: ReverseSearcher<'a>;
+    fn rsplitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> RSplitN<'a, P>
+        where P::Searcher: ReverseSearcher<'a>;
     fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P>;
     #[allow(deprecated) /* for SplitStr */]
     fn split_str<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitStr<'a, P>;
@@ -1424,7 +1614,6 @@ fn splitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> SplitN<'a, P> {
         SplitN(CharSplitsN {
             iter: self.split(pat).0,
             count: count,
-            invert: false,
         })
     }
 
@@ -1437,11 +1626,25 @@ fn split_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitTerminator<'a,
     }
 
     #[inline]
-    fn rsplitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> RSplitN<'a, P> {
-        RSplitN(CharSplitsN {
-            iter: self.split(pat).0,
+    fn rsplit<'a, P: Pattern<'a>>(&'a self, pat: P) -> RSplit<'a, P>
+        where P::Searcher: ReverseSearcher<'a>
+    {
+        RSplit(RCharSplits {
+            start: 0,
+            end: self.len(),
+            matcher: pat.into_searcher(self),
+            allow_final_empty: true,
+            finished: false,
+        })
+    }
+
+    #[inline]
+    fn rsplitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> RSplitN<'a, P>
+        where P::Searcher: ReverseSearcher<'a>
+    {
+        RSplitN(RCharSplitsN {
+            iter: self.rsplit(pat).0,
             count: count,
-            invert: true,
         })
     }
 
index 7bf248917a5cd20596312e917142777035701041..98b6533980dd913728ff45724e01793ee26d1122 100644 (file)
@@ -474,22 +474,16 @@ impl<'a, 'b> Pattern<'a> for &'b [char] {
                       s, CharEqPattern(s));
 }
 
+/// A convenience impl that delegates to the impl for `&str`
+impl<'a, 'b> Pattern<'a> for &'b &'b str {
+    type Searcher =   <&'b str as Pattern<'a>>::Searcher;
+    associated_items!(<&'b str as Pattern<'a>>::Searcher,
+                      s, (*s));
+}
+
 /// Searches for chars that match the given predicate
 impl<'a, F> Pattern<'a> for F where F: FnMut(char) -> bool {
     type Searcher =   <CharEqPattern<Self> as Pattern<'a>>::Searcher;
     associated_items!(<CharEqPattern<Self> as Pattern<'a>>::Searcher,
                       s, CharEqPattern(s));
 }
-
-// Deref-forward impl
-
-use ops::Deref;
-
-/// Delegates to the next deref coercion of `Self` that implements `Pattern`
-impl<'a, 'b, P: 'b + ?Sized, T: Deref<Target = P> + ?Sized> Pattern<'a> for &'b T
-    where &'b P: Pattern<'a>
-{
-    type Searcher =   <&'b P as Pattern<'a>>::Searcher;
-    associated_items!(<&'b P as Pattern<'a>>::Searcher,
-                      s, (&**s));
-}
index 536bce0d05f0ba0781ab2b093e0ecac1fb199a14..33f9b63bc4907d006439c5a77f5d61a6ee8ea788 100644 (file)
@@ -24,6 +24,8 @@
 #![feature(io)]
 #![feature(collections)]
 #![feature(debug_builders)]
+#![feature(unique)]
+#![feature(step_by)]
 #![allow(deprecated)] // rand
 
 extern crate core;
index bf3e1cf03cbddfb516fe2137b43d44e63d9b89a6..17d6b684c50e80a1111ee80cc5e47a1b329f347d 100644 (file)
@@ -95,7 +95,7 @@ fn test_transmute() {
     trait Foo { fn dummy(&self) { } }
     impl Foo for int {}
 
-    let a = box 100 as Box<Foo>;
+    let a = box 100isize as Box<Foo>;
     unsafe {
         let x: ::core::raw::TraitObject = transmute(a);
         assert!(*(x.data as *const int) == 100);
index 6a25c8be14e5a97e8fde1cc2719180260a405fc6..4f5f269d4375d0c0a6e2ec2c24ad3f19b476a065 100644 (file)
@@ -35,18 +35,18 @@ struct Pair {
         let v0 = vec![32000u16, 32001u16, 32002u16];
         let mut v1 = vec![0u16, 0u16, 0u16];
 
-        copy_memory(v1.as_mut_ptr().offset(1),
-                    v0.as_ptr().offset(1), 1);
+        copy(v1.as_mut_ptr().offset(1),
+             v0.as_ptr().offset(1), 1);
         assert!((v1[0] == 0u16 &&
                  v1[1] == 32001u16 &&
                  v1[2] == 0u16));
-        copy_memory(v1.as_mut_ptr(),
-                    v0.as_ptr().offset(2), 1);
+        copy(v1.as_mut_ptr(),
+             v0.as_ptr().offset(2), 1);
         assert!((v1[0] == 32002u16 &&
                  v1[1] == 32001u16 &&
                  v1[2] == 0u16));
-        copy_memory(v1.as_mut_ptr().offset(2),
-                    v0.as_ptr(), 1);
+        copy(v1.as_mut_ptr().offset(2),
+             v0.as_ptr(), 1);
         assert!((v1[0] == 32002u16 &&
                  v1[1] == 32001u16 &&
                  v1[2] == 32000u16));
@@ -84,9 +84,9 @@ fn test_as_ref() {
         assert_eq!(q.as_ref().unwrap(), &2);
 
         // Lifetime inference
-        let u = 2;
+        let u = 2isize;
         {
-            let p: *const int = &u as *const _;
+            let p = &u as *const int;
             assert_eq!(p.as_ref().unwrap(), &2);
         }
     }
@@ -102,9 +102,9 @@ fn test_as_mut() {
         assert!(q.as_mut().unwrap() == &mut 2);
 
         // Lifetime inference
-        let mut u = 2;
+        let mut u = 2isize;
         {
-            let p: *mut int = &mut u as *mut _;
+            let p = &mut u as *mut int;
             assert!(p.as_mut().unwrap() == &mut 2);
         }
     }
@@ -164,15 +164,15 @@ fn test_ptr_subtraction() {
 fn test_set_memory() {
     let mut xs = [0u8; 20];
     let ptr = xs.as_mut_ptr();
-    unsafe { set_memory(ptr, 5u8, xs.len()); }
+    unsafe { write_bytes(ptr, 5u8, xs.len()); }
     assert!(xs == [5u8; 20]);
 }
 
 #[test]
 fn test_unsized_unique() {
-    let xs: &mut [_] = &mut [1, 2, 3];
-    let ptr = unsafe { Unique::new(xs as *mut [_]) };
+    let xs: &mut [i32] = &mut [1, 2, 3];
+    let ptr = unsafe { Unique::new(xs as *mut [i32]) };
     let ys = unsafe { &mut **ptr };
-    let zs: &mut [_] = &mut [1, 2, 3];
+    let zs: &mut [i32] = &mut [1, 2, 3];
     assert!(ys == zs);
 }
index cac78363dd53b8e83144b68bad4a38e2925d62a2..38cab4f0e0942440063c16e0bd3b1a3813fd9451 100644 (file)
@@ -13,9 +13,7 @@ fn test_pattern_deref_forward() {
     let data = "aabcdaa";
     assert!(data.contains("bcd"));
     assert!(data.contains(&"bcd"));
-    assert!(data.contains(&&"bcd"));
     assert!(data.contains(&"bcd".to_string()));
-    assert!(data.contains(&&"bcd".to_string()));
 }
 
 #[test]
index 695c71c73eded0f14773c417e8659fb1806c5d74..63d1fe968fe1b6a0a3aa4c53a0b78f287e1d1d1e 100644 (file)
@@ -28,6 +28,7 @@
 #![feature(libc)]
 #![feature(staged_api)]
 #![feature(unique)]
+#![cfg_attr(test, feature(rustc_private, rand, collections))]
 
 #[cfg(test)] #[macro_use] extern crate log;
 
index 0e0804593443d5d733bb4e16b51fa1939b31d937..ccf4a3f48d9a15aa2cc7106b9a878df808c556f2 100644 (file)
 //! which is cyclic.
 //!
 //! ```rust
+//! # #![feature(rustc_private, core, into_cow)]
 //! use std::borrow::IntoCow;
 //! use std::io::Write;
 //! use graphviz as dot;
 //!
-//! type Nd = int;
-//! type Ed = (int,int);
+//! type Nd = isize;
+//! type Ed = (isize,isize);
 //! struct Edges(Vec<Ed>);
 //!
 //! pub fn render_to<W: Write>(output: &mut W) {
 //! direct reference to the `(source,target)` pair stored in the graph's
 //! internal vector (rather than passing around a copy of the pair
 //! itself). Note that this implies that `fn edges(&'a self)` must
-//! construct a fresh `Vec<&'a (uint,uint)>` from the `Vec<(uint,uint)>`
+//! construct a fresh `Vec<&'a (usize,usize)>` from the `Vec<(usize,usize)>`
 //! edges stored in `self`.
 //!
 //! Since both the set of nodes and the set of edges are always
 //! entity `&sube`).
 //!
 //! ```rust
+//! # #![feature(rustc_private, core, into_cow)]
 //! use std::borrow::IntoCow;
 //! use std::io::Write;
 //! use graphviz as dot;
 //!
-//! type Nd = uint;
-//! type Ed<'a> = &'a (uint, uint);
-//! struct Graph { nodes: Vec<&'static str>, edges: Vec<(uint,uint)> }
+//! type Nd = usize;
+//! type Ed<'a> = &'a (usize, usize);
+//! struct Graph { nodes: Vec<&'static str>, edges: Vec<(usize,usize)> }
 //!
 //! pub fn render_to<W: Write>(output: &mut W) {
 //!     let nodes = vec!("{x,y}","{x}","{y}","{}");
 //! Hasse-diagram for the subsets of the set `{x, y}`.
 //!
 //! ```rust
+//! # #![feature(rustc_private, core, into_cow)]
 //! use std::borrow::IntoCow;
 //! use std::io::Write;
 //! use graphviz as dot;
 //!
-//! type Nd<'a> = (uint, &'a str);
+//! type Nd<'a> = (usize, &'a str);
 //! type Ed<'a> = (Nd<'a>, Nd<'a>);
-//! struct Graph { nodes: Vec<&'static str>, edges: Vec<(uint,uint)> }
+//! struct Graph { nodes: Vec<&'static str>, edges: Vec<(usize,usize)> }
 //!
 //! pub fn render_to<W: Write>(output: &mut W) {
 //!     let nodes = vec!("{x,y}","{x}","{y}","{}");
 //!     }
 //!     fn node_label<'b>(&'b self, n: &Nd<'b>) -> dot::LabelText<'b> {
 //!         let &(i, _) = n;
-//!         dot::LabelText::LabelStr(self.nodes[i].as_slice().into_cow())
+//!         dot::LabelText::LabelStr(self.nodes[i].into_cow())
 //!     }
 //!     fn edge_label<'b>(&'b self, _: &Ed<'b>) -> dot::LabelText<'b> {
 //!         dot::LabelText::LabelStr("&sube;".into_cow())
 //!
 //! impl<'a> dot::GraphWalk<'a, Nd<'a>, Ed<'a>> for Graph {
 //!     fn nodes(&'a self) -> dot::Nodes<'a,Nd<'a>> {
-//!         self.nodes.iter().map(|s|s.as_slice()).enumerate().collect()
+//!         self.nodes.iter().map(|s| &s[..]).enumerate().collect()
 //!     }
 //!     fn edges(&'a self) -> dot::Edges<'a,Ed<'a>> {
 //!         self.edges.iter()
-//!             .map(|&(i,j)|((i, self.nodes[i].as_slice()),
-//!                           (j, self.nodes[j].as_slice())))
+//!             .map(|&(i,j)|((i, &self.nodes[i][..]),
+//!                           (j, &self.nodes[j][..])))
 //!             .collect()
 //!     }
 //!     fn source(&self, e: &Ed<'a>) -> Nd<'a> { let &(s,_) = e; s }
        html_root_url = "http://doc.rust-lang.org/nightly/")]
 #![feature(int_uint)]
 #![feature(collections)]
+#![feature(into_cow)]
 
 use self::LabelText::*;
 
@@ -381,7 +385,7 @@ fn is_constituent(c: char) -> bool {
             is_letter_or_underscore(c) || in_range('0', c, '9')
         }
         fn in_range(low: char, c: char, high: char) -> bool {
-            low as uint <= c as uint && c as uint <= high as uint
+            low as usize <= c as usize && c as usize <= high as usize
         }
     }
 
@@ -598,12 +602,12 @@ mod tests {
     use std::iter::repeat;
 
     /// each node is an index in a vector in the graph.
-    type Node = uint;
+    type Node = usize;
     struct Edge {
-        from: uint, to: uint, label: &'static str
+        from: usize, to: usize, label: &'static str
     }
 
-    fn edge(from: uint, to: uint, label: &'static str) -> Edge {
+    fn edge(from: usize, to: usize, label: &'static str) -> Edge {
         Edge { from: from, to: to, label: label }
     }
 
@@ -633,7 +637,7 @@ struct LabelledGraphWithEscStrs {
 
     enum NodeLabels<L> {
         AllNodesLabelled(Vec<L>),
-        UnlabelledNodes(uint),
+        UnlabelledNodes(usize),
         SomeNodesLabelled(Vec<Option<L>>),
     }
 
index 893781e6220908ae2823a6eda6ac3e86519fa8e1..1cb1f956e266ebc5fe3648d9dc2a6dd4586174c7 100644 (file)
@@ -2461,6 +2461,14 @@ pub mod posix88 {
             pub const S_IXUSR : c_int = 64;
             pub const S_IWUSR : c_int = 128;
             pub const S_IRUSR : c_int = 256;
+            pub const S_IRWXG : mode_t = 56;
+            pub const S_IXGRP : mode_t = 8;
+            pub const S_IWGRP : mode_t = 16;
+            pub const S_IRGRP : mode_t = 32;
+            pub const S_IRWXO : mode_t = 7;
+            pub const S_IXOTH : mode_t = 1;
+            pub const S_IWOTH : mode_t = 2;
+            pub const S_IROTH : mode_t = 4;
             pub const F_OK : c_int = 0;
             pub const R_OK : c_int = 4;
             pub const W_OK : c_int = 2;
@@ -2495,10 +2503,24 @@ pub mod bsd44 {
 
             pub const TCP_NODELAY: c_int = 0x0001;
             pub const SOL_SOCKET: c_int = 0xffff;
-            pub const SO_KEEPALIVE: c_int = 8;
-            pub const SO_BROADCAST: c_int = 32;
-            pub const SO_REUSEADDR: c_int = 4;
+
+            pub const SO_DEBUG: c_int = 0x0001;
+            pub const SO_ACCEPTCONN: c_int = 0x0002;
+            pub const SO_REUSEADDR: c_int = 0x0004;
+            pub const SO_KEEPALIVE: c_int = 0x0008;
+            pub const SO_DONTROUTE: c_int = 0x0010;
+            pub const SO_BROADCAST: c_int = 0x0020;
+            pub const SO_USELOOPBACK: c_int = 0x0040;
+            pub const SO_LINGER: c_int = 0x0080;
+            pub const SO_OOBINLINE: c_int = 0x0100;
+            pub const SO_SNDBUF: c_int = 0x1001;
+            pub const SO_RCVBUF: c_int = 0x1002;
+            pub const SO_SNDLOWAT: c_int = 0x1003;
+            pub const SO_RCVLOWAT: c_int = 0x1004;
+            pub const SO_SNDTIMEO: c_int = 0x1005;
+            pub const SO_RCVTIMEO: c_int = 0x1006;
             pub const SO_ERROR: c_int = 0x1007;
+            pub const SO_TYPE: c_int = 0x1008;
 
             pub const IFF_LOOPBACK: c_int = 4;
 
@@ -2797,6 +2819,14 @@ pub mod posix88 {
             pub const S_IXUSR : mode_t = 64;
             pub const S_IWUSR : mode_t = 128;
             pub const S_IRUSR : mode_t = 256;
+            pub const S_IRWXG : mode_t = 56;
+            pub const S_IXGRP : mode_t = 8;
+            pub const S_IWGRP : mode_t = 16;
+            pub const S_IRGRP : mode_t = 32;
+            pub const S_IRWXO : mode_t = 7;
+            pub const S_IXOTH : mode_t = 1;
+            pub const S_IWOTH : mode_t = 2;
+            pub const S_IROTH : mode_t = 4;
             pub const F_OK : c_int = 0;
             pub const R_OK : c_int = 4;
             pub const W_OK : c_int = 2;
@@ -3010,6 +3040,14 @@ pub mod posix88 {
             pub const S_IXUSR : mode_t = 64;
             pub const S_IWUSR : mode_t = 128;
             pub const S_IRUSR : mode_t = 256;
+            pub const S_IRWXG : mode_t = 56;
+            pub const S_IXGRP : mode_t = 8;
+            pub const S_IWGRP : mode_t = 16;
+            pub const S_IRGRP : mode_t = 32;
+            pub const S_IRWXO : mode_t = 7;
+            pub const S_IXOTH : mode_t = 1;
+            pub const S_IWOTH : mode_t = 2;
+            pub const S_IROTH : mode_t = 4;
             pub const F_OK : c_int = 0;
             pub const R_OK : c_int = 4;
             pub const W_OK : c_int = 2;
@@ -3441,10 +3479,24 @@ pub mod bsd44 {
 
             pub const TCP_NODELAY: c_int = 1;
             pub const SOL_SOCKET: c_int = 1;
-            pub const SO_KEEPALIVE: c_int = 9;
-            pub const SO_BROADCAST: c_int = 6;
+
+            pub const SO_DEBUG: c_int = 1;
             pub const SO_REUSEADDR: c_int = 2;
+            pub const SO_TYPE: c_int = 3;
             pub const SO_ERROR: c_int = 4;
+            pub const SO_DONTROUTE: c_int = 5;
+            pub const SO_BROADCAST: c_int = 6;
+            pub const SO_SNDBUF: c_int = 7;
+            pub const SO_RCVBUF: c_int = 8;
+            pub const SO_KEEPALIVE: c_int = 9;
+            pub const SO_OOBINLINE: c_int = 10;
+            pub const SO_LINGER: c_int = 13;
+            pub const SO_REUSEPORT: c_int = 15;
+            pub const SO_RCVLOWAT: c_int = 18;
+            pub const SO_SNDLOWAT: c_int = 19;
+            pub const SO_RCVTIMEO: c_int = 20;
+            pub const SO_SNDTIMEO: c_int = 21;
+            pub const SO_ACCEPTCONN: c_int = 30;
 
             pub const SHUT_RD: c_int = 0;
             pub const SHUT_WR: c_int = 1;
@@ -3487,10 +3539,24 @@ pub mod bsd44 {
 
             pub const TCP_NODELAY: c_int = 1;
             pub const SOL_SOCKET: c_int = 65535;
-            pub const SO_KEEPALIVE: c_int = 8;
-            pub const SO_BROADCAST: c_int = 32;
-            pub const SO_REUSEADDR: c_int = 4;
-            pub const SO_ERROR: c_int = 4103;
+
+            pub const SO_DEBUG: c_int = 0x0001;
+            pub const SO_REUSEADDR: c_int = 0x0004;
+            pub const SO_KEEPALIVE: c_int = 0x0008;
+            pub const SO_DONTROUTE: c_int = 0x0010;
+            pub const SO_BROADCAST: c_int = 0x0020;
+            pub const SO_LINGER: c_int = 0x0080;
+            pub const SO_OOBINLINE: c_int = 0x100;
+            pub const SO_REUSEPORT: c_int = 0x0200;
+            pub const SO_SNDBUF: c_int = 0x1001;
+            pub const SO_RCVBUF: c_int = 0x1002;
+            pub const SO_SNDLOWAT: c_int = 0x1003;
+            pub const SO_RCVLOWAT: c_int = 0x1004;
+            pub const SO_SNDTIMEO: c_int = 0x1005;
+            pub const SO_RCVTIMEO: c_int = 0x1006;
+            pub const SO_ERROR: c_int = 0x1007;
+            pub const SO_TYPE: c_int = 0x1008;
+            pub const SO_ACCEPTCONN: c_int = 0x1009;
 
             pub const SHUT_RD: c_int = 0;
             pub const SHUT_WR: c_int = 1;
@@ -3710,6 +3776,14 @@ pub mod posix88 {
             pub const S_IXUSR : mode_t = 64;
             pub const S_IWUSR : mode_t = 128;
             pub const S_IRUSR : mode_t = 256;
+            pub const S_IRWXG : mode_t = 56;
+            pub const S_IXGRP : mode_t = 8;
+            pub const S_IWGRP : mode_t = 16;
+            pub const S_IRGRP : mode_t = 32;
+            pub const S_IRWXO : mode_t = 7;
+            pub const S_IXOTH : mode_t = 1;
+            pub const S_IWOTH : mode_t = 2;
+            pub const S_IROTH : mode_t = 4;
             pub const F_OK : c_int = 0;
             pub const R_OK : c_int = 4;
             pub const W_OK : c_int = 2;
@@ -4002,10 +4076,24 @@ pub mod bsd44 {
             pub const TCP_NODELAY: c_int = 1;
             pub const TCP_KEEPIDLE: c_int = 256;
             pub const SOL_SOCKET: c_int = 0xffff;
+            pub const SO_DEBUG: c_int = 0x01;
+            pub const SO_ACCEPTCONN: c_int = 0x0002;
+            pub const SO_REUSEADDR: c_int = 0x0004;
             pub const SO_KEEPALIVE: c_int = 0x0008;
+            pub const SO_DONTROUTE: c_int = 0x0010;
             pub const SO_BROADCAST: c_int = 0x0020;
-            pub const SO_REUSEADDR: c_int = 0x0004;
+            pub const SO_USELOOPBACK: c_int = 0x0040;
+            pub const SO_LINGER: c_int = 0x0080;
+            pub const SO_OOBINLINE: c_int = 0x0100;
+            pub const SO_REUSEPORT: c_int = 0x0200;
+            pub const SO_SNDBUF: c_int = 0x1001;
+            pub const SO_RCVBUF: c_int = 0x1002;
+            pub const SO_SNDLOWAT: c_int = 0x1003;
+            pub const SO_RCVLOWAT: c_int = 0x1004;
+            pub const SO_SNDTIMEO: c_int = 0x1005;
+            pub const SO_RCVTIMEO: c_int = 0x1006;
             pub const SO_ERROR: c_int = 0x1007;
+            pub const SO_TYPE: c_int = 0x1008;
 
             pub const IFF_LOOPBACK: c_int = 0x8;
 
@@ -4142,6 +4230,14 @@ pub mod posix88 {
             pub const S_IXUSR : mode_t = 64;
             pub const S_IWUSR : mode_t = 128;
             pub const S_IRUSR : mode_t = 256;
+            pub const S_IRWXG : mode_t = 56;
+            pub const S_IXGRP : mode_t = 8;
+            pub const S_IWGRP : mode_t = 16;
+            pub const S_IRGRP : mode_t = 32;
+            pub const S_IRWXO : mode_t = 7;
+            pub const S_IXOTH : mode_t = 1;
+            pub const S_IWOTH : mode_t = 2;
+            pub const S_IROTH : mode_t = 4;
             pub const F_OK : c_int = 0;
             pub const R_OK : c_int = 4;
             pub const W_OK : c_int = 2;
@@ -4403,10 +4499,24 @@ pub mod bsd44 {
 
             pub const TCP_NODELAY: c_int = 0x01;
             pub const SOL_SOCKET: c_int = 0xffff;
+            pub const SO_DEBUG: c_int = 0x01;
+            pub const SO_ACCEPTCONN: c_int = 0x0002;
+            pub const SO_REUSEADDR: c_int = 0x0004;
             pub const SO_KEEPALIVE: c_int = 0x0008;
+            pub const SO_DONTROUTE: c_int = 0x0010;
             pub const SO_BROADCAST: c_int = 0x0020;
-            pub const SO_REUSEADDR: c_int = 0x0004;
+            pub const SO_USELOOPBACK: c_int = 0x0040;
+            pub const SO_LINGER: c_int = 0x0080;
+            pub const SO_OOBINLINE: c_int = 0x0100;
+            pub const SO_REUSEPORT: c_int = 0x0200;
+            pub const SO_SNDBUF: c_int = 0x1001;
+            pub const SO_RCVBUF: c_int = 0x1002;
+            pub const SO_SNDLOWAT: c_int = 0x1003;
+            pub const SO_RCVLOWAT: c_int = 0x1004;
+            pub const SO_SNDTIMEO: c_int = 0x1005;
+            pub const SO_RCVTIMEO: c_int = 0x1006;
             pub const SO_ERROR: c_int = 0x1007;
+            pub const SO_TYPE: c_int = 0x1008;
 
             pub const IFF_LOOPBACK: c_int = 0x8;
 
@@ -4540,6 +4650,14 @@ pub mod posix88 {
             pub const S_IXUSR : mode_t = 64;
             pub const S_IWUSR : mode_t = 128;
             pub const S_IRUSR : mode_t = 256;
+            pub const S_IRWXG : mode_t = 56;
+            pub const S_IXGRP : mode_t = 8;
+            pub const S_IWGRP : mode_t = 16;
+            pub const S_IRGRP : mode_t = 32;
+            pub const S_IRWXO : mode_t = 7;
+            pub const S_IXOTH : mode_t = 1;
+            pub const S_IWOTH : mode_t = 2;
+            pub const S_IROTH : mode_t = 4;
             pub const F_OK : c_int = 0;
             pub const R_OK : c_int = 4;
             pub const W_OK : c_int = 2;
@@ -4820,10 +4938,25 @@ pub mod bsd44 {
             pub const TCP_NODELAY: c_int = 0x01;
             pub const TCP_KEEPALIVE: c_int = 0x10;
             pub const SOL_SOCKET: c_int = 0xffff;
+
+            pub const SO_DEBUG: c_int = 0x01;
+            pub const SO_ACCEPTCONN: c_int = 0x0002;
+            pub const SO_REUSEADDR: c_int = 0x0004;
             pub const SO_KEEPALIVE: c_int = 0x0008;
+            pub const SO_DONTROUTE: c_int = 0x0010;
             pub const SO_BROADCAST: c_int = 0x0020;
-            pub const SO_REUSEADDR: c_int = 0x0004;
+            pub const SO_USELOOPBACK: c_int = 0x0040;
+            pub const SO_LINGER: c_int = 0x0080;
+            pub const SO_OOBINLINE: c_int = 0x0100;
+            pub const SO_REUSEPORT: c_int = 0x0200;
+            pub const SO_SNDBUF: c_int = 0x1001;
+            pub const SO_RCVBUF: c_int = 0x1002;
+            pub const SO_SNDLOWAT: c_int = 0x1003;
+            pub const SO_RCVLOWAT: c_int = 0x1004;
+            pub const SO_SNDTIMEO: c_int = 0x1005;
+            pub const SO_RCVTIMEO: c_int = 0x1006;
             pub const SO_ERROR: c_int = 0x1007;
+            pub const SO_TYPE: c_int = 0x1008;
 
             pub const IFF_LOOPBACK: c_int = 0x8;
 
@@ -4849,6 +4982,15 @@ pub mod extra {
             pub const MAP_STACK : c_int = 0;
 
             pub const IPPROTO_RAW : c_int = 255;
+
+            pub const SO_NREAD: c_int = 0x1020;
+            pub const SO_NKE: c_int = 0x1021;
+            pub const SO_NOSIGPIPE: c_int = 0x1022;
+            pub const SO_NOADDRERR: c_int = 0x1023;
+            pub const SO_NWRITE: c_int = 0x1024;
+            pub const SO_DONTTRUNC: c_int = 0x2000;
+            pub const SO_WANTMORE: c_int = 0x4000;
+            pub const SO_WANTOOBFLAG: c_int = 0x8000;
         }
         pub mod sysconf {
             use types::os::arch::c95::c_int;
@@ -5031,7 +5173,7 @@ pub fn strtoul(s: *const c_char, endp: *mut *mut c_char,
                 ///
                 /// # Examples
                 ///
-                /// ```no_run
+                /// ```no_run,ignore
                 /// extern crate libc;
                 ///
                 /// fn main() {
index 4537fc763c9536caa7a6ba3ba6312cdff8b71ef4..7ccd5401fdea47b58419244621a473b813d7e7e1 100644 (file)
@@ -304,10 +304,10 @@ pub fn log(level: u32, loc: &'static LogLocation, args: fmt::Arguments) {
     // Completely remove the local logger from TLS in case anyone attempts to
     // frob the slot while we're doing the logging. This will destroy any logger
     // set during logging.
-    let mut logger = LOCAL_LOGGER.with(|s| {
+    let mut logger: Box<Logger + Send> = LOCAL_LOGGER.with(|s| {
         s.borrow_mut().take()
     }).unwrap_or_else(|| {
-        box DefaultLogger { handle: io::stderr() } as Box<Logger + Send>
+        box DefaultLogger { handle: io::stderr() }
     });
     logger.log(&LogRecord {
         level: LogLevel(level),
@@ -443,7 +443,7 @@ fn init() {
         DIRECTIVES = boxed::into_raw(box directives);
 
         // Schedule the cleanup for the globals for when the runtime exits.
-        rt::at_exit(move || {
+        let _ = rt::at_exit(move || {
             let _g = LOCK.lock();
             assert!(!DIRECTIVES.is_null());
             let _directives = Box::from_raw(DIRECTIVES);
index 3180f03cfd3c2ee2d4c60efb78c8d8591a2e1c69..0c5f5cb0d444ee44962375c1b6a8818dde76b294 100644 (file)
@@ -60,6 +60,7 @@ fn zero_case<R:Rng>(rng: &mut R, _u: f64) -> f64 {
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand;
 /// use std::rand::distributions::{Exp, IndependentSample};
 ///
index 8eaac203fb4ad22ffdfbc3e1c40dfdc18bdf1e45..d04e83e84f7289e1a8cecbec01d1048bb1503b06 100644 (file)
@@ -40,6 +40,7 @@
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand;
 /// use std::rand::distributions::{IndependentSample, Gamma};
 ///
@@ -187,6 +188,7 @@ fn ind_sample<R: Rng>(&self, rng: &mut R) -> f64 {
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand;
 /// use std::rand::distributions::{ChiSquared, IndependentSample};
 ///
@@ -244,6 +246,7 @@ fn ind_sample<R: Rng>(&self, rng: &mut R) -> f64 {
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand;
 /// use std::rand::distributions::{FisherF, IndependentSample};
 ///
@@ -288,6 +291,7 @@ fn ind_sample<R: Rng>(&self, rng: &mut R) -> f64 {
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand;
 /// use std::rand::distributions::{StudentT, IndependentSample};
 ///
index a46709932e2de72afe7f6fa11b68a3ab31d6bd31..5cafb8d2e5eae2ab6f61339c9f4f2c42536d75d8 100644 (file)
@@ -94,6 +94,7 @@ pub struct Weighted<T> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand;
 /// use std::rand::distributions::{Weighted, WeightedChoice, IndependentSample};
 ///
index d07964624bf582e94941d0800dcc4aee7d3db9fb..7cecc6ac611e2af1e6b587b03b2adaa228974f0b 100644 (file)
@@ -76,6 +76,7 @@ fn zero_case<R:Rng>(rng: &mut R, u: f64) -> f64 {
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand;
 /// use std::rand::distributions::{Normal, IndependentSample};
 ///
@@ -124,6 +125,7 @@ fn ind_sample<R: Rng>(&self, rng: &mut R) -> f64 {
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand;
 /// use std::rand::distributions::{LogNormal, IndependentSample};
 ///
index 4086e149e7866fee68b6e4143257eba4ba68cc8b..a682fa8584176977d02ccb2b942fd91b4e62e2ab 100644 (file)
@@ -10,6 +10,8 @@
 
 //! Generating numbers between two others.
 
+#![allow(trivial_numeric_casts)]
+
 // this is surprisingly complicated to be both generic & correct
 
 use core::prelude::{PartialOrd};
@@ -36,6 +38,7 @@
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand::distributions::{IndependentSample, Range};
 ///
 /// fn main() {
index 7ea62b7fd3f413b62d35b1d365872e645d3cc4ee..14bebe0cd915cf167803a01a40d41227e389c387 100644 (file)
@@ -447,6 +447,7 @@ fn next_u32(&mut self) -> u32 {
 
     #[inline]
     fn next_u64(&mut self) -> u64 {
+        #![allow(trivial_numeric_casts)]
         if self.cnt == 0 {
             // make some more numbers
             self.isaac64();
index 5e52a176c9e16db2a344629d5adb9a4c3d74fcd8..9f6399ff12dd659f792aa448eb1cb377456d06ca 100644 (file)
@@ -34,7 +34,7 @@
 #![deprecated(reason = "use the crates.io `rand` library instead",
               since = "1.0.0-alpha")]
 
-#![cfg_attr(test, feature(test, rand))]
+#![cfg_attr(test, feature(test, rand, rustc_private))]
 
 #![allow(deprecated)]
 
@@ -149,6 +149,7 @@ fn next_f64(&mut self) -> f64 {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(rand, core)]
     /// use std::rand::{thread_rng, Rng};
     ///
     /// let mut v = [0; 13579];
@@ -184,6 +185,7 @@ fn fill_bytes(&mut self, dest: &mut [u8]) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(rand)]
     /// use std::rand::{thread_rng, Rng};
     ///
     /// let mut rng = thread_rng();
@@ -202,6 +204,7 @@ fn gen<T: Rand>(&mut self) -> T {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(rand)]
     /// use std::rand::{thread_rng, Rng};
     ///
     /// let mut rng = thread_rng();
@@ -229,6 +232,7 @@ fn gen_iter<'a, T: Rand>(&'a mut self) -> Generator<'a, T, Self> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(rand)]
     /// use std::rand::{thread_rng, Rng};
     ///
     /// let mut rng = thread_rng();
@@ -247,6 +251,7 @@ fn gen_range<T: PartialOrd + SampleRange>(&mut self, low: T, high: T) -> T {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(rand)]
     /// use std::rand::{thread_rng, Rng};
     ///
     /// let mut rng = thread_rng();
@@ -261,6 +266,7 @@ fn gen_weighted_bool(&mut self, n: uint) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(rand)]
     /// use std::rand::{thread_rng, Rng};
     ///
     /// let s: String = thread_rng().gen_ascii_chars().take(10).collect();
@@ -277,6 +283,7 @@ fn gen_ascii_chars<'a>(&'a mut self) -> AsciiGenerator<'a, Self> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(rand)]
     /// use std::rand::{thread_rng, Rng};
     ///
     /// let choices = [1, 2, 4, 8, 16, 32];
@@ -297,6 +304,7 @@ fn choose<'a, T>(&mut self, values: &'a [T]) -> Option<&'a T> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(rand, core)]
     /// use std::rand::{thread_rng, Rng};
     ///
     /// let mut rng = thread_rng();
@@ -360,6 +368,7 @@ pub trait SeedableRng<Seed>: Rng {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(rand)]
     /// use std::rand::{Rng, SeedableRng, StdRng};
     ///
     /// let seed: &[_] = &[1, 2, 3, 4];
@@ -375,6 +384,7 @@ pub trait SeedableRng<Seed>: Rng {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(rand)]
     /// use std::rand::{Rng, SeedableRng, StdRng};
     ///
     /// let seed: &[_] = &[1, 2, 3, 4];
@@ -480,6 +490,7 @@ fn rand<R: Rng>(rng: &mut R) -> XorShiftRng {
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand::{random, Open01};
 ///
 /// let Open01(val) = random::<Open01<f32>>();
@@ -497,6 +508,7 @@ fn rand<R: Rng>(rng: &mut R) -> XorShiftRng {
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand::{random, Closed01};
 ///
 /// let Closed01(val) = random::<Closed01<f32>>();
index 81e65da37fc5f34701cda91c16a612aaccccf607..95dd986d2e3c7be0556708349b6b55f3411ccdf5 100644 (file)
@@ -103,6 +103,7 @@ fn from_seed((rsdr, seed): (Rsdr, S)) -> ReseedingRng<R, Rsdr> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand::{Rng, SeedableRng, StdRng};
 /// use std::rand::reseeding::{Reseeder, ReseedingRng};
 ///
index 1a794f56f802c62c3a9c371f47acf6583e568111..182b05acbb61860d2133cd1db0027485f5f89b84 100644 (file)
@@ -353,7 +353,7 @@ pub fn vuint_at(data: &[u8], start: uint) -> DecodeResult<Res> {
             let (shift, mask) = SHIFT_MASK_TABLE[i];
             Ok(Res {
                 val: ((val >> shift) & mask) as uint,
-                next: start + (((32 - shift) >> 3) as uint)
+                next: start + ((32 - shift) >> 3),
             })
         }
     }
@@ -573,7 +573,7 @@ fn _next_int(&mut self,
                     0 => doc_as_u8(r_doc) as u64,
                     1 => doc_as_u16(r_doc) as u64,
                     2 => doc_as_u32(r_doc) as u64,
-                    3 => doc_as_u64(r_doc) as u64,
+                    3 => doc_as_u64(r_doc),
                     _ => unreachable!(),
                 }
             } else {
index 97ed391fdfc7842470d6ba283928c6f6bf0f6369..e8af07e43815919ef4a23410a662770d90047409 100644 (file)
 #![feature(path_ext)]
 #![feature(str_words)]
 #![feature(str_char)]
+#![feature(convert)]
+#![feature(into_cow)]
 #![cfg_attr(test, feature(test))]
 
+#![allow(trivial_casts)]
+#![allow(trivial_numeric_casts)]
+
 extern crate arena;
 extern crate flate;
 extern crate fmt_macros;
index 44718d1c5251dbfff6cfe42f55d9e7ee67d31df4..2cc47f258f0764db771e1a7dd1feb00b51e9f092 100644 (file)
     "detects transmutes of fat pointers"
 }
 
+declare_lint! {
+    pub TRIVIAL_CASTS,
+    Warn,
+    "detects trivial casts which could be removed"
+}
+
+declare_lint! {
+    pub TRIVIAL_NUMERIC_CASTS,
+    Warn,
+    "detects trivial casts of numeric types which could be removed"
+}
 /// Does nothing as a lint pass, but registers some `Lint`s
 /// which are used by other parts of the compiler.
 #[derive(Copy)]
@@ -121,7 +132,9 @@ fn get_lints(&self) -> LintArray {
             STABLE_FEATURES,
             UNKNOWN_CRATE_TYPES,
             VARIANT_SIZE_DIFFERENCES,
-            FAT_PTR_TRANSMUTES
+            FAT_PTR_TRANSMUTES,
+            TRIVIAL_CASTS,
+            TRIVIAL_NUMERIC_CASTS
         )
     }
 }
index 9aa6395b7b278b11b21bdf2c198340e956c4390b..9688447dc046a50f3f3996333d98c82354d20442 100644 (file)
@@ -212,7 +212,7 @@ pub fn process_command_line(&mut self, sess: &Session) {
     fn maybe_stage_features(&mut self, sess: &Session) {
         let lvl = match sess.opts.unstable_features {
             UnstableFeatures::Default => return,
-            UnstableFeatures::Disallow => Warn,
+            UnstableFeatures::Disallow => Forbid,
             UnstableFeatures::Cheat => Allow
         };
         match self.by_name.get("unstable_features") {
index 47ec31c0f1ab7d0c26b7d366282cf54d368121b9..f201ff374ea0f058db497bebce436a4dc34d06ea 100644 (file)
@@ -111,7 +111,7 @@ pub fn next_crate_num(&self) -> ast::CrateNum {
     }
 
     pub fn get_crate_data(&self, cnum: ast::CrateNum) -> Rc<crate_metadata> {
-        (*self.metas.borrow())[cnum].clone()
+        self.metas.borrow().get(&cnum).unwrap().clone()
     }
 
     pub fn get_crate_hash(&self, cnum: ast::CrateNum) -> Svh {
@@ -243,7 +243,7 @@ pub fn hash(&self) -> Svh { decoder::get_crate_hash(self.data()) }
 impl MetadataBlob {
     pub fn as_slice<'a>(&'a self) -> &'a [u8] {
         let slice = match *self {
-            MetadataVec(ref vec) => vec.as_slice(),
+            MetadataVec(ref vec) => &vec[..],
             MetadataArchive(ref ar) => ar.as_slice(),
         };
         if slice.len() < 4 {
index 10461e3d2aedfc38b2f51f9a0bd78f6fe97e5bde..fa8d0b2a56e4ee34b8e062ed0bac19948f730897 100644 (file)
@@ -375,7 +375,7 @@ fn encode_reexported_static_base_methods(ecx: &EncodeContext,
     match ecx.tcx.inherent_impls.borrow().get(&exp.def_id) {
         Some(implementations) => {
             for base_impl_did in &**implementations {
-                for &method_did in &*(*impl_items)[*base_impl_did] {
+                for &method_did in impl_items.get(base_impl_did).unwrap() {
                     let impl_item = ty::impl_or_trait_item(
                         ecx.tcx,
                         method_did.def_id());
@@ -1175,7 +1175,7 @@ fn add_to_index(item: &ast::Item, rbml_w: &mut Encoder,
         // We need to encode information about the default methods we
         // have inherited, so we drive this based on the impl structure.
         let impl_items = tcx.impl_items.borrow();
-        let items = &(*impl_items)[def_id];
+        let items = impl_items.get(&def_id).unwrap();
 
         add_to_index(item, rbml_w, index);
         rbml_w.start_tag(tag_items_data_item);
@@ -1816,7 +1816,7 @@ struct ImplVisitor<'a, 'b:'a, 'c:'a, 'tcx:'b> {
 impl<'a, 'b, 'c, 'tcx, 'v> Visitor<'v> for ImplVisitor<'a, 'b, 'c, 'tcx> {
     fn visit_item(&mut self, item: &ast::Item) {
         if let ast::ItemImpl(_, _, _, Some(ref trait_ref), _, _) = item.node {
-            let def_id = self.ecx.tcx.def_map.borrow()[trait_ref.ref_id].def_id();
+            let def_id = self.ecx.tcx.def_map.borrow().get(&trait_ref.ref_id).unwrap().def_id();
 
             // Load eagerly if this is an implementation of the Drop trait
             // or if the trait is not defined in this crate.
index 22a4a6fc978dc055a9a79ae360b03c0d51feca7e..284e76b328a6912323692c82f0f6180e8f29f97e 100644 (file)
@@ -156,7 +156,7 @@ pub fn get_dylib_search_paths(&self) -> Vec<PathBuf> {
 
     // Returns a list of directories where target-specific tool binaries are located.
     pub fn get_tools_search_paths(&self) -> Vec<PathBuf> {
-        let mut p = PathBuf::new(self.sysroot);
+        let mut p = PathBuf::from(self.sysroot);
         p.push(&find_libdir(self.sysroot));
         p.push(&rustlibdir());
         p.push(&self.triple);
@@ -166,7 +166,7 @@ pub fn get_tools_search_paths(&self) -> Vec<PathBuf> {
 }
 
 pub fn relative_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf {
-    let mut p = PathBuf::new(&find_libdir(sysroot));
+    let mut p = PathBuf::from(&find_libdir(sysroot));
     assert!(p.is_relative());
     p.push(&rustlibdir());
     p.push(target_triple);
@@ -224,7 +224,7 @@ pub fn rust_path() -> Vec<PathBuf> {
         Some(env_path) => {
             let env_path_components =
                 env_path.split(PATH_ENTRY_SEPARATOR);
-            env_path_components.map(|s| PathBuf::new(s)).collect()
+            env_path_components.map(|s| PathBuf::from(s)).collect()
         }
         None => Vec::new()
     };
index e466dc8a3a0181db8a7a3b99983fdffe748e5ea4..7854db811466517bbd3f675ab3ac0e80b9edc643 100644 (file)
@@ -628,7 +628,7 @@ fn find_commandline_library(&mut self, locs: &[String]) -> Option<Library> {
         let mut rlibs = HashMap::new();
         let mut dylibs = HashMap::new();
         {
-            let locs = locs.iter().map(|l| PathBuf::new(&l[..])).filter(|loc| {
+            let locs = locs.iter().map(|l| PathBuf::from(l)).filter(|loc| {
                 if !loc.exists() {
                     sess.err(&format!("extern location for {} does not exist: {}",
                                      self.crate_name, loc.display()));
index bffcb93bc6d06382d7d5d20f71be447d7291d1cf..801350e8a1e9c1d50d29d9f28d66f9c7add566ad 100644 (file)
@@ -1228,7 +1228,7 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext,
                     var_id: var_id,
                     closure_expr_id: id
                 };
-                let upvar_capture = tcx.upvar_capture_map.borrow()[upvar_id].clone();
+                let upvar_capture = tcx.upvar_capture_map.borrow().get(&upvar_id).unwrap().clone();
                 var_id.encode(rbml_w);
                 upvar_capture.encode(rbml_w);
             })
index 496c96c7c8adc1dd5bebd412b258c7a352db670d..97cd9456098b1bbab4fb5b8947975d9d46af1399 100644 (file)
@@ -874,7 +874,7 @@ pub fn specialize<'a>(cx: &MatchCheckCtxt, r: &[&'a Pat],
         }
 
         ast::PatEnum(_, ref args) => {
-            let def = cx.tcx.def_map.borrow()[pat_id].full_def();
+            let def = cx.tcx.def_map.borrow().get(&pat_id).unwrap().full_def();
             match def {
                 DefConst(..) =>
                     cx.tcx.sess.span_bug(pat_span, "const pattern should've \
@@ -892,7 +892,7 @@ pub fn specialize<'a>(cx: &MatchCheckCtxt, r: &[&'a Pat],
 
         ast::PatStruct(_, ref pattern_fields, _) => {
             // Is this a struct or an enum variant?
-            let def = cx.tcx.def_map.borrow()[pat_id].full_def();
+            let def = cx.tcx.def_map.borrow().get(&pat_id).unwrap().full_def();
             let class_id = match def {
                 DefConst(..) =>
                     cx.tcx.sess.span_bug(pat_span, "const pattern should've \
index 96433729a9b96ff675d29d4d7f8183b3a380cf4c..f9598237ff460805cc0494475f97820ff385fb3d 100644 (file)
@@ -150,7 +150,7 @@ pub fn const_expr_to_pat(tcx: &ty::ctxt, expr: &Expr, span: Span) -> P<ast::Pat>
             ast::PatTup(exprs.iter().map(|expr| const_expr_to_pat(tcx, &**expr, span)).collect()),
 
         ast::ExprCall(ref callee, ref args) => {
-            let def = tcx.def_map.borrow()[callee.id];
+            let def = *tcx.def_map.borrow().get(&callee.id).unwrap();
             if let Vacant(entry) = tcx.def_map.borrow_mut().entry(expr.id) {
                entry.insert(def);
             }
index 5efea66ab0c6cc751cff9f1550057df4657780f7..6d4d759476ed5330edde04b58b498f294dc99498 100644 (file)
@@ -158,7 +158,7 @@ fn handle_tup_field_access(&mut self, lhs: &ast::Expr, idx: uint) {
 
     fn handle_field_pattern_match(&mut self, lhs: &ast::Pat,
                                   pats: &[codemap::Spanned<ast::FieldPat>]) {
-        let id = match self.tcx.def_map.borrow()[lhs.id].full_def() {
+        let id = match self.tcx.def_map.borrow().get(&lhs.id).unwrap().full_def() {
             def::DefVariant(_, id, _) => id,
             _ => {
                 match ty::ty_to_def_id(ty::node_id_to_type(self.tcx,
@@ -496,7 +496,7 @@ fn symbol_is_live(&mut self, id: ast::NodeId,
             None => (),
             Some(impl_list) => {
                 for impl_did in &**impl_list {
-                    for item_did in &(*impl_items)[*impl_did] {
+                    for item_did in &*impl_items.get(impl_did).unwrap() {
                         if self.live_symbols.contains(&item_did.def_id()
                                                                .node) {
                             return true;
index 378f3db0823391064cc40409021c97497134dddd..5d970c59f639bd5e3b4a289a7419ce7ddb52dfd0 100644 (file)
@@ -141,7 +141,7 @@ fn visit_expr(&mut self, expr: &ast::Expr) {
         match expr.node {
             ast::ExprMethodCall(_, _, _) => {
                 let method_call = MethodCall::expr(expr.id);
-                let base_type = (*self.tcx.method_map.borrow())[method_call].ty;
+                let base_type = self.tcx.method_map.borrow().get(&method_call).unwrap().ty;
                 debug!("effect: method call case, base type is {}",
                        ppaux::ty_to_string(self.tcx, base_type));
                 if type_is_unsafe_function(base_type) {
index 6d2392054f9d578efd6786583c204d89302d00c0..97314b57ef656802a6b773495566051c7a27978c 100644 (file)
@@ -442,7 +442,7 @@ pub fn walk_expr(&mut self, expr: &ast::Expr) {
                 if !self.walk_overloaded_operator(expr,
                                                   &**lhs,
                                                   vec![&**rhs],
-                                                  PassArgs::ByRef) {
+                                                  PassArgs::ByValue) {
                     self.select_from_expr(&**lhs);
                     self.consume_expr(&**rhs);
                 }
@@ -1012,7 +1012,7 @@ fn walk_pat(&mut self,
 
                 // Each match binding is effectively an assignment to the
                 // binding being produced.
-                let def = def_map.borrow()[pat.id].full_def();
+                let def = def_map.borrow().get(&pat.id).unwrap().full_def();
                 match mc.cat_def(pat.id, pat.span, pat_ty, def) {
                     Ok(binding_cmt) => {
                         delegate.mutate(pat.id, pat.span, binding_cmt, Init);
index 94c9699e30cc42ad73d545f3471c3a18b1a91616..930e95d1f939a474590138324dbacc9dd1b5dac7 100644 (file)
@@ -557,18 +557,7 @@ pub fn super_tys<'tcx, C>(this: &C,
 
         (&ty::ty_rptr(a_r, ref a_mt), &ty::ty_rptr(b_r, ref b_mt)) => {
             let r = try!(this.regions_with_variance(ty::Contravariant, *a_r, *b_r));
-
-            // FIXME(14985)  If we have mutable references to trait objects, we
-            // used to use covariant subtyping. I have preserved this behaviour,
-            // even though it is probably incorrect. So don't go down the usual
-            // path which would require invariance.
-            let mt = match (&a_mt.ty.sty, &b_mt.ty.sty) {
-                (&ty::ty_trait(..), &ty::ty_trait(..)) if a_mt.mutbl == b_mt.mutbl => {
-                    let ty = try!(this.tys(a_mt.ty, b_mt.ty));
-                    ty::mt { ty: ty, mutbl: a_mt.mutbl }
-                }
-                _ => try!(this.mts(a_mt, b_mt))
-            };
+            let mt = try!(this.mts(a_mt, b_mt));
             Ok(ty::mk_rptr(tcx, tcx.mk_region(r), mt))
         }
 
index 759d7357df1931d71b0843e61594c2dd4624cbcb..553e3601806677ed1bc37f4ba22ddc4a9fbe7a3e 100644 (file)
@@ -1533,7 +1533,7 @@ fn process_edges<'a, 'tcx>(this: &RegionVarBindings<'a, 'tcx>,
                     ConstrainVarSubReg(_, region) => {
                         state.result.push(RegionAndOrigin {
                             region: region,
-                            origin: this.constraints.borrow()[edge.data].clone()
+                            origin: this.constraints.borrow().get(&edge.data).unwrap().clone()
                         });
                     }
                 }
index 932c9c61ef1fbb53ef4006201de88feea96f0f31..705f20559afde27711c2c0934f7aba5c68aa5df0 100644 (file)
@@ -448,7 +448,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) {
     match expr.node {
       // live nodes required for uses or definitions of variables:
       ast::ExprPath(..) => {
-        let def = ir.tcx.def_map.borrow()[expr.id].full_def();
+        let def = ir.tcx.def_map.borrow().get(&expr.id).unwrap().full_def();
         debug!("expr {}: path that leads to {:?}", expr.id, def);
         if let DefLocal(..) = def {
             ir.add_live_node_for_node(expr.id, ExprNode(expr.span));
@@ -1302,7 +1302,7 @@ fn write_lvalue(&mut self, expr: &Expr, succ: LiveNode, acc: u32)
 
     fn access_path(&mut self, expr: &Expr, succ: LiveNode, acc: u32)
                    -> LiveNode {
-        match self.ir.tcx.def_map.borrow()[expr.id].full_def() {
+        match self.ir.tcx.def_map.borrow().get(&expr.id).unwrap().full_def() {
           DefLocal(nid) => {
             let ln = self.live_node(expr.id, expr.span);
             if acc != 0 {
@@ -1564,7 +1564,9 @@ fn check_ret(&self,
     fn check_lvalue(&mut self, expr: &Expr) {
         match expr.node {
             ast::ExprPath(..) => {
-                if let DefLocal(nid) = self.ir.tcx.def_map.borrow()[expr.id].full_def() {
+                if let DefLocal(nid) = self.ir.tcx.def_map.borrow().get(&expr.id)
+                                                                   .unwrap()
+                                                                   .full_def() {
                     // Assignment to an immutable variable or argument: only legal
                     // if there is no later assignment. If this local is actually
                     // mutable, then check for a reassignment to flag the mutability
index 5237a86ebb6300f5c76f16a32587b866d51edd34..bdcfc67f92b997a370cad0693f2eab1f729c626f 100644 (file)
@@ -531,7 +531,7 @@ pub fn cat_expr_unadjusted(&self, expr: &ast::Expr) -> McResult<cmt<'tcx>> {
           }
 
           ast::ExprPath(..) => {
-            let def = self.tcx().def_map.borrow()[expr.id].full_def();
+            let def = self.tcx().def_map.borrow().get(&expr.id).unwrap().full_def();
             self.cat_def(expr.id, expr.span, expr_ty, def)
           }
 
index c5abff3b96360bceaa9ca8b8d8124e02ad4fb08e..4f365beed213f2a44f57d238779cb69d84cebcd7 100644 (file)
@@ -119,6 +119,24 @@ pub fn pat_contains_bindings(dm: &DefMap, pat: &ast::Pat) -> bool {
     contains_bindings
 }
 
+/// Checks if the pattern contains any `ref` or `ref mut` bindings.
+pub fn pat_contains_ref_binding(dm: &DefMap, pat: &ast::Pat) -> bool {
+    let mut result = false;
+    pat_bindings(dm, pat, |mode, _, _, _| {
+        match mode {
+            ast::BindingMode::BindByRef(_) => { result = true; }
+            ast::BindingMode::BindByValue(_) => { }
+        }
+    });
+    result
+}
+
+/// Checks if the patterns for this arm contain any `ref` or `ref mut`
+/// bindings.
+pub fn arm_contains_ref_binding(dm: &DefMap, arm: &ast::Arm) -> bool {
+    arm.pats.iter().any(|pat| pat_contains_ref_binding(dm, pat))
+}
+
 /// Checks if the pattern contains any patterns that bind something to
 /// an ident or wildcard, e.g. `foo`, or `Foo(_)`, `foo @ Bar(..)`,
 pub fn pat_contains_bindings_or_wild(dm: &DefMap, pat: &ast::Pat) -> bool {
index 7ded344414ce698bf328818b6ea1ef645553bd0d..1bd45b5fc86017cd5a8afea2c994c2e181397d9e 100644 (file)
@@ -128,7 +128,7 @@ fn visit_expr(&mut self, expr: &ast::Expr) {
             }
             ast::ExprMethodCall(..) => {
                 let method_call = ty::MethodCall::expr(expr.id);
-                match (*self.tcx.method_map.borrow())[method_call].origin {
+                match (*self.tcx.method_map.borrow()).get(&method_call).unwrap().origin {
                     ty::MethodStatic(def_id) => {
                         if is_local(def_id) {
                             if self.def_id_represents_local_inlined_item(def_id) {
index 01766b0de085f0c4d32d5f2b70aec2a3d6257366..7043b2613605d4b9ddf16bbab1d2d0550c9b454a 100644 (file)
@@ -26,7 +26,7 @@
 use syntax::ast_util::is_local;
 use syntax::attr::{Stability, AttrMetaMethods};
 use syntax::visit::{FnKind, Visitor};
-use syntax::feature_gate::emit_feature_warn;
+use syntax::feature_gate::emit_feature_err;
 use util::nodemap::{NodeMap, DefIdMap, FnvHashSet, FnvHashMap};
 use util::ppaux::Repr;
 
@@ -237,7 +237,7 @@ fn check(&mut self, id: ast::DefId, span: Span, stab: &Option<Stability>) {
                         None => format!("use of unstable library feature '{}'", &feature)
                     };
 
-                    emit_feature_warn(&self.tcx.sess.parse_sess.span_diagnostic,
+                    emit_feature_err(&self.tcx.sess.parse_sess.span_diagnostic,
                                       &feature, span, &msg);
                 }
             }
@@ -319,7 +319,7 @@ pub fn check_item(tcx: &ty::ctxt, item: &ast::Item, warn_about_defns: bool,
         // individually as it's possible to have a stable trait with unstable
         // items.
         ast::ItemImpl(_, _, _, Some(ref t), _, ref impl_items) => {
-            let trait_did = tcx.def_map.borrow()[t.ref_id].def_id();
+            let trait_did = tcx.def_map.borrow().get(&t.ref_id).unwrap().def_id();
             let trait_items = ty::trait_items(tcx, trait_did);
 
             for impl_item in impl_items {
index d2b5b460d142002b174a88910a9972944f3f7316..d10ff060418ccb05cdca1061c2e816224c9fbacf 100644 (file)
@@ -12,6 +12,7 @@
     FulfillmentError,
     FulfillmentErrorCode,
     MismatchedProjectionTypes,
+    Obligation,
     ObligationCauseCode,
     OutputTypeParameterMismatch,
     PredicateObligation,
@@ -21,6 +22,7 @@
 use fmt_macros::{Parser, Piece, Position};
 use middle::infer::InferCtxt;
 use middle::ty::{self, AsPredicate, ReferencesError, ToPolyTraitRef, TraitRef};
+use middle::ty_fold::TypeFoldable;
 use std::collections::HashMap;
 use syntax::codemap::{DUMMY_SP, Span};
 use syntax::attr::{AttributeMethods, AttrMetaMethods};
@@ -137,24 +139,36 @@ trait definition for {} must have a value, \
     report
 }
 
+/// Reports that an overflow has occurred and halts compilation. We
+/// halt compilation unconditionally because it is important that
+/// overflows never be masked -- they basically represent computations
+/// whose result could not be truly determined and thus we can't say
+/// if the program type checks or not -- and they are unusual
+/// occurrences in any case.
+pub fn report_overflow_error<'a, 'tcx, T>(infcx: &InferCtxt<'a, 'tcx>,
+                                          obligation: &Obligation<'tcx, T>)
+                                          -> !
+    where T: UserString<'tcx> + TypeFoldable<'tcx>
+{
+    let predicate =
+        infcx.resolve_type_vars_if_possible(&obligation.predicate);
+    span_err!(infcx.tcx.sess, obligation.cause.span, E0275,
+              "overflow evaluating the requirement `{}`",
+              predicate.user_string(infcx.tcx));
+
+    suggest_new_overflow_limit(infcx.tcx, obligation.cause.span);
+
+    note_obligation_cause(infcx, obligation);
+
+    infcx.tcx.sess.abort_if_errors();
+    unreachable!();
+}
+
 pub fn report_selection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
                                         obligation: &PredicateObligation<'tcx>,
                                         error: &SelectionError<'tcx>)
 {
     match *error {
-        SelectionError::Overflow => {
-            // We could track the stack here more precisely if we wanted, I imagine.
-            let predicate =
-                infcx.resolve_type_vars_if_possible(&obligation.predicate);
-            span_err!(infcx.tcx.sess, obligation.cause.span, E0275,
-                    "overflow evaluating the requirement `{}`",
-                    predicate.user_string(infcx.tcx));
-
-            suggest_new_overflow_limit(infcx.tcx, obligation.cause.span);
-
-            note_obligation_cause(infcx, obligation);
-        }
-
         SelectionError::Unimplemented => {
             match &obligation.cause.code {
                 &ObligationCauseCode::CompareImplMethodObligation => {
@@ -309,8 +323,9 @@ pub fn maybe_report_ambiguity<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
     }
 }
 
-fn note_obligation_cause<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
-                                   obligation: &PredicateObligation<'tcx>)
+fn note_obligation_cause<'a, 'tcx, T>(infcx: &InferCtxt<'a, 'tcx>,
+                                      obligation: &Obligation<'tcx, T>)
+    where T: UserString<'tcx>
 {
     note_obligation_cause_code(infcx,
                                &obligation.predicate,
@@ -318,10 +333,11 @@ fn note_obligation_cause<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
                                &obligation.cause.code);
 }
 
-fn note_obligation_cause_code<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
-                                        predicate: &ty::Predicate<'tcx>,
-                                        cause_span: Span,
-                                        cause_code: &ObligationCauseCode<'tcx>)
+fn note_obligation_cause_code<'a, 'tcx, T>(infcx: &InferCtxt<'a, 'tcx>,
+                                           predicate: &T,
+                                           cause_span: Span,
+                                           cause_code: &ObligationCauseCode<'tcx>)
+    where T: UserString<'tcx>
 {
     let tcx = infcx.tcx;
     match *cause_code {
index f46cac308287ba769d34378ddc19421d5aee3233..24b201c960f16ffe001b9914c2010b81170e4946 100644 (file)
 use std::rc::Rc;
 use syntax::ast;
 use syntax::codemap::{Span, DUMMY_SP};
-use util::ppaux::{Repr, UserString};
+use util::ppaux::Repr;
 
 pub use self::error_reporting::report_fulfillment_errors;
+pub use self::error_reporting::report_overflow_error;
 pub use self::error_reporting::suggest_new_overflow_limit;
 pub use self::coherence::orphan_check;
 pub use self::coherence::overlapping_impls;
@@ -151,7 +152,6 @@ pub struct DerivedObligationCause<'tcx> {
 #[derive(Clone,Debug)]
 pub enum SelectionError<'tcx> {
     Unimplemented,
-    Overflow,
     OutputTypeParameterMismatch(ty::PolyTraitRef<'tcx>,
                                 ty::PolyTraitRef<'tcx>,
                                 ty::type_err<'tcx>),
@@ -327,16 +327,9 @@ pub fn evaluate_builtin_bound<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
     let result = match fulfill_cx.select_all_or_error(infcx, typer) {
         Ok(()) => Ok(Some(())), // Success, we know it implements Copy.
         Err(errors) => {
-            // Check if overflow occurred anywhere and propagate that.
-            if errors.iter().any(
-                |err| match err.code { CodeSelectionError(Overflow) => true, _ => false })
-            {
-                return Err(Overflow);
-            }
-
-            // Otherwise, if there were any hard errors, propagate an
-            // arbitrary one of those. If no hard errors at all,
-            // report ambiguity.
+            // If there were any hard errors, propagate an arbitrary
+            // one of those. If no hard errors at all, report
+            // ambiguity.
             let sel_error =
                 errors.iter()
                       .filter_map(|err| {
@@ -384,16 +377,8 @@ pub fn type_known_to_meet_builtin_bound<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
             // soldering on, so just treat this like not implemented
             false
         }
-        Err(Overflow) => {
-            span_err!(infcx.tcx.sess, span, E0285,
-                "overflow evaluating whether `{}` is `{}`",
-                      ty.user_string(infcx.tcx),
-                      bound.user_string(infcx.tcx));
-            suggest_new_overflow_limit(infcx.tcx, span);
-            false
-        }
         Err(_) => {
-            // other errors: not implemented.
+            // errors: not implemented.
             false
         }
     }
@@ -652,15 +637,6 @@ fn new(obligation: PredicateObligation<'tcx>,
     {
         FulfillmentError { obligation: obligation, code: code }
     }
-
-    pub fn is_overflow(&self) -> bool {
-        match self.code {
-            CodeAmbiguity => false,
-            CodeSelectionError(Overflow) => true,
-            CodeSelectionError(_) => false,
-            CodeProjectionError(_) => false,
-        }
-    }
 }
 
 impl<'tcx> TraitObligation<'tcx> {
index 6b66d7227d300d00ca6e4280ebf7ea778b69d18c..2232bb7bcdbf3698510c56e4f40808c205664dc0 100644 (file)
@@ -11,9 +11,9 @@
 //! Code for projecting associated types out of trait references.
 
 use super::elaborate_predicates;
+use super::report_overflow_error;
 use super::Obligation;
 use super::ObligationCause;
-use super::Overflow;
 use super::PredicateObligation;
 use super::SelectionContext;
 use super::SelectionError;
@@ -442,7 +442,7 @@ fn project_type<'cx,'tcx>(
     let recursion_limit = selcx.tcx().sess.recursion_limit.get();
     if obligation.recursion_depth >= recursion_limit {
         debug!("project: overflow!");
-        return Err(ProjectionTyError::TraitSelectionError(Overflow));
+        report_overflow_error(selcx.infcx(), &obligation);
     }
 
     let obligation_trait_ref =
@@ -789,10 +789,13 @@ fn confirm_callable_candidate<'cx,'tcx>(
            obligation.repr(tcx),
            fn_sig.repr(tcx));
 
+    // the `Output` associated type is declared on `FnOnce`
+    let fn_once_def_id = tcx.lang_items.fn_once_trait().unwrap();
+
     // Note: we unwrap the binder here but re-create it below (1)
     let ty::Binder((trait_ref, ret_type)) =
         util::closure_trait_ref_and_return_type(tcx,
-                                                obligation.predicate.trait_ref.def_id,
+                                                fn_once_def_id,
                                                 obligation.predicate.trait_ref.self_ty(),
                                                 fn_sig,
                                                 flag);
@@ -854,10 +857,10 @@ fn confirm_impl_candidate<'cx,'tcx>(
     let impl_items_map = selcx.tcx().impl_items.borrow();
     let impl_or_trait_items_map = selcx.tcx().impl_or_trait_items.borrow();
 
-    let impl_items = &impl_items_map[impl_vtable.impl_def_id];
+    let impl_items = impl_items_map.get(&impl_vtable.impl_def_id).unwrap();
     let mut impl_ty = None;
     for impl_item in impl_items {
-        let assoc_type = match impl_or_trait_items_map[impl_item.def_id()] {
+        let assoc_type = match *impl_or_trait_items_map.get(&impl_item.def_id()).unwrap() {
             ty::TypeTraitItem(ref assoc_type) => assoc_type.clone(),
             ty::MethodTraitItem(..) => { continue; }
         };
index 7dfbccea0dccd160f4c8ecfb6a0470083d6c28c1..0d6a1f7df5e564cd8d26bf8d7beebec1ba9f4201 100644 (file)
@@ -21,8 +21,9 @@
 use super::project;
 use super::project::{normalize_with_depth, Normalized};
 use super::{PredicateObligation, TraitObligation, ObligationCause};
+use super::{report_overflow_error};
 use super::{ObligationCauseCode, BuiltinDerivedObligation, ImplDerivedObligation};
-use super::{SelectionError, Unimplemented, Overflow, OutputTypeParameterMismatch};
+use super::{SelectionError, Unimplemented, OutputTypeParameterMismatch};
 use super::{Selection};
 use super::{SelectionResult};
 use super::{VtableBuiltin, VtableImpl, VtableParam, VtableClosure,
@@ -561,10 +562,7 @@ fn candidate_from_obligation<'o>(&mut self,
         // not update) the cache.
         let recursion_limit = self.infcx.tcx.sess.recursion_limit.get();
         if stack.obligation.recursion_depth >= recursion_limit {
-            debug!("{} --> overflow (limit={})",
-                   stack.obligation.repr(self.tcx()),
-                   recursion_limit);
-            return Err(Overflow)
+            report_overflow_error(self.infcx(), &stack.obligation);
         }
 
         // Check the cache. Note that we skolemize the trait-ref
@@ -1071,7 +1069,7 @@ fn assemble_closure_candidates(&mut self,
         match self.closure_typer.closure_kind(closure_def_id) {
             Some(closure_kind) => {
                 debug!("assemble_unboxed_candidates: closure_kind = {:?}", closure_kind);
-                if closure_kind == kind {
+                if closure_kind.extends(kind) {
                     candidates.vec.push(ClosureCandidate(closure_def_id, substs.clone()));
                 }
             }
@@ -1090,10 +1088,8 @@ fn assemble_fn_pointer_candidates(&mut self,
                                       candidates: &mut SelectionCandidateSet<'tcx>)
                                       -> Result<(),SelectionError<'tcx>>
     {
-        // We provide a `Fn` impl for fn pointers. There is no need to provide
-        // the other traits (e.g. `FnMut`) since those are provided by blanket
-        // impls.
-        if Some(obligation.predicate.def_id()) != self.tcx().lang_items.fn_trait() {
+        // We provide impl of all fn traits for fn pointers.
+        if self.tcx().lang_items.fn_trait_kind(obligation.predicate.def_id()).is_none() {
             return Ok(());
         }
 
@@ -1762,7 +1758,7 @@ fn collect_predicates_for_types(&mut self,
 
         match obligations {
             Ok(mut obls) => {
-                obls.push_all(normalized.obligations.as_slice());
+                obls.push_all(&normalized.obligations);
                 obls
             },
             Err(ErrorReported) => Vec::new()
@@ -2582,11 +2578,13 @@ fn repr(&self, tcx: &ty::ctxt<'tcx>) -> String {
 impl<'tcx> EvaluationResult<'tcx> {
     fn may_apply(&self) -> bool {
         match *self {
-            EvaluatedToOk
-            | EvaluatedToAmbig
-            | EvaluatedToErr(Overflow)
-            | EvaluatedToErr(OutputTypeParameterMismatch(..)) => true,
-            EvaluatedToErr(Unimplemented) => false,
+            EvaluatedToOk |
+            EvaluatedToAmbig |
+            EvaluatedToErr(OutputTypeParameterMismatch(..)) =>
+                true,
+
+            EvaluatedToErr(Unimplemented) =>
+                false,
         }
     }
 }
index 88b721ce958622c7b345dbe53c7c88b9e1b389b4..965aaf12044ec20692b20ca403d9234580c25a04 100644 (file)
@@ -514,9 +514,6 @@ fn repr(&self, tcx: &ty::ctxt<'tcx>) -> String {
 impl<'tcx> Repr<'tcx> for super::SelectionError<'tcx> {
     fn repr(&self, tcx: &ty::ctxt<'tcx>) -> String {
         match *self {
-            super::Overflow =>
-                format!("Overflow"),
-
             super::Unimplemented =>
                 format!("Unimplemented"),
 
index 99c35c6e5425824a20b3e8ba2144f5d885dd4aba..7eb54ca9daff003e8adbf54275d8b71ce55bcb29 100644 (file)
@@ -52,6 +52,7 @@
 use middle::region;
 use middle::resolve_lifetime;
 use middle::infer;
+use middle::pat_util;
 use middle::stability;
 use middle::subst::{self, ParamSpace, Subst, Substs, VecPerParamSpace};
 use middle::traits;
@@ -967,7 +968,7 @@ impl<'tcx> Eq for TyS<'tcx> {}
 
 impl<'tcx> Hash for TyS<'tcx> {
     fn hash<H: Hasher>(&self, s: &mut H) {
-        (self as *const _).hash(s)
+        (self as *const TyS).hash(s)
     }
 }
 
@@ -2461,8 +2462,11 @@ pub struct ItemSubsts<'tcx> {
     pub substs: Substs<'tcx>,
 }
 
-#[derive(Clone, Copy, PartialEq, Eq, Debug, RustcEncodable, RustcDecodable)]
+#[derive(Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, RustcEncodable, RustcDecodable)]
 pub enum ClosureKind {
+    // Warning: Ordering is significant here! The ordering is chosen
+    // because the trait Fn is a subtrait of FnMut and so in turn, and
+    // hence we order it so that Fn < FnMut < FnOnce.
     FnClosureKind,
     FnMutClosureKind,
     FnOnceClosureKind,
@@ -2484,6 +2488,20 @@ pub fn trait_did(&self, cx: &ctxt) -> ast::DefId {
             Err(err) => cx.sess.fatal(&err[..]),
         }
     }
+
+    /// True if this a type that impls this closure kind
+    /// must also implement `other`.
+    pub fn extends(self, other: ty::ClosureKind) -> bool {
+        match (self, other) {
+            (FnClosureKind, FnClosureKind) => true,
+            (FnClosureKind, FnMutClosureKind) => true,
+            (FnClosureKind, FnOnceClosureKind) => true,
+            (FnMutClosureKind, FnMutClosureKind) => true,
+            (FnMutClosureKind, FnOnceClosureKind) => true,
+            (FnOnceClosureKind, FnOnceClosureKind) => true,
+            _ => false,
+        }
+    }
 }
 
 pub trait ClosureTyper<'tcx> {
@@ -2667,7 +2685,7 @@ pub fn mk_region(&self, region: Region) -> &'tcx Region {
     }
 
     pub fn closure_kind(&self, def_id: ast::DefId) -> ty::ClosureKind {
-        self.closure_kinds.borrow()[def_id]
+        *self.closure_kinds.borrow().get(&def_id).unwrap()
     }
 
     pub fn closure_type(&self,
@@ -2675,14 +2693,22 @@ pub fn closure_type(&self,
                         substs: &subst::Substs<'tcx>)
                         -> ty::ClosureTy<'tcx>
     {
-        self.closure_tys.borrow()[def_id].subst(self, substs)
+        self.closure_tys.borrow().get(&def_id).unwrap().subst(self, substs)
     }
 
     pub fn type_parameter_def(&self,
                               node_id: ast::NodeId)
                               -> TypeParameterDef<'tcx>
     {
-        self.ty_param_defs.borrow()[node_id].clone()
+        self.ty_param_defs.borrow().get(&node_id).unwrap().clone()
+    }
+
+    pub fn pat_contains_ref_binding(&self, pat: &ast::Pat) -> bool {
+        pat_util::pat_contains_ref_binding(&self.def_map, pat)
+    }
+
+    pub fn arm_contains_ref_binding(&self, arm: &ast::Arm) -> bool {
+        pat_util::arm_contains_ref_binding(&self.def_map, arm)
     }
 }
 
@@ -2712,7 +2738,7 @@ fn intern_ty<'tcx>(type_arena: &'tcx TypedArena<TyS<'tcx>>,
     };
 
     debug!("Interned type: {:?} Pointer: {:?}",
-           ty, ty as *const _);
+           ty, ty as *const TyS);
 
     interner.insert(InternedTy { ty: ty }, ty);
 
@@ -4797,32 +4823,6 @@ pub fn expr_kind(tcx: &ctxt, expr: &ast::Expr) -> ExprKind {
             RvalueDpsExpr
         }
 
-        ast::ExprCast(..) => {
-            match tcx.node_types.borrow().get(&expr.id) {
-                Some(&ty) => {
-                    if type_is_trait(ty) {
-                        RvalueDpsExpr
-                    } else {
-                        RvalueDatumExpr
-                    }
-                }
-                None => {
-                    // Technically, it should not happen that the expr is not
-                    // present within the table.  However, it DOES happen
-                    // during type check, because the final types from the
-                    // expressions are not yet recorded in the tcx.  At that
-                    // time, though, we are only interested in knowing lvalue
-                    // vs rvalue.  It would be better to base this decision on
-                    // the AST type in cast node---but (at the time of this
-                    // writing) it's not easy to distinguish casts to traits
-                    // from other casts based on the AST.  This should be
-                    // easier in the future, when casts to traits
-                    // would like @Foo, Box<Foo>, or &Foo.
-                    RvalueDatumExpr
-                }
-            }
-        }
-
         ast::ExprBreak(..) |
         ast::ExprAgain(..) |
         ast::ExprRet(..) |
@@ -4838,7 +4838,8 @@ pub fn expr_kind(tcx: &ctxt, expr: &ast::Expr) -> ExprKind {
         ast::ExprUnary(..) |
         ast::ExprBox(None, _) |
         ast::ExprAddrOf(..) |
-        ast::ExprBinary(..) => {
+        ast::ExprBinary(..) |
+        ast::ExprCast(..) => {
             RvalueDatumExpr
         }
 
@@ -5980,10 +5981,7 @@ pub fn item_variances(tcx: &ctxt, item_id: ast::DefId) -> Rc<ItemVariances> {
 
 pub fn trait_has_default_impl(tcx: &ctxt, trait_def_id: DefId) -> bool {
     populate_implementations_for_trait_if_necessary(tcx, trait_def_id);
-    match tcx.lang_items.to_builtin_kind(trait_def_id) {
-        Some(BoundSend) | Some(BoundSync) => true,
-        _ => tcx.traits_with_default_impls.borrow().contains_key(&trait_def_id),
-    }
+    tcx.traits_with_default_impls.borrow().contains_key(&trait_def_id)
 }
 
 /// Records a trait-to-implementation mapping.
@@ -6540,7 +6538,7 @@ pub fn is_method_call(&self, expr_id: ast::NodeId) -> bool {
     }
 
     pub fn upvar_capture(&self, upvar_id: ty::UpvarId) -> Option<ty::UpvarCapture> {
-        Some(self.upvar_capture_map.borrow()[upvar_id].clone())
+        Some(self.upvar_capture_map.borrow().get(&upvar_id).unwrap().clone())
     }
 }
 
index e368a6691332caa6b78d96c546d28d894bbd6a82..a7c67a0863182e6af468f5e4ba104a01b3c5a50c 100644 (file)
@@ -907,7 +907,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
 
     let cg = build_codegen_options(matches);
 
-    let sysroot_opt = matches.opt_str("sysroot").map(|m| PathBuf::new(&m));
+    let sysroot_opt = matches.opt_str("sysroot").map(|m| PathBuf::from(&m));
     let target = matches.opt_str("target").unwrap_or(
         host_triple().to_string());
     let opt_level = {
index 3c5d97445058b2d7ed3743a35192bb3bf4d5c910..3dc31f9524effe1e5b32668c7c7d707bbf9ce1fb 100644 (file)
@@ -54,7 +54,7 @@ pub fn add_path(&mut self, path: &str) {
         if path.is_empty() {
             early_error("empty search path given via `-L`");
         }
-        self.paths.push((kind, PathBuf::new(path)));
+        self.paths.push((kind, PathBuf::from(path)));
     }
 
     pub fn iter(&self, kind: PathKind) -> Iter {
index aec8ac38a5ad3a48fc94aff7b690e14c32576621..2cc51a723f2370c96a362fb87b2de0e83ecd18ed 100644 (file)
@@ -319,7 +319,7 @@ fn add_archive<F>(&mut self, archive: &Path, name: &str,
             };
             let new_filename = self.work_dir.path().join(&filename[..]);
             try!(fs::rename(&file, &new_filename));
-            self.members.push(PathBuf::new(&filename));
+            self.members.push(PathBuf::from(filename));
         }
         Ok(())
     }
index c29cbb352a321ce44bc2a5b911474fbf4787eff1..6d8891dd4fe078f058ed3ed958ede8b891013147 100644 (file)
@@ -19,7 +19,7 @@
 pub fn realpath(original: &Path) -> io::Result<PathBuf> {
     let old = old_path::Path::new(original.to_str().unwrap());
     match old_realpath(&old) {
-        Ok(p) => Ok(PathBuf::new(p.as_str().unwrap())),
+        Ok(p) => Ok(PathBuf::from(p.as_str().unwrap())),
         Err(e) => Err(io::Error::new(io::ErrorKind::Other,
                                      "realpath error",
                                      Some(e.to_string())))
index 99d24a6013078f90be120d67ffadaf33a0b168bc..f7ee76c0a4397450ce8a258e67d51439bd90ac3f 100644 (file)
@@ -36,7 +36,6 @@
 #![feature(collections)]
 #![feature(core)]
 #![feature(old_fs)]
-#![feature(hash)]
 #![feature(int_uint)]
 #![feature(io)]
 #![feature(old_io)]
@@ -47,8 +46,9 @@
 #![feature(rand)]
 #![feature(path_ext)]
 #![feature(std_misc)]
-#![feature(path_relative_from)]
 #![feature(step_by)]
+#![feature(convert)]
+#![cfg_attr(test, feature(test, rand))]
 
 extern crate syntax;
 extern crate serialize;
index 4f9f1447d8a731b918f765666306916435348de4..ff3f0b78f91b317fae4c0485a0a835c796fdb8cf 100644 (file)
@@ -99,30 +99,58 @@ fn get_rpath_relative_to_output(config: &mut RPathConfig, lib: &Path) -> String
     lib.pop();
     let mut output = (config.realpath)(&cwd.join(&config.out_filename)).unwrap();
     output.pop();
-    let relative = relativize(&lib, &output);
+    let relative = path_relative_from(&lib, &output)
+        .expect(&format!("couldn't create relative path from {:?} to {:?}", output, lib));
     // FIXME (#9639): This needs to handle non-utf8 paths
     format!("{}/{}", prefix,
             relative.to_str().expect("non-utf8 component in path"))
 }
 
-fn relativize(path: &Path, rel: &Path) -> PathBuf {
-    let mut res = PathBuf::new("");
-    let mut cur = rel;
-    while !path.starts_with(cur) {
-        res.push("..");
-        match cur.parent() {
-            Some(p) => cur = p,
-            None => panic!("can't create relative paths across filesystems"),
+// This routine is adapted from the *old* Path's `path_relative_from`
+// function, which works differently from the new `relative_from` function.
+// In particular, this handles the case on unix where both paths are
+// absolute but with only the root as the common directory.
+fn path_relative_from(path: &Path, base: &Path) -> Option<PathBuf> {
+    use std::path::Component;
+
+    if path.is_absolute() != base.is_absolute() {
+        if path.is_absolute() {
+            Some(PathBuf::from(path))
+        } else {
+            None
         }
+    } else {
+        let mut ita = path.components();
+        let mut itb = base.components();
+        let mut comps: Vec<Component> = vec![];
+        loop {
+            match (ita.next(), itb.next()) {
+                (None, None) => break,
+                (Some(a), None) => {
+                    comps.push(a);
+                    comps.extend(ita.by_ref());
+                    break;
+                }
+                (None, _) => comps.push(Component::ParentDir),
+                (Some(a), Some(b)) if comps.is_empty() && a == b => (),
+                (Some(a), Some(b)) if b == Component::CurDir => comps.push(a),
+                (Some(_), Some(b)) if b == Component::ParentDir => return None,
+                (Some(a), Some(_)) => {
+                    comps.push(Component::ParentDir);
+                    for _ in itb {
+                        comps.push(Component::ParentDir);
+                    }
+                    comps.push(a);
+                    comps.extend(ita.by_ref());
+                    break;
+                }
+            }
+        }
+        Some(comps.iter().map(|c| c.as_os_str()).collect())
     }
-    match path.relative_from(cur) {
-        Some(s) => { res.push(s); res }
-        None => panic!("couldn't create relative path from {:?} to {:?}",
-                       rel, path),
-    }
-
 }
 
+
 fn get_install_prefix_rpath(config: &mut RPathConfig) -> String {
     let path = (config.get_install_prefix_lib_path)();
     let path = env::current_dir().unwrap().join(&path);
@@ -200,7 +228,7 @@ fn test_rpath_relative() {
                 used_crates: Vec::new(),
                 has_rpath: true,
                 is_like_osx: true,
-                out_filename: PathBuf::new("bin/rustc"),
+                out_filename: PathBuf::from("bin/rustc"),
                 get_install_prefix_lib_path: &mut || panic!(),
                 realpath: &mut |p| Ok(p.to_path_buf()),
             };
@@ -210,7 +238,7 @@ fn test_rpath_relative() {
         } else {
             let config = &mut RPathConfig {
                 used_crates: Vec::new(),
-                out_filename: PathBuf::new("bin/rustc"),
+                out_filename: PathBuf::from("bin/rustc"),
                 get_install_prefix_lib_path: &mut || panic!(),
                 has_rpath: true,
                 is_like_osx: false,
index 4663901a7b4c1f84114586dc066bf05feecf5aac..c464658f447acd973d1568b93dca9285c59dd21b 100644 (file)
@@ -393,11 +393,11 @@ macro_rules! load_specific {
         let path = {
             let mut target = target.to_string();
             target.push_str(".json");
-            PathBuf::new(&target)
+            PathBuf::from(target)
         };
 
         let target_path = env::var_os("RUST_TARGET_PATH")
-                              .unwrap_or(OsString::from_str(""));
+                              .unwrap_or(OsString::new());
 
         // FIXME 16351: add a sane default search path?
 
index 2992ddbc4f4533ac2ca3517bc3c573c863084e13..93a2a5d125778eeab36329aa661ec2dec366a926 100644 (file)
@@ -18,6 +18,7 @@
 #![feature(no_std)]
 #![no_std]
 #![unstable(feature = "rustc_private")]
+#![cfg_attr(test, feature(hash))]
 
 //! A typesafe bitmask flag generator.
 
@@ -32,6 +33,7 @@
 /// # Examples
 ///
 /// ```{.rust}
+/// # #![feature(rustc_private)]
 /// #[macro_use] extern crate rustc_bitflags;
 ///
 /// bitflags! {
@@ -58,6 +60,7 @@
 /// The generated `struct`s can also be extended with type and trait implementations:
 ///
 /// ```{.rust}
+/// # #![feature(rustc_private)]
 /// #[macro_use] extern crate rustc_bitflags;
 ///
 /// use std::fmt;
index 8846f70fbd335febf9b005813b07dfc2b885bb03..2834fce5278c85ab7b3caf36f3de0a47425e6a30 100644 (file)
@@ -486,7 +486,7 @@ fn add_gen_kills(&self,
             match path.loan_path.kind {
                 LpVar(..) | LpUpvar(..) | LpDowncast(..) => {
                     let kill_scope = path.loan_path.kill_scope(tcx);
-                    let path = self.path_map.borrow()[path.loan_path];
+                    let path = *self.path_map.borrow().get(&path.loan_path).unwrap();
                     self.kill_moves(path, kill_scope.node_id(), dfcx_moves);
                 }
                 LpExtend(..) => {}
index e09457970e12f776513d60245527aab02288f6c5..e927ea5b86cdd27bc3416ced57069c96bf3b5e22 100644 (file)
@@ -28,6 +28,7 @@
 #![feature(rustc_private)]
 #![feature(staged_api)]
 #![feature(unsafe_destructor)]
+#![feature(into_cow)]
 
 #[macro_use] extern crate log;
 #[macro_use] extern crate syntax;
index dc27a30110950454f813cf5ac82003408a379e37..4c654cbf27de05fd5bfecd79ba31d0b91a3a857e 100644 (file)
@@ -468,7 +468,7 @@ pub fn phase_2_configure_and_expand(sess: &Session,
             // dependent dlls. Note that this uses cfg!(windows) as opposed to
             // targ_cfg because syntax extensions are always loaded for the host
             // compiler, not for the target.
-            let mut _old_path = OsString::from_str("");
+            let mut _old_path = OsString::new();
             if cfg!(windows) {
                 _old_path = env::var_os("PATH").unwrap_or(_old_path);
                 let mut new_path = sess.host_filesearch(PathKind::All).get_dylib_search_paths();
@@ -752,7 +752,7 @@ pub fn phase_5_run_llvm_passes(sess: &Session,
 pub fn phase_6_link_output(sess: &Session,
                            trans: &trans::CrateTranslation,
                            outputs: &OutputFilenames) {
-    let old_path = env::var_os("PATH").unwrap_or(OsString::from_str(""));
+    let old_path = env::var_os("PATH").unwrap_or(OsString::new());
     let mut new_path = sess.host_filesearch(PathKind::All).get_tools_search_paths();
     new_path.extend(env::split_paths(&old_path));
     env::set_var("PATH", &env::join_paths(new_path.iter()).unwrap());
@@ -927,7 +927,7 @@ pub fn build_output_filenames(input: &Input,
             // We want to toss everything after the final '.'
             let dirpath = match *odir {
                 Some(ref d) => d.clone(),
-                None => PathBuf::new("")
+                None => PathBuf::new()
             };
 
             // If a crate name is present, we use it as the link name
index 0071e4434efa4a5ae8cc1aff523c887388c41c67..5e6f2fb835bb2a01787ebf36f027bcf5e1a4ed58 100644 (file)
@@ -39,6 +39,7 @@
 #![feature(io)]
 #![feature(set_stdio)]
 #![feature(unicode)]
+#![feature(convert)]
 
 extern crate arena;
 extern crate flate;
@@ -163,8 +164,8 @@ macro_rules! do_or_return {($expr: expr) => {
 
 // Extract output directory and file from matches.
 fn make_output(matches: &getopts::Matches) -> (Option<PathBuf>, Option<PathBuf>) {
-    let odir = matches.opt_str("out-dir").map(|o| PathBuf::new(&o));
-    let ofile = matches.opt_str("o").map(|o| PathBuf::new(&o));
+    let odir = matches.opt_str("out-dir").map(|o| PathBuf::from(&o));
+    let ofile = matches.opt_str("o").map(|o| PathBuf::from(&o));
     (odir, ofile)
 }
 
@@ -177,7 +178,7 @@ fn make_input(free_matches: &[String]) -> Option<(Input, Option<PathBuf>)> {
             io::stdin().read_to_string(&mut src).unwrap();
             Some((Input::Str(src), None))
         } else {
-            Some((Input::File(PathBuf::new(ifile)), Some(PathBuf::new(ifile))))
+            Some((Input::File(PathBuf::from(ifile)), Some(PathBuf::from(ifile))))
         }
     } else {
         None
@@ -858,9 +859,9 @@ pub fn diagnostics_registry() -> diagnostics::registry::Registry {
     use syntax::diagnostics::registry::Registry;
 
     let all_errors = Vec::new() +
-        rustc::diagnostics::DIAGNOSTICS.as_slice() +
-        rustc_typeck::diagnostics::DIAGNOSTICS.as_slice() +
-        rustc_resolve::diagnostics::DIAGNOSTICS.as_slice();
+        &rustc::diagnostics::DIAGNOSTICS[..] +
+        &rustc_typeck::diagnostics::DIAGNOSTICS[..] +
+        &rustc_resolve::diagnostics::DIAGNOSTICS[..];
 
     Registry::new(&*all_errors)
 }
index f6f82c65374bd2bf9f0f8f5c2be28576892d6c28..8b57a48f3ce728355e345cb4b3415009ab00e885 100644 (file)
@@ -84,30 +84,6 @@ fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
     }
 }
 
-declare_lint! {
-    UNUSED_TYPECASTS,
-    Allow,
-    "detects unnecessary type casts that can be removed"
-}
-
-#[derive(Copy)]
-pub struct UnusedCasts;
-
-impl LintPass for UnusedCasts {
-    fn get_lints(&self) -> LintArray {
-        lint_array!(UNUSED_TYPECASTS)
-    }
-
-    fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
-        if let ast::ExprCast(ref expr, ref ty) = e.node {
-            let t_t = ty::expr_ty(cx.tcx, e);
-            if ty::expr_ty(cx.tcx, &**expr) == t_t {
-                cx.span_lint(UNUSED_TYPECASTS, ty.span, "unnecessary type cast");
-            }
-        }
-    }
-}
-
 declare_lint! {
     UNSIGNED_NEGATION,
     Warn,
@@ -418,7 +394,7 @@ struct ImproperCTypesVisitor<'a, 'tcx: 'a> {
 
 impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
     fn check_def(&mut self, sp: Span, id: ast::NodeId) {
-        match self.cx.tcx.def_map.borrow()[id].full_def() {
+        match self.cx.tcx.def_map.borrow().get(&id).unwrap().full_def() {
             def::DefPrimTy(ast::TyInt(ast::TyIs(_))) => {
                 self.cx.span_lint(IMPROPER_CTYPES, sp,
                                   "found rust type `isize` in foreign module, while \
@@ -1804,6 +1780,9 @@ fn get_lints(&self) -> LintArray {
 
     fn check_fn(&mut self, cx: &Context, fn_kind: visit::FnKind, _: &ast::FnDecl,
                 blk: &ast::Block, sp: Span, id: ast::NodeId) {
+        // FIXME(#23542) Replace with type ascription.
+        #![allow(trivial_casts)]
+
         type F = for<'tcx> fn(&ty::ctxt<'tcx>,
                               ast::NodeId, ast::NodeId, ast::Ident, ast::NodeId) -> bool;
 
@@ -2056,7 +2035,7 @@ fn check_item(&mut self, cx: &Context, it: &ast::Item) {
                 }
             },
             ast::ItemStatic(..) => {
-                if attr::contains_name(it.attrs.as_slice(), "no_mangle") &&
+                if attr::contains_name(&it.attrs, "no_mangle") &&
                        !cx.exported_items.contains(&it.id) {
                     let msg = format!("static {} is marked #[no_mangle], but not exported",
                                       it.ident);
@@ -2064,7 +2043,7 @@ fn check_item(&mut self, cx: &Context, it: &ast::Item) {
                 }
             },
             ast::ItemConst(..) => {
-                if attr::contains_name(it.attrs.as_slice(), "no_mangle") {
+                if attr::contains_name(&it.attrs, "no_mangle") {
                     // Const items do not refer to a particular location in memory, and therefore
                     // don't have anything to attach a symbol to
                     let msg = "const items should never be #[no_mangle], consider instead using \
index 99b3393c003de840856e6511268a6bd1d318be51..e158541cd1cfffe8471fc3a9662070de078949c1 100644 (file)
@@ -40,7 +40,6 @@
 #![feature(rustc_private)]
 #![feature(unsafe_destructor)]
 #![feature(staged_api)]
-#![feature(std_misc)]
 #![feature(str_char)]
 #![cfg_attr(test, feature(test))]
 
@@ -57,7 +56,7 @@
 pub use rustc::util as util;
 
 use session::Session;
-use lint::{LintPassObject, LintId};
+use lint::LintId;
 
 mod builtin;
 
@@ -68,7 +67,7 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
     macro_rules! add_builtin {
         ($sess:ident, $($name:ident),*,) => (
             {$(
-                store.register_pass($sess, false, box builtin::$name as LintPassObject);
+                store.register_pass($sess, false, box builtin::$name);
                 )*}
             )
     }
@@ -76,7 +75,7 @@ macro_rules! add_builtin {
     macro_rules! add_builtin_with_new {
         ($sess:ident, $($name:ident),*,) => (
             {$(
-                store.register_pass($sess, false, box builtin::$name::new() as LintPassObject);
+                store.register_pass($sess, false, box builtin::$name::new());
                 )*}
             )
     }
@@ -90,7 +89,6 @@ macro_rules! add_lint_group {
     add_builtin!(sess,
                  HardwiredLints,
                  WhileTrue,
-                 UnusedCasts,
                  ImproperCTypes,
                  BoxPointers,
                  UnusedAttributes,
@@ -130,7 +128,7 @@ macro_rules! add_lint_group {
                     UNUSED_UNSAFE, PATH_STATEMENTS);
 
     // We have one lint pass defined specially
-    store.register_pass(sess, false, box lint::GatherNodeLevels as LintPassObject);
+    store.register_pass(sess, false, box lint::GatherNodeLevels);
 
     // Insert temporary renamings for a one-time deprecation
     store.register_renamed("raw_pointer_deriving", "raw_pointer_derive");
index 506bf4a058fc6f155e10b3b8a7a5ec4709c97d3f..9d564fa56f54d88391f62a02fbe7690870f38d93 100644 (file)
@@ -14,6 +14,8 @@
 #![allow(non_camel_case_types)]
 #![allow(non_snake_case)]
 #![allow(dead_code)]
+#![allow(trivial_casts)]
+#![allow(trivial_numeric_casts)]
 
 #![crate_name = "rustc_llvm"]
 #![unstable(feature = "rustc_private")]
index bfce2f0062de48f8591406f4af87b2f0a3d85a43..2e7fe91365a13475dabf5e99106be2e2b82421dd 100644 (file)
@@ -253,7 +253,7 @@ fn visit_item(&mut self, item: &ast::Item) {
             ast::ItemImpl(_, _, _, _, ref ty, ref impl_items) => {
                 let public_ty = match ty.node {
                     ast::TyPath(..) => {
-                        match self.tcx.def_map.borrow()[ty.id].full_def() {
+                        match self.tcx.def_map.borrow().get(&ty.id).unwrap().full_def() {
                             def::DefPrimTy(..) => true,
                             def => {
                                 let did = def.def_id();
@@ -317,7 +317,7 @@ fn visit_item(&mut self, item: &ast::Item) {
 
             ast::ItemTy(ref ty, _) if public_first => {
                 if let ast::TyPath(..) = ty.node {
-                    match self.tcx.def_map.borrow()[ty.id].full_def() {
+                    match self.tcx.def_map.borrow().get(&ty.id).unwrap().full_def() {
                         def::DefPrimTy(..) | def::DefTyParam(..) => {},
                         def => {
                             let did = def.def_id();
@@ -349,7 +349,7 @@ fn visit_mod(&mut self, m: &ast::Mod, _sp: Span, id: ast::NodeId) {
         // crate module gets processed as well.
         if self.prev_exported {
             assert!(self.export_map.contains_key(&id), "wut {}", id);
-            for export in &self.export_map[id] {
+            for export in self.export_map.get(&id).unwrap() {
                 if is_local(export.def_id) {
                     self.reexports.insert(export.def_id.node);
                 }
@@ -525,7 +525,7 @@ fn def_privacy(&self, did: ast::DefId) -> PrivacyResult {
             // if we've reached the root, then everything was allowable and this
             // access is public.
             if closest_private_id == ast::CRATE_NODE_ID { return Allowable }
-            closest_private_id = self.parents[closest_private_id];
+            closest_private_id = *self.parents.get(&closest_private_id).unwrap();
 
             // If we reached the top, then we were public all the way down and
             // we can allow this access.
@@ -543,7 +543,7 @@ fn def_privacy(&self, did: ast::DefId) -> PrivacyResult {
     /// whether the node is accessible by the current module that iteration is
     /// inside.
     fn private_accessible(&self, id: ast::NodeId) -> bool {
-        let parent = self.parents[id];
+        let parent = *self.parents.get(&id).unwrap();
         debug!("privacy - accessible parent {}", self.nodestr(parent));
 
         // After finding `did`'s closest private member, we roll ourselves back
@@ -567,7 +567,7 @@ fn private_accessible(&self, id: ast::NodeId) -> bool {
                 _ => {}
             }
 
-            cur = self.parents[cur];
+            cur = *self.parents.get(&cur).unwrap();
         }
     }
 
@@ -622,7 +622,7 @@ fn ensure_public(&self, span: Span, to_check: ast::DefId,
                             ast::TyPath(..) => {}
                             _ => return Some((err_span, err_msg, None)),
                         };
-                        let def = self.tcx.def_map.borrow()[ty.id].full_def();
+                        let def = self.tcx.def_map.borrow().get(&ty.id).unwrap().full_def();
                         let did = def.def_id();
                         assert!(is_local(did));
                         match self.tcx.map.get(did.node) {
@@ -708,7 +708,7 @@ fn check_static_method(&mut self,
     // Checks that a path is in scope.
     fn check_path(&mut self, span: Span, path_id: ast::NodeId, last: ast::Ident) {
         debug!("privacy - path {}", self.nodestr(path_id));
-        let path_res = self.tcx.def_map.borrow()[path_id];
+        let path_res = *self.tcx.def_map.borrow().get(&path_id).unwrap();
         let ck = |tyname: &str| {
             let ck_public = |def: ast::DefId| {
                 debug!("privacy - ck_public {:?}", def);
@@ -881,7 +881,7 @@ fn visit_expr(&mut self, expr: &ast::Expr) {
                         }
                     }
                     ty::ty_enum(_, _) => {
-                        match self.tcx.def_map.borrow()[expr.id].full_def() {
+                        match self.tcx.def_map.borrow().get(&expr.id).unwrap().full_def() {
                             def::DefVariant(_, variant_id, _) => {
                                 for field in fields {
                                     self.check_field(expr.span, variant_id,
index 34a23f3efac42c3011bbb2773d05f58f01aea631..bb7880161d5d4e364b2ebc7701468e64d3820a77 100644 (file)
@@ -877,7 +877,7 @@ fn link_args(cmd: &mut Command,
         if t.options.is_like_osx {
             let morestack = lib_path.join("libmorestack.a");
 
-            let mut v = OsString::from_str("-Wl,-force_load,");
+            let mut v = OsString::from("-Wl,-force_load,");
             v.push(&morestack);
             cmd.arg(&v);
         } else {
@@ -1002,7 +1002,7 @@ fn link_args(cmd: &mut Command,
             cmd.args(&["-dynamiclib", "-Wl,-dylib"]);
 
             if sess.opts.cg.rpath {
-                let mut v = OsString::from_str("-Wl,-install_name,@rpath/");
+                let mut v = OsString::from("-Wl,-install_name,@rpath/");
                 v.push(out_filename.file_name().unwrap());
                 cmd.arg(&v);
             }
@@ -1020,7 +1020,7 @@ fn link_args(cmd: &mut Command,
         let mut get_install_prefix_lib_path = || {
             let install_prefix = option_env!("CFG_PREFIX").expect("CFG_PREFIX");
             let tlib = filesearch::relative_target_lib_path(sysroot, target_triple);
-            let mut path = PathBuf::new(install_prefix);
+            let mut path = PathBuf::from(install_prefix);
             path.push(&tlib);
 
             path
@@ -1102,7 +1102,7 @@ fn add_local_native_libraries(cmd: &mut Command, sess: &Session) {
                                             &sess.target.target.options.staticlib_suffix,
                                             &search_path[..],
                                             &sess.diagnostic().handler);
-            let mut v = OsString::from_str("-Wl,-force_load,");
+            let mut v = OsString::from("-Wl,-force_load,");
             v.push(&lib);
             cmd.arg(&v);
         }
@@ -1141,9 +1141,9 @@ fn add_upstream_rust_crates(cmd: &mut Command, sess: &Session,
     // involves just passing the right -l flag.
 
     let data = if dylib {
-        &trans.crate_formats[config::CrateTypeDylib]
+        trans.crate_formats.get(&config::CrateTypeDylib).unwrap()
     } else {
-        &trans.crate_formats[config::CrateTypeExecutable]
+        trans.crate_formats.get(&config::CrateTypeExecutable).unwrap()
     };
 
     // Invoke get_used_crates to ensure that we get a topological sorting of
index efc81da560b6e262e0cc9ed52f9eaa50fe4781ad..99a64156d667b96d89a3cef297d4500ed0f6c33c 100644 (file)
 #![feature(unicode)]
 #![feature(path_ext)]
 #![feature(fs)]
-#![feature(hash)]
+#![feature(convert)]
 #![feature(path_relative_from)]
 
+#![allow(trivial_casts)]
+#![allow(trivial_numeric_casts)]
+
 extern crate arena;
 extern crate flate;
 extern crate getopts;
index 83bb5efb425d26564f746145dcba376b4086f67b..53aa6d44fe7e86f014df2b7a65737af761883975 100644 (file)
@@ -219,7 +219,7 @@ fn lookup_type_ref(&self, ref_id: NodeId) -> Option<DefId> {
             self.sess.bug(&format!("def_map has no key for {} in lookup_type_ref",
                                   ref_id));
         }
-        let def = self.analysis.ty_cx.def_map.borrow()[ref_id].full_def();
+        let def = self.analysis.ty_cx.def_map.borrow().get(&ref_id).unwrap().full_def();
         match def {
             def::DefPrimTy(_) => None,
             _ => Some(def.def_id()),
@@ -232,7 +232,7 @@ fn lookup_def_kind(&self, ref_id: NodeId, span: Span) -> Option<recorder::Row> {
             self.sess.span_bug(span, &format!("def_map has no key for {} in lookup_def_kind",
                                              ref_id));
         }
-        let def = def_map[ref_id].full_def();
+        let def = def_map.get(&ref_id).unwrap().full_def();
         match def {
             def::DefMod(_) |
             def::DefForeignMod(_) => Some(recorder::ModRef),
@@ -269,8 +269,10 @@ fn process_formals(&mut self, formals: &Vec<ast::Arg>, qualname: &str) {
             self.collecting = false;
             let span_utils = self.span.clone();
             for &(id, ref p, _, _) in &self.collected_paths {
-                let typ = ppaux::ty_to_string(&self.analysis.ty_cx,
-                    (*self.analysis.ty_cx.node_types.borrow())[id]);
+                let typ =
+                    ppaux::ty_to_string(
+                        &self.analysis.ty_cx,
+                        *self.analysis.ty_cx.node_types.borrow().get(&id).unwrap());
                 // get the span only for the name of the variable (I hope the path is only ever a
                 // variable name, but who knows?)
                 self.fmt.formal_str(p.span,
@@ -431,8 +433,10 @@ fn process_struct_field_def(&mut self,
             ast::NamedField(ident, _) => {
                 let name = get_ident(ident);
                 let qualname = format!("{}::{}", qualname, name);
-                let typ = ppaux::ty_to_string(&self.analysis.ty_cx,
-                    (*self.analysis.ty_cx.node_types.borrow())[field.node.id]);
+                let typ =
+                    ppaux::ty_to_string(
+                        &self.analysis.ty_cx,
+                        *self.analysis.ty_cx.node_types.borrow().get(&field.node.id).unwrap());
                 match self.span.sub_span_before_token(field.span, token::Colon) {
                     Some(sub_span) => self.fmt.field_str(field.span,
                                                          Some(sub_span),
@@ -789,7 +793,7 @@ fn process_path(&mut self,
             self.sess.span_bug(span,
                                &format!("def_map has no key for {} in visit_expr", id));
         }
-        let def = def_map[id].full_def();
+        let def = def_map.get(&id).unwrap().full_def();
         let sub_span = self.span.span_for_last_ident(span);
         match def {
             def::DefUpvar(..) |
@@ -832,7 +836,8 @@ fn process_path(&mut self,
                                                  .ty_cx
                                                  .impl_items
                                                  .borrow();
-                            Some((*impl_items)[def_id]
+                            Some(impl_items.get(&def_id)
+                                           .unwrap()
                                            .iter()
                                            .find(|mr| {
                                                 ty::impl_or_trait_item(
@@ -941,7 +946,7 @@ fn process_method_call(&mut self,
                            ex: &ast::Expr,
                            args: &Vec<P<ast::Expr>>) {
         let method_map = self.analysis.ty_cx.method_map.borrow();
-        let method_callee = &(*method_map)[ty::MethodCall::expr(ex.id)];
+        let method_callee = method_map.get(&ty::MethodCall::expr(ex.id)).unwrap();
         let (def_id, decl_id) = match method_callee.origin {
             ty::MethodStatic(def_id) |
             ty::MethodStaticClosure(def_id) => {
@@ -1001,7 +1006,7 @@ fn process_pat(&mut self, p:&ast::Pat) {
                 self.collected_paths.push((p.id, path.clone(), false, recorder::StructRef));
                 visit::walk_path(self, path);
 
-                let def = self.analysis.ty_cx.def_map.borrow()[p.id].full_def();
+                let def = self.analysis.ty_cx.def_map.borrow().get(&p.id).unwrap().full_def();
                 let struct_def = match def {
                     def::DefConst(..) => None,
                     def::DefVariant(_, variant_id, _) => Some(variant_id),
@@ -1113,7 +1118,7 @@ fn visit_item(&mut self, item: &ast::Item) {
                         let glob_map = &self.analysis.glob_map;
                         let glob_map = glob_map.as_ref().unwrap();
                         if glob_map.contains_key(&item.id) {
-                            for n in &glob_map[item.id] {
+                            for n in glob_map.get(&item.id).unwrap() {
                                 if name_string.len() > 0 {
                                     name_string.push_str(", ");
                                 }
@@ -1406,7 +1411,7 @@ fn visit_arm(&mut self, arm: &ast::Arm) {
                                    &format!("def_map has no key for {} in visit_arm",
                                            id));
             }
-            let def = def_map[id].full_def();
+            let def = def_map.get(&id).unwrap().full_def();
             match def {
                 def::DefLocal(id)  => {
                     let value = if *immut {
@@ -1467,7 +1472,7 @@ fn visit_local(&mut self, l: &ast::Local) {
         for &(id, ref p, ref immut, _) in &self.collected_paths {
             let value = if *immut { value.to_string() } else { "<mutable>".to_string() };
             let types = self.analysis.ty_cx.node_types.borrow();
-            let typ = ppaux::ty_to_string(&self.analysis.ty_cx, (*types)[id]);
+            let typ = ppaux::ty_to_string(&self.analysis.ty_cx, *types.get(&id).unwrap());
             // Get the span only for the name of the variable (I hope the path
             // is only ever a variable name, but who knows?).
             let sub_span = self.span.span_for_last_ident(p.span);
@@ -1509,10 +1514,10 @@ pub fn process_crate(sess: &Session,
 
     // find a path to dump our data to
     let mut root_path = match env::var_os("DXR_RUST_TEMP_FOLDER") {
-        Some(val) => PathBuf::new(&val),
+        Some(val) => PathBuf::from(val),
         None => match odir {
             Some(val) => val.join("dxr"),
-            None => PathBuf::new("dxr-temp"),
+            None => PathBuf::from("dxr-temp"),
         },
     };
 
index c08d3b2be53dd02645b41ba779d1450ffa5f05c8..eb759393ac6eca125f2432641e792c9d37575c2d 100644 (file)
@@ -1017,7 +1017,7 @@ fn compile_submatch<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
         None => {
             let data = &m[0].data;
             for &(ref ident, ref value_ptr) in &m[0].bound_ptrs {
-                let binfo = data.bindings_map[*ident];
+                let binfo = *data.bindings_map.get(ident).unwrap();
                 call_lifetime_start(bcx, binfo.llmatch);
                 if binfo.trmode == TrByRef && type_is_fat_ptr(bcx.tcx(), binfo.ty) {
                     expr::copy_fat_ptr(bcx, *value_ptr, binfo.llmatch);
index a3bd0cf6b1a623bac1cf719408aa45f7d1696859..d6c85e8b173459c5449a60a68dbccc6bdb6d7e99 100644 (file)
@@ -76,43 +76,33 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm)
     // no failure occurred preparing operands, no need to cleanup
     fcx.pop_custom_cleanup_scope(temp_scope);
 
-    let mut constraints = constraints.iter()
-                                     .map(|s| s.to_string())
-                                     .chain(ext_constraints.into_iter())
-                                     .collect::<Vec<String>>()
-                                     .connect(",");
-
-    let mut clobbers = ia.clobbers.iter()
-                                  .map(|s| format!("~{{{}}}", &s))
-                                  .collect::<Vec<String>>()
-                                  .connect(",");
-    let more_clobbers = get_clobbers();
-    if !more_clobbers.is_empty() {
-        if !clobbers.is_empty() {
-            clobbers.push(',');
-        }
-        clobbers.push_str(&more_clobbers[..]);
-    }
-
-    // Add the clobbers to our constraints list
-    if clobbers.len() != 0 && constraints.len() != 0 {
-        constraints.push(',');
-        constraints.push_str(&clobbers[..]);
-    } else {
-        constraints.push_str(&clobbers[..]);
-    }
+    let clobbers = ia.clobbers.iter()
+                              .map(|s| format!("~{{{}}}", &s));
+
+    // Default per-arch clobbers
+    // Basically what clang does
+    let arch_clobbers = match &bcx.sess().target.target.arch[..] {
+        "x86" | "x86_64" => vec!("~{dirflag}", "~{fpsr}", "~{flags}"),
+        _                => Vec::new()
+    };
 
-    debug!("Asm Constraints: {}", &constraints[..]);
+    let all_constraints= constraints.iter()
+                                    .map(|s| s.to_string())
+                                    .chain(ext_constraints.into_iter())
+                                    .chain(clobbers)
+                                    .chain(arch_clobbers.iter()
+                                               .map(|s| s.to_string()))
+                                    .collect::<Vec<String>>()
+                                    .connect(",");
 
-    let num_outputs = outputs.len();
+    debug!("Asm Constraints: {}", &all_constraints[..]);
 
     // Depending on how many outputs we have, the return type is different
-    let output_type = if num_outputs == 0 {
-        Type::void(bcx.ccx())
-    } else if num_outputs == 1 {
-        output_types[0]
-    } else {
-        Type::struct_(bcx.ccx(), &output_types[..], false)
+    let num_outputs = outputs.len();
+    let output_type = match num_outputs {
+        0 => Type::void(bcx.ccx()),
+        1 => output_types[0],
+        _ => Type::struct_(bcx.ccx(), &output_types[..], false)
     };
 
     let dialect = match ia.dialect {
@@ -121,10 +111,10 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm)
     };
 
     let asm = CString::new(ia.asm.as_bytes()).unwrap();
-    let constraints = CString::new(constraints).unwrap();
+    let constraint_cstr = CString::new(all_constraints).unwrap();
     let r = InlineAsmCall(bcx,
                           asm.as_ptr(),
-                          constraints.as_ptr(),
+                          constraint_cstr.as_ptr(),
                           &inputs,
                           output_type,
                           ia.volatile,
@@ -158,15 +148,3 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm)
 
 }
 
-// Default per-arch clobbers
-// Basically what clang does
-
-#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
-fn get_clobbers() -> String {
-    "".to_string()
-}
-
-#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
-fn get_clobbers() -> String {
-    "~{dirflag},~{fpsr},~{flags}".to_string()
-}
index 7b177bd4e395c47898fd359bc1c3c695dabaf6ed..2f944e49b15161dc6d6243d9aebed4eb49fdb95f 100644 (file)
@@ -269,7 +269,7 @@ pub fn self_type_for_closure<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
 }
 
 pub fn kind_for_closure(ccx: &CrateContext, closure_id: ast::DefId) -> ty::ClosureKind {
-    ccx.tcx().closure_kinds.borrow()[closure_id]
+    *ccx.tcx().closure_kinds.borrow().get(&closure_id).unwrap()
 }
 
 pub fn decl_rust_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
@@ -428,11 +428,6 @@ pub fn set_llvm_fn_attrs(ccx: &CrateContext, attrs: &[ast::Attribute], llfn: Val
         let mut used = true;
         match &attr.name()[..] {
             "no_stack_check" => unset_split_stack(llfn),
-            "no_split_stack" => {
-                unset_split_stack(llfn);
-                ccx.sess().span_warn(attr.span,
-                                     "no_split_stack is a deprecated synonym for no_stack_check");
-            }
             "cold" => unsafe {
                 llvm::LLVMAddFunctionAttribute(llfn,
                                                llvm::FunctionIndex as c_uint,
@@ -1591,55 +1586,6 @@ fn copy_args_to_allocas<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     bcx
 }
 
-fn copy_closure_args_to_allocas<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
-                                            arg_scope: cleanup::CustomScopeIndex,
-                                            args: &[ast::Arg],
-                                            arg_datums: Vec<RvalueDatum<'tcx>>,
-                                            monomorphized_arg_types: &[Ty<'tcx>])
-                                            -> Block<'blk, 'tcx> {
-    let _icx = push_ctxt("copy_closure_args_to_allocas");
-    let arg_scope_id = cleanup::CustomScope(arg_scope);
-
-    assert_eq!(arg_datums.len(), 1);
-
-    let arg_datum = arg_datums.into_iter().next().unwrap();
-
-    // Untuple the rest of the arguments.
-    let tuple_datum =
-        unpack_datum!(bcx,
-                      arg_datum.to_lvalue_datum_in_scope(bcx,
-                                                         "argtuple",
-                                                         arg_scope_id));
-    let untupled_arg_types = match monomorphized_arg_types[0].sty {
-        ty::ty_tup(ref types) => &types[..],
-        _ => {
-            bcx.tcx().sess.span_bug(args[0].pat.span,
-                                    "first arg to `rust-call` ABI function \
-                                     wasn't a tuple?!")
-        }
-    };
-    for j in 0..args.len() {
-        let tuple_element_type = untupled_arg_types[j];
-        let tuple_element_datum =
-            tuple_datum.get_element(bcx,
-                                    tuple_element_type,
-                                    |llval| GEPi(bcx, llval, &[0, j]));
-        let tuple_element_datum = tuple_element_datum.to_expr_datum();
-        let tuple_element_datum =
-            unpack_datum!(bcx,
-                          tuple_element_datum.to_rvalue_datum(bcx,
-                                                              "arg"));
-        bcx = _match::store_arg(bcx,
-                                &*args[j].pat,
-                                tuple_element_datum,
-                                arg_scope_id);
-
-        debuginfo::create_argument_metadata(bcx, &args[j]);
-    }
-
-    bcx
-}
-
 // Ties up the llstaticallocas -> llloadenv -> lltop edges,
 // and builds the return block.
 pub fn finish_fn<'blk, 'tcx>(fcx: &'blk FunctionContext<'blk, 'tcx>,
@@ -1797,33 +1743,18 @@ pub fn trans_closure<'a, 'b, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
     debug!("trans_closure: function lltype: {}",
            bcx.fcx.ccx.tn().val_to_string(bcx.fcx.llfn));
 
-    let arg_datums = if abi != RustCall {
-        create_datums_for_fn_args(&fcx,
-                                  &monomorphized_arg_types[..])
-    } else {
-        create_datums_for_fn_args_under_call_abi(
-            bcx,
-            arg_scope,
-            &monomorphized_arg_types[..])
-    };
-
-    bcx = match closure_env {
-        closure::ClosureEnv::NotClosure => {
-            copy_args_to_allocas(bcx,
-                                 arg_scope,
-                                 &decl.inputs,
-                                 arg_datums)
+    let arg_datums = match closure_env {
+        closure::ClosureEnv::NotClosure if abi == RustCall => {
+            create_datums_for_fn_args_under_call_abi(bcx, arg_scope, &monomorphized_arg_types[..])
         }
-        closure::ClosureEnv::Closure(_) => {
-            copy_closure_args_to_allocas(
-                bcx,
-                arg_scope,
-                &decl.inputs,
-                arg_datums,
-                &monomorphized_arg_types[..])
+        _ => {
+            let arg_tys = untuple_arguments_if_necessary(ccx, &monomorphized_arg_types, abi);
+            create_datums_for_fn_args(&fcx, &arg_tys)
         }
     };
 
+    bcx = copy_args_to_allocas(bcx, arg_scope, &decl.inputs, arg_datums);
+
     bcx = closure_env.load(bcx, cleanup::CustomScope(arg_scope));
 
     // Up until here, IR instructions for this function have explicitly not been annotated with
@@ -2322,7 +2253,7 @@ pub fn trans_item(ccx: &CrateContext, item: &ast::Item) {
                                          static");
               }
 
-              let v = ccx.static_values().borrow()[item.id].clone();
+              let v = ccx.static_values().borrow().get(&item.id).unwrap().clone();
               unsafe {
                   if !(llvm::LLVMConstIntGetZExtValue(v) != 0) {
                       ccx.sess().span_fatal(expr.span, "static assertion failed");
index cf36ec1f3ed96f49954a1ec836a582ae23c6460c..e7911d5cc197006942987d85575ad302488b5037 100644 (file)
@@ -264,14 +264,29 @@ fn trans_fn_ref_with_substs_to_callee<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
 /// but for the bare function type given.
 pub fn trans_fn_pointer_shim<'a, 'tcx>(
     ccx: &'a CrateContext<'a, 'tcx>,
+    closure_kind: ty::ClosureKind,
     bare_fn_ty: Ty<'tcx>)
     -> ValueRef
 {
     let _icx = push_ctxt("trans_fn_pointer_shim");
     let tcx = ccx.tcx();
 
+    // Normalize the type for better caching.
     let bare_fn_ty = common::erase_regions(tcx, &bare_fn_ty);
-    match ccx.fn_pointer_shims().borrow().get(&bare_fn_ty) {
+
+    // If this is an impl of `Fn` or `FnMut` trait, the receiver is `&self`.
+    let is_by_ref = match closure_kind {
+        ty::FnClosureKind | ty::FnMutClosureKind => true,
+        ty::FnOnceClosureKind => false,
+    };
+    let bare_fn_ty_maybe_ref = if is_by_ref {
+        ty::mk_imm_rptr(tcx, tcx.mk_region(ty::ReStatic), bare_fn_ty)
+    } else {
+        bare_fn_ty
+    };
+
+    // Check if we already trans'd this shim.
+    match ccx.fn_pointer_shims().borrow().get(&bare_fn_ty_maybe_ref) {
         Some(&llval) => { return llval; }
         None => { }
     }
@@ -279,9 +294,6 @@ pub fn trans_fn_pointer_shim<'a, 'tcx>(
     debug!("trans_fn_pointer_shim(bare_fn_ty={})",
            bare_fn_ty.repr(tcx));
 
-    // This is an impl of `Fn` trait, so receiver is `&self`.
-    let bare_fn_ty_ref = ty::mk_imm_rptr(tcx, tcx.mk_region(ty::ReStatic), bare_fn_ty);
-
     // Construct the "tuply" version of `bare_fn_ty`. It takes two arguments: `self`,
     // which is the fn pointer, and `args`, which is the arguments tuple.
     let (opt_def_id, sig) =
@@ -306,7 +318,7 @@ pub fn trans_fn_pointer_shim<'a, 'tcx>(
                                          unsafety: ast::Unsafety::Normal,
                                          abi: synabi::RustCall,
                                          sig: ty::Binder(ty::FnSig {
-                                             inputs: vec![bare_fn_ty_ref,
+                                             inputs: vec![bare_fn_ty_maybe_ref,
                                                           tuple_input_ty],
                                              output: sig.output,
                                              variadic: false
@@ -337,8 +349,11 @@ pub fn trans_fn_pointer_shim<'a, 'tcx>(
     let mut bcx = init_function(&fcx, false, sig.output);
 
     // the first argument (`self`) will be ptr to the the fn pointer
-    let llfnpointer =
-        Load(bcx, get_param(fcx.llfn, fcx.arg_pos(0) as u32));
+    let llfnpointer = if is_by_ref {
+        Load(bcx, get_param(fcx.llfn, fcx.arg_pos(0) as u32))
+    } else {
+        get_param(fcx.llfn, fcx.arg_pos(0) as u32)
+    };
 
     // the remaining arguments will be the untupled values
     let llargs: Vec<_> =
@@ -361,7 +376,7 @@ pub fn trans_fn_pointer_shim<'a, 'tcx>(
 
     finish_fn(&fcx, bcx, sig.output, DebugLoc::None);
 
-    ccx.fn_pointer_shims().borrow_mut().insert(bare_fn_ty, llfn);
+    ccx.fn_pointer_shims().borrow_mut().insert(bare_fn_ty_maybe_ref, llfn);
 
     llfn
 }
@@ -511,7 +526,7 @@ pub fn trans_fn_ref_with_substs<'a, 'tcx>(
             let ref_ty = match node {
                 ExprId(id) => ty::node_id_to_type(tcx, id),
                 MethodCallKey(method_call) => {
-                    (*tcx.method_map.borrow())[method_call].ty
+                    tcx.method_map.borrow().get(&method_call).unwrap().ty
                 }
             };
             let ref_ty = monomorphize::apply_param_substs(tcx,
index c1bc7219ad8253942eb826dcdbbc22aa739ac9b4..5a48b8e4bce1d37acb4ae77844ff80a2e674c864 100644 (file)
@@ -8,24 +8,27 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use back::link::mangle_internal_name_by_path_and_seq;
-use llvm::ValueRef;
+use arena::TypedArena;
+use back::link::{self, mangle_internal_name_by_path_and_seq};
+use llvm::{ValueRef, get_param};
 use middle::mem_categorization::Typer;
 use trans::adt;
 use trans::base::*;
 use trans::build::*;
-use trans::cleanup::{CleanupMethods, ScopeId};
+use trans::callee::{self, ArgVals, Callee, TraitItem, MethodData};
+use trans::cleanup::{CleanupMethods, CustomScope, ScopeId};
 use trans::common::*;
-use trans::datum::{Datum, rvalue_scratch_datum};
-use trans::datum::{Rvalue, ByValue};
-use trans::debuginfo;
+use trans::datum::{self, Datum, rvalue_scratch_datum, Rvalue, ByValue};
+use trans::debuginfo::{self, DebugLoc};
 use trans::expr;
 use trans::monomorphize::{self, MonoId};
 use trans::type_of::*;
 use middle::ty::{self, ClosureTyper};
 use middle::subst::{Substs};
 use session::config::FullDebugInfo;
+use util::ppaux::Repr;
 
+use syntax::abi::RustCall;
 use syntax::ast;
 use syntax::ast_util;
 
@@ -239,11 +242,7 @@ pub fn trans_closure_expr<'a, 'tcx>(dest: Dest<'a, 'tcx>,
     // Create the closure.
     for (i, freevar) in freevars.iter().enumerate() {
         let datum = expr::trans_local_var(bcx, freevar.def);
-        let upvar_slot_dest = adt::trans_field_ptr(bcx,
-                                                   &*repr,
-                                                   dest_addr,
-                                                   0,
-                                                   i);
+        let upvar_slot_dest = adt::trans_field_ptr(bcx, &*repr, dest_addr, 0, i);
         let upvar_id = ty::UpvarId { var_id: freevar.def.local_node_id(),
                                      closure_expr_id: id };
         match tcx.upvar_capture(upvar_id).unwrap() {
@@ -259,3 +258,186 @@ pub fn trans_closure_expr<'a, 'tcx>(dest: Dest<'a, 'tcx>,
 
     Some(bcx)
 }
+
+pub fn trans_closure_method<'a, 'tcx>(ccx: &'a CrateContext<'a, 'tcx>,
+                                      closure_def_id: ast::DefId,
+                                      substs: Substs<'tcx>,
+                                      node: ExprOrMethodCall,
+                                      param_substs: &'tcx Substs<'tcx>,
+                                      trait_closure_kind: ty::ClosureKind)
+                                      -> ValueRef
+{
+    // The substitutions should have no type parameters remaining
+    // after passing through fulfill_obligation
+    let llfn = callee::trans_fn_ref_with_substs(ccx,
+                                                closure_def_id,
+                                                node,
+                                                param_substs,
+                                                substs.clone()).val;
+
+    // If the closure is a Fn closure, but a FnOnce is needed (etc),
+    // then adapt the self type
+    let closure_kind = ccx.tcx().closure_kind(closure_def_id);
+    trans_closure_adapter_shim(ccx,
+                               closure_def_id,
+                               substs,
+                               closure_kind,
+                               trait_closure_kind,
+                               llfn)
+}
+
+fn trans_closure_adapter_shim<'a, 'tcx>(
+    ccx: &'a CrateContext<'a, 'tcx>,
+    closure_def_id: ast::DefId,
+    substs: Substs<'tcx>,
+    llfn_closure_kind: ty::ClosureKind,
+    trait_closure_kind: ty::ClosureKind,
+    llfn: ValueRef)
+    -> ValueRef
+{
+    let _icx = push_ctxt("trans_closure_adapter_shim");
+    let tcx = ccx.tcx();
+
+    debug!("trans_closure_adapter_shim(llfn_closure_kind={:?}, \
+           trait_closure_kind={:?}, \
+           llfn={})",
+           llfn_closure_kind,
+           trait_closure_kind,
+           ccx.tn().val_to_string(llfn));
+
+    match (llfn_closure_kind, trait_closure_kind) {
+        (ty::FnClosureKind, ty::FnClosureKind) |
+        (ty::FnMutClosureKind, ty::FnMutClosureKind) |
+        (ty::FnOnceClosureKind, ty::FnOnceClosureKind) => {
+            // No adapter needed.
+            llfn
+        }
+        (ty::FnClosureKind, ty::FnMutClosureKind) => {
+            // The closure fn `llfn` is a `fn(&self, ...)`.  We want a
+            // `fn(&mut self, ...)`. In fact, at trans time, these are
+            // basically the same thing, so we can just return llfn.
+            llfn
+        }
+        (ty::FnClosureKind, ty::FnOnceClosureKind) |
+        (ty::FnMutClosureKind, ty::FnOnceClosureKind) => {
+            // The closure fn `llfn` is a `fn(&self, ...)` or `fn(&mut
+            // self, ...)`.  We want a `fn(self, ...)`. We can produce
+            // this by doing something like:
+            //
+            //     fn call_once(self, ...) { call_mut(&self, ...) }
+            //     fn call_once(mut self, ...) { call_mut(&mut self, ...) }
+            //
+            // These are both the same at trans time.
+            trans_fn_once_adapter_shim(ccx, closure_def_id, substs, llfn)
+        }
+        _ => {
+            tcx.sess.bug(&format!("trans_closure_adapter_shim: cannot convert {:?} to {:?}",
+                                  llfn_closure_kind,
+                                  trait_closure_kind));
+        }
+    }
+}
+
+fn trans_fn_once_adapter_shim<'a, 'tcx>(
+    ccx: &'a CrateContext<'a, 'tcx>,
+    closure_def_id: ast::DefId,
+    substs: Substs<'tcx>,
+    llreffn: ValueRef)
+    -> ValueRef
+{
+    debug!("trans_fn_once_adapter_shim(closure_def_id={}, substs={}, llreffn={})",
+           closure_def_id.repr(ccx.tcx()),
+           substs.repr(ccx.tcx()),
+           ccx.tn().val_to_string(llreffn));
+
+    let tcx = ccx.tcx();
+    let typer = NormalizingClosureTyper::new(tcx);
+
+    // Find a version of the closure type. Substitute static for the
+    // region since it doesn't really matter.
+    let substs = tcx.mk_substs(substs);
+    let closure_ty = ty::mk_closure(tcx, closure_def_id, substs);
+    let ref_closure_ty = ty::mk_imm_rptr(tcx, tcx.mk_region(ty::ReStatic), closure_ty);
+
+    // Make a version with the type of by-ref closure.
+    let ty::ClosureTy { unsafety, abi, mut sig } = typer.closure_type(closure_def_id, substs);
+    sig.0.inputs.insert(0, ref_closure_ty); // sig has no self type as of yet
+    let llref_bare_fn_ty = tcx.mk_bare_fn(ty::BareFnTy { unsafety: unsafety,
+                                                               abi: abi,
+                                                               sig: sig.clone() });
+    let llref_fn_ty = ty::mk_bare_fn(tcx, None, llref_bare_fn_ty);
+    debug!("trans_fn_once_adapter_shim: llref_fn_ty={}",
+           llref_fn_ty.repr(tcx));
+
+    // Make a version of the closure type with the same arguments, but
+    // with argument #0 being by value.
+    assert_eq!(abi, RustCall);
+    sig.0.inputs[0] = closure_ty;
+    let llonce_bare_fn_ty = tcx.mk_bare_fn(ty::BareFnTy { unsafety: unsafety,
+                                                                abi: abi,
+                                                                sig: sig });
+    let llonce_fn_ty = ty::mk_bare_fn(tcx, None, llonce_bare_fn_ty);
+
+    // Create the by-value helper.
+    let function_name = link::mangle_internal_name_by_type_and_seq(ccx, llonce_fn_ty, "once_shim");
+    let lloncefn = decl_internal_rust_fn(ccx, llonce_fn_ty, &function_name);
+
+    let sig = ty::erase_late_bound_regions(tcx, &llonce_bare_fn_ty.sig);
+    let (block_arena, fcx): (TypedArena<_>, FunctionContext);
+    block_arena = TypedArena::new();
+    fcx = new_fn_ctxt(ccx,
+                      lloncefn,
+                      ast::DUMMY_NODE_ID,
+                      false,
+                      sig.output,
+                      substs,
+                      None,
+                      &block_arena);
+    let mut bcx = init_function(&fcx, false, sig.output);
+
+    // the first argument (`self`) will be the (by value) closure env.
+    let self_scope = fcx.push_custom_cleanup_scope();
+    let self_scope_id = CustomScope(self_scope);
+    let rvalue_mode = datum::appropriate_rvalue_mode(ccx, closure_ty);
+    let llself = get_param(lloncefn, fcx.arg_pos(0) as u32);
+    let env_datum = Datum::new(llself, closure_ty, Rvalue::new(rvalue_mode));
+    let env_datum = unpack_datum!(bcx,
+                                  env_datum.to_lvalue_datum_in_scope(bcx, "self",
+                                                                     self_scope_id));
+
+    debug!("trans_fn_once_adapter_shim: env_datum={}",
+           bcx.val_to_string(env_datum.val));
+
+    // the remaining arguments will be packed up in a tuple.
+    let input_tys = match sig.inputs[1].sty {
+        ty::ty_tup(ref tys) => &**tys,
+        _ => bcx.sess().bug(&format!("trans_fn_once_adapter_shim: not rust-call! \
+                                      closure_def_id={}",
+                                     closure_def_id.repr(tcx)))
+    };
+    let llargs: Vec<_> =
+        input_tys.iter()
+                 .enumerate()
+                 .map(|(i, _)| get_param(lloncefn, fcx.arg_pos(i+1) as u32))
+                 .collect();
+
+    let dest =
+        fcx.llretslotptr.get().map(
+            |_| expr::SaveIn(fcx.get_ret_slot(bcx, sig.output, "ret_slot")));
+
+    let callee_data = TraitItem(MethodData { llfn: llreffn,
+                                             llself: env_datum.val });
+
+    bcx = callee::trans_call_inner(bcx,
+                                   DebugLoc::None,
+                                   llref_fn_ty,
+                                   |bcx, _| Callee { bcx: bcx, data: callee_data },
+                                   ArgVals(&llargs),
+                                   dest).bcx;
+
+    fcx.pop_custom_cleanup_scope(self_scope);
+
+    finish_fn(&fcx, bcx, sig.output, DebugLoc::None);
+
+    lloncefn
+}
index 8f5dbfe2ec000ad2a52fb2516c3ea76387ef03ee..61cdde3bfbecd775a24346f063341a12e8bff644 100644 (file)
@@ -709,7 +709,7 @@ fn temporary_scope(&self, rvalue_id: ast::NodeId) -> Option<region::CodeExtent>
     }
 
     fn upvar_capture(&self, upvar_id: ty::UpvarId) -> Option<ty::UpvarCapture> {
-        Some(self.tcx().upvar_capture_map.borrow()[upvar_id].clone())
+        Some(self.tcx().upvar_capture_map.borrow().get(&upvar_id).unwrap().clone())
     }
 
     fn type_moves_by_default(&self, span: Span, ty: Ty<'tcx>) -> bool {
@@ -1025,8 +1025,9 @@ pub fn fulfill_obligation<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
     // shallow result we are looking for -- that is, what specific impl.
     let typer = NormalizingClosureTyper::new(tcx);
     let mut selcx = traits::SelectionContext::new(&infcx, &typer);
-    let obligation = traits::Obligation::new(traits::ObligationCause::dummy(),
-                                             trait_ref.to_poly_trait_predicate());
+    let obligation =
+        traits::Obligation::new(traits::ObligationCause::misc(span, ast::DUMMY_NODE_ID),
+                                trait_ref.to_poly_trait_predicate());
     let selection = match selcx.select(&obligation) {
         Ok(Some(selection)) => selection,
         Ok(None) => {
@@ -1081,7 +1082,7 @@ pub fn predicates_hold<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
         let obligation = traits::Obligation::new(traits::ObligationCause::dummy(), predicate);
         fulfill_cx.register_predicate_obligation(&infcx, obligation);
     }
-    drain_fulfillment_cx(DUMMY_SP, &infcx, &mut fulfill_cx, &()).is_ok()
+    drain_fulfillment_cx(&infcx, &mut fulfill_cx, &()).is_ok()
 }
 
 pub struct NormalizingClosureTyper<'a,'tcx:'a> {
@@ -1138,7 +1139,7 @@ pub fn drain_fulfillment_cx_or_panic<'a,'tcx,T>(span: Span,
                                                 -> T
     where T : TypeFoldable<'tcx> + Repr<'tcx>
 {
-    match drain_fulfillment_cx(span, infcx, fulfill_cx, result) {
+    match drain_fulfillment_cx(infcx, fulfill_cx, result) {
         Ok(v) => v,
         Err(errors) => {
             infcx.tcx.sess.span_bug(
@@ -1156,8 +1157,7 @@ pub fn drain_fulfillment_cx_or_panic<'a,'tcx,T>(span: Span,
 /// inference variables that appear in `result` to be unified, and
 /// hence we need to process those obligations to get the complete
 /// picture of the type.
-pub fn drain_fulfillment_cx<'a,'tcx,T>(span: Span,
-                                       infcx: &infer::InferCtxt<'a,'tcx>,
+pub fn drain_fulfillment_cx<'a,'tcx,T>(infcx: &infer::InferCtxt<'a,'tcx>,
                                        fulfill_cx: &mut traits::FulfillmentContext<'tcx>,
                                        result: &T)
                                        -> StdResult<T,Vec<traits::FulfillmentError<'tcx>>>
@@ -1173,14 +1173,7 @@ pub fn drain_fulfillment_cx<'a,'tcx,T>(span: Span,
     match fulfill_cx.select_all_or_error(infcx, &typer) {
         Ok(()) => { }
         Err(errors) => {
-            // We always want to surface any overflow errors, no matter what.
-            if errors.iter().all(|e| e.is_overflow()) {
-                infcx.tcx.sess.span_fatal(
-                    span,
-                    "reached the recursion limit during monomorphization");
-            } else {
-                return Err(errors);
-            }
+            return Err(errors);
         }
     }
 
@@ -1213,7 +1206,7 @@ pub fn node_id_substs<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
             ty::node_id_item_substs(tcx, id).substs
         }
         MethodCallKey(method_call) => {
-            (*tcx.method_map.borrow())[method_call].substs.clone()
+            tcx.method_map.borrow().get(&method_call).unwrap().substs.clone()
         }
     };
 
index c95b29f4e7afca2fad2ee6aeb9ca91551d46ec90..4b1a03e47e7aebb1f2ef30bf261659b61204e2b4 100644 (file)
@@ -187,7 +187,7 @@ pub fn get_const_expr_as_global<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
     // Special-case constants to cache a common global for all uses.
     match expr.node {
         ast::ExprPath(..) => {
-            let def = ccx.tcx().def_map.borrow()[expr.id].full_def();
+            let def = ccx.tcx().def_map.borrow().get(&expr.id).unwrap().full_def();
             match def {
                 def::DefConst(def_id) => {
                     if !ccx.tcx().adjustments.borrow().contains_key(&expr.id) {
@@ -665,7 +665,7 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
             }
           }
           ast::ExprPath(..) => {
-            let def = cx.tcx().def_map.borrow()[e.id].full_def();
+            let def = cx.tcx().def_map.borrow().get(&e.id).unwrap().full_def();
             match def {
                 def::DefFn(..) | def::DefMethod(..) => {
                     expr::trans_def_fn_unadjusted(cx, e, def, param_substs).val
@@ -751,7 +751,7 @@ pub fn trans_static(ccx: &CrateContext, m: ast::Mutability, id: ast::NodeId) {
         let g = base::get_item_val(ccx, id);
         // At this point, get_item_val has already translated the
         // constant's initializer to determine its LLVM type.
-        let v = ccx.static_values().borrow()[id].clone();
+        let v = ccx.static_values().borrow().get(&id).unwrap().clone();
         // boolean SSA values are i1, but they have to be stored in i8 slots,
         // otherwise some LLVM optimization passes don't work as expected
         let v = if llvm::LLVMTypeOf(v) == Type::i1(ccx).to_ref() {
index e181df545e6fc06aa63f4b0e2a39f2ea835d9dea..15738d1e61ac14122f0161df205f0d536ebca146 100644 (file)
@@ -471,15 +471,6 @@ pub fn add_clean_if_rvalue<'blk>(self,
             })
     }
 
-    /// Ensures that `self` will get cleaned up, if it is not an lvalue already.
-    pub fn clean<'blk>(self,
-                       bcx: Block<'blk, 'tcx>,
-                       name: &'static str,
-                       expr_id: ast::NodeId)
-                       -> Block<'blk, 'tcx> {
-        self.to_lvalue_datum(bcx, name, expr_id).bcx
-    }
-
     pub fn to_lvalue_datum<'blk>(self,
                                  bcx: Block<'blk, 'tcx>,
                                  name: &str,
index 3e8cc46e2550107d9fede430516be79e4e3b289c..b9c59a0bc78d671f59e3b8a13b74a8b4612f9931 100644 (file)
@@ -1695,7 +1695,7 @@ fn declare_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     };
 
     let name = CString::new(name.as_bytes()).unwrap();
-    match (variable_access, [].as_slice()) {
+    match (variable_access, &[][..]) {
         (DirectVariable { alloca }, address_operations) |
         (IndirectVariable {alloca, address_operations}, _) => {
             let metadata = unsafe {
index 565fe4a4d8f45375471e1b8d4f6d16cef2a15859..4d7431a20b707e098f3ef6ea54f03b7853ea2763 100644 (file)
@@ -126,7 +126,7 @@ pub fn trans_into<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
         return datum.store_to_dest(bcx, dest, expr.id);
     }
 
-    let qualif = bcx.tcx().const_qualif_map.borrow()[expr.id];
+    let qualif = *bcx.tcx().const_qualif_map.borrow().get(&expr.id).unwrap();
     if !qualif.intersects(check_const::NOT_CONST | check_const::NEEDS_DROP) {
         if !qualif.intersects(check_const::PREFER_IN_PLACE) {
             if let SaveIn(lldest) = dest {
@@ -209,7 +209,7 @@ pub fn trans<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
 
     let mut bcx = bcx;
     let fcx = bcx.fcx;
-    let qualif = bcx.tcx().const_qualif_map.borrow()[expr.id];
+    let qualif = *bcx.tcx().const_qualif_map.borrow().get(&expr.id).unwrap();
     let adjusted_global = !qualif.intersects(check_const::NON_STATIC_BORROWS);
     let global = if !qualif.intersects(check_const::NOT_CONST | check_const::NEEDS_DROP) {
         let global = consts::get_const_expr_as_global(bcx.ccx(), expr, qualif,
@@ -843,7 +843,7 @@ fn trans_index<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                                                base_datum,
                                                vec![(ix_datum, idx.id)],
                                                Some(SaveIn(scratch.val)),
-                                               true));
+                                               false));
             let datum = scratch.to_expr_datum();
             if type_is_sized(bcx.tcx(), elt_ty) {
                 Datum::new(datum.to_llscalarish(bcx), elt_ty, LvalueExpr)
@@ -1227,22 +1227,9 @@ fn make_field(field_name: &str, expr: P<ast::Expr>) -> ast::Field {
             trans_overloaded_op(bcx, expr, MethodCall::expr(expr.id), base,
                                 vec![(idx_datum, idx.id)], Some(dest), true).bcx
         }
-        ast::ExprCast(ref val, _) => {
-            // DPS output mode means this is a trait cast:
-            if ty::type_is_trait(node_id_type(bcx, expr.id)) {
-                let trait_ref =
-                    bcx.tcx().object_cast_map.borrow()
-                                             .get(&expr.id)
-                                             .cloned()
-                                             .unwrap();
-                let trait_ref = bcx.monomorphize(&trait_ref);
-                let datum = unpack_datum!(bcx, trans(bcx, &**val));
-                meth::trans_trait_cast(bcx, datum, expr.id,
-                                       trait_ref, dest)
-            } else {
-                bcx.tcx().sess.span_bug(expr.span,
-                                        "expr_cast of non-trait");
-            }
+        ast::ExprCast(..) => {
+            // Trait casts used to come this way, now they should be coercions.
+            bcx.tcx().sess.span_bug(expr.span, "DPS expr_cast (residual trait cast?)")
         }
         ast::ExprAssignOp(op, ref dst, ref src) => {
             trans_assign_op(bcx, expr, op, &**dst, &**src)
@@ -1405,7 +1392,7 @@ pub fn with_field_tys<'tcx, R, F>(tcx: &ty::ctxt<'tcx>,
                         ty.repr(tcx)));
                 }
                 Some(node_id) => {
-                    let def = tcx.def_map.borrow()[node_id].full_def();
+                    let def = tcx.def_map.borrow().get(&node_id).unwrap().full_def();
                     match def {
                         def::DefVariant(enum_id, variant_id, _) => {
                             let variant_info = ty::enum_variant_with_id(tcx, enum_id, variant_id);
@@ -1964,7 +1951,7 @@ fn trans_overloaded_op<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                                    dest: Option<Dest>,
                                    autoref: bool)
                                    -> Result<'blk, 'tcx> {
-    let method_ty = (*bcx.tcx().method_map.borrow())[method_call].ty;
+    let method_ty = bcx.tcx().method_map.borrow().get(&method_call).unwrap().ty;
     callee::trans_call_inner(bcx,
                              expr.debug_loc(),
                              monomorphize_type(bcx, method_ty),
@@ -1985,10 +1972,12 @@ fn trans_overloaded_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
                                          dest: Option<Dest>)
                                          -> Block<'blk, 'tcx> {
     let method_call = MethodCall::expr(expr.id);
-    let method_type = (*bcx.tcx()
-                           .method_map
-                           .borrow())[method_call]
-                           .ty;
+    let method_type = bcx.tcx()
+                         .method_map
+                         .borrow()
+                         .get(&method_call)
+                         .unwrap()
+                         .ty;
     let mut all_args = vec!(callee);
     all_args.extend(args.iter().map(|e| &**e));
     unpack_result!(bcx,
@@ -2089,7 +2078,7 @@ fn trans_imm_cast<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     let mut bcx = bcx;
     let ccx = bcx.ccx();
 
-    let t_in = expr_ty(bcx, expr);
+    let t_in = expr_ty_adjusted(bcx, expr);
     let t_out = node_id_type(bcx, id);
     let k_in = cast_type_kind(bcx.tcx(), t_in);
     let k_out = cast_type_kind(bcx.tcx(), t_out);
@@ -2101,7 +2090,8 @@ fn trans_imm_cast<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     // by-value as appropriate given its type:
     let mut datum = unpack_datum!(bcx, trans(bcx, expr));
 
-    if cast_is_noop(datum.ty, t_out) {
+    let datum_ty = monomorphize_type(bcx, datum.ty);
+    if cast_is_noop(datum_ty, t_out) {
         datum.ty = t_out;
         return DatumBlock::new(bcx, datum);
     }
index d158cfa7b88765b77f12dba0808328ebd9ef630b..f714c5800c57b3717f5fb2532413b7e5159f17a3 100644 (file)
@@ -386,7 +386,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
             InBoundsGEP(bcx, ptr, &[offset])
         }
 
-        (_, "copy_nonoverlapping_memory") => {
+        (_, "copy_nonoverlapping") => {
             copy_intrinsic(bcx,
                            false,
                            false,
@@ -396,7 +396,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
                            llargs[2],
                            call_debug_location)
         }
-        (_, "copy_memory") => {
+        (_, "copy") => {
             copy_intrinsic(bcx,
                            true,
                            false,
@@ -406,7 +406,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
                            llargs[2],
                            call_debug_location)
         }
-        (_, "set_memory") => {
+        (_, "write_bytes") => {
             memset_intrinsic(bcx,
                              false,
                              *substs.types.get(FnSpace, 0),
index 4da17972c55fb68e4eda4207eb20911b0c67374c..1a38b3d142676f1a717c395a702d4a6a5302e0fe 100644 (file)
 use middle::subst::VecPerParamSpace;
 use middle::subst;
 use middle::traits;
+use middle::ty::ClosureTyper;
 use trans::base::*;
 use trans::build::*;
 use trans::callee::*;
 use trans::callee;
 use trans::cleanup;
+use trans::closure;
 use trans::common::*;
 use trans::consts;
 use trans::datum::*;
 use trans::debuginfo::DebugLoc;
-use trans::expr::{SaveIn, Ignore};
+use trans::expr::SaveIn;
 use trans::expr;
 use trans::glue;
 use trans::machine;
@@ -358,19 +360,21 @@ fn trans_monomorphized_callee<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
         traits::VtableClosure(closure_def_id, substs) => {
             // The substitutions should have no type parameters remaining
             // after passing through fulfill_obligation
-            let llfn = trans_fn_ref_with_substs(bcx.ccx(),
-                                                closure_def_id,
-                                                MethodCallKey(method_call),
-                                                bcx.fcx.param_substs,
-                                                substs).val;
-
+            let trait_closure_kind = bcx.tcx().lang_items.fn_trait_kind(trait_id).unwrap();
+            let llfn = closure::trans_closure_method(bcx.ccx(),
+                                                     closure_def_id,
+                                                     substs,
+                                                     MethodCallKey(method_call),
+                                                     bcx.fcx.param_substs,
+                                                     trait_closure_kind);
             Callee {
                 bcx: bcx,
                 data: Fn(llfn),
             }
         }
         traits::VtableFnPointer(fn_ty) => {
-            let llfn = trans_fn_pointer_shim(bcx.ccx(), fn_ty);
+            let trait_closure_kind = bcx.tcx().lang_items.fn_trait_kind(trait_id).unwrap();
+            let llfn = trans_fn_pointer_shim(bcx.ccx(), trait_closure_kind, fn_ty);
             Callee { bcx: bcx, data: Fn(llfn) }
         }
         traits::VtableObject(ref data) => {
@@ -645,9 +649,6 @@ pub fn trans_object_shim<'a, 'tcx>(
 
     assert!(!fcx.needs_ret_allocas);
 
-    let sig =
-        ty::erase_late_bound_regions(bcx.tcx(), &fty.sig);
-
     let dest =
         fcx.llretslotptr.get().map(
             |_| expr::SaveIn(fcx.get_ret_slot(bcx, sig.output, "ret_slot")));
@@ -714,17 +715,18 @@ pub fn get_vtable<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
                 emit_vtable_methods(ccx, id, substs, param_substs).into_iter()
             }
             traits::VtableClosure(closure_def_id, substs) => {
-                let llfn = trans_fn_ref_with_substs(
-                    ccx,
-                    closure_def_id,
-                    ExprId(0),
-                    param_substs,
-                    substs).val;
-
+                let trait_closure_kind = tcx.lang_items.fn_trait_kind(trait_ref.def_id()).unwrap();
+                let llfn = closure::trans_closure_method(ccx,
+                                                         closure_def_id,
+                                                         substs,
+                                                         ExprId(0),
+                                                         param_substs,
+                                                         trait_closure_kind);
                 vec![llfn].into_iter()
             }
             traits::VtableFnPointer(bare_fn_ty) => {
-                vec![trans_fn_pointer_shim(ccx, bare_fn_ty)].into_iter()
+                let trait_closure_kind = tcx.lang_items.fn_trait_kind(trait_ref.def_id()).unwrap();
+                vec![trans_fn_pointer_shim(ccx, trait_closure_kind, bare_fn_ty)].into_iter()
             }
             traits::VtableObject(ref data) => {
                 // this would imply that the Self type being erased is
@@ -861,44 +863,6 @@ fn emit_vtable_methods<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
         .collect()
 }
 
-/// Generates the code to convert from a pointer (`Box<T>`, `&T`, etc) into an object
-/// (`Box<Trait>`, `&Trait`, etc). This means creating a pair where the first word is the vtable
-/// and the second word is the pointer.
-pub fn trans_trait_cast<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
-                                    datum: Datum<'tcx, Expr>,
-                                    id: ast::NodeId,
-                                    trait_ref: ty::PolyTraitRef<'tcx>,
-                                    dest: expr::Dest)
-                                    -> Block<'blk, 'tcx> {
-    let mut bcx = bcx;
-    let _icx = push_ctxt("meth::trans_trait_cast");
-
-    let lldest = match dest {
-        Ignore => {
-            return datum.clean(bcx, "trait_trait_cast", id);
-        }
-        SaveIn(dest) => dest
-    };
-
-    debug!("trans_trait_cast: trait_ref={}",
-           trait_ref.repr(bcx.tcx()));
-
-    let llty = type_of(bcx.ccx(), datum.ty);
-
-    // Store the pointer into the first half of pair.
-    let llboxdest = GEPi(bcx, lldest, &[0, abi::FAT_PTR_ADDR]);
-    let llboxdest = PointerCast(bcx, llboxdest, llty.ptr_to());
-    bcx = datum.store_to(bcx, llboxdest);
-
-    // Store the vtable into the second half of pair.
-    let vtable = get_vtable(bcx.ccx(), trait_ref, bcx.fcx.param_substs);
-    let llvtabledest = GEPi(bcx, lldest, &[0, abi::FAT_PTR_EXTRA]);
-    let llvtabledest = PointerCast(bcx, llvtabledest, val_ty(vtable).ptr_to());
-    Store(bcx, vtable, llvtabledest);
-
-    bcx
-}
-
 /// Replace the self type (&Self or Box<Self>) with an opaque pointer.
 pub fn opaque_method_ty<'tcx>(tcx: &ty::ctxt<'tcx>, method_ty: &ty::BareFnTy<'tcx>)
         -> &'tcx ty::BareFnTy<'tcx> {
index 28e7027b2124a2e2135e7d0b4007851de08b46ff..e9de8bd879e202342cbe00df6e0d61ec3adf812c 100644 (file)
@@ -55,7 +55,7 @@
 use middle::privacy::{AllPublic, LastMod};
 use middle::subst::{FnSpace, TypeSpace, SelfSpace, Subst, Substs};
 use middle::traits;
-use middle::ty::{self, RegionEscape, ToPolyTraitRef, Ty};
+use middle::ty::{self, RegionEscape, Ty};
 use rscope::{self, UnelidableRscope, RegionScope, ElidableRscope,
              ObjectLifetimeDefaultRscope, ShiftedRscope, BindingRscope};
 use util::common::{ErrorReported, FN_OUTPUT_NAME};
@@ -608,24 +608,16 @@ pub fn instantiate_poly_trait_ref<'tcx>(
     poly_projections: &mut Vec<ty::PolyProjectionPredicate<'tcx>>)
     -> ty::PolyTraitRef<'tcx>
 {
-    let mut projections = Vec::new();
-
-    // The trait reference introduces a binding level here, so
-    // we need to shift the `rscope`. It'd be nice if we could
-    // do away with this rscope stuff and work this knowledge
-    // into resolve_lifetimes, as we do with non-omitted
-    // lifetimes. Oh well, not there yet.
-    let shifted_rscope = ShiftedRscope::new(rscope);
-
-    let trait_ref = instantiate_trait_ref(this, &shifted_rscope,
-                                          &ast_trait_ref.trait_ref,
-                                          None, self_ty, Some(&mut projections));
-
-    for projection in projections {
-        poly_projections.push(ty::Binder(projection));
-    }
-
-    ty::Binder(trait_ref)
+    let trait_ref = &ast_trait_ref.trait_ref;
+    let trait_def_id = trait_def_id(this, trait_ref);
+    ast_path_to_poly_trait_ref(this,
+                               rscope,
+                               trait_ref.path.span,
+                               PathParamMode::Explicit,
+                               trait_def_id,
+                               self_ty,
+                               trait_ref.path.segments.last().unwrap(),
+                               poly_projections)
 }
 
 /// Instantiates the path for the given trait reference, assuming that it's
@@ -634,31 +626,27 @@ pub fn instantiate_poly_trait_ref<'tcx>(
 ///
 /// If the `projections` argument is `None`, then assoc type bindings like `Foo<T=X>`
 /// are disallowed. Otherwise, they are pushed onto the vector given.
-pub fn instantiate_trait_ref<'tcx>(
+pub fn instantiate_mono_trait_ref<'tcx>(
     this: &AstConv<'tcx>,
     rscope: &RegionScope,
     trait_ref: &ast::TraitRef,
-    impl_id: Option<ast::NodeId>,
-    self_ty: Option<Ty<'tcx>>,
-    projections: Option<&mut Vec<ty::ProjectionPredicate<'tcx>>>)
+    self_ty: Option<Ty<'tcx>>)
     -> Rc<ty::TraitRef<'tcx>>
 {
+    let trait_def_id = trait_def_id(this, trait_ref);
+    ast_path_to_mono_trait_ref(this,
+                               rscope,
+                               trait_ref.path.span,
+                               PathParamMode::Explicit,
+                               trait_def_id,
+                               self_ty,
+                               trait_ref.path.segments.last().unwrap())
+}
+
+fn trait_def_id<'tcx>(this: &AstConv<'tcx>, trait_ref: &ast::TraitRef) -> ast::DefId {
     let path = &trait_ref.path;
     match ::lookup_full_def(this.tcx(), path.span, trait_ref.ref_id) {
-        def::DefTrait(trait_def_id) => {
-            let trait_ref = ast_path_to_trait_ref(this,
-                                                  rscope,
-                                                  path.span,
-                                                  PathParamMode::Explicit,
-                                                  trait_def_id,
-                                                  self_ty,
-                                                  path.segments.last().unwrap(),
-                                                  projections);
-            if let Some(id) = impl_id {
-                this.tcx().impl_trait_refs.borrow_mut().insert(id, trait_ref.clone());
-            }
-            trait_ref
-        }
+        def::DefTrait(trait_def_id) => trait_def_id,
         _ => {
             span_fatal!(this.tcx().sess, path.span, E0245, "`{}` is not a trait",
                         path.user_string(this.tcx()));
@@ -676,24 +664,17 @@ fn object_path_to_poly_trait_ref<'a,'tcx>(
     mut projections: &mut Vec<ty::PolyProjectionPredicate<'tcx>>)
     -> ty::PolyTraitRef<'tcx>
 {
-    // we are introducing a binder here, so shift the
-    // anonymous regions depth to account for that
-    let shifted_rscope = ShiftedRscope::new(rscope);
-
-    let mut tmp = Vec::new();
-    let trait_ref = ty::Binder(ast_path_to_trait_ref(this,
-                                                     &shifted_rscope,
-                                                     span,
-                                                     param_mode,
-                                                     trait_def_id,
-                                                     None,
-                                                     trait_segment,
-                                                     Some(&mut tmp)));
-    projections.extend(tmp.into_iter().map(ty::Binder));
-    trait_ref
+    ast_path_to_poly_trait_ref(this,
+                               rscope,
+                               span,
+                               param_mode,
+                               trait_def_id,
+                               None,
+                               trait_segment,
+                               projections)
 }
 
-fn ast_path_to_trait_ref<'a,'tcx>(
+fn ast_path_to_poly_trait_ref<'a,'tcx>(
     this: &AstConv<'tcx>,
     rscope: &RegionScope,
     span: Span,
@@ -701,10 +682,78 @@ fn ast_path_to_trait_ref<'a,'tcx>(
     trait_def_id: ast::DefId,
     self_ty: Option<Ty<'tcx>>,
     trait_segment: &ast::PathSegment,
-    mut projections: Option<&mut Vec<ty::ProjectionPredicate<'tcx>>>)
-    -> Rc<ty::TraitRef<'tcx>>
+    poly_projections: &mut Vec<ty::PolyProjectionPredicate<'tcx>>)
+    -> ty::PolyTraitRef<'tcx>
+{
+    // The trait reference introduces a binding level here, so
+    // we need to shift the `rscope`. It'd be nice if we could
+    // do away with this rscope stuff and work this knowledge
+    // into resolve_lifetimes, as we do with non-omitted
+    // lifetimes. Oh well, not there yet.
+    let shifted_rscope = &ShiftedRscope::new(rscope);
+
+    let (substs, assoc_bindings) =
+        create_substs_for_ast_trait_ref(this,
+                                        shifted_rscope,
+                                        span,
+                                        param_mode,
+                                        trait_def_id,
+                                        self_ty,
+                                        trait_segment);
+    let poly_trait_ref = ty::Binder(Rc::new(ty::TraitRef::new(trait_def_id, substs)));
+
+    {
+        let converted_bindings =
+            assoc_bindings
+            .iter()
+            .filter_map(|binding| {
+                // specify type to assert that error was already reported in Err case:
+                let predicate: Result<_, ErrorReported> =
+                    ast_type_binding_to_poly_projection_predicate(this,
+                                                                  poly_trait_ref.clone(),
+                                                                  self_ty,
+                                                                  binding);
+                predicate.ok() // ok to ignore Err() because ErrorReported (see above)
+            });
+        poly_projections.extend(converted_bindings);
+    }
+
+    poly_trait_ref
+}
+
+fn ast_path_to_mono_trait_ref<'a,'tcx>(this: &AstConv<'tcx>,
+                                       rscope: &RegionScope,
+                                       span: Span,
+                                       param_mode: PathParamMode,
+                                       trait_def_id: ast::DefId,
+                                       self_ty: Option<Ty<'tcx>>,
+                                       trait_segment: &ast::PathSegment)
+                                       -> Rc<ty::TraitRef<'tcx>>
 {
-    debug!("ast_path_to_trait_ref {:?}", trait_segment);
+    let (substs, assoc_bindings) =
+        create_substs_for_ast_trait_ref(this,
+                                        rscope,
+                                        span,
+                                        param_mode,
+                                        trait_def_id,
+                                        self_ty,
+                                        trait_segment);
+    prohibit_projections(this.tcx(), &assoc_bindings);
+    Rc::new(ty::TraitRef::new(trait_def_id, substs))
+}
+
+fn create_substs_for_ast_trait_ref<'a,'tcx>(this: &AstConv<'tcx>,
+                                            rscope: &RegionScope,
+                                            span: Span,
+                                            param_mode: PathParamMode,
+                                            trait_def_id: ast::DefId,
+                                            self_ty: Option<Ty<'tcx>>,
+                                            trait_segment: &ast::PathSegment)
+                                            -> (&'tcx Substs<'tcx>, Vec<ConvertedBinding<'tcx>>)
+{
+    debug!("create_substs_for_ast_trait_ref(trait_segment={:?})",
+           trait_segment);
+
     let trait_def = match this.get_trait_def(span, trait_def_id) {
         Ok(trait_def) => trait_def,
         Err(ErrorReported) => {
@@ -752,34 +801,16 @@ fn ast_path_to_trait_ref<'a,'tcx>(
                                             self_ty,
                                             types,
                                             regions);
-    let substs = this.tcx().mk_substs(substs);
 
-    let trait_ref = Rc::new(ty::TraitRef::new(trait_def_id, substs));
-
-    match projections {
-        None => {
-            prohibit_projections(this.tcx(), &assoc_bindings);
-        }
-        Some(ref mut v) => {
-            for binding in &assoc_bindings {
-                match ast_type_binding_to_projection_predicate(this, trait_ref.clone(),
-                                                               self_ty, binding) {
-                    Ok(pp) => { v.push(pp); }
-                    Err(ErrorReported) => { }
-                }
-            }
-        }
-    }
-
-    trait_ref
+    (this.tcx().mk_substs(substs), assoc_bindings)
 }
 
-fn ast_type_binding_to_projection_predicate<'tcx>(
+fn ast_type_binding_to_poly_projection_predicate<'tcx>(
     this: &AstConv<'tcx>,
-    mut trait_ref: Rc<ty::TraitRef<'tcx>>,
+    mut trait_ref: ty::PolyTraitRef<'tcx>,
     self_ty: Option<Ty<'tcx>>,
     binding: &ConvertedBinding<'tcx>)
-    -> Result<ty::ProjectionPredicate<'tcx>, ErrorReported>
+    -> Result<ty::PolyProjectionPredicate<'tcx>, ErrorReported>
 {
     let tcx = this.tcx();
 
@@ -800,14 +831,14 @@ fn ast_type_binding_to_projection_predicate<'tcx>(
     // We want to produce `<B as SuperTrait<int>>::T == foo`.
 
     // Simple case: X is defined in the current trait.
-    if this.trait_defines_associated_type_named(trait_ref.def_id, binding.item_name) {
-        return Ok(ty::ProjectionPredicate {
-            projection_ty: ty::ProjectionTy {
-                trait_ref: trait_ref,
+    if this.trait_defines_associated_type_named(trait_ref.def_id(), binding.item_name) {
+        return Ok(ty::Binder(ty::ProjectionPredicate {      // <-------------------+
+            projection_ty: ty::ProjectionTy {               //                     |
+                trait_ref: trait_ref.skip_binder().clone(), // Binder moved here --+
                 item_name: binding.item_name,
             },
             ty: binding.ty,
-        });
+        }));
     }
 
     // Otherwise, we have to walk through the supertraits to find
@@ -820,17 +851,17 @@ fn ast_type_binding_to_projection_predicate<'tcx>(
 
     let dummy_self_ty = ty::mk_infer(tcx, ty::FreshTy(0));
     if self_ty.is_none() { // if converting for an object type
-        let mut dummy_substs = trait_ref.substs.clone();
-        assert!(dummy_substs.self_ty().is_none());
-        dummy_substs.types.push(SelfSpace, dummy_self_ty);
-        trait_ref = Rc::new(ty::TraitRef::new(trait_ref.def_id,
-                                              tcx.mk_substs(dummy_substs)));
+        let mut dummy_substs = trait_ref.skip_binder().substs.clone(); // binder moved here -+
+        assert!(dummy_substs.self_ty().is_none());                     //                    |
+        dummy_substs.types.push(SelfSpace, dummy_self_ty);             //                    |
+        trait_ref = ty::Binder(Rc::new(ty::TraitRef::new(trait_ref.def_id(), // <------------+
+                                                         tcx.mk_substs(dummy_substs))));
     }
 
-    try!(this.ensure_super_predicates(binding.span, trait_ref.def_id));
+    try!(this.ensure_super_predicates(binding.span, trait_ref.def_id()));
 
     let mut candidates: Vec<ty::PolyTraitRef> =
-        traits::supertraits(tcx, trait_ref.to_poly_trait_ref())
+        traits::supertraits(tcx, trait_ref.clone())
         .filter(|r| this.trait_defines_associated_type_named(r.def_id(), binding.item_name))
         .collect();
 
@@ -865,21 +896,13 @@ fn ast_type_binding_to_projection_predicate<'tcx>(
         }
     };
 
-    if ty::binds_late_bound_regions(tcx, &candidate) {
-        span_err!(tcx.sess, binding.span, E0219,
-            "associated type `{}` defined in higher-ranked supertrait `{}`",
-                    token::get_name(binding.item_name),
-                    candidate.user_string(tcx));
-        return Err(ErrorReported);
-    }
-
-    Ok(ty::ProjectionPredicate {
-        projection_ty: ty::ProjectionTy {
-            trait_ref: candidate.0,
+    Ok(ty::Binder(ty::ProjectionPredicate {             // <-------------------------+
+        projection_ty: ty::ProjectionTy {               //                           |
+            trait_ref: candidate.skip_binder().clone(), // binder is moved up here --+
             item_name: binding.item_name,
         },
         ty: binding.ty,
-    })
+    }))
 }
 
 fn ast_path_to_ty<'tcx>(
@@ -1046,7 +1069,7 @@ fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx>,
         return (tcx.types.err, ty_path_def);
     };
 
-    let ty_param_name = tcx.ty_param_defs.borrow()[ty_param_node_id].name;
+    let ty_param_name = tcx.ty_param_defs.borrow().get(&ty_param_node_id).unwrap().name;
 
     let bounds = match this.get_type_parameter_bounds(span, ty_param_node_id) {
         Ok(v) => v,
@@ -1134,14 +1157,14 @@ fn qpath_to_ty<'tcx>(this: &AstConv<'tcx>,
 
     debug!("qpath_to_ty: self_type={}", self_ty.repr(tcx));
 
-    let trait_ref = ast_path_to_trait_ref(this,
-                                          rscope,
-                                          span,
-                                          param_mode,
-                                          trait_def_id,
-                                          Some(self_ty),
-                                          trait_segment,
-                                          None);
+    let trait_ref =
+        ast_path_to_mono_trait_ref(this,
+                                   rscope,
+                                   span,
+                                   param_mode,
+                                   trait_def_id,
+                                   Some(self_ty),
+                                   trait_segment);
 
     debug!("qpath_to_ty: trait_ref={}", trait_ref.repr(tcx));
 
index 8e2f4dcefa02231db95ee7d5d576e8dc7df057b7..e8da19efa06afd790bb966de830e877e5f9e498f 100644 (file)
@@ -119,7 +119,7 @@ pub fn check_pat<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>,
             demand::eqtype(fcx, pat.span, expected, lhs_ty);
         }
         ast::PatEnum(..) | ast::PatIdent(..) if pat_is_const(&tcx.def_map, pat) => {
-            let const_did = tcx.def_map.borrow()[pat.id].def_id();
+            let const_did = tcx.def_map.borrow().get(&pat.id).unwrap().def_id();
             let const_scheme = ty::lookup_item_type(tcx, const_did);
             assert!(const_scheme.generics.is_empty());
             let const_ty = pcx.fcx.instantiate_type_scheme(pat.span,
@@ -163,7 +163,7 @@ pub fn check_pat<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>,
 
             // if there are multiple arms, make sure they all agree on
             // what the type of the binding `x` ought to be
-            let canon_id = pcx.map[path.node];
+            let canon_id = *pcx.map.get(&path.node).unwrap();
             if canon_id != pat.id {
                 let ct = fcx.local_ty(pat.span, canon_id);
                 demand::eqtype(fcx, pat.span, ct, typ);
@@ -287,10 +287,11 @@ pub fn check_pat<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>,
     // (nmatsakis) an hour or two debugging to remember, so I thought
     // I'd write them down this time.
     //
-    // 1. Most importantly, there is no loss of expressiveness
-    // here. What we are saying is that the type of `x`
-    // becomes *exactly* what is expected. This might seem
-    // like it will cause errors in a case like this:
+    // 1. There is no loss of expressiveness here, though it does
+    // cause some inconvenience. What we are saying is that the type
+    // of `x` becomes *exactly* what is expected. This can cause unnecessary
+    // errors in some cases, such as this one:
+    // it will cause errors in a case like this:
     //
     // ```
     // fn foo<'x>(x: &'x int) {
@@ -361,8 +362,21 @@ pub fn check_match<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
                              match_src: ast::MatchSource) {
     let tcx = fcx.ccx.tcx;
 
-    let discrim_ty = fcx.infcx().next_ty_var();
-    check_expr_has_type(fcx, discrim, discrim_ty);
+    // Not entirely obvious: if matches may create ref bindings, we
+    // want to use the *precise* type of the discriminant, *not* some
+    // supertype, as the "discriminant type" (issue #23116).
+    let contains_ref_bindings = arms.iter().any(|a| tcx.arm_contains_ref_binding(a));
+    let discrim_ty;
+    if contains_ref_bindings {
+        check_expr(fcx, discrim);
+        discrim_ty = fcx.expr_ty(discrim);
+    } else {
+        // ...but otherwise we want to use any supertype of the
+        // discriminant. This is sort of a workaround, see note (*) in
+        // `check_pat` for some details.
+        discrim_ty = fcx.infcx().next_ty_var();
+        check_expr_has_type(fcx, discrim, discrim_ty);
+    };
 
     // Typecheck the patterns first, so that we get types for all the
     // bindings.
@@ -449,7 +463,7 @@ pub fn check_pat_struct<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>, pat: &'tcx ast::Pat,
     let fcx = pcx.fcx;
     let tcx = pcx.fcx.ccx.tcx;
 
-    let def = tcx.def_map.borrow()[pat.id].full_def();
+    let def = tcx.def_map.borrow().get(&pat.id).unwrap().full_def();
     let (enum_def_id, variant_def_id) = match def {
         def::DefTrait(_) => {
             let name = pprust::path_to_string(path);
@@ -518,7 +532,7 @@ pub fn check_pat_enum<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>,
     let fcx = pcx.fcx;
     let tcx = pcx.fcx.ccx.tcx;
 
-    let def = tcx.def_map.borrow()[pat.id].full_def();
+    let def = tcx.def_map.borrow().get(&pat.id).unwrap().full_def();
     let enum_def = def.variant_def_ids()
         .map_or_else(|| def.def_id(), |(enum_def, _)| enum_def);
 
index 32f91a175f3c3eed8d9eb73355aea543127124a8..d2a06fcf9909138d1a1b354350c9dc1ea903b5ce 100644 (file)
@@ -16,6 +16,7 @@
 use middle::region;
 use middle::subst;
 use middle::ty::{self, ToPolyTraitRef, Ty};
+use std::cmp;
 use syntax::abi;
 use syntax::ast;
 use syntax::ast_util;
@@ -109,15 +110,11 @@ fn deduce_expectations_from_expected_type<'a,'tcx>(
         ty::ty_trait(ref object_type) => {
             let proj_bounds = object_type.projection_bounds_with_self_ty(fcx.tcx(),
                                                                          fcx.tcx().types.err);
-            let expectations =
-                proj_bounds.iter()
-                           .filter_map(|pb| deduce_expectations_from_projection(fcx, pb))
-                           .next();
-
-            match expectations {
-                Some((sig, kind)) => (Some(sig), Some(kind)),
-                None => (None, None)
-            }
+            let sig = proj_bounds.iter()
+                                 .filter_map(|pb| deduce_sig_from_projection(fcx, pb))
+                                 .next();
+            let kind = fcx.tcx().lang_items.fn_trait_kind(object_type.principal_def_id());
+            (sig, kind)
         }
         ty::ty_infer(ty::TyVar(vid)) => {
             deduce_expectations_from_obligations(fcx, vid)
@@ -136,7 +133,7 @@ fn deduce_expectations_from_obligations<'a,'tcx>(
     let fulfillment_cx = fcx.inh.fulfillment_cx.borrow();
     // Here `expected_ty` is known to be a type inference variable.
 
-    let expected_sig_and_kind =
+    let expected_sig =
         fulfillment_cx
         .pending_obligations()
         .iter()
@@ -150,7 +147,7 @@ fn deduce_expectations_from_obligations<'a,'tcx>(
                 ty::Predicate::Projection(ref proj_predicate) => {
                     let trait_ref = proj_predicate.to_poly_trait_ref();
                     self_type_matches_expected_vid(fcx, trait_ref, expected_vid)
-                        .and_then(|_| deduce_expectations_from_projection(fcx, proj_predicate))
+                        .and_then(|_| deduce_sig_from_projection(fcx, proj_predicate))
                 }
                 _ => {
                     None
@@ -159,14 +156,10 @@ fn deduce_expectations_from_obligations<'a,'tcx>(
         })
         .next();
 
-    match expected_sig_and_kind {
-        Some((sig, kind)) => { return (Some(sig), Some(kind)); }
-        None => { }
-    }
-
     // Even if we can't infer the full signature, we may be able to
     // infer the kind. This can occur if there is a trait-reference
-    // like `F : Fn<A>`.
+    // like `F : Fn<A>`. Note that due to subtyping we could encounter
+    // many viable options, so pick the most restrictive.
     let expected_kind =
         fulfillment_cx
         .pending_obligations()
@@ -183,54 +176,61 @@ fn deduce_expectations_from_obligations<'a,'tcx>(
                 .and_then(|trait_ref| self_type_matches_expected_vid(fcx, trait_ref, expected_vid))
                 .and_then(|trait_ref| fcx.tcx().lang_items.fn_trait_kind(trait_ref.def_id()))
         })
-        .next();
+        .fold(None, pick_most_restrictive_closure_kind);
+
+    (expected_sig, expected_kind)
+}
 
-    (None, expected_kind)
+fn pick_most_restrictive_closure_kind(best: Option<ty::ClosureKind>,
+                                      cur: ty::ClosureKind)
+                                      -> Option<ty::ClosureKind>
+{
+    match best {
+        None => Some(cur),
+        Some(best) => Some(cmp::min(best, cur))
+    }
 }
 
 /// Given a projection like "<F as Fn(X)>::Result == Y", we can deduce
 /// everything we need to know about a closure.
-fn deduce_expectations_from_projection<'a,'tcx>(
+fn deduce_sig_from_projection<'a,'tcx>(
     fcx: &FnCtxt<'a,'tcx>,
     projection: &ty::PolyProjectionPredicate<'tcx>)
-    -> Option<(ty::FnSig<'tcx>, ty::ClosureKind)>
+    -> Option<ty::FnSig<'tcx>>
 {
     let tcx = fcx.tcx();
 
-    debug!("deduce_expectations_from_projection({})",
+    debug!("deduce_sig_from_projection({})",
            projection.repr(tcx));
 
     let trait_ref = projection.to_poly_trait_ref();
 
-    let kind = match tcx.lang_items.fn_trait_kind(trait_ref.def_id()) {
-        Some(k) => k,
-        None => { return None; }
-    };
-
-    debug!("found object type {:?}", kind);
+    if tcx.lang_items.fn_trait_kind(trait_ref.def_id()).is_none() {
+        return None;
+    }
 
     let arg_param_ty = *trait_ref.substs().types.get(subst::TypeSpace, 0);
     let arg_param_ty = fcx.infcx().resolve_type_vars_if_possible(&arg_param_ty);
-    debug!("arg_param_ty {}", arg_param_ty.repr(tcx));
+    debug!("deduce_sig_from_projection: arg_param_ty {}", arg_param_ty.repr(tcx));
 
     let input_tys = match arg_param_ty.sty {
         ty::ty_tup(ref tys) => { (*tys).clone() }
         _ => { return None; }
     };
-    debug!("input_tys {}", input_tys.repr(tcx));
+    debug!("deduce_sig_from_projection: input_tys {}", input_tys.repr(tcx));
 
     let ret_param_ty = projection.0.ty;
     let ret_param_ty = fcx.infcx().resolve_type_vars_if_possible(&ret_param_ty);
-    debug!("ret_param_ty {}", ret_param_ty.repr(tcx));
+    debug!("deduce_sig_from_projection: ret_param_ty {}", ret_param_ty.repr(tcx));
 
     let fn_sig = ty::FnSig {
         inputs: input_tys,
         output: ty::FnConverging(ret_param_ty),
         variadic: false
     };
-    debug!("fn_sig {}", fn_sig.repr(tcx));
+    debug!("deduce_sig_from_projection: fn_sig {}", fn_sig.repr(tcx));
 
-    return Some((fn_sig, kind));
+    Some(fn_sig)
 }
 
 fn self_type_matches_expected_vid<'a,'tcx>(
index a82ebcd9175fa43d9be6d03ede273282c3134d8c..ae1dbbb1b00ad2ca0dc0d619344fc5aaea99e8e5 100644 (file)
@@ -92,6 +92,12 @@ fn subtype(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> CoerceResult<'tcx> {
         Ok(None) // No coercion required.
     }
 
+    fn outlives(&self, a: ty::Region, b: ty::Region) -> cres<'tcx, ()> {
+        let sub = Sub(self.fcx.infcx().combine_fields(false, self.trace.clone()));
+        try!(sub.regions(b, a));
+        Ok(())
+    }
+
     fn unpack_actual_value<T, F>(&self, a: Ty<'tcx>, f: F) -> T where
         F: FnOnce(Ty<'tcx>) -> T,
     {
@@ -252,70 +258,64 @@ fn coerce_unsized(&self,
 
         match (&a.sty, &b.sty) {
             (&ty::ty_rptr(_, ty::mt{ty: t_a, mutbl: mutbl_a}), &ty::ty_rptr(_, mt_b)) => {
-                self.unpack_actual_value(t_a, |a| {
-                    match self.unsize_ty(t_a, a, mt_b.ty) {
-                        Some((ty, kind)) => {
-                            if !can_coerce_mutbls(mutbl_a, mt_b.mutbl) {
-                                return Err(ty::terr_mutability);
-                            }
-
-                            let coercion = Coercion(self.trace.clone());
-                            let r_borrow = self.fcx.infcx().next_region_var(coercion);
-                            let ty = ty::mk_rptr(self.tcx(),
-                                                 self.tcx().mk_region(r_borrow),
-                                                 ty::mt{ty: ty, mutbl: mt_b.mutbl});
-                            try!(self.fcx.infcx().try(|_| self.subtype(ty, b)));
-                            debug!("Success, coerced with AutoDerefRef(1, \
-                                    AutoPtr(AutoUnsize({:?})))", kind);
-                            Ok(Some(AdjustDerefRef(AutoDerefRef {
-                                autoderefs: 1,
-                                autoref: Some(ty::AutoPtr(r_borrow, mt_b.mutbl,
-                                                          Some(box AutoUnsize(kind))))
-                            })))
+                match self.unsize_ty(t_a, mt_b.ty) {
+                    Some((ty, kind)) => {
+                        if !can_coerce_mutbls(mutbl_a, mt_b.mutbl) {
+                            return Err(ty::terr_mutability);
                         }
-                        _ => Err(ty::terr_mismatch)
+
+                        let coercion = Coercion(self.trace.clone());
+                        let r_borrow = self.fcx.infcx().next_region_var(coercion);
+                        let ty = ty::mk_rptr(self.tcx(),
+                                             self.tcx().mk_region(r_borrow),
+                                             ty::mt{ty: ty, mutbl: mt_b.mutbl});
+                        try!(self.fcx.infcx().try(|_| self.subtype(ty, b)));
+                        debug!("Success, coerced with AutoDerefRef(1, \
+                                AutoPtr(AutoUnsize({:?})))", kind);
+                        Ok(Some(AdjustDerefRef(AutoDerefRef {
+                            autoderefs: 1,
+                            autoref: Some(ty::AutoPtr(r_borrow, mt_b.mutbl,
+                                                      Some(box AutoUnsize(kind))))
+                        })))
                     }
-                })
+                    _ => Err(ty::terr_mismatch)
+                }
             }
             (&ty::ty_rptr(_, ty::mt{ty: t_a, mutbl: mutbl_a}), &ty::ty_ptr(mt_b)) => {
-                self.unpack_actual_value(t_a, |a| {
-                    match self.unsize_ty(t_a, a, mt_b.ty) {
-                        Some((ty, kind)) => {
-                            if !can_coerce_mutbls(mutbl_a, mt_b.mutbl) {
-                                return Err(ty::terr_mutability);
-                            }
-
-                            let ty = ty::mk_ptr(self.tcx(),
-                                                 ty::mt{ty: ty, mutbl: mt_b.mutbl});
-                            try!(self.fcx.infcx().try(|_| self.subtype(ty, b)));
-                            debug!("Success, coerced with AutoDerefRef(1, \
-                                    AutoPtr(AutoUnsize({:?})))", kind);
-                            Ok(Some(AdjustDerefRef(AutoDerefRef {
-                                autoderefs: 1,
-                                autoref: Some(ty::AutoUnsafe(mt_b.mutbl,
-                                                             Some(box AutoUnsize(kind))))
-                            })))
+                match self.unsize_ty(t_a, mt_b.ty) {
+                    Some((ty, kind)) => {
+                        if !can_coerce_mutbls(mutbl_a, mt_b.mutbl) {
+                            return Err(ty::terr_mutability);
                         }
-                        _ => Err(ty::terr_mismatch)
+
+                        let ty = ty::mk_ptr(self.tcx(),
+                                             ty::mt{ty: ty, mutbl: mt_b.mutbl});
+                        try!(self.fcx.infcx().try(|_| self.subtype(ty, b)));
+                        debug!("Success, coerced with AutoDerefRef(1, \
+                                AutoPtr(AutoUnsize({:?})))", kind);
+                        Ok(Some(AdjustDerefRef(AutoDerefRef {
+                            autoderefs: 1,
+                            autoref: Some(ty::AutoUnsafe(mt_b.mutbl,
+                                                         Some(box AutoUnsize(kind))))
+                        })))
                     }
-                })
+                    _ => Err(ty::terr_mismatch)
+                }
             }
             (&ty::ty_uniq(t_a), &ty::ty_uniq(t_b)) => {
-                self.unpack_actual_value(t_a, |a| {
-                    match self.unsize_ty(t_a, a, t_b) {
-                        Some((ty, kind)) => {
-                            let ty = ty::mk_uniq(self.tcx(), ty);
-                            try!(self.fcx.infcx().try(|_| self.subtype(ty, b)));
-                            debug!("Success, coerced with AutoDerefRef(1, \
-                                    AutoUnsizeUniq({:?}))", kind);
-                            Ok(Some(AdjustDerefRef(AutoDerefRef {
-                                autoderefs: 1,
-                                autoref: Some(ty::AutoUnsizeUniq(kind))
-                            })))
-                        }
-                        _ => Err(ty::terr_mismatch)
+                match self.unsize_ty(t_a, t_b) {
+                    Some((ty, kind)) => {
+                        let ty = ty::mk_uniq(self.tcx(), ty);
+                        try!(self.fcx.infcx().try(|_| self.subtype(ty, b)));
+                        debug!("Success, coerced with AutoDerefRef(1, \
+                                AutoUnsizeUniq({:?}))", kind);
+                        Ok(Some(AdjustDerefRef(AutoDerefRef {
+                            autoderefs: 1,
+                            autoref: Some(ty::AutoUnsizeUniq(kind))
+                        })))
                     }
-                })
+                    _ => Err(ty::terr_mismatch)
+                }
             }
             _ => Err(ty::terr_mismatch)
         }
@@ -326,94 +326,112 @@ fn coerce_unsized(&self,
     // E.g., `[T, ..n]` -> `([T], UnsizeLength(n))`
     fn unsize_ty(&self,
                  ty_a: Ty<'tcx>,
-                 a: Ty<'tcx>,
                  ty_b: Ty<'tcx>)
-                 -> Option<(Ty<'tcx>, ty::UnsizeKind<'tcx>)> {
-        debug!("unsize_ty(a={:?}, ty_b={})", a, ty_b.repr(self.tcx()));
-
+                 -> Option<(Ty<'tcx>, ty::UnsizeKind<'tcx>)>
+    {
         let tcx = self.tcx();
 
-        self.unpack_actual_value(ty_b, |b|
-            match (&a.sty, &b.sty) {
-                (&ty::ty_vec(t_a, Some(len)), &ty::ty_vec(_, None)) => {
-                    let ty = ty::mk_vec(tcx, t_a, None);
-                    Some((ty, ty::UnsizeLength(len)))
-                }
-                (&ty::ty_trait(ref data_a), &ty::ty_trait(ref data_b)) => {
-                    // For now, we only support upcasts from
-                    // `Foo+Send` to `Foo` (really, any time there are
-                    // fewer builtin bounds then before). These are
-                    // convenient because they don't require any sort
-                    // of change to the vtable at runtime.
-                    if data_a.bounds.builtin_bounds != data_b.bounds.builtin_bounds &&
-                        data_a.bounds.builtin_bounds.is_superset(&data_b.bounds.builtin_bounds)
-                    {
-                        let bounds_a1 = ty::ExistentialBounds {
-                            region_bound: data_a.bounds.region_bound,
-                            builtin_bounds: data_b.bounds.builtin_bounds,
-                            projection_bounds: data_a.bounds.projection_bounds.clone(),
-                        };
-                        let ty_a1 = ty::mk_trait(tcx, data_a.principal.clone(), bounds_a1);
-                        match self.fcx.infcx().try(|_| self.subtype(ty_a1, ty_b)) {
-                            Ok(_) => Some((ty_b, ty::UnsizeUpcast(ty_b))),
-                            Err(_) => None,
-                        }
-                    } else {
-                        None
+        self.unpack_actual_value(ty_a, |a| {
+            self.unpack_actual_value(ty_b, |b| {
+                debug!("unsize_ty(a={}, b={})", a.repr(self.tcx()), b.repr(self.tcx()));
+                match (&a.sty, &b.sty) {
+                    (&ty::ty_vec(t_a, Some(len)), &ty::ty_vec(_, None)) => {
+                        let ty = ty::mk_vec(tcx, t_a, None);
+                        Some((ty, ty::UnsizeLength(len)))
                     }
-                }
-                (_, &ty::ty_trait(ref data)) => {
-                    Some((ty_b, ty::UnsizeVtable(ty::TyTrait { principal: data.principal.clone(),
-                                                               bounds: data.bounds.clone() },
-                                                 ty_a)))
-                }
-                (&ty::ty_struct(did_a, substs_a), &ty::ty_struct(did_b, substs_b))
-                  if did_a == did_b => {
-                    debug!("unsizing a struct");
-                    // Try unsizing each type param in turn to see if we end up with ty_b.
-                    let ty_substs_a = substs_a.types.get_slice(subst::TypeSpace);
-                    let ty_substs_b = substs_b.types.get_slice(subst::TypeSpace);
-                    assert!(ty_substs_a.len() == ty_substs_b.len());
-
-                    let mut result = None;
-                    let tps = ty_substs_a.iter().zip(ty_substs_b.iter()).enumerate();
-                    for (i, (tp_a, tp_b)) in tps {
-                        if self.fcx.infcx().try(|_| self.subtype(*tp_a, *tp_b)).is_ok() {
-                            continue;
+                    (&ty::ty_trait(ref data_a), &ty::ty_trait(ref data_b)) => {
+                        // Upcasts permit two things:
+                        //
+                        // 1. Dropping builtin bounds, e.g. `Foo+Send` to `Foo`
+                        // 2. Tightening the region bound, e.g. `Foo+'a` to `Foo+'b` if `'a : 'b`
+                        //
+                        // Note that neither of these changes requires any
+                        // change at runtime.  Eventually this will be
+                        // generalized.
+                        //
+                        // We always upcast when we can because of reason
+                        // #2 (region bounds).
+                        if data_a.bounds.builtin_bounds.is_superset(&data_b.bounds.builtin_bounds) {
+                            // construct a type `a1` which is a version of
+                            // `a` using the upcast bounds from `b`
+                            let bounds_a1 = ty::ExistentialBounds {
+                                // From type b
+                                region_bound: data_b.bounds.region_bound,
+                                builtin_bounds: data_b.bounds.builtin_bounds,
+
+                                // From type a
+                                projection_bounds: data_a.bounds.projection_bounds.clone(),
+                            };
+                            let ty_a1 = ty::mk_trait(tcx, data_a.principal.clone(), bounds_a1);
+
+                            // relate `a1` to `b`
+                            let result = self.fcx.infcx().try(|_| {
+                                // it's ok to upcast from Foo+'a to Foo+'b so long as 'a : 'b
+                                try!(self.outlives(data_a.bounds.region_bound,
+                                                   data_b.bounds.region_bound));
+                                self.subtype(ty_a1, ty_b)
+                            });
+
+                            // if that was successful, we have a coercion
+                            match result {
+                                Ok(_) => Some((ty_b, ty::UnsizeUpcast(ty_b))),
+                                Err(_) => None,
+                            }
+                        } else {
+                            None
                         }
-                        match
-                            self.unpack_actual_value(
-                                *tp_a,
-                                |tp| self.unsize_ty(*tp_a, tp, *tp_b))
-                        {
-                            Some((new_tp, k)) => {
-                                // Check that the whole types match.
-                                let mut new_substs = substs_a.clone();
-                                new_substs.types.get_mut_slice(subst::TypeSpace)[i] = new_tp;
-                                let ty = ty::mk_struct(tcx, did_a, tcx.mk_substs(new_substs));
-                                if self.fcx.infcx().try(|_| self.subtype(ty, ty_b)).is_err() {
-                                    debug!("Unsized type parameter '{}', but still \
-                                            could not match types {} and {}",
-                                           ppaux::ty_to_string(tcx, *tp_a),
-                                           ppaux::ty_to_string(tcx, ty),
-                                           ppaux::ty_to_string(tcx, ty_b));
-                                    // We can only unsize a single type parameter, so
-                                    // if we unsize one and it doesn't give us the
-                                    // type we want, then we won't succeed later.
+                    }
+                    (_, &ty::ty_trait(ref data)) => {
+                        Some((ty_b, ty::UnsizeVtable(ty::TyTrait {
+                                                         principal: data.principal.clone(),
+                                                         bounds: data.bounds.clone()
+                                                     },
+                                                     ty_a)))
+                    }
+                    (&ty::ty_struct(did_a, substs_a), &ty::ty_struct(did_b, substs_b))
+                      if did_a == did_b => {
+                        debug!("unsizing a struct");
+                        // Try unsizing each type param in turn to see if we end up with ty_b.
+                        let ty_substs_a = substs_a.types.get_slice(subst::TypeSpace);
+                        let ty_substs_b = substs_b.types.get_slice(subst::TypeSpace);
+                        assert!(ty_substs_a.len() == ty_substs_b.len());
+
+                        let mut result = None;
+                        let tps = ty_substs_a.iter().zip(ty_substs_b.iter()).enumerate();
+                        for (i, (tp_a, tp_b)) in tps {
+                            if self.fcx.infcx().try(|_| self.subtype(*tp_a, *tp_b)).is_ok() {
+                                continue;
+                            }
+                            match self.unsize_ty(*tp_a, *tp_b) {
+                                Some((new_tp, k)) => {
+                                    // Check that the whole types match.
+                                    let mut new_substs = substs_a.clone();
+                                    new_substs.types.get_mut_slice(subst::TypeSpace)[i] = new_tp;
+                                    let ty = ty::mk_struct(tcx, did_a, tcx.mk_substs(new_substs));
+                                    if self.fcx.infcx().try(|_| self.subtype(ty, ty_b)).is_err() {
+                                        debug!("Unsized type parameter '{}', but still \
+                                                could not match types {} and {}",
+                                               ppaux::ty_to_string(tcx, *tp_a),
+                                               ppaux::ty_to_string(tcx, ty),
+                                               ppaux::ty_to_string(tcx, ty_b));
+                                        // We can only unsize a single type parameter, so
+                                        // if we unsize one and it doesn't give us the
+                                        // type we want, then we won't succeed later.
+                                        break;
+                                    }
+
+                                    result = Some((ty, ty::UnsizeStruct(box k, i)));
                                     break;
                                 }
-
-                                result = Some((ty, ty::UnsizeStruct(box k, i)));
-                                break;
+                                None => {}
                             }
-                            None => {}
                         }
+                        result
                     }
-                    result
+                    _ => None
                 }
-                _ => None
-            }
-        )
+            })
+        })
     }
 
     fn coerce_from_fn_pointer(&self,
index 6f2d0cb3667418023cc69a0d954305d84bab85cb..cd6a1226e00c9d639d8c83d38891caaf13122e85 100644 (file)
@@ -53,9 +53,11 @@ pub fn eqtype<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, sp: Span,
     }
 }
 
-// Checks that the type `actual` can be coerced to `expected`.
-pub fn coerce<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, sp: Span,
-                        expected: Ty<'tcx>, expr: &ast::Expr) {
+// Checks that the type of `expr` can be coerced to `expected`.
+pub fn coerce<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
+                        sp: Span,
+                        expected: Ty<'tcx>,
+                        expr: &ast::Expr) {
     let expr_ty = fcx.expr_ty(expr);
     debug!("demand::coerce(expected = {}, expr_ty = {})",
            expected.repr(fcx.ccx.tcx),
index bc581a6af4154c516b2279fb0079a5e02e412243..b95e0ce8cb3c59e512d65101884e5fbd1d9b1697 100644 (file)
@@ -725,7 +725,7 @@ fn assemble_closure_candidates(&mut self,
             };
 
             // this closure doesn't implement the right kind of `Fn` trait
-            if closure_kind != kind {
+            if !closure_kind.extends(kind) {
                 continue;
             }
 
index 45d4a1edc6b2414074ecc573012ad832a40e819d..47aafa2251d9713dcc74a2eea5e9b163f46d0f6a 100644 (file)
@@ -184,6 +184,8 @@ pub struct Inherited<'a, 'tcx: 'a> {
     // def-id of the closure, so that once we decide, we can easily go
     // back and process them.
     deferred_call_resolutions: RefCell<DefIdMap<Vec<DeferredCallResolutionHandler<'tcx>>>>,
+
+    deferred_cast_checks: RefCell<Vec<CastCheck<'tcx>>>,
 }
 
 trait DeferredCallResolution<'tcx> {
@@ -192,6 +194,15 @@ trait DeferredCallResolution<'tcx> {
 
 type DeferredCallResolutionHandler<'tcx> = Box<DeferredCallResolution<'tcx>+'tcx>;
 
+/// Reifies a cast check to be checked once we have full type information for
+/// a function context.
+struct CastCheck<'tcx> {
+    expr: ast::Expr,
+    expr_ty: Ty<'tcx>,
+    cast_ty: Ty<'tcx>,
+    span: Span,
+}
+
 /// When type-checking an expression, we propagate downward
 /// whatever type hint we are able in the form of an `Expectation`.
 #[derive(Copy)]
@@ -368,7 +379,7 @@ fn closure_type(&self,
                     substs: &subst::Substs<'tcx>)
                     -> ty::ClosureTy<'tcx>
     {
-        self.inh.closure_tys.borrow()[def_id].subst(self.tcx(), substs)
+        self.inh.closure_tys.borrow().get(&def_id).unwrap().subst(self.tcx(), substs)
     }
 
     fn closure_upvars(&self,
@@ -399,6 +410,7 @@ fn new(tcx: &'a ty::ctxt<'tcx>,
             fn_sig_map: RefCell::new(NodeMap()),
             fulfillment_cx: RefCell::new(traits::FulfillmentContext::new()),
             deferred_call_resolutions: RefCell::new(DefIdMap()),
+            deferred_cast_checks: RefCell::new(Vec::new()),
         }
     }
 
@@ -508,6 +520,7 @@ fn check_bare_fn<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
             vtable::select_all_fcx_obligations_and_apply_defaults(&fcx);
             upvar::closure_analyze_fn(&fcx, fn_id, decl, body);
             vtable::select_all_fcx_obligations_or_error(&fcx);
+            fcx.check_casts();
             regionck::regionck_fn(&fcx, fn_id, fn_span, decl, body);
             writeback::resolve_type_vars_in_fn(&fcx, decl, body);
         }
@@ -549,7 +562,7 @@ fn visit_local(&mut self, local: &'tcx ast::Local) {
         debug!("Local variable {} is assigned type {}",
                self.fcx.pat_to_string(&*local.pat),
                self.fcx.infcx().ty_to_string(
-                   self.fcx.inh.locals.borrow()[local.id].clone()));
+                   self.fcx.inh.locals.borrow().get(&local.id).unwrap().clone()));
         visit::walk_local(self, local);
     }
 
@@ -565,7 +578,7 @@ fn visit_pat(&mut self, p: &'tcx ast::Pat) {
                 debug!("Pattern binding {} is assigned to {} with type {}",
                        token::get_ident(path1.node),
                        self.fcx.infcx().ty_to_string(
-                           self.fcx.inh.locals.borrow()[p.id].clone()),
+                           self.fcx.inh.locals.borrow().get(&p.id).unwrap().clone()),
                        var_ty.repr(self.fcx.tcx()));
             }
         }
@@ -1053,11 +1066,7 @@ fn report_cast_to_unsized_type<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
 }
 
 
-fn check_cast_inner<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
-                              span: Span,
-                              t_1: Ty<'tcx>,
-                              t_e: Ty<'tcx>,
-                              e: &ast::Expr) {
+fn check_cast<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, cast: &CastCheck<'tcx>) {
     fn cast_through_integer_err<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
                                           span: Span,
                                           t_1: Ty<'tcx>,
@@ -1070,6 +1079,33 @@ fn cast_through_integer_err<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
         }, t_e, None);
     }
 
+    let span = cast.span;
+    let e = &cast.expr;
+    let t_e = structurally_resolved_type(fcx, span, cast.expr_ty);
+    let t_1 = structurally_resolved_type(fcx, span, cast.cast_ty);
+
+    // Check for trivial casts.
+    if !ty::type_has_ty_infer(t_1) {
+        if let Ok(()) = coercion::mk_assignty(fcx, e, t_e, t_1) {
+            if ty::type_is_numeric(t_1) && ty::type_is_numeric(t_e) {
+                fcx.tcx().sess.add_lint(lint::builtin::TRIVIAL_NUMERIC_CASTS,
+                                        e.id,
+                                        span,
+                                        format!("trivial numeric cast: `{}` as `{}`",
+                                                fcx.infcx().ty_to_string(t_e),
+                                                fcx.infcx().ty_to_string(t_1)));
+            } else {
+                fcx.tcx().sess.add_lint(lint::builtin::TRIVIAL_CASTS,
+                                        e.id,
+                                        span,
+                                        format!("trivial cast: `{}` as `{}`",
+                                                fcx.infcx().ty_to_string(t_e),
+                                                fcx.infcx().ty_to_string(t_1)));
+            }
+            return;
+        }
+    }
+
     let t_e_is_bare_fn_item = ty::type_is_bare_fn_item(t_e);
     let t_e_is_scalar = ty::type_is_scalar(t_e);
     let t_e_is_integral = ty::type_is_integral(t_e);
@@ -1085,18 +1121,17 @@ fn cast_through_integer_err<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
     let t_1_is_trivial = t_1_is_scalar && !t_1_is_char && !t_1_is_bare_fn;
 
     if t_e_is_bare_fn_item && t_1_is_bare_fn {
-        demand::coerce(fcx, e.span, t_1, &*e);
+        demand::coerce(fcx, e.span, t_1, &e);
     } else if t_1_is_char {
         let t_e = fcx.infcx().shallow_resolve(t_e);
         if t_e.sty != ty::ty_uint(ast::TyU8) {
             fcx.type_error_message(span, |actual| {
-                format!("only `u8` can be cast as \
-                         `char`, not `{}`", actual)
+                format!("only `u8` can be cast as `char`, not `{}`", actual)
             }, t_e, None);
         }
     } else if t_1.sty == ty::ty_bool {
         span_err!(fcx.tcx().sess, span, E0054,
-            "cannot cast as `bool`, compare with zero instead");
+                  "cannot cast as `bool`, compare with zero instead");
     } else if t_1_is_float && (t_e_is_scalar || t_e_is_c_enum) && !(
         t_e_is_integral || t_e_is_float || t_e.sty == ty::ty_bool) {
         // Casts to float must go through an integer or boolean
@@ -1145,7 +1180,7 @@ fn types_compatible<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, sp: Span,
                 /* this case is allowed */
             }
             _ => {
-                demand::coerce(fcx, e.span, t_1, &*e);
+                demand::coerce(fcx, e.span, t_1, &e);
             }
         }
     } else if !(t_e_is_scalar && t_1_is_trivial) {
@@ -1162,49 +1197,6 @@ fn types_compatible<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, sp: Span,
     }
 }
 
-fn check_cast<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
-                       cast_expr: &ast::Expr,
-                       e: &'tcx ast::Expr,
-                       t: &ast::Ty) {
-    let id = cast_expr.id;
-    let span = cast_expr.span;
-
-    // Find the type of `e`. Supply hints based on the type we are casting to,
-    // if appropriate.
-    let t_1 = fcx.to_ty(t);
-    let t_1 = structurally_resolved_type(fcx, span, t_1);
-
-    check_expr_with_expectation(fcx, e, ExpectCastableToType(t_1));
-
-    let t_e = fcx.expr_ty(e);
-
-    debug!("t_1={}", fcx.infcx().ty_to_string(t_1));
-    debug!("t_e={}", fcx.infcx().ty_to_string(t_e));
-
-    if ty::type_is_error(t_e) {
-        fcx.write_error(id);
-        return
-    }
-
-    if !fcx.type_is_known_to_be_sized(t_1, cast_expr.span) {
-        report_cast_to_unsized_type(fcx, span, t.span, e.span, t_1, t_e, id);
-        return
-    }
-
-    if ty::type_is_trait(t_1) {
-        // This will be looked up later on.
-        vtable::check_object_cast(fcx, cast_expr, e, t_1);
-        fcx.write_ty(id, t_1);
-        return
-    }
-
-    let t_1 = structurally_resolved_type(fcx, span, t_1);
-    let t_e = structurally_resolved_type(fcx, span, t_e);
-
-    check_cast_inner(fcx, span, t_1, t_e, e);
-    fcx.write_ty(id, t_1);
-}
-
 impl<'a, 'tcx> AstConv<'tcx> for FnCtxt<'a, 'tcx> {
     fn tcx(&self) -> &ty::ctxt<'tcx> { self.ccx.tcx }
 
@@ -1372,7 +1364,8 @@ fn remove_deferred_call_resolutions(&self,
     }
 
     pub fn tag(&self) -> String {
-        format!("{:?}", self as *const FnCtxt)
+        let self_ptr: *const FnCtxt = self;
+        format!("{:?}", self_ptr)
     }
 
     pub fn local_ty(&self, span: Span, nid: ast::NodeId) -> Ty<'tcx> {
@@ -1416,14 +1409,6 @@ pub fn write_ty(&self, node_id: ast::NodeId, ty: Ty<'tcx>) {
         self.inh.node_types.borrow_mut().insert(node_id, ty);
     }
 
-    pub fn write_object_cast(&self,
-                             key: ast::NodeId,
-                             trait_ref: ty::PolyTraitRef<'tcx>) {
-        debug!("write_object_cast key={} trait_ref={}",
-               key, trait_ref.repr(self.tcx()));
-        self.inh.object_cast_map.borrow_mut().insert(key, trait_ref);
-    }
-
     pub fn write_substs(&self, node_id: ast::NodeId, substs: ty::ItemSubsts<'tcx>) {
         if !substs.substs.is_noop() {
             debug!("write_substs({}, {}) in fcx {}",
@@ -1923,6 +1908,15 @@ pub fn lookup_tup_field_ty(&self,
         o_field.map(|f| ty::lookup_field_type(self.tcx(), class_id, f.id, substs))
                .map(|t| self.normalize_associated_types_in(span, &t))
     }
+
+    fn check_casts(&self) {
+        let mut deferred_cast_checks = self.inh.deferred_cast_checks.borrow_mut();
+        for check in deferred_cast_checks.iter() {
+            check_cast(self, check);
+        }
+
+        deferred_cast_checks.clear();
+    }
 }
 
 impl<'a, 'tcx> RegionScope for FnCtxt<'a, 'tcx> {
@@ -3327,7 +3321,7 @@ fn check_struct_or_variant_fields<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
                 let mut missing_fields = Vec::new();
                 for class_field in field_types {
                     let name = class_field.name;
-                    let (_, seen) = class_field_map[name];
+                    let (_, seen) = *class_field_map.get(&name).unwrap();
                     if !seen {
                         missing_fields.push(
                             format!("`{}`", &token::get_name(name)))
@@ -3828,7 +3822,33 @@ fn check_struct_fields_on_error<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
         if let ast::TyFixedLengthVec(_, ref count_expr) = t.node {
             check_expr_with_hint(fcx, &**count_expr, tcx.types.uint);
         }
-        check_cast(fcx, expr, &**e, &**t);
+
+        // Find the type of `e`. Supply hints based on the type we are casting to,
+        // if appropriate.
+        let t_1 = fcx.to_ty(t);
+        let t_1 = structurally_resolved_type(fcx, expr.span, t_1);
+        check_expr_with_expectation(fcx, e, ExpectCastableToType(t_1));
+        let t_e = fcx.expr_ty(e);
+
+        // Eagerly check for some obvious errors.
+        if ty::type_is_error(t_e) {
+            fcx.write_error(id);
+        } else if !fcx.type_is_known_to_be_sized(t_1, expr.span) {
+            report_cast_to_unsized_type(fcx, expr.span, t.span, e.span, t_1, t_e, id);
+        } else {
+            // Write a type for the whole expression, assuming everything is going
+            // to work out Ok.
+            fcx.write_ty(id, t_1);
+
+            // Defer other checks until we're done type checking.
+            let mut deferred_cast_checks = fcx.inh.deferred_cast_checks.borrow_mut();
+            deferred_cast_checks.push(CastCheck {
+                expr: (**e).clone(),
+                expr_ty: t_e,
+                cast_ty: t_1,
+                span: expr.span,
+            });
+        }
       }
       ast::ExprVec(ref args) => {
         let uty = expected.to_option(fcx).and_then(|uty| {
@@ -4242,11 +4262,27 @@ fn repr(&self, tcx: &ty::ctxt<'tcx>) -> String {
 }
 
 pub fn check_decl_initializer<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
-                                       nid: ast::NodeId,
+                                       local: &'tcx ast::Local,
                                        init: &'tcx ast::Expr)
 {
-    let local_ty = fcx.local_ty(init.span, nid);
-    check_expr_coercable_to_type(fcx, init, local_ty)
+    let ref_bindings = fcx.tcx().pat_contains_ref_binding(&local.pat);
+
+    let local_ty = fcx.local_ty(init.span, local.id);
+    if !ref_bindings {
+        check_expr_coercable_to_type(fcx, init, local_ty)
+    } else {
+        // Somewhat subtle: if we have a `ref` binding in the pattern,
+        // we want to avoid introducing coercions for the RHS. This is
+        // both because it helps preserve sanity and, in the case of
+        // ref mut, for soundness (issue #23116). In particular, in
+        // the latter case, we need to be clear that the type of the
+        // referent for the reference that results is *equal to* the
+        // type of the lvalue it is referencing, and not some
+        // supertype thereof.
+        check_expr(fcx, init);
+        let init_ty = fcx.expr_ty(init);
+        demand::eqtype(fcx, init.span, init_ty, local_ty);
+    };
 }
 
 pub fn check_decl_local<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>, local: &'tcx ast::Local)  {
@@ -4256,7 +4292,7 @@ pub fn check_decl_local<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>, local: &'tcx ast::Local)
     fcx.write_ty(local.id, t);
 
     if let Some(ref init) = local.init {
-        check_decl_initializer(fcx, local.id, &**init);
+        check_decl_initializer(fcx, local, &**init);
         let init_ty = fcx.expr_ty(&**init);
         if ty::type_is_error(init_ty) {
             fcx.write_ty(local.id, init_ty);
@@ -4428,7 +4464,7 @@ fn check_const<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,
     let inh = static_inherited_fields(ccx);
     let rty = ty::node_id_to_type(ccx.tcx, id);
     let fcx = blank_fn_ctxt(ccx, &inh, ty::FnConverging(rty), e.id);
-    let declty = (*fcx.ccx.tcx.tcache.borrow())[local_def(id)].ty;
+    let declty = fcx.ccx.tcx.tcache.borrow().get(&local_def(id)).unwrap().ty;
     check_const_with_ty(&fcx, sp, e, declty);
 }
 
@@ -4445,6 +4481,7 @@ fn check_const_with_ty<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
     check_expr_with_hint(fcx, e, declty);
     demand::coerce(fcx, e.span, declty, e);
     vtable::select_all_fcx_obligations_or_error(fcx);
+    fcx.check_casts();
     regionck::regionck_expr(fcx, e);
     writeback::resolve_type_vars_in_expr(fcx, e);
 }
@@ -4544,6 +4581,8 @@ fn disr_in_range(ccx: &CrateCtxt,
                      ty: attr::IntType,
                      disr: ty::Disr) -> bool {
         fn uint_in_range(ccx: &CrateCtxt, ty: ast::UintTy, disr: ty::Disr) -> bool {
+            #![allow(trivial_numeric_casts)]
+
             match ty {
                 ast::TyU8 => disr as u8 as Disr == disr,
                 ast::TyU16 => disr as u16 as Disr == disr,
@@ -4572,6 +4611,7 @@ fn do_check<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
                           id: ast::NodeId,
                           hint: attr::ReprAttr)
                           -> Vec<Rc<ty::VariantInfo<'tcx>>> {
+        #![allow(trivial_numeric_casts)]
         use std::num::Int;
 
         let rty = ty::node_id_to_type(ccx.tcx, id);
@@ -5365,7 +5405,7 @@ fn param<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, n: u32) -> Ty<'tcx> {
                    mutbl: ast::MutImmutable
                }))
             }
-            "copy_memory" | "copy_nonoverlapping_memory" |
+            "copy" | "copy_nonoverlapping" |
             "volatile_copy_memory" | "volatile_copy_nonoverlapping_memory" => {
               (1,
                vec!(
@@ -5381,7 +5421,7 @@ fn param<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, n: u32) -> Ty<'tcx> {
                ),
                ty::mk_nil(tcx))
             }
-            "set_memory" | "volatile_set_memory" => {
+            "write_bytes" | "volatile_set_memory" => {
               (1,
                vec!(
                   ty::mk_ptr(tcx, ty::mt {
index ce4bb4465517b21ef55189e1fc99f2312fae03ee..340cca7d47e7a395619bb5ae60ce9d1724e800a6 100644 (file)
@@ -448,7 +448,7 @@ fn adjust_closure_kind(&self,
 
         let closure_def_id = ast_util::local_def(closure_id);
         let mut closure_kinds = self.fcx.inh.closure_kinds.borrow_mut();
-        let existing_kind = closure_kinds[closure_def_id];
+        let existing_kind = *closure_kinds.get(&closure_def_id).unwrap();
 
         debug!("adjust_closure_kind: closure_id={}, existing_kind={:?}, new_kind={:?}",
                closure_id, existing_kind, new_kind);
index 963be9aa2e2d2b0cb77e2320f19796e5ebdb2c1e..2858dc9b569fe1adaa22ffb7cde199e4e375404a 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 use check::{FnCtxt};
-use check::demand;
 use middle::traits::{self, ObjectSafetyViolation, MethodViolationCode};
 use middle::traits::{Obligation, ObligationCause};
 use middle::traits::report_fulfillment_errors;
 use util::nodemap::FnvHashSet;
 use util::ppaux::{Repr, UserString};
 
-pub fn check_object_cast<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
-                                   cast_expr: &ast::Expr,
-                                   source_expr: &ast::Expr,
-                                   target_object_ty: Ty<'tcx>)
-{
-    let tcx = fcx.tcx();
-    debug!("check_object_cast(cast_expr={}, target_object_ty={})",
-           cast_expr.repr(tcx),
-           target_object_ty.repr(tcx));
-
-    // Look up vtables for the type we're casting to,
-    // passing in the source and target type.  The source
-    // must be a pointer type suitable to the object sigil,
-    // e.g.: `&x as &Trait` or `box x as Box<Trait>`
-
-    // First, construct a fresh type that we can feed into `<expr>`
-    // within `<expr> as <type>` to inform type inference (e.g. to
-    // tell it that we are expecting a `Box<_>` or an `&_`).
-    let fresh_ty = fcx.infcx().next_ty_var();
-    let (object_trait_ty, source_expected_ty) = match target_object_ty.sty {
-        ty::ty_uniq(object_trait_ty) => {
-            (object_trait_ty, ty::mk_uniq(fcx.tcx(), fresh_ty))
-        }
-        ty::ty_rptr(target_region, ty::mt { ty: object_trait_ty,
-                                            mutbl: target_mutbl }) => {
-            (object_trait_ty,
-             ty::mk_rptr(fcx.tcx(),
-                         target_region, ty::mt { ty: fresh_ty,
-                                                 mutbl: target_mutbl }))
-        }
-        _ => {
-            fcx.tcx().sess.span_bug(source_expr.span, "expected object type");
-        }
-    };
-
-    let source_ty = fcx.expr_ty(source_expr);
-    debug!("check_object_cast pre unify source_ty={}", source_ty.repr(tcx));
-
-    // This ensures that the source_ty <: source_expected_ty, which
-    // will ensure e.g. that &'a T <: &'b T when doing `&'a T as &'b Trait`
-    //
-    // FIXME (pnkfelix): do we need to use suptype_with_fn in order to
-    // override the error message emitted when the types do not work
-    // out in the manner desired?
-    demand::suptype(fcx, source_expr.span, source_expected_ty, source_ty);
-
-    debug!("check_object_cast postunify source_ty={}", source_ty.repr(tcx));
-
-    let object_trait = object_trait(&object_trait_ty);
-
-    // Ensure that if Ptr<T> is cast to Ptr<Trait>, then T : Trait.
-    push_cast_obligation(fcx, cast_expr, object_trait, fresh_ty);
-    check_object_safety(tcx, object_trait, source_expr.span);
-
-    fn object_trait<'a, 'tcx>(t: &'a Ty<'tcx>) -> &'a ty::TyTrait<'tcx> {
-        match t.sty {
-            ty::ty_trait(ref ty_trait) => &**ty_trait,
-            _ => panic!("expected ty_trait")
-        }
-    }
-
-    fn push_cast_obligation<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
-                                      cast_expr: &ast::Expr,
-                                      object_trait: &ty::TyTrait<'tcx>,
-                                      referent_ty: Ty<'tcx>) {
-        let object_trait_ref =
-            register_object_cast_obligations(fcx,
-                                             cast_expr.span,
-                                             object_trait,
-                                             referent_ty);
-
-        // Finally record the object_trait_ref for use during trans
-        // (it would prob be better not to do this, but it's just kind
-        // of a pain to have to reconstruct it).
-        fcx.write_object_cast(cast_expr.id, object_trait_ref);
-    }
-}
 
 // Check that a trait is 'object-safe'. This should be checked whenever a trait object
 // is created (by casting or coercion, etc.). A trait is object-safe if all its
index 6b0fb8ac71af0479f8b3ab85cc304448da19fac6..ffd99ff2eece081f7390195ea24506fe83ebb302 100644 (file)
@@ -269,7 +269,7 @@ fn add_trait_impl(&self, base_def_id: DefId, impl_def_id: DefId) {
 
     fn get_self_type_for_implementation(&self, impl_did: DefId)
                                         -> TypeScheme<'tcx> {
-        self.crate_context.tcx.tcache.borrow()[impl_did].clone()
+        self.crate_context.tcx.tcache.borrow().get(&impl_did).unwrap().clone()
     }
 
     // Converts an implementation in the AST to a vector of items.
@@ -387,7 +387,7 @@ fn populate_destructor_table(&self) {
         };
 
         for &impl_did in &*trait_impls.borrow() {
-            let items = &(*impl_items)[impl_did];
+            let items = impl_items.get(&impl_did).unwrap();
             if items.len() < 1 {
                 // We'll error out later. For now, just don't ICE.
                 continue;
index 867dea9588568b515c68d7f699b258505e9da37c..e4926b119d5dbe551808b3e8bb2db99d0afd7d12 100644 (file)
@@ -27,55 +27,66 @@ struct UnsafetyChecker<'cx, 'tcx:'cx> {
     tcx: &'cx ty::ctxt<'tcx>
 }
 
-impl<'cx, 'tcx,'v> visit::Visitor<'v> for UnsafetyChecker<'cx, 'tcx> {
-    fn visit_item(&mut self, item: &'v ast::Item) {
-        match item.node {
-            ast::ItemImpl(unsafety, polarity, _, _, _, _) => {
-                match ty::impl_trait_ref(self.tcx, ast_util::local_def(item.id)) {
-                    None => {
-                        // Inherent impl.
-                        match unsafety {
-                            ast::Unsafety::Normal => { /* OK */ }
-                            ast::Unsafety::Unsafe => {
-                                span_err!(self.tcx.sess, item.span, E0197,
-                                    "inherent impls cannot be declared as unsafe");
-                            }
-                        }
+impl<'cx, 'tcx, 'v> UnsafetyChecker<'cx, 'tcx> {
+    fn check_unsafety_coherence(&mut self, item: &'v ast::Item,
+                                unsafety: ast::Unsafety,
+                                polarity: ast::ImplPolarity) {
+        match ty::impl_trait_ref(self.tcx, ast_util::local_def(item.id)) {
+            None => {
+                // Inherent impl.
+                match unsafety {
+                    ast::Unsafety::Normal => { /* OK */ }
+                    ast::Unsafety::Unsafe => {
+                        span_err!(self.tcx.sess, item.span, E0197,
+                                  "inherent impls cannot be declared as unsafe");
                     }
+                }
+            }
 
-                    Some(trait_ref) => {
-                        let trait_def = ty::lookup_trait_def(self.tcx, trait_ref.def_id);
-                        match (trait_def.unsafety, unsafety, polarity) {
-                            (ast::Unsafety::Unsafe,
-                             ast::Unsafety::Unsafe, ast::ImplPolarity::Negative) => {
-                                span_err!(self.tcx.sess, item.span, E0198,
-                                    "negative implementations are not unsafe");
-                            }
+            Some(trait_ref) => {
+                let trait_def = ty::lookup_trait_def(self.tcx, trait_ref.def_id);
+                match (trait_def.unsafety, unsafety, polarity) {
+                    (ast::Unsafety::Unsafe,
+                     ast::Unsafety::Unsafe, ast::ImplPolarity::Negative) => {
+                        span_err!(self.tcx.sess, item.span, E0198,
+                                  "negative implementations are not unsafe");
+                    }
 
-                            (ast::Unsafety::Normal, ast::Unsafety::Unsafe, _) => {
-                                span_err!(self.tcx.sess, item.span, E0199,
-                                    "implementing the trait `{}` is not unsafe",
-                                            trait_ref.user_string(self.tcx));
-                            }
+                    (ast::Unsafety::Normal, ast::Unsafety::Unsafe, _) => {
+                        span_err!(self.tcx.sess, item.span, E0199,
+                                  "implementing the trait `{}` is not unsafe",
+                                  trait_ref.user_string(self.tcx));
+                    }
 
-                            (ast::Unsafety::Unsafe,
-                             ast::Unsafety::Normal, ast::ImplPolarity::Positive) => {
-                                span_err!(self.tcx.sess, item.span, E0200,
-                                    "the trait `{}` requires an `unsafe impl` declaration",
-                                            trait_ref.user_string(self.tcx));
-                            }
+                    (ast::Unsafety::Unsafe,
+                     ast::Unsafety::Normal, ast::ImplPolarity::Positive) => {
+                        span_err!(self.tcx.sess, item.span, E0200,
+                                  "the trait `{}` requires an `unsafe impl` declaration",
+                                  trait_ref.user_string(self.tcx));
+                    }
 
-                            (ast::Unsafety::Unsafe,
-                             ast::Unsafety::Normal, ast::ImplPolarity::Negative) |
-                            (ast::Unsafety::Unsafe,
-                             ast::Unsafety::Unsafe, ast::ImplPolarity::Positive) |
-                            (ast::Unsafety::Normal, ast::Unsafety::Normal, _) => {
-                                /* OK */
-                            }
-                        }
+                    (ast::Unsafety::Unsafe,
+                     ast::Unsafety::Normal, ast::ImplPolarity::Negative) |
+                    (ast::Unsafety::Unsafe,
+                     ast::Unsafety::Unsafe, ast::ImplPolarity::Positive) |
+                    (ast::Unsafety::Normal, ast::Unsafety::Normal, _) => {
+                        /* OK */
                     }
                 }
             }
+        }
+    }
+}
+
+impl<'cx, 'tcx,'v> visit::Visitor<'v> for UnsafetyChecker<'cx, 'tcx> {
+    fn visit_item(&mut self, item: &'v ast::Item) {
+        match item.node {
+            ast::ItemDefaultImpl(unsafety, _) => {
+                self.check_unsafety_coherence(item, unsafety, ast::ImplPolarity::Positive);
+            }
+            ast::ItemImpl(unsafety, polarity, _, _, _, _) => {
+                self.check_unsafety_coherence(item, unsafety, polarity);
+            }
             _ => { }
         }
 
index 97cc3ac7c48a78aa2a79c1051be851fbf0e93b5e..5816fe58bc9b1b25948ae56670bb2032fb94470e 100644 (file)
@@ -194,7 +194,7 @@ fn icx(&'a self, param_bounds: &'a GetTypeParameterBounds<'tcx>) -> ItemCtxt<'a,
 
     fn method_ty(&self, method_id: ast::NodeId) -> Rc<ty::Method<'tcx>> {
         let def_id = local_def(method_id);
-        match self.tcx.impl_or_trait_items.borrow()[def_id] {
+        match *self.tcx.impl_or_trait_items.borrow().get(&def_id).unwrap() {
             ty::MethodTraitItem(ref mty) => mty.clone(),
             ty::TypeTraitItem(..) => {
                 self.tcx.sess.bug(&format!("method with id {} has the wrong type", method_id));
@@ -545,7 +545,7 @@ fn is_param<'tcx>(tcx: &ty::ctxt<'tcx>,
                   -> bool
 {
     if let ast::TyPath(None, _) = ast_ty.node {
-        let path_res = tcx.def_map.borrow()[ast_ty.id];
+        let path_res = *tcx.def_map.borrow().get(&ast_ty.id).unwrap();
         match path_res.base_def {
             def::DefSelfTy(node_id) =>
                 path_res.depth == 0 && node_id == param_id,
@@ -690,7 +690,7 @@ fn convert_field<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
     }
 }
 
-fn convert_associated_type<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
+fn as_refsociated_type<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
                                      container: ImplOrTraitItemContainer,
                                      ident: ast::Ident,
                                      id: ast::NodeId,
@@ -784,14 +784,15 @@ fn convert_item(ccx: &CrateCtxt, it: &ast::Item) {
                                    &enum_definition.variants);
         },
         ast::ItemDefaultImpl(_, ref ast_trait_ref) => {
-            let trait_ref = astconv::instantiate_trait_ref(&ccx.icx(&()),
-                                                           &ExplicitRscope,
-                                                           ast_trait_ref,
-                                                           Some(it.id),
-                                                           None,
-                                                           None);
+            let trait_ref =
+                astconv::instantiate_mono_trait_ref(&ccx.icx(&()),
+                                                    &ExplicitRscope,
+                                                    ast_trait_ref,
+                                                    None);
 
             ty::record_trait_has_default_impl(tcx, trait_ref.def_id);
+
+            tcx.impl_trait_refs.borrow_mut().insert(it.id, trait_ref);
         }
         ast::ItemImpl(_, _,
                       ref generics,
@@ -835,7 +836,7 @@ fn convert_item(ccx: &CrateCtxt, it: &ast::Item) {
                                               "associated items are not allowed in inherent impls");
                         }
 
-                        convert_associated_type(ccx, ImplContainer(local_def(it.id)),
+                        as_refsociated_type(ccx, ImplContainer(local_def(it.id)),
                                                 impl_item.ident, impl_item.id, impl_item.vis);
 
                         let typ = ccx.icx(&ty_predicates).to_ty(&ExplicitRscope, ty);
@@ -890,13 +891,14 @@ fn convert_item(ccx: &CrateCtxt, it: &ast::Item) {
                 }
             }
 
-            if let Some(ref trait_ref) = *opt_trait_ref {
-                astconv::instantiate_trait_ref(&ccx.icx(&ty_predicates),
-                                               &ExplicitRscope,
-                                               trait_ref,
-                                               Some(it.id),
-                                               Some(selfty),
-                                               None);
+            if let Some(ref ast_trait_ref) = *opt_trait_ref {
+                let trait_ref =
+                    astconv::instantiate_mono_trait_ref(&ccx.icx(&ty_predicates),
+                                                        &ExplicitRscope,
+                                                        ast_trait_ref,
+                                                        Some(selfty));
+
+                tcx.impl_trait_refs.borrow_mut().insert(it.id, trait_ref);
             }
 
             enforce_impl_ty_params_are_constrained(tcx,
@@ -917,7 +919,7 @@ fn convert_item(ccx: &CrateCtxt, it: &ast::Item) {
                 match trait_item.node {
                     ast::MethodTraitItem(..) => {}
                     ast::TypeTraitItem(..) => {
-                        convert_associated_type(ccx, TraitContainer(local_def(it.id)),
+                        as_refsociated_type(ccx, TraitContainer(local_def(it.id)),
                                                 trait_item.ident, trait_item.id, ast::Public);
                     }
                 }
@@ -1040,9 +1042,13 @@ fn convert_struct<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
                 tcx.predicates.borrow_mut().insert(local_def(ctor_id), predicates);
             } else if struct_def.fields[0].node.kind.is_unnamed() {
                 // Tuple-like.
-                let inputs: Vec<_> = struct_def.fields.iter().map(
-                        |field| (*tcx.tcache.borrow())[
-                            local_def(field.node.id)].ty).collect();
+                let inputs: Vec<_> =
+                    struct_def.fields
+                              .iter()
+                              .map(|field| tcx.tcache.borrow().get(&local_def(field.node.id))
+                                                              .unwrap()
+                                                              .ty)
+                              .collect();
                 let ctor_fn_ty = ty::mk_ctor_fn(tcx,
                                                 local_def(ctor_id),
                                                 &inputs[..],
@@ -1987,7 +1993,7 @@ fn conv_param_bounds<'a,'tcx>(astconv: &AstConv<'tcx>,
         builtin_bounds,
         trait_bounds,
         region_bounds
-    } = astconv::partition_bounds(tcx, span, ast_bounds.as_slice());
+    } = astconv::partition_bounds(tcx, span, &ast_bounds);
 
     let mut projection_bounds = Vec::new();
 
index 6bdfb17ec1c44c7032bcab09b686d2502e0ef4c1..4e7e63a5d7779a6787e1d732aa67e22646ecdbe1 100644 (file)
@@ -80,7 +80,6 @@
 #![feature(collections)]
 #![feature(core)]
 #![feature(int_uint)]
-#![feature(std_misc)]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(rustc_private)]
index 421549f8b7ecb8ab838ed60dfeec7ea940299e39..41e05ff5162cfca0e849b00ca76d13f981572a2e 100644 (file)
@@ -188,7 +188,7 @@ fn clean(&self, cx: &DocContext) -> Crate {
 
         let src = match cx.input {
             Input::File(ref path) => path.clone(),
-            Input::Str(_) => PathBuf::new("") // FIXME: this is wrong
+            Input::Str(_) => PathBuf::new() // FIXME: this is wrong
         };
 
         Crate {
@@ -1322,7 +1322,8 @@ pub enum Type {
     /// For parameterized types, so the consumer of the JSON don't go
     /// looking for types which don't exist anywhere.
     Generic(String),
-    /// Primitives are just the fixed-size numeric types (plus int/uint/float), and char.
+    /// Primitives are the fixed-size numeric types (plus int/uint/float), char,
+    /// arrays, slices, and tuples.
     Primitive(PrimitiveType),
     /// extern "ABI" fn
     BareFunction(Box<BareFunctionDecl>),
@@ -1362,6 +1363,7 @@ pub enum PrimitiveType {
     Bool,
     Str,
     Slice,
+    Array,
     PrimitiveTuple,
 }
 
@@ -1396,6 +1398,7 @@ fn from_str(s: &str) -> Option<PrimitiveType> {
             "str" => Some(Str),
             "f32" => Some(F32),
             "f64" => Some(F64),
+            "array" => Some(Array),
             "slice" => Some(Slice),
             "tuple" => Some(PrimitiveTuple),
             _ => None,
@@ -1440,6 +1443,7 @@ pub fn to_string(&self) -> &'static str {
             Str => "str",
             Bool => "bool",
             Char => "char",
+            Array => "array",
             Slice => "slice",
             PrimitiveTuple => "tuple",
         }
index c2b6c940caea29291b36fa179c28d706e05b315c..57cb87e1b2d011fb7a4c08147bfc1a491e687f8c 100644 (file)
@@ -47,7 +47,7 @@ pub fn load_string(input: &Path) -> io::Result<Option<String>> {
 macro_rules! load_or_return {
     ($input: expr, $cant_read: expr, $not_utf8: expr) => {
         {
-            let input = PathBuf::new($input);
+            let input = PathBuf::from(&$input[..]);
             match ::externalfiles::load_string(&input) {
                 Err(e) => {
                     let _ = writeln!(&mut io::stderr(),
index 03a2d708ee43aa5b742c2efc9c19aacdf4764ecf..df6beab0f5832ebc75bbfdf62fbd0b6a412bbeef 100644 (file)
@@ -290,7 +290,7 @@ fn resolved_path(w: &mut fmt::Formatter, did: ast::DefId, p: &clean::Path,
             if ast_util::is_local(did) || cache.inlined.contains(&did) {
                 Some(repeat("../").take(loc.len()).collect::<String>())
             } else {
-                match cache.extern_locations[did.krate] {
+                match cache.extern_locations[&did.krate] {
                     render::Remote(ref s) => Some(s.to_string()),
                     render::Local => {
                         Some(repeat("../").take(loc.len()).collect::<String>())
@@ -404,11 +404,11 @@ fn primitive_link(f: &mut fmt::Formatter,
             needs_termination = true;
         }
         Some(&cnum) => {
-            let path = &m.paths[ast::DefId {
+            let path = &m.paths[&ast::DefId {
                 krate: cnum,
                 node: ast::CRATE_NODE_ID,
             }];
-            let loc = match m.extern_locations[cnum] {
+            let loc = match m.extern_locations[&cnum] {
                 render::Remote(ref s) => Some(s.to_string()),
                 render::Local => {
                     let len = CURRENT_LOCATION_KEY.with(|s| s.borrow().len());
@@ -486,7 +486,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
                 primitive_link(f, clean::Slice, &format!("[{}]", **t))
             }
             clean::FixedVector(ref t, ref s) => {
-                primitive_link(f, clean::Slice,
+                primitive_link(f, clean::PrimitiveType::Array,
                                &format!("[{}; {}]", **t, *s))
             }
             clean::Bottom => f.write_str("!"),
index 7ea5bd569e1996df853eeccd1e550b3a6309e49e..cfa84de5ca7c9f37577877f1bc6f38ea347300ca 100644 (file)
@@ -230,7 +230,7 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result {
                         stripped_filtered_line(l).unwrap_or(l)
                     }).collect::<Vec<&str>>().connect("\n");
                     let krate = krate.as_ref().map(|s| &**s);
-                    let test = test::maketest(&test, krate, false, false);
+                    let test = test::maketest(&test, krate, false, false, true);
                     s.push_str(&format!("<span class='rusttest'>{}</span>", Escape(&test)));
                 });
                 s.push_str(&highlight::highlight(&text,
@@ -308,8 +308,8 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result {
         };
         (*((*renderer).opaque as *mut hoedown_html_renderer_state)).opaque
                 = &mut opaque as *mut _ as *mut libc::c_void;
-        (*renderer).blockcode = Some(block as blockcodefn);
-        (*renderer).header = Some(header as headerfn);
+        (*renderer).blockcode = Some(block);
+        (*renderer).header = Some(header);
 
         let document = hoedown_document_new(renderer, HOEDOWN_EXTENSIONS, 16);
         hoedown_document_render(document, ob, s.as_ptr(),
@@ -380,8 +380,8 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) {
     unsafe {
         let ob = hoedown_buffer_new(DEF_OUNIT);
         let renderer = hoedown_html_renderer_new(0, 0);
-        (*renderer).blockcode = Some(block as blockcodefn);
-        (*renderer).header = Some(header as headerfn);
+        (*renderer).blockcode = Some(block);
+        (*renderer).header = Some(header);
         (*((*renderer).opaque as *mut hoedown_html_renderer_state)).opaque
                 = tests as *mut _ as *mut libc::c_void;
 
@@ -501,10 +501,10 @@ pub fn plain_summary_line(md: &str) -> String {
     unsafe {
         let ob = hoedown_buffer_new(DEF_OUNIT);
         let mut plain_renderer: hoedown_renderer = ::std::mem::zeroed();
-        let renderer = &mut plain_renderer as *mut hoedown_renderer;
+        let renderer: *mut hoedown_renderer = &mut plain_renderer;
         (*renderer).opaque = ob as *mut libc::c_void;
-        (*renderer).link = Some(link as linkfn);
-        (*renderer).normal_text = Some(normal_text as normaltextfn);
+        (*renderer).link = Some(link);
+        (*renderer).normal_text = Some(normal_text);
 
         let document = hoedown_document_new(renderer, HOEDOWN_EXTENSIONS, 16);
         hoedown_document_render(document, ob, md.as_ptr(),
index 81daac7b90f0d018fb86ed71288a9f088ce8fffe..d57739c4002494165c4f48cf4fbc7abbce720425 100644 (file)
@@ -300,7 +300,7 @@ pub fn run(mut krate: clean::Crate,
            passes: HashSet<String>) -> io::Result<()> {
     let src_root = match krate.src.parent() {
         Some(p) => p.to_path_buf(),
-        None => PathBuf::new(""),
+        None => PathBuf::new(),
     };
     let mut cx = Context {
         dst: dst,
@@ -784,7 +784,7 @@ fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
 impl<'a> SourceCollector<'a> {
     /// Renders the given filename into its corresponding HTML source file.
     fn emit_source(&mut self, filename: &str) -> io::Result<()> {
-        let p = PathBuf::new(filename);
+        let p = PathBuf::from(filename);
 
         // If we couldn't open this file, then just returns because it
         // probably means that it's some standard library macro thing and we
@@ -819,7 +819,7 @@ fn emit_source(&mut self, filename: &str) -> io::Result<()> {
         let mut fname = p.file_name().expect("source has no filename")
                          .to_os_string();
         fname.push(".html");
-        cur.push(&fname);
+        cur.push(&fname[..]);
         let mut w = BufWriter::new(try!(File::create(&cur)));
 
         let title = format!("{} -- source", cur.file_name().unwrap()
@@ -1026,7 +1026,8 @@ fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
                 match item {
                     clean::Item{ attrs, inner: clean::ImplItem(i), .. } => {
                         use clean::{Primitive, Vector, ResolvedPath, BorrowedRef};
-                        use clean::{FixedVector, Slice, Tuple, PrimitiveTuple};
+                        use clean::PrimitiveType::{Array, Slice, PrimitiveTuple};
+                        use clean::{FixedVector, Tuple};
 
                         // extract relevant documentation for this impl
                         let dox = match attrs.into_iter().find(|a| {
@@ -1056,12 +1057,16 @@ fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
                                 Some(ast_util::local_def(p.to_node_id()))
                             }
 
-                            // In a DST world, we may only need
-                            // Vector/FixedVector, but for now we also pick up
-                            // borrowed references
-                            Vector(..) | FixedVector(..) |
-                                BorrowedRef{ type_: box Vector(..), ..  } |
-                                BorrowedRef{ type_: box FixedVector(..), .. } =>
+                            FixedVector(..) |
+                                BorrowedRef { type_: box FixedVector(..), .. } =>
+                            {
+                                Some(ast_util::local_def(Array.to_node_id()))
+                            }
+
+                            // In a DST world, we may only need Vector, but for now we
+                            // also pick up borrowed references
+                            Vector(..) |
+                                BorrowedRef{ type_: box Vector(..), ..  } =>
                             {
                                 Some(ast_util::local_def(Slice.to_node_id()))
                             }
@@ -1404,8 +1409,8 @@ fn href(&self, cx: &Context) -> Option<String> {
         // located, then we return `None`.
         } else {
             let cache = cache();
-            let path = &cache.external_paths[self.item.def_id];
-            let root = match cache.extern_locations[self.item.def_id.krate] {
+            let path = &cache.external_paths[&self.item.def_id];
+            let root = match cache.extern_locations[&self.item.def_id.krate] {
                 Remote(ref s) => s.to_string(),
                 Local => self.cx.root_path.clone(),
                 Unknown => return None,
@@ -1863,7 +1868,7 @@ fn trait_item(w: &mut fmt::Formatter, m: &clean::Item)
                 path = if ast_util::is_local(it.def_id) {
                     cx.current.connect("/")
                 } else {
-                    let path = &cache.external_paths[it.def_id];
+                    let path = &cache.external_paths[&it.def_id];
                     path[..path.len() - 1].connect("/")
                 },
                 ty = shortty(it).to_static_str(),
index d747ed3f119c2df095e443daefd785696bc11d0f..9f1d876432c389c55cdf55e6c8d18f1fb25dfda5 100644 (file)
@@ -38,6 +38,7 @@
 #![feature(file_path)]
 #![feature(path_ext)]
 #![feature(path_relative_from)]
+#![feature(convert)]
 
 extern crate arena;
 extern crate getopts;
@@ -51,6 +52,7 @@
 extern crate serialize;
 extern crate syntax;
 extern crate "test" as testing;
+extern crate unicode;
 #[macro_use] extern crate log;
 
 extern crate "serialize" as rustc_serialize; // used by deriving
@@ -251,7 +253,7 @@ pub fn main_args(args: &[String]) -> int {
     let should_test = matches.opt_present("test");
     let markdown_input = input.ends_with(".md") || input.ends_with(".markdown");
 
-    let output = matches.opt_str("o").map(|s| PathBuf::new(&s));
+    let output = matches.opt_str("o").map(|s| PathBuf::from(&s));
     let cfgs = matches.opt_strs("cfg");
 
     let external_html = match ExternalHtml::load(
@@ -271,7 +273,7 @@ pub fn main_args(args: &[String]) -> int {
             return test::run(input, cfgs, libs, externs, test_args, crate_name)
         }
         (false, true) => return markdown::render(input,
-                                                 output.unwrap_or(PathBuf::new("doc")),
+                                                 output.unwrap_or(PathBuf::from("doc")),
                                                  &matches, &external_html,
                                                  !matches.opt_present("markdown-no-toc")),
         (false, false) => {}
@@ -289,7 +291,7 @@ pub fn main_args(args: &[String]) -> int {
     match matches.opt_str("w").as_ref().map(|s| &**s) {
         Some("html") | None => {
             match html::render::run(krate, &external_html,
-                                    output.unwrap_or(PathBuf::new("doc")),
+                                    output.unwrap_or(PathBuf::from("doc")),
                                     passes.into_iter().collect()) {
                 Ok(()) => {}
                 Err(e) => panic!("failed to generate documentation: {}", e),
@@ -297,7 +299,7 @@ pub fn main_args(args: &[String]) -> int {
         }
         Some("json") => {
             match json_output(krate, json_plugins,
-                              output.unwrap_or(PathBuf::new("doc.json"))) {
+                              output.unwrap_or(PathBuf::from("doc.json"))) {
                 Ok(()) => {}
                 Err(e) => panic!("failed to write json: {}", e),
             }
@@ -376,7 +378,7 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche
     let cfgs = matches.opt_strs("cfg");
     let triple = matches.opt_str("target");
 
-    let cr = PathBuf::new(cratefile);
+    let cr = PathBuf::from(cratefile);
     info!("starting to run rustc");
 
     let (tx, rx) = channel();
index 09b4915222b3902ec3c6d49ea904a1be381fb2ca..f3d7ae19f4d3c1f978000636c5bf765381698e6e 100644 (file)
@@ -143,7 +143,7 @@ pub fn test(input: &str, libs: SearchPaths, externs: core::Externs,
             mut test_args: Vec<String>) -> int {
     let input_str = load_or_return!(input, 1, 2);
 
-    let mut collector = Collector::new(input.to_string(), libs, externs, true);
+    let mut collector = Collector::new(input.to_string(), libs, externs, true, false);
     find_testable_code(&input_str, &mut collector);
     test_args.insert(0, "rustdoctest".to_string());
     testing::test_main(&test_args, collector.tests);
index e2f8a6f82c6442df51e271223ddc4e82b91fa95b..7b37a5a9d1c8167e6fd19f3f60aa1222b291cc47 100644 (file)
@@ -46,7 +46,7 @@ pub fn run(input: &str,
            mut test_args: Vec<String>,
            crate_name: Option<String>)
            -> int {
-    let input_path = PathBuf::new(input);
+    let input_path = PathBuf::from(input);
     let input = config::Input::File(input_path.clone());
 
     let sessopts = config::Options {
@@ -76,6 +76,8 @@ pub fn run(input: &str,
                                                      "rustdoc-test", None)
         .expect("phase_2_configure_and_expand aborted in rustdoc!");
 
+    let inject_crate = should_inject_crate(&krate);
+
     let ctx = core::DocContext {
         krate: &krate,
         maybe_typed: core::NotTyped(sess),
@@ -100,7 +102,8 @@ pub fn run(input: &str,
     let mut collector = Collector::new(krate.name.to_string(),
                                        libs,
                                        externs,
-                                       false);
+                                       false,
+                                       inject_crate);
     collector.fold_crate(krate);
 
     test_args.insert(0, "rustdoctest".to_string());
@@ -110,13 +113,42 @@ pub fn run(input: &str,
     0
 }
 
+// Look for #![doc(test(no_crate_inject))], used by crates in the std facade
+fn should_inject_crate(krate: &::syntax::ast::Crate) -> bool {
+    use syntax::attr::AttrMetaMethods;
+
+    let mut inject_crate = true;
+
+    for attr in &krate.attrs {
+        if attr.check_name("doc") {
+            for list in attr.meta_item_list().into_iter() {
+                for attr in list {
+                    if attr.check_name("test") {
+                        for list in attr.meta_item_list().into_iter() {
+                            for attr in list {
+                                if attr.check_name("no_crate_inject") {
+                                    inject_crate = false;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    return inject_crate;
+}
+
 #[allow(deprecated)]
 fn runtest(test: &str, cratename: &str, libs: SearchPaths,
            externs: core::Externs,
-           should_panic: bool, no_run: bool, as_test_harness: bool) {
+           should_panic: bool, no_run: bool, as_test_harness: bool,
+           inject_crate: bool) {
     // the test harness wants its own `main` & top level functions, so
     // never wrap the test in `fn main() { ... }`
-    let test = maketest(test, Some(cratename), true, as_test_harness);
+    let test = maketest(test, Some(cratename), true, as_test_harness,
+                        inject_crate);
     let input = config::Input::Str(test.to_string());
 
     let sessopts = config::Options {
@@ -218,8 +250,16 @@ fn drop(&mut self) {
     }
 }
 
-pub fn maketest(s: &str, cratename: Option<&str>, lints: bool, dont_insert_main: bool) -> String {
+pub fn maketest(s: &str, cratename: Option<&str>, lints: bool,
+                dont_insert_main: bool, inject_crate: bool) -> String {
+    let (crate_attrs, everything_else) = partition_source(s);
+
     let mut prog = String::new();
+
+    // First push any outer attributes from the example, assuming they
+    // are intended to be crate attributes.
+    prog.push_str(&crate_attrs);
+
     if lints {
         prog.push_str(r"
 #![allow(unused_variables, unused_assignments, unused_mut, unused_attributes, dead_code)]
@@ -228,7 +268,7 @@ pub fn maketest(s: &str, cratename: Option<&str>, lints: bool, dont_insert_main:
 
     // Don't inject `extern crate std` because it's already injected by the
     // compiler.
-    if !s.contains("extern crate") && cratename != Some("std") {
+    if !s.contains("extern crate") && inject_crate {
         match cratename {
             Some(cratename) => {
                 if s.contains(cratename) {
@@ -240,16 +280,42 @@ pub fn maketest(s: &str, cratename: Option<&str>, lints: bool, dont_insert_main:
         }
     }
     if dont_insert_main || s.contains("fn main") {
-        prog.push_str(s);
+        prog.push_str(&everything_else);
     } else {
         prog.push_str("fn main() {\n    ");
-        prog.push_str(&s.replace("\n", "\n    "));
+        prog.push_str(&everything_else.replace("\n", "\n    "));
         prog.push_str("\n}");
     }
 
+    info!("final test program: {}", prog);
+
     return prog
 }
 
+fn partition_source(s: &str) -> (String, String) {
+    use unicode::str::UnicodeStr;
+
+    let mut after_header = false;
+    let mut before = String::new();
+    let mut after = String::new();
+
+    for line in s.lines() {
+        let trimline = line.trim();
+        let header = trimline.is_whitespace() ||
+            trimline.starts_with("#![feature");
+        if !header || after_header {
+            after_header = true;
+            after.push_str(line);
+            after.push_str("\n");
+        } else {
+            before.push_str(line);
+            before.push_str("\n");
+        }
+    }
+
+    return (before, after);
+}
+
 pub struct Collector {
     pub tests: Vec<testing::TestDescAndFn>,
     names: Vec<String>,
@@ -259,11 +325,12 @@ pub struct Collector {
     use_headers: bool,
     current_header: Option<String>,
     cratename: String,
+    inject_crate: bool
 }
 
 impl Collector {
     pub fn new(cratename: String, libs: SearchPaths, externs: core::Externs,
-               use_headers: bool) -> Collector {
+               use_headers: bool, inject_crate: bool) -> Collector {
         Collector {
             tests: Vec::new(),
             names: Vec::new(),
@@ -273,11 +340,13 @@ pub fn new(cratename: String, libs: SearchPaths, externs: core::Externs,
             use_headers: use_headers,
             current_header: None,
             cratename: cratename,
+            inject_crate: inject_crate
         }
     }
 
     pub fn add_test(&mut self, test: String,
-                    should_panic: bool, no_run: bool, should_ignore: bool, as_test_harness: bool) {
+                    should_panic: bool, no_run: bool, should_ignore: bool,
+                    as_test_harness: bool) {
         let name = if self.use_headers {
             let s = self.current_header.as_ref().map(|s| &**s).unwrap_or("");
             format!("{}_{}", s, self.cnt)
@@ -288,6 +357,7 @@ pub fn add_test(&mut self, test: String,
         let libs = self.libs.clone();
         let externs = self.externs.clone();
         let cratename = self.cratename.to_string();
+        let inject_crate = self.inject_crate;
         debug!("Creating test {}: {}", name, test);
         self.tests.push(testing::TestDescAndFn {
             desc: testing::TestDesc {
@@ -302,7 +372,8 @@ pub fn add_test(&mut self, test: String,
                         externs,
                         should_panic,
                         no_run,
-                        as_test_harness);
+                        as_test_harness,
+                        inject_crate);
             }))
         });
     }
index d53954b29b585422bc3305b821476fa41e8e45e8..11e10cc2aa7a16cf004fdb8933d7e47283df978d 100644 (file)
@@ -196,7 +196,7 @@ fn resolve_id(&mut self, id: ast::NodeId, renamed: Option<ast::Ident>,
             Some(tcx) => tcx,
             None => return false
         };
-        let def = tcx.def_map.borrow()[id].def_id();
+        let def = tcx.def_map.borrow()[&id].def_id();
         if !ast_util::is_local(def) { return false }
         let analysis = match self.analysis {
             Some(analysis) => analysis, None => return false
index 1f8d45a007d2b19864febe22d2780bf3198c6188..e42aa1835dc4466e46e6429eaa292b801267bd54 100644 (file)
@@ -32,6 +32,7 @@ impl ToHex for [u8] {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(rustc_private)]
     /// extern crate serialize;
     /// use serialize::hex::ToHex;
     ///
@@ -101,6 +102,7 @@ impl FromHex for str {
     /// This converts a string literal to hexadecimal and back.
     ///
     /// ```
+    /// # #![feature(rustc_private)]
     /// extern crate serialize;
     /// use serialize::hex::{FromHex, ToHex};
     ///
index 096c72e6af2db0fb660c0002aa43c288d5dfe524..0d6ed91d5298139b1cdf5800d3e6ac20c08aaab4 100644 (file)
@@ -1218,6 +1218,7 @@ pub fn as_null(&self) -> Option<()> {
     }
 }
 
+#[cfg(stage0)]
 impl<'a> Index<&'a str>  for Json {
     type Output = Json;
 
@@ -1226,6 +1227,16 @@ fn index(&self, idx: & &str) -> &Json {
     }
 }
 
+#[cfg(not(stage0))]
+impl<'a> Index<&'a str>  for Json {
+    type Output = Json;
+
+    fn index(&self, idx: &'a str) -> &Json {
+        self.find(idx).unwrap()
+    }
+}
+
+#[cfg(stage0)]
 impl Index<uint> for Json {
     type Output = Json;
 
@@ -1237,6 +1248,18 @@ fn index<'a>(&'a self, idx: &uint) -> &'a Json {
     }
 }
 
+#[cfg(not(stage0))]
+impl Index<uint> for Json {
+    type Output = Json;
+
+    fn index<'a>(&'a self, idx: uint) -> &'a Json {
+        match self {
+            &Json::Array(ref v) => &v[idx],
+            _ => panic!("can only index Json with uint if it is an array")
+        }
+    }
+}
+
 /// The output of the streaming parser.
 #[derive(PartialEq, Clone, Debug)]
 pub enum JsonEvent {
@@ -2406,7 +2429,10 @@ pub trait ToJson {
 macro_rules! to_json_impl_i64 {
     ($($t:ty), +) => (
         $(impl ToJson for $t {
-            fn to_json(&self) -> Json { Json::I64(*self as i64) }
+            fn to_json(&self) -> Json {
+                #![allow(trivial_numeric_casts)]
+                Json::I64(*self as i64)
+            }
         })+
     )
 }
@@ -2416,7 +2442,10 @@ fn to_json(&self) -> Json { Json::I64(*self as i64) }
 macro_rules! to_json_impl_u64 {
     ($($t:ty), +) => (
         $(impl ToJson for $t {
-            fn to_json(&self) -> Json { Json::U64(*self as u64) }
+            fn to_json(&self) -> Json {
+                #![allow(trivial_numeric_casts)]
+                Json::U64(*self as u64)
+            }
         })+
     )
 }
index 90cb88046e53d008416577d3934a927888b6dbe9..482e0d1d0eed3739d1bedc6d018d6bd102e9673f 100644 (file)
@@ -37,7 +37,8 @@
 #![feature(std_misc)]
 #![feature(unicode)]
 #![feature(str_char)]
-#![cfg_attr(test, feature(test))]
+#![feature(convert)]
+#![cfg_attr(test, feature(test, old_io))]
 
 // test harness access
 #[cfg(test)] extern crate test;
index 71f9e01706dab1eb2d93f2207d86fd1546c234dd..5e9baa9b9e903557236e407db817a01b0790fe3b 100644 (file)
@@ -579,7 +579,7 @@ fn encode<S: Encoder>(&self, e: &mut S) -> Result<(), S::Error> {
 impl Decodable for path::PathBuf {
     fn decode<D: Decoder>(d: &mut D) -> Result<path::PathBuf, D::Error> {
         let bytes: String = try!(Decodable::decode(d));
-        Ok(path::PathBuf::new(&bytes))
+        Ok(path::PathBuf::from(bytes))
     }
 }
 
diff --git a/src/libstd/array.rs b/src/libstd/array.rs
new file mode 100644 (file)
index 0000000..a6b8cd7
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! The fixed-size array type (`[T; n]`).
+
+#![doc(primitive = "array")]
index 9139e182ce479594ba38b0ccc132a33f2f9b98a5..f9558b85825d2ee03ebacde2850aa347441a4d3e 100644 (file)
@@ -538,6 +538,7 @@ impl<K, V, S> HashMap<K, V, S>
     /// # Examples
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::collections::HashMap;
     /// use std::collections::hash_map::RandomState;
     ///
@@ -566,6 +567,7 @@ pub fn with_hash_state(hash_state: S) -> HashMap<K, V, S> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::collections::HashMap;
     /// use std::collections::hash_map::RandomState;
     ///
@@ -981,6 +983,7 @@ pub fn is_empty(&self) -> bool { self.len() == 0 }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::collections::HashMap;
     ///
     /// let mut a = HashMap::new();
@@ -1088,7 +1091,7 @@ pub fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool
     ///     Some(x) => *x = "b",
     ///     None => (),
     /// }
-    /// assert_eq!(map[1], "b");
+    /// assert_eq!(map[&1], "b");
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn get_mut<Q: ?Sized>(&mut self, k: &Q) -> Option<&mut V>
@@ -1111,7 +1114,7 @@ pub fn get_mut<Q: ?Sized>(&mut self, k: &Q) -> Option<&mut V>
     ///
     /// map.insert(37, "b");
     /// assert_eq!(map.insert(37, "c"), Some("b"));
-    /// assert_eq!(map[37], "c");
+    /// assert_eq!(map[&37], "c");
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn insert(&mut self, k: K, v: V) -> Option<V> {
@@ -1244,6 +1247,7 @@ fn default() -> HashMap<K, V, S> {
     }
 }
 
+#[cfg(stage0)]
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<K, Q: ?Sized, V, S> Index<Q> for HashMap<K, V, S>
     where K: Eq + Hash + Borrow<Q>,
@@ -1258,6 +1262,21 @@ fn index<'a>(&'a self, index: &Q) -> &'a V {
     }
 }
 
+#[cfg(not(stage0))]
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a, K, Q: ?Sized, V, S> Index<&'a Q> for HashMap<K, V, S>
+    where K: Eq + Hash + Borrow<Q>,
+          Q: Eq + Hash,
+          S: HashState,
+{
+    type Output = V;
+
+    #[inline]
+    fn index(&self, index: &Q) -> &V {
+        self.get(index).expect("no entry found for key")
+    }
+}
+
 /// HashMap iterator.
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct Iter<'a, K: 'a, V: 'a> {
@@ -1323,15 +1342,13 @@ pub struct Drain<'a, K: 'a, V: 'a> {
 }
 
 /// A view into a single occupied location in a HashMap.
-#[unstable(feature = "std_misc",
-           reason = "precise API still being fleshed out")]
+#[stable(feature = "rust1", since = "1.0.0")]
 pub struct OccupiedEntry<'a, K: 'a, V: 'a> {
     elem: FullBucket<K, V, &'a mut RawTable<K, V>>,
 }
 
 /// A view into a single empty location in a HashMap.
-#[unstable(feature = "std_misc",
-           reason = "precise API still being fleshed out")]
+#[stable(feature = "rust1", since = "1.0.0")]
 pub struct VacantEntry<'a, K: 'a, V: 'a> {
     hash: SafeHash,
     key: K,
@@ -1339,12 +1356,14 @@ pub struct VacantEntry<'a, K: 'a, V: 'a> {
 }
 
 /// A view into a single location in a map, which may be vacant or occupied.
-#[unstable(feature = "std_misc",
-           reason = "precise API still being fleshed out")]
+#[stable(feature = "rust1", since = "1.0.0")]
 pub enum Entry<'a, K: 'a, V: 'a> {
     /// An occupied Entry.
+    #[stable(feature = "rust1", since = "1.0.0")]
     Occupied(OccupiedEntry<'a, K, V>),
+
     /// A vacant Entry.
+    #[stable(feature = "rust1", since = "1.0.0")]
     Vacant(VacantEntry<'a, K, V>),
 }
 
@@ -1465,10 +1484,10 @@ impl<'a, K, V> ExactSizeIterator for Drain<'a, K, V> {
     #[inline] fn len(&self) -> usize { self.inner.len() }
 }
 
-#[unstable(feature = "std_misc",
-           reason = "matches collection reform v2 specification, waiting for dust to settle")]
 impl<'a, K, V> Entry<'a, K, V> {
     /// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant.
+    #[unstable(feature = "std_misc",
+               reason = "will soon be replaced by or_insert")]
     pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, K, V>> {
         match self {
             Occupied(entry) => Ok(entry.into_mut()),
@@ -2185,7 +2204,7 @@ fn test_index() {
         map.insert(2, 1);
         map.insert(3, 4);
 
-        assert_eq!(map[2], 1);
+        assert_eq!(map[&2], 1);
     }
 
     #[test]
@@ -2197,7 +2216,7 @@ fn test_index_nonexistent() {
         map.insert(2, 1);
         map.insert(3, 4);
 
-        map[4];
+        map[&4];
     }
 
     #[test]
index de3f080de829651d6b8d7b87db99ecddf263f739..0933b4f662a9d744fbec130c491ea1d842e3d944 100644 (file)
@@ -145,6 +145,7 @@ impl<T, S> HashSet<T, S>
     /// # Examples
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::collections::HashSet;
     /// use std::collections::hash_map::RandomState;
     ///
@@ -169,6 +170,7 @@ pub fn with_hash_state(hash_state: S) -> HashSet<T, S> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::collections::HashSet;
     /// use std::collections::hash_map::RandomState;
     ///
@@ -295,6 +297,7 @@ fn first<A, B>((a, _): (A, B)) -> A { a }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::HashSet;
     /// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect();
     /// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect();
@@ -325,6 +328,7 @@ pub fn difference<'a>(&'a self, other: &'a HashSet<T, S>) -> Difference<'a, T, S
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::HashSet;
     /// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect();
     /// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect();
@@ -351,6 +355,7 @@ pub fn symmetric_difference<'a>(&'a self, other: &'a HashSet<T, S>)
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::HashSet;
     /// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect();
     /// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect();
@@ -376,6 +381,7 @@ pub fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a,
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::HashSet;
     /// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect();
     /// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect();
@@ -458,6 +464,7 @@ pub fn clear(&mut self) { self.map.clear() }
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::HashSet;
     ///
     /// let set: HashSet<_> = [1, 2, 3].iter().cloned().collect();
@@ -477,6 +484,7 @@ pub fn contains<Q: ?Sized>(&self, value: &Q) -> bool
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::HashSet;
     ///
     /// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect();
@@ -498,6 +506,7 @@ pub fn is_disjoint(&self, other: &HashSet<T, S>) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::HashSet;
     ///
     /// let sup: HashSet<_> = [1, 2, 3].iter().cloned().collect();
@@ -519,6 +528,7 @@ pub fn is_subset(&self, other: &HashSet<T, S>) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::collections::HashSet;
     ///
     /// let sub: HashSet<_> = [1, 2].iter().cloned().collect();
@@ -853,6 +863,9 @@ fn into_iter(self) -> IntoIter<T> {
     }
 }
 
+impl<'a, K> Clone for Iter<'a, K> {
+    fn clone(&self) -> Iter<'a, K> { Iter { iter: self.iter.clone() } }
+}
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, K> Iterator for Iter<'a, K> {
     type Item = &'a K;
@@ -889,6 +902,12 @@ impl<'a, K> ExactSizeIterator for Drain<'a, K> {
     fn len(&self) -> usize { self.iter.len() }
 }
 
+impl<'a, T, S> Clone for Intersection<'a, T, S> {
+    fn clone(&self) -> Intersection<'a, T, S> {
+        Intersection { iter: self.iter.clone(), ..*self }
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T, S> Iterator for Intersection<'a, T, S>
     where T: Eq + Hash, S: HashState
@@ -912,6 +931,12 @@ fn size_hint(&self) -> (usize, Option<usize>) {
     }
 }
 
+impl<'a, T, S> Clone for Difference<'a, T, S> {
+    fn clone(&self) -> Difference<'a, T, S> {
+        Difference { iter: self.iter.clone(), ..*self }
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T, S> Iterator for Difference<'a, T, S>
     where T: Eq + Hash, S: HashState
@@ -935,6 +960,12 @@ fn size_hint(&self) -> (usize, Option<usize>) {
     }
 }
 
+impl<'a, T, S> Clone for SymmetricDifference<'a, T, S> {
+    fn clone(&self) -> SymmetricDifference<'a, T, S> {
+        SymmetricDifference { iter: self.iter.clone() }
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T, S> Iterator for SymmetricDifference<'a, T, S>
     where T: Eq + Hash, S: HashState
@@ -945,6 +976,10 @@ fn next(&mut self) -> Option<&'a T> { self.iter.next() }
     fn size_hint(&self) -> (usize, Option<usize>) { self.iter.size_hint() }
 }
 
+impl<'a, T, S> Clone for Union<'a, T, S> {
+    fn clone(&self) -> Union<'a, T, S> { Union { iter: self.iter.clone() } }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T, S> Iterator for Union<'a, T, S>
     where T: Eq + Hash, S: HashState
index caada8ae50f74aa30a4f0c7373674ddbb5ad191b..8d24f6b191659f622aa6379aa4dc968ed8a2e499 100644 (file)
 //! #### Counting the number of times each character in a string occurs
 //!
 //! ```
+//! # #![feature(collections)]
 //! use std::collections::btree_map::{BTreeMap, Entry};
 //!
 //! let mut count = BTreeMap::new();
 //! #### Tracking the inebriation of customers at a bar
 //!
 //! ```
+//! # #![feature(collections)]
 //! use std::collections::btree_map::{BTreeMap, Entry};
 //!
 //! // A client of the bar. They have an id and a blood alcohol level.
index 24882c7f7abfd099c8703909c04c6ed3563247ac..71f072302fb21c8fef6cf1b7a6e55075e0fc8e96 100644 (file)
@@ -23,7 +23,7 @@
 use ffi::{OsString, AsOsStr};
 use fmt;
 use io;
-use path::{AsPath, PathBuf};
+use path::{Path, PathBuf};
 use sync::atomic::{AtomicIsize, ATOMIC_ISIZE_INIT, Ordering};
 use sync::{StaticMutex, MUTEX_INIT};
 use sys::os as os_imp;
@@ -67,8 +67,8 @@ pub fn current_dir() -> io::Result<PathBuf> {
 /// println!("Successfully changed working directory to {}!", root.display());
 /// ```
 #[stable(feature = "env", since = "1.0.0")]
-pub fn set_current_dir<P: AsPath + ?Sized>(p: &P) -> io::Result<()> {
-    os_imp::chdir(p.as_path())
+pub fn set_current_dir<P: AsRef<Path> + ?Sized>(p: &P) -> io::Result<()> {
+    os_imp::chdir(p.as_ref())
 }
 
 static ENV_LOCK: StaticMutex = MUTEX_INIT;
@@ -327,12 +327,13 @@ pub struct JoinPathsError {
 /// # Examples
 ///
 /// ```
+/// # #![feature(convert)]
 /// use std::env;
 /// use std::path::PathBuf;
 ///
 /// if let Some(path) = env::var_os("PATH") {
 ///     let mut paths = env::split_paths(&path).collect::<Vec<_>>();
-///     paths.push(PathBuf::new("/home/xyz/bin"));
+///     paths.push(PathBuf::from("/home/xyz/bin"));
 ///     let new_path = env::join_paths(paths.iter()).unwrap();
 ///     env::set_var("PATH", &new_path);
 /// }
@@ -833,7 +834,7 @@ fn test() {
     fn split_paths_windows() {
         fn check_parse(unparsed: &str, parsed: &[&str]) -> bool {
             split_paths(unparsed).collect::<Vec<_>>() ==
-                parsed.iter().map(|s| PathBuf::new(*s)).collect::<Vec<_>>()
+                parsed.iter().map(|s| PathBuf::from(*s)).collect::<Vec<_>>()
         }
 
         assert!(check_parse("", &mut [""]));
@@ -853,7 +854,7 @@ fn check_parse(unparsed: &str, parsed: &[&str]) -> bool {
     fn split_paths_unix() {
         fn check_parse(unparsed: &str, parsed: &[&str]) -> bool {
             split_paths(unparsed).collect::<Vec<_>>() ==
-                parsed.iter().map(|s| PathBuf::new(*s)).collect::<Vec<_>>()
+                parsed.iter().map(|s| PathBuf::from(*s)).collect::<Vec<_>>()
         }
 
         assert!(check_parse("", &mut [""]));
index fc4f03ff3a54a808d3a28a27a6074a57caa29ddd..8b19d16017280ccce55b6458778101f02c5a81c2 100644 (file)
@@ -10,6 +10,7 @@
 
 #![unstable(feature = "std_misc")]
 
+use convert::Into;
 use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
 use error::{Error, FromError};
 use fmt;
@@ -44,6 +45,7 @@
 /// # Examples
 ///
 /// ```no_run
+/// # #![feature(libc)]
 /// # extern crate libc;
 /// # fn main() {
 /// use std::ffi::CString;
@@ -82,6 +84,7 @@ pub struct CString {
 /// Inspecting a foreign C string
 ///
 /// ```no_run
+/// # #![feature(libc)]
 /// extern crate libc;
 /// use std::ffi::CStr;
 ///
@@ -98,6 +101,7 @@ pub struct CString {
 /// Passing a Rust-originating C string
 ///
 /// ```no_run
+/// # #![feature(libc)]
 /// extern crate libc;
 /// use std::ffi::{CString, CStr};
 ///
@@ -130,6 +134,8 @@ pub struct CStr {
 
 /// A conversion trait used by the constructor of `CString` for types that can
 /// be converted to a vector of bytes.
+#[deprecated(since = "1.0.0", reason = "use std::convert::Into<Vec<u8>> instead")]
+#[unstable(feature = "std_misc")]
 pub trait IntoBytes {
     /// Consumes this container, returning a vector of bytes.
     fn into_bytes(self) -> Vec<u8>;
@@ -144,6 +150,7 @@ impl CString {
     /// # Examples
     ///
     /// ```no_run
+    /// # #![feature(libc)]
     /// extern crate libc;
     /// use std::ffi::CString;
     ///
@@ -163,8 +170,8 @@ impl CString {
     /// internal 0 byte. The error returned will contain the bytes as well as
     /// the position of the nul byte.
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn new<T: IntoBytes>(t: T) -> Result<CString, NulError> {
-        let bytes = t.into_bytes();
+    pub fn new<T: Into<Vec<u8>>>(t: T) -> Result<CString, NulError> {
+        let bytes = t.into();
         match bytes.iter().position(|x| *x == 0) {
             Some(i) => Err(NulError(i, bytes)),
             None => Ok(unsafe { CString::from_vec_unchecked(bytes) }),
@@ -179,6 +186,7 @@ pub fn new<T: IntoBytes>(t: T) -> Result<CString, NulError> {
     /// # Examples
     ///
     /// ```no_run
+    /// # #![feature(libc)]
     /// extern crate libc;
     /// use std::ffi::CString;
     ///
@@ -329,6 +337,7 @@ impl CStr {
     /// # Examples
     ///
     /// ```no_run
+    /// # #![feature(libc)]
     /// # extern crate libc;
     /// # fn main() {
     /// use std::ffi::CStr;
@@ -433,15 +442,19 @@ pub unsafe fn c_str_to_bytes_with_nul<'a>(raw: &'a *const libc::c_char)
     slice::from_raw_parts(*(raw as *const _ as *const *const u8), len as usize)
 }
 
+#[allow(deprecated)]
 impl<'a> IntoBytes for &'a str {
     fn into_bytes(self) -> Vec<u8> { self.as_bytes().to_vec() }
 }
+#[allow(deprecated)]
 impl<'a> IntoBytes for &'a [u8] {
     fn into_bytes(self) -> Vec<u8> { self.to_vec() }
 }
+#[allow(deprecated)]
 impl IntoBytes for String {
     fn into_bytes(self) -> Vec<u8> { self.into_bytes() }
 }
+#[allow(deprecated)]
 impl IntoBytes for Vec<u8> {
     fn into_bytes(self) -> Vec<u8> { self }
 }
index feacbf1e98b81e9fe0e3a9cec8b1975a606041fd..5851c6e2998095923c744da0d01fceeb6556355b 100644 (file)
@@ -63,16 +63,18 @@ pub struct OsStr {
 impl OsString {
     /// Constructs an `OsString` at no cost by consuming a `String`.
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[deprecated(since = "1.0.0", reason = "use `from` instead")]
     pub fn from_string(s: String) -> OsString {
-        OsString { inner: Buf::from_string(s) }
+        OsString::from(s)
     }
 
     /// Constructs an `OsString` by copying from a `&str` slice.
     ///
     /// Equivalent to: `OsString::from_string(String::from_str(s))`.
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[deprecated(since = "1.0.0", reason = "use `from` instead")]
     pub fn from_str(s: &str) -> OsString {
-        OsString { inner: Buf::from_str(s) }
+        OsString::from(s)
     }
 
     /// Constructs a new empty `OsString`.
@@ -98,11 +100,40 @@ pub fn push_os_str(&mut self, s: &OsStr) {
 
     /// Extend the string with the given `&OsStr` slice.
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn push<T: AsOsStr + ?Sized>(&mut self, s: &T) {
-        self.inner.push_slice(&s.as_os_str().inner)
+    pub fn push<T: AsRef<OsStr>>(&mut self, s: T) {
+        self.inner.push_slice(&s.as_ref().inner)
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl From<String> for OsString {
+    fn from(s: String) -> OsString {
+        OsString { inner: Buf::from_string(s) }
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> From<&'a String> for OsString {
+    fn from(s: &'a String) -> OsString {
+        OsString { inner: Buf::from_str(s) }
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> From<&'a str> for OsString {
+    fn from(s: &'a str) -> OsString {
+        OsString { inner: Buf::from_str(s) }
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> From<&'a OsStr> for OsString {
+    fn from(s: &'a OsStr) -> OsString {
+        OsString { inner: s.inner.to_owned() }
     }
 }
 
+#[cfg(stage0)]
 #[stable(feature = "rust1", since = "1.0.0")]
 impl ops::Index<ops::RangeFull> for OsString {
     type Output = OsStr;
@@ -113,6 +144,17 @@ fn index(&self, _index: &ops::RangeFull) -> &OsStr {
     }
 }
 
+#[cfg(not(stage0))]
+#[stable(feature = "rust1", since = "1.0.0")]
+impl ops::Index<ops::RangeFull> for OsString {
+    type Output = OsStr;
+
+    #[inline]
+    fn index(&self, _index: ops::RangeFull) -> &OsStr {
+        unsafe { mem::transmute(self.inner.as_slice()) }
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl ops::Deref for OsString {
     type Target = OsStr;
@@ -316,37 +358,76 @@ fn to_owned(&self) -> OsString { self.to_os_string() }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
+#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
 impl<'a, T: AsOsStr + ?Sized> AsOsStr for &'a T {
     fn as_os_str(&self) -> &OsStr {
         (*self).as_os_str()
     }
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
 impl AsOsStr for OsStr {
     fn as_os_str(&self) -> &OsStr {
         self
     }
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
 impl AsOsStr for OsString {
     fn as_os_str(&self) -> &OsStr {
         &self[..]
     }
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
 impl AsOsStr for str {
     fn as_os_str(&self) -> &OsStr {
         OsStr::from_str(self)
     }
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
 impl AsOsStr for String {
     fn as_os_str(&self) -> &OsStr {
         OsStr::from_str(&self[..])
     }
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<OsStr> for OsStr {
+    fn as_ref(&self) -> &OsStr {
+        self
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<OsStr> for OsString {
+    fn as_ref(&self) -> &OsStr {
+        self
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<OsStr> for str {
+    fn as_ref(&self) -> &OsStr {
+        OsStr::from_str(self)
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<OsStr> for String {
+    fn as_ref(&self) -> &OsStr {
+        OsStr::from_str(&self[..])
+    }
+}
+
 #[allow(deprecated)]
+#[stable(feature = "rust1", since = "1.0.0")]
+#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
 impl AsOsStr for Path {
     #[cfg(unix)]
     fn as_os_str(&self) -> &OsStr {
index 7df6d6887a25892e564dbeb2a11ff0207165bbc6..ab7675e4646c56dd6071b9c216c475e17d9cc049 100644 (file)
@@ -20,7 +20,7 @@
 use core::prelude::*;
 
 use io::{self, Error, ErrorKind, SeekFrom, Seek, Read, Write};
-use path::{AsPath, Path, PathBuf};
+use path::{Path, PathBuf};
 use sys::fs2 as fs_imp;
 use sys_common::{AsInnerMut, FromInner, AsInner};
 use vec::Vec;
@@ -128,8 +128,19 @@ impl File {
     ///
     /// This function will return an error if `path` does not already exist.
     /// Other errors may also be returned according to `OpenOptions::open`.
+    ///
+    /// # Examples
+    ///
+    /// ```no_run
+    /// use std::fs::File;
+    ///
+    /// # fn foo() -> std::io::Result<()> {
+    /// let mut f = try!(File::open("foo.txt"));
+    /// # Ok(())
+    /// # }
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn open<P: AsPath>(path: P) -> io::Result<File> {
+    pub fn open<P: AsRef<Path>>(path: P) -> io::Result<File> {
         OpenOptions::new().read(true).open(path)
     }
 
@@ -139,8 +150,19 @@ pub fn open<P: AsPath>(path: P) -> io::Result<File> {
     /// and will truncate it if it does.
     ///
     /// See the `OpenOptions::open` function for more details.
+    ///
+    /// # Examples
+    ///
+    /// ```no_run
+    /// use std::fs::File;
+    ///
+    /// # fn foo() -> std::io::Result<()> {
+    /// let mut f = try!(File::create("foo.txt"));
+    /// # Ok(())
+    /// # }
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn create<P: AsPath>(path: P) -> io::Result<File> {
+    pub fn create<P: AsRef<Path>>(path: P) -> io::Result<File> {
         OpenOptions::new().write(true).create(true).truncate(true).open(path)
     }
 
@@ -156,6 +178,20 @@ pub fn path(&self) -> Option<&Path> {
     ///
     /// This function will attempt to ensure that all in-core data reaches the
     /// filesystem before returning.
+    ///
+    /// # Examples
+    ///
+    /// ```no_run
+    /// use std::fs::File;
+    ///
+    /// # fn foo() -> std::io::Result<()> {
+    /// let mut f = try!(File::create("foo.txt"));
+    /// try!(f.write_all(b"Hello, world!"));
+    ///
+    /// try!(f.sync_all());
+    /// # Ok(())
+    /// # }
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn sync_all(&self) -> io::Result<()> {
         self.inner.fsync()
@@ -170,6 +206,20 @@ pub fn sync_all(&self) -> io::Result<()> {
     ///
     /// Note that some platforms may simply implement this in terms of
     /// `sync_all`.
+    ///
+    /// # Examples
+    ///
+    /// ```no_run
+    /// use std::fs::File;
+    ///
+    /// # fn foo() -> std::io::Result<()> {
+    /// let mut f = try!(File::create("foo.txt"));
+    /// try!(f.write_all(b"Hello, world!"));
+    ///
+    /// try!(f.sync_data());
+    /// # Ok(())
+    /// # }
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn sync_data(&self) -> io::Result<()> {
         self.inner.datasync()
@@ -182,12 +232,36 @@ pub fn sync_data(&self) -> io::Result<()> {
     /// be shrunk. If it is greater than the current file's size, then the file
     /// will be extended to `size` and have all of the intermediate data filled
     /// in with 0s.
+    ///
+    /// # Examples
+    ///
+    /// ```no_run
+    /// use std::fs::File;
+    ///
+    /// # fn foo() -> std::io::Result<()> {
+    /// let mut f = try!(File::open("foo.txt"));
+    /// try!(f.set_len(0));
+    /// # Ok(())
+    /// # }
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn set_len(&self, size: u64) -> io::Result<()> {
         self.inner.truncate(size)
     }
 
     /// Queries metadata about the underlying file.
+    ///
+    /// # Examples
+    ///
+    /// ```no_run
+    /// use std::fs::File;
+    ///
+    /// # fn foo() -> std::io::Result<()> {
+    /// let mut f = try!(File::open("foo.txt"));
+    /// let metadata = try!(f.metadata());
+    /// # Ok(())
+    /// # }
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn metadata(&self) -> io::Result<Metadata> {
         self.inner.file_attr().map(Metadata)
@@ -302,8 +376,8 @@ pub fn create(&mut self, create: bool) -> &mut OpenOptions {
     ///   permissions for
     /// * Filesystem-level errors (full disk, etc)
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn open<P: AsPath>(&self, path: P) -> io::Result<File> {
-        let path = path.as_path();
+    pub fn open<P: AsRef<Path>>(&self, path: P) -> io::Result<File> {
+        let path = path.as_ref();
         let inner = try!(fs_imp::File::open(path, &self.0));
         Ok(File { path: path.to_path_buf(), inner: inner })
     }
@@ -415,8 +489,8 @@ pub fn path(&self) -> PathBuf { self.0.path() }
 /// user lacks permissions to remove the file, or if some other filesystem-level
 /// error occurs.
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn remove_file<P: AsPath>(path: P) -> io::Result<()> {
-    fs_imp::unlink(path.as_path())
+pub fn remove_file<P: AsRef<Path>>(path: P) -> io::Result<()> {
+    fs_imp::unlink(path.as_ref())
 }
 
 /// Given a path, query the file system to get information about a file,
@@ -443,8 +517,8 @@ pub fn remove_file<P: AsPath>(path: P) -> io::Result<()> {
 /// permissions to perform a `metadata` call on the given `path` or if there
 /// is no entry in the filesystem at the provided path.
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn metadata<P: AsPath>(path: P) -> io::Result<Metadata> {
-    fs_imp::stat(path.as_path()).map(Metadata)
+pub fn metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
+    fs_imp::stat(path.as_ref()).map(Metadata)
 }
 
 /// Rename a file or directory to a new name.
@@ -464,8 +538,8 @@ pub fn metadata<P: AsPath>(path: P) -> io::Result<Metadata> {
 /// reside on separate filesystems, or if some other intermittent I/O error
 /// occurs.
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn rename<P: AsPath, Q: AsPath>(from: P, to: Q) -> io::Result<()> {
-    fs_imp::rename(from.as_path(), to.as_path())
+pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<()> {
+    fs_imp::rename(from.as_ref(), to.as_ref())
 }
 
 /// Copies the contents of one file to another. This function will also
@@ -494,9 +568,9 @@ pub fn rename<P: AsPath, Q: AsPath>(from: P, to: Q) -> io::Result<()> {
 /// * The current process does not have the permission rights to access
 ///   `from` or write `to`
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn copy<P: AsPath, Q: AsPath>(from: P, to: Q) -> io::Result<u64> {
-    let from = from.as_path();
-    let to = to.as_path();
+pub fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<u64> {
+    let from = from.as_ref();
+    let to = to.as_ref();
     if !from.is_file() {
         return Err(Error::new(ErrorKind::InvalidInput,
                               "the source path is not an existing file",
@@ -517,16 +591,16 @@ pub fn copy<P: AsPath, Q: AsPath>(from: P, to: Q) -> io::Result<u64> {
 /// The `dst` path will be a link pointing to the `src` path. Note that systems
 /// often require these two paths to both be located on the same filesystem.
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn hard_link<P: AsPath, Q: AsPath>(src: P, dst: Q) -> io::Result<()> {
-    fs_imp::link(src.as_path(), dst.as_path())
+pub fn hard_link<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<()> {
+    fs_imp::link(src.as_ref(), dst.as_ref())
 }
 
 /// Creates a new soft link on the filesystem.
 ///
 /// The `dst` path will be a soft link pointing to the `src` path.
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn soft_link<P: AsPath, Q: AsPath>(src: P, dst: Q) -> io::Result<()> {
-    fs_imp::symlink(src.as_path(), dst.as_path())
+pub fn soft_link<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<()> {
+    fs_imp::symlink(src.as_ref(), dst.as_ref())
 }
 
 /// Reads a soft link, returning the file that the link points to.
@@ -537,8 +611,8 @@ pub fn soft_link<P: AsPath, Q: AsPath>(src: P, dst: Q) -> io::Result<()> {
 /// reading a file that does not exist or reading a file that is not a soft
 /// link.
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn read_link<P: AsPath>(path: P) -> io::Result<PathBuf> {
-    fs_imp::readlink(path.as_path())
+pub fn read_link<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
+    fs_imp::readlink(path.as_ref())
 }
 
 /// Create a new, empty directory at the provided path
@@ -556,8 +630,8 @@ pub fn read_link<P: AsPath>(path: P) -> io::Result<PathBuf> {
 /// This function will return an error if the user lacks permissions to make a
 /// new directory at the provided `path`, or if the directory already exists.
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn create_dir<P: AsPath>(path: P) -> io::Result<()> {
-    fs_imp::mkdir(path.as_path())
+pub fn create_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
+    fs_imp::mkdir(path.as_ref())
 }
 
 /// Recursively create a directory and all of its parent components if they
@@ -570,9 +644,9 @@ pub fn create_dir<P: AsPath>(path: P) -> io::Result<()> {
 /// error conditions for when a directory is being created (after it is
 /// determined to not exist) are outlined by `fs::create_dir`.
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn create_dir_all<P: AsPath>(path: P) -> io::Result<()> {
-    let path = path.as_path();
-    if path.is_dir() { return Ok(()) }
+pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
+    let path = path.as_ref();
+    if path == Path::new("") || path.is_dir() { return Ok(()) }
     if let Some(p) = path.parent() { try!(create_dir_all(p)) }
     create_dir(path)
 }
@@ -592,8 +666,8 @@ pub fn create_dir_all<P: AsPath>(path: P) -> io::Result<()> {
 /// This function will return an error if the user lacks permissions to remove
 /// the directory at the provided `path`, or if the directory isn't empty.
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn remove_dir<P: AsPath>(path: P) -> io::Result<()> {
-    fs_imp::rmdir(path.as_path())
+pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
+    fs_imp::rmdir(path.as_ref())
 }
 
 /// Removes a directory at this path, after removing all its contents. Use
@@ -606,8 +680,8 @@ pub fn remove_dir<P: AsPath>(path: P) -> io::Result<()> {
 ///
 /// See `file::remove_file` and `fs::remove_dir`
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn remove_dir_all<P: AsPath>(path: P) -> io::Result<()> {
-    let path = path.as_path();
+pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
+    let path = path.as_ref();
     for child in try!(read_dir(path)) {
         let child = try!(child).path();
         let stat = try!(lstat(&*child));
@@ -633,6 +707,7 @@ fn lstat(path: &Path) -> io::Result<fs_imp::FileAttr> { fs_imp::stat(path) }
 /// # Examples
 ///
 /// ```
+/// # #![feature(path_ext)]
 /// use std::io;
 /// use std::fs::{self, PathExt, DirEntry};
 /// use std::path::Path;
@@ -659,8 +734,8 @@ fn lstat(path: &Path) -> io::Result<fs_imp::FileAttr> { fs_imp::stat(path) }
 /// the process lacks permissions to view the contents or if the `path` points
 /// at a non-directory file
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn read_dir<P: AsPath>(path: P) -> io::Result<ReadDir> {
-    fs_imp::readdir(path.as_path()).map(ReadDir)
+pub fn read_dir<P: AsRef<Path>>(path: P) -> io::Result<ReadDir> {
+    fs_imp::readdir(path.as_ref()).map(ReadDir)
 }
 
 /// Returns an iterator that will recursively walk the directory structure
@@ -675,7 +750,7 @@ pub fn read_dir<P: AsPath>(path: P) -> io::Result<ReadDir> {
            reason = "the precise semantics and defaults for a recursive walk \
                      may change and this may end up accounting for files such \
                      as symlinks differently")]
-pub fn walk_dir<P: AsPath>(path: P) -> io::Result<WalkDir> {
+pub fn walk_dir<P: AsRef<Path>>(path: P) -> io::Result<WalkDir> {
     let start = try!(read_dir(path));
     Ok(WalkDir { cur: Some(start), stack: Vec::new() })
 }
@@ -761,9 +836,9 @@ fn is_dir(&self) -> bool {
            reason = "the argument type of u64 is not quite appropriate for \
                      this function and may change if the standard library \
                      gains a type to represent a moment in time")]
-pub fn set_file_times<P: AsPath>(path: P, accessed: u64,
+pub fn set_file_times<P: AsRef<Path>>(path: P, accessed: u64,
                                  modified: u64) -> io::Result<()> {
-    fs_imp::utimes(path.as_path(), accessed, modified)
+    fs_imp::utimes(path.as_ref(), accessed, modified)
 }
 
 /// Changes the permissions found on a file or a directory.
@@ -771,6 +846,7 @@ pub fn set_file_times<P: AsPath>(path: P, accessed: u64,
 /// # Examples
 ///
 /// ```
+/// # #![feature(fs)]
 /// # fn foo() -> std::io::Result<()> {
 /// use std::fs;
 ///
@@ -790,8 +866,8 @@ pub fn set_file_times<P: AsPath>(path: P, accessed: u64,
            reason = "a more granual ability to set specific permissions may \
                      be exposed on the Permissions structure itself and this \
                      method may not always exist")]
-pub fn set_permissions<P: AsPath>(path: P, perm: Permissions) -> io::Result<()> {
-    fs_imp::set_perm(path.as_path(), perm.0)
+pub fn set_permissions<P: AsRef<Path>>(path: P, perm: Permissions) -> io::Result<()> {
+    fs_imp::set_perm(path.as_ref(), perm.0)
 }
 
 #[cfg(test)]
index 8f32d7a586459241324a3a249a6ede228c4bce55..a9717e36323392a74e55325916a306f9b52bd503 100644 (file)
@@ -18,7 +18,7 @@
 use env;
 use io::{self, Error, ErrorKind};
 use fs;
-use path::{self, PathBuf, AsPath};
+use path::{self, PathBuf};
 use rand::{thread_rng, Rng};
 
 /// A wrapper for a path to temporary directory implementing automatic
@@ -43,10 +43,9 @@ impl TempDir {
     ///
     /// If no directory can be created, `Err` is returned.
     #[allow(deprecated)] // rand usage
-    pub fn new_in<P: AsPath + ?Sized>(tmpdir: &P, prefix: &str)
-                                      -> io::Result<TempDir> {
+    pub fn new_in<P: AsRef<path::Path>>(tmpdir: P, prefix: &str) -> io::Result<TempDir> {
         let storage;
-        let mut tmpdir = tmpdir.as_path();
+        let mut tmpdir = tmpdir.as_ref();
         if !tmpdir.is_absolute() {
             let cur_dir = try!(env::current_dir());
             storage = cur_dir.join(tmpdir);
index 43eec695274208213e2a1f4e9850a2c58879037f..4def601f1c0e7657f6a3e7da1c057ec3c53da99a 100644 (file)
@@ -258,7 +258,7 @@ fn from_error(iie: IntoInnerError<W>) -> Error { iie.1 }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<W> error::Error for IntoInnerError<W> {
+impl<W: Send + fmt::Debug> error::Error for IntoInnerError<W> {
     fn description(&self) -> &str {
         error::Error::description(self.error())
     }
index 87e5a2a448855f97da265eeeccc38aa1c2ae16fe..79f0af670b44624ea031136bf95654877ed3bcdb 100644 (file)
 use num::Int;
 use slice;
 
-/// A `Cursor` is a type which wraps another I/O object to provide a `Seek`
+/// A `Cursor` is a type which wraps a non-I/O object to provide a `Seek`
 /// implementation.
 ///
-/// Cursors are currently typically used with memory buffer objects in order to
-/// allow `Seek` plus `Read` and `Write` implementations. For example, common
-/// cursor types include:
+/// Cursors are typically used with memory buffer objects in order to allow
+/// `Seek`, `Read`, and `Write` implementations. For example, common cursor types
+/// include `Cursor<Vec<u8>>` and `Cursor<&[u8]>`.
 ///
-/// * `Cursor<Vec<u8>>`
-/// * `Cursor<&[u8]>`
-///
-/// Implementations of the I/O traits for `Cursor<T>` are not currently generic
+/// Implementations of the I/O traits for `Cursor<T>` are currently not generic
 /// over `T` itself. Instead, specific implementations are provided for various
 /// in-memory buffer types like `Vec<u8>` and `&[u8]`.
 #[stable(feature = "rust1", since = "1.0.0")]
+#[derive(Clone, Debug)]
 pub struct Cursor<T> {
     inner: T,
     pos: u64,
index c9b105f72a53943ab0d8e9ff6dbab3071b1ab993..df280dab37d467221afff885df9cdd78004e01ba 100644 (file)
@@ -35,25 +35,33 @@ impl<T: Send + Sync + 'static> Lazy<T> {
     pub fn get(&'static self) -> Option<Arc<T>> {
         let _g = self.lock.lock();
         unsafe {
-            let mut ptr = *self.ptr.get();
+            let ptr = *self.ptr.get();
             if ptr.is_null() {
-                ptr = boxed::into_raw(self.init());
-                *self.ptr.get() = ptr;
+                Some(self.init())
             } else if ptr as usize == 1 {
-                return None
+                None
+            } else {
+                Some((*ptr).clone())
             }
-            Some((*ptr).clone())
         }
     }
 
-    fn init(&'static self) -> Box<Arc<T>> {
-        rt::at_exit(move || unsafe {
+    unsafe fn init(&'static self) -> Arc<T> {
+        // If we successfully register an at exit handler, then we cache the
+        // `Arc` allocation in our own internal box (it will get deallocated by
+        // the at exit handler). Otherwise we just return the freshly allocated
+        // `Arc`.
+        let registered = rt::at_exit(move || {
             let g = self.lock.lock();
             let ptr = *self.ptr.get();
             *self.ptr.get() = 1 as *mut _;
             drop(g);
             drop(Box::from_raw(ptr))
         });
-        Box::new((self.init)())
+        let ret = (self.init)();
+        if registered.is_ok() {
+            *self.ptr.get() = boxed::into_raw(Box::new(ret.clone()));
+        }
+        return ret
     }
 }
index 237435d6dfbfa4c9b8a224c515edc74d122dc20a..39c718c96b38a014583a3f557b8c8cdfff9f3fb6 100644 (file)
@@ -558,6 +558,12 @@ pub trait BufRead: Read {
     /// This function does not perform any I/O, it simply informs this object
     /// that some amount of its buffer, returned from `fill_buf`, has been
     /// consumed and should no longer be returned.
+    ///
+    /// This function is used to tell the buffer how many bytes you've consumed
+    /// from the return value of `fill_buf`, and so may do odd things if
+    /// `fill_buf` isn't called before calling this.
+    ///
+    /// The `amt` must be `<=` the number of bytes in the buffer returned by `fill_buf`.
     #[stable(feature = "rust1", since = "1.0.0")]
     fn consume(&mut self, amt: usize);
 
index b055796ba547fefc9ce9ea8df62d797373d89cc9..cca6bb747d43c5f2e66f0f43dcd2883fbc18345b 100644 (file)
 //!
 //! ## Vectors, slices and strings
 //!
-//! The common container type, `Vec`, a growable vector backed by an
-//! array, lives in the [`vec`](vec/index.html) module. References to
-//! arrays, `&[T]`, more commonly called "slices", are built-in types
-//! for which the [`slice`](slice/index.html) module defines many
-//! methods.
+//! The common container type, `Vec`, a growable vector backed by an array,
+//! lives in the [`vec`](vec/index.html) module. Contiguous, unsized regions
+//! of memory, `[T]`, commonly called "slices", and their borrowed versions,
+//! `&[T]`, commonly called "borrowed slices", are built-in types for which the
+//! for which the [`slice`](slice/index.html) module defines many methods.
 //!
 //! `&str`, a UTF-8 string, is a built-in type, and the standard library
 //! defines methods for it on a variety of traits in the
@@ -75,7 +75,7 @@
 //!
 //! The [`thread`](thread/index.html) module contains Rust's threading abstractions.
 //! [`sync`](sync/index.html) contains further, primitive, shared memory types,
-//! including [`atomic`](sync/atomic/index.html), and [`mpsc`](sync/mpmc/index.html),
+//! including [`atomic`](sync/atomic/index.html), and [`mpsc`](sync/mpsc/index.html),
 //! which contains the channel types for message passing.
 //!
 //! Common types of I/O, including files, TCP, UDP, pipes, Unix domain sockets,
        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
        html_root_url = "http://doc.rust-lang.org/nightly/",
        html_playground_url = "http://play.rust-lang.org/")]
+#![doc(test(no_crate_inject))]
 
 #![feature(alloc)]
 #![feature(box_syntax)]
 #![feature(collections)]
 #![feature(core)]
-#![feature(hash)]
 #![feature(lang_items)]
 #![feature(libc)]
 #![feature(linkage, thread_local, asm)]
 #![feature(unsafe_destructor)]
 #![feature(unsafe_no_drop_flag)]
 #![feature(macro_reexport)]
-#![feature(hash)]
 #![feature(int_uint)]
 #![feature(unique)]
+#![feature(convert)]
 #![feature(allow_internal_unstable)]
 #![feature(str_char)]
-#![cfg_attr(test, feature(test, rustc_private))]
+#![feature(into_cow)]
+#![cfg_attr(test, feature(test, rustc_private, std_misc))]
 
 // Don't link to std. We are std.
 #![feature(no_std)]
 #![no_std]
 
+#![allow(trivial_casts)]
+#![allow(trivial_numeric_casts)]
 #![deny(missing_docs)]
 
 #[cfg(test)] extern crate test;
 pub use core::cell;
 pub use core::clone;
 #[cfg(not(test))] pub use core::cmp;
+pub use core::convert;
 pub use core::default;
 #[allow(deprecated)]
 pub use core::finally;
 
 /* Primitive types */
 
+// NB: slice and str are primitive types too, but their module docs + primitive doc pages
+// are inlined from the public re-exports of core_collections::{slice, str} above.
+
 #[path = "num/float_macros.rs"]
 #[macro_use]
 mod float_macros;
 /* Runtime and platform support */
 
 #[macro_use]
-pub mod thread_local;
+pub mod thread;
 
+pub mod collections;
 pub mod dynamic_lib;
+pub mod env;
 pub mod ffi;
-pub mod old_io;
-pub mod io;
 pub mod fs;
+pub mod io;
 pub mod net;
+pub mod old_io;
+pub mod old_path;
 pub mod os;
-pub mod env;
 pub mod path;
-pub mod old_path;
 pub mod process;
 pub mod rand;
-pub mod time;
-
-/* Common data structures */
-
-pub mod collections;
-
-/* Threads and communication */
-
-pub mod thread;
 pub mod sync;
+pub mod time;
 
 #[macro_use]
 #[path = "sys/common/mod.rs"] mod sys_common;
 pub mod rt;
 mod panicking;
 
-// Documentation for primitive types
+// Modules that exist purely to document + host impl docs for primitive types
 
+mod array;
 mod bool;
 mod unit;
 mod tuple;
@@ -305,7 +306,7 @@ mod std {
     pub use rt; // used for panic!()
     pub use vec; // used for vec![]
     pub use cell; // used for tls!
-    pub use thread_local; // used for thread_local!
+    pub use thread; // used for thread_local!
     pub use marker;  // used for tls!
     pub use ops; // used for bitflags!
 
index f4a7e8b1b982441654b505b96fefdd654a38c594..1681ed4282f48c9e2fa767e1868ab82674084aea 100644 (file)
@@ -90,8 +90,7 @@ macro_rules! println {
 }
 
 /// Helper macro for unwrapping `Result` values while returning early with an
-/// error if the value of the expression is `Err`. For more information, see
-/// `std::io`.
+/// error if the value of the expression is `Err`.
 #[macro_export]
 #[stable(feature = "rust1", since = "1.0.0")]
 macro_rules! try {
@@ -112,6 +111,7 @@ macro_rules! try {
 /// # Examples
 ///
 /// ```
+/// # #![feature(std_misc)]
 /// use std::thread;
 /// use std::sync::mpsc;
 ///
index 872411170438cfda13687f5366493105895c849e..e8187dc2c402720453e8083195224bb6f4010d25 100644 (file)
@@ -263,6 +263,7 @@ fn hash<H: hash::Hasher>(&self, s: &mut H) {
 /// Some examples:
 ///
 /// ```no_run
+/// # #![feature(net)]
 /// use std::net::{SocketAddrV4, TcpStream, UdpSocket, TcpListener, Ipv4Addr};
 ///
 /// fn main() {
index 73c2464a6b2cb9b33449568b3149c34a3e0e3a9e..d737ad17ff8ecf7220cdb3d894b735ef3246b151 100644 (file)
@@ -374,7 +374,6 @@ fn fmt_subslice(segments: &[u16]) -> String {
                             .iter()
                             .map(|&seg| format!("{:x}", seg))
                             .collect::<Vec<String>>()
-                            .as_slice()
                             .connect(":")
                     }
 
index 543fdd16f41e307d3b185f7e8f39232ad494e6b0..48b3247f2127abd143646e0243add745cb9129bd 100644 (file)
@@ -91,6 +91,7 @@ fn next(&mut self) -> Option<io::Result<SocketAddr>> { self.0.next() }
 /// # Examples
 ///
 /// ```no_run
+/// # #![feature(net)]
 /// use std::net;
 ///
 /// # fn foo() -> std::io::Result<()> {
index f263d7d72d35d364d5d5d04af0a6c2d78dc83c15..869faa795f9c3fb1c0cd506578ac26cc67360bb4 100644 (file)
@@ -27,6 +27,7 @@
 /// # Examples
 ///
 /// ```no_run
+/// # #![feature(net)]
 /// use std::io::prelude::*;
 /// use std::net::TcpStream;
 ///
@@ -46,6 +47,7 @@
 /// # Examples
 ///
 /// ```no_run
+/// # #![feature(net)]
 /// use std::net::{TcpListener, TcpStream};
 /// use std::thread;
 ///
index 1ace195752658ab297b853009a52b8b5ee21ba8c..e593bbe8e489b526e67eb1e94da25dd25c9d378d 100644 (file)
@@ -27,6 +27,7 @@
 /// # Examples
 ///
 /// ```no_run
+/// # #![feature(net)]
 /// use std::net::UdpSocket;
 ///
 /// # fn foo() -> std::io::Result<()> {
index b5513dfd0354d542538360bb947fb510020596d3..a4f06f14d49df4d77a0a5de8f190d2d5928281c9 100644 (file)
@@ -365,6 +365,7 @@ impl f32 {
     /// Returns the `NaN` value.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let nan: f32 = Float::nan();
@@ -379,6 +380,7 @@ pub fn nan() -> f32 { num::Float::nan() }
     /// Returns the infinite value.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -396,6 +398,7 @@ pub fn infinity() -> f32 { num::Float::infinity() }
     /// Returns the negative infinite value.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -413,6 +416,7 @@ pub fn neg_infinity() -> f32 { num::Float::neg_infinity() }
     /// Returns `0.0`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let inf: f32 = Float::infinity();
@@ -431,6 +435,7 @@ pub fn zero() -> f32 { num::Float::zero() }
     /// Returns `-0.0`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let inf: f32 = Float::infinity();
@@ -449,6 +454,7 @@ pub fn neg_zero() -> f32 { num::Float::neg_zero() }
     /// Returns `1.0`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let one: f32 = Float::one();
@@ -525,6 +531,7 @@ pub fn max_10_exp(unused_self: Option<f32>) -> int { num::Float::max_10_exp(unus
     /// Returns the smallest finite value that this type can represent.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -548,6 +555,7 @@ pub fn min_pos_value(unused_self: Option<f32>) -> f32 { num::Float::min_pos_valu
     /// Returns the largest finite value that this type can represent.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -563,6 +571,7 @@ pub fn max_value() -> f32 { num::Float::max_value() }
     /// Returns `true` if this value is `NaN` and false otherwise.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -580,6 +589,7 @@ pub fn is_nan(self) -> bool { num::Float::is_nan(self) }
     /// false otherwise.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -601,6 +611,7 @@ pub fn is_infinite(self) -> bool { num::Float::is_infinite(self) }
     /// Returns `true` if this number is neither infinite nor `NaN`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -623,6 +634,7 @@ pub fn is_finite(self) -> bool { num::Float::is_finite(self) }
     /// [subnormal][subnormal], or `NaN`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -650,6 +662,7 @@ pub fn is_normal(self) -> bool { num::Float::is_normal(self) }
     /// predicate instead.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::{Float, FpCategory};
     /// use std::f32;
     ///
@@ -668,6 +681,7 @@ pub fn classify(self) -> FpCategory { num::Float::classify(self) }
     /// The floating point encoding is documented in the [Reference][floating-point].
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let num = 2.0f32;
@@ -770,6 +784,7 @@ pub fn fract(self) -> f32 { num::Float::fract(self) }
     /// number is `Float::nan()`.
     ///
     /// ```
+    /// # #![feature(core, std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -795,6 +810,7 @@ pub fn abs(self) -> f32 { num::Float::abs(self) }
     /// - `Float::nan()` if the number is `Float::nan()`
     ///
     /// ```
+    /// # #![feature(core, std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -856,6 +872,7 @@ pub fn is_negative(self) -> bool { num::Float::is_negative(self) }
     /// a separate multiplication operation followed by an add.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let m = 10.0;
@@ -875,6 +892,7 @@ pub fn mul_add(self, a: f32, b: f32) -> f32 { num::Float::mul_add(self, a, b) }
     /// Take the reciprocal (inverse) of a number, `1/x`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 2.0;
@@ -922,6 +940,7 @@ pub fn powf(self, n: f32) -> f32 { num::Float::powf(self, n) }
     /// Returns NaN if `self` is a negative number.
     ///
     /// ```
+    /// # #![feature(core, std_misc)]
     /// use std::num::Float;
     ///
     /// let positive = 4.0;
@@ -940,6 +959,7 @@ pub fn sqrt(self) -> f32 { num::Float::sqrt(self) }
     /// Take the reciprocal (inverse) square root of a number, `1/sqrt(x)`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let f = 4.0;
@@ -1061,6 +1081,7 @@ pub fn log10(self) -> f32 { num::Float::log10(self) }
     /// Convert radians to degrees.
     ///
     /// ```
+    /// # #![feature(std_misc, core)]
     /// use std::num::Float;
     /// use std::f64::consts;
     ///
@@ -1077,6 +1098,7 @@ pub fn to_degrees(self) -> f32 { num::Float::to_degrees(self) }
     /// Convert degrees to radians.
     ///
     /// ```
+    /// # #![feature(std_misc, core)]
     /// use std::num::Float;
     /// use std::f64::consts;
     ///
@@ -1093,6 +1115,7 @@ pub fn to_radians(self) -> f32 { num::Float::to_radians(self) }
     /// Constructs a floating point number of `x*2^exp`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// // 3*2^2 - 12 == 0
@@ -1114,6 +1137,7 @@ pub fn ldexp(x: f32, exp: int) -> f32 {
     ///  * `0.5 <= abs(x) < 1.0`
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 4.0;
@@ -1141,6 +1165,7 @@ pub fn frexp(self) -> (f32, int) {
     /// `other`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 1.0f32;
@@ -1194,6 +1219,7 @@ pub fn min(self, other: f32) -> f32 {
     /// * Else: `self - other`
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 3.0;
@@ -1214,6 +1240,7 @@ pub fn abs_sub(self, other: f32) -> f32 {
     /// Take the cubic root of a number.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 8.0;
@@ -1233,6 +1260,7 @@ pub fn cbrt(self) -> f32 {
     /// legs of length `x` and `y`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 2.0;
@@ -1253,6 +1281,7 @@ pub fn hypot(self, other: f32) -> f32 {
     /// Computes the sine of a number (in radians).
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1271,6 +1300,7 @@ pub fn sin(self) -> f32 {
     /// Computes the cosine of a number (in radians).
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1289,6 +1319,7 @@ pub fn cos(self) -> f32 {
     /// Computes the tangent of a number (in radians).
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1308,6 +1339,7 @@ pub fn tan(self) -> f32 {
     /// [-1, 1].
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1329,6 +1361,7 @@ pub fn asin(self) -> f32 {
     /// [-1, 1].
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1372,6 +1405,7 @@ pub fn atan(self) -> f32 {
     /// * `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)`
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1401,6 +1435,7 @@ pub fn atan2(self, other: f32) -> f32 {
     /// `(sin(x), cos(x))`.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1423,6 +1458,7 @@ pub fn sin_cos(self) -> (f32, f32) {
     /// number is close to zero.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 7.0;
@@ -1442,6 +1478,7 @@ pub fn exp_m1(self) -> f32 {
     /// the operations were performed separately.
     ///
     /// ```
+    /// # #![feature(std_misc, core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1461,6 +1498,7 @@ pub fn ln_1p(self) -> f32 {
     /// Hyperbolic sine function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1483,6 +1521,7 @@ pub fn sinh(self) -> f32 {
     /// Hyperbolic cosine function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1505,6 +1544,7 @@ pub fn cosh(self) -> f32 {
     /// Hyperbolic tangent function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1527,6 +1567,7 @@ pub fn tanh(self) -> f32 {
     /// Inverse hyperbolic sine function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     ///
     /// let x = 1.0;
@@ -1548,6 +1589,7 @@ pub fn asinh(self) -> f32 {
     /// Inverse hyperbolic cosine function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     ///
     /// let x = 1.0;
@@ -1569,6 +1611,7 @@ pub fn acosh(self) -> f32 {
     /// Inverse hyperbolic tangent function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
index 61bddc3d18f66310c7210bdd5c7747b9001f0517..9306804d1f787aa34f8345fd5595ffa4da96bf7f 100644 (file)
@@ -374,6 +374,7 @@ impl f64 {
     /// Returns the `NaN` value.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let nan: f32 = Float::nan();
@@ -388,6 +389,7 @@ pub fn nan() -> f64 { num::Float::nan() }
     /// Returns the infinite value.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -405,6 +407,7 @@ pub fn infinity() -> f64 { num::Float::infinity() }
     /// Returns the negative infinite value.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -422,6 +425,7 @@ pub fn neg_infinity() -> f64 { num::Float::neg_infinity() }
     /// Returns `0.0`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let inf: f32 = Float::infinity();
@@ -440,6 +444,7 @@ pub fn zero() -> f64 { num::Float::zero() }
     /// Returns `-0.0`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let inf: f32 = Float::infinity();
@@ -458,6 +463,7 @@ pub fn neg_zero() -> f64 { num::Float::neg_zero() }
     /// Returns `1.0`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let one: f32 = Float::one();
@@ -534,6 +540,7 @@ pub fn max_10_exp(unused_self: Option<f64>) -> int { num::Float::max_10_exp(unus
     /// Returns the smallest finite value that this type can represent.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -557,6 +564,7 @@ pub fn min_pos_value(unused_self: Option<f64>) -> f64 { num::Float::min_pos_valu
     /// Returns the largest finite value that this type can represent.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -572,6 +580,7 @@ pub fn max_value() -> f64 { num::Float::max_value() }
     /// Returns `true` if this value is `NaN` and false otherwise.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -589,6 +598,7 @@ pub fn is_nan(self) -> bool { num::Float::is_nan(self) }
     /// false otherwise.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -610,6 +620,7 @@ pub fn is_infinite(self) -> bool { num::Float::is_infinite(self) }
     /// Returns `true` if this number is neither infinite nor `NaN`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -632,6 +643,7 @@ pub fn is_finite(self) -> bool { num::Float::is_finite(self) }
     /// [subnormal][subnormal], or `NaN`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -659,6 +671,7 @@ pub fn is_normal(self) -> bool { num::Float::is_normal(self) }
     /// predicate instead.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::{Float, FpCategory};
     /// use std::f32;
     ///
@@ -677,6 +690,7 @@ pub fn classify(self) -> FpCategory { num::Float::classify(self) }
     /// The floating point encoding is documented in the [Reference][floating-point].
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let num = 2.0f32;
@@ -779,6 +793,7 @@ pub fn fract(self) -> f64 { num::Float::fract(self) }
     /// number is `Float::nan()`.
     ///
     /// ```
+    /// # #![feature(core, std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -804,6 +819,7 @@ pub fn abs(self) -> f64 { num::Float::abs(self) }
     /// - `Float::nan()` if the number is `Float::nan()`
     ///
     /// ```
+    /// # #![feature(core, std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -865,6 +881,7 @@ pub fn is_negative(self) -> bool { num::Float::is_negative(self) }
     /// a separate multiplication operation followed by an add.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let m = 10.0;
@@ -884,6 +901,7 @@ pub fn mul_add(self, a: f64, b: f64) -> f64 { num::Float::mul_add(self, a, b) }
     /// Take the reciprocal (inverse) of a number, `1/x`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 2.0;
@@ -931,6 +949,7 @@ pub fn powf(self, n: f64) -> f64 { num::Float::powf(self, n) }
     /// Returns NaN if `self` is a negative number.
     ///
     /// ```
+    /// # #![feature(core, std_misc)]
     /// use std::num::Float;
     ///
     /// let positive = 4.0;
@@ -948,6 +967,7 @@ pub fn sqrt(self) -> f64 { num::Float::sqrt(self) }
     /// Take the reciprocal (inverse) square root of a number, `1/sqrt(x)`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let f = 4.0;
@@ -1069,6 +1089,7 @@ pub fn log10(self) -> f64 { num::Float::log10(self) }
     /// Convert radians to degrees.
     ///
     /// ```
+    /// # #![feature(std_misc, core)]
     /// use std::num::Float;
     /// use std::f64::consts;
     ///
@@ -1085,6 +1106,7 @@ pub fn to_degrees(self) -> f64 { num::Float::to_degrees(self) }
     /// Convert degrees to radians.
     ///
     /// ```
+    /// # #![feature(std_misc, core)]
     /// use std::num::Float;
     /// use std::f64::consts;
     ///
@@ -1101,6 +1123,7 @@ pub fn to_radians(self) -> f64 { num::Float::to_radians(self) }
     /// Constructs a floating point number of `x*2^exp`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// // 3*2^2 - 12 == 0
@@ -1122,6 +1145,7 @@ pub fn ldexp(x: f64, exp: int) -> f64 {
     ///  * `0.5 <= abs(x) < 1.0`
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 4.0;
@@ -1149,6 +1173,7 @@ pub fn frexp(self) -> (f64, int) {
     /// `other`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 1.0f32;
@@ -1202,6 +1227,7 @@ pub fn min(self, other: f64) -> f64 {
     /// * Else: `self - other`
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 3.0;
@@ -1222,6 +1248,7 @@ pub fn abs_sub(self, other: f64) -> f64 {
     /// Take the cubic root of a number.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 8.0;
@@ -1241,6 +1268,7 @@ pub fn cbrt(self) -> f64 {
     /// legs of length `x` and `y`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 2.0;
@@ -1261,6 +1289,7 @@ pub fn hypot(self, other: f64) -> f64 {
     /// Computes the sine of a number (in radians).
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1279,6 +1308,7 @@ pub fn sin(self) -> f64 {
     /// Computes the cosine of a number (in radians).
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1297,6 +1327,7 @@ pub fn cos(self) -> f64 {
     /// Computes the tangent of a number (in radians).
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1316,6 +1347,7 @@ pub fn tan(self) -> f64 {
     /// [-1, 1].
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1337,6 +1369,7 @@ pub fn asin(self) -> f64 {
     /// [-1, 1].
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1380,6 +1413,7 @@ pub fn atan(self) -> f64 {
     /// * `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)`
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1409,6 +1443,7 @@ pub fn atan2(self, other: f64) -> f64 {
     /// `(sin(x), cos(x))`.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1431,6 +1466,7 @@ pub fn sin_cos(self) -> (f64, f64) {
     /// number is close to zero.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 7.0;
@@ -1450,6 +1486,7 @@ pub fn exp_m1(self) -> f64 {
     /// the operations were performed separately.
     ///
     /// ```
+    /// # #![feature(std_misc, core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1469,6 +1506,7 @@ pub fn ln_1p(self) -> f64 {
     /// Hyperbolic sine function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1491,6 +1529,7 @@ pub fn sinh(self) -> f64 {
     /// Hyperbolic cosine function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1513,6 +1552,7 @@ pub fn cosh(self) -> f64 {
     /// Hyperbolic tangent function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1577,6 +1617,7 @@ pub fn acosh(self) -> f64 {
     /// Inverse hyperbolic tangent function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
index 562094a87f4e5db0a8a1ccefa2a67e5217d8b490..b9e9433e3ee5addbd0ae3765286e817eb1bc7ba9 100644 (file)
@@ -55,6 +55,7 @@ pub trait Float
     /// Returns the `NaN` value.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let nan: f32 = Float::nan();
@@ -67,6 +68,7 @@ pub trait Float
     /// Returns the infinite value.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -82,6 +84,7 @@ pub trait Float
     /// Returns the negative infinite value.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -97,6 +100,7 @@ pub trait Float
     /// Returns `0.0`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let inf: f32 = Float::infinity();
@@ -113,6 +117,7 @@ pub trait Float
     /// Returns `-0.0`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let inf: f32 = Float::infinity();
@@ -129,6 +134,7 @@ pub trait Float
     /// Returns `1.0`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let one: f32 = Float::one();
@@ -182,6 +188,7 @@ pub trait Float
     /// Returns the smallest finite value that this type can represent.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -199,6 +206,7 @@ pub trait Float
     /// Returns the largest finite value that this type can represent.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -211,6 +219,7 @@ pub trait Float
     /// Returns `true` if this value is `NaN` and false otherwise.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -226,6 +235,7 @@ pub trait Float
     /// false otherwise.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -245,6 +255,7 @@ pub trait Float
     /// Returns `true` if this number is neither infinite nor `NaN`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -265,6 +276,7 @@ pub trait Float
     /// [subnormal][subnormal], or `NaN`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f32;
     ///
@@ -291,6 +303,7 @@ pub trait Float
     /// predicate instead.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::{Float, FpCategory};
     /// use std::f32;
     ///
@@ -308,6 +321,7 @@ pub trait Float
     /// The floating point encoding is documented in the [Reference][floating-point].
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let num = 2.0f32;
@@ -399,6 +413,7 @@ pub trait Float
     /// number is `Float::nan()`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -422,6 +437,7 @@ pub trait Float
     /// - `Float::nan()` if the number is `Float::nan()`
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -478,6 +494,7 @@ pub trait Float
     /// a separate multiplication operation followed by an add.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let m = 10.0;
@@ -495,6 +512,7 @@ pub trait Float
     /// Take the reciprocal (inverse) of a number, `1/x`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 2.0;
@@ -537,6 +555,7 @@ pub trait Float
     /// Returns NaN if `self` is a negative number.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let positive = 4.0;
@@ -553,6 +572,7 @@ pub trait Float
     /// Take the reciprocal (inverse) square root of a number, `1/sqrt(x)`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let f = 4.0;
@@ -662,6 +682,7 @@ pub trait Float
     /// Convert radians to degrees.
     ///
     /// ```
+    /// # #![feature(std_misc, core)]
     /// use std::num::Float;
     /// use std::f64::consts;
     ///
@@ -676,6 +697,7 @@ pub trait Float
     /// Convert degrees to radians.
     ///
     /// ```
+    /// # #![feature(std_misc, core)]
     /// use std::num::Float;
     /// use std::f64::consts;
     ///
@@ -690,6 +712,7 @@ pub trait Float
     /// Constructs a floating point number of `x*2^exp`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// // 3*2^2 - 12 == 0
@@ -707,6 +730,7 @@ pub trait Float
     ///  * `0.5 <= abs(x) < 1.0`
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 4.0;
@@ -726,6 +750,7 @@ pub trait Float
     /// `other`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 1.0f32;
@@ -769,6 +794,7 @@ pub trait Float
     /// * Else: `self - other`
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 3.0;
@@ -785,6 +811,7 @@ pub trait Float
     /// Take the cubic root of a number.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 8.0;
@@ -800,6 +827,7 @@ pub trait Float
     /// legs of length `x` and `y`.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 2.0;
@@ -817,6 +845,7 @@ pub trait Float
     /// Computes the sine of a number (in radians).
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -831,6 +860,7 @@ pub trait Float
     /// Computes the cosine of a number (in radians).
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -845,6 +875,7 @@ pub trait Float
     /// Computes the tangent of a number (in radians).
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -860,6 +891,7 @@ pub trait Float
     /// [-1, 1].
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -877,6 +909,7 @@ pub trait Float
     /// [-1, 1].
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -912,6 +945,7 @@ pub trait Float
     /// * `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)`
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -937,6 +971,7 @@ pub trait Float
     /// `(sin(x), cos(x))`.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -956,6 +991,7 @@ pub trait Float
     /// number is close to zero.
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::num::Float;
     ///
     /// let x = 7.0;
@@ -971,6 +1007,7 @@ pub trait Float
     /// the operations were performed separately.
     ///
     /// ```
+    /// # #![feature(std_misc, core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -987,6 +1024,7 @@ pub trait Float
     /// Hyperbolic sine function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1005,6 +1043,7 @@ pub trait Float
     /// Hyperbolic cosine function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1023,6 +1062,7 @@ pub trait Float
     /// Hyperbolic tangent function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
@@ -1069,6 +1109,7 @@ pub trait Float
     /// Inverse hyperbolic tangent function.
     ///
     /// ```
+    /// # #![feature(core)]
     /// use std::num::Float;
     /// use std::f64;
     ///
index 3e5f732e345453d3f7c9eb396137433d56ad1486..cb67d709a143ab6d289a8750ef65768cb28e302f 100644 (file)
@@ -33,6 +33,7 @@
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, old_path)]
 /// use std::old_io::*;
 /// use std::old_path::Path;
 ///
@@ -137,6 +138,7 @@ fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, old_path)]
 /// use std::old_io::*;
 /// use std::old_path::Path;
 ///
@@ -324,6 +326,7 @@ fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, old_path)]
 /// # #![allow(unused_must_use)]
 /// use std::old_io::*;
 /// use std::old_path::Path;
index 7e62a21f105cd8d43ab16c8c98458db6c9f9f440..cd8252540dacce9eaa1ccc4445856479e4e27b45 100644 (file)
@@ -23,6 +23,7 @@
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io)]
 /// use std::sync::mpsc::channel;
 /// use std::old_io::*;
 ///
@@ -114,6 +115,7 @@ fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, io)]
 /// # #![allow(unused_must_use)]
 /// use std::sync::mpsc::channel;
 /// use std::old_io::*;
index 2990c1c265d54fcb14b2efd5fd3d73d5587fb2e8..5b1b9471b075c5247e9a8a5338a8970684ff31e8 100644 (file)
@@ -159,7 +159,7 @@ pub fn u64_to_be_bytes<T, F>(n: u64, size: uint, f: F) -> T where
 ///           that many bytes are parsed. For example, if `size` is 4, then a
 ///           32-bit value is parsed.
 pub fn u64_from_be_bytes(data: &[u8], start: uint, size: uint) -> u64 {
-    use ptr::{copy_nonoverlapping_memory};
+    use ptr::{copy_nonoverlapping};
 
     assert!(size <= 8);
 
@@ -171,7 +171,7 @@ pub fn u64_from_be_bytes(data: &[u8], start: uint, size: uint) -> u64 {
     unsafe {
         let ptr = data.as_ptr().offset(start as int);
         let out = buf.as_mut_ptr();
-        copy_nonoverlapping_memory(out.offset((8 - size) as int), ptr, size);
+        copy_nonoverlapping(out.offset((8 - size) as int), ptr, size);
         (*(out as *const u64)).to_be()
     }
 }
index 87e5b91fc2820d84729252d9234b0a1dcbc5f66b..40a7cce81dd01ebb8b85c7e481f30d0848612084 100644 (file)
@@ -30,6 +30,7 @@
 //! # Examples
 //!
 //! ```rust
+//! # #![feature(old_io, io, old_path)]
 //! # #![allow(unused_must_use)]
 //! use std::old_io::fs::PathExtensions;
 //! use std::old_io::*;
@@ -105,6 +106,7 @@ impl File {
     /// # Examples
     ///
     /// ```rust,should_fail
+    /// # #![feature(old_io, old_path)]
     /// use std::old_io::*;
     /// use std::old_path::Path;
     ///
@@ -177,6 +179,7 @@ pub fn open_mode(path: &Path,
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_io, old_path)]
     /// use std::old_io::*;
     /// use std::old_path::Path;
     ///
@@ -197,6 +200,7 @@ pub fn open(path: &Path) -> IoResult<File> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_io, old_path, io)]
     /// # #![allow(unused_must_use)]
     /// use std::old_io::*;
     /// use std::old_path::Path;
@@ -289,6 +293,7 @@ pub fn stat(&self) -> IoResult<FileStat> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, old_path)]
 /// # #![allow(unused_must_use)]
 /// use std::old_io::*;
 /// use std::old_path::Path;
@@ -321,6 +326,7 @@ pub fn unlink(path: &Path) -> IoResult<()> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, old_path)]
 /// use std::old_io::*;
 /// use std::old_path::Path;
 ///
@@ -364,6 +370,7 @@ pub fn lstat(path: &Path) -> IoResult<FileStat> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, old_path)]
 /// # #![allow(unused_must_use)]
 /// use std::old_io::*;
 /// use std::old_path::Path;
@@ -393,6 +400,7 @@ pub fn rename(from: &Path, to: &Path) -> IoResult<()> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, old_path)]
 /// # #![allow(unused_must_use)]
 /// use std::old_io::*;
 /// use std::old_path::Path;
@@ -444,6 +452,7 @@ fn update_err<T>(result: IoResult<T>, from: &Path, to: &Path) -> IoResult<T> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, old_path)]
 /// # #![allow(unused_must_use)]
 /// use std::old_io;
 /// use std::old_io::*;
@@ -516,6 +525,7 @@ pub fn readlink(path: &Path) -> IoResult<Path> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, old_path, old_fs)]
 /// # #![allow(unused_must_use)]
 /// use std::old_io;
 /// use std::old_io::*;
@@ -541,6 +551,7 @@ pub fn mkdir(path: &Path, mode: FilePermission) -> IoResult<()> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, old_path)]
 /// # #![allow(unused_must_use)]
 /// use std::old_io::*;
 /// use std::old_path::Path;
@@ -566,6 +577,7 @@ pub fn rmdir(path: &Path) -> IoResult<()> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, old_path)]
 /// use std::old_io::fs::PathExtensions;
 /// use std::old_io;
 /// use std::old_io::*;
index 1acc6abc8506f435f3cf47487670edaba65c132b..d877a60b079d7f6c8b8e1f2986c6055ea1d22f67 100644 (file)
@@ -54,6 +54,7 @@ fn write_all(&mut self, buf: &[u8]) -> IoResult<()> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, io)]
 /// # #![allow(unused_must_use)]
 /// use std::old_io::*;
 ///
@@ -114,6 +115,7 @@ fn write_all(&mut self, buf: &[u8]) -> IoResult<()> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io)]
 /// # #![allow(unused_must_use)]
 /// use std::old_io::*;
 ///
@@ -244,6 +246,7 @@ fn consume(&mut self, amt: uint) {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, io)]
 /// # #![allow(unused_must_use)]
 /// use std::old_io::*;
 ///
@@ -316,6 +319,7 @@ fn seek(&mut self, pos: i64, style: SeekStyle) -> IoResult<()> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io)]
 /// # #![allow(unused_must_use)]
 /// use std::old_io::*;
 ///
index 6dfb54fd66cc4107d167ab893ea4cbd6f57802c8..ac908c529dca661b0a6c2b70e59932919ff663ba 100644 (file)
@@ -48,6 +48,7 @@
 //! * Read lines from stdin
 //!
 //!     ```rust
+//!     # #![feature(old_io, old_path)]
 //!     use std::old_io as io;
 //!     use std::old_io::*;
 //!
@@ -60,6 +61,7 @@
 //! * Read a complete file
 //!
 //!     ```rust
+//!     # #![feature(old_io, old_path)]
 //!     use std::old_io::*;
 //!     use std::old_path::Path;
 //!
@@ -69,6 +71,7 @@
 //! * Write a line to a file
 //!
 //!     ```rust
+//!     # #![feature(old_io, old_path)]
 //!     # #![allow(unused_must_use)]
 //!     use std::old_io::*;
 //!     use std::old_path::Path;
@@ -82,6 +85,7 @@
 //! * Iterate over the lines of a file
 //!
 //!     ```rust,no_run
+//!     # #![feature(old_io, old_path)]
 //!     use std::old_io::*;
 //!     use std::old_path::Path;
 //!
@@ -95,6 +99,7 @@
 //! * Pull the lines of a file into a vector of strings
 //!
 //!     ```rust,no_run
+//!     # #![feature(old_io, old_path)]
 //!     use std::old_io::*;
 //!     use std::old_path::Path;
 //!
 //! * Make a simple TCP client connection and request
 //!
 //!     ```rust
+//!     # #![feature(old_io)]
 //!     # #![allow(unused_must_use)]
 //!     use std::old_io::*;
 //!
 //! * Make a simple TCP server
 //!
 //!     ```rust
+//!     # #![feature(old_io)]
 //!     # fn main() { }
 //!     # fn foo() {
 //!     # #![allow(dead_code)]
 //! If you wanted to handle the error though you might write:
 //!
 //! ```rust
+//! # #![feature(old_io, old_path)]
 //! # #![allow(unused_must_use)]
 //! use std::old_io::*;
 //! use std::old_path::Path;
 //! If you wanted to read several `u32`s from a file and return their product:
 //!
 //! ```rust
+//! # #![feature(old_io, old_path)]
 //! use std::old_io::*;
 //! use std::old_path::Path;
 //!
@@ -948,6 +957,7 @@ unsafe fn slice_vec_capacity<'a, T>(v: &'a mut Vec<T>, start: uint, end: uint) -
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io)]
 /// use std::old_io as io;
 /// use std::old_io::*;
 /// use std::old_io::util::LimitReader;
@@ -1282,6 +1292,7 @@ fn flush(&mut self) -> IoResult<()> { (**self).flush() }
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io)]
 /// use std::old_io::util::TeeReader;
 /// use std::old_io::*;
 ///
@@ -1407,6 +1418,7 @@ pub trait Buffer: Reader {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_io)]
     /// use std::old_io::*;
     ///
     /// let mut reader = BufReader::new(b"hello\nworld");
@@ -1631,6 +1643,7 @@ fn next(&mut self) -> Option<IoResult<T>> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io)]
 /// use std::old_io as io;
 ///
 /// let eof = io::standard_error(io::EndOfFile);
@@ -1719,6 +1732,7 @@ pub enum FileType {
 /// # Examples
 ///
 /// ```no_run
+/// # #![feature(old_io, old_path)]
 ///
 /// use std::old_io::fs::PathExtensions;
 /// use std::old_path::Path;
index 077a50725705286ade3fdc4d8d31990265b92c5f..f7953ac51b8e63e74146211226cb64399b8e7477 100644 (file)
@@ -414,6 +414,7 @@ fn from_str(s: &str) -> Result<SocketAddr, ParseError> {
 /// Some examples:
 ///
 /// ```rust,no_run
+/// # #![feature(old_io, core)]
 /// # #![allow(unused_must_use)]
 ///
 /// use std::old_io::{TcpStream, TcpListener};
index 77efedbc327d4cd06b81195d7de646740f5c53d5..f9e5ae71e12e5b737e7d92a62b3c17ba70e7077d 100644 (file)
@@ -54,6 +54,7 @@ impl UnixStream {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_io, old_path, io)]
     /// # #![allow(unused_must_use)]
     /// use std::old_io::net::pipe::UnixStream;
     /// use std::old_io::*;
@@ -181,6 +182,7 @@ impl UnixListener {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_io, io, old_path)]
     /// # fn foo() {
     /// use std::old_io::net::pipe::UnixListener;
     /// use std::old_io::*;
index dbf3c4a4b1ecbf8d153615b18d06c86eef25281d..75f786f0bb1e4d7271f4d5d312adabbecb116f58 100644 (file)
@@ -41,6 +41,7 @@
 /// # Examples
 ///
 /// ```no_run
+/// # #![feature(old_io, io)]
 /// use std::old_io::*;
 ///
 /// {
@@ -133,6 +134,7 @@ pub fn set_keepalive(&mut self, delay_in_seconds: Option<uint>) -> IoResult<()>
     /// # Examples
     ///
     /// ```no_run
+    /// # #![feature(old_io, std_misc)]
     /// # #![allow(unused_must_use)]
     /// use std::old_io::*;
     /// use std::time::Duration;
@@ -278,6 +280,7 @@ fn as_inner(&self) -> &TcpStreamImp {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io)]
 /// # fn foo() {
 /// use std::old_io::*;
 /// use std::thread;
@@ -374,6 +377,7 @@ impl TcpAcceptor {
     /// # Examples
     ///
     /// ```no_run
+    /// # #![feature(old_io, io)]
     /// use std::old_io::*;
     ///
     /// let mut a = TcpListener::bind("127.0.0.1:8482").listen().unwrap();
@@ -417,6 +421,7 @@ impl TcpAcceptor {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_io, io)]
     /// use std::old_io::*;
     /// use std::thread;
     ///
index 97ef3da2f369a26a2e1ffc639ecd600ebf72b96b..3aa811974b3aa965364da836c355e9a5694a9516 100644 (file)
@@ -31,6 +31,7 @@
 /// # Examples
 ///
 /// ```rust,no_run
+/// # #![feature(old_io)]
 /// # #![allow(unused_must_use)]
 ///
 /// use std::old_io::net::udp::UdpSocket;
index b2b28453c890514637237e5e77b5e27abe108eb5..0b555e2f0ff7e9c5eed72f11e3f135cc6c71070e 100644 (file)
@@ -46,6 +46,7 @@ impl PipeStream {
     /// # Examples
     ///
     /// ```{rust,no_run}
+    /// # #![feature(old_io, libc, io)]
     /// # #![allow(unused_must_use)]
     /// extern crate libc;
     ///
index 54fd20f45e298bd7ae44bf2f49c51075219a19c2..d7ede451fb8b79460b3916374ac59b4de9aad267 100644 (file)
@@ -61,6 +61,7 @@
 /// # Examples
 ///
 /// ```should_fail
+/// # #![feature(old_io)]
 /// use std::old_io::*;
 ///
 /// let mut child = match Command::new("/bin/cat").arg("file.txt").spawn() {
@@ -164,6 +165,7 @@ fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
 /// to be changed (for example, by adding arguments) prior to spawning:
 ///
 /// ```
+/// # #![feature(old_io)]
 /// use std::old_io::*;
 ///
 /// let mut process = match Command::new("sh").arg("-c").arg("echo hello").spawn() {
@@ -365,6 +367,7 @@ pub fn spawn(&self) -> IoResult<Process> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_io, core)]
     /// use std::old_io::Command;
     ///
     /// let output = match Command::new("cat").arg("foot.txt").output() {
@@ -386,6 +389,7 @@ pub fn output(&self) -> IoResult<ProcessOutput> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_io)]
     /// use std::old_io::Command;
     ///
     /// let status = match Command::new("ls").status() {
@@ -660,6 +664,7 @@ pub fn wait(&mut self) -> IoResult<ProcessExit> {
     /// # Examples
     ///
     /// ```no_run
+    /// # #![feature(old_io, io)]
     /// use std::old_io::{Command, IoResult};
     /// use std::old_io::process::ProcessExit;
     ///
index a1c8630e0ec319efb0bfcb3537cbb9e6b8303d30..90d270849114186f57d96fed9290e4c50b124feb 100644 (file)
@@ -18,6 +18,7 @@
 //! # Examples
 //!
 //! ```rust
+//! # #![feature(old_io)]
 //! # #![allow(unused_must_use)]
 //! use std::old_io;
 //! use std::old_io::*;
@@ -140,6 +141,7 @@ impl StdinReader {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_io)]
     /// use std::old_io;
     /// use std::old_io::*;
     ///
@@ -238,7 +240,7 @@ pub fn stdin() -> StdinReader {
             STDIN = boxed::into_raw(box stdin);
 
             // Make sure to free it at exit
-            rt::at_exit(|| {
+            let _ = rt::at_exit(|| {
                 Box::from_raw(STDIN);
                 STDIN = ptr::null_mut();
             });
@@ -335,10 +337,10 @@ pub fn set_stderr(_stderr: Box<Writer + Send>) -> Option<Box<Writer + Send>> {
 //      })
 //  })
 fn with_task_stdout<F>(f: F) where F: FnOnce(&mut Writer) -> IoResult<()> {
-    let mut my_stdout = LOCAL_STDOUT.with(|slot| {
+    let mut my_stdout: Box<Writer + Send> = LOCAL_STDOUT.with(|slot| {
         slot.borrow_mut().take()
     }).unwrap_or_else(|| {
-        box stdout() as Box<Writer + Send>
+        box stdout()
     });
     let result = f(&mut *my_stdout);
     let mut var = Some(my_stdout);
index 90b3d1004c0b35d95d9b0454e7c3fc89f403855e..c0f6ddaaef7cc3e7264ea3a465e6c34fcc72bff4 100644 (file)
@@ -29,6 +29,7 @@
 /// # Examples
 ///
 /// ```no_run
+/// # #![feature(old_io, old_path)]
 /// use std::old_io::*;
 /// use std::old_path::{Path, GenericPath};
 ///
index 65c62a99335220d5409934483f254316163c4884..f8cba0444433175b02a141ed88cdd62b234b81c5 100644 (file)
@@ -31,6 +31,7 @@
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_io, std_misc)]
 /// # fn foo() {
 /// use std::old_io::Timer;
 /// use std::time::Duration;
@@ -54,6 +55,7 @@
 /// the `old_io::timer` module.
 ///
 /// ```
+/// # #![feature(old_io, std_misc)]
 /// # fn foo() {
 /// use std::old_io::timer;
 /// use std::time::Duration;
@@ -116,6 +118,7 @@ pub fn sleep(&mut self, duration: Duration) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_io, std_misc)]
     /// use std::old_io::Timer;
     /// use std::time::Duration;
     ///
@@ -129,6 +132,7 @@ pub fn sleep(&mut self, duration: Duration) {
     /// ```
     ///
     /// ```
+    /// # #![feature(old_io, std_misc)]
     /// use std::old_io::Timer;
     /// use std::time::Duration;
     ///
@@ -168,6 +172,7 @@ pub fn oneshot(&mut self, duration: Duration) -> Receiver<()> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_io, std_misc)]
     /// use std::old_io::Timer;
     /// use std::time::Duration;
     ///
@@ -187,6 +192,7 @@ pub fn oneshot(&mut self, duration: Duration) -> Receiver<()> {
     /// ```
     ///
     /// ```
+    /// # #![feature(old_io, std_misc)]
     /// use std::old_io::Timer;
     /// use std::time::Duration;
     ///
index 909fa4062b6042086e0748061d613f0d530019cd..50bda04b5d0745c33ce30b2baab8b886e472923e 100644 (file)
@@ -49,6 +49,7 @@
 //! ## Examples
 //!
 //! ```rust
+//! # #![feature(old_path, old_io)]
 //! use std::old_io::fs::PathExtensions;
 //! use std::old_path::{Path, GenericPath};
 //!
@@ -143,6 +144,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -168,6 +170,7 @@ fn new<T: BytesContainer>(path: T) -> Self {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -191,6 +194,7 @@ fn new_opt<T: BytesContainer>(path: T) -> Option<Self> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -209,6 +213,7 @@ fn as_str<'a>(&'a self) -> Option<&'a str> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -224,6 +229,7 @@ fn as_str<'a>(&'a self) -> Option<&'a str> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -240,6 +246,7 @@ fn as_str<'a>(&'a self) -> Option<&'a str> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -259,6 +266,7 @@ fn display<'a>(&'a self) -> Display<'a, Self> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -277,6 +285,7 @@ fn filename_display<'a>(&'a self) -> Display<'a, Self> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -293,6 +302,7 @@ fn filename_display<'a>(&'a self) -> Display<'a, Self> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -313,6 +323,7 @@ fn dirname_str<'a>(&'a self) -> Option<&'a str> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -329,6 +340,7 @@ fn dirname_str<'a>(&'a self) -> Option<&'a str> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -349,6 +361,7 @@ fn filename_str<'a>(&'a self) -> Option<&'a str> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -377,6 +390,7 @@ fn filestem<'a>(&'a self) -> Option<&'a [u8]> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -398,6 +412,7 @@ fn filestem_str<'a>(&'a self) -> Option<&'a str> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -426,6 +441,7 @@ fn extension<'a>(&'a self) -> Option<&'a [u8]> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -445,6 +461,7 @@ fn extension_str<'a>(&'a self) -> Option<&'a str> {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -472,6 +489,7 @@ fn set_filename<T: BytesContainer>(&mut self, filename: T) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -523,6 +541,7 @@ fn set_extension<T: BytesContainer>(&mut self, extension: T) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -549,6 +568,7 @@ fn with_filename<T: BytesContainer>(&self, filename: T) -> Self {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -574,6 +594,7 @@ fn with_extension<T: BytesContainer>(&self, extension: T) -> Self {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -594,6 +615,7 @@ fn dir_path(&self) -> Self {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -610,6 +632,7 @@ fn dir_path(&self) -> Self {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -635,6 +658,7 @@ fn push<T: BytesContainer>(&mut self, path: T) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -665,6 +689,7 @@ fn push_many<T: BytesContainer>(&mut self, paths: &[T]) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -683,6 +708,7 @@ fn push_many<T: BytesContainer>(&mut self, paths: &[T]) {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -709,6 +735,7 @@ fn join<T: BytesContainer>(&self, path: T) -> Self {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -732,6 +759,7 @@ fn join_many<T: BytesContainer>(&self, paths: &[T]) -> Self {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -750,6 +778,7 @@ fn join_many<T: BytesContainer>(&self, paths: &[T]) -> Self {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -769,6 +798,7 @@ fn is_relative(&self) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -789,6 +819,7 @@ fn is_relative(&self) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
@@ -806,6 +837,7 @@ fn is_relative(&self) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// # foo();
     /// # #[cfg(windows)] fn foo() {}
index cea2c238ecec29d2fe5e565bd1e72d363146e089..4f367e3052673eb839b7f32ff656588a2d627b01 100644 (file)
@@ -605,6 +605,7 @@ impl Path {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// println!("{}", Path::new(r"C:\some\path").display());
     /// ```
@@ -620,6 +621,7 @@ pub fn new<T: BytesContainer>(path: T) -> Path {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(old_path)]
     /// use std::old_path::{Path, GenericPath};
     /// let path = Path::new_opt(r"C:\some\path");
     ///
index 3870b8614ffdfe05fbdaafc4c698bb4b34d26dc9..40aaea7aca0b796b98504c164bc8c35e373e393b 100644 (file)
@@ -38,6 +38,7 @@
 
 use boxed::Box;
 use clone::Clone;
+use convert::From;
 use env;
 use error::{FromError, Error};
 use ffi::{OsString, OsStr};
@@ -79,12 +80,12 @@ fn err2old(new: ::io::Error) -> IoError {
 
 #[cfg(windows)]
 fn path2new(path: &Path) -> PathBuf {
-    PathBuf::new(path.as_str().unwrap())
+    PathBuf::from(path.as_str().unwrap())
 }
 #[cfg(unix)]
 fn path2new(path: &Path) -> PathBuf {
     use os::unix::prelude::*;
-    PathBuf::new(<OsStr as OsStrExt>::from_bytes(path.as_vec()))
+    PathBuf::from(<OsStr as OsStrExt>::from_bytes(path.as_vec()))
 }
 
 #[cfg(unix)]
@@ -125,6 +126,7 @@ pub fn num_cpus() -> uint {
 /// # Examples
 ///
 /// ```
+/// # #![feature(os, old_path)]
 /// use std::os;
 /// use std::old_path::{Path, GenericPath};
 ///
@@ -146,6 +148,7 @@ pub fn getcwd() -> IoResult<Path> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(os)]
 /// use std::os;
 ///
 /// // We will iterate through the references to the element returned by os::env();
@@ -182,6 +185,7 @@ pub fn env_as_bytes() -> Vec<(Vec<u8>, Vec<u8>)> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(os)]
 /// use std::os;
 ///
 /// let key = "HOME";
@@ -224,6 +228,7 @@ fn byteify(s: OsString) -> Vec<u8> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(os)]
 /// use std::os;
 ///
 /// let key = "KEY";
@@ -265,6 +270,7 @@ pub fn unsetenv(n: &str) {
 /// # Examples
 ///
 /// ```
+/// # #![feature(old_path, os)]
 /// use std::os;
 /// use std::old_path::{Path, GenericPath};
 ///
@@ -298,6 +304,7 @@ pub fn split_paths<T: BytesContainer>(unparsed: T) -> Vec<Path> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(os, old_path, core)]
 /// use std::os;
 /// use std::old_path::Path;
 ///
@@ -359,6 +366,7 @@ pub fn dll_filename(base: &str) -> String {
 /// # Examples
 ///
 /// ```
+/// # #![feature(os, old_path)]
 /// use std::os;
 /// use std::old_path::{Path, GenericPath};
 ///
@@ -380,6 +388,7 @@ pub fn self_exe_name() -> Option<Path> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(os, old_path)]
 /// use std::os;
 /// use std::old_path::{Path, GenericPath};
 ///
@@ -410,6 +419,7 @@ pub fn self_exe_path() -> Option<Path> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(os, old_path)]
 /// use std::os;
 /// use std::old_path::{Path, GenericPath};
 ///
@@ -501,6 +511,7 @@ fn lookup() -> Path {
 /// # Examples
 ///
 /// ```
+/// # #![feature(os, old_path)]
 /// use std::os;
 /// use std::old_path::{Path, GenericPath};
 ///
@@ -533,6 +544,7 @@ pub fn make_absolute(p: &Path) -> IoResult<Path> {
 /// # Examples
 ///
 /// ```
+/// # #![feature(os, old_path)]
 /// use std::os;
 /// use std::old_path::{Path, GenericPath};
 ///
@@ -555,6 +567,7 @@ pub fn errno() -> i32 {
 /// # Examples
 ///
 /// ```
+/// # #![feature(os)]
 /// use std::os;
 ///
 /// // Same as println!("{}", last_os_error());
@@ -751,6 +764,7 @@ fn CommandLineToArgvW(lpCmdLine: LPCWSTR,
 /// # Examples
 ///
 /// ```
+/// # #![feature(os)]
 /// use std::os;
 ///
 /// // Prints each argument on a separate line
index ddceed14cc6ce51a49ea3bbb680be1a71d56fd97..50f79967f555ef86a707fcd4f96d798f9eb2daa9 100644 (file)
 //! To build or modify paths, use `PathBuf`:
 //!
 //! ```rust
+//! # #![feature(convert)]
 //! use std::path::PathBuf;
 //!
-//! let mut path = PathBuf::new("c:\\");
+//! let mut path = PathBuf::from("c:\\");
 //! path.push("windows");
 //! path.push("system32");
 //! path.set_extension("dll");
 use iter::{self, IntoIterator};
 use mem;
 use ops::{self, Deref};
+use string::String;
 use vec::Vec;
 use fmt;
 
@@ -527,6 +529,13 @@ pub fn as_os_str(self) -> &'a OsStr {
     }
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> AsRef<OsStr> for Component<'a> {
+    fn as_ref(&self) -> &OsStr {
+        self.as_os_str()
+    }
+}
+
 /// The core iterator giving the components of a path.
 ///
 /// See the module documentation for an in-depth explanation of components and
@@ -601,6 +610,7 @@ fn is_sep_byte(&self, b: u8) -> bool {
     }
 
     /// Extract a slice corresponding to the portion of the path remaining for iteration.
+    #[stable(feature = "rust1", since = "1.0.0")]
     pub fn as_path(&self) -> &'a Path {
         let mut comps = self.clone();
         if comps.front == State::Body { comps.trim_left(); }
@@ -695,6 +705,20 @@ pub fn peek(&self) -> Option<Component<'a>> {
     }
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> AsRef<Path> for Components<'a> {
+    fn as_ref(&self) -> &Path {
+        self.as_path()
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> AsRef<OsStr> for Components<'a> {
+    fn as_ref(&self) -> &OsStr {
+        self.as_path().as_os_str()
+    }
+}
+
 impl<'a> Iter<'a> {
     /// Extract a slice corresponding to the portion of the path remaining for iteration.
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -703,6 +727,20 @@ pub fn as_path(&self) -> &'a Path {
     }
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> AsRef<Path> for Iter<'a> {
+    fn as_ref(&self) -> &Path {
+        self.as_path()
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> AsRef<OsStr> for Iter<'a> {
+    fn as_ref(&self) -> &OsStr {
+        self.as_path().as_os_str()
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a> Iterator for Iter<'a> {
     type Item = &'a OsStr;
@@ -855,9 +893,10 @@ fn cmp(&self, other: &Components<'a>) -> cmp::Ordering {
 /// # Examples
 ///
 /// ```
+/// # #![feature(convert)]
 /// use std::path::PathBuf;
 ///
-/// let mut path = PathBuf::new("c:\\");
+/// let mut path = PathBuf::from("c:\\");
 /// path.push("windows");
 /// path.push("system32");
 /// path.set_extension("dll");
@@ -873,11 +912,10 @@ fn as_mut_vec(&mut self) -> &mut Vec<u8> {
         unsafe { mem::transmute(self) }
     }
 
-    /// Allocate a `PathBuf` with initial contents given by the
-    /// argument.
+    /// Allocate an empty `PathBuf`.
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn new<S: AsOsStr>(s: S) -> PathBuf {
-        PathBuf { inner: s.as_os_str().to_os_string() }
+    pub fn new() -> PathBuf {
+        PathBuf { inner: OsString::new() }
     }
 
     /// Extend `self` with `path`.
@@ -890,8 +928,8 @@ pub fn new<S: AsOsStr>(s: S) -> PathBuf {
     ///   replaces everything except for the prefix (if any) of `self`.
     /// * if `path` has a prefix but no root, it replaces `self.
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn push<P: AsPath>(&mut self, path: P) {
-        let path = path.as_path();
+    pub fn push<P: AsRef<Path>>(&mut self, path: P) {
+        let path = path.as_ref();
 
         // in general, a separator is needed if the rightmost byte is not a separator
         let mut need_sep = self.as_mut_vec().last().map(|c| !is_sep_byte(*c)).unwrap_or(false);
@@ -947,23 +985,24 @@ pub fn pop(&mut self) -> bool {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(convert)]
     /// use std::path::PathBuf;
     ///
-    /// let mut buf = PathBuf::new("/");
+    /// let mut buf = PathBuf::from("/");
     /// assert!(buf.file_name() == None);
     /// buf.set_file_name("bar");
-    /// assert!(buf == PathBuf::new("/bar"));
+    /// assert!(buf == PathBuf::from("/bar"));
     /// assert!(buf.file_name().is_some());
     /// buf.set_file_name("baz.txt");
-    /// assert!(buf == PathBuf::new("/baz.txt"));
+    /// assert!(buf == PathBuf::from("/baz.txt"));
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn set_file_name<S: AsOsStr>(&mut self, file_name: S) {
+    pub fn set_file_name<S: AsRef<OsStr>>(&mut self, file_name: S) {
         if self.file_name().is_some() {
             let popped = self.pop();
             debug_assert!(popped);
         }
-        self.push(file_name.as_os_str());
+        self.push(file_name.as_ref());
     }
 
     /// Updates `self.extension()` to `extension`.
@@ -973,15 +1012,15 @@ pub fn set_file_name<S: AsOsStr>(&mut self, file_name: S) {
     /// Otherwise, returns `true`; if `self.extension()` is `None`, the extension
     /// is added; otherwise it is replaced.
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn set_extension<S: AsOsStr>(&mut self, extension: S) -> bool {
+    pub fn set_extension<S: AsRef<OsStr>>(&mut self, extension: S) -> bool {
         if self.file_name().is_none() { return false; }
 
         let mut stem = match self.file_stem() {
             Some(stem) => stem.to_os_string(),
-            None => OsString::from_str(""),
+            None => OsString::new(),
         };
 
-        let extension = extension.as_os_str();
+        let extension = extension.as_ref();
         if os_str_as_u8_slice(extension).len() > 0 {
             stem.push(".");
             stem.push(extension);
@@ -999,16 +1038,65 @@ pub fn into_os_string(self) -> OsString {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<P: AsPath> iter::FromIterator<P> for PathBuf {
+impl<'a> From<&'a Path> for PathBuf {
+    fn from(s: &'a Path) -> PathBuf {
+        s.to_path_buf()
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> From<&'a str> for PathBuf {
+    fn from(s: &'a str) -> PathBuf {
+        PathBuf::from(OsString::from(s))
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> From<&'a String> for PathBuf {
+    fn from(s: &'a String) -> PathBuf {
+        PathBuf::from(OsString::from(s))
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl From<String> for PathBuf {
+    fn from(s: String) -> PathBuf {
+        PathBuf::from(OsString::from(s))
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> From<&'a OsStr> for PathBuf {
+    fn from(s: &'a OsStr) -> PathBuf {
+        PathBuf::from(OsString::from(s))
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a> From<&'a OsString> for PathBuf {
+    fn from(s: &'a OsString) -> PathBuf {
+        PathBuf::from(s.to_os_string())
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl From<OsString> for PathBuf {
+    fn from(s: OsString) -> PathBuf {
+        PathBuf { inner: s }
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<P: AsRef<Path>> iter::FromIterator<P> for PathBuf {
     fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> PathBuf {
-        let mut buf = PathBuf::new("");
+        let mut buf = PathBuf::new();
         buf.extend(iter);
         buf
     }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<P: AsPath> iter::Extend<P> for PathBuf {
+impl<P: AsRef<Path>> iter::Extend<P> for PathBuf {
     fn extend<I: IntoIterator<Item = P>>(&mut self, iter: I) {
         for p in iter {
             self.push(p)
@@ -1084,12 +1172,27 @@ fn cmp(&self, other: &PathBuf) -> cmp::Ordering {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<OsStr> for PathBuf {
+    fn as_ref(&self) -> &OsStr {
+        &self.inner[..]
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
 impl AsOsStr for PathBuf {
     fn as_os_str(&self) -> &OsStr {
         &self.inner[..]
     }
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+impl Into<OsString> for PathBuf {
+    fn into(self) -> OsString {
+        self.inner
+    }
+}
+
 /// A slice of a path (akin to `str`).
 ///
 /// This type supports a number of operations for inspecting a path, including
@@ -1133,8 +1236,14 @@ fn as_u8_slice(&self) -> &[u8] {
     ///
     /// This is a cost-free conversion.
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn new<S: ?Sized + AsOsStr>(s: &S) -> &Path {
-        unsafe { mem::transmute(s.as_os_str()) }
+    pub fn new<S: AsRef<OsStr> + ?Sized>(s: &S) -> &Path {
+        unsafe { mem::transmute(s.as_ref()) }
+    }
+
+    /// Yield the underlying `OsStr` slice.
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn as_os_str(&self) -> &OsStr {
+        &self.inner
     }
 
     /// Yield a `&str` slice if the `Path` is valid unicode.
@@ -1156,7 +1265,7 @@ pub fn to_string_lossy(&self) -> Cow<str> {
     /// Convert a `Path` to an owned `PathBuf`.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn to_path_buf(&self) -> PathBuf {
-        PathBuf::new(self)
+        PathBuf::from(self.inner.to_os_string())
     }
 
     /// A path is *absolute* if it is independent of the current directory.
@@ -1243,23 +1352,25 @@ pub fn file_name(&self) -> Option<&OsStr> {
     }
 
     /// Returns a path that, when joined onto `base`, yields `self`.
+    ///
+    /// If `base` is not a prefix of `self` (i.e. `starts_with`
+    /// returns false), then `relative_from` returns `None`.
     #[unstable(feature = "path_relative_from", reason = "see #23284")]
-    pub fn relative_from<'a, P: ?Sized>(&'a self, base: &'a P) -> Option<&Path> where
-        P: AsPath
+    pub fn relative_from<'a, P: ?Sized + AsRef<Path>>(&'a self, base: &'a P) -> Option<&Path>
     {
-        iter_after(self.components(), base.as_path().components()).map(|c| c.as_path())
+        iter_after(self.components(), base.as_ref().components()).map(|c| c.as_path())
     }
 
     /// Determines whether `base` is a prefix of `self`.
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn starts_with<P: AsPath>(&self, base: P) -> bool {
-        iter_after(self.components(), base.as_path().components()).is_some()
+    pub fn starts_with<P: AsRef<Path>>(&self, base: P) -> bool {
+        iter_after(self.components(), base.as_ref().components()).is_some()
     }
 
     /// Determines whether `child` is a suffix of `self`.
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn ends_with<P: AsPath>(&self, child: P) -> bool {
-        iter_after(self.components().rev(), child.as_path().components().rev()).is_some()
+    pub fn ends_with<P: AsRef<Path>>(&self, child: P) -> bool {
+        iter_after(self.components().rev(), child.as_ref().components().rev()).is_some()
     }
 
     /// Extract the stem (non-extension) portion of `self.file()`.
@@ -1292,7 +1403,7 @@ pub fn extension(&self) -> Option<&OsStr> {
     ///
     /// See `PathBuf::push` for more details on what it means to adjoin a path.
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn join<P: AsPath>(&self, path: P) -> PathBuf {
+    pub fn join<P: AsRef<Path>>(&self, path: P) -> PathBuf {
         let mut buf = self.to_path_buf();
         buf.push(path);
         buf
@@ -1302,7 +1413,7 @@ pub fn join<P: AsPath>(&self, path: P) -> PathBuf {
     ///
     /// See `PathBuf::set_file_name` for more details.
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn with_file_name<S: AsOsStr>(&self, file_name: S) -> PathBuf {
+    pub fn with_file_name<S: AsRef<OsStr>>(&self, file_name: S) -> PathBuf {
         let mut buf = self.to_path_buf();
         buf.set_file_name(file_name);
         buf
@@ -1312,7 +1423,7 @@ pub fn with_file_name<S: AsOsStr>(&self, file_name: S) -> PathBuf {
     ///
     /// See `PathBuf::set_extension` for more details.
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn with_extension<S: AsOsStr>(&self, extension: S) -> PathBuf {
+    pub fn with_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf {
         let mut buf = self.to_path_buf();
         buf.set_extension(extension);
         buf
@@ -1346,6 +1457,14 @@ pub fn display(&self) -> Display {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<OsStr> for Path {
+    fn as_ref(&self) -> &OsStr {
+        &self.inner
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
 impl AsOsStr for Path {
     fn as_os_str(&self) -> &OsStr {
         &self.inner
@@ -1405,6 +1524,7 @@ fn cmp(&self, other: &Path) -> cmp::Ordering {
 
 /// Freely convertible to a `Path`.
 #[unstable(feature = "std_misc")]
+#[deprecated(since = "1.0.0", reason = "use std::convert::AsRef<Path> instead")]
 pub trait AsPath {
     /// Convert to a `Path`.
     #[unstable(feature = "std_misc")]
@@ -1412,10 +1532,42 @@ pub trait AsPath {
 }
 
 #[unstable(feature = "std_misc")]
+#[deprecated(since = "1.0.0", reason = "use std::convert::AsRef<Path> instead")]
+#[allow(deprecated)]
 impl<T: AsOsStr + ?Sized> AsPath for T {
     fn as_path(&self) -> &Path { Path::new(self.as_os_str()) }
 }
 
+#[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<Path> for Path {
+    fn as_ref(&self) -> &Path { self }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<Path> for OsStr {
+    fn as_ref(&self) -> &Path { Path::new(self) }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<Path> for OsString {
+    fn as_ref(&self) -> &Path { Path::new(self) }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<Path> for str {
+    fn as_ref(&self) -> &Path { Path::new(self) }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<Path> for String {
+    fn as_ref(&self) -> &Path { Path::new(self) }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl AsRef<Path> for PathBuf {
+    fn as_ref(&self) -> &Path { self }
+}
+
 #[cfg(test)]
 mod tests {
     use super::*;
@@ -1512,7 +1664,7 @@ fn into_cow() {
 
         let static_path = Path::new("/home/foo");
         let static_cow_path: Cow<'static, Path> = static_path.into_cow();
-        let pathbuf = PathBuf::new("/home/foo");
+        let pathbuf = PathBuf::from("/home/foo");
 
         {
             let path: &Path = &pathbuf;
@@ -2394,7 +2546,7 @@ pub fn test_stem_ext() {
     pub fn test_push() {
         macro_rules! tp(
             ($path:expr, $push:expr, $expected:expr) => ( {
-                let mut actual = PathBuf::new($path);
+                let mut actual = PathBuf::from($path);
                 actual.push($push);
                 assert!(actual.to_str() == Some($expected),
                         "pushing {:?} onto {:?}: Expected {:?}, got {:?}",
@@ -2482,7 +2634,7 @@ macro_rules! tp(
     pub fn test_pop() {
         macro_rules! tp(
             ($path:expr, $expected:expr, $output:expr) => ( {
-                let mut actual = PathBuf::new($path);
+                let mut actual = PathBuf::from($path);
                 let output = actual.pop();
                 assert!(actual.to_str() == Some($expected) && output == $output,
                         "popping from {:?}: Expected {:?}/{:?}, got {:?}/{:?}",
@@ -2536,7 +2688,7 @@ macro_rules! tp(
     pub fn test_set_file_name() {
         macro_rules! tfn(
                 ($path:expr, $file:expr, $expected:expr) => ( {
-                let mut p = PathBuf::new($path);
+                let mut p = PathBuf::from($path);
                 p.set_file_name($file);
                 assert!(p.to_str() == Some($expected),
                         "setting file name of {:?} to {:?}: Expected {:?}, got {:?}",
@@ -2570,7 +2722,7 @@ macro_rules! tfn(
     pub fn test_set_extension() {
         macro_rules! tfe(
                 ($path:expr, $ext:expr, $expected:expr, $output:expr) => ( {
-                let mut p = PathBuf::new($path);
+                let mut p = PathBuf::from($path);
                 let output = p.set_extension($ext);
                 assert!(p.to_str() == Some($expected) && output == $output,
                         "setting extension of {:?} to {:?}: Expected {:?}/{:?}, got {:?}/{:?}",
index a0b4c80e9f3fa47e886a8434064e9621662f713c..6e12ac1a226592b864354231aed50703fd0f8e4f 100644 (file)
@@ -29,6 +29,8 @@
 #[doc(no_inline)] pub use clone::Clone;
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(no_inline)] pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
+#[unstable(feature = "convert")]
+#[doc(no_inline)] pub use convert::{AsRef, AsMut, Into, From};
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(no_inline)] pub use iter::DoubleEndedIterator;
 #[stable(feature = "rust1", since = "1.0.0")]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(no_inline)] pub use result::Result::{self, Ok, Err};
 #[stable(feature = "rust1", since = "1.0.0")]
+#[allow(deprecated)]
 #[doc(no_inline)] pub use slice::{SliceConcatExt, AsSlice};
 #[stable(feature = "rust1", since = "1.0.0")]
+#[allow(deprecated)]
 #[doc(no_inline)] pub use str::Str;
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(no_inline)] pub use string::{String, ToString};
index 6b09636c1df1e8a370621a854db33ff569dbd05e..553412c83712f6dcf4b44c275f62f628ef0109cc 100644 (file)
@@ -19,8 +19,8 @@
 use ffi::AsOsStr;
 use fmt;
 use io::{self, Error, ErrorKind};
-use path::AsPath;
 use libc;
+use path;
 use sync::mpsc::{channel, Receiver};
 use sys::pipe2::{self, AnonPipe};
 use sys::process2::Process as ProcessImp;
@@ -198,8 +198,8 @@ pub fn env_clear(&mut self) -> &mut Command {
 
     /// Set the working directory for the child process.
     #[stable(feature = "process", since = "1.0.0")]
-    pub fn current_dir<P: AsPath>(&mut self, dir: P) -> &mut Command {
-        self.inner.cwd(dir.as_path().as_os_str());
+    pub fn current_dir<P: AsRef<path::Path>>(&mut self, dir: P) -> &mut Command {
+        self.inner.cwd(dir.as_ref().as_os_str());
         self
     }
 
@@ -770,7 +770,7 @@ fn test_change_working_directory() {
         // test changing to the parent of os::getcwd() because we know
         // the path exists (and os::getcwd() is not expected to be root)
         let parent_dir = os::getcwd().unwrap().dir_path();
-        let result = pwd_cmd().current_dir(&parent_dir).output().unwrap();
+        let result = pwd_cmd().current_dir(parent_dir.as_str().unwrap()).output().unwrap();
 
         let output = String::from_utf8(result.stdout).unwrap();
         let child_dir = old_path::Path::new(output.trim());
index 69053252ed1de1e944d5ec6b69082910213b55a7..656ca980624dcdcf9302693bbbbb11ed3e4cbae0 100644 (file)
@@ -58,6 +58,7 @@
 //! # Examples
 //!
 //! ```rust
+//! # #![feature(rand)]
 //! use std::rand;
 //! use std::rand::Rng;
 //!
@@ -68,6 +69,7 @@
 //! ```
 //!
 //! ```rust
+//! # #![feature(rand)]
 //! use std::rand;
 //!
 //! let tuple = rand::random::<(f64, char)>();
@@ -92,6 +94,7 @@
 //! multiply this fraction by 4.
 //!
 //! ```
+//! # #![feature(rand)]
 //! use std::rand;
 //! use std::rand::distributions::{IndependentSample, Range};
 //!
 //! [Monty Hall Problem]: http://en.wikipedia.org/wiki/Monty_Hall_problem
 //!
 //! ```
+//! # #![feature(rand)]
 //! use std::rand;
 //! use std::rand::Rng;
 //! use std::rand::distributions::{IndependentSample, Range};
@@ -384,6 +388,7 @@ fn fill_bytes(&mut self, bytes: &mut [u8]) {
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand;
 ///
 /// let x: u8 = rand::random();
@@ -400,6 +405,7 @@ fn fill_bytes(&mut self, bytes: &mut [u8]) {
 /// Caching the thread local random number generator:
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand;
 /// use std::rand::Rng;
 ///
@@ -427,6 +433,7 @@ pub fn random<T: Rand>() -> T {
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand)]
 /// use std::rand::{thread_rng, sample};
 ///
 /// let mut rng = thread_rng();
index 5231b122b9e538f61799dbffb62320ff2eef9b18..d3a8fa864fce39a0594f26cba18ffaba1dcb1cbb 100644 (file)
@@ -24,6 +24,7 @@
 /// # Examples
 ///
 /// ```
+/// # #![feature(rand, old_io)]
 /// use std::rand::{reader, Rng};
 /// use std::old_io::MemReader;
 ///
index 9fa12b1ef30239472e35a3dc2b948ebc4950b782..9079c0aaffb7d3669e6bd57ecce4dde8d7b8c6c2 100644 (file)
 //!
 //! Documentation can be found on the `rt::at_exit` function.
 
+// FIXME: switch this to use atexit. Currently this
+// segfaults (the queue's memory is mysteriously gone), so
+// instead the cleanup is tied to the `std::rt` entry point.
+
 use boxed;
 use boxed::Box;
 use vec::Vec;
 static LOCK: Mutex = MUTEX_INIT;
 static mut QUEUE: *mut Queue = 0 as *mut Queue;
 
-unsafe fn init() {
+// The maximum number of times the cleanup routines will be run. While running
+// the at_exit closures new ones may be registered, and this count is the number
+// of times the new closures will be allowed to register successfully. After
+// this number of iterations all new registrations will return `false`.
+const ITERS: usize = 10;
+
+unsafe fn init() -> bool {
     if QUEUE.is_null() {
         let state: Box<Queue> = box Vec::new();
         QUEUE = boxed::into_raw(state);
-    } else {
+    } else if QUEUE as usize == 1 {
         // can't re-init after a cleanup
-        rtassert!(QUEUE as uint != 1);
+        return false
     }
 
-    // FIXME: switch this to use atexit as below. Currently this
-    // segfaults (the queue's memory is mysteriously gone), so
-    // instead the cleanup is tied to the `std::rt` entry point.
-    //
-    // ::libc::atexit(cleanup);
+    return true
 }
 
 pub fn cleanup() {
-    unsafe {
-        LOCK.lock();
-        let queue = QUEUE;
-        QUEUE = 1 as *mut _;
-        LOCK.unlock();
+    for i in 0..ITERS {
+        unsafe {
+            LOCK.lock();
+            let queue = QUEUE;
+            QUEUE = if i == ITERS - 1 {1} else {0} as *mut _;
+            LOCK.unlock();
 
-        // make sure we're not recursively cleaning up
-        rtassert!(queue as uint != 1);
+            // make sure we're not recursively cleaning up
+            rtassert!(queue as usize != 1);
 
-        // If we never called init, not need to cleanup!
-        if queue as uint != 0 {
-            let queue: Box<Queue> = Box::from_raw(queue);
-            for to_run in *queue {
-                to_run.invoke(());
+            // If we never called init, not need to cleanup!
+            if queue as usize != 0 {
+                let queue: Box<Queue> = Box::from_raw(queue);
+                for to_run in *queue {
+                    to_run.invoke(());
+                }
             }
         }
     }
 }
 
-pub fn push(f: Thunk<'static>) {
+pub fn push(f: Thunk<'static>) -> bool {
+    let mut ret = true;
     unsafe {
         LOCK.lock();
-        init();
-        (*QUEUE).push(f);
+        if init() {
+            (*QUEUE).push(f);
+        } else {
+            ret = false;
+        }
         LOCK.unlock();
     }
+    return ret
 }
index e52e68dad23faec8358bd4c7f63b501eb1e39e49..497076cc6ac34795e763897cdee911c6f9fba400 100644 (file)
 //! time being.
 
 #![unstable(feature = "std_misc")]
-
-// FIXME: this should not be here.
 #![allow(missing_docs)]
 
-#![allow(dead_code)]
-
-use marker::Send;
-use ops::FnOnce;
+use prelude::v1::*;
 use sys;
 use thunk::Thunk;
 use usize;
@@ -73,7 +68,7 @@ fn lang_start(main: *const u8, argc: int, argv: *const *const u8) -> int {
     use thread::Thread;
 
     let something_around_the_top_of_the_stack = 1;
-    let addr = &something_around_the_top_of_the_stack as *const int;
+    let addr = &something_around_the_top_of_the_stack as *const _ as *const int;
     let my_stack_top = addr as uint;
 
     // FIXME #11359 we just assume that this thread has a stack of a
@@ -149,13 +144,16 @@ fn lang_start(main: *const u8, argc: int, argv: *const *const u8) -> int {
 
 /// Enqueues a procedure to run when the main thread exits.
 ///
-/// It is forbidden for procedures to register more `at_exit` handlers when they
-/// are running, and doing so will lead to a process abort.
+/// Currently these closures are only run once the main *Rust* thread exits.
+/// Once the `at_exit` handlers begin running, more may be enqueued, but not
+/// infinitely so. Eventually a handler registration will be forced to fail.
 ///
-/// Note that other threads may still be running when `at_exit` routines start
-/// running.
-pub fn at_exit<F: FnOnce() + Send + 'static>(f: F) {
-    at_exit_imp::push(Thunk::new(f));
+/// Returns `Ok` if the handler was successfully registered, meaning that the
+/// closure will be run once the main thread exits. Returns `Err` to indicate
+/// that the closure could not be registered, meaning that it is not scheduled
+/// to be rune.
+pub fn at_exit<F: FnOnce() + Send + 'static>(f: F) -> Result<(), ()> {
+    if at_exit_imp::push(Thunk::new(f)) {Ok(())} else {Err(())}
 }
 
 /// One-time runtime cleanup.
index 4430cc3b0af826695f88f334d8578b9d98d3e124..69c5267ab69fccdbddf013277216c831b26d6170 100644 (file)
@@ -69,6 +69,7 @@ pub struct Condvar { inner: Box<StaticCondvar> }
 /// # Examples
 ///
 /// ```
+/// # #![feature(std_misc)]
 /// use std::sync::{StaticCondvar, CONDVAR_INIT};
 ///
 /// static CVAR: StaticCondvar = CONDVAR_INIT;
index ee9bcd3dd89bf630d28886e8357f62ea41297def..3c7fecb75153a9913473ff92f45cb835181a9497 100644 (file)
@@ -14,6 +14,7 @@
 //! # Examples
 //!
 //! ```
+//! # #![feature(std_misc)]
 //! use std::sync::Future;
 //!
 //! // a fake, for now
index 123dad978f55ad4d30748650f6bfe05b7c840e66..7adfd9154acf86bae7f5d19812de347d3b848bf1 100644 (file)
 //! after 10 seconds no matter what:
 //!
 //! ```no_run
+//! # #![feature(std_misc, old_io)]
 //! use std::sync::mpsc::channel;
 //! use std::old_io::timer::Timer;
 //! use std::time::Duration;
 //! has been inactive for 5 seconds:
 //!
 //! ```no_run
+//! # #![feature(std_misc, old_io)]
 //! use std::sync::mpsc::channel;
 //! use std::old_io::timer::Timer;
 //! use std::time::Duration;
@@ -977,7 +979,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T> error::Error for SendError<T> {
+impl<T: Send> error::Error for SendError<T> {
 
     fn description(&self) -> &str {
         "sending on a closed channel"
@@ -1013,7 +1015,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T> error::Error for TrySendError<T> {
+impl<T: Send> error::Error for TrySendError<T> {
 
     fn description(&self) -> &str {
         match *self {
index b5739c36aa9122b307471f99cb6474e29a94a46b..0f936641cdc75bb5081f3bf63a09b3d9e8e58f39 100644 (file)
@@ -27,6 +27,7 @@
 //! # Examples
 //!
 //! ```rust
+//! # #![feature(std_misc)]
 //! use std::sync::mpsc::channel;
 //!
 //! let (tx1, rx1) = channel();
@@ -119,6 +120,7 @@ impl Select {
     /// # Examples
     ///
     /// ```
+    /// # #![feature(std_misc)]
     /// use std::sync::mpsc::Select;
     ///
     /// let select = Select::new();
index 130fd1d7dc83b36841ee5ca4afbf89ec575188f5..2bf75cf1d3764c97ea0c89fba9e2bd206f6340f8 100644 (file)
@@ -85,6 +85,7 @@
 /// To recover from a poisoned mutex:
 ///
 /// ```
+/// # #![feature(std_misc)]
 /// use std::sync::{Arc, Mutex};
 /// use std::thread;
 ///
@@ -136,6 +137,7 @@ unsafe impl<T: Send> Sync for Mutex<T> { }
 /// # Examples
 ///
 /// ```
+/// # #![feature(std_misc)]
 /// use std::sync::{StaticMutex, MUTEX_INIT};
 ///
 /// static LOCK: StaticMutex = MUTEX_INIT;
index 2587ff5238ea7b86eb29d107856be5ed31629198..c07c83d37f48881b041966d9c9cfbf48d82f5d8a 100644 (file)
@@ -105,11 +105,11 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> fmt::Display for PoisonError<T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.description().fmt(f)
+        "poisoned lock: another task failed inside".fmt(f)
     }
 }
 
-impl<T> Error for PoisonError<T> {
+impl<T: Send> Error for PoisonError<T> {
     fn description(&self) -> &str {
         "poisoned lock: another task failed inside"
     }
@@ -161,13 +161,13 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T> fmt::Display for TryLockError<T> {
+impl<T: Send> fmt::Display for TryLockError<T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.description().fmt(f)
     }
 }
 
-impl<T> Error for TryLockError<T> {
+impl<T: Send> Error for TryLockError<T> {
     fn description(&self) -> &str {
         match *self {
             TryLockError::Poisoned(ref p) => p.description(),
index 368e88e4e8b418ea0d20c23d7c87c01ceb1026eb..6e94db6d7530c027a569bacbee71a9bb0b9c9401 100644 (file)
@@ -77,6 +77,7 @@ unsafe impl<T: Send + Sync> Sync for RwLock<T> {}
 /// # Examples
 ///
 /// ```
+/// # #![feature(std_misc)]
 /// use std::sync::{StaticRwLock, RW_LOCK_INIT};
 ///
 /// static LOCK: StaticRwLock = RW_LOCK_INIT;
index 2f9873950b62ee4eba074fc97ef25f1540d7e3a3..059cce572459e61767cf4ae7235f96d6b7c77923 100644 (file)
@@ -25,6 +25,7 @@
 /// # Examples
 ///
 /// ```
+/// # #![feature(std_misc)]
 /// use std::sync::Semaphore;
 ///
 /// // Create a semaphore that represents 5 resources
index 8a1946b86ab4a1ae3a9dda176e5f1359c81682a2..51cf70e615bcc17eb1619a794b61c64ea595e37f 100644 (file)
@@ -61,6 +61,7 @@ fn drop(&mut self) {
 /// # Examples
 ///
 /// ```
+/// # #![feature(std_misc, core)]
 /// use std::sync::TaskPool;
 /// use std::iter::AdditiveIterator;
 /// use std::sync::mpsc::channel;
index 2a852fbcd57e37d3a9399776d34015d83e486f84..53f18a57325556264656f70d514fd8aeb2811bb0 100644 (file)
@@ -112,7 +112,7 @@ pub fn boot<T, F>(&'static self, f: F, helper: fn(helper_signal::signal, Receive
                     self.cond.notify_one()
                 });
 
-                rt::at_exit(move || { self.shutdown() });
+                let _ = rt::at_exit(move || { self.shutdown() });
                 *self.initialized.get() = true;
             } else if *self.chan.get() as uint == 1 {
                 panic!("cannot continue usage after shutdown");
index e4985e703ba7645243ec3efd7e41a407eefa47c3..90526b8f4f318faa941d26c8cdd9be788e2be001 100644 (file)
@@ -15,7 +15,7 @@
 use cell::RefCell;
 use string::String;
 use thread::Thread;
-use thread_local::State;
+use thread::LocalKeyState;
 
 struct ThreadInfo {
     stack_guard: uint,
@@ -26,7 +26,7 @@ struct ThreadInfo {
 
 impl ThreadInfo {
     fn with<R, F>(f: F) -> R where F: FnOnce(&mut ThreadInfo) -> R {
-        if THREAD_INFO.state() == State::Destroyed {
+        if THREAD_INFO.state() == LocalKeyState::Destroyed {
             panic!("Use of std::thread::current() is not possible after \
                     the thread's local data has been destroyed");
         }
index 3cc91bf54b4d92dec95082b79f2f223acba8b81e..9f3dae34c7a4bff3a127111110fa955d335748e3 100644 (file)
@@ -634,6 +634,7 @@ fn initial_trail_surrogate(&self) -> Option<u16> {
 ///
 /// Panics when `begin` and `end` do not point to code point boundaries,
 /// or point beyond the end of the string.
+#[cfg(stage0)]
 impl ops::Index<ops::Range<usize>> for Wtf8 {
     type Output = Wtf8;
 
@@ -650,12 +651,36 @@ fn index(&self, range: &ops::Range<usize>) -> &Wtf8 {
     }
 }
 
+/// Return a slice of the given string for the byte range [`begin`..`end`).
+///
+/// # Panics
+///
+/// Panics when `begin` and `end` do not point to code point boundaries,
+/// or point beyond the end of the string.
+#[cfg(not(stage0))]
+impl ops::Index<ops::Range<usize>> for Wtf8 {
+    type Output = Wtf8;
+
+    #[inline]
+    fn index(&self, range: ops::Range<usize>) -> &Wtf8 {
+        // is_code_point_boundary checks that the index is in [0, .len()]
+        if range.start <= range.end &&
+           is_code_point_boundary(self, range.start) &&
+           is_code_point_boundary(self, range.end) {
+            unsafe { slice_unchecked(self, range.start, range.end) }
+        } else {
+            slice_error_fail(self, range.start, range.end)
+        }
+    }
+}
+
 /// Return a slice of the given string from byte `begin` to its end.
 ///
 /// # Panics
 ///
 /// Panics when `begin` is not at a code point boundary,
 /// or is beyond the end of the string.
+#[cfg(stage0)]
 impl ops::Index<ops::RangeFrom<usize>> for Wtf8 {
     type Output = Wtf8;
 
@@ -670,12 +695,34 @@ fn index(&self, range: &ops::RangeFrom<usize>) -> &Wtf8 {
     }
 }
 
+/// Return a slice of the given string from byte `begin` to its end.
+///
+/// # Panics
+///
+/// Panics when `begin` is not at a code point boundary,
+/// or is beyond the end of the string.
+#[cfg(not(stage0))]
+impl ops::Index<ops::RangeFrom<usize>> for Wtf8 {
+    type Output = Wtf8;
+
+    #[inline]
+    fn index(&self, range: ops::RangeFrom<usize>) -> &Wtf8 {
+        // is_code_point_boundary checks that the index is in [0, .len()]
+        if is_code_point_boundary(self, range.start) {
+            unsafe { slice_unchecked(self, range.start, self.len()) }
+        } else {
+            slice_error_fail(self, range.start, self.len())
+        }
+    }
+}
+
 /// Return a slice of the given string from its beginning to byte `end`.
 ///
 /// # Panics
 ///
 /// Panics when `end` is not at a code point boundary,
 /// or is beyond the end of the string.
+#[cfg(stage0)]
 impl ops::Index<ops::RangeTo<usize>> for Wtf8 {
     type Output = Wtf8;
 
@@ -690,6 +737,28 @@ fn index(&self, range: &ops::RangeTo<usize>) -> &Wtf8 {
     }
 }
 
+/// Return a slice of the given string from its beginning to byte `end`.
+///
+/// # Panics
+///
+/// Panics when `end` is not at a code point boundary,
+/// or is beyond the end of the string.
+#[cfg(not(stage0))]
+impl ops::Index<ops::RangeTo<usize>> for Wtf8 {
+    type Output = Wtf8;
+
+    #[inline]
+    fn index(&self, range: ops::RangeTo<usize>) -> &Wtf8 {
+        // is_code_point_boundary checks that the index is in [0, .len()]
+        if is_code_point_boundary(self, range.end) {
+            unsafe { slice_unchecked(self, 0, range.end) }
+        } else {
+            slice_error_fail(self, 0, range.end)
+        }
+    }
+}
+
+#[cfg(stage0)]
 impl ops::Index<ops::RangeFull> for Wtf8 {
     type Output = Wtf8;
 
@@ -699,6 +768,16 @@ fn index(&self, _range: &ops::RangeFull) -> &Wtf8 {
     }
 }
 
+#[cfg(not(stage0))]
+impl ops::Index<ops::RangeFull> for Wtf8 {
+    type Output = Wtf8;
+
+    #[inline]
+    fn index(&self, _range: ops::RangeFull) -> &Wtf8 {
+        self
+    }
+}
+
 #[inline]
 fn decode_surrogate(second_byte: u8, third_byte: u8) -> u16 {
     // The first byte is assumed to be 0xED
index ea74aab3331ae5e49c12b76e6f89b999de9ace63..202e5ddaec42bd01c77eda25d11acdba21c902fd 100644 (file)
@@ -338,8 +338,7 @@ pub fn readlink(p: &Path) -> io::Result<PathBuf> {
         }));
         buf.set_len(n as usize);
     }
-    let s: OsString = OsStringExt::from_vec(buf);
-    Ok(PathBuf::new(&s))
+    Ok(PathBuf::from(OsString::from_vec(buf)))
 }
 
 pub fn symlink(src: &Path, dst: &Path) -> io::Result<()> {
index a5a2f71acb7e0db572dd89fee95e1b3df3b5f715..6c191689255bc123ac0517fa676300ef5051f128 100644 (file)
@@ -36,7 +36,7 @@
 const TMPBUF_SZ: usize = 128;
 
 fn bytes2path(b: &[u8]) -> PathBuf {
-    PathBuf::new(<OsStr as OsStrExt>::from_bytes(b))
+    PathBuf::from(<OsStr as OsStrExt>::from_bytes(b))
 }
 
 fn os2path(os: OsString) -> PathBuf {
@@ -253,7 +253,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
         let err = _NSGetExecutablePath(v.as_mut_ptr() as *mut i8, &mut sz);
         if err != 0 { return Err(io::Error::last_os_error()); }
         v.set_len(sz as uint - 1); // chop off trailing NUL
-        Ok(PathBuf::new(OsString::from_vec(v)))
+        Ok(PathBuf::from(OsString::from_vec(v)))
     }
 }
 
@@ -466,9 +466,9 @@ pub fn page_size() -> usize {
 pub fn temp_dir() -> PathBuf {
     getenv("TMPDIR".as_os_str()).map(os2path).unwrap_or_else(|| {
         if cfg!(target_os = "android") {
-            PathBuf::new("/data/local/tmp")
+            PathBuf::from("/data/local/tmp")
         } else {
-            PathBuf::new("/tmp")
+            PathBuf::from("/tmp")
         }
     })
 }
index c5f07c6c75a7072bd2345212e81c94c434b9c6bd..eb61f21aacd5d52ee5a7c66106948e90ac835287 100644 (file)
@@ -227,19 +227,16 @@ pub unsafe fn create(stack: usize, p: Thunk) -> io::Result<rust_thread> {
 
 #[cfg(any(target_os = "linux", target_os = "android"))]
 pub unsafe fn set_name(name: &str) {
-    // pthread_setname_np() since glibc 2.12
-    // availability autodetected via weak linkage
-    type F = unsafe extern fn(libc::pthread_t, *const libc::c_char)
-                              -> libc::c_int;
+    // pthread wrapper only appeared in glibc 2.12, so we use syscall directly.
     extern {
-        #[linkage = "extern_weak"]
-        static pthread_setname_np: *const ();
-    }
-    if !pthread_setname_np.is_null() {
-        let cname = CString::new(name).unwrap();
-        mem::transmute::<*const (), F>(pthread_setname_np)(pthread_self(),
-                                                           cname.as_ptr());
+        fn prctl(option: libc::c_int, arg2: libc::c_ulong, arg3: libc::c_ulong,
+                 arg4: libc::c_ulong, arg5: libc::c_ulong) -> libc::c_int;
     }
+    const PR_SET_NAME: libc::c_int = 15;
+    let cname = CString::new(name).unwrap_or_else(|_| {
+        panic!("thread name may not contain interior null bytes")
+    });
+    prctl(PR_SET_NAME, cname.as_ptr() as libc::c_ulong, 0, 0, 0);
 }
 
 #[cfg(any(target_os = "freebsd",
@@ -314,26 +311,39 @@ unsafe fn dosleep(ts: *mut libc::timespec) -> libc::c_int {
 // is created in an application with big thread-local storage requirements.
 // See #6233 for rationale and details.
 //
-// Link weakly to the symbol for compatibility with older versions of glibc.
-// Assumes that we've been dynamically linked to libpthread but that is
-// currently always the case.  Note that you need to check that the symbol
-// is non-null before calling it!
+// Use dlsym to get the symbol value at runtime, both for
+// compatibility with older versions of glibc, and to avoid creating
+// dependencies on GLIBC_PRIVATE symbols.  Assumes that we've been
+// dynamically linked to libpthread but that is currently always the
+// case.  We previously used weak linkage (under the same assumption),
+// but that caused Debian to detect an unnecessarily strict versioned
+// dependency on libc6 (#23628).
 #[cfg(target_os = "linux")]
 fn min_stack_size(attr: *const libc::pthread_attr_t) -> libc::size_t {
+    use dynamic_lib::DynamicLibrary;
+    use sync::{Once, ONCE_INIT};
+
     type F = unsafe extern "C" fn(*const libc::pthread_attr_t) -> libc::size_t;
-    extern {
-        #[linkage = "extern_weak"]
-        static __pthread_get_minstack: *const ();
-    }
-    if __pthread_get_minstack.is_null() {
-        PTHREAD_STACK_MIN
-    } else {
-        unsafe { mem::transmute::<*const (), F>(__pthread_get_minstack)(attr) }
+    static INIT: Once = ONCE_INIT;
+    static mut __pthread_get_minstack: Option<F> = None;
+
+    INIT.call_once(|| {
+        let lib = DynamicLibrary::open(None).unwrap();
+        unsafe {
+            if let Ok(f) = lib.symbol("__pthread_get_minstack") {
+                __pthread_get_minstack = Some(mem::transmute::<*const (), F>(f));
+            }
+        }
+    });
+
+    match unsafe { __pthread_get_minstack } {
+        None => PTHREAD_STACK_MIN,
+        Some(f) => unsafe { f(attr) },
     }
 }
 
-// __pthread_get_minstack() is marked as weak but extern_weak linkage is
-// not supported on OS X, hence this kludge...
+// No point in looking up __pthread_get_minstack() on non-glibc
+// platforms.
 #[cfg(not(target_os = "linux"))]
 fn min_stack_size(_: *const libc::pthread_attr_t) -> libc::size_t {
     PTHREAD_STACK_MIN
index 117f819eeeb3fd870ac36dc485d6874630ad0ced..998352651117bcbe99b5f9c3f54cc69b2ef3d88f 100644 (file)
@@ -372,7 +372,7 @@ pub fn readlink(p: &Path) -> io::Result<PathBuf> {
                                   sz - 1,
                                   libc::VOLUME_NAME_DOS)
     }, |s| OsStringExt::from_wide(s)));
-    Ok(PathBuf::new(&ret))
+    Ok(PathBuf::from(&ret))
 }
 
 pub fn symlink(src: &Path, dst: &Path) -> io::Result<()> {
index eeaf4ced07239e16fe0b5b3b83b08bb45a45fe99..b1ceac9b9025684429ad28bc8d37c90a3afeb97a 100644 (file)
@@ -304,9 +304,7 @@ fn fill_utf16_buf_new<F1, F2, T>(f1: F1, f2: F2) -> io::Result<T>
 }
 
 fn os2path(s: &[u16]) -> PathBuf {
-    let os = <OsString as OsStringExt>::from_wide(s);
-    // FIXME(#22751) should consume `os`
-    PathBuf::new(&os)
+    PathBuf::from(OsString::from_wide(s))
 }
 
 pub fn truncate_utf16_at_nul<'a>(v: &'a [u16]) -> &'a [u16] {
index 4f6c4c9aab3660ff071c3f1790dd055922750d2d..167db1e8ac2d790b056c05af6bd78b8bdb8cdb86 100644 (file)
@@ -109,7 +109,7 @@ fn next(&mut self) -> Option<(OsString, OsString)> {
             if *self.cur == 0 { return None }
             let p = &*self.cur;
             let mut len = 0;
-            while *(p as *const _).offset(len) != 0 {
+            while *(p as *const u16).offset(len) != 0 {
                 len += 1;
             }
             let p = p as *const u16;
@@ -363,10 +363,7 @@ pub fn temp_dir() -> PathBuf {
 pub fn home_dir() -> Option<PathBuf> {
     getenv("HOME".as_os_str()).or_else(|| {
         getenv("USERPROFILE".as_os_str())
-    }).map(|os| {
-        // FIXME(#22751) should consume `os`
-        PathBuf::new(&os)
-    }).or_else(|| unsafe {
+    }).map(PathBuf::from).or_else(|| unsafe {
         let me = c::GetCurrentProcess();
         let mut token = ptr::null_mut();
         if c::OpenProcessToken(me, c::TOKEN_READ, &mut token) == 0 {
diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs
deleted file mode 100644 (file)
index ab74442..0000000
+++ /dev/null
@@ -1,960 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-//! Native threads
-//!
-//! ## The threading model
-//!
-//! An executing Rust program consists of a collection of native OS threads,
-//! each with their own stack and local state.
-//!
-//! Communication between threads can be done through
-//! [channels](../../std/sync/mpsc/index.html), Rust's message-passing
-//! types, along with [other forms of thread
-//! synchronization](../../std/sync/index.html) and shared-memory data
-//! structures. In particular, types that are guaranteed to be
-//! threadsafe are easily shared between threads using the
-//! atomically-reference-counted container,
-//! [`Arc`](../../std/sync/struct.Arc.html).
-//!
-//! Fatal logic errors in Rust cause *thread panic*, during which
-//! a thread will unwind the stack, running destructors and freeing
-//! owned resources. Thread panic is unrecoverable from within
-//! the panicking thread (i.e. there is no 'try/catch' in Rust), but
-//! the panic may optionally be detected from a different thread. If
-//! the main thread panics, the application will exit with a non-zero
-//! exit code.
-//!
-//! When the main thread of a Rust program terminates, the entire program shuts
-//! down, even if other threads are still running. However, this module provides
-//! convenient facilities for automatically waiting for the termination of a
-//! child thread (i.e., join).
-//!
-//! ## The `Thread` type
-//!
-//! Threads are represented via the `Thread` type, which you can
-//! get in one of two ways:
-//!
-//! * By spawning a new thread, e.g. using the `thread::spawn` function.
-//! * By requesting the current thread, using the `thread::current` function.
-//!
-//! Threads can be named, and provide some built-in support for low-level
-//! synchronization (described below).
-//!
-//! The `thread::current()` function is available even for threads not spawned
-//! by the APIs of this module.
-//!
-//! ## Spawning a thread
-//!
-//! A new thread can be spawned using the `thread::spawn` function:
-//!
-//! ```rust
-//! use std::thread;
-//!
-//! thread::spawn(move || {
-//!     // some work here
-//! });
-//! ```
-//!
-//! In this example, the spawned thread is "detached" from the current
-//! thread. This means that it can outlive its parent (the thread that spawned
-//! it), unless this parent is the main thread.
-//!
-//! ## Scoped threads
-//!
-//! Often a parent thread uses a child thread to perform some particular task,
-//! and at some point must wait for the child to complete before continuing.
-//! For this scenario, use the `thread::scoped` function:
-//!
-//! ```rust
-//! use std::thread;
-//!
-//! let guard = thread::scoped(move || {
-//!     // some work here
-//! });
-//!
-//! // do some other work in the meantime
-//! let output = guard.join();
-//! ```
-//!
-//! The `scoped` function doesn't return a `Thread` directly; instead,
-//! it returns a *join guard*. The join guard is an RAII-style guard
-//! that will automatically join the child thread (block until it
-//! terminates) when it is dropped. You can join the child thread in
-//! advance by calling the `join` method on the guard, which will also
-//! return the result produced by the thread.  A handle to the thread
-//! itself is available via the `thread` method of the join guard.
-//!
-//! ## Configuring threads
-//!
-//! A new thread can be configured before it is spawned via the `Builder` type,
-//! which currently allows you to set the name, stack size, and writers for
-//! `println!` and `panic!` for the child thread:
-//!
-//! ```rust
-//! use std::thread;
-//!
-//! thread::Builder::new().name("child1".to_string()).spawn(move || {
-//!     println!("Hello, world!");
-//! });
-//! ```
-//!
-//! ## Blocking support: park and unpark
-//!
-//! Every thread is equipped with some basic low-level blocking support, via the
-//! `park` and `unpark` functions.
-//!
-//! Conceptually, each `Thread` handle has an associated token, which is
-//! initially not present:
-//!
-//! * The `thread::park()` function blocks the current thread unless or until
-//!   the token is available for its thread handle, at which point it atomically
-//!   consumes the token. It may also return *spuriously*, without consuming the
-//!   token. `thread::park_timeout()` does the same, but allows specifying a
-//!   maximum time to block the thread for.
-//!
-//! * The `unpark()` method on a `Thread` atomically makes the token available
-//!   if it wasn't already.
-//!
-//! In other words, each `Thread` acts a bit like a semaphore with initial count
-//! 0, except that the semaphore is *saturating* (the count cannot go above 1),
-//! and can return spuriously.
-//!
-//! The API is typically used by acquiring a handle to the current thread,
-//! placing that handle in a shared data structure so that other threads can
-//! find it, and then `park`ing. When some desired condition is met, another
-//! thread calls `unpark` on the handle.
-//!
-//! The motivation for this design is twofold:
-//!
-//! * It avoids the need to allocate mutexes and condvars when building new
-//!   synchronization primitives; the threads already provide basic blocking/signaling.
-//!
-//! * It can be implemented very efficiently on many platforms.
-
-#![stable(feature = "rust1", since = "1.0.0")]
-
-use prelude::v1::*;
-
-use any::Any;
-use cell::UnsafeCell;
-use fmt;
-use io;
-use marker::PhantomData;
-use rt::{self, unwind};
-use sync::{Mutex, Condvar, Arc};
-use sys::thread as imp;
-use sys_common::{stack, thread_info};
-use thunk::Thunk;
-use time::Duration;
-
-#[allow(deprecated)] use old_io::Writer;
-
-/// Thread configuration. Provides detailed control over the properties
-/// and behavior of new threads.
-#[stable(feature = "rust1", since = "1.0.0")]
-pub struct Builder {
-    // A name for the thread-to-be, for identification in panic messages
-    name: Option<String>,
-    // The size of the stack for the spawned thread
-    stack_size: Option<usize>,
-}
-
-impl Builder {
-    /// Generate the base configuration for spawning a thread, from which
-    /// configuration methods can be chained.
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn new() -> Builder {
-        Builder {
-            name: None,
-            stack_size: None,
-        }
-    }
-
-    /// Name the thread-to-be. Currently the name is used for identification
-    /// only in panic messages.
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn name(mut self, name: String) -> Builder {
-        self.name = Some(name);
-        self
-    }
-
-    /// Set the size of the stack for the new thread.
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn stack_size(mut self, size: usize) -> Builder {
-        self.stack_size = Some(size);
-        self
-    }
-
-    /// Redirect thread-local stdout.
-    #[unstable(feature = "std_misc",
-               reason = "Will likely go away after proc removal")]
-    #[deprecated(since = "1.0.0",
-                 reason = "the old I/O module is deprecated and this function \
-                           will be removed with no replacement")]
-    #[allow(deprecated)]
-    pub fn stdout(self, _stdout: Box<Writer + Send + 'static>) -> Builder {
-        self
-    }
-
-    /// Redirect thread-local stderr.
-    #[unstable(feature = "std_misc",
-               reason = "Will likely go away after proc removal")]
-    #[deprecated(since = "1.0.0",
-                 reason = "the old I/O module is deprecated and this function \
-                           will be removed with no replacement")]
-    #[allow(deprecated)]
-    pub fn stderr(self, _stderr: Box<Writer + Send + 'static>) -> Builder {
-        self
-    }
-
-    /// Spawn a new thread, and return a join handle for it.
-    ///
-    /// The child thread may outlive the parent (unless the parent thread
-    /// is the main thread; the whole process is terminated when the main
-    /// thread finishes.) The join handle can be used to block on
-    /// termination of the child thread, including recovering its panics.
-    ///
-    /// # Errors
-    ///
-    /// Unlike the `spawn` free function, this method yields an
-    /// `io::Result` to capture any failure to create the thread at
-    /// the OS level.
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn spawn<F>(self, f: F) -> io::Result<JoinHandle> where
-        F: FnOnce(), F: Send + 'static
-    {
-        self.spawn_inner(Thunk::new(f)).map(|i| JoinHandle(i))
-    }
-
-    /// Spawn a new child thread that must be joined within a given
-    /// scope, and return a `JoinGuard`.
-    ///
-    /// The join guard can be used to explicitly join the child thread (via
-    /// `join`), returning `Result<T>`, or it will implicitly join the child
-    /// upon being dropped. Because the child thread may refer to data on the
-    /// current thread's stack (hence the "scoped" name), it cannot be detached;
-    /// it *must* be joined before the relevant stack frame is popped. See the
-    /// module documentation for additional details.
-    ///
-    /// # Errors
-    ///
-    /// Unlike the `scoped` free function, this method yields an
-    /// `io::Result` to capture any failure to create the thread at
-    /// the OS level.
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn scoped<'a, T, F>(self, f: F) -> io::Result<JoinGuard<'a, T>> where
-        T: Send + 'a, F: FnOnce() -> T, F: Send + 'a
-    {
-        self.spawn_inner(Thunk::new(f)).map(|inner| {
-            JoinGuard { inner: inner, _marker: PhantomData }
-        })
-    }
-
-    fn spawn_inner<T: Send>(self, f: Thunk<(), T>) -> io::Result<JoinInner<T>> {
-        let Builder { name, stack_size } = self;
-
-        let stack_size = stack_size.unwrap_or(rt::min_stack());
-
-        let my_thread = Thread::new(name);
-        let their_thread = my_thread.clone();
-
-        let my_packet = Packet(Arc::new(UnsafeCell::new(None)));
-        let their_packet = Packet(my_packet.0.clone());
-
-        // Spawning a new OS thread guarantees that __morestack will never get
-        // triggered, but we must manually set up the actual stack bounds once
-        // this function starts executing. This raises the lower limit by a bit
-        // because by the time that this function is executing we've already
-        // consumed at least a little bit of stack (we don't know the exact byte
-        // address at which our stack started).
-        let main = move || {
-            let something_around_the_top_of_the_stack = 1;
-            let addr = &something_around_the_top_of_the_stack as *const i32;
-            let my_stack_top = addr as usize;
-            let my_stack_bottom = my_stack_top - stack_size + 1024;
-            unsafe {
-                if let Some(name) = their_thread.name() {
-                    imp::set_name(name);
-                }
-                stack::record_os_managed_stack_bounds(my_stack_bottom,
-                                                      my_stack_top);
-                thread_info::set(imp::guard::current(), their_thread);
-            }
-
-            let mut output = None;
-            let try_result = {
-                let ptr = &mut output;
-
-                // There are two primary reasons that general try/catch is
-                // unsafe. The first is that we do not support nested
-                // try/catch. The fact that this is happening in a newly-spawned
-                // thread suffices. The second is that unwinding while unwinding
-                // is not defined.  We take care of that by having an
-                // 'unwinding' flag in the thread itself. For these reasons,
-                // this unsafety should be ok.
-                unsafe {
-                    unwind::try(move || *ptr = Some(f.invoke(())))
-                }
-            };
-            unsafe {
-                *their_packet.0.get() = Some(match (output, try_result) {
-                    (Some(data), Ok(_)) => Ok(data),
-                    (None, Err(cause)) => Err(cause),
-                    _ => unreachable!()
-                });
-            }
-        };
-
-        Ok(JoinInner {
-            native: try!(unsafe { imp::create(stack_size, Thunk::new(main)) }),
-            thread: my_thread,
-            packet: my_packet,
-            joined: false,
-        })
-    }
-}
-
-/// Spawn a new thread, returning a `JoinHandle` for it.
-///
-/// The join handle will implicitly *detach* the child thread upon being
-/// dropped. In this case, the child thread may outlive the parent (unless
-/// the parent thread is the main thread; the whole process is terminated when
-/// the main thread finishes.) Additionally, the join handle provides a `join`
-/// method that can be used to join the child thread. If the child thread
-/// panics, `join` will return an `Err` containing the argument given to
-/// `panic`.
-///
-/// # Panics
-///
-/// Panicks if the OS fails to create a thread; use `Builder::spawn`
-/// to recover from such errors.
-#[stable(feature = "rust1", since = "1.0.0")]
-pub fn spawn<F>(f: F) -> JoinHandle where F: FnOnce(), F: Send + 'static {
-    Builder::new().spawn(f).unwrap()
-}
-
-/// Spawn a new *scoped* thread, returning a `JoinGuard` for it.
-///
-/// The join guard can be used to explicitly join the child thread (via
-/// `join`), returning `Result<T>`, or it will implicitly join the child
-/// upon being dropped. Because the child thread may refer to data on the
-/// current thread's stack (hence the "scoped" name), it cannot be detached;
-/// it *must* be joined before the relevant stack frame is popped. See the
-/// module documentation for additional details.
-///
-/// # Panics
-///
-/// Panicks if the OS fails to create a thread; use `Builder::scoped`
-/// to recover from such errors.
-#[stable(feature = "rust1", since = "1.0.0")]
-pub fn scoped<'a, T, F>(f: F) -> JoinGuard<'a, T> where
-    T: Send + 'a, F: FnOnce() -> T, F: Send + 'a
-{
-    Builder::new().scoped(f).unwrap()
-}
-
-/// Gets a handle to the thread that invokes it.
-#[stable(feature = "rust1", since = "1.0.0")]
-pub fn current() -> Thread {
-    thread_info::current_thread()
-}
-
-/// Cooperatively give up a timeslice to the OS scheduler.
-#[stable(feature = "rust1", since = "1.0.0")]
-pub fn yield_now() {
-    unsafe { imp::yield_now() }
-}
-
-/// Determines whether the current thread is unwinding because of panic.
-#[inline]
-#[stable(feature = "rust1", since = "1.0.0")]
-pub fn panicking() -> bool {
-    unwind::panicking()
-}
-
-/// Put the current thread to sleep for the specified amount of time.
-///
-/// The thread may sleep longer than the duration specified due to scheduling
-/// specifics or platform-dependent functionality. Note that on unix platforms
-/// this function will not return early due to a signal being received or a
-/// spurious wakeup.
-#[unstable(feature = "thread_sleep",
-           reason = "recently added, needs an RFC, and `Duration` itself is \
-                     unstable")]
-pub fn sleep(dur: Duration) {
-    imp::sleep(dur)
-}
-
-/// Block unless or until the current thread's token is made available (may wake spuriously).
-///
-/// See the module doc for more detail.
-//
-// The implementation currently uses the trivial strategy of a Mutex+Condvar
-// with wakeup flag, which does not actually allow spurious wakeups. In the
-// future, this will be implemented in a more efficient way, perhaps along the lines of
-//   http://cr.openjdk.java.net/~stefank/6989984.1/raw_files/new/src/os/linux/vm/os_linux.cpp
-// or futuxes, and in either case may allow spurious wakeups.
-#[stable(feature = "rust1", since = "1.0.0")]
-pub fn park() {
-    let thread = current();
-    let mut guard = thread.inner.lock.lock().unwrap();
-    while !*guard {
-        guard = thread.inner.cvar.wait(guard).unwrap();
-    }
-    *guard = false;
-}
-
-/// Block unless or until the current thread's token is made available or
-/// the specified duration has been reached (may wake spuriously).
-///
-/// The semantics of this function are equivalent to `park()` except that the
-/// thread will be blocked for roughly no longer than *duration*. This method
-/// should not be used for precise timing due to anomalies such as
-/// preemption or platform differences that may not cause the maximum
-/// amount of time waited to be precisely *duration* long.
-///
-/// See the module doc for more detail.
-#[unstable(feature = "std_misc", reason = "recently introduced, depends on Duration")]
-pub fn park_timeout(duration: Duration) {
-    let thread = current();
-    let mut guard = thread.inner.lock.lock().unwrap();
-    if !*guard {
-        let (g, _) = thread.inner.cvar.wait_timeout(guard, duration).unwrap();
-        guard = g;
-    }
-    *guard = false;
-}
-
-/// The internal representation of a `Thread` handle
-struct Inner {
-    name: Option<String>,
-    lock: Mutex<bool>,          // true when there is a buffered unpark
-    cvar: Condvar,
-}
-
-unsafe impl Sync for Inner {}
-
-#[derive(Clone)]
-#[stable(feature = "rust1", since = "1.0.0")]
-/// A handle to a thread.
-pub struct Thread {
-    inner: Arc<Inner>,
-}
-
-impl Thread {
-    // Used only internally to construct a thread object without spawning
-    fn new(name: Option<String>) -> Thread {
-        Thread {
-            inner: Arc::new(Inner {
-                name: name,
-                lock: Mutex::new(false),
-                cvar: Condvar::new(),
-            })
-        }
-    }
-
-    /// Deprecated: use module-level free function.
-    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
-    #[unstable(feature = "std_misc",
-               reason = "may change with specifics of new Send semantics")]
-    pub fn spawn<F>(f: F) -> Thread where F: FnOnce(), F: Send + 'static {
-        Builder::new().spawn(f).unwrap().thread().clone()
-    }
-
-    /// Deprecated: use module-level free function.
-    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
-    #[unstable(feature = "std_misc",
-               reason = "may change with specifics of new Send semantics")]
-    pub fn scoped<'a, T, F>(f: F) -> JoinGuard<'a, T> where
-        T: Send + 'a, F: FnOnce() -> T, F: Send + 'a
-    {
-        Builder::new().scoped(f).unwrap()
-    }
-
-    /// Deprecated: use module-level free function.
-    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn current() -> Thread {
-        thread_info::current_thread()
-    }
-
-    /// Deprecated: use module-level free function.
-    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
-    #[unstable(feature = "std_misc", reason = "name may change")]
-    pub fn yield_now() {
-        unsafe { imp::yield_now() }
-    }
-
-    /// Deprecated: use module-level free function.
-    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
-    #[inline]
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn panicking() -> bool {
-        unwind::panicking()
-    }
-
-    /// Deprecated: use module-level free function.
-    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
-    #[unstable(feature = "std_misc", reason = "recently introduced")]
-    pub fn park() {
-        let thread = current();
-        let mut guard = thread.inner.lock.lock().unwrap();
-        while !*guard {
-            guard = thread.inner.cvar.wait(guard).unwrap();
-        }
-        *guard = false;
-    }
-
-    /// Deprecated: use module-level free function.
-    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
-    #[unstable(feature = "std_misc", reason = "recently introduced")]
-    pub fn park_timeout(duration: Duration) {
-        let thread = current();
-        let mut guard = thread.inner.lock.lock().unwrap();
-        if !*guard {
-            let (g, _) = thread.inner.cvar.wait_timeout(guard, duration).unwrap();
-            guard = g;
-        }
-        *guard = false;
-    }
-
-    /// Atomically makes the handle's token available if it is not already.
-    ///
-    /// See the module doc for more detail.
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn unpark(&self) {
-        let mut guard = self.inner.lock.lock().unwrap();
-        if !*guard {
-            *guard = true;
-            self.inner.cvar.notify_one();
-        }
-    }
-
-    /// Get the thread's name.
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn name(&self) -> Option<&str> {
-        self.inner.name.as_ref().map(|s| &**s)
-    }
-}
-
-#[stable(feature = "rust1", since = "1.0.0")]
-impl fmt::Debug for Thread {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        fmt::Debug::fmt(&self.name(), f)
-    }
-}
-
-// a hack to get around privacy restrictions
-impl thread_info::NewThread for Thread {
-    fn new(name: Option<String>) -> Thread { Thread::new(name) }
-}
-
-/// Indicates the manner in which a thread exited.
-///
-/// A thread that completes without panicking is considered to exit successfully.
-#[stable(feature = "rust1", since = "1.0.0")]
-pub type Result<T> = ::result::Result<T, Box<Any + Send + 'static>>;
-
-struct Packet<T>(Arc<UnsafeCell<Option<Result<T>>>>);
-
-unsafe impl<T:Send> Send for Packet<T> {}
-unsafe impl<T> Sync for Packet<T> {}
-
-/// Inner representation for JoinHandle and JoinGuard
-struct JoinInner<T> {
-    native: imp::rust_thread,
-    thread: Thread,
-    packet: Packet<T>,
-    joined: bool,
-}
-
-impl<T> JoinInner<T> {
-    fn join(&mut self) -> Result<T> {
-        assert!(!self.joined);
-        unsafe { imp::join(self.native) };
-        self.joined = true;
-        unsafe {
-            (*self.packet.0.get()).take().unwrap()
-        }
-    }
-}
-
-/// An owned permission to join on a thread (block on its termination).
-///
-/// Unlike a `JoinGuard`, a `JoinHandle` *detaches* the child thread
-/// when it is dropped, rather than automatically joining on drop.
-///
-/// Due to platform restrictions, it is not possible to `Clone` this
-/// handle: the ability to join a child thread is a uniquely-owned
-/// permission.
-#[stable(feature = "rust1", since = "1.0.0")]
-pub struct JoinHandle(JoinInner<()>);
-
-impl JoinHandle {
-    /// Extract a handle to the underlying thread
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn thread(&self) -> &Thread {
-        &self.0.thread
-    }
-
-    /// Wait for the associated thread to finish.
-    ///
-    /// If the child thread panics, `Err` is returned with the parameter given
-    /// to `panic`.
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn join(mut self) -> Result<()> {
-        self.0.join()
-    }
-}
-
-#[stable(feature = "rust1", since = "1.0.0")]
-impl Drop for JoinHandle {
-    fn drop(&mut self) {
-        if !self.0.joined {
-            unsafe { imp::detach(self.0.native) }
-        }
-    }
-}
-
-/// An RAII-style guard that will block until thread termination when dropped.
-///
-/// The type `T` is the return type for the thread's main function.
-///
-/// Joining on drop is necessary to ensure memory safety when stack
-/// data is shared between a parent and child thread.
-///
-/// Due to platform restrictions, it is not possible to `Clone` this
-/// handle: the ability to join a child thread is a uniquely-owned
-/// permission.
-#[must_use = "thread will be immediately joined if `JoinGuard` is not used"]
-#[stable(feature = "rust1", since = "1.0.0")]
-pub struct JoinGuard<'a, T: 'a> {
-    inner: JoinInner<T>,
-    _marker: PhantomData<&'a T>,
-}
-
-#[stable(feature = "rust1", since = "1.0.0")]
-unsafe impl<'a, T: Send + 'a> Sync for JoinGuard<'a, T> {}
-
-impl<'a, T: Send + 'a> JoinGuard<'a, T> {
-    /// Extract a handle to the thread this guard will join on.
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn thread(&self) -> &Thread {
-        &self.inner.thread
-    }
-
-    /// Wait for the associated thread to finish, returning the result of the thread's
-    /// calculation.
-    ///
-    /// # Panics
-    ///
-    /// Panics on the child thread are propagated by panicking the parent.
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn join(mut self) -> T {
-        match self.inner.join() {
-            Ok(res) => res,
-            Err(_) => panic!("child thread {:?} panicked", self.thread()),
-        }
-    }
-}
-
-#[stable(feature = "rust1", since = "1.0.0")]
-impl<T: Send> JoinGuard<'static, T> {
-    /// Detaches the child thread, allowing it to outlive its parent.
-    #[deprecated(since = "1.0.0", reason = "use spawn instead")]
-    #[unstable(feature = "std_misc")]
-    pub fn detach(mut self) {
-        unsafe { imp::detach(self.inner.native) };
-        self.inner.joined = true; // avoid joining in the destructor
-    }
-}
-
-#[unsafe_destructor]
-#[stable(feature = "rust1", since = "1.0.0")]
-impl<'a, T: Send + 'a> Drop for JoinGuard<'a, T> {
-    fn drop(&mut self) {
-        if !self.inner.joined {
-            if self.inner.join().is_err() {
-                panic!("child thread {:?} panicked", self.thread());
-            }
-        }
-    }
-}
-
-#[cfg(test)]
-mod test {
-    use prelude::v1::*;
-
-    use any::Any;
-    use sync::mpsc::{channel, Sender};
-    use boxed::BoxAny;
-    use result;
-    use std::old_io::{ChanReader, ChanWriter};
-    use super::{Builder};
-    use thread;
-    use thunk::Thunk;
-    use time::Duration;
-
-    // !!! These tests are dangerous. If something is buggy, they will hang, !!!
-    // !!! instead of exiting cleanly. This might wedge the buildbots.       !!!
-
-    #[test]
-    fn test_unnamed_thread() {
-        thread::spawn(move|| {
-            assert!(thread::current().name().is_none());
-        }).join().ok().unwrap();
-    }
-
-    #[test]
-    fn test_named_thread() {
-        Builder::new().name("ada lovelace".to_string()).scoped(move|| {
-            assert!(thread::current().name().unwrap() == "ada lovelace".to_string());
-        }).unwrap().join();
-    }
-
-    #[test]
-    fn test_run_basic() {
-        let (tx, rx) = channel();
-        thread::spawn(move|| {
-            tx.send(()).unwrap();
-        });
-        rx.recv().unwrap();
-    }
-
-    #[test]
-    fn test_join_success() {
-        assert!(thread::scoped(move|| -> String {
-            "Success!".to_string()
-        }).join() == "Success!");
-    }
-
-    #[test]
-    fn test_join_panic() {
-        match thread::spawn(move|| {
-            panic!()
-        }).join() {
-            result::Result::Err(_) => (),
-            result::Result::Ok(()) => panic!()
-        }
-    }
-
-    #[test]
-    fn test_scoped_success() {
-        let res = thread::scoped(move|| -> String {
-            "Success!".to_string()
-        }).join();
-        assert!(res == "Success!");
-    }
-
-    #[test]
-    #[should_fail]
-    fn test_scoped_panic() {
-        thread::scoped(|| panic!()).join();
-    }
-
-    #[test]
-    #[should_fail]
-    fn test_scoped_implicit_panic() {
-        let _ = thread::scoped(|| panic!());
-    }
-
-    #[test]
-    fn test_spawn_sched() {
-        use clone::Clone;
-
-        let (tx, rx) = channel();
-
-        fn f(i: i32, tx: Sender<()>) {
-            let tx = tx.clone();
-            thread::spawn(move|| {
-                if i == 0 {
-                    tx.send(()).unwrap();
-                } else {
-                    f(i - 1, tx);
-                }
-            });
-
-        }
-        f(10, tx);
-        rx.recv().unwrap();
-    }
-
-    #[test]
-    fn test_spawn_sched_childs_on_default_sched() {
-        let (tx, rx) = channel();
-
-        thread::spawn(move|| {
-            thread::spawn(move|| {
-                tx.send(()).unwrap();
-            });
-        });
-
-        rx.recv().unwrap();
-    }
-
-    fn avoid_copying_the_body<F>(spawnfn: F) where F: FnOnce(Thunk<'static>) {
-        let (tx, rx) = channel();
-
-        let x: Box<_> = box 1;
-        let x_in_parent = (&*x) as *const i32 as usize;
-
-        spawnfn(Thunk::new(move|| {
-            let x_in_child = (&*x) as *const i32 as usize;
-            tx.send(x_in_child).unwrap();
-        }));
-
-        let x_in_child = rx.recv().unwrap();
-        assert_eq!(x_in_parent, x_in_child);
-    }
-
-    #[test]
-    fn test_avoid_copying_the_body_spawn() {
-        avoid_copying_the_body(|v| {
-            thread::spawn(move || v.invoke(()));
-        });
-    }
-
-    #[test]
-    fn test_avoid_copying_the_body_thread_spawn() {
-        avoid_copying_the_body(|f| {
-            thread::spawn(move|| {
-                f.invoke(());
-            });
-        })
-    }
-
-    #[test]
-    fn test_avoid_copying_the_body_join() {
-        avoid_copying_the_body(|f| {
-            let _ = thread::spawn(move|| {
-                f.invoke(())
-            }).join();
-        })
-    }
-
-    #[test]
-    fn test_child_doesnt_ref_parent() {
-        // If the child refcounts the parent task, this will stack overflow when
-        // climbing the task tree to dereference each ancestor. (See #1789)
-        // (well, it would if the constant were 8000+ - I lowered it to be more
-        // valgrind-friendly. try this at home, instead..!)
-        const GENERATIONS: u32 = 16;
-        fn child_no(x: u32) -> Thunk<'static> {
-            return Thunk::new(move|| {
-                if x < GENERATIONS {
-                    thread::spawn(move|| child_no(x+1).invoke(()));
-                }
-            });
-        }
-        thread::spawn(|| child_no(0).invoke(()));
-    }
-
-    #[test]
-    fn test_simple_newsched_spawn() {
-        thread::spawn(move || {});
-    }
-
-    #[test]
-    fn test_try_panic_message_static_str() {
-        match thread::spawn(move|| {
-            panic!("static string");
-        }).join() {
-            Err(e) => {
-                type T = &'static str;
-                assert!(e.is::<T>());
-                assert_eq!(*e.downcast::<T>().unwrap(), "static string");
-            }
-            Ok(()) => panic!()
-        }
-    }
-
-    #[test]
-    fn test_try_panic_message_owned_str() {
-        match thread::spawn(move|| {
-            panic!("owned string".to_string());
-        }).join() {
-            Err(e) => {
-                type T = String;
-                assert!(e.is::<T>());
-                assert_eq!(*e.downcast::<T>().unwrap(), "owned string".to_string());
-            }
-            Ok(()) => panic!()
-        }
-    }
-
-    #[test]
-    fn test_try_panic_message_any() {
-        match thread::spawn(move|| {
-            panic!(box 413u16 as Box<Any + Send>);
-        }).join() {
-            Err(e) => {
-                type T = Box<Any + Send>;
-                assert!(e.is::<T>());
-                let any = e.downcast::<T>().unwrap();
-                assert!(any.is::<u16>());
-                assert_eq!(*any.downcast::<u16>().unwrap(), 413);
-            }
-            Ok(()) => panic!()
-        }
-    }
-
-    #[test]
-    fn test_try_panic_message_unit_struct() {
-        struct Juju;
-
-        match thread::spawn(move|| {
-            panic!(Juju)
-        }).join() {
-            Err(ref e) if e.is::<Juju>() => {}
-            Err(_) | Ok(()) => panic!()
-        }
-    }
-
-    #[test]
-    fn test_park_timeout_unpark_before() {
-        for _ in 0..10 {
-            thread::current().unpark();
-            thread::park_timeout(Duration::seconds(10_000_000));
-        }
-    }
-
-    #[test]
-    fn test_park_timeout_unpark_not_called() {
-        for _ in 0..10 {
-            thread::park_timeout(Duration::milliseconds(10));
-        }
-    }
-
-    #[test]
-    fn test_park_timeout_unpark_called_other_thread() {
-        use std::old_io;
-
-        for _ in 0..10 {
-            let th = thread::current();
-
-            let _guard = thread::spawn(move || {
-                old_io::timer::sleep(Duration::milliseconds(50));
-                th.unpark();
-            });
-
-            thread::park_timeout(Duration::seconds(10_000_000));
-        }
-    }
-
-    #[test]
-    fn sleep_smoke() {
-        thread::sleep(Duration::milliseconds(2));
-        thread::sleep(Duration::milliseconds(-2));
-    }
-
-    // NOTE: the corresponding test for stderr is in run-pass/task-stderr, due
-    // to the test harness apparently interfering with stderr configuration.
-}
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
new file mode 100644 (file)
index 0000000..a2b824b
--- /dev/null
@@ -0,0 +1,734 @@
+// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Thread local storage
+
+#![unstable(feature = "thread_local_internals")]
+
+use prelude::v1::*;
+
+use cell::UnsafeCell;
+
+// Sure wish we had macro hygiene, no?
+#[doc(hidden)]
+#[unstable(feature = "thread_local_internals")]
+pub mod __impl {
+    pub use super::imp::Key as KeyInner;
+    pub use super::imp::destroy_value;
+    pub use sys_common::thread_local::INIT_INNER as OS_INIT_INNER;
+    pub use sys_common::thread_local::StaticKey as OsStaticKey;
+}
+
+/// A thread local storage key which owns its contents.
+///
+/// This key uses the fastest possible implementation available to it for the
+/// target platform. It is instantiated with the `thread_local!` macro and the
+/// primary method is the `with` method.
+///
+/// The `with` method yields a reference to the contained value which cannot be
+/// sent across tasks or escape the given closure.
+///
+/// # Initialization and Destruction
+///
+/// Initialization is dynamically performed on the first call to `with()`
+/// within a thread, and values support destructors which will be run when a
+/// thread exits.
+///
+/// # Examples
+///
+/// ```
+/// use std::cell::RefCell;
+/// use std::thread;
+///
+/// thread_local!(static FOO: RefCell<u32> = RefCell::new(1));
+///
+/// FOO.with(|f| {
+///     assert_eq!(*f.borrow(), 1);
+///     *f.borrow_mut() = 2;
+/// });
+///
+/// // each thread starts out with the initial value of 1
+/// thread::spawn(move|| {
+///     FOO.with(|f| {
+///         assert_eq!(*f.borrow(), 1);
+///         *f.borrow_mut() = 3;
+///     });
+/// });
+///
+/// // we retain our original value of 2 despite the child thread
+/// FOO.with(|f| {
+///     assert_eq!(*f.borrow(), 2);
+/// });
+/// ```
+#[stable(feature = "rust1", since = "1.0.0")]
+pub struct LocalKey<T> {
+    // The key itself may be tagged with #[thread_local], and this `Key` is
+    // stored as a `static`, and it's not valid for a static to reference the
+    // address of another thread_local static. For this reason we kinda wonkily
+    // work around this by generating a shim function which will give us the
+    // address of the inner TLS key at runtime.
+    //
+    // This is trivially devirtualizable by LLVM because we never store anything
+    // to this field and rustc can declare the `static` as constant as well.
+    #[doc(hidden)]
+    #[unstable(feature = "thread_local_internals")]
+    pub inner: fn() -> &'static __impl::KeyInner<UnsafeCell<Option<T>>>,
+
+    // initialization routine to invoke to create a value
+    #[doc(hidden)]
+    #[unstable(feature = "thread_local_internals")]
+    pub init: fn() -> T,
+}
+
+/// Declare a new thread local storage key of type `std::thread::LocalKey`.
+#[macro_export]
+#[stable(feature = "rust1", since = "1.0.0")]
+#[allow_internal_unstable]
+macro_rules! thread_local {
+    (static $name:ident: $t:ty = $init:expr) => (
+        static $name: ::std::thread::LocalKey<$t> = {
+            use std::cell::UnsafeCell as __UnsafeCell;
+            use std::thread::__local::__impl::KeyInner as __KeyInner;
+            use std::option::Option as __Option;
+            use std::option::Option::None as __None;
+
+            __thread_local_inner!(static __KEY: __UnsafeCell<__Option<$t>> = {
+                __UnsafeCell { value: __None }
+            });
+            fn __init() -> $t { $init }
+            fn __getit() -> &'static __KeyInner<__UnsafeCell<__Option<$t>>> {
+                &__KEY
+            }
+            ::std::thread::LocalKey { inner: __getit, init: __init }
+        };
+    );
+    (pub static $name:ident: $t:ty = $init:expr) => (
+        pub static $name: ::std::thread::LocalKey<$t> = {
+            use std::cell::UnsafeCell as __UnsafeCell;
+            use std::thread::__local::__impl::KeyInner as __KeyInner;
+            use std::option::Option as __Option;
+            use std::option::Option::None as __None;
+
+            __thread_local_inner!(static __KEY: __UnsafeCell<__Option<$t>> = {
+                __UnsafeCell { value: __None }
+            });
+            fn __init() -> $t { $init }
+            fn __getit() -> &'static __KeyInner<__UnsafeCell<__Option<$t>>> {
+                &__KEY
+            }
+            ::std::thread::LocalKey { inner: __getit, init: __init }
+        };
+    );
+}
+
+// Macro pain #4586:
+//
+// When cross compiling, rustc will load plugins and macros from the *host*
+// platform before search for macros from the target platform. This is primarily
+// done to detect, for example, plugins. Ideally the macro below would be
+// defined once per module below, but unfortunately this means we have the
+// following situation:
+//
+// 1. We compile libstd for x86_64-unknown-linux-gnu, this thread_local!() macro
+//    will inject #[thread_local] statics.
+// 2. We then try to compile a program for arm-linux-androideabi
+// 3. The compiler has a host of linux and a target of android, so it loads
+//    macros from the *linux* libstd.
+// 4. The macro generates a #[thread_local] field, but the android libstd does
+//    not use #[thread_local]
+// 5. Compile error about structs with wrong fields.
+//
+// To get around this, we're forced to inject the #[cfg] logic into the macro
+// itself. Woohoo.
+
+#[macro_export]
+#[doc(hidden)]
+#[allow_internal_unstable]
+macro_rules! __thread_local_inner {
+    (static $name:ident: $t:ty = $init:expr) => (
+        #[cfg_attr(all(any(target_os = "macos", target_os = "linux"),
+                       not(target_arch = "aarch64")),
+                   thread_local)]
+        static $name: ::std::thread::__local::__impl::KeyInner<$t> =
+            __thread_local_inner!($init, $t);
+    );
+    (pub static $name:ident: $t:ty = $init:expr) => (
+        #[cfg_attr(all(any(target_os = "macos", target_os = "linux"),
+                       not(target_arch = "aarch64")),
+                   thread_local)]
+        pub static $name: ::std::thread::__local::__impl::KeyInner<$t> =
+            __thread_local_inner!($init, $t);
+    );
+    ($init:expr, $t:ty) => ({
+        #[cfg(all(any(target_os = "macos", target_os = "linux"), not(target_arch = "aarch64")))]
+        const _INIT: ::std::thread::__local::__impl::KeyInner<$t> = {
+            ::std::thread::__local::__impl::KeyInner {
+                inner: ::std::cell::UnsafeCell { value: $init },
+                dtor_registered: ::std::cell::UnsafeCell { value: false },
+                dtor_running: ::std::cell::UnsafeCell { value: false },
+            }
+        };
+
+        #[allow(trivial_casts)]
+        #[cfg(any(not(any(target_os = "macos", target_os = "linux")), target_arch = "aarch64"))]
+        const _INIT: ::std::thread::__local::__impl::KeyInner<$t> = {
+            ::std::thread::__local::__impl::KeyInner {
+                inner: ::std::cell::UnsafeCell { value: $init },
+                os: ::std::thread::__local::__impl::OsStaticKey {
+                    inner: ::std::thread::__local::__impl::OS_INIT_INNER,
+                    dtor: ::std::option::Option::Some(
+                        ::std::thread::__local::__impl::destroy_value::<$t>
+                    ),
+                },
+            }
+        };
+
+        _INIT
+    });
+}
+
+/// Indicator of the state of a thread local storage key.
+#[unstable(feature = "std_misc",
+           reason = "state querying was recently added")]
+#[derive(Eq, PartialEq, Copy)]
+pub enum LocalKeyState {
+    /// All keys are in this state whenever a thread starts. Keys will
+    /// transition to the `Valid` state once the first call to `with` happens
+    /// and the initialization expression succeeds.
+    ///
+    /// Keys in the `Uninitialized` state will yield a reference to the closure
+    /// passed to `with` so long as the initialization routine does not panic.
+    Uninitialized,
+
+    /// Once a key has been accessed successfully, it will enter the `Valid`
+    /// state. Keys in the `Valid` state will remain so until the thread exits,
+    /// at which point the destructor will be run and the key will enter the
+    /// `Destroyed` state.
+    ///
+    /// Keys in the `Valid` state will be guaranteed to yield a reference to the
+    /// closure passed to `with`.
+    Valid,
+
+    /// When a thread exits, the destructors for keys will be run (if
+    /// necessary). While a destructor is running, and possibly after a
+    /// destructor has run, a key is in the `Destroyed` state.
+    ///
+    /// Keys in the `Destroyed` states will trigger a panic when accessed via
+    /// `with`.
+    Destroyed,
+}
+
+impl<T: 'static> LocalKey<T> {
+    /// Acquire a reference to the value in this TLS key.
+    ///
+    /// This will lazily initialize the value if this thread has not referenced
+    /// this key yet.
+    ///
+    /// # Panics
+    ///
+    /// This function will `panic!()` if the key currently has its
+    /// destructor running, and it **may** panic if the destructor has
+    /// previously been run for this thread.
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn with<F, R>(&'static self, f: F) -> R
+                      where F: FnOnce(&T) -> R {
+        let slot = (self.inner)();
+        unsafe {
+            let slot = slot.get().expect("cannot access a TLS value during or \
+                                          after it is destroyed");
+            f(match *slot.get() {
+                Some(ref inner) => inner,
+                None => self.init(slot),
+            })
+        }
+    }
+
+    unsafe fn init(&self, slot: &UnsafeCell<Option<T>>) -> &T {
+        // Execute the initialization up front, *then* move it into our slot,
+        // just in case initialization fails.
+        let value = (self.init)();
+        let ptr = slot.get();
+        *ptr = Some(value);
+        (*ptr).as_ref().unwrap()
+    }
+
+    /// Query the current state of this key.
+    ///
+    /// A key is initially in the `Uninitialized` state whenever a thread
+    /// starts. It will remain in this state up until the first call to `with`
+    /// within a thread has run the initialization expression successfully.
+    ///
+    /// Once the initialization expression succeeds, the key transitions to the
+    /// `Valid` state which will guarantee that future calls to `with` will
+    /// succeed within the thread.
+    ///
+    /// When a thread exits, each key will be destroyed in turn, and as keys are
+    /// destroyed they will enter the `Destroyed` state just before the
+    /// destructor starts to run. Keys may remain in the `Destroyed` state after
+    /// destruction has completed. Keys without destructors (e.g. with types
+    /// that are `Copy`), may never enter the `Destroyed` state.
+    ///
+    /// Keys in the `Uninitialized` can be accessed so long as the
+    /// initialization does not panic. Keys in the `Valid` state are guaranteed
+    /// to be able to be accessed. Keys in the `Destroyed` state will panic on
+    /// any call to `with`.
+    #[unstable(feature = "std_misc",
+               reason = "state querying was recently added")]
+    pub fn state(&'static self) -> LocalKeyState {
+        unsafe {
+            match (self.inner)().get() {
+                Some(cell) => {
+                    match *cell.get() {
+                        Some(..) => LocalKeyState::Valid,
+                        None => LocalKeyState::Uninitialized,
+                    }
+                }
+                None => LocalKeyState::Destroyed,
+            }
+        }
+    }
+
+    /// Deprecated
+    #[unstable(feature = "std_misc")]
+    #[deprecated(since = "1.0.0",
+                 reason = "function renamed to state() and returns more info")]
+    pub fn destroyed(&'static self) -> bool { self.state() == LocalKeyState::Destroyed }
+}
+
+#[cfg(all(any(target_os = "macos", target_os = "linux"), not(target_arch = "aarch64")))]
+mod imp {
+    use prelude::v1::*;
+
+    use cell::UnsafeCell;
+    use intrinsics;
+    use ptr;
+
+    #[doc(hidden)]
+    #[unstable(feature = "thread_local_internals")]
+    pub struct Key<T> {
+        // Place the inner bits in an `UnsafeCell` to currently get around the
+        // "only Sync statics" restriction. This allows any type to be placed in
+        // the cell.
+        //
+        // Note that all access requires `T: 'static` so it can't be a type with
+        // any borrowed pointers still.
+        #[unstable(feature = "thread_local_internals")]
+        pub inner: UnsafeCell<T>,
+
+        // Metadata to keep track of the state of the destructor. Remember that
+        // these variables are thread-local, not global.
+        #[unstable(feature = "thread_local_internals")]
+        pub dtor_registered: UnsafeCell<bool>, // should be Cell
+        #[unstable(feature = "thread_local_internals")]
+        pub dtor_running: UnsafeCell<bool>, // should be Cell
+    }
+
+    unsafe impl<T> ::marker::Sync for Key<T> { }
+
+    #[doc(hidden)]
+    impl<T> Key<T> {
+        pub unsafe fn get(&'static self) -> Option<&'static T> {
+            if intrinsics::needs_drop::<T>() && *self.dtor_running.get() {
+                return None
+            }
+            self.register_dtor();
+            Some(&*self.inner.get())
+        }
+
+        unsafe fn register_dtor(&self) {
+            if !intrinsics::needs_drop::<T>() || *self.dtor_registered.get() {
+                return
+            }
+
+            register_dtor(self as *const _ as *mut u8,
+                          destroy_value::<T>);
+            *self.dtor_registered.get() = true;
+        }
+    }
+
+    // Since what appears to be glibc 2.18 this symbol has been shipped which
+    // GCC and clang both use to invoke destructors in thread_local globals, so
+    // let's do the same!
+    //
+    // Note, however, that we run on lots older linuxes, as well as cross
+    // compiling from a newer linux to an older linux, so we also have a
+    // fallback implementation to use as well.
+    //
+    // Due to rust-lang/rust#18804, make sure this is not generic!
+    #[cfg(target_os = "linux")]
+    unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern fn(*mut u8)) {
+        use boxed;
+        use mem;
+        use libc;
+        use sys_common::thread_local as os;
+
+        extern {
+            static __dso_handle: *mut u8;
+            #[linkage = "extern_weak"]
+            static __cxa_thread_atexit_impl: *const ();
+        }
+        if !__cxa_thread_atexit_impl.is_null() {
+            type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8),
+                                      arg: *mut u8,
+                                      dso_handle: *mut u8) -> libc::c_int;
+            mem::transmute::<*const (), F>(__cxa_thread_atexit_impl)
+            (dtor, t, __dso_handle);
+            return
+        }
+
+        // The fallback implementation uses a vanilla OS-based TLS key to track
+        // the list of destructors that need to be run for this thread. The key
+        // then has its own destructor which runs all the other destructors.
+        //
+        // The destructor for DTORS is a little special in that it has a `while`
+        // loop to continuously drain the list of registered destructors. It
+        // *should* be the case that this loop always terminates because we
+        // provide the guarantee that a TLS key cannot be set after it is
+        // flagged for destruction.
+        static DTORS: os::StaticKey = os::StaticKey {
+            inner: os::INIT_INNER,
+            dtor: Some(run_dtors as unsafe extern "C" fn(*mut u8)),
+        };
+        type List = Vec<(*mut u8, unsafe extern fn(*mut u8))>;
+        if DTORS.get().is_null() {
+            let v: Box<List> = box Vec::new();
+            DTORS.set(boxed::into_raw(v) as *mut u8);
+        }
+        let list: &mut List = &mut *(DTORS.get() as *mut List);
+        list.push((t, dtor));
+
+        unsafe extern fn run_dtors(mut ptr: *mut u8) {
+            while !ptr.is_null() {
+                let list: Box<List> = Box::from_raw(ptr as *mut List);
+                for &(ptr, dtor) in &*list {
+                    dtor(ptr);
+                }
+                ptr = DTORS.get();
+                DTORS.set(ptr::null_mut());
+            }
+        }
+    }
+
+    // OSX's analog of the above linux function is this _tlv_atexit function.
+    // The disassembly of thread_local globals in C++ (at least produced by
+    // clang) will have this show up in the output.
+    #[cfg(target_os = "macos")]
+    unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern fn(*mut u8)) {
+        extern {
+            fn _tlv_atexit(dtor: unsafe extern fn(*mut u8),
+                           arg: *mut u8);
+        }
+        _tlv_atexit(dtor, t);
+    }
+
+    #[doc(hidden)]
+    #[unstable(feature = "thread_local_internals")]
+    pub unsafe extern fn destroy_value<T>(ptr: *mut u8) {
+        let ptr = ptr as *mut Key<T>;
+        // Right before we run the user destructor be sure to flag the
+        // destructor as running for this thread so calls to `get` will return
+        // `None`.
+        *(*ptr).dtor_running.get() = true;
+        ptr::read((*ptr).inner.get());
+    }
+}
+
+#[cfg(any(not(any(target_os = "macos", target_os = "linux")), target_arch = "aarch64"))]
+mod imp {
+    use prelude::v1::*;
+
+    use alloc::boxed;
+    use cell::UnsafeCell;
+    use mem;
+    use ptr;
+    use sys_common::thread_local::StaticKey as OsStaticKey;
+
+    #[doc(hidden)]
+    #[unstable(feature = "thread_local_internals")]
+    pub struct Key<T> {
+        // Statically allocated initialization expression, using an `UnsafeCell`
+        // for the same reasons as above.
+        #[unstable(feature = "thread_local_internals")]
+        pub inner: UnsafeCell<T>,
+
+        // OS-TLS key that we'll use to key off.
+        #[unstable(feature = "thread_local_internals")]
+        pub os: OsStaticKey,
+    }
+
+    unsafe impl<T> ::marker::Sync for Key<T> { }
+
+    struct Value<T: 'static> {
+        key: &'static Key<T>,
+        value: T,
+    }
+
+    #[doc(hidden)]
+    impl<T> Key<T> {
+        pub unsafe fn get(&'static self) -> Option<&'static T> {
+            self.ptr().map(|p| &*p)
+        }
+
+        unsafe fn ptr(&'static self) -> Option<*mut T> {
+            let ptr = self.os.get() as *mut Value<T>;
+            if !ptr.is_null() {
+                if ptr as usize == 1 {
+                    return None
+                }
+                return Some(&mut (*ptr).value as *mut T);
+            }
+
+            // If the lookup returned null, we haven't initialized our own local
+            // copy, so do that now.
+            //
+            // Also note that this transmute_copy should be ok because the value
+            // `inner` is already validated to be a valid `static` value, so we
+            // should be able to freely copy the bits.
+            let ptr: Box<Value<T>> = box Value {
+                key: self,
+                value: mem::transmute_copy(&self.inner),
+            };
+            let ptr: *mut Value<T> = boxed::into_raw(ptr);
+            self.os.set(ptr as *mut u8);
+            Some(&mut (*ptr).value as *mut T)
+        }
+    }
+
+    #[doc(hidden)]
+    #[unstable(feature = "thread_local_internals")]
+    pub unsafe extern fn destroy_value<T: 'static>(ptr: *mut u8) {
+        // The OS TLS ensures that this key contains a NULL value when this
+        // destructor starts to run. We set it back to a sentinel value of 1 to
+        // ensure that any future calls to `get` for this thread will return
+        // `None`.
+        //
+        // Note that to prevent an infinite loop we reset it back to null right
+        // before we return from the destructor ourselves.
+        let ptr: Box<Value<T>> = Box::from_raw(ptr as *mut Value<T>);
+        let key = ptr.key;
+        key.os.set(1 as *mut u8);
+        drop(ptr);
+        key.os.set(ptr::null_mut());
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use prelude::v1::*;
+
+    use sync::mpsc::{channel, Sender};
+    use cell::UnsafeCell;
+    use super::LocalKeyState;
+    use thread;
+
+    struct Foo(Sender<()>);
+
+    impl Drop for Foo {
+        fn drop(&mut self) {
+            let Foo(ref s) = *self;
+            s.send(()).unwrap();
+        }
+    }
+
+    #[test]
+    fn smoke_no_dtor() {
+        thread_local!(static FOO: UnsafeCell<i32> = UnsafeCell { value: 1 });
+
+        FOO.with(|f| unsafe {
+            assert_eq!(*f.get(), 1);
+            *f.get() = 2;
+        });
+        let (tx, rx) = channel();
+        let _t = thread::spawn(move|| {
+            FOO.with(|f| unsafe {
+                assert_eq!(*f.get(), 1);
+            });
+            tx.send(()).unwrap();
+        });
+        rx.recv().unwrap();
+
+        FOO.with(|f| unsafe {
+            assert_eq!(*f.get(), 2);
+        });
+    }
+
+    #[test]
+    fn states() {
+        struct Foo;
+        impl Drop for Foo {
+            fn drop(&mut self) {
+                assert!(FOO.state() == LocalKeyState::Destroyed);
+            }
+        }
+        fn foo() -> Foo {
+            assert!(FOO.state() == LocalKeyState::Uninitialized);
+            Foo
+        }
+        thread_local!(static FOO: Foo = foo());
+
+        thread::spawn(|| {
+            assert!(FOO.state() == LocalKeyState::Uninitialized);
+            FOO.with(|_| {
+                assert!(FOO.state() == LocalKeyState::Valid);
+            });
+            assert!(FOO.state() == LocalKeyState::Valid);
+        }).join().ok().unwrap();
+    }
+
+    #[test]
+    fn smoke_dtor() {
+        thread_local!(static FOO: UnsafeCell<Option<Foo>> = UnsafeCell {
+            value: None
+        });
+
+        let (tx, rx) = channel();
+        let _t = thread::spawn(move|| unsafe {
+            let mut tx = Some(tx);
+            FOO.with(|f| {
+                *f.get() = Some(Foo(tx.take().unwrap()));
+            });
+        });
+        rx.recv().unwrap();
+    }
+
+    #[test]
+    fn circular() {
+        struct S1;
+        struct S2;
+        thread_local!(static K1: UnsafeCell<Option<S1>> = UnsafeCell {
+            value: None
+        });
+        thread_local!(static K2: UnsafeCell<Option<S2>> = UnsafeCell {
+            value: None
+        });
+        static mut HITS: u32 = 0;
+
+        impl Drop for S1 {
+            fn drop(&mut self) {
+                unsafe {
+                    HITS += 1;
+                    if K2.state() == LocalKeyState::Destroyed {
+                        assert_eq!(HITS, 3);
+                    } else {
+                        if HITS == 1 {
+                            K2.with(|s| *s.get() = Some(S2));
+                        } else {
+                            assert_eq!(HITS, 3);
+                        }
+                    }
+                }
+            }
+        }
+        impl Drop for S2 {
+            fn drop(&mut self) {
+                unsafe {
+                    HITS += 1;
+                    assert!(K1.state() != LocalKeyState::Destroyed);
+                    assert_eq!(HITS, 2);
+                    K1.with(|s| *s.get() = Some(S1));
+                }
+            }
+        }
+
+        thread::spawn(move|| {
+            drop(S1);
+        }).join().ok().unwrap();
+    }
+
+    #[test]
+    fn self_referential() {
+        struct S1;
+        thread_local!(static K1: UnsafeCell<Option<S1>> = UnsafeCell {
+            value: None
+        });
+
+        impl Drop for S1 {
+            fn drop(&mut self) {
+                assert!(K1.state() == LocalKeyState::Destroyed);
+            }
+        }
+
+        thread::spawn(move|| unsafe {
+            K1.with(|s| *s.get() = Some(S1));
+        }).join().ok().unwrap();
+    }
+
+    #[test]
+    fn dtors_in_dtors_in_dtors() {
+        struct S1(Sender<()>);
+        thread_local!(static K1: UnsafeCell<Option<S1>> = UnsafeCell {
+            value: None
+        });
+        thread_local!(static K2: UnsafeCell<Option<Foo>> = UnsafeCell {
+            value: None
+        });
+
+        impl Drop for S1 {
+            fn drop(&mut self) {
+                let S1(ref tx) = *self;
+                unsafe {
+                    if K2.state() != LocalKeyState::Destroyed {
+                        K2.with(|s| *s.get() = Some(Foo(tx.clone())));
+                    }
+                }
+            }
+        }
+
+        let (tx, rx) = channel();
+        let _t = thread::spawn(move|| unsafe {
+            let mut tx = Some(tx);
+            K1.with(|s| *s.get() = Some(S1(tx.take().unwrap())));
+        });
+        rx.recv().unwrap();
+    }
+}
+
+#[cfg(test)]
+mod dynamic_tests {
+    use prelude::v1::*;
+
+    use cell::RefCell;
+    use collections::HashMap;
+
+    #[test]
+    fn smoke() {
+        fn square(i: i32) -> i32 { i * i }
+        thread_local!(static FOO: i32 = square(3));
+
+        FOO.with(|f| {
+            assert_eq!(*f, 9);
+        });
+    }
+
+    #[test]
+    fn hashmap() {
+        fn map() -> RefCell<HashMap<i32, i32>> {
+            let mut m = HashMap::new();
+            m.insert(1, 2);
+            RefCell::new(m)
+        }
+        thread_local!(static FOO: RefCell<HashMap<i32, i32>> = map());
+
+        FOO.with(|map| {
+            assert_eq!(map.borrow()[&1], 2);
+        });
+    }
+
+    #[test]
+    fn refcell_vec() {
+        thread_local!(static FOO: RefCell<Vec<u32>> = RefCell::new(vec![1, 2, 3]));
+
+        FOO.with(|vec| {
+            assert_eq!(vec.borrow().len(), 3);
+            vec.borrow_mut().push(4);
+            assert_eq!(vec.borrow()[3], 4);
+        });
+    }
+}
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
new file mode 100644 (file)
index 0000000..57baeb1
--- /dev/null
@@ -0,0 +1,1026 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Native threads
+//!
+//! ## The threading model
+//!
+//! An executing Rust program consists of a collection of native OS threads,
+//! each with their own stack and local state.
+//!
+//! Communication between threads can be done through
+//! [channels](../../std/sync/mpsc/index.html), Rust's message-passing
+//! types, along with [other forms of thread
+//! synchronization](../../std/sync/index.html) and shared-memory data
+//! structures. In particular, types that are guaranteed to be
+//! threadsafe are easily shared between threads using the
+//! atomically-reference-counted container,
+//! [`Arc`](../../std/sync/struct.Arc.html).
+//!
+//! Fatal logic errors in Rust cause *thread panic*, during which
+//! a thread will unwind the stack, running destructors and freeing
+//! owned resources. Thread panic is unrecoverable from within
+//! the panicking thread (i.e. there is no 'try/catch' in Rust), but
+//! the panic may optionally be detected from a different thread. If
+//! the main thread panics, the application will exit with a non-zero
+//! exit code.
+//!
+//! When the main thread of a Rust program terminates, the entire program shuts
+//! down, even if other threads are still running. However, this module provides
+//! convenient facilities for automatically waiting for the termination of a
+//! child thread (i.e., join).
+//!
+//! ## The `Thread` type
+//!
+//! Threads are represented via the `Thread` type, which you can
+//! get in one of two ways:
+//!
+//! * By spawning a new thread, e.g. using the `thread::spawn` function.
+//! * By requesting the current thread, using the `thread::current` function.
+//!
+//! Threads can be named, and provide some built-in support for low-level
+//! synchronization (described below).
+//!
+//! The `thread::current()` function is available even for threads not spawned
+//! by the APIs of this module.
+//!
+//! ## Spawning a thread
+//!
+//! A new thread can be spawned using the `thread::spawn` function:
+//!
+//! ```rust
+//! use std::thread;
+//!
+//! thread::spawn(move || {
+//!     // some work here
+//! });
+//! ```
+//!
+//! In this example, the spawned thread is "detached" from the current
+//! thread. This means that it can outlive its parent (the thread that spawned
+//! it), unless this parent is the main thread.
+//!
+//! ## Scoped threads
+//!
+//! Often a parent thread uses a child thread to perform some particular task,
+//! and at some point must wait for the child to complete before continuing.
+//! For this scenario, use the `thread::scoped` function:
+//!
+//! ```rust
+//! use std::thread;
+//!
+//! let guard = thread::scoped(move || {
+//!     // some work here
+//! });
+//!
+//! // do some other work in the meantime
+//! let output = guard.join();
+//! ```
+//!
+//! The `scoped` function doesn't return a `Thread` directly; instead,
+//! it returns a *join guard*. The join guard is an RAII-style guard
+//! that will automatically join the child thread (block until it
+//! terminates) when it is dropped. You can join the child thread in
+//! advance by calling the `join` method on the guard, which will also
+//! return the result produced by the thread.  A handle to the thread
+//! itself is available via the `thread` method of the join guard.
+//!
+//! ## Configuring threads
+//!
+//! A new thread can be configured before it is spawned via the `Builder` type,
+//! which currently allows you to set the name, stack size, and writers for
+//! `println!` and `panic!` for the child thread:
+//!
+//! ```rust
+//! use std::thread;
+//!
+//! thread::Builder::new().name("child1".to_string()).spawn(move || {
+//!     println!("Hello, world!");
+//! });
+//! ```
+//!
+//! ## Blocking support: park and unpark
+//!
+//! Every thread is equipped with some basic low-level blocking support, via the
+//! `park` and `unpark` functions.
+//!
+//! Conceptually, each `Thread` handle has an associated token, which is
+//! initially not present:
+//!
+//! * The `thread::park()` function blocks the current thread unless or until
+//!   the token is available for its thread handle, at which point it atomically
+//!   consumes the token. It may also return *spuriously*, without consuming the
+//!   token. `thread::park_timeout()` does the same, but allows specifying a
+//!   maximum time to block the thread for.
+//!
+//! * The `unpark()` method on a `Thread` atomically makes the token available
+//!   if it wasn't already.
+//!
+//! In other words, each `Thread` acts a bit like a semaphore with initial count
+//! 0, except that the semaphore is *saturating* (the count cannot go above 1),
+//! and can return spuriously.
+//!
+//! The API is typically used by acquiring a handle to the current thread,
+//! placing that handle in a shared data structure so that other threads can
+//! find it, and then `park`ing. When some desired condition is met, another
+//! thread calls `unpark` on the handle.
+//!
+//! The motivation for this design is twofold:
+//!
+//! * It avoids the need to allocate mutexes and condvars when building new
+//!   synchronization primitives; the threads already provide basic blocking/signaling.
+//!
+//! * It can be implemented very efficiently on many platforms.
+//!
+//! ## Thread-local storage
+//!
+//! This module also provides an implementation of thread local storage for Rust
+//! programs. Thread local storage is a method of storing data into a global
+//! variable which each thread in the program will have its own copy of.
+//! Threads do not share this data, so accesses do not need to be synchronized.
+//!
+//! At a high level, this module provides two variants of storage:
+//!
+//! * Owned thread-local storage. This is a type of thread local key which
+//!   owns the value that it contains, and will destroy the value when the
+//!   thread exits. This variant is created with the `thread_local!` macro and
+//!   can contain any value which is `'static` (no borrowed pointers).
+//!
+//! * Scoped thread-local storage. This type of key is used to store a reference
+//!   to a value into local storage temporarily for the scope of a function
+//!   call. There are no restrictions on what types of values can be placed
+//!   into this key.
+//!
+//! Both forms of thread local storage provide an accessor function, `with`,
+//! which will yield a shared reference to the value to the specified
+//! closure. Thread-local keys only allow shared access to values as there is no
+//! way to guarantee uniqueness if a mutable borrow was allowed. Most values
+//! will want to make use of some form of **interior mutability** through the
+//! `Cell` or `RefCell` types.
+
+#![stable(feature = "rust1", since = "1.0.0")]
+
+#[stable(feature = "rust1", since = "1.0.0")]
+pub use self::__local::{LocalKey, LocalKeyState};
+
+#[unstable(feature = "scoped_tls",
+            reason = "scoped TLS has yet to have wide enough use to fully consider \
+                      stabilizing its interface")]
+pub use self::__scoped::ScopedKey;
+
+use prelude::v1::*;
+
+use any::Any;
+use cell::UnsafeCell;
+use fmt;
+use io;
+use marker::PhantomData;
+use rt::{self, unwind};
+use sync::{Mutex, Condvar, Arc};
+use sys::thread as imp;
+use sys_common::{stack, thread_info};
+use thunk::Thunk;
+use time::Duration;
+
+#[allow(deprecated)] use old_io::Writer;
+
+////////////////////////////////////////////////////////////////////////////////
+// Thread-local storage
+////////////////////////////////////////////////////////////////////////////////
+
+#[macro_use]
+#[doc(hidden)]
+#[path = "local.rs"] pub mod __local;
+
+#[macro_use]
+#[doc(hidden)]
+#[path = "scoped.rs"] pub mod __scoped;
+
+////////////////////////////////////////////////////////////////////////////////
+// Builder
+////////////////////////////////////////////////////////////////////////////////
+
+/// Thread configuration. Provides detailed control over the properties
+/// and behavior of new threads.
+#[stable(feature = "rust1", since = "1.0.0")]
+pub struct Builder {
+    // A name for the thread-to-be, for identification in panic messages
+    name: Option<String>,
+    // The size of the stack for the spawned thread
+    stack_size: Option<usize>,
+}
+
+impl Builder {
+    /// Generate the base configuration for spawning a thread, from which
+    /// configuration methods can be chained.
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn new() -> Builder {
+        Builder {
+            name: None,
+            stack_size: None,
+        }
+    }
+
+    /// Name the thread-to-be. Currently the name is used for identification
+    /// only in panic messages.
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn name(mut self, name: String) -> Builder {
+        self.name = Some(name);
+        self
+    }
+
+    /// Set the size of the stack for the new thread.
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn stack_size(mut self, size: usize) -> Builder {
+        self.stack_size = Some(size);
+        self
+    }
+
+    /// Redirect thread-local stdout.
+    #[unstable(feature = "std_misc",
+               reason = "Will likely go away after proc removal")]
+    #[deprecated(since = "1.0.0",
+                 reason = "the old I/O module is deprecated and this function \
+                           will be removed with no replacement")]
+    #[allow(deprecated)]
+    pub fn stdout(self, _stdout: Box<Writer + Send + 'static>) -> Builder {
+        self
+    }
+
+    /// Redirect thread-local stderr.
+    #[unstable(feature = "std_misc",
+               reason = "Will likely go away after proc removal")]
+    #[deprecated(since = "1.0.0",
+                 reason = "the old I/O module is deprecated and this function \
+                           will be removed with no replacement")]
+    #[allow(deprecated)]
+    pub fn stderr(self, _stderr: Box<Writer + Send + 'static>) -> Builder {
+        self
+    }
+
+    /// Spawn a new thread, and return a join handle for it.
+    ///
+    /// The child thread may outlive the parent (unless the parent thread
+    /// is the main thread; the whole process is terminated when the main
+    /// thread finishes.) The join handle can be used to block on
+    /// termination of the child thread, including recovering its panics.
+    ///
+    /// # Errors
+    ///
+    /// Unlike the `spawn` free function, this method yields an
+    /// `io::Result` to capture any failure to create the thread at
+    /// the OS level.
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn spawn<F>(self, f: F) -> io::Result<JoinHandle> where
+        F: FnOnce(), F: Send + 'static
+    {
+        self.spawn_inner(Thunk::new(f)).map(|i| JoinHandle(i))
+    }
+
+    /// Spawn a new child thread that must be joined within a given
+    /// scope, and return a `JoinGuard`.
+    ///
+    /// The join guard can be used to explicitly join the child thread (via
+    /// `join`), returning `Result<T>`, or it will implicitly join the child
+    /// upon being dropped. Because the child thread may refer to data on the
+    /// current thread's stack (hence the "scoped" name), it cannot be detached;
+    /// it *must* be joined before the relevant stack frame is popped. See the
+    /// module documentation for additional details.
+    ///
+    /// # Errors
+    ///
+    /// Unlike the `scoped` free function, this method yields an
+    /// `io::Result` to capture any failure to create the thread at
+    /// the OS level.
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn scoped<'a, T, F>(self, f: F) -> io::Result<JoinGuard<'a, T>> where
+        T: Send + 'a, F: FnOnce() -> T, F: Send + 'a
+    {
+        self.spawn_inner(Thunk::new(f)).map(|inner| {
+            JoinGuard { inner: inner, _marker: PhantomData }
+        })
+    }
+
+    fn spawn_inner<T: Send>(self, f: Thunk<(), T>) -> io::Result<JoinInner<T>> {
+        let Builder { name, stack_size } = self;
+
+        let stack_size = stack_size.unwrap_or(rt::min_stack());
+
+        let my_thread = Thread::new(name);
+        let their_thread = my_thread.clone();
+
+        let my_packet = Packet(Arc::new(UnsafeCell::new(None)));
+        let their_packet = Packet(my_packet.0.clone());
+
+        // Spawning a new OS thread guarantees that __morestack will never get
+        // triggered, but we must manually set up the actual stack bounds once
+        // this function starts executing. This raises the lower limit by a bit
+        // because by the time that this function is executing we've already
+        // consumed at least a little bit of stack (we don't know the exact byte
+        // address at which our stack started).
+        let main = move || {
+            let something_around_the_top_of_the_stack = 1;
+            let addr = &something_around_the_top_of_the_stack as *const i32;
+            let my_stack_top = addr as usize;
+            let my_stack_bottom = my_stack_top - stack_size + 1024;
+            unsafe {
+                if let Some(name) = their_thread.name() {
+                    imp::set_name(name);
+                }
+                stack::record_os_managed_stack_bounds(my_stack_bottom,
+                                                      my_stack_top);
+                thread_info::set(imp::guard::current(), their_thread);
+            }
+
+            let mut output = None;
+            let try_result = {
+                let ptr = &mut output;
+
+                // There are two primary reasons that general try/catch is
+                // unsafe. The first is that we do not support nested
+                // try/catch. The fact that this is happening in a newly-spawned
+                // thread suffices. The second is that unwinding while unwinding
+                // is not defined.  We take care of that by having an
+                // 'unwinding' flag in the thread itself. For these reasons,
+                // this unsafety should be ok.
+                unsafe {
+                    unwind::try(move || *ptr = Some(f.invoke(())))
+                }
+            };
+            unsafe {
+                *their_packet.0.get() = Some(match (output, try_result) {
+                    (Some(data), Ok(_)) => Ok(data),
+                    (None, Err(cause)) => Err(cause),
+                    _ => unreachable!()
+                });
+            }
+        };
+
+        Ok(JoinInner {
+            native: try!(unsafe { imp::create(stack_size, Thunk::new(main)) }),
+            thread: my_thread,
+            packet: my_packet,
+            joined: false,
+        })
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Free functions
+////////////////////////////////////////////////////////////////////////////////
+
+/// Spawn a new thread, returning a `JoinHandle` for it.
+///
+/// The join handle will implicitly *detach* the child thread upon being
+/// dropped. In this case, the child thread may outlive the parent (unless
+/// the parent thread is the main thread; the whole process is terminated when
+/// the main thread finishes.) Additionally, the join handle provides a `join`
+/// method that can be used to join the child thread. If the child thread
+/// panics, `join` will return an `Err` containing the argument given to
+/// `panic`.
+///
+/// # Panics
+///
+/// Panicks if the OS fails to create a thread; use `Builder::spawn`
+/// to recover from such errors.
+#[stable(feature = "rust1", since = "1.0.0")]
+pub fn spawn<F>(f: F) -> JoinHandle where F: FnOnce(), F: Send + 'static {
+    Builder::new().spawn(f).unwrap()
+}
+
+/// Spawn a new *scoped* thread, returning a `JoinGuard` for it.
+///
+/// The join guard can be used to explicitly join the child thread (via
+/// `join`), returning `Result<T>`, or it will implicitly join the child
+/// upon being dropped. Because the child thread may refer to data on the
+/// current thread's stack (hence the "scoped" name), it cannot be detached;
+/// it *must* be joined before the relevant stack frame is popped. See the
+/// module documentation for additional details.
+///
+/// # Panics
+///
+/// Panicks if the OS fails to create a thread; use `Builder::scoped`
+/// to recover from such errors.
+#[stable(feature = "rust1", since = "1.0.0")]
+pub fn scoped<'a, T, F>(f: F) -> JoinGuard<'a, T> where
+    T: Send + 'a, F: FnOnce() -> T, F: Send + 'a
+{
+    Builder::new().scoped(f).unwrap()
+}
+
+/// Gets a handle to the thread that invokes it.
+#[stable(feature = "rust1", since = "1.0.0")]
+pub fn current() -> Thread {
+    thread_info::current_thread()
+}
+
+/// Cooperatively give up a timeslice to the OS scheduler.
+#[stable(feature = "rust1", since = "1.0.0")]
+pub fn yield_now() {
+    unsafe { imp::yield_now() }
+}
+
+/// Determines whether the current thread is unwinding because of panic.
+#[inline]
+#[stable(feature = "rust1", since = "1.0.0")]
+pub fn panicking() -> bool {
+    unwind::panicking()
+}
+
+/// Put the current thread to sleep for the specified amount of time.
+///
+/// The thread may sleep longer than the duration specified due to scheduling
+/// specifics or platform-dependent functionality. Note that on unix platforms
+/// this function will not return early due to a signal being received or a
+/// spurious wakeup.
+#[unstable(feature = "thread_sleep",
+           reason = "recently added, needs an RFC, and `Duration` itself is \
+                     unstable")]
+pub fn sleep(dur: Duration) {
+    imp::sleep(dur)
+}
+
+/// Block unless or until the current thread's token is made available (may wake spuriously).
+///
+/// See the module doc for more detail.
+//
+// The implementation currently uses the trivial strategy of a Mutex+Condvar
+// with wakeup flag, which does not actually allow spurious wakeups. In the
+// future, this will be implemented in a more efficient way, perhaps along the lines of
+//   http://cr.openjdk.java.net/~stefank/6989984.1/raw_files/new/src/os/linux/vm/os_linux.cpp
+// or futuxes, and in either case may allow spurious wakeups.
+#[stable(feature = "rust1", since = "1.0.0")]
+pub fn park() {
+    let thread = current();
+    let mut guard = thread.inner.lock.lock().unwrap();
+    while !*guard {
+        guard = thread.inner.cvar.wait(guard).unwrap();
+    }
+    *guard = false;
+}
+
+/// Block unless or until the current thread's token is made available or
+/// the specified duration has been reached (may wake spuriously).
+///
+/// The semantics of this function are equivalent to `park()` except that the
+/// thread will be blocked for roughly no longer than *duration*. This method
+/// should not be used for precise timing due to anomalies such as
+/// preemption or platform differences that may not cause the maximum
+/// amount of time waited to be precisely *duration* long.
+///
+/// See the module doc for more detail.
+#[unstable(feature = "std_misc", reason = "recently introduced, depends on Duration")]
+pub fn park_timeout(duration: Duration) {
+    let thread = current();
+    let mut guard = thread.inner.lock.lock().unwrap();
+    if !*guard {
+        let (g, _) = thread.inner.cvar.wait_timeout(guard, duration).unwrap();
+        guard = g;
+    }
+    *guard = false;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Thread
+////////////////////////////////////////////////////////////////////////////////
+
+/// The internal representation of a `Thread` handle
+struct Inner {
+    name: Option<String>,
+    lock: Mutex<bool>,          // true when there is a buffered unpark
+    cvar: Condvar,
+}
+
+unsafe impl Sync for Inner {}
+
+#[derive(Clone)]
+#[stable(feature = "rust1", since = "1.0.0")]
+/// A handle to a thread.
+pub struct Thread {
+    inner: Arc<Inner>,
+}
+
+impl Thread {
+    // Used only internally to construct a thread object without spawning
+    fn new(name: Option<String>) -> Thread {
+        Thread {
+            inner: Arc::new(Inner {
+                name: name,
+                lock: Mutex::new(false),
+                cvar: Condvar::new(),
+            })
+        }
+    }
+
+    /// Deprecated: use module-level free function.
+    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
+    #[unstable(feature = "std_misc",
+               reason = "may change with specifics of new Send semantics")]
+    pub fn spawn<F>(f: F) -> Thread where F: FnOnce(), F: Send + 'static {
+        Builder::new().spawn(f).unwrap().thread().clone()
+    }
+
+    /// Deprecated: use module-level free function.
+    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
+    #[unstable(feature = "std_misc",
+               reason = "may change with specifics of new Send semantics")]
+    pub fn scoped<'a, T, F>(f: F) -> JoinGuard<'a, T> where
+        T: Send + 'a, F: FnOnce() -> T, F: Send + 'a
+    {
+        Builder::new().scoped(f).unwrap()
+    }
+
+    /// Deprecated: use module-level free function.
+    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn current() -> Thread {
+        thread_info::current_thread()
+    }
+
+    /// Deprecated: use module-level free function.
+    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
+    #[unstable(feature = "std_misc", reason = "name may change")]
+    pub fn yield_now() {
+        unsafe { imp::yield_now() }
+    }
+
+    /// Deprecated: use module-level free function.
+    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
+    #[inline]
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn panicking() -> bool {
+        unwind::panicking()
+    }
+
+    /// Deprecated: use module-level free function.
+    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
+    #[unstable(feature = "std_misc", reason = "recently introduced")]
+    pub fn park() {
+        let thread = current();
+        let mut guard = thread.inner.lock.lock().unwrap();
+        while !*guard {
+            guard = thread.inner.cvar.wait(guard).unwrap();
+        }
+        *guard = false;
+    }
+
+    /// Deprecated: use module-level free function.
+    #[deprecated(since = "1.0.0", reason = "use module-level free function")]
+    #[unstable(feature = "std_misc", reason = "recently introduced")]
+    pub fn park_timeout(duration: Duration) {
+        let thread = current();
+        let mut guard = thread.inner.lock.lock().unwrap();
+        if !*guard {
+            let (g, _) = thread.inner.cvar.wait_timeout(guard, duration).unwrap();
+            guard = g;
+        }
+        *guard = false;
+    }
+
+    /// Atomically makes the handle's token available if it is not already.
+    ///
+    /// See the module doc for more detail.
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn unpark(&self) {
+        let mut guard = self.inner.lock.lock().unwrap();
+        if !*guard {
+            *guard = true;
+            self.inner.cvar.notify_one();
+        }
+    }
+
+    /// Get the thread's name.
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn name(&self) -> Option<&str> {
+        self.inner.name.as_ref().map(|s| &**s)
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl fmt::Debug for Thread {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::Debug::fmt(&self.name(), f)
+    }
+}
+
+// a hack to get around privacy restrictions
+impl thread_info::NewThread for Thread {
+    fn new(name: Option<String>) -> Thread { Thread::new(name) }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// JoinHandle and JoinGuard
+////////////////////////////////////////////////////////////////////////////////
+
+/// Indicates the manner in which a thread exited.
+///
+/// A thread that completes without panicking is considered to exit successfully.
+#[stable(feature = "rust1", since = "1.0.0")]
+pub type Result<T> = ::result::Result<T, Box<Any + Send + 'static>>;
+
+struct Packet<T>(Arc<UnsafeCell<Option<Result<T>>>>);
+
+unsafe impl<T:Send> Send for Packet<T> {}
+unsafe impl<T> Sync for Packet<T> {}
+
+/// Inner representation for JoinHandle and JoinGuard
+struct JoinInner<T> {
+    native: imp::rust_thread,
+    thread: Thread,
+    packet: Packet<T>,
+    joined: bool,
+}
+
+impl<T> JoinInner<T> {
+    fn join(&mut self) -> Result<T> {
+        assert!(!self.joined);
+        unsafe { imp::join(self.native) };
+        self.joined = true;
+        unsafe {
+            (*self.packet.0.get()).take().unwrap()
+        }
+    }
+}
+
+/// An owned permission to join on a thread (block on its termination).
+///
+/// Unlike a `JoinGuard`, a `JoinHandle` *detaches* the child thread
+/// when it is dropped, rather than automatically joining on drop.
+///
+/// Due to platform restrictions, it is not possible to `Clone` this
+/// handle: the ability to join a child thread is a uniquely-owned
+/// permission.
+#[stable(feature = "rust1", since = "1.0.0")]
+pub struct JoinHandle(JoinInner<()>);
+
+impl JoinHandle {
+    /// Extract a handle to the underlying thread
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn thread(&self) -> &Thread {
+        &self.0.thread
+    }
+
+    /// Wait for the associated thread to finish.
+    ///
+    /// If the child thread panics, `Err` is returned with the parameter given
+    /// to `panic`.
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn join(mut self) -> Result<()> {
+        self.0.join()
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl Drop for JoinHandle {
+    fn drop(&mut self) {
+        if !self.0.joined {
+            unsafe { imp::detach(self.0.native) }
+        }
+    }
+}
+
+/// An RAII-style guard that will block until thread termination when dropped.
+///
+/// The type `T` is the return type for the thread's main function.
+///
+/// Joining on drop is necessary to ensure memory safety when stack
+/// data is shared between a parent and child thread.
+///
+/// Due to platform restrictions, it is not possible to `Clone` this
+/// handle: the ability to join a child thread is a uniquely-owned
+/// permission.
+#[must_use = "thread will be immediately joined if `JoinGuard` is not used"]
+#[stable(feature = "rust1", since = "1.0.0")]
+pub struct JoinGuard<'a, T: 'a> {
+    inner: JoinInner<T>,
+    _marker: PhantomData<&'a T>,
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+unsafe impl<'a, T: Send + 'a> Sync for JoinGuard<'a, T> {}
+
+impl<'a, T: Send + 'a> JoinGuard<'a, T> {
+    /// Extract a handle to the thread this guard will join on.
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn thread(&self) -> &Thread {
+        &self.inner.thread
+    }
+
+    /// Wait for the associated thread to finish, returning the result of the thread's
+    /// calculation.
+    ///
+    /// # Panics
+    ///
+    /// Panics on the child thread are propagated by panicking the parent.
+    #[stable(feature = "rust1", since = "1.0.0")]
+    pub fn join(mut self) -> T {
+        match self.inner.join() {
+            Ok(res) => res,
+            Err(_) => panic!("child thread {:?} panicked", self.thread()),
+        }
+    }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<T: Send> JoinGuard<'static, T> {
+    /// Detaches the child thread, allowing it to outlive its parent.
+    #[deprecated(since = "1.0.0", reason = "use spawn instead")]
+    #[unstable(feature = "std_misc")]
+    pub fn detach(mut self) {
+        unsafe { imp::detach(self.inner.native) };
+        self.inner.joined = true; // avoid joining in the destructor
+    }
+}
+
+#[unsafe_destructor]
+#[stable(feature = "rust1", since = "1.0.0")]
+impl<'a, T: Send + 'a> Drop for JoinGuard<'a, T> {
+    fn drop(&mut self) {
+        if !self.inner.joined {
+            if self.inner.join().is_err() {
+                panic!("child thread {:?} panicked", self.thread());
+            }
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Tests
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(test)]
+mod test {
+    use prelude::v1::*;
+
+    use any::Any;
+    use sync::mpsc::{channel, Sender};
+    use boxed::BoxAny;
+    use result;
+    use std::old_io::{ChanReader, ChanWriter};
+    use super::{Builder};
+    use thread;
+    use thunk::Thunk;
+    use time::Duration;
+
+    // !!! These tests are dangerous. If something is buggy, they will hang, !!!
+    // !!! instead of exiting cleanly. This might wedge the buildbots.       !!!
+
+    #[test]
+    fn test_unnamed_thread() {
+        thread::spawn(move|| {
+            assert!(thread::current().name().is_none());
+        }).join().ok().unwrap();
+    }
+
+    #[test]
+    fn test_named_thread() {
+        Builder::new().name("ada lovelace".to_string()).scoped(move|| {
+            assert!(thread::current().name().unwrap() == "ada lovelace".to_string());
+        }).unwrap().join();
+    }
+
+    #[test]
+    fn test_run_basic() {
+        let (tx, rx) = channel();
+        thread::spawn(move|| {
+            tx.send(()).unwrap();
+        });
+        rx.recv().unwrap();
+    }
+
+    #[test]
+    fn test_join_success() {
+        assert!(thread::scoped(move|| -> String {
+            "Success!".to_string()
+        }).join() == "Success!");
+    }
+
+    #[test]
+    fn test_join_panic() {
+        match thread::spawn(move|| {
+            panic!()
+        }).join() {
+            result::Result::Err(_) => (),
+            result::Result::Ok(()) => panic!()
+        }
+    }
+
+    #[test]
+    fn test_scoped_success() {
+        let res = thread::scoped(move|| -> String {
+            "Success!".to_string()
+        }).join();
+        assert!(res == "Success!");
+    }
+
+    #[test]
+    #[should_fail]
+    fn test_scoped_panic() {
+        thread::scoped(|| panic!()).join();
+    }
+
+    #[test]
+    #[should_fail]
+    fn test_scoped_implicit_panic() {
+        let _ = thread::scoped(|| panic!());
+    }
+
+    #[test]
+    fn test_spawn_sched() {
+        use clone::Clone;
+
+        let (tx, rx) = channel();
+
+        fn f(i: i32, tx: Sender<()>) {
+            let tx = tx.clone();
+            thread::spawn(move|| {
+                if i == 0 {
+                    tx.send(()).unwrap();
+                } else {
+                    f(i - 1, tx);
+                }
+            });
+
+        }
+        f(10, tx);
+        rx.recv().unwrap();
+    }
+
+    #[test]
+    fn test_spawn_sched_childs_on_default_sched() {
+        let (tx, rx) = channel();
+
+        thread::spawn(move|| {
+            thread::spawn(move|| {
+                tx.send(()).unwrap();
+            });
+        });
+
+        rx.recv().unwrap();
+    }
+
+    fn avoid_copying_the_body<F>(spawnfn: F) where F: FnOnce(Thunk<'static>) {
+        let (tx, rx) = channel();
+
+        let x: Box<_> = box 1;
+        let x_in_parent = (&*x) as *const i32 as usize;
+
+        spawnfn(Thunk::new(move|| {
+            let x_in_child = (&*x) as *const i32 as usize;
+            tx.send(x_in_child).unwrap();
+        }));
+
+        let x_in_child = rx.recv().unwrap();
+        assert_eq!(x_in_parent, x_in_child);
+    }
+
+    #[test]
+    fn test_avoid_copying_the_body_spawn() {
+        avoid_copying_the_body(|v| {
+            thread::spawn(move || v.invoke(()));
+        });
+    }
+
+    #[test]
+    fn test_avoid_copying_the_body_thread_spawn() {
+        avoid_copying_the_body(|f| {
+            thread::spawn(move|| {
+                f.invoke(());
+            });
+        })
+    }
+
+    #[test]
+    fn test_avoid_copying_the_body_join() {
+        avoid_copying_the_body(|f| {
+            let _ = thread::spawn(move|| {
+                f.invoke(())
+            }).join();
+        })
+    }
+
+    #[test]
+    fn test_child_doesnt_ref_parent() {
+        // If the child refcounts the parent task, this will stack overflow when
+        // climbing the task tree to dereference each ancestor. (See #1789)
+        // (well, it would if the constant were 8000+ - I lowered it to be more
+        // valgrind-friendly. try this at home, instead..!)
+        const GENERATIONS: u32 = 16;
+        fn child_no(x: u32) -> Thunk<'static> {
+            return Thunk::new(move|| {
+                if x < GENERATIONS {
+                    thread::spawn(move|| child_no(x+1).invoke(()));
+                }
+            });
+        }
+        thread::spawn(|| child_no(0).invoke(()));
+    }
+
+    #[test]
+    fn test_simple_newsched_spawn() {
+        thread::spawn(move || {});
+    }
+
+    #[test]
+    fn test_try_panic_message_static_str() {
+        match thread::spawn(move|| {
+            panic!("static string");
+        }).join() {
+            Err(e) => {
+                type T = &'static str;
+                assert!(e.is::<T>());
+                assert_eq!(*e.downcast::<T>().unwrap(), "static string");
+            }
+            Ok(()) => panic!()
+        }
+    }
+
+    #[test]
+    fn test_try_panic_message_owned_str() {
+        match thread::spawn(move|| {
+            panic!("owned string".to_string());
+        }).join() {
+            Err(e) => {
+                type T = String;
+                assert!(e.is::<T>());
+                assert_eq!(*e.downcast::<T>().unwrap(), "owned string".to_string());
+            }
+            Ok(()) => panic!()
+        }
+    }
+
+    #[test]
+    fn test_try_panic_message_any() {
+        match thread::spawn(move|| {
+            panic!(box 413u16 as Box<Any + Send>);
+        }).join() {
+            Err(e) => {
+                type T = Box<Any + Send>;
+                assert!(e.is::<T>());
+                let any = e.downcast::<T>().unwrap();
+                assert!(any.is::<u16>());
+                assert_eq!(*any.downcast::<u16>().unwrap(), 413);
+            }
+            Ok(()) => panic!()
+        }
+    }
+
+    #[test]
+    fn test_try_panic_message_unit_struct() {
+        struct Juju;
+
+        match thread::spawn(move|| {
+            panic!(Juju)
+        }).join() {
+            Err(ref e) if e.is::<Juju>() => {}
+            Err(_) | Ok(()) => panic!()
+        }
+    }
+
+    #[test]
+    fn test_park_timeout_unpark_before() {
+        for _ in 0..10 {
+            thread::current().unpark();
+            thread::park_timeout(Duration::seconds(10_000_000));
+        }
+    }
+
+    #[test]
+    fn test_park_timeout_unpark_not_called() {
+        for _ in 0..10 {
+            thread::park_timeout(Duration::milliseconds(10));
+        }
+    }
+
+    #[test]
+    fn test_park_timeout_unpark_called_other_thread() {
+        use std::old_io;
+
+        for _ in 0..10 {
+            let th = thread::current();
+
+            let _guard = thread::spawn(move || {
+                old_io::timer::sleep(Duration::milliseconds(50));
+                th.unpark();
+            });
+
+            thread::park_timeout(Duration::seconds(10_000_000));
+        }
+    }
+
+    #[test]
+    fn sleep_smoke() {
+        thread::sleep(Duration::milliseconds(2));
+        thread::sleep(Duration::milliseconds(-2));
+    }
+
+    // NOTE: the corresponding test for stderr is in run-pass/task-stderr, due
+    // to the test harness apparently interfering with stderr configuration.
+}
diff --git a/src/libstd/thread/scoped.rs b/src/libstd/thread/scoped.rs
new file mode 100644 (file)
index 0000000..b384879
--- /dev/null
@@ -0,0 +1,320 @@
+// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Scoped thread-local storage
+//!
+//! This module provides the ability to generate *scoped* thread-local
+//! variables. In this sense, scoped indicates that thread local storage
+//! actually stores a reference to a value, and this reference is only placed
+//! in storage for a scoped amount of time.
+//!
+//! There are no restrictions on what types can be placed into a scoped
+//! variable, but all scoped variables are initialized to the equivalent of
+//! null. Scoped thread local storage is useful when a value is present for a known
+//! period of time and it is not required to relinquish ownership of the
+//! contents.
+//!
+//! # Examples
+//!
+//! ```
+//! # #![feature(scoped_tls)]
+//! scoped_thread_local!(static FOO: u32);
+//!
+//! // Initially each scoped slot is empty.
+//! assert!(!FOO.is_set());
+//!
+//! // When inserting a value, the value is only in place for the duration
+//! // of the closure specified.
+//! FOO.set(&1, || {
+//!     FOO.with(|slot| {
+//!         assert_eq!(*slot, 1);
+//!     });
+//! });
+//! ```
+
+#![unstable(feature = "thread_local_internals")]
+
+use prelude::v1::*;
+
+// macro hygiene sure would be nice, wouldn't it?
+#[doc(hidden)]
+pub mod __impl {
+    pub use super::imp::KeyInner;
+    pub use sys_common::thread_local::INIT as OS_INIT;
+}
+
+/// Type representing a thread local storage key corresponding to a reference
+/// to the type parameter `T`.
+///
+/// Keys are statically allocated and can contain a reference to an instance of
+/// type `T` scoped to a particular lifetime. Keys provides two methods, `set`
+/// and `with`, both of which currently use closures to control the scope of
+/// their contents.
+#[unstable(feature = "scoped_tls",
+           reason = "scoped TLS has yet to have wide enough use to fully consider \
+                     stabilizing its interface")]
+pub struct ScopedKey<T> { #[doc(hidden)] pub inner: __impl::KeyInner<T> }
+
+/// Declare a new scoped thread local storage key.
+///
+/// This macro declares a `static` item on which methods are used to get and
+/// set the value stored within.
+#[macro_export]
+#[allow_internal_unstable]
+macro_rules! scoped_thread_local {
+    (static $name:ident: $t:ty) => (
+        __scoped_thread_local_inner!(static $name: $t);
+    );
+    (pub static $name:ident: $t:ty) => (
+        __scoped_thread_local_inner!(pub static $name: $t);
+    );
+}
+
+#[macro_export]
+#[doc(hidden)]
+#[allow_internal_unstable]
+macro_rules! __scoped_thread_local_inner {
+    (static $name:ident: $t:ty) => (
+        #[cfg_attr(not(any(windows,
+                           target_os = "android",
+                           target_os = "ios",
+                           target_os = "openbsd",
+                           target_arch = "aarch64")),
+                   thread_local)]
+        static $name: ::std::thread::ScopedKey<$t> =
+            __scoped_thread_local_inner!($t);
+    );
+    (pub static $name:ident: $t:ty) => (
+        #[cfg_attr(not(any(windows,
+                           target_os = "android",
+                           target_os = "ios",
+                           target_os = "openbsd",
+                           target_arch = "aarch64")),
+                   thread_local)]
+        pub static $name: ::std::thread::ScopedKey<$t> =
+            __scoped_thread_local_inner!($t);
+    );
+    ($t:ty) => ({
+        use std::thread::ScopedKey as __Key;
+
+        #[cfg(not(any(windows,
+                      target_os = "android",
+                      target_os = "ios",
+                      target_os = "openbsd",
+                      target_arch = "aarch64")))]
+        const _INIT: __Key<$t> = __Key {
+            inner: ::std::thread::__scoped::__impl::KeyInner {
+                inner: ::std::cell::UnsafeCell { value: 0 as *mut _ },
+            }
+        };
+
+        #[cfg(any(windows,
+                  target_os = "android",
+                  target_os = "ios",
+                  target_os = "openbsd",
+                  target_arch = "aarch64"))]
+        const _INIT: __Key<$t> = __Key {
+            inner: ::std::thread::__scoped::__impl::KeyInner {
+                inner: ::std::thread::__scoped::__impl::OS_INIT,
+                marker: ::std::marker::PhantomData::<::std::cell::Cell<$t>>,
+            }
+        };
+
+        _INIT
+    })
+}
+
+#[unstable(feature = "scoped_tls",
+           reason = "scoped TLS has yet to have wide enough use to fully consider \
+                     stabilizing its interface")]
+impl<T> ScopedKey<T> {
+    /// Insert a value into this scoped thread local storage slot for a
+    /// duration of a closure.
+    ///
+    /// While `cb` is running, the value `t` will be returned by `get` unless
+    /// this function is called recursively inside of `cb`.
+    ///
+    /// Upon return, this function will restore the previous value, if any
+    /// was available.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// # #![feature(scoped_tls)]
+    /// scoped_thread_local!(static FOO: u32);
+    ///
+    /// FOO.set(&100, || {
+    ///     let val = FOO.with(|v| *v);
+    ///     assert_eq!(val, 100);
+    ///
+    ///     // set can be called recursively
+    ///     FOO.set(&101, || {
+    ///         // ...
+    ///     });
+    ///
+    ///     // Recursive calls restore the previous value.
+    ///     let val = FOO.with(|v| *v);
+    ///     assert_eq!(val, 100);
+    /// });
+    /// ```
+    pub fn set<R, F>(&'static self, t: &T, cb: F) -> R where
+        F: FnOnce() -> R,
+    {
+        struct Reset<'a, T: 'a> {
+            key: &'a __impl::KeyInner<T>,
+            val: *mut T,
+        }
+        #[unsafe_destructor]
+        impl<'a, T> Drop for Reset<'a, T> {
+            fn drop(&mut self) {
+                unsafe { self.key.set(self.val) }
+            }
+        }
+
+        let prev = unsafe {
+            let prev = self.inner.get();
+            self.inner.set(t as *const T as *mut T);
+            prev
+        };
+
+        let _reset = Reset { key: &self.inner, val: prev };
+        cb()
+    }
+
+    /// Get a value out of this scoped variable.
+    ///
+    /// This function takes a closure which receives the value of this
+    /// variable.
+    ///
+    /// # Panics
+    ///
+    /// This function will panic if `set` has not previously been called.
+    ///
+    /// # Examples
+    ///
+    /// ```no_run
+    /// # #![feature(scoped_tls)]
+    /// scoped_thread_local!(static FOO: u32);
+    ///
+    /// FOO.with(|slot| {
+    ///     // work with `slot`
+    /// });
+    /// ```
+    pub fn with<R, F>(&'static self, cb: F) -> R where
+        F: FnOnce(&T) -> R
+    {
+        unsafe {
+            let ptr = self.inner.get();
+            assert!(!ptr.is_null(), "cannot access a scoped thread local \
+                                     variable without calling `set` first");
+            cb(&*ptr)
+        }
+    }
+
+    /// Test whether this TLS key has been `set` for the current thread.
+    pub fn is_set(&'static self) -> bool {
+        unsafe { !self.inner.get().is_null() }
+    }
+}
+
+#[cfg(not(any(windows,
+              target_os = "android",
+              target_os = "ios",
+              target_os = "openbsd",
+              target_arch = "aarch64")))]
+mod imp {
+    use std::cell::UnsafeCell;
+
+    #[doc(hidden)]
+    pub struct KeyInner<T> { pub inner: UnsafeCell<*mut T> }
+
+    unsafe impl<T> ::marker::Sync for KeyInner<T> { }
+
+    #[doc(hidden)]
+    impl<T> KeyInner<T> {
+        #[doc(hidden)]
+        pub unsafe fn set(&self, ptr: *mut T) { *self.inner.get() = ptr; }
+        #[doc(hidden)]
+        pub unsafe fn get(&self) -> *mut T { *self.inner.get() }
+    }
+}
+
+#[cfg(any(windows,
+          target_os = "android",
+          target_os = "ios",
+          target_os = "openbsd",
+          target_arch = "aarch64"))]
+mod imp {
+    use marker;
+    use std::cell::Cell;
+    use sys_common::thread_local::StaticKey as OsStaticKey;
+
+    #[doc(hidden)]
+    pub struct KeyInner<T> {
+        pub inner: OsStaticKey,
+        pub marker: marker::PhantomData<Cell<T>>,
+    }
+
+    unsafe impl<T> ::marker::Sync for KeyInner<T> { }
+
+    #[doc(hidden)]
+    impl<T> KeyInner<T> {
+        #[doc(hidden)]
+        pub unsafe fn set(&self, ptr: *mut T) { self.inner.set(ptr as *mut _) }
+        #[doc(hidden)]
+        pub unsafe fn get(&self) -> *mut T { self.inner.get() as *mut _ }
+    }
+}
+
+
+#[cfg(test)]
+mod tests {
+    use cell::Cell;
+    use prelude::v1::*;
+
+    scoped_thread_local!(static FOO: u32);
+
+    #[test]
+    fn smoke() {
+        scoped_thread_local!(static BAR: u32);
+
+        assert!(!BAR.is_set());
+        BAR.set(&1, || {
+            assert!(BAR.is_set());
+            BAR.with(|slot| {
+                assert_eq!(*slot, 1);
+            });
+        });
+        assert!(!BAR.is_set());
+    }
+
+    #[test]
+    fn cell_allowed() {
+        scoped_thread_local!(static BAR: Cell<u32>);
+
+        BAR.set(&Cell::new(1), || {
+            BAR.with(|slot| {
+                assert_eq!(slot.get(), 1);
+            });
+        });
+    }
+
+    #[test]
+    fn scope_item_allowed() {
+        assert!(!FOO.is_set());
+        FOO.set(&1, || {
+            assert!(FOO.is_set());
+            FOO.with(|slot| {
+                assert_eq!(*slot, 1);
+            });
+        });
+        assert!(!FOO.is_set());
+    }
+}
diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs
deleted file mode 100644 (file)
index 0878029..0000000
+++ /dev/null
@@ -1,762 +0,0 @@
-// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-//! Thread local storage
-//!
-//! This module provides an implementation of thread local storage for Rust
-//! programs. Thread local storage is a method of storing data into a global
-//! variable which each thread in the program will have its own copy of.
-//! Threads do not share this data, so accesses do not need to be synchronized.
-//!
-//! At a high level, this module provides two variants of storage:
-//!
-//! * Owning thread local storage. This is a type of thread local key which
-//!   owns the value that it contains, and will destroy the value when the
-//!   thread exits. This variant is created with the `thread_local!` macro and
-//!   can contain any value which is `'static` (no borrowed pointers.
-//!
-//! * Scoped thread local storage. This type of key is used to store a reference
-//!   to a value into local storage temporarily for the scope of a function
-//!   call. There are no restrictions on what types of values can be placed
-//!   into this key.
-//!
-//! Both forms of thread local storage provide an accessor function, `with`,
-//! which will yield a shared reference to the value to the specified
-//! closure. Thread local keys only allow shared access to values as there is no
-//! way to guarantee uniqueness if a mutable borrow was allowed. Most values
-//! will want to make use of some form of **interior mutability** through the
-//! `Cell` or `RefCell` types.
-
-#![stable(feature = "rust1", since = "1.0.0")]
-
-use prelude::v1::*;
-
-use cell::UnsafeCell;
-
-#[macro_use]
-pub mod scoped;
-
-// Sure wish we had macro hygiene, no?
-#[doc(hidden)]
-#[unstable(feature = "thread_local_internals")]
-pub mod __impl {
-    pub use super::imp::Key as KeyInner;
-    pub use super::imp::destroy_value;
-    pub use sys_common::thread_local::INIT_INNER as OS_INIT_INNER;
-    pub use sys_common::thread_local::StaticKey as OsStaticKey;
-}
-
-/// A thread local storage key which owns its contents.
-///
-/// This key uses the fastest possible implementation available to it for the
-/// target platform. It is instantiated with the `thread_local!` macro and the
-/// primary method is the `with` method.
-///
-/// The `with` method yields a reference to the contained value which cannot be
-/// sent across tasks or escape the given closure.
-///
-/// # Initialization and Destruction
-///
-/// Initialization is dynamically performed on the first call to `with()`
-/// within a thread, and values support destructors which will be run when a
-/// thread exits.
-///
-/// # Examples
-///
-/// ```
-/// use std::cell::RefCell;
-/// use std::thread;
-///
-/// thread_local!(static FOO: RefCell<u32> = RefCell::new(1));
-///
-/// FOO.with(|f| {
-///     assert_eq!(*f.borrow(), 1);
-///     *f.borrow_mut() = 2;
-/// });
-///
-/// // each thread starts out with the initial value of 1
-/// thread::spawn(move|| {
-///     FOO.with(|f| {
-///         assert_eq!(*f.borrow(), 1);
-///         *f.borrow_mut() = 3;
-///     });
-/// });
-///
-/// // we retain our original value of 2 despite the child thread
-/// FOO.with(|f| {
-///     assert_eq!(*f.borrow(), 2);
-/// });
-/// ```
-#[stable(feature = "rust1", since = "1.0.0")]
-pub struct Key<T> {
-    // The key itself may be tagged with #[thread_local], and this `Key` is
-    // stored as a `static`, and it's not valid for a static to reference the
-    // address of another thread_local static. For this reason we kinda wonkily
-    // work around this by generating a shim function which will give us the
-    // address of the inner TLS key at runtime.
-    //
-    // This is trivially devirtualizable by LLVM because we never store anything
-    // to this field and rustc can declare the `static` as constant as well.
-    #[doc(hidden)]
-    #[unstable(feature = "thread_local_internals")]
-    pub inner: fn() -> &'static __impl::KeyInner<UnsafeCell<Option<T>>>,
-
-    // initialization routine to invoke to create a value
-    #[doc(hidden)]
-    #[unstable(feature = "thread_local_internals")]
-    pub init: fn() -> T,
-}
-
-/// Declare a new thread local storage key of type `std::thread_local::Key`.
-#[macro_export]
-#[stable(feature = "rust1", since = "1.0.0")]
-#[allow_internal_unstable]
-macro_rules! thread_local {
-    (static $name:ident: $t:ty = $init:expr) => (
-        static $name: ::std::thread_local::Key<$t> = {
-            use std::cell::UnsafeCell as __UnsafeCell;
-            use std::thread_local::__impl::KeyInner as __KeyInner;
-            use std::option::Option as __Option;
-            use std::option::Option::None as __None;
-
-            __thread_local_inner!(static __KEY: __UnsafeCell<__Option<$t>> = {
-                __UnsafeCell { value: __None }
-            });
-            fn __init() -> $t { $init }
-            fn __getit() -> &'static __KeyInner<__UnsafeCell<__Option<$t>>> {
-                &__KEY
-            }
-            ::std::thread_local::Key { inner: __getit, init: __init }
-        };
-    );
-    (pub static $name:ident: $t:ty = $init:expr) => (
-        pub static $name: ::std::thread_local::Key<$t> = {
-            use std::cell::UnsafeCell as __UnsafeCell;
-            use std::thread_local::__impl::KeyInner as __KeyInner;
-            use std::option::Option as __Option;
-            use std::option::Option::None as __None;
-
-            __thread_local_inner!(static __KEY: __UnsafeCell<__Option<$t>> = {
-                __UnsafeCell { value: __None }
-            });
-            fn __init() -> $t { $init }
-            fn __getit() -> &'static __KeyInner<__UnsafeCell<__Option<$t>>> {
-                &__KEY
-            }
-            ::std::thread_local::Key { inner: __getit, init: __init }
-        };
-    );
-}
-
-// Macro pain #4586:
-//
-// When cross compiling, rustc will load plugins and macros from the *host*
-// platform before search for macros from the target platform. This is primarily
-// done to detect, for example, plugins. Ideally the macro below would be
-// defined once per module below, but unfortunately this means we have the
-// following situation:
-//
-// 1. We compile libstd for x86_64-unknown-linux-gnu, this thread_local!() macro
-//    will inject #[thread_local] statics.
-// 2. We then try to compile a program for arm-linux-androideabi
-// 3. The compiler has a host of linux and a target of android, so it loads
-//    macros from the *linux* libstd.
-// 4. The macro generates a #[thread_local] field, but the android libstd does
-//    not use #[thread_local]
-// 5. Compile error about structs with wrong fields.
-//
-// To get around this, we're forced to inject the #[cfg] logic into the macro
-// itself. Woohoo.
-
-#[macro_export]
-#[doc(hidden)]
-#[allow_internal_unstable]
-macro_rules! __thread_local_inner {
-    (static $name:ident: $t:ty = $init:expr) => (
-        #[cfg_attr(all(any(target_os = "macos", target_os = "linux"),
-                       not(target_arch = "aarch64")),
-                   thread_local)]
-        static $name: ::std::thread_local::__impl::KeyInner<$t> =
-            __thread_local_inner!($init, $t);
-    );
-    (pub static $name:ident: $t:ty = $init:expr) => (
-        #[cfg_attr(all(any(target_os = "macos", target_os = "linux"),
-                       not(target_arch = "aarch64")),
-                   thread_local)]
-        pub static $name: ::std::thread_local::__impl::KeyInner<$t> =
-            __thread_local_inner!($init, $t);
-    );
-    ($init:expr, $t:ty) => ({
-        #[cfg(all(any(target_os = "macos", target_os = "linux"), not(target_arch = "aarch64")))]
-        const _INIT: ::std::thread_local::__impl::KeyInner<$t> = {
-            ::std::thread_local::__impl::KeyInner {
-                inner: ::std::cell::UnsafeCell { value: $init },
-                dtor_registered: ::std::cell::UnsafeCell { value: false },
-                dtor_running: ::std::cell::UnsafeCell { value: false },
-            }
-        };
-
-        #[cfg(any(not(any(target_os = "macos", target_os = "linux")), target_arch = "aarch64"))]
-        const _INIT: ::std::thread_local::__impl::KeyInner<$t> = {
-            unsafe extern fn __destroy(ptr: *mut u8) {
-                ::std::thread_local::__impl::destroy_value::<$t>(ptr);
-            }
-
-            ::std::thread_local::__impl::KeyInner {
-                inner: ::std::cell::UnsafeCell { value: $init },
-                os: ::std::thread_local::__impl::OsStaticKey {
-                    inner: ::std::thread_local::__impl::OS_INIT_INNER,
-                    dtor: ::std::option::Option::Some(__destroy as unsafe extern fn(*mut u8)),
-                },
-            }
-        };
-
-        _INIT
-    });
-}
-
-/// Indicator of the state of a thread local storage key.
-#[unstable(feature = "std_misc",
-           reason = "state querying was recently added")]
-#[derive(Eq, PartialEq, Copy)]
-pub enum State {
-    /// All keys are in this state whenever a thread starts. Keys will
-    /// transition to the `Valid` state once the first call to `with` happens
-    /// and the initialization expression succeeds.
-    ///
-    /// Keys in the `Uninitialized` state will yield a reference to the closure
-    /// passed to `with` so long as the initialization routine does not panic.
-    Uninitialized,
-
-    /// Once a key has been accessed successfully, it will enter the `Valid`
-    /// state. Keys in the `Valid` state will remain so until the thread exits,
-    /// at which point the destructor will be run and the key will enter the
-    /// `Destroyed` state.
-    ///
-    /// Keys in the `Valid` state will be guaranteed to yield a reference to the
-    /// closure passed to `with`.
-    Valid,
-
-    /// When a thread exits, the destructors for keys will be run (if
-    /// necessary). While a destructor is running, and possibly after a
-    /// destructor has run, a key is in the `Destroyed` state.
-    ///
-    /// Keys in the `Destroyed` states will trigger a panic when accessed via
-    /// `with`.
-    Destroyed,
-}
-
-impl<T: 'static> Key<T> {
-    /// Acquire a reference to the value in this TLS key.
-    ///
-    /// This will lazily initialize the value if this thread has not referenced
-    /// this key yet.
-    ///
-    /// # Panics
-    ///
-    /// This function will `panic!()` if the key currently has its
-    /// destructor running, and it **may** panic if the destructor has
-    /// previously been run for this thread.
-    #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn with<F, R>(&'static self, f: F) -> R
-                      where F: FnOnce(&T) -> R {
-        let slot = (self.inner)();
-        unsafe {
-            let slot = slot.get().expect("cannot access a TLS value during or \
-                                          after it is destroyed");
-            f(match *slot.get() {
-                Some(ref inner) => inner,
-                None => self.init(slot),
-            })
-        }
-    }
-
-    unsafe fn init(&self, slot: &UnsafeCell<Option<T>>) -> &T {
-        // Execute the initialization up front, *then* move it into our slot,
-        // just in case initialization fails.
-        let value = (self.init)();
-        let ptr = slot.get();
-        *ptr = Some(value);
-        (*ptr).as_ref().unwrap()
-    }
-
-    /// Query the current state of this key.
-    ///
-    /// A key is initially in the `Uninitialized` state whenever a thread
-    /// starts. It will remain in this state up until the first call to `with`
-    /// within a thread has run the initialization expression successfully.
-    ///
-    /// Once the initialization expression succeeds, the key transitions to the
-    /// `Valid` state which will guarantee that future calls to `with` will
-    /// succeed within the thread.
-    ///
-    /// When a thread exits, each key will be destroyed in turn, and as keys are
-    /// destroyed they will enter the `Destroyed` state just before the
-    /// destructor starts to run. Keys may remain in the `Destroyed` state after
-    /// destruction has completed. Keys without destructors (e.g. with types
-    /// that are `Copy`), may never enter the `Destroyed` state.
-    ///
-    /// Keys in the `Uninitialized` can be accessed so long as the
-    /// initialization does not panic. Keys in the `Valid` state are guaranteed
-    /// to be able to be accessed. Keys in the `Destroyed` state will panic on
-    /// any call to `with`.
-    #[unstable(feature = "std_misc",
-               reason = "state querying was recently added")]
-    pub fn state(&'static self) -> State {
-        unsafe {
-            match (self.inner)().get() {
-                Some(cell) => {
-                    match *cell.get() {
-                        Some(..) => State::Valid,
-                        None => State::Uninitialized,
-                    }
-                }
-                None => State::Destroyed,
-            }
-        }
-    }
-
-    /// Deprecated
-    #[unstable(feature = "std_misc")]
-    #[deprecated(since = "1.0.0",
-                 reason = "function renamed to state() and returns more info")]
-    pub fn destroyed(&'static self) -> bool { self.state() == State::Destroyed }
-}
-
-#[cfg(all(any(target_os = "macos", target_os = "linux"), not(target_arch = "aarch64")))]
-mod imp {
-    use prelude::v1::*;
-
-    use cell::UnsafeCell;
-    use intrinsics;
-    use ptr;
-
-    #[doc(hidden)]
-    #[unstable(feature = "thread_local_internals")]
-    pub struct Key<T> {
-        // Place the inner bits in an `UnsafeCell` to currently get around the
-        // "only Sync statics" restriction. This allows any type to be placed in
-        // the cell.
-        //
-        // Note that all access requires `T: 'static` so it can't be a type with
-        // any borrowed pointers still.
-        #[unstable(feature = "thread_local_internals")]
-        pub inner: UnsafeCell<T>,
-
-        // Metadata to keep track of the state of the destructor. Remember that
-        // these variables are thread-local, not global.
-        #[unstable(feature = "thread_local_internals")]
-        pub dtor_registered: UnsafeCell<bool>, // should be Cell
-        #[unstable(feature = "thread_local_internals")]
-        pub dtor_running: UnsafeCell<bool>, // should be Cell
-    }
-
-    unsafe impl<T> ::marker::Sync for Key<T> { }
-
-    #[doc(hidden)]
-    impl<T> Key<T> {
-        pub unsafe fn get(&'static self) -> Option<&'static T> {
-            if intrinsics::needs_drop::<T>() && *self.dtor_running.get() {
-                return None
-            }
-            self.register_dtor();
-            Some(&*self.inner.get())
-        }
-
-        unsafe fn register_dtor(&self) {
-            if !intrinsics::needs_drop::<T>() || *self.dtor_registered.get() {
-                return
-            }
-
-            register_dtor(self as *const _ as *mut u8,
-                          destroy_value::<T>);
-            *self.dtor_registered.get() = true;
-        }
-    }
-
-    // Since what appears to be glibc 2.18 this symbol has been shipped which
-    // GCC and clang both use to invoke destructors in thread_local globals, so
-    // let's do the same!
-    //
-    // Note, however, that we run on lots older linuxes, as well as cross
-    // compiling from a newer linux to an older linux, so we also have a
-    // fallback implementation to use as well.
-    //
-    // Due to rust-lang/rust#18804, make sure this is not generic!
-    #[cfg(target_os = "linux")]
-    unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern fn(*mut u8)) {
-        use boxed;
-        use mem;
-        use libc;
-        use sys_common::thread_local as os;
-
-        extern {
-            static __dso_handle: *mut u8;
-            #[linkage = "extern_weak"]
-            static __cxa_thread_atexit_impl: *const ();
-        }
-        if !__cxa_thread_atexit_impl.is_null() {
-            type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8),
-                                      arg: *mut u8,
-                                      dso_handle: *mut u8) -> libc::c_int;
-            mem::transmute::<*const (), F>(__cxa_thread_atexit_impl)
-            (dtor, t, __dso_handle);
-            return
-        }
-
-        // The fallback implementation uses a vanilla OS-based TLS key to track
-        // the list of destructors that need to be run for this thread. The key
-        // then has its own destructor which runs all the other destructors.
-        //
-        // The destructor for DTORS is a little special in that it has a `while`
-        // loop to continuously drain the list of registered destructors. It
-        // *should* be the case that this loop always terminates because we
-        // provide the guarantee that a TLS key cannot be set after it is
-        // flagged for destruction.
-        static DTORS: os::StaticKey = os::StaticKey {
-            inner: os::INIT_INNER,
-            dtor: Some(run_dtors as unsafe extern "C" fn(*mut u8)),
-        };
-        type List = Vec<(*mut u8, unsafe extern fn(*mut u8))>;
-        if DTORS.get().is_null() {
-            let v: Box<List> = box Vec::new();
-            DTORS.set(boxed::into_raw(v) as *mut u8);
-        }
-        let list: &mut List = &mut *(DTORS.get() as *mut List);
-        list.push((t, dtor));
-
-        unsafe extern fn run_dtors(mut ptr: *mut u8) {
-            while !ptr.is_null() {
-                let list: Box<List> = Box::from_raw(ptr as *mut List);
-                for &(ptr, dtor) in &*list {
-                    dtor(ptr);
-                }
-                ptr = DTORS.get();
-                DTORS.set(ptr::null_mut());
-            }
-        }
-    }
-
-    // OSX's analog of the above linux function is this _tlv_atexit function.
-    // The disassembly of thread_local globals in C++ (at least produced by
-    // clang) will have this show up in the output.
-    #[cfg(target_os = "macos")]
-    unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern fn(*mut u8)) {
-        extern {
-            fn _tlv_atexit(dtor: unsafe extern fn(*mut u8),
-                           arg: *mut u8);
-        }
-        _tlv_atexit(dtor, t);
-    }
-
-    #[doc(hidden)]
-    #[unstable(feature = "thread_local_internals")]
-    pub unsafe extern fn destroy_value<T>(ptr: *mut u8) {
-        let ptr = ptr as *mut Key<T>;
-        // Right before we run the user destructor be sure to flag the
-        // destructor as running for this thread so calls to `get` will return
-        // `None`.
-        *(*ptr).dtor_running.get() = true;
-        ptr::read((*ptr).inner.get());
-    }
-}
-
-#[cfg(any(not(any(target_os = "macos", target_os = "linux")), target_arch = "aarch64"))]
-mod imp {
-    use prelude::v1::*;
-
-    use alloc::boxed;
-    use cell::UnsafeCell;
-    use mem;
-    use ptr;
-    use sys_common::thread_local::StaticKey as OsStaticKey;
-
-    #[doc(hidden)]
-    #[unstable(feature = "thread_local_internals")]
-    pub struct Key<T> {
-        // Statically allocated initialization expression, using an `UnsafeCell`
-        // for the same reasons as above.
-        #[unstable(feature = "thread_local_internals")]
-        pub inner: UnsafeCell<T>,
-
-        // OS-TLS key that we'll use to key off.
-        #[unstable(feature = "thread_local_internals")]
-        pub os: OsStaticKey,
-    }
-
-    unsafe impl<T> ::marker::Sync for Key<T> { }
-
-    struct Value<T: 'static> {
-        key: &'static Key<T>,
-        value: T,
-    }
-
-    #[doc(hidden)]
-    impl<T> Key<T> {
-        pub unsafe fn get(&'static self) -> Option<&'static T> {
-            self.ptr().map(|p| &*p)
-        }
-
-        unsafe fn ptr(&'static self) -> Option<*mut T> {
-            let ptr = self.os.get() as *mut Value<T>;
-            if !ptr.is_null() {
-                if ptr as usize == 1 {
-                    return None
-                }
-                return Some(&mut (*ptr).value as *mut T);
-            }
-
-            // If the lookup returned null, we haven't initialized our own local
-            // copy, so do that now.
-            //
-            // Also note that this transmute_copy should be ok because the value
-            // `inner` is already validated to be a valid `static` value, so we
-            // should be able to freely copy the bits.
-            let ptr: Box<Value<T>> = box Value {
-                key: self,
-                value: mem::transmute_copy(&self.inner),
-            };
-            let ptr: *mut Value<T> = boxed::into_raw(ptr);
-            self.os.set(ptr as *mut u8);
-            Some(&mut (*ptr).value as *mut T)
-        }
-    }
-
-    #[doc(hidden)]
-    #[unstable(feature = "thread_local_internals")]
-    pub unsafe extern fn destroy_value<T: 'static>(ptr: *mut u8) {
-        // The OS TLS ensures that this key contains a NULL value when this
-        // destructor starts to run. We set it back to a sentinel value of 1 to
-        // ensure that any future calls to `get` for this thread will return
-        // `None`.
-        //
-        // Note that to prevent an infinite loop we reset it back to null right
-        // before we return from the destructor ourselves.
-        let ptr: Box<Value<T>> = Box::from_raw(ptr as *mut Value<T>);
-        let key = ptr.key;
-        key.os.set(1 as *mut u8);
-        drop(ptr);
-        key.os.set(ptr::null_mut());
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use prelude::v1::*;
-
-    use sync::mpsc::{channel, Sender};
-    use cell::UnsafeCell;
-    use super::State;
-    use thread;
-
-    struct Foo(Sender<()>);
-
-    impl Drop for Foo {
-        fn drop(&mut self) {
-            let Foo(ref s) = *self;
-            s.send(()).unwrap();
-        }
-    }
-
-    #[test]
-    fn smoke_no_dtor() {
-        thread_local!(static FOO: UnsafeCell<i32> = UnsafeCell { value: 1 });
-
-        FOO.with(|f| unsafe {
-            assert_eq!(*f.get(), 1);
-            *f.get() = 2;
-        });
-        let (tx, rx) = channel();
-        let _t = thread::spawn(move|| {
-            FOO.with(|f| unsafe {
-                assert_eq!(*f.get(), 1);
-            });
-            tx.send(()).unwrap();
-        });
-        rx.recv().unwrap();
-
-        FOO.with(|f| unsafe {
-            assert_eq!(*f.get(), 2);
-        });
-    }
-
-    #[test]
-    fn states() {
-        struct Foo;
-        impl Drop for Foo {
-            fn drop(&mut self) {
-                assert!(FOO.state() == State::Destroyed);
-            }
-        }
-        fn foo() -> Foo {
-            assert!(FOO.state() == State::Uninitialized);
-            Foo
-        }
-        thread_local!(static FOO: Foo = foo());
-
-        thread::spawn(|| {
-            assert!(FOO.state() == State::Uninitialized);
-            FOO.with(|_| {
-                assert!(FOO.state() == State::Valid);
-            });
-            assert!(FOO.state() == State::Valid);
-        }).join().ok().unwrap();
-    }
-
-    #[test]
-    fn smoke_dtor() {
-        thread_local!(static FOO: UnsafeCell<Option<Foo>> = UnsafeCell {
-            value: None
-        });
-
-        let (tx, rx) = channel();
-        let _t = thread::spawn(move|| unsafe {
-            let mut tx = Some(tx);
-            FOO.with(|f| {
-                *f.get() = Some(Foo(tx.take().unwrap()));
-            });
-        });
-        rx.recv().unwrap();
-    }
-
-    #[test]
-    fn circular() {
-        struct S1;
-        struct S2;
-        thread_local!(static K1: UnsafeCell<Option<S1>> = UnsafeCell {
-            value: None
-        });
-        thread_local!(static K2: UnsafeCell<Option<S2>> = UnsafeCell {
-            value: None
-        });
-        static mut HITS: u32 = 0;
-
-        impl Drop for S1 {
-            fn drop(&mut self) {
-                unsafe {
-                    HITS += 1;
-                    if K2.state() == State::Destroyed {
-                        assert_eq!(HITS, 3);
-                    } else {
-                        if HITS == 1 {
-                            K2.with(|s| *s.get() = Some(S2));
-                        } else {
-                            assert_eq!(HITS, 3);
-                        }
-                    }
-                }
-            }
-        }
-        impl Drop for S2 {
-            fn drop(&mut self) {
-                unsafe {
-                    HITS += 1;
-                    assert!(K1.state() != State::Destroyed);
-                    assert_eq!(HITS, 2);
-                    K1.with(|s| *s.get() = Some(S1));
-                }
-            }
-        }
-
-        thread::spawn(move|| {
-            drop(S1);
-        }).join().ok().unwrap();
-    }
-
-    #[test]
-    fn self_referential() {
-        struct S1;
-        thread_local!(static K1: UnsafeCell<Option<S1>> = UnsafeCell {
-            value: None
-        });
-
-        impl Drop for S1 {
-            fn drop(&mut self) {
-                assert!(K1.state() == State::Destroyed);
-            }
-        }
-
-        thread::spawn(move|| unsafe {
-            K1.with(|s| *s.get() = Some(S1));
-        }).join().ok().unwrap();
-    }
-
-    #[test]
-    fn dtors_in_dtors_in_dtors() {
-        struct S1(Sender<()>);
-        thread_local!(static K1: UnsafeCell<Option<S1>> = UnsafeCell {
-            value: None
-        });
-        thread_local!(static K2: UnsafeCell<Option<Foo>> = UnsafeCell {
-            value: None
-        });
-
-        impl Drop for S1 {
-            fn drop(&mut self) {
-                let S1(ref tx) = *self;
-                unsafe {
-                    if K2.state() != State::Destroyed {
-                        K2.with(|s| *s.get() = Some(Foo(tx.clone())));
-                    }
-                }
-            }
-        }
-
-        let (tx, rx) = channel();
-        let _t = thread::spawn(move|| unsafe {
-            let mut tx = Some(tx);
-            K1.with(|s| *s.get() = Some(S1(tx.take().unwrap())));
-        });
-        rx.recv().unwrap();
-    }
-}
-
-#[cfg(test)]
-mod dynamic_tests {
-    use prelude::v1::*;
-
-    use cell::RefCell;
-    use collections::HashMap;
-
-    #[test]
-    fn smoke() {
-        fn square(i: i32) -> i32 { i * i }
-        thread_local!(static FOO: i32 = square(3));
-
-        FOO.with(|f| {
-            assert_eq!(*f, 9);
-        });
-    }
-
-    #[test]
-    fn hashmap() {
-        fn map() -> RefCell<HashMap<i32, i32>> {
-            let mut m = HashMap::new();
-            m.insert(1, 2);
-            RefCell::new(m)
-        }
-        thread_local!(static FOO: RefCell<HashMap<i32, i32>> = map());
-
-        FOO.with(|map| {
-            assert_eq!(map.borrow()[1], 2);
-        });
-    }
-
-    #[test]
-    fn refcell_vec() {
-        thread_local!(static FOO: RefCell<Vec<u32>> = RefCell::new(vec![1, 2, 3]));
-
-        FOO.with(|vec| {
-            assert_eq!(vec.borrow().len(), 3);
-            vec.borrow_mut().push(4);
-            assert_eq!(vec.borrow()[3], 4);
-        });
-    }
-}
diff --git a/src/libstd/thread_local/scoped.rs b/src/libstd/thread_local/scoped.rs
deleted file mode 100644 (file)
index 86e6c05..0000000
+++ /dev/null
@@ -1,313 +0,0 @@
-// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-//! Scoped thread-local storage
-//!
-//! This module provides the ability to generate *scoped* thread-local
-//! variables. In this sense, scoped indicates that thread local storage
-//! actually stores a reference to a value, and this reference is only placed
-//! in storage for a scoped amount of time.
-//!
-//! There are no restrictions on what types can be placed into a scoped
-//! variable, but all scoped variables are initialized to the equivalent of
-//! null. Scoped thread local storage is useful when a value is present for a known
-//! period of time and it is not required to relinquish ownership of the
-//! contents.
-//!
-//! # Examples
-//!
-//! ```
-//! scoped_thread_local!(static FOO: u32);
-//!
-//! // Initially each scoped slot is empty.
-//! assert!(!FOO.is_set());
-//!
-//! // When inserting a value, the value is only in place for the duration
-//! // of the closure specified.
-//! FOO.set(&1, || {
-//!     FOO.with(|slot| {
-//!         assert_eq!(*slot, 1);
-//!     });
-//! });
-//! ```
-
-#![unstable(feature = "std_misc",
-            reason = "scoped TLS has yet to have wide enough use to fully consider \
-                      stabilizing its interface")]
-
-use prelude::v1::*;
-
-// macro hygiene sure would be nice, wouldn't it?
-#[doc(hidden)]
-pub mod __impl {
-    pub use super::imp::KeyInner;
-    pub use sys_common::thread_local::INIT as OS_INIT;
-}
-
-/// Type representing a thread local storage key corresponding to a reference
-/// to the type parameter `T`.
-///
-/// Keys are statically allocated and can contain a reference to an instance of
-/// type `T` scoped to a particular lifetime. Keys provides two methods, `set`
-/// and `with`, both of which currently use closures to control the scope of
-/// their contents.
-pub struct Key<T> { #[doc(hidden)] pub inner: __impl::KeyInner<T> }
-
-/// Declare a new scoped thread local storage key.
-///
-/// This macro declares a `static` item on which methods are used to get and
-/// set the value stored within.
-#[macro_export]
-#[allow_internal_unstable]
-macro_rules! scoped_thread_local {
-    (static $name:ident: $t:ty) => (
-        __scoped_thread_local_inner!(static $name: $t);
-    );
-    (pub static $name:ident: $t:ty) => (
-        __scoped_thread_local_inner!(pub static $name: $t);
-    );
-}
-
-#[macro_export]
-#[doc(hidden)]
-#[allow_internal_unstable]
-macro_rules! __scoped_thread_local_inner {
-    (static $name:ident: $t:ty) => (
-        #[cfg_attr(not(any(windows,
-                           target_os = "android",
-                           target_os = "ios",
-                           target_os = "openbsd",
-                           target_arch = "aarch64")),
-                   thread_local)]
-        static $name: ::std::thread_local::scoped::Key<$t> =
-            __scoped_thread_local_inner!($t);
-    );
-    (pub static $name:ident: $t:ty) => (
-        #[cfg_attr(not(any(windows,
-                           target_os = "android",
-                           target_os = "ios",
-                           target_os = "openbsd",
-                           target_arch = "aarch64")),
-                   thread_local)]
-        pub static $name: ::std::thread_local::scoped::Key<$t> =
-            __scoped_thread_local_inner!($t);
-    );
-    ($t:ty) => ({
-        use std::thread_local::scoped::Key as __Key;
-
-        #[cfg(not(any(windows,
-                      target_os = "android",
-                      target_os = "ios",
-                      target_os = "openbsd",
-                      target_arch = "aarch64")))]
-        const _INIT: __Key<$t> = __Key {
-            inner: ::std::thread_local::scoped::__impl::KeyInner {
-                inner: ::std::cell::UnsafeCell { value: 0 as *mut _ },
-            }
-        };
-
-        #[cfg(any(windows,
-                  target_os = "android",
-                  target_os = "ios",
-                  target_os = "openbsd",
-                  target_arch = "aarch64"))]
-        const _INIT: __Key<$t> = __Key {
-            inner: ::std::thread_local::scoped::__impl::KeyInner {
-                inner: ::std::thread_local::scoped::__impl::OS_INIT,
-                marker: ::std::marker::PhantomData::<::std::cell::Cell<$t>>,
-            }
-        };
-
-        _INIT
-    })
-}
-
-impl<T> Key<T> {
-    /// Insert a value into this scoped thread local storage slot for a
-    /// duration of a closure.
-    ///
-    /// While `cb` is running, the value `t` will be returned by `get` unless
-    /// this function is called recursively inside of `cb`.
-    ///
-    /// Upon return, this function will restore the previous value, if any
-    /// was available.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// scoped_thread_local!(static FOO: u32);
-    ///
-    /// FOO.set(&100, || {
-    ///     let val = FOO.with(|v| *v);
-    ///     assert_eq!(val, 100);
-    ///
-    ///     // set can be called recursively
-    ///     FOO.set(&101, || {
-    ///         // ...
-    ///     });
-    ///
-    ///     // Recursive calls restore the previous value.
-    ///     let val = FOO.with(|v| *v);
-    ///     assert_eq!(val, 100);
-    /// });
-    /// ```
-    pub fn set<R, F>(&'static self, t: &T, cb: F) -> R where
-        F: FnOnce() -> R,
-    {
-        struct Reset<'a, T: 'a> {
-            key: &'a __impl::KeyInner<T>,
-            val: *mut T,
-        }
-        #[unsafe_destructor]
-        impl<'a, T> Drop for Reset<'a, T> {
-            fn drop(&mut self) {
-                unsafe { self.key.set(self.val) }
-            }
-        }
-
-        let prev = unsafe {
-            let prev = self.inner.get();
-            self.inner.set(t as *const T as *mut T);
-            prev
-        };
-
-        let _reset = Reset { key: &self.inner, val: prev };
-        cb()
-    }
-
-    /// Get a value out of this scoped variable.
-    ///
-    /// This function takes a closure which receives the value of this
-    /// variable.
-    ///
-    /// # Panics
-    ///
-    /// This function will panic if `set` has not previously been called.
-    ///
-    /// # Examples
-    ///
-    /// ```no_run
-    /// scoped_thread_local!(static FOO: u32);
-    ///
-    /// FOO.with(|slot| {
-    ///     // work with `slot`
-    /// });
-    /// ```
-    pub fn with<R, F>(&'static self, cb: F) -> R where
-        F: FnOnce(&T) -> R
-    {
-        unsafe {
-            let ptr = self.inner.get();
-            assert!(!ptr.is_null(), "cannot access a scoped thread local \
-                                     variable without calling `set` first");
-            cb(&*ptr)
-        }
-    }
-
-    /// Test whether this TLS key has been `set` for the current thread.
-    pub fn is_set(&'static self) -> bool {
-        unsafe { !self.inner.get().is_null() }
-    }
-}
-
-#[cfg(not(any(windows,
-              target_os = "android",
-              target_os = "ios",
-              target_os = "openbsd",
-              target_arch = "aarch64")))]
-mod imp {
-    use std::cell::UnsafeCell;
-
-    #[doc(hidden)]
-    pub struct KeyInner<T> { pub inner: UnsafeCell<*mut T> }
-
-    unsafe impl<T> ::marker::Sync for KeyInner<T> { }
-
-    #[doc(hidden)]
-    impl<T> KeyInner<T> {
-        #[doc(hidden)]
-        pub unsafe fn set(&self, ptr: *mut T) { *self.inner.get() = ptr; }
-        #[doc(hidden)]
-        pub unsafe fn get(&self) -> *mut T { *self.inner.get() }
-    }
-}
-
-#[cfg(any(windows,
-          target_os = "android",
-          target_os = "ios",
-          target_os = "openbsd",
-          target_arch = "aarch64"))]
-mod imp {
-    use marker;
-    use std::cell::Cell;
-    use sys_common::thread_local::StaticKey as OsStaticKey;
-
-    #[doc(hidden)]
-    pub struct KeyInner<T> {
-        pub inner: OsStaticKey,
-        pub marker: marker::PhantomData<Cell<T>>,
-    }
-
-    unsafe impl<T> ::marker::Sync for KeyInner<T> { }
-
-    #[doc(hidden)]
-    impl<T> KeyInner<T> {
-        #[doc(hidden)]
-        pub unsafe fn set(&self, ptr: *mut T) { self.inner.set(ptr as *mut _) }
-        #[doc(hidden)]
-        pub unsafe fn get(&self) -> *mut T { self.inner.get() as *mut _ }
-    }
-}
-
-
-#[cfg(test)]
-mod tests {
-    use cell::Cell;
-    use prelude::v1::*;
-
-    scoped_thread_local!(static FOO: u32);
-
-    #[test]
-    fn smoke() {
-        scoped_thread_local!(static BAR: u32);
-
-        assert!(!BAR.is_set());
-        BAR.set(&1, || {
-            assert!(BAR.is_set());
-            BAR.with(|slot| {
-                assert_eq!(*slot, 1);
-            });
-        });
-        assert!(!BAR.is_set());
-    }
-
-    #[test]
-    fn cell_allowed() {
-        scoped_thread_local!(static BAR: Cell<u32>);
-
-        BAR.set(&Cell::new(1), || {
-            BAR.with(|slot| {
-                assert_eq!(slot.get(), 1);
-            });
-        });
-    }
-
-    #[test]
-    fn scope_item_allowed() {
-        assert!(!FOO.is_set());
-        FOO.set(&1, || {
-            assert!(FOO.is_set());
-            FOO.with(|slot| {
-                assert_eq!(*slot, 1);
-            });
-        });
-        assert!(!FOO.is_set());
-    }
-}
index 70aab26092c440548a082bebf4d1ae230602ac6a..6a00fff186002f4383ec2b0e24da9556d3b25dcd 100644 (file)
@@ -284,7 +284,7 @@ pub struct ExpnInfo {
 
 impl ExpnId {
     pub fn from_llvm_cookie(cookie: c_uint) -> ExpnId {
-        ExpnId(cookie as u32)
+        ExpnId(cookie)
     }
 
     pub fn to_llvm_cookie(self) -> i32 {
@@ -351,8 +351,7 @@ fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
                         let max_line_length = if lines.len() == 1 {
                             0
                         } else {
-                            lines.as_slice()
-                                 .windows(2)
+                            lines.windows(2)
                                  .map(|w| w[1] - w[0])
                                  .map(|bp| bp.to_usize())
                                  .max()
@@ -377,7 +376,7 @@ fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
                         match bytes_per_diff {
                             1 => for diff in diff_iter { try! { (diff.0 as u8).encode(s) } },
                             2 => for diff in diff_iter { try! { (diff.0 as u16).encode(s) } },
-                            4 => for diff in diff_iter { try! { (diff.0 as u32).encode(s) } },
+                            4 => for diff in diff_iter { try! { diff.0.encode(s) } },
                             _ => unreachable!()
                         }
                     }
@@ -651,7 +650,7 @@ pub fn span_to_lines(&self, sp: Span) -> FileLines {
         let lo = self.lookup_char_pos(sp.lo);
         let hi = self.lookup_char_pos(sp.hi);
         let mut lines = Vec::new();
-        for i in lo.line - 1..hi.line as usize {
+        for i in lo.line - 1..hi.line {
             lines.push(i);
         };
         FileLines {file: lo.file, lines: lines}
index 35449bde0b2e086e870198f5874dc882838a8e23..b679456b3537ba00ea448ec2ca0706e7da07bbd3 100644 (file)
@@ -264,7 +264,7 @@ pub fn $fld(v: $t) -> Box<MacResult> {
                     box MacEager {
                         $fld: Some(v),
                         ..Default::default()
-                    } as Box<MacResult>
+                    }
                 }
             )*
         }
@@ -330,7 +330,7 @@ impl DummyResult {
     /// Use this as a return value after hitting any errors and
     /// calling `span_err`.
     pub fn any(sp: Span) -> Box<MacResult+'static> {
-        box DummyResult { expr_only: false, span: sp } as Box<MacResult+'static>
+        box DummyResult { expr_only: false, span: sp }
     }
 
     /// Create a default MacResult that can only be an expression.
@@ -339,7 +339,7 @@ pub fn any(sp: Span) -> Box<MacResult+'static> {
     /// if an error is encountered internally, the user will receive
     /// an error that they also used it in the wrong place.
     pub fn expr(sp: Span) -> Box<MacResult+'static> {
-        box DummyResult { expr_only: true, span: sp } as Box<MacResult+'static>
+        box DummyResult { expr_only: true, span: sp }
     }
 
     /// A plain dummy expression.
index 2631c28cf2fe9296e19e9589a4d01ab13ee114dd..d8c50b5a0942ae37eeedfbad14a71ada51aa65af 100644 (file)
@@ -78,14 +78,6 @@ macro_rules! path_std {
 
 pub mod generic;
 
-fn expand_deprecated_deriving(cx: &mut ExtCtxt,
-                              span: Span,
-                              _: &MetaItem,
-                              _: &Item,
-                              _: &mut FnMut(P<Item>)) {
-    cx.span_err(span, "`deriving` has been renamed to `derive`");
-}
-
 fn expand_derive(cx: &mut ExtCtxt,
                  _: Span,
                  mitem: &MetaItem,
@@ -151,8 +143,6 @@ fn expand(&self,
 
             env.insert(intern("derive"),
                        Modifier(Box::new(expand_derive)));
-            env.insert(intern("deriving"),
-                       Decorator(Box::new(expand_deprecated_deriving)));
         }
 
         fn is_builtin_trait(name: &str) -> bool {
index 0eaca9af4f08d41258287ac5c0dc24704b848caa..2fe77bf7a5411cbff2ed0c49a6acfeb769e32491 100644 (file)
@@ -513,7 +513,7 @@ fn into_expr(mut self) -> P<ast::Expr> {
             let lname = self.ecx.ident_of(&format!("__arg{}",
                                                   *name));
             pats.push(self.ecx.pat_ident(e.span, lname));
-            names[self.name_positions[*name]] =
+            names[*self.name_positions.get(name).unwrap()] =
                 Some(Context::format_arg(self.ecx, e.span, arg_ty,
                                          self.ecx.expr_ident(e.span, lname)));
             heads.push(self.ecx.expr_addr_of(e.span, e));
index c11ffe66e6c392305450dd13706994e6ba3ed812..a25a6451918d72e671784b951fab29d2a3b4c75b 100644 (file)
@@ -262,6 +262,7 @@ fn to_source_with_hygiene(&self) -> String {
         (unsigned, $t:ty, $tag:expr) => (
             impl ToSource for $t {
                 fn to_source(&self) -> String {
+                    #![allow(trivial_numeric_casts)]
                     let lit = ast::LitInt(*self as u64, ast::UnsignedIntLit($tag));
                     pprust::lit_to_string(&dummy_spanned(lit))
                 }
index c61aec0069db255032b059d3bedd105b86305878..31d8b207bb9f080134fcbc582391391b1924c726 100644 (file)
@@ -194,7 +194,7 @@ pub fn expand_include_bytes(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
 fn res_rel_file(cx: &mut ExtCtxt, sp: codemap::Span, arg: &Path) -> PathBuf {
     // NB: relative paths are resolved relative to the compilation unit
     if !arg.is_absolute() {
-        let mut cu = PathBuf::new(&cx.codemap().span_to_filename(sp));
+        let mut cu = PathBuf::from(&cx.codemap().span_to_filename(sp));
         cu.pop();
         cu.push(arg);
         cu
index 7a2ae55e91494cfad3186ac0122fcbc45c955bd5..1e53db6030143bbcad443e12b866da8fa706c273 100644 (file)
@@ -169,7 +169,7 @@ fn generic_extension<'cx>(cx: &'cx ExtCtxt,
                 // Weird, but useful for X-macros.
                 return box ParserAnyMacro {
                     parser: RefCell::new(p),
-                } as Box<MacResult+'cx>
+                }
               }
               Failure(sp, ref msg) => if sp.lo >= best_fail_spot.lo {
                 best_fail_spot = sp;
@@ -236,7 +236,7 @@ pub fn compile<'cx>(cx: &'cx mut ExtCtxt,
                                      argument_gram);
 
     // Extract the arguments:
-    let lhses = match *argument_map[lhs_nm] {
+    let lhses = match **argument_map.get(&lhs_nm).unwrap() {
         MatchedSeq(ref s, _) => /* FIXME (#2543) */ (*s).clone(),
         _ => cx.span_bug(def.span, "wrong-structured lhs")
     };
@@ -245,7 +245,7 @@ pub fn compile<'cx>(cx: &'cx mut ExtCtxt,
         check_lhs_nt_follows(cx, &**lhs, def.span);
     }
 
-    let rhses = match *argument_map[rhs_nm] {
+    let rhses = match **argument_map.get(&rhs_nm).unwrap() {
         MatchedSeq(ref s, _) => /* FIXME (#2543) */ (*s).clone(),
         _ => cx.span_bug(def.span, "wrong-structured rhs")
     };
index 0a9980c892527a9b88bec0fecbb6f1bcf2282f56..60f81dac1e9abaf09fc2e1c7cba5c113b9030fdc 100644 (file)
@@ -201,7 +201,6 @@ enum Status {
     ("no_mangle", Normal),
     ("no_link", Normal),
     ("derive", Normal),
-    ("deriving", Normal), // deprecation err in expansion
     ("should_fail", Normal),
     ("should_panic", Normal),
     ("ignore", Normal),
@@ -259,7 +258,6 @@ enum Status {
     ("link_section", Whitelisted),
     ("no_builtins", Whitelisted),
     ("no_mangle", Whitelisted),
-    ("no_split_stack", Whitelisted),
     ("no_stack_check", Whitelisted),
     ("packed", Whitelisted),
     ("static_assert", Gated("static_assert",
@@ -563,6 +561,13 @@ fn visit_item(&mut self, i: &ast::Item) {
                 }
             }
 
+            ast::ItemDefaultImpl(..) => {
+                self.gate_feature("optin_builtin_traits",
+                                  i.span,
+                                  "default trait implementations are experimental \
+                                   and possibly buggy");
+            }
+
             ast::ItemImpl(_, polarity, _, _, _, _) => {
                 match polarity {
                     ast::ImplPolarity::Negative => {
index 9f217bba00ab6e2b30b280c953a72032aed578a4..9af7b9ab633116619c2e9ff3cc12b4ad28e5ad74 100644 (file)
@@ -39,6 +39,8 @@
 #![feature(unicode)]
 #![feature(path_ext)]
 #![feature(str_char)]
+#![feature(convert)]
+#![feature(into_cow)]
 
 extern crate arena;
 extern crate fmt_macros;
index e0953a8ace68d5c646ee23fa436766fca91b9ad5..0843713681bbdaad8b27502a7b8c34956ba151de 100644 (file)
@@ -758,7 +758,7 @@ fn scan_hex_digits(&mut self,
                 self.err_span_char(self.last_pos, self.pos,
                               "illegal character in numeric character escape", c);
                 0
-            }) as u32;
+            });
             self.bump();
         }
 
@@ -887,7 +887,7 @@ fn scan_unicode_escape(&mut self, delim: char) -> bool {
                     self.fatal_span_char(self.last_pos, self.pos,
                                    "illegal character in unicode escape", c);
                 }
-            }) as u32;
+            });
             self.bump();
             count += 1;
         }
index ee646d95f35a42f8f9de737f7beeece3ef8aa37e..7da0a6de5479cb7594fbd37a7f743c46c7b7ccfd 100644 (file)
@@ -22,9 +22,6 @@
 /// The specific types of unsupported syntax
 #[derive(Copy, PartialEq, Eq, Hash)]
 pub enum ObsoleteSyntax {
-    Sized,
-    ForSized,
-    ClosureType,
     ClosureKind,
     EmptyIndex,
 }
@@ -49,27 +46,11 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> {
     /// Reports an obsolete syntax non-fatal error.
     fn obsolete(&mut self, sp: Span, kind: ObsoleteSyntax) {
         let (kind_str, desc, error) = match kind {
-            ObsoleteSyntax::ForSized => (
-                "for Sized?",
-                "no longer required. Traits (and their `Self` type) do not have the `Sized` bound \
-                 by default",
-                true,
-            ),
-            ObsoleteSyntax::ClosureType => (
-                "`|usize| -> bool` closure type",
-                "use unboxed closures instead, no type annotation needed",
-                true,
-            ),
             ObsoleteSyntax::ClosureKind => (
                 "`:`, `&mut:`, or `&:`",
                 "rely on inference instead",
                 true,
             ),
-            ObsoleteSyntax::Sized => (
-                "`Sized? T` for removing the `Sized` bound",
-                "write `T: ?Sized` instead",
-                true,
-            ),
             ObsoleteSyntax::EmptyIndex => (
                 "[]",
                 "write `[..]` instead",
index 667af642744b9db478dad5ce0fcd12f528599e3b..44097ffeb205921da76a16ec591b2d2a1831862e 100644 (file)
@@ -516,11 +516,7 @@ pub fn parse_ident_or_self_type(&mut self) -> ast::Ident {
 
     pub fn parse_path_list_item(&mut self) -> ast::PathListItem {
         let lo = self.span.lo;
-        let node = if self.eat_keyword_noexpect(keywords::Mod) {
-            let span = self.last_span;
-            self.span_warn(span, "deprecated syntax; use the `self` keyword now");
-            ast::PathListMod { id: ast::DUMMY_NODE_ID }
-        } else if self.eat_keyword(keywords::SelfValue) {
+        let node = if self.eat_keyword(keywords::SelfValue) {
             ast::PathListMod { id: ast::DUMMY_NODE_ID }
         } else {
             let ident = self.parse_ident();
@@ -619,23 +615,6 @@ fn expect_and(&mut self) {
         }
     }
 
-    /// Expect and consume a `|`. If `||` is seen, replace it with a single
-    /// `|` and continue. If a `|` is not seen, signal an error.
-    fn expect_or(&mut self) {
-        self.expected_tokens.push(TokenType::Token(token::BinOp(token::Or)));
-        match self.token {
-            token::BinOp(token::Or) => self.bump(),
-            token::OrOr => {
-                let span = self.span;
-                let lo = span.lo + BytePos(1);
-                self.replace_token(token::BinOp(token::Or), lo, span.hi)
-            }
-            _ => {
-                self.expect_one_of(&[], &[]);
-            }
-        }
-    }
-
     pub fn expect_no_suffix(&self, sp: Span, kind: &str, suffix: Option<ast::Name>) {
         match suffix {
             None => {/* everything ok */}
@@ -675,28 +654,6 @@ fn expect_lt(&mut self) {
         }
     }
 
-    /// Parse a sequence bracketed by `|` and `|`, stopping before the `|`.
-    fn parse_seq_to_before_or<T, F>(&mut self,
-                                    sep: &token::Token,
-                                    mut f: F)
-                                    -> Vec<T> where
-        F: FnMut(&mut Parser) -> T,
-    {
-        let mut first = true;
-        let mut vector = Vec::new();
-        while self.token != token::BinOp(token::Or) &&
-                self.token != token::OrOr {
-            if first {
-                first = false
-            } else {
-                self.expect(sep)
-            }
-
-            vector.push(f(self))
-        }
-        vector
-    }
-
     /// Expect and consume a GT. if a >> is seen, replace it
     /// with a single > and continue. If a GT is not seen,
     /// signal an error.
@@ -908,7 +865,7 @@ pub fn bump(&mut self) {
         } else {
             // Avoid token copies with `replace`.
             let buffer_start = self.buffer_start as usize;
-            let next_index = (buffer_start + 1) & 3 as usize;
+            let next_index = (buffer_start + 1) & 3;
             self.buffer_start = next_index as isize;
 
             let placeholder = TokenAndSpan {
@@ -1008,11 +965,6 @@ pub fn token_is_bare_fn_keyword(&mut self) -> bool {
             self.check_keyword(keywords::Extern)
     }
 
-    /// Is the current token one of the keywords that signals a closure type?
-    pub fn token_is_closure_keyword(&mut self) -> bool {
-        self.check_keyword(keywords::Unsafe)
-    }
-
     pub fn get_lifetime(&mut self) -> ast::Ident {
         match self.token {
             token::Lifetime(ref ident) => *ident,
@@ -1042,12 +994,9 @@ pub fn parse_for_in_type(&mut self) -> Ty_ {
         let lifetime_defs = self.parse_late_bound_lifetime_defs();
 
         // examine next token to decide to do
-        if self.token_is_bare_fn_keyword() || self.token_is_closure_keyword() {
-            self.parse_ty_bare_fn_or_ty_closure(lifetime_defs)
-        } else if self.check(&token::ModSep) ||
-                  self.token.is_ident() ||
-                  self.token.is_path()
-        {
+        if self.token_is_bare_fn_keyword() {
+            self.parse_ty_bare_fn(lifetime_defs)
+        } else {
             let hi = self.span.hi;
             let trait_ref = self.parse_trait_ref();
             let poly_trait_ref = ast::PolyTraitRef { bound_lifetimes: lifetime_defs,
@@ -1063,8 +1012,6 @@ pub fn parse_for_in_type(&mut self) -> Ty_ {
                 .chain(other_bounds.into_vec().into_iter())
                 .collect();
             ast::TyPolyTraitRef(all_bounds)
-        } else {
-            self.parse_ty_closure(lifetime_defs)
         }
     }
 
@@ -1094,7 +1041,6 @@ pub fn parse_ty_bare_fn(&mut self, lifetime_defs: Vec<ast::LifetimeDef>) -> Ty_
         };
 
         self.expect_keyword(keywords::Fn);
-        let lifetime_defs = self.parse_legacy_lifetime_defs(lifetime_defs);
         let (inputs, variadic) = self.parse_fn_args(false, true);
         let ret_ty = self.parse_ret_ty();
         let decl = P(FnDecl {
@@ -1139,71 +1085,6 @@ pub fn parse_obsolete_closure_kind(&mut self) {
          self.obsolete(span, ObsoleteSyntax::ClosureKind);
     }
 
-    pub fn parse_ty_bare_fn_or_ty_closure(&mut self, lifetime_defs: Vec<LifetimeDef>) -> Ty_ {
-        // Both bare fns and closures can begin with stuff like unsafe
-        // and extern. So we just scan ahead a few tokens to see if we see
-        // a `fn`.
-        //
-        // Closure:  [unsafe] <'lt> |S| [:Bounds] -> T
-        // Fn:       [unsafe] [extern "ABI"] fn <'lt> (S) -> T
-
-        if self.check_keyword(keywords::Fn) {
-            self.parse_ty_bare_fn(lifetime_defs)
-        } else if self.check_keyword(keywords::Extern) {
-            self.parse_ty_bare_fn(lifetime_defs)
-        } else if self.check_keyword(keywords::Unsafe) {
-            if self.look_ahead(1, |t| t.is_keyword(keywords::Fn) ||
-                                      t.is_keyword(keywords::Extern)) {
-                self.parse_ty_bare_fn(lifetime_defs)
-            } else {
-                self.parse_ty_closure(lifetime_defs)
-            }
-        } else {
-            self.parse_ty_closure(lifetime_defs)
-        }
-    }
-
-    /// Parse a TyClosure type
-    pub fn parse_ty_closure(&mut self, lifetime_defs: Vec<ast::LifetimeDef>) -> Ty_ {
-        /*
-
-        [unsafe] <'lt> |S| [:Bounds] -> T
-        ^~~~~~~^ ^~~~^  ^  ^~~~~~~~^    ^
-          |        |       |      |        |
-          |        |       |      |      Return type
-          |        |       |  Closure bounds
-          |        |     Argument types
-          |      Deprecated lifetime defs
-          |
-        Function Style
-
-        */
-
-        let ty_closure_span = self.last_span;
-
-        // To be helpful, parse the closure type as ever
-        let _ = self.parse_unsafety();
-
-        let _ = self.parse_legacy_lifetime_defs(lifetime_defs);
-
-        if !self.eat(&token::OrOr) {
-            self.expect_or();
-
-            let _ = self.parse_seq_to_before_or(
-                &token::Comma,
-                |p| p.parse_arg_general(false));
-            self.expect_or();
-        }
-
-        let _ = self.parse_colon_then_ty_param_bounds(BoundParsingMode::Bare);
-
-        let _ = self.parse_ret_ty();
-
-        self.obsolete(ty_closure_span, ObsoleteSyntax::ClosureType);
-
-        TyInfer
-    }
-
     pub fn parse_unsafety(&mut self) -> Unsafety {
         if self.eat_keyword(keywords::Unsafe) {
             return Unsafety::Unsafe;
@@ -1212,27 +1093,6 @@ pub fn parse_unsafety(&mut self) -> Unsafety {
         }
     }
 
-    /// Parses `[ 'for' '<' lifetime_defs '>' ]'
-    fn parse_legacy_lifetime_defs(&mut self,
-                                  lifetime_defs: Vec<ast::LifetimeDef>)
-                                  -> Vec<ast::LifetimeDef>
-    {
-        if self.token == token::Lt {
-            self.bump();
-            if lifetime_defs.is_empty() {
-                self.warn("deprecated syntax; use the `for` keyword now \
-                            (e.g. change `fn<'a>` to `for<'a> fn`)");
-                let lifetime_defs = self.parse_lifetime_defs();
-                self.expect_gt();
-                lifetime_defs
-            } else {
-                self.fatal("cannot use new `for` keyword and older syntax together");
-            }
-        } else {
-            lifetime_defs
-        }
-    }
-
     /// Parse the items in a trait declaration
     pub fn parse_trait_items(&mut self) -> Vec<P<TraitItem>> {
         self.parse_unspanned_seq(
@@ -1321,19 +1181,7 @@ pub fn parse_ret_ty(&mut self) -> FunctionRetTy {
             if self.eat(&token::Not) {
                 NoReturn(self.span)
             } else {
-                let t = self.parse_ty();
-
-                // We used to allow `fn foo() -> &T + U`, but don't
-                // anymore. If we see it, report a useful error.  This
-                // only makes sense because `parse_ret_ty` is only
-                // used in fn *declarations*, not fn types or where
-                // clauses (i.e., not when parsing something like
-                // `FnMut() -> T + Send`, where the `+` is legal).
-                if self.token == token::BinOp(token::Plus) {
-                    self.warn("deprecated syntax: `()` are required, see RFC 438 for details");
-                }
-
-                Return(t)
+                Return(self.parse_ty())
             }
         } else {
             let pos = self.span.lo;
@@ -1421,18 +1269,9 @@ pub fn parse_ty(&mut self) -> P<Ty> {
             self.parse_borrowed_pointee()
         } else if self.check_keyword(keywords::For) {
             self.parse_for_in_type()
-        } else if self.token_is_bare_fn_keyword() ||
-                  self.token_is_closure_keyword() {
-            // BARE FUNCTION OR CLOSURE
-            self.parse_ty_bare_fn_or_ty_closure(Vec::new())
-        } else if self.check(&token::BinOp(token::Or)) ||
-                  self.token == token::OrOr ||
-                  (self.token == token::Lt &&
-                   self.look_ahead(1, |t| {
-                       *t == token::Gt || t.is_lifetime()
-                   })) {
-            // CLOSURE
-            self.parse_ty_closure(Vec::new())
+        } else if self.token_is_bare_fn_keyword() {
+            // BARE FUNCTION
+            self.parse_ty_bare_fn(Vec::new())
         } else if self.eat_keyword_noexpect(keywords::Typeof) {
             // TYPEOF
             // In order to not be ambiguous, the type must be surrounded by parens.
@@ -3974,56 +3813,19 @@ fn parse_ty_param_bounds(&mut self,
         return OwnedSlice::from_vec(result);
     }
 
-    fn trait_ref_from_ident(ident: Ident, span: Span) -> TraitRef {
-        let segment = ast::PathSegment {
-            identifier: ident,
-            parameters: ast::PathParameters::none()
-        };
-        let path = ast::Path {
-            span: span,
-            global: false,
-            segments: vec![segment],
-        };
-        ast::TraitRef {
-            path: path,
-            ref_id: ast::DUMMY_NODE_ID,
-        }
-    }
-
-    /// Matches typaram = (unbound `?`)? IDENT (`?` unbound)? optbounds ( EQ ty )?
+    /// Matches typaram = IDENT (`?` unbound)? optbounds ( EQ ty )?
     fn parse_ty_param(&mut self) -> TyParam {
-        // This is a bit hacky. Currently we are only interested in a single
-        // unbound, and it may only be `Sized`. To avoid backtracking and other
-        // complications, we parse an ident, then check for `?`. If we find it,
-        // we use the ident as the unbound, otherwise, we use it as the name of
-        // type param. Even worse, we need to check for `?` before or after the
-        // bound.
-        let mut span = self.span;
-        let mut ident = self.parse_ident();
-        let mut unbound = None;
-        if self.eat(&token::Question) {
-            let tref = Parser::trait_ref_from_ident(ident, span);
-            unbound = Some(tref);
-            span = self.span;
-            ident = self.parse_ident();
-            self.obsolete(span, ObsoleteSyntax::Sized);
-        }
+        let span = self.span;
+        let ident = self.parse_ident();
 
-        let mut bounds = self.parse_colon_then_ty_param_bounds(BoundParsingMode::Modified);
-        if let Some(unbound) = unbound {
-            let mut bounds_as_vec = bounds.into_vec();
-            bounds_as_vec.push(TraitTyParamBound(PolyTraitRef { bound_lifetimes: vec![],
-                                                                trait_ref: unbound,
-                                                                span: span },
-                                                 TraitBoundModifier::Maybe));
-            bounds = OwnedSlice::from_vec(bounds_as_vec);
-        };
+        let bounds = self.parse_colon_then_ty_param_bounds(BoundParsingMode::Modified);
 
         let default = if self.check(&token::Eq) {
             self.bump();
             Some(self.parse_ty_sum())
-        }
-        else { None };
+        } else {
+            None
+        };
 
         TyParam {
             ident: ident,
@@ -4654,22 +4456,9 @@ fn parse_item_trait(&mut self, unsafety: Unsafety) -> ItemInfo {
 
         let ident = self.parse_ident();
         let mut tps = self.parse_generics();
-        // This is not very accurate, but since unbound only exists to catch
-        // obsolete syntax, the span is unlikely to ever be used.
-        let unbound_span = self.span;
-        let unbound = self.parse_for_sized();
 
         // Parse supertrait bounds.
-        let mut bounds = self.parse_colon_then_ty_param_bounds(BoundParsingMode::Bare);
-
-        if let Some(unbound) = unbound {
-            let mut bounds_as_vec = bounds.into_vec();
-            bounds_as_vec.push(TraitTyParamBound(PolyTraitRef { bound_lifetimes: vec![],
-                                                                trait_ref: unbound,
-                                                                span:  unbound_span },
-                                                 TraitBoundModifier::Maybe));
-            bounds = OwnedSlice::from_vec(bounds_as_vec);
-        };
+        let bounds = self.parse_colon_then_ty_param_bounds(BoundParsingMode::Bare);
 
         self.parse_where_clause(&mut tps);
 
@@ -4956,39 +4745,6 @@ fn parse_visibility(&mut self) -> Visibility {
         else { Inherited }
     }
 
-    fn parse_for_sized(&mut self) -> Option<ast::TraitRef> {
-        // FIXME, this should really use TraitBoundModifier, but it will get
-        // re-jigged shortly in any case, so leaving the hacky version for now.
-        if self.eat_keyword(keywords::For) {
-            let span = self.span;
-
-            let mut ate_question = false;
-            if self.eat(&token::Question) {
-                ate_question = true;
-            }
-            let ident = self.parse_ident();
-            if self.eat(&token::Question) {
-                if ate_question {
-                    self.span_err(span,
-                        "unexpected `?`");
-                }
-                ate_question = true;
-            }
-            if !ate_question {
-                self.span_err(span,
-                    "expected `?Sized` after `for` in trait item");
-                return None;
-            }
-            let _tref = Parser::trait_ref_from_ident(ident, span);
-
-            self.obsolete(span, ObsoleteSyntax::ForSized);
-
-            None
-        } else {
-            None
-        }
-    }
-
     /// Given a termination token, parse all of the items in a module
     fn parse_mod_items(&mut self, term: &token::Token, inner_lo: BytePos) -> Mod {
         let mut items = vec![];
@@ -5064,8 +4820,8 @@ fn eval_src_mod(&mut self,
                     outer_attrs: &[ast::Attribute],
                     id_sp: Span)
                     -> (ast::Item_, Vec<ast::Attribute> ) {
-        let mut prefix = PathBuf::new(&self.sess.span_diagnostic.cm
-                                           .span_to_filename(self.span));
+        let mut prefix = PathBuf::from(&self.sess.span_diagnostic.cm
+                                            .span_to_filename(self.span));
         prefix.pop();
         let mut dir_path = prefix;
         for part in &self.mod_path_stack {
index 239fea57d94d2ae795f47dc5ba21543818e8aa8d..5941f044a078a8975c8926b607284910bdcaea0c 100644 (file)
@@ -2712,8 +2712,20 @@ pub fn print_ty_fn(&mut self,
                        opt_explicit_self: Option<&ast::ExplicitSelf_>)
                        -> io::Result<()> {
         try!(self.ibox(indent_unit));
+        if generics.lifetimes.len() > 0 || generics.ty_params.len() > 0 {
+            try!(word(&mut self.s, "for"));
+            try!(self.print_generics(generics));
+        }
+        let generics = ast::Generics {
+            lifetimes: Vec::new(),
+            ty_params: OwnedSlice::empty(),
+            where_clause: ast::WhereClause {
+                id: ast::DUMMY_NODE_ID,
+                predicates: Vec::new(),
+            },
+        };
         try!(self.print_fn(decl, unsafety, abi, name,
-                           generics, opt_explicit_self,
+                           &generics, opt_explicit_self,
                            ast::Inherited));
         self.end()
     }
@@ -2819,7 +2831,7 @@ pub fn print_literal(&mut self, lit: &ast::Lit) -> io::Result<()> {
             ast::LitBinary(ref v) => {
                 let mut escaped: String = String::new();
                 for &ch in &**v {
-                    escaped.extend(ascii::escape_default(ch as u8)
+                    escaped.extend(ascii::escape_default(ch)
                                          .map(|c| c as char));
                 }
                 word(&mut self.s, &format!("b\"{}\"", escaped))
index f517dca53cdd20366324ceae83dd523a55597220..41e066cc94a92b2aab65ea336f0c2b16639bffe6 100644 (file)
@@ -19,6 +19,7 @@
 //! # Examples
 //!
 //! ```no_run
+//! # #![feature(rustc_private)]
 //! extern crate term;
 //!
 //! use std::io::prelude::*;
@@ -62,6 +63,7 @@
 #![feature(std_misc)]
 #![feature(str_char)]
 #![feature(path_ext)]
+#![feature(convert)]
 #![cfg_attr(windows, feature(libc))]
 
 #[macro_use] extern crate log;
@@ -101,7 +103,7 @@ fn flush(&mut self) -> io::Result<()> {
 /// opened.
 pub fn stdout() -> Option<Box<Terminal<WriterWrapper> + Send>> {
     TerminfoTerminal::new(WriterWrapper {
-        wrapped: box std::io::stdout() as Box<Write + Send>,
+        wrapped: box std::io::stdout(),
     })
 }
 
@@ -110,14 +112,14 @@ pub fn stdout() -> Option<Box<Terminal<WriterWrapper> + Send>> {
 /// opened.
 pub fn stdout() -> Option<Box<Terminal<WriterWrapper> + Send>> {
     let ti = TerminfoTerminal::new(WriterWrapper {
-        wrapped: box std::io::stdout() as Box<Write + Send>,
+        wrapped: box std::io::stdout(),
     });
 
     match ti {
         Some(t) => Some(t),
         None => {
             WinConsole::new(WriterWrapper {
-                wrapped: box std::io::stdout() as Box<Write + Send>,
+                wrapped: box std::io::stdout(),
             })
         }
     }
@@ -128,7 +130,7 @@ pub fn stdout() -> Option<Box<Terminal<WriterWrapper> + Send>> {
 /// opened.
 pub fn stderr() -> Option<Box<Terminal<WriterWrapper> + Send>> {
     TerminfoTerminal::new(WriterWrapper {
-        wrapped: box std::io::stderr() as Box<Write + Send>,
+        wrapped: box std::io::stderr(),
     })
 }
 
@@ -137,14 +139,14 @@ pub fn stderr() -> Option<Box<Terminal<WriterWrapper> + Send>> {
 /// opened.
 pub fn stderr() -> Option<Box<Terminal<WriterWrapper> + Send>> {
     let ti = TerminfoTerminal::new(WriterWrapper {
-        wrapped: box std::io::stderr() as Box<Write + Send>,
+        wrapped: box std::io::stderr(),
     });
 
     match ti {
         Some(t) => Some(t),
         None => {
             WinConsole::new(WriterWrapper {
-                wrapped: box std::io::stderr() as Box<Write + Send>,
+                wrapped: box std::io::stderr(),
             })
         }
     }
index 309320b52ffe4aa641abdf485537f5452eb7f64a..1d6657d5932c0d5a410282254e8a7056571dc148 100644 (file)
@@ -190,7 +190,7 @@ pub fn new(out: T) -> Option<Box<Terminal<T>+Send+'static>> {
                         out: out,
                         ti: msys_terminfo(),
                         num_colors: 8,
-                    } as Box<Terminal<T>+Send>)
+                    })
                 },
                 _ => {
                     debug!("error finding terminfo entry: {:?}", err);
@@ -213,7 +213,7 @@ pub fn new(out: T) -> Option<Box<Terminal<T>+Send+'static>> {
 
         return Some(box TerminfoTerminal {out: out,
                                           ti: inf,
-                                          num_colors: nc} as Box<Terminal<T>+Send>);
+                                          num_colors: nc});
     }
 
     fn dim_if_necessary(&self, color: color::Color) -> color::Color {
index cc9a2880b5d07d10b5f8502315b1f9e9951f0798..8d0a9e6e9717d502d2e7b17fa1dd34dceddc90e4 100644 (file)
@@ -186,7 +186,7 @@ macro_rules! try { ($e:expr) => (
     let magic = try!(read_le_u16(file));
     if magic != 0x011A {
         return Err(format!("invalid magic number: expected {:x}, found {:x}",
-                           0x011A as usize, magic as usize));
+                           0x011A_usize, magic as usize));
     }
 
     let names_bytes          = try!(read_le_u16(file)) as int;
index f47921cbf5e6acc3e921dd04ea36b1b373a33b2e..66ee2b1ba87cbee6337302ff195d21093564ae41 100644 (file)
@@ -31,7 +31,7 @@ pub fn get_dbpath_for_term(term: &str) -> Option<Box<PathBuf>> {
 
     // Find search directory
     match env::var_os("TERMINFO") {
-        Some(dir) => dirs_to_search.push(PathBuf::new(&dir)),
+        Some(dir) => dirs_to_search.push(PathBuf::from(dir)),
         None => {
             if homedir.is_some() {
                 // ncurses compatibility;
@@ -40,9 +40,9 @@ pub fn get_dbpath_for_term(term: &str) -> Option<Box<PathBuf>> {
             match env::var("TERMINFO_DIRS") {
                 Ok(dirs) => for i in dirs.split(':') {
                     if i == "" {
-                        dirs_to_search.push(PathBuf::new("/usr/share/terminfo"));
+                        dirs_to_search.push(PathBuf::from("/usr/share/terminfo"));
                     } else {
-                        dirs_to_search.push(PathBuf::new(i));
+                        dirs_to_search.push(PathBuf::from(i));
                     }
                 },
                 // Found nothing in TERMINFO_DIRS, use the default paths:
@@ -50,9 +50,9 @@ pub fn get_dbpath_for_term(term: &str) -> Option<Box<PathBuf>> {
                 // ~/.terminfo, ncurses will search /etc/terminfo, then
                 // /lib/terminfo, and eventually /usr/share/terminfo.
                 Err(..) => {
-                    dirs_to_search.push(PathBuf::new("/etc/terminfo"));
-                    dirs_to_search.push(PathBuf::new("/lib/terminfo"));
-                    dirs_to_search.push(PathBuf::new("/usr/share/terminfo"));
+                    dirs_to_search.push(PathBuf::from("/etc/terminfo"));
+                    dirs_to_search.push(PathBuf::from("/lib/terminfo"));
+                    dirs_to_search.push(PathBuf::from("/usr/share/terminfo"));
                 }
             }
         }
index e29e0e27394db93a3103fc149c9baf424cbf930f..001313db6769f133b8f8166b16c61428ead730a4 100644 (file)
@@ -126,7 +126,7 @@ pub fn new(out: T) -> Option<Box<Terminal<T>+Send+'static>> {
         }
         Some(box WinConsole { buf: out,
                               def_foreground: fg, def_background: bg,
-                              foreground: fg, background: bg } as Box<Terminal<T>+Send>)
+                              foreground: fg, background: bg })
     }
 }
 
index 51decbab8587d1e516279ff98e05dccd3dd6ce91..c48c7e413d03baa961ec62c60a07b19e82da678c 100644 (file)
@@ -45,6 +45,8 @@
 #![feature(libc)]
 #![feature(set_stdio)]
 #![feature(os)]
+#![feature(convert)]
+#![cfg_attr(test, feature(old_io))]
 
 extern crate getopts;
 extern crate serialize;
@@ -382,7 +384,7 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> {
     let run_ignored = matches.opt_present("ignored");
 
     let logfile = matches.opt_str("logfile");
-    let logfile = logfile.map(|s| PathBuf::new(&s));
+    let logfile = logfile.map(|s| PathBuf::from(&s));
 
     let run_benchmarks = matches.opt_present("bench");
     let run_tests = ! run_benchmarks ||
@@ -696,7 +698,7 @@ fn len_if_padded(t: &TestDescAndFn) -> uint {
     match tests.iter().max_by(|t|len_if_padded(*t)) {
         Some(t) => {
             let n = t.desc.name.as_slice();
-            st.max_name_len = n.as_slice().len();
+            st.max_name_len = n.len();
         },
         None => {}
     }
@@ -1019,7 +1021,7 @@ pub fn fmt_metrics(&self) -> String {
         let MetricMap(ref mm) = *self;
         let v : Vec<String> = mm.iter()
             .map(|(k,v)| format!("{}: {} (+/- {})", *k,
-                                 v.value as f64, v.noise as f64))
+                                 v.value, v.noise))
             .collect();
         v.connect(", ")
     }
index 5e1070c6dc503d1bc1019eab14dff4a90a16288b..db5a25b9bedcaf9e2352a9284566ba2626e99c14 100644 (file)
@@ -209,6 +209,7 @@ pub trait CharExt {
     /// In both of these examples, 'ß' takes two bytes to encode.
     ///
     /// ```
+    /// # #![feature(unicode)]
     /// let mut b = [0; 2];
     ///
     /// let result = 'ß'.encode_utf8(&mut b);
@@ -219,6 +220,7 @@ pub trait CharExt {
     /// A buffer that's too small:
     ///
     /// ```
+    /// # #![feature(unicode)]
     /// let mut b = [0; 1];
     ///
     /// let result = 'ß'.encode_utf8(&mut b);
@@ -241,6 +243,7 @@ pub trait CharExt {
     /// In both of these examples, 'ß' takes one `u16` to encode.
     ///
     /// ```
+    /// # #![feature(unicode)]
     /// let mut b = [0; 1];
     ///
     /// let result = 'ß'.encode_utf16(&mut b);
@@ -251,6 +254,7 @@ pub trait CharExt {
     /// A buffer that's too small:
     ///
     /// ```
+    /// # #![feature(unicode)]
     /// let mut b = [0; 0];
     ///
     /// let result = 'ß'.encode_utf8(&mut b);
@@ -653,6 +657,7 @@ pub fn len_utf16(self) -> usize { C::len_utf16(self) }
     /// In both of these examples, 'ß' takes two bytes to encode.
     ///
     /// ```
+    /// # #![feature(unicode)]
     /// let mut b = [0; 2];
     ///
     /// let result = 'ß'.encode_utf8(&mut b);
@@ -663,6 +668,7 @@ pub fn len_utf16(self) -> usize { C::len_utf16(self) }
     /// A buffer that's too small:
     ///
     /// ```
+    /// # #![feature(unicode)]
     /// let mut b = [0; 1];
     ///
     /// let result = 'ß'.encode_utf8(&mut b);
@@ -685,6 +691,7 @@ pub fn encode_utf8(self, dst: &mut [u8]) -> Option<usize> { C::encode_utf8(self,
     /// In both of these examples, 'ß' takes one `u16` to encode.
     ///
     /// ```
+    /// # #![feature(unicode)]
     /// let mut b = [0; 1];
     ///
     /// let result = 'ß'.encode_utf16(&mut b);
@@ -695,6 +702,7 @@ pub fn encode_utf8(self, dst: &mut [u8]) -> Option<usize> { C::encode_utf8(self,
     /// A buffer that's too small:
     ///
     /// ```
+    /// # #![feature(unicode)]
     /// let mut b = [0; 0];
     ///
     /// let result = 'ß'.encode_utf8(&mut b);
index a09c0cb3bd6306a6d3ce68f4530b26cdda8cfae9..6879fa7b3ba6834a7df0543d1aef4f6e560ff94b 100644 (file)
@@ -35,6 +35,7 @@
 #![feature(no_std)]
 #![no_std]
 #![feature(core)]
+#![doc(test(no_crate_inject))]
 
 extern crate core;
 
index 485065685f1dfdfa6a934be2eb44a22350d3b811..de3a593143e79191852a1d682cea733af46c5d63 100644 (file)
@@ -481,19 +481,24 @@ fn size_hint(&self) -> (usize, Option<usize>) {
 /// # Examples
 ///
 /// ```
+/// # #![feature(unicode)]
+/// extern crate unicode;
+///
 /// use unicode::str::Utf16Item::{ScalarValue, LoneSurrogate};
 ///
-/// // 𝄞mus<invalid>ic<invalid>
-/// let v = [0xD834, 0xDD1E, 0x006d, 0x0075,
-///          0x0073, 0xDD1E, 0x0069, 0x0063,
-///          0xD834];
+/// fn main() {
+///     // 𝄞mus<invalid>ic<invalid>
+///     let v = [0xD834, 0xDD1E, 0x006d, 0x0075,
+///              0x0073, 0xDD1E, 0x0069, 0x0063,
+///              0xD834];
 ///
-/// assert_eq!(unicode::str::utf16_items(&v).collect::<Vec<_>>(),
-///            vec![ScalarValue('𝄞'),
-///                 ScalarValue('m'), ScalarValue('u'), ScalarValue('s'),
-///                 LoneSurrogate(0xDD1E),
-///                 ScalarValue('i'), ScalarValue('c'),
-///                 LoneSurrogate(0xD834)]);
+///     assert_eq!(unicode::str::utf16_items(&v).collect::<Vec<_>>(),
+///                vec![ScalarValue('𝄞'),
+///                     ScalarValue('m'), ScalarValue('u'), ScalarValue('s'),
+///                     LoneSurrogate(0xDD1E),
+///                     ScalarValue('i'), ScalarValue('c'),
+///                     LoneSurrogate(0xD834)]);
+/// }
 /// ```
 pub fn utf16_items<'a>(v: &'a [u16]) -> Utf16Items<'a> {
     Utf16Items { iter : v.iter() }
index ac7f2f824cbbf9ab9c5d3dcab3fb911ad7ea8df0..a08481f8be94e0473c8cfc6b77167bf83d7aa4c1 100644 (file)
@@ -102,8 +102,8 @@ fn collapse(stack: &mut Vec<BookItem>,
     // always include the introduction
     top_items.push(BookItem {
         title: "Introduction".to_string(),
-        path: PathBuf::new("README.md"),
-        path_to_root: PathBuf::new("."),
+        path: PathBuf::from("README.md"),
+        path_to_root: PathBuf::from("."),
         children: vec!(),
     });
 
@@ -133,10 +133,10 @@ fn collapse(stack: &mut Vec<BookItem>,
                 errors.push(format!("paths in SUMMARY.md must be relative, \
                                      but path '{}' for section '{}' is not.",
                                      given_path, title));
-                PathBuf::new("")
+                PathBuf::new()
             }
         };
-        let path_to_root = PathBuf::new(&iter::repeat("../")
+        let path_to_root = PathBuf::from(&iter::repeat("../")
                                          .take(path_from_root.components().count() - 1)
                                          .collect::<String>());
         let item = BookItem {
index 731773917e09118452152504f0df79da09bd10e4..f06290b27cb2809583269f159f4b3313de5745ee 100644 (file)
@@ -87,7 +87,7 @@ fn render(book: &Book, tgt: &Path) -> CliResult<()> {
         if env::args().len() < 3 {
             src = env::current_dir().unwrap().clone();
         } else {
-            src = PathBuf::new(&env::args().nth(2).unwrap());
+            src = PathBuf::from(&env::args().nth(2).unwrap());
         }
         // preprocess the markdown, rerouting markdown references to html references
         let mut markdown_data = String::new();
@@ -164,13 +164,13 @@ fn execute(&mut self, term: &mut Term) -> CommandResult<()> {
         if env::args().len() < 3 {
             src = cwd.clone();
         } else {
-            src = PathBuf::new(&env::args().nth(2).unwrap());
+            src = PathBuf::from(&env::args().nth(2).unwrap());
         }
 
         if env::args().len() < 4 {
             tgt = cwd.join("_book");
         } else {
-            tgt = PathBuf::new(&env::args().nth(3).unwrap());
+            tgt = PathBuf::from(&env::args().nth(3).unwrap());
         }
 
         try!(fs::create_dir(&tgt));
index 294b4e556694ad2be1c935ab5749226a392877bf..e896dee27919e1c4121e2be47b7c5c334e8ffa1f 100644 (file)
@@ -20,6 +20,7 @@
 pub type CommandResult<T> = Result<T, CommandError>;
 
 pub fn err(s: &str) -> CliError {
+    #[derive(Debug)]
     struct E(String);
 
     impl Error for E {
index 09fcd518c1e7e3998f32851738559f36840d845d..4a652f846ed58bd0112c54e609a64737c8dad74f 100644 (file)
@@ -15,6 +15,7 @@
 #![feature(rustdoc)]
 #![feature(rustc_private)]
 #![feature(path_relative_from)]
+#![feature(convert)]
 
 extern crate rustdoc;
 extern crate rustc_back;
index 473739c919d64ee27fc4e3e3e40a85e3b0e29426..44af43be7877344cfd878700984662adb9f60058 100644 (file)
@@ -32,11 +32,11 @@ pub trait Subcommand {
 
 /// Create a Subcommand object based on its name.
 pub fn parse_name(name: &str) -> Option<Box<Subcommand>> {
-    for parser in [
-        help::parse_cmd as fn(&str) -> Option<Box<Subcommand>>,
-        build::parse_cmd as fn(&str) -> Option<Box<Subcommand>>,
-        serve::parse_cmd as fn(&str) -> Option<Box<Subcommand>>,
-        test::parse_cmd as fn(&str) -> Option<Box<Subcommand>>].iter() {
+    let cmds: [fn(&str) -> Option<Box<Subcommand>>; 4] = [help::parse_cmd,
+                                                          build::parse_cmd,
+                                                          serve::parse_cmd,
+                                                          test::parse_cmd];
+    for parser in cmds.iter() {
         let parsed = (*parser)(name);
         if parsed.is_some() { return parsed }
     }
index 3bdf32b53fa8731a65c5a7a7b4b034842538edd6..141ddba7db620dd02d763e4b73bbad6b1b7bea10 100644 (file)
@@ -1,5 +1,5 @@
 S 2015-03-17 c64d671
-  bitrig-x86_64 4b2f11a96b1b5b3782d74bda707aca33bc179880
+  bitrig-x86_64 41de2c7a69a1ac648d3fa3b65e96a29bdc122163
   freebsd-x86_64 14ced24e1339a4dd8baa9db69995daa52a948d54
   linux-i386 200450ad3cc56bc715ca105b9acae35204bf7351
   linux-x86_64 a54f50fee722ba6bc7281dec3e4d5121af7c15e3
index 12ab62267a363c1a5d4ff88ef7d0afdbe66d6d6f..197fb9a6d018c488ae9e81522666859c4e32d58a 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![crate_name="anonexternmod"]
+#![feature(libc)]
 
 extern crate libc;
 
index b5c2a4f135fe2c0101f396b5c7a1a13a57a2dc61..c0d81cd8e1bad335e807e7346044895240f3e662 100644 (file)
@@ -10,6 +10,8 @@
 
 // Helper definition for test/run-pass/check-static-recursion-foreign.rs.
 
+#![feature(libc)]
+
 #[crate_id = "check_static_recursion_foreign_helper"]
 #[crate_type = "lib"]
 
index 0e3b531e4581c90455bf9bfadb160cfd20b276d6..fc2e328f68657e65c58f724a1fef960d62dd688b 100644 (file)
@@ -10,6 +10,7 @@
 
 #![crate_name="externcallback"]
 #![crate_type = "lib"]
+#![feature(libc)]
 
 extern crate libc;
 
index a5d672e3c0cf90d004d64151620c056751cb1c6a..92239ce55981c808dfd0991c4a7eaa2906377223 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![crate_name="foreign_lib"]
+#![feature(libc)]
 
 pub mod rustrt {
     extern crate libc;
index 560844332a128d4718362b8a7debb61deb7436a0..d66cfe9bf636b716867370a728bd5f52091142c6 100644 (file)
@@ -21,6 +21,6 @@ fn f() {}
 }
 
 pub fn foo() {
-    let a = &1 as &inner::Trait;
+    let a = &1i as &inner::Trait;
     a.f();
 }
index dd1ad413a3d279a873f299ec853c7e03dbf68c1a..604a3e69a21767909233a369c61149385b64a07a 100644 (file)
@@ -19,6 +19,6 @@
 
 // the unused ty param is necessary so this gets monomorphized
 pub fn request<T>(req: &header_map) {
-  let data = req["METHOD".to_string()].clone();
+  let data = req[&"METHOD".to_string()].clone();
   let _x = data.borrow().clone()[0].clone();
 }
index 25eb67e0423005cc14f825f02faa287206604b48..b6199f59ebe0638c9e82c3bc27ae0c129ac2104b 100644 (file)
@@ -10,6 +10,7 @@
 
 #![crate_name="socketlib"]
 #![crate_type = "lib"]
+#![feature(libc)]
 
 pub mod socket {
     extern crate libc;
index f24721adb5d968cff71300a37ba672ba71b57292..4a8839abc7cb2083017e8030f302d466c04266ac 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(core)]
+
 pub mod testtypes {
     use std::any::TypeId;
 
index f5a9063e1def5107f29a03f5633bf4f7f0cfc392..58dee1216ee6047d03262e8cf8714c5bb779907f 100644 (file)
@@ -11,7 +11,7 @@
 // ignore-stage1
 // force-host
 
-#![feature(plugin_registrar, quote)]
+#![feature(plugin_registrar, quote, rustc_private)]
 #![crate_type = "dylib"]
 
 extern crate syntax;
index c118f7e4854fa762ed5962045da93f2dcfb1d7a7..3d5e52d709df3ec4c1966eafc87252acd368efc0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(core)]
+
 use std::marker::MarkerTrait;
 
 pub trait Foo : MarkerTrait {
index e12af579c571d7c481b8b16c0916432d071c2fcd..5c878b1e667d9f61128c7f92cd90e6a1bca13e79 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(libc)]
+
 extern crate libc;
 
 extern "C" {
index 03fe2fd94dd527587e50ea7f88f3b480e582f1f4..fd3e9b9ac9dcea8ca1de970fcddb5c8b842b0654 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc, old_path)]
+
 use std::dynamic_lib::DynamicLibrary;
 
 #[no_mangle]
index 1be37ce1780b3fcb11d36adf7d0bef167e8ae078..3b45b0ae701061c125cca7917ab8f104c94b19da 100644 (file)
@@ -10,7 +10,7 @@
 
 // force-host
 
-#![feature(plugin_registrar)]
+#![feature(plugin_registrar, rustc_private)]
 #![feature(box_syntax)]
 
 extern crate syntax;
index e9d98889ff854062f3434ea105b5b91f401fca81..ca5a7b75e06cfe61ac929401d378523c517fc458 100644 (file)
@@ -11,7 +11,7 @@
 // force-host
 
 #![feature(plugin_registrar)]
-#![feature(box_syntax)]
+#![feature(box_syntax, rustc_private)]
 
 extern crate syntax;
 
index ffb234f70c8e754ec7f4d86411101598ac100118..20799ce5b467f9debdb077e3479a3baef395c58a 100644 (file)
@@ -11,7 +11,7 @@
 // force-host
 
 #![feature(plugin_registrar)]
-#![feature(box_syntax)]
+#![feature(box_syntax, rustc_private)]
 
 extern crate syntax;
 
index bf4ab975cedd8c97a66dfd89a45a30488e732cdf..974db7c92463839a1a7b9bb973a30e7eddf5d225 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(rustc_private)]
+
 #[macro_use] extern crate log;
 
 pub fn foo<T>() {
index d50c27a4e75bb0efae4bb6c6fbd2e98e03b8bbb3..03cd70d949428886501b663dbe60de5b64df9039 100644 (file)
@@ -10,7 +10,7 @@
 
 // force-host
 
-#![feature(plugin_registrar)]
+#![feature(plugin_registrar, rustc_private)]
 
 extern crate syntax;
 extern crate rustc;
index 36a34bc6c8b41a3e6189597d3de89e1681e29918..5b7e52e9164e96744d8c34162eacf10d1b783cf7 100644 (file)
@@ -11,7 +11,7 @@
 // force-host
 
 #![feature(plugin_registrar, quote)]
-#![feature(box_syntax)]
+#![feature(box_syntax, rustc_private)]
 
 extern crate syntax;
 extern crate rustc;
index 30b18a3618ffa09174f70bcb64757472a20a5934..5a615502a95e3200a11aae532eb4c3b4a1e74ffb 100644 (file)
@@ -11,7 +11,7 @@
 // force-host
 
 #![feature(plugin_registrar)]
-#![feature(box_syntax)]
+#![feature(box_syntax, rustc_private)]
 
 extern crate syntax;
 extern crate rustc;
index 420151c471ea636a067c210738a8eeb4f690fc86..6f5f50475483d4ca05a5e672047551ed382e6928 100644 (file)
@@ -11,7 +11,7 @@
 // force-host
 
 #![feature(plugin_registrar)]
-#![feature(box_syntax)]
+#![feature(box_syntax, rustc_private)]
 
 extern crate rustc;
 
index cfc8c015324d9384edfcbb88cb5f8b47717b39df..75f404c96cd0e7f380cdfb6e2f7cef70ca06fae1 100644 (file)
@@ -10,7 +10,7 @@
 
 // force-host
 
-#![feature(plugin_registrar)]
+#![feature(plugin_registrar, rustc_private)]
 #![deny(plugin_as_library)] // should have no effect in a plugin crate
 
 extern crate macro_crate_test;
index 42691579491bbfb7e7abb069fd995bf62288e8f0..dc08033602c99dfa9a6f9f3aed31ce6ddf1c7412 100644 (file)
@@ -8,4 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(core)]
+
 trait Foo : ::std::marker::MarkerTrait {}
index d9a2b06e0393f6f9899af007653ddf0cadc22e4e..8c7ad2293e23db67cd051db94533e334486b6c07 100644 (file)
@@ -11,7 +11,7 @@
 // force-host
 
 #![crate_type="dylib"]
-#![feature(plugin_registrar, quote)]
+#![feature(plugin_registrar, quote, rustc_private)]
 
 extern crate syntax;
 extern crate rustc;
@@ -33,7 +33,7 @@ fn expand_mbe_matches(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
 
     let mac_expr = match TokenTree::parse(cx, &mbe_matcher[..], args) {
         Success(map) => {
-            match (&*map[str_to_ident("matched")], &*map[str_to_ident("pat")]) {
+            match (&*map[&str_to_ident("matched")], &*map[&str_to_ident("pat")]) {
                 (&MatchedNonterminal(NtExpr(ref matched_expr)),
                  &MatchedSeq(ref pats, seq_sp)) => {
                     let pats: Vec<P<Pat>> = pats.iter().map(|pat_nt|
index be03a36393e24053b4f27194cb79d464392433ef..86ce3df9ba6efcd0740b132c8b69c6063102d418 100644 (file)
@@ -11,7 +11,7 @@
 // no-prefer-dynamic
 
 #![crate_type = "rlib"]
-#![feature(plugin_registrar)]
+#![feature(plugin_registrar, rustc_private)]
 
 extern crate rustc;
 
index 0ea7c0005707defad9aa5a93cbb278a2f64d7c80..a105cb7ae6cfb6ce9db14d867c12b2e2703b4b6b 100644 (file)
@@ -11,7 +11,7 @@
 // force-host
 
 #![crate_type="dylib"]
-#![feature(plugin_registrar)]
+#![feature(plugin_registrar, rustc_private)]
 
 extern crate syntax;
 extern crate rustc;
index 04f1062c16f02a572e8f97c9345b2f6b99469983..6d4ea499b2bde8f623b41acaf24ddc46d911aee6 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index fabd2289e9a44ea61c62f41c56fb5c41a7b2be99..61e4aaf32586e3d96e1ba00fcd3bee56a58f003a 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index 3fdb861bd40c178d430e26c4b51059b55debb0d8..cfdb0902b5d365f6d42f091258a0d27ffaa704e5 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index 3116d24673d4847bef21ac198e648c5f098a4257..e79738c04103522746e4cd728267ff38f6fb7218 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index b49a1533628f6f526225f062d21e06987dca295b..b22d553c02b5afb951a4eea095747c980e3d0253 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index 6562a93135f39740c5210eaa7824ed37668ffdd5..78dbdc28b9f31f572a9dde4ada8260d8fc2e71d6 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index c7b392c6ee82b07b942cd7188a9fe316b8ad7579..30592827039746562b385df875af145ecb2f2a13 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index 450f61020260dd49416c27ea402223efd0c20157..4c457b099a4b17e6590b21905d056a47683d6e85 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index c000737c854c6a85b1264f8a87c251ac718a9d40..cab25ac9e4f4fbe78827cb65b74700c12f11282b 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index 1e12659dc4b92f15dff148558217b6eb28ba4446..01926dc8abc43938aef08b77287f8b9c88b7bfb4 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index 04f1062c16f02a572e8f97c9345b2f6b99469983..6d4ea499b2bde8f623b41acaf24ddc46d911aee6 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index 1e82b74f1ef2e5cd6240b735add8776a5a0d025f..f3a31df94b3e4e42af2d1b05f607b82e442e32aa 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index 3c3dac9cdab96209dc789d35c42546ffd90ec6ef..bec6b207c071e4c5bb7072e2adae9c2532026ddd 100644 (file)
@@ -14,6 +14,7 @@
 //! (#14132).
 
 #![crate_name = "a"]
+#![feature(core)]
 
 use std::marker::MarkerTrait;
 
index 07f3b863af8a1f98006d1e2b2b4b3bc9aa35d3ee..54da1a1e451c848b4f0ed0b04b04d79ca359b7be 100644 (file)
@@ -11,7 +11,7 @@
 // force-host
 
 #![crate_type = "dylib"]
-#![feature(plugin_registrar, quote)]
+#![feature(plugin_registrar, quote, rustc_private)]
 
 extern crate "syntax_extension_with_dll_deps_1" as other;
 extern crate syntax;
index 0982efbdbf47e4d8770a7adc1aa0aa4a78ac5071..4a4de2455e36ea4bce9e376fa364f2a4280f1c87 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(core)]
+
 pub trait Foo : ::std::marker::MarkerTrait {
 }
 
index 506e7a00c75bcc72271c6f289984e1c5db52618e..5a7a3e7bcc6942ac1b5a7495bd8a569990674cd1 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(optin_builtin_traits)]
+#![feature(optin_builtin_traits, core)]
 #![crate_type = "rlib"]
 
 use std::marker::MarkerTrait;
index 82f613ee117ca63966af0532f5d3473b3b46b41c..82d07a9df4e12662e428d1feb51cffb1ea716e81 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(core)]
+
 use std::any::TypeId;
 
 pub struct A;
index 82f613ee117ca63966af0532f5d3473b3b46b41c..82d07a9df4e12662e428d1feb51cffb1ea716e81 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(core)]
+
 use std::any::TypeId;
 
 pub struct A;
index 85f49b4bb7fad0a1e744cd48fa10f45e91a91481..ceffae79677f4100f55d7d94ef219c9383f58a1e 100644 (file)
@@ -13,7 +13,7 @@
 // This aux-file will require the eh_personality function to be codegen'd, but
 // it hasn't been defined just yet. Make sure we don't explode.
 
-#![feature(no_std)]
+#![feature(no_std, core)]
 #![no_std]
 #![crate_type = "rlib"]
 
index 4909d84a34f126960aadfb6e28343ceb275a34fd..0cff90d61ed995c95959ae57c74fcdb9a39d2509 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, std_misc, rand)]
 
 use std::collections::{BTreeMap, HashMap, HashSet};
 use std::env;
index 994c9605fc375ccbaec7c386c6612f9a951b62b5..aeedaa288fef810f3bec9db55f07e7e93a8a9022 100644 (file)
@@ -10,7 +10,7 @@
 
 // ignore-pretty very bad with line comments
 
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, rand, std_misc, collections)]
 
 extern crate collections;
 extern crate rand;
index c2ea097ed751f73940981847e20f29821dc8ab8c..0344d6a46eeb58ffd54af4db766b59ec7c13785f 100644 (file)
@@ -11,7 +11,7 @@
 // ignore-lexer-test FIXME #15679
 // Microbenchmarks for various functions in std and extra
 
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, rand, old_io, old_path, std_misc, collections)]
 
 use std::old_io::*;
 use std::old_path::{Path, GenericPath};
index b8d8f0cc9e6a9511acb6c5c86681c586174316d0..fb95f92da77094239763d5ee9c59a890fb0b2fc2 100644 (file)
@@ -18,6 +18,8 @@
 // different scalability characteristics compared to the select
 // version.
 
+#![feature(std_misc)]
+
 use std::sync::mpsc::{channel, Sender, Receiver};
 use std::env;
 use std::thread;
index 3642eb82fdb0517f4200f1b9c1676e7348380a91..6d702242d765f2714ee84f327e05d779e0950de6 100644 (file)
@@ -14,6 +14,8 @@
 //
 // I *think* it's the same, more or less.
 
+#![feature(std_misc)]
+
 use std::sync::mpsc::{channel, Sender, Receiver};
 use std::env;
 use std::thread;
index a980b7ed9e75d0d72446f04b633ccc8505a0bbfc..6fb2c954e020503450a4845fc49fe5bafce01f6a 100644 (file)
@@ -18,6 +18,8 @@
 // no-pretty-expanded FIXME #15189
 // ignore-lexer-test FIXME #15679
 
+#![feature(std_misc)]
+
 use std::env;
 use std::sync::{Arc, Future, Mutex, Condvar};
 use std::time::Duration;
index de88c7733b379b87e7edf7996e4a434d26b41b95..6cd758361870ee4e8ec84713f82b1884f4c2ab16 100644 (file)
@@ -12,6 +12,8 @@
 // See https://github.com/nsf/pnoise for timings and alternative implementations.
 // ignore-lexer-test FIXME #15679
 
+#![feature(rand, core)]
+
 use std::f32::consts::PI;
 use std::num::Float;
 use std::rand::{Rng, StdRng};
index 38fc53ccd366a104896a9bc5dcd313a66aa215c7..64c3872213780beefc05796991c918f900bc4bd9 100644 (file)
@@ -38,6 +38,8 @@
 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 // OF THE POSSIBILITY OF SUCH DAMAGE.
 
+#![feature(rustc_private, core)]
+
 extern crate arena;
 
 use std::iter::range_step;
index 3688c224a7df4b5aacd9cd5b6018270ff92af224..e23862f4286aa33ab4790830fd7898a8e6dd483a 100644 (file)
@@ -38,6 +38,8 @@
 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 // OF THE POSSIBILITY OF SUCH DAMAGE.
 
+#![feature(core)]
+
 use std::{cmp, iter, mem};
 use std::thread;
 
index 289f05a299b9942205dd8c763033d1d99ea02a1a..709b23ef9dd039c07e4cf109ad83ea4582bc25b1 100644 (file)
@@ -38,6 +38,8 @@
 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 // OF THE POSSIBILITY OF SUCH DAMAGE.
 
+#![feature(core, old_io, io, core)]
+
 use std::cmp::min;
 use std::old_io::*;
 use std::iter::repeat;
index df839fc27eec8ee6d8495dfd2a5e64f9fa150992..78d31faeb51690c4cd8e2bc8ce6daf38ad5963e7 100644 (file)
@@ -38,6 +38,8 @@
 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 // OF THE POSSIBILITY OF SUCH DAMAGE.
 
+#![feature(old_io, old_path, io, core)]
+
 use std::cmp::min;
 use std::old_io::*;
 use std::old_io;
index 88c9f43f6ec7ca434334ab32cf7e7c8e3592aafb..ebdc60cdd2b0f3628894e8c7ea8cac35e07433d8 100644 (file)
@@ -13,7 +13,7 @@
 
 // multi tasking k-nucleotide
 
-#![feature(box_syntax)]
+#![feature(box_syntax, std_misc, old_io, collections, os)]
 
 use std::ascii::{AsciiExt, OwnedAsciiExt};
 use std::cmp::Ordering::{self, Less, Greater, Equal};
index 9e5885041b66b98875006e13b6b4238322c1c8d1..ba4f2c9b1c563abbfc9a00fc9d122bb22342521a 100644 (file)
@@ -40,7 +40,7 @@
 
 // ignore-android see #10393 #13206
 
-#![feature(box_syntax)]
+#![feature(box_syntax, std_misc, collections)]
 
 use std::ascii::OwnedAsciiExt;
 use std::env;
index 128c92921fa8616162c88743baf74f3ee01218a3..d248293103bdec7940ae623dd621216fe685b3ea 100644 (file)
@@ -38,7 +38,7 @@
 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 // OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#![feature(simd)]
+#![feature(simd, old_io, core, io)]
 
 // ignore-pretty very bad with line comments
 
index 79a5245a40849bc8842324917e8ed84b7c1ae110..150522fd02d4cb75ab41d8a0fb3c445bdb351b61 100644 (file)
@@ -40,6 +40,8 @@
 
 // no-pretty-expanded FIXME #15189
 
+#![feature(core)]
+
 use std::iter::repeat;
 use std::sync::Arc;
 use std::sync::mpsc::channel;
index 534dfe9548c2f73a5275abc4205b6028c5623c6f..3748b65dacbb8bd581cd0352c6072e3c21b59931 100644 (file)
@@ -38,6 +38,8 @@
 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 // OF THE POSSIBILITY OF SUCH DAMAGE.
 
+#![feature(core)]
+
 use std::num::Float;
 
 const PI: f64 = 3.141592653589793;
index a542c81f2394ea2523717305de5956469606a2a9..4d9bc951fa3061a460a4270e7e85484c481652a9 100644 (file)
@@ -18,6 +18,8 @@
 
 */
 
+#![feature(std_misc, rustc_private)]
+
 extern crate getopts;
 
 use std::sync::mpsc::{channel, Sender};
index 93aa5f2571bfbd30a138d928c0c3c0feb87735d0..8235b013a81bad39deb9d0696a90f80a4d33ef81 100644 (file)
 
 // ignore-android see #10393 #13206
 
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, libc, old_io, collections, io, core)]
 
 extern crate libc;
 
 use std::old_io::stdio::{stdin_raw, stdout_raw};
 use std::old_io::*;
-use std::ptr::{copy_memory, Unique};
+use std::ptr::{copy, Unique};
 use std::thread;
 
 struct Tables {
@@ -181,8 +181,8 @@ fn reverse_complement(seq: &mut [u8], tables: &Tables) {
     let mut i = LINE_LEN;
     while i < len {
         unsafe {
-            copy_memory(seq.as_mut_ptr().offset((i - off + 1) as int),
-                        seq.as_ptr().offset((i - off) as int), off);
+            copy(seq.as_mut_ptr().offset((i - off + 1) as int),
+                 seq.as_ptr().offset((i - off) as int), off);
             *seq.get_unchecked_mut(i - off) = b'\n';
         }
         i += LINE_LEN + 1;
index f7514a3e8848d16788fc26152f6409f82010fc88..3889b404d8557c111b639c121791618847be1d75 100644 (file)
@@ -41,7 +41,7 @@
 // no-pretty-expanded FIXME #15189
 
 #![allow(non_snake_case)]
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, core, os)]
 
 use std::iter::{repeat, AdditiveIterator};
 use std::thread;
index a54a869412e35483529c1cd943cf6c423e7e298f..dd56b18c144f2f29df781ada49cd3641008b2730 100644 (file)
@@ -10,6 +10,8 @@
 
 // Microbenchmark for the smallintmap library
 
+#![feature(collections, std_misc)]
+
 use std::collections::VecMap;
 use std::env;
 use std::time::Duration;
index 9a82614510eb265431596d82b1d34ec472e7a203..3913de3a3f99f49a5202859b11eef6e9016d76bb 100644 (file)
@@ -10,7 +10,7 @@
 
 // ignore-pretty very bad with line comments
 
-#![feature(box_syntax)]
+#![feature(box_syntax, core)]
 #![allow(non_snake_case)]
 
 use std::io::prelude::*;
index 896b0ee57a04cb47186e29aaafd7b5a634d2fed6..d8f4603ab1af956990efb3a463aa41220cba823a 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(unsafe_destructor, box_syntax)]
+#![feature(unsafe_destructor, box_syntax, std_misc, collections)]
 
 use std::env;
 use std::thread;
index 673c025e86345098b695e0d832673a7777d315ac..93c37524bf565294dd07c4fba3c4ec794c49bd7a 100644 (file)
@@ -18,26 +18,36 @@ struct SFn {
 }
 
 impl Fn<(isize,)> for SFn {
-    type Output = isize;
-
     extern "rust-call" fn call(&self, (z,): (isize,)) -> isize {
         self.x * self.y * z
     }
 }
 
+impl FnMut<(isize,)> for SFn {
+    extern "rust-call" fn call_mut(&mut self, args: (isize,)) -> isize { self.call(args) }
+}
+
+impl FnOnce<(isize,)> for SFn {
+    type Output = isize;
+    extern "rust-call" fn call_once(self, args: (isize,)) -> isize { self.call(args) }
+}
+
 struct SFnMut {
     x: isize,
     y: isize,
 }
 
 impl FnMut<(isize,)> for SFnMut {
-    type Output = isize;
-
     extern "rust-call" fn call_mut(&mut self, (z,): (isize,)) -> isize {
         self.x * self.y * z
     }
 }
 
+impl FnOnce<(isize,)> for SFnMut {
+    type Output = isize;
+    extern "rust-call" fn call_once(mut self, args: (isize,)) -> isize { self.call_mut(args) }
+}
+
 struct SFnOnce {
     x: String,
 }
diff --git a/src/test/compile-fail/borrowck-overloaded-index-2.rs b/src/test/compile-fail/borrowck-overloaded-index-2.rs
deleted file mode 100644 (file)
index 58668b7..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(box_syntax)]
-
-use std::ops::Index;
-
-struct MyVec<T> {
-    data: Vec<T>,
-}
-
-impl<T> Index<usize> for MyVec<T> {
-    type Output = T;
-
-    fn index(&self, &i: &usize) -> &T {
-        &self.data[i]
-    }
-}
-
-fn main() {
-    let v = MyVec::<Box<_>> { data: vec!(box 1, box 2, box 3) };
-    let good = &v[0]; // Shouldn't fail here
-    let bad = v[0];
-    //~^ ERROR cannot move out of indexed content
-}
index 430f2fcc13a73c0a075cd0ae286739c9bbcb54ea..bee56c9bf390bb17092d20dc86324435decad8e7 100644 (file)
@@ -19,7 +19,7 @@ struct MyVec<T> { x: T }
 
 impl<T> Index<usize> for MyVec<T> {
     type Output = T;
-    fn index(&self, _: &usize) -> &T {
+    fn index(&self, _: usize) -> &T {
         &self.x
     }
 }
index 99f396ef8143213af415dbca2a649d0b4e1cd167..55a6e2ac7b8d6755f8bd2bcac6da1e07105a5d8e 100644 (file)
@@ -18,6 +18,7 @@ struct Foo {
     y: isize,
 }
 
+#[cfg(stage0)]
 impl Index<String> for Foo {
     type Output = isize;
 
@@ -30,8 +31,20 @@ fn index<'a>(&'a self, z: &String) -> &'a isize {
     }
 }
 
-impl IndexMut<String> for Foo {
-    fn index_mut<'a>(&'a mut self, z: &String) -> &'a mut isize {
+impl<'a> Index<&'a String> for Foo {
+    type Output = isize;
+
+    fn index(&self, z: &String) -> &isize {
+        if *z == "x" {
+            &self.x
+        } else {
+            &self.y
+        }
+    }
+}
+
+impl<'a> IndexMut<&'a String> for Foo {
+    fn index_mut(&mut self, z: &String) -> &mut isize {
         if *z == "x" {
             &mut self.x
         } else {
@@ -41,13 +54,13 @@ fn index_mut<'a>(&'a mut self, z: &String) -> &'a mut isize {
 }
 
 fn test1(mut f: Box<Foo>, s: String) {
-    let _p = &mut f[s];
-    let _q = &f[s]; //~ ERROR cannot borrow
+    let _p = &mut f[&s];
+    let _q = &f[&s]; //~ ERROR cannot borrow
 }
 
 fn test2(mut f: Box<Foo>, s: String) {
-    let _p = &mut f[s];
-    let _q = &mut f[s]; //~ ERROR cannot borrow
+    let _p = &mut f[&s];
+    let _q = &mut f[&s]; //~ ERROR cannot borrow
 }
 
 struct Bar {
@@ -55,37 +68,37 @@ struct Bar {
 }
 
 fn test3(mut f: Box<Bar>, s: String) {
-    let _p = &mut f.foo[s];
-    let _q = &mut f.foo[s]; //~ ERROR cannot borrow
+    let _p = &mut f.foo[&s];
+    let _q = &mut f.foo[&s]; //~ ERROR cannot borrow
 }
 
 fn test4(mut f: Box<Bar>, s: String) {
-    let _p = &f.foo[s];
-    let _q = &f.foo[s];
+    let _p = &f.foo[&s];
+    let _q = &f.foo[&s];
 }
 
 fn test5(mut f: Box<Bar>, s: String) {
-    let _p = &f.foo[s];
-    let _q = &mut f.foo[s]; //~ ERROR cannot borrow
+    let _p = &f.foo[&s];
+    let _q = &mut f.foo[&s]; //~ ERROR cannot borrow
 }
 
 fn test6(mut f: Box<Bar>, g: Foo, s: String) {
-    let _p = &f.foo[s];
+    let _p = &f.foo[&s];
     f.foo = g; //~ ERROR cannot assign
 }
 
 fn test7(mut f: Box<Bar>, g: Bar, s: String) {
-    let _p = &f.foo[s];
+    let _p = &f.foo[&s];
     *f = g; //~ ERROR cannot assign
 }
 
 fn test8(mut f: Box<Bar>, g: Foo, s: String) {
-    let _p = &mut f.foo[s];
+    let _p = &mut f.foo[&s];
     f.foo = g; //~ ERROR cannot assign
 }
 
 fn test9(mut f: Box<Bar>, g: Bar, s: String) {
-    let _p = &mut f.foo[s];
+    let _p = &mut f.foo[&s];
     *f = g; //~ ERROR cannot assign
 }
 
diff --git a/src/test/compile-fail/borrowck-overloaded-index-move-from-vec.rs b/src/test/compile-fail/borrowck-overloaded-index-move-from-vec.rs
new file mode 100644 (file)
index 0000000..1b62d9c
--- /dev/null
@@ -0,0 +1,32 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(box_syntax)]
+
+use std::ops::Index;
+
+struct MyVec<T> {
+    data: Vec<T>,
+}
+
+impl<T> Index<usize> for MyVec<T> {
+    type Output = T;
+
+    fn index(&self, i: usize) -> &T {
+        &self.data[i]
+    }
+}
+
+fn main() {
+    let v = MyVec::<Box<_>> { data: vec!(box 1, box 2, box 3) };
+    let good = &v[0]; // Shouldn't fail here
+    let bad = v[0];
+    //~^ ERROR cannot move out of indexed content
+}
diff --git a/src/test/compile-fail/borrowck-overloaded-index-move-index.rs b/src/test/compile-fail/borrowck-overloaded-index-move-index.rs
new file mode 100644 (file)
index 0000000..d8615d1
--- /dev/null
@@ -0,0 +1,74 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::ops::{Index, IndexMut};
+
+struct Foo {
+    x: isize,
+    y: isize,
+}
+
+impl Index<String> for Foo {
+    type Output = isize;
+
+    fn index(&self, z: String) -> &isize {
+        if z == "x" {
+            &self.x
+        } else {
+            &self.y
+        }
+    }
+}
+
+impl IndexMut<String> for Foo {
+    fn index_mut(&mut self, z: String) -> &mut isize {
+        if z == "x" {
+            &mut self.x
+        } else {
+            &mut self.y
+        }
+    }
+}
+
+struct Bar {
+    x: isize,
+}
+
+impl Index<isize> for Bar {
+    type Output = isize;
+
+    fn index<'a>(&'a self, z: isize) -> &'a isize {
+        &self.x
+    }
+}
+
+fn main() {
+    let mut f = Foo {
+        x: 1,
+        y: 2,
+    };
+    let mut s = "hello".to_string();
+    let rs = &mut s;
+
+    println!("{}", f[s]);
+    //~^ ERROR cannot move out of `s` because it is borrowed
+
+    f[s] = 10;
+    //~^ ERROR cannot move out of `s` because it is borrowed
+    //~| ERROR use of moved value: `s`
+
+    let s = Bar {
+        x: 1,
+    };
+    let i = 2;
+    let _j = &i;
+    println!("{}", s[i]); // no error, i is copy
+    println!("{}", s[i]);
+}
diff --git a/src/test/compile-fail/borrowck-overloaded-index-ref-index.rs b/src/test/compile-fail/borrowck-overloaded-index-ref-index.rs
new file mode 100644 (file)
index 0000000..4c50caf
--- /dev/null
@@ -0,0 +1,68 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::ops::{Index, IndexMut};
+
+struct Foo {
+    x: isize,
+    y: isize,
+}
+
+impl<'a> Index<&'a String> for Foo {
+    type Output = isize;
+
+    fn index(&self, z: &String) -> &isize {
+        if *z == "x" {
+            &self.x
+        } else {
+            &self.y
+        }
+    }
+}
+
+impl<'a> IndexMut<&'a String> for Foo {
+    fn index_mut(&mut self, z: &String) -> &mut isize {
+        if *z == "x" {
+            &mut self.x
+        } else {
+            &mut self.y
+        }
+    }
+}
+
+struct Bar {
+    x: isize,
+}
+
+impl Index<isize> for Bar {
+    type Output = isize;
+
+    fn index<'a>(&'a self, z: isize) -> &'a isize {
+        &self.x
+    }
+}
+
+fn main() {
+    let mut f = Foo {
+        x: 1,
+        y: 2,
+    };
+    let mut s = "hello".to_string();
+    let rs = &mut s;
+    println!("{}", f[&s]);
+    //~^ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable
+    f[&s] = 10;
+    //~^ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable
+    let s = Bar {
+        x: 1,
+    };
+    s[2] = 20;
+    //~^ ERROR cannot assign to immutable indexed content
+}
diff --git a/src/test/compile-fail/borrowck-overloaded-index.rs b/src/test/compile-fail/borrowck-overloaded-index.rs
deleted file mode 100644 (file)
index 2d752ab..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::ops::{Index, IndexMut};
-
-struct Foo {
-    x: isize,
-    y: isize,
-}
-
-impl Index<String> for Foo {
-    type Output = isize;
-
-    fn index<'a>(&'a self, z: &String) -> &'a isize {
-        if *z == "x" {
-            &self.x
-        } else {
-            &self.y
-        }
-    }
-}
-
-impl IndexMut<String> for Foo {
-    fn index_mut<'a>(&'a mut self, z: &String) -> &'a mut isize {
-        if *z == "x" {
-            &mut self.x
-        } else {
-            &mut self.y
-        }
-    }
-}
-
-struct Bar {
-    x: isize,
-}
-
-impl Index<isize> for Bar {
-    type Output = isize;
-
-    fn index<'a>(&'a self, z: &isize) -> &'a isize {
-        &self.x
-    }
-}
-
-fn main() {
-    let mut f = Foo {
-        x: 1,
-        y: 2,
-    };
-    let mut s = "hello".to_string();
-    let rs = &mut s;
-    println!("{}", f[s]);
-    //~^ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable
-    f[s] = 10;
-    //~^ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable
-    let s = Bar {
-        x: 1,
-    };
-    s[2] = 20;
-    //~^ ERROR cannot assign to immutable indexed content
-}
index fe7635f065cdc5ee969fe64c792b991de8fe45a6..27b4a04054f073f203503b5ef9a01298e864a622 100644 (file)
@@ -10,5 +10,6 @@
 
 fn main() {
     let x: Option<&[u8]> = Some("foo").map(std::mem::transmute);
-    //~^ ERROR: is not implemented for the type
+    //~^ ERROR E0277
+    //~| ERROR E0277
 }
index 6bcbefb904d9e6a510ec6120a94a40e80aeefa57..a5b317307379e82cfa80d034d4a95e8bca787c6c 100644 (file)
@@ -21,4 +21,14 @@ impl MyTrait for .. {}
 impl MyTrait for .. {}
 //~^ ERROR conflicting implementations for trait `MyTrait`
 
+trait MySafeTrait: MarkerTrait {}
+
+unsafe impl MySafeTrait for .. {}
+//~^ ERROR implementing the trait `MySafeTrait` is not unsafe
+
+unsafe trait MyUnsafeTrait: MarkerTrait {}
+
+impl MyUnsafeTrait for .. {}
+//~^ ERROR the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
+
 fn main() {}
diff --git a/src/test/compile-fail/deriving-is-deprecated.rs b/src/test/compile-fail/deriving-is-deprecated.rs
deleted file mode 100644 (file)
index 060e178..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-#[deriving(Clone)] //~ ERROR `deriving` has been renamed to `derive`
-struct Foo;
-
-fn main() {}
index 91f34320482561aca98a3a707e8405a976579c41..021ef7343cbb4432f028f51e030967d23a98db43 100644 (file)
@@ -20,7 +20,7 @@
 impl Index<usize> for S {
     type Output = str;
 
-    fn index<'a>(&'a self, _: &usize) -> &'a str {
+    fn index(&self, _: usize) -> &str {
         "hello"
     }
 }
@@ -31,7 +31,7 @@ fn index<'a>(&'a self, _: &usize) -> &'a str {
 impl Index<usize> for T {
     type Output = Debug + 'static;
 
-    fn index<'a>(&'a self, idx: &usize) -> &'a (Debug + 'static) {
+    fn index<'a>(&'a self, idx: usize) -> &'a (Debug + 'static) {
         static x: usize = 42;
         &x
     }
index db3373ea02772285a8300795963091b2e992609b..d1abed9b2627c0a636bd9f1eb96ceb6ce7c3f008 100644 (file)
@@ -18,5 +18,5 @@ fn main() {
     let _x: extern "C" fn() = f; // OK
     is_fn(f);
     //~^ ERROR the trait `core::ops::Fn<()>` is not implemented for the type `extern "C" fn()
-    //~| ERROR the trait `core::ops::Fn<()>` is not implemented for the type `extern "C" fn()
+    //~| ERROR the trait `core::ops::FnOnce<()>` is not implemented for the type `extern "C" fn()
 }
index e5e5ddadafccf8014d09b675f53a1b093c896e4c..d86c5d211dc5fa2e339d1fa06582655ee0b44d3f 100644 (file)
 struct Foo;
 impl Fn<()> for Foo {
     //~^ ERROR angle-bracket notation is not stable when used with the `Fn` family of traits
-    type Output = ();
-
-    extern "rust-call" fn call(&self, args: ()) -> () {}
+    extern "rust-call" fn call(self, args: ()) -> () {}
 }
 struct Foo1;
-impl Fn() for Foo1 {
+impl FnOnce() for Foo1 {
     //~^ ERROR associated type bindings are not allowed here
-
-    extern "rust-call" fn call(&self, args: ()) -> () {}
+    extern "rust-call" fn call_once(self, args: ()) -> () {}
 }
 struct Bar;
 impl FnMut<()> for Bar {
     //~^ ERROR angle-bracket notation is not stable when used with the `Fn` family of traits
-    type Output = ();
-
     extern "rust-call" fn call_mut(&self, args: ()) -> () {}
 }
 struct Baz;
 impl FnOnce<()> for Baz {
     //~^ ERROR angle-bracket notation is not stable when used with the `Fn` family of traits
-    type Output = ();
-
     extern "rust-call" fn call_once(&self, args: ()) -> () {}
 }
 
index 35c551931366d28c732260ef2d523197a14c4759..6433255bd4d2fcb7e3dd05894e669f8a38b0b945 100644 (file)
@@ -35,5 +35,5 @@ fn main() {
 
     needs_fn(1);
     //~^ ERROR `core::ops::Fn<(isize,)>`
-    //~| ERROR `core::ops::Fn<(isize,)>`
+    //~| ERROR `core::ops::FnOnce<(isize,)>`
 }
index 838e65e1d0574718d893ed2856e2daab64c0d057..8e1e88a92e452c09d0200806c4bfe2cdc7386394 100644 (file)
@@ -17,9 +17,13 @@ fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
 }
 
 fn main() {
-    apply(&3, takes_mut); //~ ERROR (values differ in mutability)
     apply(&3, takes_imm);
+    apply(&3, takes_mut);
+    //~^ ERROR (values differ in mutability)
+    //~| ERROR (values differ in mutability)
 
     apply(&mut 3, takes_mut);
-    apply(&mut 3, takes_imm); //~ ERROR (values differ in mutability)
+    apply(&mut 3, takes_imm);
+    //~^ ERROR (values differ in mutability)
+    //~| ERROR (values differ in mutability)
 }
diff --git a/src/test/compile-fail/hrtb-precedence-of-plus-error-message.rs b/src/test/compile-fail/hrtb-precedence-of-plus-error-message.rs
deleted file mode 100644 (file)
index db67249..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(unboxed_closures)]
-
-// Test that we suggest the correct parentheses
-
-trait Bar {
-    fn dummy(&self) { }
-}
-
-struct Foo<'a> {
-    a: &'a Bar+'a,
-        //~^ ERROR E0178
-        //~^^ HELP perhaps you meant `&'a (Bar + 'a)`?
-
-    b: &'a mut Bar+'a,
-        //~^ ERROR E0178
-        //~^^ HELP perhaps you meant `&'a mut (Bar + 'a)`?
-
-    c: Box<Bar+'a>, // OK, no paren needed in this context
-
-    d: fn() -> Bar+'a,
-        //~^ ERROR E0178
-        //~^^ HELP perhaps you forgot parentheses
-        //~^^^ WARN deprecated syntax
-}
-
-fn main() { }
index 4e296198be8e4b295fd8b94bf7f1b712db697d6a..2b48d47e940912c883795317f463ec779a752119 100644 (file)
 // aux-build:internal_unstable.rs
 // error-pattern:use of unstable library feature 'function'
 // error-pattern:use of unstable library feature 'struct_field'
-// error-pattern:compilation successful
-#![feature(rustc_attrs)]
 
 #[macro_use]
 extern crate internal_unstable;
 
-#[rustc_error]
 fn main() {
     call_unstable_noallow!();
 
index ff1584975462f18974441bbc2262dc543e5d520a..74526fb3d83143de09750cce78068b9eab3a4184 100644 (file)
 
 // aux-build:internal_unstable.rs
 
-#![feature(rustc_attrs)]
 #![allow(dead_code)]
 
 extern crate internal_unstable;
 
 
 thread_local!(static FOO: () = ());
-thread_local!(static BAR: () = internal_unstable::unstable()); //~ WARN use of unstable
+thread_local!(static BAR: () = internal_unstable::unstable()); //~ ERROR use of unstable
 
-#[rustc_error]
-fn main() {} //~ ERROR
+fn main() {}
index 8674e8ab5b2cdaf95bac7751a7d8edcedd57ed93..accc898b8a8081ce1b82a5e97b2bf6f70c0bbe46 100755 (executable)
@@ -10,7 +10,7 @@
 
 // aux-build:internal_unstable.rs
 
-#![feature(rustc_attrs, allow_internal_unstable)]
+#![feature(allow_internal_unstable)]
 
 #[macro_use]
 extern crate internal_unstable;
@@ -19,7 +19,7 @@ macro_rules! foo {
     ($e: expr, $f: expr) => {{
         $e;
         $f;
-        internal_unstable::unstable(); //~ WARN use of unstable
+        internal_unstable::unstable(); //~ ERROR use of unstable
     }}
 }
 
@@ -32,20 +32,19 @@ macro_rules! bar {
     }}
 }
 
-#[rustc_error]
-fn main() { //~ ERROR
+fn main() {
     // ok, the instability is contained.
     call_unstable_allow!();
     construct_unstable_allow!(0);
 
     // bad.
-    pass_through_allow!(internal_unstable::unstable()); //~ WARN use of unstable
+    pass_through_allow!(internal_unstable::unstable()); //~ ERROR use of unstable
 
-    pass_through_noallow!(internal_unstable::unstable()); //~ WARN use of unstable
+    pass_through_noallow!(internal_unstable::unstable()); //~ ERROR use of unstable
 
 
 
-    println!("{:?}", internal_unstable::unstable()); //~ WARN use of unstable
+    println!("{:?}", internal_unstable::unstable()); //~ ERROR use of unstable
 
-    bar!(internal_unstable::unstable()); //~ WARN use of unstable
+    bar!(internal_unstable::unstable()); //~ ERROR use of unstable
 }
index d7bb806999c74abe7291eac8f090a492a53ac417..3f994102a173e0853f052c0b7ba9f3d65e0864bc 100644 (file)
@@ -22,11 +22,11 @@ fn main() {
     //~| expected u8
     //~| found array of 1 elements
 
-    let local = [0];
+    let local: [u8; 1] = [0];
     let _v = &local as *mut u8;
     //~^ ERROR mismatched types
     //~| expected `*mut u8`
-    //~| found `&[_; 1]`
+    //~| found `&[u8; 1]`
     //~| expected u8,
     //~| found array of 1 elements
 }
index 8f79022405ebe40139c5784530c59061018c5bfe..3853434e128ebd0b9465747277150ddf0c9fc41b 100644 (file)
@@ -16,11 +16,10 @@ struct Debuger<T> {
     x: T
 }
 
-impl<T: fmt::Debug> ops::Fn<(),> for Debuger<T> {
+impl<T: fmt::Debug> ops::FnOnce<(),> for Debuger<T> {
     type Output = ();
-
-    fn call(&self, _args: ()) {
-//~^ ERROR `call` has an incompatible type for trait: expected "rust-call" fn, found "Rust" fn
+    fn call_once(self, _args: ()) {
+//~^ ERROR `call_once` has an incompatible type for trait: expected "rust-call" fn, found "Rust" fn
         println!("{:?}", self.x);
     }
 }
index 6d2cfcab04e36aa757cf40418f7127e917453590..a4e0f69b63b39e0b55c2353ca65c1d95221c6180 100644 (file)
@@ -19,8 +19,7 @@ fn foo(value: *const X) -> *const X {
 }
 
 static foo: *const Y::X = Y::foo(Y::x as *const Y::X);
-//~^ ERROR cannot refer to other statics by value
-//~| ERROR the trait `core::marker::Sync` is not implemented for the type
+//~^ ERROR the trait `core::marker::Sync` is not implemented for the type
 //~| ERROR function calls in statics are limited to struct and enum constructors
 
 fn main() {}
index 015f1fa603a2004ae08c5fcae9cff0af5295b7bb..f8d85f939374dabce61c3f7eeaa4f705b2fc0b5a 100644 (file)
@@ -33,7 +33,4 @@ fn main() {
 
     0.contains(bits);
     //~^ ERROR overflow
-    //~| ERROR overflow
-    //~| ERROR overflow
-    //~| ERROR mismatched types
 }
index e4bedbbb7e1e54d4b4c25f718304954a0f82b4a3..fe427e02451af6a0587f2c7ae49cfc2f98dfa75e 100644 (file)
 struct Foo;
 
 impl<'a, T> Fn<(&'a T,)> for Foo {
+  extern "rust-call" fn call(&self, (_,): (T,)) {}
+  //~^ ERROR: has an incompatible type for trait: expected &-ptr
+}
+
+impl<'a, T> FnMut<(&'a T,)> for Foo {
+  extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
+  //~^ ERROR: has an incompatible type for trait: expected &-ptr
+}
+
+impl<'a, T> FnOnce<(&'a T,)> for Foo {
   type Output = ();
 
-  extern "rust-call" fn call(&self, (_,): (T,)) {}
+  extern "rust-call" fn call_once(self, (_,): (T,)) {}
   //~^ ERROR: has an incompatible type for trait: expected &-ptr
 }
 
diff --git a/src/test/compile-fail/issue-5543.rs b/src/test/compile-fail/issue-5543.rs
deleted file mode 100644 (file)
index c27362e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Foo { fn foo(&self) {} }
-impl Foo for u8 {}
-
-fn main() {
-    // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
-    let r: Box<Foo> = Box::new(5);
-    let _m: Box<Foo> = r as Box<Foo>;
-    //~^ ERROR `core::marker::Sized` is not implemented for the type `Foo`
-}
index dffc8fa2abd70d95def12e4df2eb40fdf247cea3..71494fd5f38dcef2116756b89e57a7c6edabdb7f 100644 (file)
@@ -28,6 +28,7 @@ fn f<T>(val: T) {
     let a = &t as &Gettable<T>;
     //~^ ERROR the trait `core::marker::Send` is not implemented
     //~^^ ERROR the trait `core::marker::Copy` is not implemented
+    //~^^^ ERROR the parameter type `T` may not live long enough
 }
 
 fn g<T>(val: T) {
index 13ee3f163616e8ccf207d9f283bed3fbebd30a4b..ba1b7f03b0f419b2fe15570b7594b77bf4a93f7d 100644 (file)
@@ -86,6 +86,6 @@ fn f() {}
 }
 
 pub fn foo() {
-    let a = &1 as &inner::Trait;
+    let a: &inner::Trait = &1_isize;
     a.f();
 }
index ec4e3c774dbf02d9e9aae57ef8b42788513cfdba..d95ed7f10bd17dfc63cb15e897c1f4bf85dc0339 100644 (file)
 
 #![feature(foo)] //~ ERROR unused or unknown feature
 
-extern crate lint_output_format; //~ WARNING: use of unstable library feature
+extern crate lint_output_format; //~ ERROR use of unstable library feature
 use lint_output_format::{foo, bar};
 
 fn main() {
     let _x = foo(); //~ WARNING #[warn(deprecated)] on by default
-    let _y = bar(); //~ WARNING: use of unstable library feature
+    let _y = bar(); //~ ERROR use of unstable library feature
 }
index c43ff198925034cec0622db9d4b9b0da7789c2c0..716d7674b2ddbe8b3b852aeca46696e6e9254196 100644 (file)
@@ -22,24 +22,24 @@ mod cross_crate {
     pub fn foo() {
         let x = Stable {
             inherit: 1,
-            override1: 2, //~ WARN use of unstable
+            override1: 2, //~ ERROR use of unstable
             override2: 3,
             //~^ ERROR use of deprecated item
-            //~^^ WARN use of unstable
+            //~^^ ERROR use of unstable
         };
 
         let _ = x.inherit;
-        let _ = x.override1; //~ WARN use of unstable
+        let _ = x.override1; //~ ERROR use of unstable
         let _ = x.override2;
         //~^ ERROR use of deprecated item
-        //~^^ WARN use of unstable
+        //~^^ ERROR use of unstable
 
         let Stable {
             inherit: _,
-            override1: _, //~ WARN use of unstable
+            override1: _, //~ ERROR use of unstable
             override2: _
             //~^ ERROR use of deprecated item
-            //~^^ WARN use of unstable
+            //~^^ ERROR use of unstable
         } = x;
         // all fine
         let Stable { .. } = x;
@@ -47,122 +47,122 @@ pub fn foo() {
         let x = Stable2(1, 2, 3);
 
         let _ = x.0;
-        let _ = x.1; //~ WARN use of unstable
+        let _ = x.1; //~ ERROR use of unstable
         let _ = x.2;
         //~^ ERROR use of deprecated item
-        //~^^ WARN use of unstable
+        //~^^ ERROR use of unstable
 
         let Stable2(_,
-                   _, //~ WARN use of unstable
+                   _, //~ ERROR use of unstable
                    _)
             //~^ ERROR use of deprecated item
-            //~^^ WARN use of unstable
+            //~^^ ERROR use of unstable
             = x;
         // all fine
         let Stable2(..) = x;
 
 
-        let x = Unstable { //~ WARN use of unstable
-            inherit: 1, //~ WARN use of unstable
+        let x = Unstable { //~ ERROR use of unstable
+            inherit: 1, //~ ERROR use of unstable
             override1: 2,
             override2: 3,
             //~^ ERROR use of deprecated item
-            //~^^ WARN use of unstable
+            //~^^ ERROR use of unstable
         };
 
-        let _ = x.inherit; //~ WARN use of unstable
+        let _ = x.inherit; //~ ERROR use of unstable
         let _ = x.override1;
         let _ = x.override2;
         //~^ ERROR use of deprecated item
-        //~^^ WARN use of unstable
+        //~^^ ERROR use of unstable
 
-        let Unstable { //~ WARN use of unstable
-            inherit: _, //~ WARN use of unstable
+        let Unstable { //~ ERROR use of unstable
+            inherit: _, //~ ERROR use of unstable
             override1: _,
             override2: _
             //~^ ERROR use of deprecated item
-            //~^^ WARN use of unstable
+            //~^^ ERROR use of unstable
         } = x;
 
-        let Unstable  //~ WARN use of unstable
+        let Unstable  //~ ERROR use of unstable
             // the patterns are all fine:
             { .. } = x;
 
 
-        let x = Unstable2(1, 2, 3); //~ WARN use of unstable
+        let x = Unstable2(1, 2, 3); //~ ERROR use of unstable
 
-        let _ = x.0; //~ WARN use of unstable
+        let _ = x.0; //~ ERROR use of unstable
         let _ = x.1;
         let _ = x.2;
         //~^ ERROR use of deprecated item
-        //~^^ WARN use of unstable
+        //~^^ ERROR use of unstable
 
-        let Unstable2  //~ WARN use of unstable
-            (_, //~ WARN use of unstable
+        let Unstable2  //~ ERROR use of unstable
+            (_, //~ ERROR use of unstable
              _,
              _)
             //~^ ERROR use of deprecated item
-            //~^^ WARN use of unstable
+            //~^^ ERROR use of unstable
             = x;
-        let Unstable2 //~ WARN use of unstable
+        let Unstable2 //~ ERROR use of unstable
             // the patterns are all fine:
             (..) = x;
 
 
         let x = Deprecated {
             //~^ ERROR use of deprecated item
-            //~^^ WARN use of unstable
+            //~^^ ERROR use of unstable
             inherit: 1,
             //~^ ERROR use of deprecated item
-            //~^^ WARN use of unstable
+            //~^^ ERROR use of unstable
             override1: 2,
-            override2: 3, //~ WARN use of unstable
+            override2: 3, //~ ERROR use of unstable
         };
 
         let _ = x.inherit;
         //~^ ERROR use of deprecated item
-        //~^^ WARN use of unstable
+        //~^^ ERROR use of unstable
         let _ = x.override1;
-        let _ = x.override2; //~ WARN use of unstable
+        let _ = x.override2; //~ ERROR use of unstable
 
         let Deprecated {
             //~^ ERROR use of deprecated item
-            //~^^ WARN use of unstable
+            //~^^ ERROR use of unstable
             inherit: _,
             //~^ ERROR use of deprecated item
-            //~^^ WARN use of unstable
+            //~^^ ERROR use of unstable
             override1: _,
-            override2: _ //~ WARN use of unstable
+            override2: _ //~ ERROR use of unstable
         } = x;
 
         let Deprecated
             //~^ ERROR use of deprecated item
-            //~^^ WARN use of unstable
+            //~^^ ERROR use of unstable
             // the patterns are all fine:
             { .. } = x;
 
         let x = Deprecated2(1, 2, 3);
         //~^ ERROR use of deprecated item
-        //~^^ WARN use of unstable
+        //~^^ ERROR use of unstable
 
         let _ = x.0;
         //~^ ERROR use of deprecated item
-        //~^^ WARN use of unstable
+        //~^^ ERROR use of unstable
         let _ = x.1;
-        let _ = x.2; //~ WARN use of unstable
+        let _ = x.2; //~ ERROR use of unstable
 
         let Deprecated2
         //~^ ERROR use of deprecated item
-        //~^^ WARN use of unstable
+        //~^^ ERROR use of unstable
             (_,
              //~^ ERROR use of deprecated item
-             //~^^ WARN use of unstable
+             //~^^ ERROR use of unstable
              _,
-             _) //~ WARN use of unstable
+             _) //~ ERROR use of unstable
             = x;
         let Deprecated2
         //~^ ERROR use of deprecated item
-        //~^^ WARN use of unstable
+        //~^^ ERROR use of unstable
             // the patterns are all fine:
             (..) = x;
     }
index 12548c4539618d73173b3a4b6d50c37faacc079d..391b49e10686ec41e68c71e30bcad03ec60573af 100644 (file)
@@ -24,7 +24,7 @@
 
 mod cross_crate {
     extern crate stability_cfg1;
-    extern crate stability_cfg2; //~ WARNING: use of unstable library feature
+    extern crate stability_cfg2; //~ ERROR use of unstable library feature
 
     use lint_stability::*;
 
@@ -51,64 +51,64 @@ fn test() {
         <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item: text
 
         deprecated_unstable(); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         foo.method_deprecated_unstable(); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         Foo::method_deprecated_unstable(&foo); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         <Foo>::method_deprecated_unstable(&foo); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         foo.trait_deprecated_unstable(); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         Trait::trait_deprecated_unstable(&foo); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         <Foo>::trait_deprecated_unstable(&foo); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         <Foo as Trait>::trait_deprecated_unstable(&foo); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
 
         deprecated_unstable_text(); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         foo.method_deprecated_unstable_text(); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         Foo::method_deprecated_unstable_text(&foo); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         <Foo>::method_deprecated_unstable_text(&foo); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         foo.trait_deprecated_unstable_text(); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         Trait::trait_deprecated_unstable_text(&foo); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         <Foo>::trait_deprecated_unstable_text(&foo); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         <Foo as Trait>::trait_deprecated_unstable_text(&foo); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
 
-        unstable(); //~ WARNING use of unstable library feature
-        foo.method_unstable(); //~ WARNING use of unstable library feature
-        Foo::method_unstable(&foo); //~ WARNING use of unstable library feature
-        <Foo>::method_unstable(&foo); //~ WARNING use of unstable library feature
-        foo.trait_unstable(); //~ WARNING use of unstable library feature
-        Trait::trait_unstable(&foo); //~ WARNING use of unstable library feature
-        <Foo>::trait_unstable(&foo); //~ WARNING use of unstable library feature
-        <Foo as Trait>::trait_unstable(&foo); //~ WARNING use of unstable library feature
+        unstable(); //~ ERROR use of unstable library feature
+        foo.method_unstable(); //~ ERROR use of unstable library feature
+        Foo::method_unstable(&foo); //~ ERROR use of unstable library feature
+        <Foo>::method_unstable(&foo); //~ ERROR use of unstable library feature
+        foo.trait_unstable(); //~ ERROR use of unstable library feature
+        Trait::trait_unstable(&foo); //~ ERROR use of unstable library feature
+        <Foo>::trait_unstable(&foo); //~ ERROR use of unstable library feature
+        <Foo as Trait>::trait_unstable(&foo); //~ ERROR use of unstable library feature
 
         unstable_text();
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
         foo.method_unstable_text();
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
         Foo::method_unstable_text(&foo);
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
         <Foo>::method_unstable_text(&foo);
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
         foo.trait_unstable_text();
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
         Trait::trait_unstable_text(&foo);
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
         <Foo>::trait_unstable_text(&foo);
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
         <Foo as Trait>::trait_unstable_text(&foo);
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
 
         stable();
         foo.method_stable();
@@ -130,26 +130,26 @@ fn test() {
 
         let _ = DeprecatedStruct { i: 0 }; //~ ERROR use of deprecated item
         let _ = DeprecatedUnstableStruct { i: 0 }; //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
-        let _ = UnstableStruct { i: 0 }; //~ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
+        let _ = UnstableStruct { i: 0 }; //~ ERROR use of unstable library feature
         let _ = StableStruct { i: 0 };
 
         let _ = DeprecatedUnitStruct; //~ ERROR use of deprecated item
         let _ = DeprecatedUnstableUnitStruct; //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
-        let _ = UnstableUnitStruct; //~ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
+        let _ = UnstableUnitStruct; //~ ERROR use of unstable library feature
         let _ = StableUnitStruct;
 
         let _ = Enum::DeprecatedVariant; //~ ERROR use of deprecated item
         let _ = Enum::DeprecatedUnstableVariant; //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
-        let _ = Enum::UnstableVariant; //~ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
+        let _ = Enum::UnstableVariant; //~ ERROR use of unstable library feature
         let _ = Enum::StableVariant;
 
         let _ = DeprecatedTupleStruct (1); //~ ERROR use of deprecated item
         let _ = DeprecatedUnstableTupleStruct (1); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
-        let _ = UnstableTupleStruct (1); //~ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
+        let _ = UnstableTupleStruct (1); //~ ERROR use of unstable library feature
         let _ = StableTupleStruct (1);
 
         // At the moment, the lint checker only checks stability in
@@ -159,7 +159,7 @@ fn test() {
         // on macros themselves are not yet linted.
         macro_test_arg!(deprecated_text()); //~ ERROR use of deprecated item: text
         macro_test_arg!(deprecated_unstable_text()); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         macro_test_arg!(macro_test_arg!(deprecated_text())); //~ ERROR use of deprecated item: text
     }
 
@@ -173,33 +173,33 @@ fn test_method_param<Foo: Trait>(foo: Foo) {
         <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item: text
         <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item: text
         foo.trait_deprecated_unstable(); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         Trait::trait_deprecated_unstable(&foo); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         <Foo>::trait_deprecated_unstable(&foo); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         <Foo as Trait>::trait_deprecated_unstable(&foo); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         foo.trait_deprecated_unstable_text(); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         Trait::trait_deprecated_unstable_text(&foo); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         <Foo>::trait_deprecated_unstable_text(&foo); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         <Foo as Trait>::trait_deprecated_unstable_text(&foo); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
-        foo.trait_unstable(); //~ WARNING use of unstable library feature
-        Trait::trait_unstable(&foo); //~ WARNING use of unstable library feature
-        <Foo>::trait_unstable(&foo); //~ WARNING use of unstable library feature
-        <Foo as Trait>::trait_unstable(&foo); //~ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
+        foo.trait_unstable(); //~ ERROR use of unstable library feature
+        Trait::trait_unstable(&foo); //~ ERROR use of unstable library feature
+        <Foo>::trait_unstable(&foo); //~ ERROR use of unstable library feature
+        <Foo as Trait>::trait_unstable(&foo); //~ ERROR use of unstable library feature
         foo.trait_unstable_text();
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
         Trait::trait_unstable_text(&foo);
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
         <Foo>::trait_unstable_text(&foo);
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
         <Foo as Trait>::trait_unstable_text(&foo);
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
         foo.trait_stable();
         Trait::trait_stable(&foo);
         <Foo>::trait_stable(&foo);
@@ -210,46 +210,46 @@ fn test_method_object(foo: &Trait) {
         foo.trait_deprecated(); //~ ERROR use of deprecated item
         foo.trait_deprecated_text(); //~ ERROR use of deprecated item: text
         foo.trait_deprecated_unstable(); //~ ERROR use of deprecated item
-        //~^ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
         foo.trait_deprecated_unstable_text(); //~ ERROR use of deprecated item: text
-        //~^ WARNING use of unstable library feature
-        foo.trait_unstable(); //~ WARNING use of unstable library feature
+        //~^ ERROR use of unstable library feature
+        foo.trait_unstable(); //~ ERROR use of unstable library feature
         foo.trait_unstable_text();
-        //~^ WARNING use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'test_feature': text
         foo.trait_stable();
     }
 
     struct S;
 
-    impl UnstableTrait for S { } //~ WARNING use of unstable library feature
+    impl UnstableTrait for S { } //~ ERROR use of unstable library feature
 
-    trait LocalTrait : UnstableTrait { } //~ WARNING use of unstable library feature
+    trait LocalTrait : UnstableTrait { } //~ ERROR use of unstable library feature
 
     impl Trait for S {
         fn trait_stable(&self) {}
-        fn trait_unstable(&self) {} //~ WARNING use of unstable library feature
+        fn trait_unstable(&self) {} //~ ERROR use of unstable library feature
     }
 }
 
 mod inheritance {
-    extern crate inherited_stability; //~ WARNING: use of unstable library feature
-    use self::inherited_stability::*; //~ WARNING: use of unstable library feature
+    extern crate inherited_stability; //~ ERROR use of unstable library feature
+    use self::inherited_stability::*; //~ ERROR use of unstable library feature
 
     fn test_inheritance() {
-        unstable(); //~ WARNING use of unstable library feature
+        unstable(); //~ ERROR use of unstable library feature
         stable();
 
-        stable_mod::unstable(); //~ WARNING use of unstable library feature
+        stable_mod::unstable(); //~ ERROR use of unstable library feature
         stable_mod::stable();
 
         unstable_mod::deprecated(); //~ ERROR use of deprecated item
-        unstable_mod::unstable(); //~ WARNING use of unstable library feature
+        unstable_mod::unstable(); //~ ERROR use of unstable library feature
 
-        let _ = Unstable::UnstableVariant; //~ WARNING use of unstable library feature
+        let _ = Unstable::UnstableVariant; //~ ERROR use of unstable library feature
         let _ = Unstable::StableVariant;
 
         let x: usize = 0;
-        x.unstable(); //~ WARNING use of unstable library feature
+        x.unstable(); //~ ERROR use of unstable library feature
         x.stable();
     }
 }
diff --git a/src/test/compile-fail/lint-unnecessary-casts.rs b/src/test/compile-fail/lint-unnecessary-casts.rs
deleted file mode 100644 (file)
index b3cf825..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![forbid(unused_typecasts)]
-
-fn foo_i32(_: i32) {}
-
-fn foo_u64(a: u64) {
-    let b: i32 = a as i32;
-    foo_i32(b as i32); //~ ERROR: unnecessary type cast
-}
-
-fn main() {
-    let x: u64 = 1;
-    let y: u64 = x as u64; //~ ERROR: unnecessary type cast
-    foo_u64(y as u64); //~ ERROR: unnecessary type cast
-}
index ac4b8a5f3090b09102e7452c2af3277ebe1b339c..0fee48a8c6c662ddeda75093ea52daf124096aae 100644 (file)
@@ -10,7 +10,7 @@
 
 #![deny(unused_variables)]
 #![deny(unused_assignments)]
-#![allow(dead_code, non_camel_case_types)]
+#![allow(dead_code, non_camel_case_types, trivial_numeric_casts)]
 
 fn f1(x: isize) {
     //~^ ERROR unused variable: `x`
diff --git a/src/test/compile-fail/match-ref-mut-invariance.rs b/src/test/compile-fail/match-ref-mut-invariance.rs
new file mode 100644 (file)
index 0000000..c2b54a9
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Check that when making a ref mut binding with type `&mut T`, the
+// type `T` must match precisely the type `U` of the value being
+// matched, and in particular cannot be some supertype of `U`. Issue
+// #23116. This test focuses on a `match`.
+
+#![allow(dead_code)]
+struct S<'b>(&'b i32);
+impl<'b> S<'b> {
+    fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
+        match self.0 { ref mut x => x } //~ ERROR mismatched types
+    }
+}
+
+fn main() {}
diff --git a/src/test/compile-fail/match-ref-mut-let-invariance.rs b/src/test/compile-fail/match-ref-mut-let-invariance.rs
new file mode 100644 (file)
index 0000000..ea16c61
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Check that when making a ref mut binding with type `&mut T`, the
+// type `T` must match precisely the type `U` of the value being
+// matched, and in particular cannot be some supertype of `U`. Issue
+// #23116. This test focuses on a `let`.
+
+#![allow(dead_code)]
+struct S<'b>(&'b i32);
+impl<'b> S<'b> {
+    fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
+        let ref mut x = self.0;
+        x //~ ERROR mismatched types
+    }
+}
+
+fn main() {}
index 976717249e8eb2400fe6e307b625bd0fc8e73e18..5a8772d61425fcb9176c7c69abe6368a900c34c1 100644 (file)
@@ -12,6 +12,7 @@
 
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
+#![allow(trivial_casts)]
 
 trait Bar {
     fn bar(self);
index 61752e62abdefe90e80100478f48b9f6c5246bba..77ac97bc8b89951427bf7aaa9d69d0e45675f55a 100644 (file)
@@ -18,13 +18,18 @@ struct S {
 }
 
 impl FnMut<(isize,)> for S {
-    type Output = isize;
-
     extern "rust-call" fn call_mut(&mut self, (z,): (isize,)) -> isize {
         self.x * self.y * z
     }
 }
 
+impl FnOnce<(isize,)> for S {
+    type Output = isize;
+    extern "rust-call" fn call_once(mut self, (z,): (isize,)) -> isize {
+        self.call_mut((z,))
+    }
+}
+
 fn main() {
     let mut s = S {
         x: 3,
index c4019fa22097a92391cb533d7fd144df0101eefa..ea47d676412098c04e54399afc0a05d7187a7be7 100644 (file)
@@ -18,12 +18,16 @@ struct S {
 }
 
 impl FnMut<isize> for S {
-    type Output = isize;
     extern "rust-call" fn call_mut(&mut self, z: isize) -> isize {
         self.x + self.y + z
     }
 }
 
+impl FnOnce<isize> for S {
+    type Output = isize;
+    extern "rust-call" fn call_once(mut self, z: isize) -> isize { self.call_mut(z) }
+}
+
 fn main() {
     let mut s = S {
         x: 1,
index e8bc11317f2aadbd597b1a58228d0a61be3505a1..368269999a296c0008f457a5f7c37f12b63d9e63 100644 (file)
@@ -42,12 +42,5 @@ fn is_send<T:Send>() { }
 fn main() {
     is_send::<A>();
     //~^ ERROR overflow evaluating
-    //~^^ NOTE consider adding a `#![recursion_limit="20"]` attribute to your crate
-    //~^^^ NOTE required by `is_send`
-    //~^^^^ ERROR overflow evaluating
-    //~^^^^^ NOTE consider adding a `#![recursion_limit="20"]` attribute to your crate
-    //~^^^^^^ NOTE required by `is_send`
-    //~^^^^^^^ ERROR overflow evaluating
-    //~^^^^^^^^ NOTE consider adding a `#![recursion_limit="20"]` attribute to your crate
-    //~^^^^^^^^^ NOTE required by `is_send`
+    //~| NOTE consider adding a `#![recursion_limit="20"]` attribute to your crate
 }
index f3b5ccabe79eb7afef291eea61b5b03b2e599f17..253132e5f07d02ed93ea98fcb613cb440934a750 100644 (file)
@@ -24,6 +24,7 @@ impl<'a, T> X for B<'a, T> {}
 
 fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> {
     box B(&*v) as Box<X> //~ ERROR the parameter type `T` may not live long enough
+        //~^ ERROR the parameter type `T` may not live long enough
 }
 
 fn main() {}
index fc18095fc8336585a582c9e0d51edf0fa3ab340d..924044647d84a08473c547d8da2366d2bb8b34b6 100644 (file)
@@ -19,6 +19,7 @@
 fn make_object1<A:SomeTrait>(v: A) -> Box<SomeTrait+'static> {
     box v as Box<SomeTrait+'static>
         //~^ ERROR the parameter type `A` may not live long enough
+        //~^^ ERROR the parameter type `A` may not live long enough
 }
 
 fn make_object2<'a,A:SomeTrait+'a>(v: A) -> Box<SomeTrait+'a> {
@@ -28,6 +29,7 @@ fn make_object2<'a,A:SomeTrait+'a>(v: A) -> Box<SomeTrait+'a> {
 fn make_object3<'a,'b,A:SomeTrait+'a>(v: A) -> Box<SomeTrait+'b> {
     box v as Box<SomeTrait+'b>
         //~^ ERROR the parameter type `A` may not live long enough
+        //~^^ ERROR the parameter type `A` may not live long enough
 }
 
 fn main() { }
diff --git a/src/test/compile-fail/regions-trait-object-subtyping.rs b/src/test/compile-fail/regions-trait-object-subtyping.rs
new file mode 100644 (file)
index 0000000..8d05cb6
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Dummy { fn dummy(&self); }
+
+fn foo1<'a:'b,'b>(x: &'a mut (Dummy+'a)) -> &'b mut (Dummy+'b) {
+    // Here, we are able to coerce
+    x
+}
+
+fn foo2<'a:'b,'b>(x: &'b mut (Dummy+'a)) -> &'b mut (Dummy+'b) {
+    // Here, we are able to coerce
+    x
+}
+
+fn foo3<'a,'b>(x: &'a mut Dummy) -> &'b mut Dummy {
+    // Without knowing 'a:'b, we can't coerce
+    x //~ ERROR mismatched types
+     //~^ ERROR cannot infer
+}
+
+struct Wrapper<T>(T);
+fn foo4<'a:'b,'b>(x: Wrapper<&'a mut Dummy>) -> Wrapper<&'b mut Dummy> {
+    // We can't coerce because it is packed in `Wrapper`
+    x //~ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/src/test/compile-fail/trivial_casts.rs b/src/test/compile-fail/trivial_casts.rs
new file mode 100644 (file)
index 0000000..3119b86
--- /dev/null
@@ -0,0 +1,94 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test the trivial_casts and trivial_numeric_casts lints. For each error we also
+// check that the cast can be done using just coercion.
+
+#![deny(trivial_casts, trivial_numeric_casts)]
+
+trait Foo {
+    fn foo(&self) {}
+}
+
+pub struct Bar;
+
+impl Foo for Bar {}
+
+pub fn main() {
+    // Numeric
+    let _ = 42_i32 as i32; //~ ERROR trivial numeric cast: `i32` as `i32`
+    let _: i32 = 42_i32;
+
+    let _ = 42_u8 as u8; //~ ERROR trivial numeric cast: `u8` as `u8`
+    let _: u8 = 42_u8;
+
+    // & to * pointers
+    let x: &u32 = &42;
+    let _ = x as *const u32; //~ERROR trivial cast: `&u32` as `*const u32`
+    let _: *const u32 = x;
+
+    let x: &mut u32 = &mut 42;
+    let _ = x as *mut u32; //~ERROR trivial cast: `&mut u32` as `*mut u32`
+    let _: *mut u32 = x;
+
+    // unsize array
+    let x: &[u32; 3] = &[42, 43, 44];
+    let _ = x as &[u32]; //~ERROR trivial cast: `&[u32; 3]` as `&[u32]`
+    let _ = x as *const [u32]; //~ERROR trivial cast: `&[u32; 3]` as `*const [u32]`
+    let _: &[u32] = x;
+    let _: *const [u32] = x;
+
+    let x: &mut [u32; 3] = &mut [42, 43, 44];
+    let _ = x as &mut [u32]; //~ERROR trivial cast: `&mut [u32; 3]` as `&mut [u32]`
+    let _ = x as *mut [u32]; //~ERROR trivial cast: `&mut [u32; 3]` as `*mut [u32]`
+    let _: &mut [u32] = x;
+    let _: *mut [u32] = x;
+
+    let x: Box<[u32; 3]> = Box::new([42, 43, 44]);
+    let _ = x as Box<[u32]>; //~ERROR trivial cast: `Box<[u32; 3]>` as `Box<[u32]>`
+    let x: Box<[u32; 3]> = Box::new([42, 43, 44]);
+    let _: Box<[u32]> = x;
+
+    // unsize trait
+    let x: &Bar = &Bar;
+    let _ = x as &Foo; //~ERROR trivial cast: `&Bar` as `&Foo`
+    let _ = x as *const Foo; //~ERROR trivial cast: `&Bar` as `*const Foo`
+    let _: &Foo = x;
+    let _: *const Foo = x;
+
+    let x: &mut Bar = &mut Bar;
+    let _ = x as &mut Foo; //~ERROR trivial cast: `&mut Bar` as `&mut Foo`
+    let _ = x as *mut Foo; //~ERROR trivial cast: `&mut Bar` as `*mut Foo`
+    let _: &mut Foo = x;
+    let _: *mut Foo = x;
+
+    let x: Box<Bar> = Box::new(Bar);
+    let _ = x as Box<Foo>; //~ERROR trivial cast: `Box<Bar>` as `Box<Foo>`
+    let x: Box<Bar> = Box::new(Bar);
+    let _: Box<Foo> = x;
+
+    // functions
+    fn baz(_x: i32) {}
+    let _ = &baz as &Fn(i32); //~ERROR trivial cast: `&fn(i32) {main::baz}` as `&core::ops::Fn(i32)`
+    let _: &Fn(i32) = &baz;
+    let x = |_x: i32| {};
+    let _ = &x as &Fn(i32); //~ERROR trivial cast
+    let _: &Fn(i32) = &x;
+}
+
+// subtyping
+pub fn test_subtyping<'a, 'b: 'a>(a: &'a Bar, b: &'b Bar) {
+    let _ = a as &'a Bar; //~ERROR trivial cast
+    let _: &'a Bar = a;
+    let _ = b as &'a Bar; //~ERROR trivial cast
+    let _: &'a Bar = b;
+    let _ = b as &'b Bar; //~ERROR trivial cast
+    let _: &'b Bar = b;
+}
index 8ff514e04e360fbcef36cf6b39a4d61089b44214..8cc531625d17956c0d01223736884c2601774dc1 100644 (file)
@@ -20,7 +20,7 @@ fn add(&self, other: &i32) -> i32 { *self + *other }
 }
 
 fn main() {
-    let x = 5;
+    let x: i32 = 5;
     let y = x as MyAdd<i32>;
     //~^ ERROR as `MyAdd<i32>`
 }
index 92e6affa4c2027f4dd28f9fa80664a3c9cf96c73..93498ac7f83514c1768d1babc95dcd640c3435e2 100644 (file)
 struct S;
 
 impl FnMut<(isize,)> for S {
-    type Output = isize;
-
     extern "rust-call" fn call_mut(&mut self, (x,): (isize,)) -> isize {
         x * x
     }
 }
 
+impl FnOnce<(isize,)> for S {
+    type Output = isize;
+
+    extern "rust-call" fn call_once(mut self, args: (isize,)) -> isize { self.call_mut(args) }
+}
+
 fn call_it<F:Fn(isize)->isize>(f: &F, x: isize) -> isize {
     f.call((x,))
 }
@@ -33,5 +37,4 @@ fn call_it<F:Fn(isize)->isize>(f: &F, x: isize) -> isize {
 fn main() {
     let x = call_it(&S, 22);
     //~^ ERROR not implemented
-    //~| ERROR not implemented
 }
index 713b64b1349fcc5893ac455a2755aa9449a203ef..2dcd7a97d8977eec83fc37a53c8dd016bc3b31fa 100644 (file)
@@ -28,14 +28,19 @@ fn new(f: F) -> YCombinator<F,A,R> {
 }
 
 impl<A,R,F : FnMut(&mut FnMut(A) -> R, A) -> R> FnMut<(A,)> for YCombinator<F,A,R> {
-    type Output = R;
-
     extern "rust-call" fn call_mut(&mut self, (arg,): (A,)) -> R {
         (self.func)(self, arg)
             //~^ ERROR cannot borrow `*self` as mutable more than once at a time
     }
 }
 
+impl<A,R,F : FnMut(&mut FnMut(A) -> R, A) -> R> FnOnce<(A,)> for YCombinator<F,A,R> {
+    type Output = R;
+    extern "rust-call" fn call_once(mut self, args: (A,)) -> R {
+        self.call_mut(args)
+    }
+}
+
 fn main() {
     let mut counter = 0;
     let factorial = |recur: &mut FnMut(u32) -> u32, arg: u32| -> u32 {
index 23f7ee2b0101d78cca2d2db9fcaa4702ac8e33bd..dc7c70ba649d8b0524766893a060679a1714c511 100644 (file)
@@ -27,11 +27,15 @@ fn a() {
 }
 
 fn b() {
-    let y = call_it_mut(&mut square, 22); //~ ERROR not implemented
+    let y = call_it_mut(&mut square, 22);
+    //~^ ERROR not implemented
+    //~| ERROR not implemented
 }
 
 fn c() {
-    let z = call_it_once(square, 22); //~ ERROR not implemented
+    let z = call_it_once(square, 22);
+    //~^ ERROR not implemented
+    //~| ERROR not implemented
 }
 
 fn main() { }
index 40655f8a3cec4e0be973a4bc8cf76a2d2d0fd7b9..cdcb435b65a6acfcc8cdc3700d420022234385bb 100644 (file)
@@ -27,11 +27,15 @@ fn a() {
 }
 
 fn b() {
-    let y = call_it_mut(&mut square, 22); //~ ERROR not implemented
+    let y = call_it_mut(&mut square, 22);
+    //~^ ERROR not implemented
+    //~| ERROR not implemented
 }
 
 fn c() {
-    let z = call_it_once(square, 22); //~ ERROR not implemented
+    let z = call_it_once(square, 22);
+    //~^ ERROR not implemented
+    //~| ERROR not implemented
 }
 
 fn main() { }
index ebcbdbbc006df83585ba4d02dad8817285a1109d..150bf36dcc286db2befd582b8dd6fa055495e1b8 100644 (file)
@@ -28,11 +28,15 @@ fn a() {
 }
 
 fn b() {
-    let y = call_it_mut(&mut square, 22); //~ ERROR not implemented
+    let y = call_it_mut(&mut square, 22);
+    //~^ ERROR not implemented
+    //~| ERROR not implemented
 }
 
 fn c() {
-    let z = call_it_once(square, 22); //~ ERROR not implemented
+    let z = call_it_once(square, 22);
+    //~^ ERROR not implemented
+    //~| ERROR not implemented
 }
 
 fn main() { }
index 97e67cd2eae273b1e9b06c03ef53138059305e94..cac52306d6ae0e1a4d08dfd13763c4552f6099a7 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #14893. Tests that casts from vectors don't behave strangely in the
 // presence of the `_` type shorthand notation.
+// Update: after a change to the way casts are done, we have more type information
+// around and so the errors here are no longer exactly the same.
 
 struct X {
     y: [u8; 2],
@@ -18,12 +20,14 @@ struct X {
 fn main() {
     let x1 = X { y: [0, 0] };
 
-    let p1: *const u8 = &x1.y as *const _;  //~ ERROR mismatched types
+    // No longer a type mismatch - the `_` can be fully resolved by type inference.
+    let p1: *const u8 = &x1.y as *const _;
     let t1: *const [u8; 2] = &x1.y as *const _;
     let h1: *const [u8; 2] = &x1.y as *const [u8; 2];
 
     let mut x1 = X { y: [0, 0] };
 
+    // This is still an error since we don't allow casts from &mut [T; n] to *mut T.
     let p1: *mut u8 = &mut x1.y as *mut _;  //~ ERROR mismatched types
     let t1: *mut [u8; 2] = &mut x1.y as *mut _;
     let h1: *mut [u8; 2] = &mut x1.y as *mut [u8; 2];
index 24332e31775088b5901b5fa16aa11f78b42359ff..f150e84b9fdfecb5ded086e2d7ecc2b432b57f3d 100644 (file)
@@ -16,6 +16,7 @@
 #![allow(unused_variables)]
 #![allow(dead_code)]
 #![omit_gdb_pretty_printer_section]
+#![feature(std_misc, core)]
 
 // This test makes sure that the compiler doesn't crash when trying to assign
 // debug locations to const-expressions.
index 7cefb6044f64f257de3722343de6f09a8394cbc2..c161600f2c3c9d24f99c2822eea03481273d04b5 100644 (file)
@@ -17,6 +17,8 @@
 
 // compile-flags:-g
 
+#![feature(old_io)]
+
 // === GDB TESTS ===================================================================================
 
 // gdb-command:run
index 8d456f334323c5681157df3a29df3124687d3eff..99e31ab23021442ca93788b9e08c282abce0f912 100644 (file)
@@ -20,6 +20,8 @@
 
 // compile-flags:-g
 
+#![feature(old_io)]
+
 // === GDB TESTS ===================================================================================
 
 // gdb-command:rbreak immediate_args
index 14433fbcd23b3500de51f516d881aaea705ea328..8312d16bcac186136fc3d6714fb9de38e0ab8c53 100644 (file)
 // lldb-command:continue
 
 #![allow(unused_variables)]
+#![feature(old_io)]
 #![omit_gdb_pretty_printer_section]
 
 fn immediate_args(a: int, b: bool, c: f64) {
index a079ddbd0f507e7c1ab1d09340c8644c7a0239e8..38b149ef243e9fbfe6b2ef0146abccffcdfbd926 100644 (file)
@@ -11,6 +11,9 @@
 // min-lldb-version: 310
 
 // aux-build:issue13213aux.rs
+
+#![feature(old_io)]
+
 extern crate issue13213aux;
 
 // compile-flags:-g
index 12c7b146342ffed60f82ab6ddfb25bdb645b419b..16ae83ee8dc2b0e630b91f1f93d643bfb2d9b025 100644 (file)
@@ -42,6 +42,7 @@
 
 #![allow(unused_variables)]
 #![omit_gdb_pretty_printer_section]
+#![feature(core)]
 
 use std::simd::{i8x16, i16x8,i32x4,i64x2,u8x16,u16x8,u32x4,u64x2,f32x4,f64x2};
 
index bf26fc23d3c16a1607af005ebe04e6cb26aad378..d4cbd255e34c2861bcc35fee75c15dc6134a9038 100644 (file)
@@ -291,15 +291,15 @@ fn main() {
     let slice2 = &*vec2;
 
     // Trait Objects
-    let box_trait = (box 0) as Box<Trait1>;
-    let ref_trait = &0 as &Trait1;
-    let mut mut_int1 = 0;
+    let box_trait = (box 0_isize) as Box<Trait1>;
+    let ref_trait = &0_isize as &Trait1;
+    let mut mut_int1 = 0_isize;
     let mut_ref_trait = (&mut mut_int1) as &mut Trait1;
 
-    let generic_box_trait = (box 0) as Box<Trait2<i32, Mod1::Struct2>>;
-    let generic_ref_trait  = (&0) as &Trait2<Struct1, Struct1>;
+    let generic_box_trait = (box 0_isize) as Box<Trait2<i32, Mod1::Struct2>>;
+    let generic_ref_trait  = (&0_isize) as &Trait2<Struct1, Struct1>;
 
-    let mut generic_mut_ref_trait_impl = 0;
+    let mut generic_mut_ref_trait_impl = 0_isize;
     let generic_mut_ref_trait = (&mut generic_mut_ref_trait_impl) as
         &mut Trait2<Mod1::Mod2::Struct3, GenericStruct<usize, isize>>;
 
diff --git a/src/test/parse-fail/obsolete-for-sized.rs b/src/test/parse-fail/obsolete-for-sized.rs
deleted file mode 100644 (file)
index 1b86d08..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test that we generate obsolete syntax errors around usages of `for Sized?`
-
-trait Foo for Sized? {} //~ ERROR obsolete syntax: for Sized?
-
-trait Bar for ?Sized {} //~ ERROR obsolete syntax: for Sized?
-
-fn main() { }
index d148bb15e99bc8d13e5c99408536a88f9d4be35a..509bee9def2731e2d65023c0fd98e1a4d35af415 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(optin_builtin_traits)]
+#![feature(optin_builtin_traits, core)]
 
 // pp-exact
 
index 0a20300e4f4de797ebe8dbd3eccba7fd3ed28547..42b2fe806e95f605bbd91febc4a4737d8fa117e4 100644 (file)
@@ -21,5 +21,5 @@ fn foo<'a>(x: Box<Tr+ Sync + 'a>) -> Box<Tr+ Sync + 'a> { x }
 fn main() {
     let x: Box<Tr+ Sync>;
 
-    Box::new(1) as Box<Tr+ Sync>;
+    Box::new(1isize) as Box<Tr+ Sync>;
 }
index 127700e963abd5a661680bb7175734bea154d7c1..bddab59e3e4c52eeeb03c12cead341923b7a8090 100644 (file)
@@ -12,6 +12,7 @@
 // error-pattern:explicit failure
 // Testing that runtime failure doesn't cause callbacks to abort abnormally.
 // Instead the failure will be delivered after the callbacks return.
+#![feature(std_misc, libc)]
 
 extern crate libc;
 use std::task;
index fd7c3f8cc0e4b346713e2854ff1d97d8ea09402d..0e72ab22dc8f9822af338157534d1b744d1d2d06 100644 (file)
@@ -10,6 +10,8 @@
 
 // error-pattern:whatever
 
+#![feature(os, rustc_private)]
+
 #[macro_use] extern crate log;
 use std::os;
 
index fb1e03c234d76a3fafe2ecb151ab2d82b54e65d9..2498b7c2be4e7fa00450643109175dfcf5a3521c 100644 (file)
@@ -10,6 +10,8 @@
 
 // error-pattern:whatever
 
+#![feature(os, rustc_private)]
+
 #[macro_use] extern crate log;
 use std::os;
 use std::thread;
index 39ece8a464a6fe8c77600ca6f9eacab0cb27196b..9425a1b1902b51aa3683b3637d9a37d6ad0340e4 100644 (file)
@@ -10,6 +10,8 @@
 
 // error-pattern:whatever
 
+#![feature(rustc_private, os)]
+
 #[macro_use] extern crate log;
 use std::os;
 
index fb23a214016a7ec41df3389036b118300d6d2410..a36cc474c2bf052054aa6614b805302073987703 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(test_feature)]
+
 extern crate bar;
 
 pub fn main() { bar::baz() }
index fd69d2786b8d0800adb74bc000a7b73b638e1c0f..02af5244b8aabe93cf4e7f208e8d51957b2f506a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(old_io, old_path)]
+
 use std::env;
 use std::fs::File;
 use std::process::Command;
index 86eed9dbe0a92e1ae9a151d137496261a68ced11..2e1fad5a044f6a5998f16efafab1cf119d0eef32 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc, old_path, os)]
+
 use std::dynamic_lib::DynamicLibrary;
 use std::os;
 use std::old_path::Path;
index 835e068c15cfd2b468e3d851a069de3f692f7d67..aec76fdf1b2c0b164164c1facc5638013091165e 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(asm)]
+#![feature(asm, core)]
 #![crate_type="lib"]
 
 use std::intrinsics;
index 1ed816ed7290a87645737874135e5a3169a04de4..0d42e0be58d0702edccef3084d2cd87cc685aa97 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(rustc_private, path, convert)]
+
 extern crate rustc;
 extern crate rustc_driver;
 extern crate rustc_lint;
@@ -31,9 +33,9 @@ fn main() {}
         panic!("expected rustc path");
     }
 
-    let tmpdir = PathBuf::new(&args[1]);
+    let tmpdir = PathBuf::from(&args[1]);
 
-    let mut sysroot = PathBuf::new(&args[3]);
+    let mut sysroot = PathBuf::from(&args[3]);
     sysroot.pop();
     sysroot.pop();
 
index cd286af602a70c36856faf30947b3ec046c0372d..b1576ccd48e9f04af52a43c2923438141a198a90 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(libc, os)]
+
 extern crate libc;
 
 #[link(name="foo")]
index a38b2cfb9628772d560e5b4703d021578b196551..c9395f557fd4f7ec9007bbf8cf6fa6ba66043a56 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(rustc_private)]
+
 extern crate lib;
 #[macro_use] extern crate log;
 
index 0bec6148189a908ea43df5f599c278c5f76236db..29f52f97a88878f0b8c8ab821ff683ac32b3578b 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(lang_items, no_std)]
+#![feature(lang_items, no_std, libc)]
 #![no_std]
 #![crate_type = "dylib"]
 
index 9e8afdc5696ed6dd604cd78a4acc655ad207517d..ae424c6569dbe3f976c61522148dbd0c92738957 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(lang_items, no_std)]
+#![feature(lang_items, no_std, libc)]
 #![no_std]
 #![crate_type = "dylib"]
 
index 08f3bd10e74a716c05b1699be930e7d698b3db0c..8f11629be6cc83c054a577b22e3618b00e05112b 100644 (file)
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(optin_builtin_traits)]
+#![feature(core)]
+
 pub mod bar {
     use std::marker;
 
index 2e2b8d2578eaf88384f98bb786cc93769aaf572a..74251c3c63e91d25af64d30506c69824cd3d3936 100644 (file)
@@ -10,7 +10,7 @@
 
 #![ crate_name = "test" ]
 #![allow(unstable)]
-#![feature(box_syntax)]
+#![feature(box_syntax, old_io, rustc_private, core)]
 
 extern crate graphviz;
 // A simple rust project
index f81d4803f8fa491f686137f91f428b85dc5e507a..474a6782b616b3af1ea845be56b948c662cda0b6 100644 (file)
@@ -16,5 +16,5 @@ impl Foo for uint {}
 
 pub fn dummy() {
     // force the vtable to be created
-    let _x = &1 as &Foo;
+    let _x = &1u as &Foo;
 }
index 1826e035e245805964bf7ec8bc91d02ee85d4cb7..aa2ce785771211f3875fa326644030f1b0c0842e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(rand)]
+
 use std::fs::File;
 use std::io::prelude::*;
 use std::path::Path;
index 9ed20ccaea5c97c07dffc6abf6a60c2d1f759e5d..ebf3226334cc6573635b0a8c1a96ff94bcb63c3f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(rand, core)]
+
 use std::fs::File;
 use std::io::prelude::*;
 use std::iter::repeat;
index 6dffb53e4a319754c20e37b14992f6f887284cac..bdd557b6cc27b4e604fb172875287d672104cbee 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(core)]
+
 use std::intrinsics::{volatile_load, volatile_store};
 
 pub fn main() {
index 8492424a1457a0d6ac62eb896cd51d8030b63a50..7a3c32a45f912c6388b8d1279338c8d4885d4cf5 100644 (file)
@@ -12,7 +12,7 @@
 
 // ignore-android
 
-#![feature(rustc_private)]
+#![feature(rustc_private, path)]
 #![feature(core)]
 
 extern crate getopts;
index 9e3ad8ee283e8c6db318219d9ed1502b2eeca816..40947b2e25652fd3e494fe91309a0110bfdfb1c6 100644 (file)
@@ -11,7 +11,7 @@
 // ignore-pretty
 // ignore-android
 
-#![feature(quote)]
+#![feature(quote, rustc_private)]
 
 extern crate syntax;
 
index aeb6a89a98ea6e2c50030096399f7546c5b1ffec..d4dc5627044dbd1be9dcff522e07581e4da45225 100644 (file)
@@ -11,7 +11,7 @@
 // ignore-android
 // ignore-pretty: does not work well with `--test`
 
-#![feature(quote)]
+#![feature(quote, rustc_private)]
 
 extern crate syntax;
 
index 020f5f562d2c3cd8cd83d62adf1a6e9b3fd58bcd..0e2e1f2dd86d6f1fe7b37f4327c7e14beefbb776 100644 (file)
@@ -11,7 +11,7 @@
 // ignore-android
 // ignore-pretty: does not work well with `--test`
 
-#![feature(quote)]
+#![feature(quote, rustc_private)]
 
 extern crate syntax;
 
index 848ea738ed7d54c7a3d78e8f591e9c25c16ad714..928368fabdf3684dde673bca6478dce74e612d05 100644 (file)
@@ -11,7 +11,7 @@
 // ignore-android
 // ignore-pretty: does not work well with `--test`
 
-#![feature(quote)]
+#![feature(quote, rustc_private)]
 #![deny(unused_variable)]
 
 extern crate syntax;
index b7570eb09261286a84f9830a5fe7066bf1464639..23096828c4b95be06ab2da1b25bff3b4aaa89624 100644 (file)
@@ -12,7 +12,7 @@
 // aux-build:syntax_extension_with_dll_deps_2.rs
 // ignore-stage1
 
-#![feature(plugin)]
+#![feature(plugin, rustc_private)]
 #![plugin(syntax_extension_with_dll_deps_2)]
 
 fn main() {
index 127be1f90d5ff08fc5ed5a5ffa7d625fd0dca84f..301c4b917816a8e1c8dec09a0a4a914a7eb5d623 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(old_io, io)]
+
 fn main() {
     let _ = std::old_io::stdin();
     let _ = std::io::stdin();
index 45dd213d71fefffee006e2e04bdf9b06176c2297..f6ff0415259af06782de1001a72693bb095f9c70 100644 (file)
@@ -12,6 +12,8 @@
 
 // Regression test for issue #374
 
+// pretty-expanded FIXME #23616
+
 enum sty { ty_nil, }
 
 struct RawT {struct_: sty, cname: Option<String>, hash: uint}
index c356d1d527e5e4e3bd453696f24988273a2b5a71..cd649310ae78406f12d0748f01693cf2e56e87d3 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 enum option<T> { some(T), none, }
 
 struct R<T> {v: Vec<option<T>> }
index 0ef666031114eacaae619625919022eb65fdaf95..b40774e2be82fcff268e35176eb9426b36907fa0 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:anon-extern-mod-cross-crate-1.rs
+// pretty-expanded FIXME #23616
+
 extern crate anonexternmod;
 
 use anonexternmod::rust_get_test_int;
index 78e1cdabb47486c683a9e43704e473a1f9fde484..e96b0cc1442c64ee33556d1bf1baeca09c3f4cbd 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 extern crate libc;
 
 #[link(name = "rust_test_helpers")]
index dfce311529028c49d02e0ff9a62afe770e50e9ea..2428d45256d518b4a0561e8ff7f55b619aab61b1 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 struct X {
     x: int
 }
index 70df6e46e59d7c4c115214193bdaf126cb12cd55..08412d1296cfc071b7440203b2ef50a2c6695d18 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let i32_c: int = 0x10101010;
     assert!(i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3) ==
index 43288d9044ec5c7b0a5513544441048ed3873bf7..8a0fc8adc189574d323684769e197ac2647b9dab 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(type_limits)]
 
 // Unsigned integer operations
index 7bc1354c3cefe9ee817e8e401dc47c2e6cffd94a..422816079d62c6ac4eb6e540c87cdcc67902b930 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn f() -> int { { return 3; } }
 
 pub fn main() { assert!((f() == 3)); }
index de294f88a4c9b24cec6a639f7c15d5644c646b74..ec89e2b3ee288437e5fb780a967e583a0785c5a6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     assert_eq!(3 as uint * 3, 9);
     assert_eq!(3 as (uint) * 3, 9);
index 9df96b35ce1b40bbfb2f923d9a4b8b3dbcdc6a47..716c3d47a0365a2fb8410be081464a8fe3413dbf 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(asm)]
 
 pub fn main() {
index 3ac8e4d0ee9ca846ad4b4388aa734fec1148de39..6aeadbe203e182f20414f4e8ed37b8401fb53b75 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(asm)]
 
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
index 0f6fec133d1ce1985aaaac5159eb9eecd7c7979f..7b1548a8d4f6118a7bddd93c08bb0ee59c43c67f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(asm)]
 
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
index 0f5d27015fb747a7709a6b3b908eeccf5a11eecb..5d93388f7f4fee8fd639ec1a1f41a24ca48a1166 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // Issue 483 - Assignment expressions result in nil
+// pretty-expanded FIXME #23616
+
 fn test_assign() {
     let mut x: int;
     let y: () = x = 10;
index 57c50511604ca3f095418cac0f56ca53e264191a..4b22f84f78d12800b42f6b90eb639559772e3ff7 100644 (file)
@@ -12,6 +12,8 @@
 // making method calls, but only if there aren't any matches without
 // it.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 trait iterable<A> {
index f5521f7da853bd025b017cac1cf7a3a4d8c463fd..853b56ffb0c2ea34a0fd916058c363e912f754b6 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::marker::MarkerTrait;
 
 trait Foo : MarkerTrait {
index b47b0109bdf39220700753aed82820fb24a025e0..39fc224148e8ed7d8f3403c1e0d044ba4018ca35 100644 (file)
@@ -11,6 +11,8 @@
 // Test a case where the associated type binding (to `bool`, in this
 // case) is derived from the trait definition. Issue #21636.
 
+// pretty-expanded FIXME #23616
+
 use std::vec;
 
 pub trait BitIter {
index c6c66f1c75c5432d477fdf980389b348a4bf38e4..87eeb23b7a3f37e0fcee111068af0dea7440072e 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test equality constraints on associated types in a where clause.
 
+// pretty-expanded FIXME #23616
+
 pub trait Foo {
     type A;
     fn boo(&self) -> <Self as Foo>::A;
index 9f97d69ce3f9b6b1b6a5b519ad977eb4f584b6ee..2301821f66358fe58a488d5e6c9284b8034533ad 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test equality constrai32s on associated types in a where clause.
 
+// pretty-expanded FIXME #23616
+
 pub trait ToI32 {
     fn to_i32(&self) -> i32;
 }
index aa65b0ed10bafe93e5521d26a074cbf801a9f25d..1a8da6755588be0e41cb3f3f5e4551293dbce350 100644 (file)
@@ -14,6 +14,8 @@
 // `Target=[A]`, then the impl marked with `(*)` is seen to conflict
 // with all the others.
 
+// pretty-expanded FIXME #23616
+
 use std::marker::PhantomData;
 use std::ops::Deref;
 
index 299225e3a47b97ea527dc0a1e2c0d1c8d01c0311..b53e69e8d9d16603b9956db33d65fd0b5de92aa5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait SignedUnsigned {
     type Opposite;
     fn convert(self) -> Self::Opposite;
index 941e9a84538025b34d0b0b3e030cee1d90449a7a..7354ae67addc4d32aee8441cf7d4c0321fbd71e3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 8b7ea61dc77e9cec9d560c2ea9f88485bf955a91..8ca3bc02548346864635ee80deac399b3ce64ef3 100644 (file)
@@ -12,6 +12,8 @@
 // (modulo bound lifetime names) appears in the environment
 // twice. Issue #21965.
 
+// pretty-expanded FIXME #23616
+
 fn foo<T>(t: T) -> i32
     where T : for<'a> Fn(&'a u8) -> i32,
           T : for<'b> Fn(&'b u8) -> i32,
index 62ac21879520bf324e29fa056a0a6cb4e144672d..5878f5dd51b2a213ae5d497d572f8507965c6941 100644 (file)
@@ -11,6 +11,8 @@
 // Check that we do not report ambiguities when the same predicate
 // appears in the environment twice. Issue #21965.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     type B;
 
index a499aa6733aae0783532874e7292b1c91db1263d..8cf97fe62fea50639b7754502e8b48cb7d5179d6 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test associated types appearing in struct-like enum variants.
 
+// pretty-expanded FIXME #23616
+
 use self::VarValue::*;
 
 pub trait UnifyKey {
index e710c53327ec76840697ba206a91c28b4af6803c..3c57da6b4a3ebee8bcee6ad51129b71c4067c3eb 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test associated types appearing in tuple-like enum variants.
 
+// pretty-expanded FIXME #23616
+
 use self::VarValue::*;
 
 pub trait UnifyKey {
index 901b3c0d96b010c78b50cd1c8f6ddfc797968722..feccd1d2dcec0daf2ca82cf80511b67b8aaf1b17 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test equality constraints on associated types inside of an object type
 
+// pretty-expanded FIXME #23616
+
 pub trait Foo {
     type A;
     fn boo(&self) -> <Self as Foo>::A;
index 0ae61037154728837200000a2174cbc53e907154..5bf10ae132cc52308ec622f91074c84f9575b970 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Get {
     type Value;
     fn get(&self) -> &<Self as Get>::Value;
index 4104f520a0c5d714827f33f6cd384c9aedfafa3e..4d286a4f9a48753c1597b07ac0ff017cad7f3047 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Get {
     type Value;
     fn get(&self) -> &<Self as Get>::Value;
index 59f05e1184285c531c284be909093d127822a38b..41c53a5ad641090a8b23755715fe0854ff55163c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Get {
     type Value;
     fn get(&self) -> &<Self as Get>::Value;
index 951497709fd69955e6c7408b4f2f38e27bf12a51..7b8b041e7ef679ac5a85cff57662d94c22c66682 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Get {
     type Value;
     fn get(&self) -> &<Self as Get>::Value;
index a253fbde5633f112d400adf95e997a5149f1c36d..718ea542799bbdb62ccd5e61a6298ebbffdd52a3 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test references to `Self::Item` in the trait. Issue #20220.
 
+// pretty-expanded FIXME #23616
+
 use std::vec;
 
 trait IntoIteratorX {
index 40ef7f3531cb5caf17247568f52fbc1ccd8a1de0..562deba4d9301c8b759b058d714c71ab251b250b 100644 (file)
 // Test that we are able to have an impl that defines an associated type
 // before the actual trait.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::marker::MarkerTrait;
 
 impl X for f64 { type Y = int; }
index 3c91577362a7d4a27657ff5ebb20a72fa4990478..057677a008785f11fe8ed4c25753e63f78ae6d5b 100644 (file)
@@ -13,6 +13,8 @@
 // where clauses in the environment which in turn required normalizing
 // `Self::Input`.
 
+// pretty-expanded FIXME #23616
+
 pub trait Parser {
     type Input;
 
index f8258466a7d43d529d534b89e42c0297e67789a3..56e39a4450221084291cae3356577ade8e0740e8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn pairwise_sub<T:DoubleEndedIterator<Item=int>>(mut t: T) -> int {
     let mut result = 0;
     loop {
index 2ee8ef0d3ddac5a51267efcc4226697cf639bb28..a26b428a4eacf2db945eb1b0654ff920bc31b996 100644 (file)
 
 // Test that we can resolve nested projection types. Issue #20666.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::marker::MarkerTrait;
 use std::slice;
 
index de96af83f59171e040223af451d43f71d59b8f0d..d95ad2e883471dacb595f5db819e22428758ff6f 100644 (file)
@@ -11,6 +11,9 @@
 // Test that we normalize associated types that appear in a bound that
 // contains a binding. Issue #21664.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
 #![allow(dead_code)]
 
 use std::marker::MarkerTrait;
index 8617750ca538ea02472b33bd0e77781960fba9df..d8e4c5218d9cf68dbb9972267e5a56b4a0630cfb 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we normalize associated types that appear in bounds; if
 // we didn't, the call to `self.split2()` fails to type check.
 
+// pretty-expanded FIXME #23616
+
 use std::marker::PhantomData;
 
 struct Splits<'a, T:'a, P>(PhantomData<(&'a T, P)>);
index 94cfcb83653812347657560b6d6654cf16b65116..ff08e7b69bdd87ab524fa3e7c345fef254c4b23e 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we normalize associated types that appear in bounds; if
 // we didn't, the call to `self.split2()` fails to type check.
 
+// pretty-expanded FIXME #23616
+
 use std::marker::PhantomData;
 
 struct Splits<'a, T, P>(PhantomData<(&'a(),T,P)>);
index 2288e19aae0bceaaa59131547736cc9cc3653fc9..82adac8cf861484e867cb47d0263ece060527b1c 100644 (file)
@@ -12,6 +12,8 @@
 // various special paths in the `type_is_immediate` function.
 
 
+// pretty-expanded FIXME #23616
+
 pub trait OffsetState: Sized {}
 pub trait Offset {
     type State: OffsetState;
index 2243e00ffa1604be0dbbc724ed0c1fbbe7e60f98..151a9da948e832c5cf0d62c0fe0f79f5bb85cd92 100644 (file)
 // `Item` originates in a where-clause, not the declaration of
 // `T`. Issue #20300.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::marker::{MarkerTrait, PhantomData};
 use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT};
 use std::sync::atomic::Ordering::SeqCst;
index c65d2db9b0cf0f3125849028aae506a4680827af..2518ccf1cb47430076f854d7fa2e854e6283f03f 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test where the impl self type uses a projection from a constant type.
 
+// pretty-expanded FIXME #23616
+
 trait Int
 {
     type T;
index a9c34a605ce163a5f2cfb842929ad6a3a7ce249d..3b146792fdaded965b7873c9e919a9b471f31364 100644 (file)
@@ -13,6 +13,8 @@
 // appear in associated type bindings in object types, which were not
 // being properly flagged.
 
+// pretty-expanded FIXME #23616
+
 use std::ops::{Shl, Shr};
 use std::cell::RefCell;
 
index 4d2358fae27b183f3440d83020b21563e4ee9139..dbc2164c93a69c32c0989f96eb88ec18ed63bbe6 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we are handle to correctly handle a projection type
 // that appears in a supertrait bound. Issue #20559.
 
+// pretty-expanded FIXME #23616
+
 trait A
 {
     type TA;
index 3f3f4fbd1d628f46489096157ad484eb17cc8642..80e3aa09e3e613e614c28d6f36ed2a44e4ffb3ea 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test a where clause that uses a non-normalized projection type.
 
+// pretty-expanded FIXME #23616
+
 trait Int
 {
     type T;
index abbde16faefca14ffa4d81a441ad1cf9ba037c82..a69de216ab997dbca06d8222b932ed258ef66be7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo<T> {
     type Bar;
     fn get_bar() -> <Self as Foo<T>>::Bar;
index 3c7cc7c4975344f173fb7b0594199df53182d533..ce09ec60bd6a52ba29ff76b0d4e63a9ed1499c09 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test associated type references in structure fields.
 
+// pretty-expanded FIXME #23616
+
 trait Test {
     type V;
 
index 67fe11d8feddec9cb3bd23833826746d2ce2b96b..30b3871522cb2317557e1d26a1d09aac0723bf7c 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test associated type references in a struct literal. Issue #20535.
 
+// pretty-expanded FIXME #23616
+
 pub trait Foo {
     type Bar;
 
index 03ab8f7e43136910ef3a75cb2672a875af6da184..16e49f146ab557b24d8c2047256b5f4eaf998e90 100644 (file)
@@ -11,6 +11,8 @@
 // Regression test for #20582. This test caused an ICE related to
 // inconsistent region erasure in trans.
 
+// pretty-expanded FIXME #23616
+
 struct Foo<'a> {
     buf: &'a[u8]
 }
index a4b0b1a6e03af4281e88164f7b91e238250438e3..1ce4d6e341de2e581f85a688fc98fce20792378d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Get<T> {
     fn get(&self) -> T;
 }
index e7ab910bc95088e8427ba9d56adb204bac81c020..87043b833fd8f177aaf910d97bdfe3c8f7b0351f 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test equality constraints on associated types in a where clause.
 
+// pretty-expanded FIXME #23616
+
 pub trait Foo {
     type A;
     fn boo(&self) -> <Self as Foo>::A;
index 9e388dc3d347e7932e2cb7fcdd589dba8c0760a7..4c9deab45112606dfd8c0959dabe8b8c39f04699 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Get {
     type Value;
     fn get(&self) -> &<Self as Get>::Value;
index ef7fbe87b304744dd51ce8791b9783ae8433c48e..a2b7cf2106eb7af89dff81498ad27b6f3be80d73 100644 (file)
@@ -11,6 +11,8 @@
 // Test references to the trait `Stream` in the bounds for associated
 // types defined on `Stream`. Issue #20551.
 
+// pretty-expanded FIXME #23616
+
 trait Stream {
     type Car;
     type Cdr: Stream;
index a63274beb0ebb32a6b2edd7887a535dca66d766d..d1872e4fb55f4c86abc2352dfcf58a82fd1c5724 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we correctly normalize the type of a struct field
 // which has an associated type.
 
+// pretty-expanded FIXME #23616
+
 pub trait UnifyKey {
     type Value;
 
index 3be2623185bcdadd43c2579933a51d9c17571065..3d97c503dca5f94848f7dbd8569934e7085e11dd 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we correctly normalize the type of a struct field
 // which has an associated type.
 
+// pretty-expanded FIXME #23616
+
 pub trait UnifyKey {
     type Value;
 
index 7e7299961d8a889659676ad6be2df1f30fd6c04a..f8eff2f22fe3c0cb31be3c19a697850dfedec16f 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test paths to associated types using the type-parameter-only sugar.
 
+// pretty-expanded FIXME #23616
+
 pub trait Foo {
     type A;
     fn boo(&self) -> Self::A;
index 0c6d91eda26af4ba9055beb05ea81b3da39c7d74..ef2dc48fe136474ae438f83e36b4e50f95ae8236 100644 (file)
@@ -13,6 +13,8 @@
 // carries a predicate that references the trait (`u32 : Trait1`,
 // substituted).
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 trait Trait1 : Trait2<SomeType<u32>> {
index 951a716879fce782c8f45effa67497ced90d438f..cdd1b96de1e6081e14f965d594457a9a6c847a2b 100644 (file)
@@ -10,7 +10,9 @@
 
 // error-pattern:expected item
 
-#![feature(custom_attribute)]
+// pretty-expanded FIXME #23616
+
+#![feature(custom_attribute, test)]
 
 #[foo = "bar"]
 extern crate test;
index ad8ce608bd05dcb30fe4f6067c5f93558cac8798..cd02b5a9e73109498a2ba5ff438371facffd170f 100644 (file)
@@ -10,7 +10,9 @@
 
 // error-pattern:expected item
 
-#![feature(custom_attribute)]
+// pretty-expanded FIXME #23616
+
+#![feature(custom_attribute, test)]
 
 mod m {
     #[foo = "bar"]
index fd0ae0729af2540fc69099043a1655eb0188c76a..4680f47fad6ce30e05e48f4edcf32ac49d9e7873 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(main)]
 
 pub fn main() {
index 29b504bed535d5af4a831fe7eefe53ad92aa29ae..e8a12ee3ac79161816a23f8460fd39c9fbcfb2b5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(main)]
 
 #[main]
index 7980937ce2a159f84aa129871dbeb59b183906c1..bcfb4b330f5eda6ff3e46578601fb2eb40f47a2e 100644 (file)
@@ -7,6 +7,8 @@
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
+// pretty-expanded FIXME #23616
+
 #![allow(unused_attribute)]
 #![feature(custom_attribute)]
 
index bd799917842b124881ebc58b2c95fd5b1c66a5b9..f135762d28327910ee7fb25cc304696f303853cd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 #![feature(unsafe_no_drop_flag)]
 
index 2bf09404200a54e180ac54cdec6a99db05266457..08dce42c05b3ec757f7791519467cc02e1e46d32 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(start)]
 
 #[start]
index 129d69b6e67ccd85851966bcd156dd910ee1fcbe..57e1b38c9c1664e133ab750c8d0a5eba586919d4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(main)]
 
 #[main]
index 2cc7451e138944c27b371b27bf34a5c3ebd8dbe3..2e79183755a18094395ab9dcd414d4d8a1ddab75 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let mut sum = 0;
     let xs = vec!(1, 2, 3, 4, 5);
index d2e9bc2efe7279c10a0a00d7c25b6b1522aea5d1..6dab0e51971382a29ab7f1d3219632454a275779 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 trait Pushable<T> {
     fn push_val(&mut self, t: T);
 }
index ed471ed0079e3c5cd21166e7fbd7e47c397ffb9a..cf3b7d41b3a65e71a0ef76950ac350eeddd89eb1 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn f<T>(x: Vec<T>) -> T { return x.into_iter().next().unwrap(); }
 
 fn g<F>(act: F) -> int where F: FnOnce(Vec<int>) -> int { return act(vec!(1, 2, 3)); }
index fc643ec594089a4cc62f9eca2343f6e4afc6ee01..6d7e150093e2cd9e7ca4d5dd0bf3d900bbfff54b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo {
     x: int,
 }
index 6a90fa47e58ff84733d521ef50e7319535b37d78..0bec3af4273afad2819f79523f6bba194425dae8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
@@ -20,6 +22,6 @@ fn double(self: Box<uint>) -> uint { *self * 2 }
 }
 
 pub fn main() {
-    let x: Box<_> = box() (box 3 as Box<double>);
+    let x: Box<_> = box() (box 3u as Box<double>);
     assert_eq!(x.double(), 6);
 }
index cadce45b18d026041d76e45462e12f4ae6afb6bb..bab0403e79dc1079d2bb1340d85ba5bd9aa59fdb 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 746107803c90d0dc1dddede22ee9151509205a97..e9f70346089a528e4aa93ecc950b77b8d32bacb1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 51b5c98816a2c447c7157ea3ba89936cd35e6421..7558733adf1d2f42dc6651608e463f06a4d26684 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 61e704276af31c984084716b9ce0b4e9ee6184c3..1754a3707681598b8a4f1299ab1617e52d3f2d1c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 86d6a91e75b7613273ac58b6e982153efad7bb04..37ba355956c309e08d289fa42c90408bdfdf36a2 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 879b3e920ab96ba067ed9f3c8e9ee6e83b8cc974..226a7c12df9ab4a1d6689fec169a2b7eeb1ab231 100644 (file)
@@ -12,7 +12,7 @@
 // ignore-windows FIXME #13259
 
 #![feature(unboxed_closures)]
-#![feature(unsafe_destructor)]
+#![feature(unsafe_destructor, old_io, collections)]
 
 use std::env;
 use std::old_io::process::Command;
index 01ac2fc20bffe1ebb3f918dad124e60f5cf98c4d..09746380ebab029d90d75a79276e7f3edaab56d6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     assert_eq!(0xffffffff, (-1 as u32));
     assert_eq!(4294967295, (-1 as u32));
index dc3b142f233762d22a6973ae01195c2379ff517d..1fe9dde844a4fe4602884c40460c6604cad837fb 100644 (file)
@@ -10,6 +10,8 @@
 
 // Check that issue #954 stays fixed
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     match -1 { -1 => {}, _ => panic!("wat") }
     assert_eq!(1-1, 0);
index a9fa8449d0f1ac654474da7fac604d30f43ac048..5a6e801501fcfc1f2ac3b9ef5e660ae35fe11a8b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::Arc;
 fn dispose(_x: Arc<bool>) { }
 
index 470577d729730de9deac00676840a97c8c772275..c7b770d0a2b639f031ae2d4618bbec61a4496de2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     struct Foo { x: int, y: int }
     let mut f = Foo { x: 10, y: 0 };
index e6982949501c2464a75ec387f078c11786456e2c..c9a2e07dd8398eb3a1445f7ca5136e64e3d86792 100644 (file)
@@ -8,8 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, collections)]
 
 extern crate collections;
 use std::collections::BitVec;
index 80c73e5e60b53ffe8a77023e911942a3f4939c81..b1d6f96f0f6d45d5de8fb9fd4073a22423cf6872 100644 (file)
@@ -11,6 +11,8 @@
 // aux-build:blind-item-mixed-crate-use-item-foo.rs
 // aux-build:blind-item-mixed-crate-use-item-foo2.rs
 
+// pretty-expanded FIXME #23616
+
 mod m {
     pub fn f<T>(_: T, _: (), _: ()) { }
     pub fn g<T>(_: T, _: (), _: ()) { }
index a3dad01acf17b6c6a3eeb2dec84a9ea1ee959fe2..6244ba6fccf0b09bb21e19b7252a90d0eb9e28ec 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod m {
     pub fn f<T>(_: T, _: ()) { }
     pub fn g<T>(_: T, _: ()) { }
index 8be6d1bd35ae81f48ac80690dac90d02472ccaa6..a745e52efeb17a3ef32238cc4fe28403052fdba2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn asBlock<F>(f: F) -> uint where F: FnOnce() -> uint {
    return f();
 }
index ace372dd2d3d9346d8db8a084044689c2ad44199..01bd8ce10cd095aa672769bf62b7f5f1522020eb 100644 (file)
@@ -13,6 +13,8 @@
 
 // no-reformat
 
+// pretty-expanded FIXME #23616
+
 /*
  *
  *  When you write a block-expression thing followed by
index f3c874a5afcec13b801d006a754704754ea55b32..059f4e3749407b0e650887fb08fb6ff88c9f5864 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn force<F>(f: F) -> int where F: FnOnce() -> int { return f(); }
 
 pub fn main() {
index e98087810b2a42d4f92aa1d4269e237c49f0bd5e..c46684af6efda630afeeda4db3896e405482ef53 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     if !false { assert!((true)); } else { assert!((false)); }
     if !true { assert!((false)); } else { assert!((true)); }
index edf6b397ff8c8c7703a3a1bb1ade80ba8b41a9f8..a2b19d32054a5561c37804de7fd551f8d50f3f7f 100644 (file)
@@ -10,6 +10,8 @@
 
 // Basic boolean tests
 
+// pretty-expanded FIXME #23616
+
 use std::cmp::Ordering::{Equal, Greater, Less};
 use std::ops::{BitAnd, BitOr, BitXor};
 
index 4cc39b4b5d79ab063310382bda15dc489142e511..bcaf94953d61282e5bc1cf3fc47b78dd896ce8b0 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn foo(self);
 }
index 2e5688d8b7497f1f32538f3eb5650aebd55b2e09..381afd94e3b64ab163f82b61d481c6a929046a99 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo(int, int);
 
 fn main() {
index 10b5825cdd6242031a0ab653709f500785db090a..f30a50e37d81d8d4ed48d9b1bda2d12b2524827b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     struct A {
         a: int,
index 34ad2b2def03f82a5d4de6a5838ff9064ce50931..a0ad3cc6ca1af8e86886cd0daa2ece177501a3fd 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 struct F { f: Vec<int> }
 
 fn impure(_v: &[int]) {
index 9fcd87418bee30a65e2db03a96c89c65fb4ac327..ff61036d2c3d68019cb304ddbe5980fe0fefcb69 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 48129f2b6ddc3ebe2b1251bca6e41085c305bc45..eb61c747aea267397e9ba875bb34e72f6b983cfa 100644 (file)
@@ -13,6 +13,8 @@
 //
 // Example from src/librustc_borrowck/borrowck/README.md
 
+// pretty-expanded FIXME #23616
+
 fn foo<'a>(mut t0: &'a mut int,
            mut t1: &'a mut int) {
     let p: &int = &*t0; // Freezes `*t0`
index 75161d16bc064c5d3954f2a36d1519bdbba64755..6ccb2203bca8e4ce2a3c5e2215a0a30bdc0da836 100644 (file)
@@ -14,6 +14,8 @@
 // that the main function can read the variable too while
 // the closures are in scope. Issue #6801.
 
+// pretty-expanded FIXME #23616
+
 fn a() -> i32 {
     let mut x = 3;
     x += 1;
index 533445052ae657e92ac468b768a823272b62dead..10e4ad3eb974beb2d663f5623b1f9bc599f7097b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index ee561fdb0be522857bcdc0cb86c92a46ede28fd6..3f38a8df04c577adf3d6c940bd62ec7078c36d56 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = [22];
     let y = &x[0];
index 30a921c9bd24fcb4da5cc032970a8e14addffe09..8e8e012fdbf49d4849890769bbad8232e0438226 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that a `&mut` inside of an `&` is freezable.
 
+// pretty-expanded FIXME #23616
+
 struct MutSlice<'a, T:'a> {
     data: &'a mut [T]
 }
index 9b8fa8f9f79b2a0e48a244c55ddcdc35409f0bc2..b0cf5d81aa9655646da50ffc906fea8d6555d7ba 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn borrow(_v: &int) {}
 
 fn borrow_from_arg_imm_ref(v: Box<int>) {
index ae5734a09b3cd6fe618680c883ece68cb567ab22..1170c5be9b5ce06cb43867f3e463652ead1d2be9 100644 (file)
@@ -11,6 +11,8 @@
 // Check that we do not ICE when compiling this
 // macro, which reuses the expression `$id`
 
+// pretty-expanded FIXME #23616
+
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 
index 4364391cf0c60c9d403250ba778af1ac69bdb926..0ea18a6abe480b39a1ce55a636fa70a3f939cde0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 #![feature(unboxed_closures)]
index 092d7c1317029be72ec0abe99ec82fcae68a08e0..313dab18a31cc81f2ed34eaeb3f3d0d3c2a520be 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn want_slice(v: &[int]) -> int {
     let mut sum = 0;
     for i in v { sum += *i; }
index 4ccbf6b5b0fedfb65a0a91ca3dc823a732917b90..c3b69333dc5552e56f8528310e4a99b9f641725c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let mut x = None;
     match x {
index d4de4ef34d39729d821b2a535bd07741e3cc4676..e7ff379b433a604621e8b0c286de754db003f4f6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Counter {
     value: uint
 }
index 02c7dc38db00fe9198b8b6ce2d62396177044f8c..488c014eac776269f1d132314b4c2ec5ffa84406 100644 (file)
@@ -12,6 +12,8 @@
 // limited to the deref operation itself, and does not infect the
 // block as a whole.
 
+// pretty-expanded FIXME #23616
+
 struct Box {
     x: uint
 }
index 366752f46b003e7ad22e45ee7b634b49b0c7f977..d51d0b1d2e1fd50c769f6280827ddc5f3c35f512 100644 (file)
@@ -10,6 +10,8 @@
 
 // Regression test for issue #7740
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     static A: &'static char = &'A';
 }
index a2b0fa566353041f8f6bc5720cf4629a18a398a8..0bfa8f48650bb30c327c45ffe64573f6b3184ec3 100644 (file)
@@ -11,6 +11,8 @@
 // This test verifies that casting from the same lifetime on a value
 // to the same lifetime on a trait succeeds. See issue #10766.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 use std::marker;
index 84bd70c78d4871c2ed5550fddb94c117889b476c..c7199fccff6d6e8468e31883598520cead2f342a 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 struct Rec {
     f: Box<int>,
 }
index d95594119b6bceb131d38aa6bb3a88be3f958607..0ce2709c02d6a9f6a52cb7e10b390de553ef3b8a 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 use std::cell::Cell;
 
 #[derive(Copy)]
index 4b69e554cda66b66cd6aaae46ed2e849ce6c1c70..b646c741e7d3c377f7f70091acd4554d9db3a519 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index efd932933db333504992493df3a2457ff88f6f7d..aaf962577ff24cdd9541b70b11b92b2825538d32 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo(s: &String) -> bool {
     match &**s {
         "kitty" => true,
index 030e055c4ccb7e0b7042d0f65f5f4ad77f0d3ddf..eaad5944e6801cec17d8205248f2c881f48fbaf0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo<'r>(s: &'r uint) -> bool {
     match s {
         &3 => true,
index e57c001ea05b4f99a7234399038ea4fc87a91f5f..69cb27dcf899e806ab8adc92e96ffd7562dfed0a 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let (&x, &y) = (&3, &'a');
     assert_eq!(x, 3);
index 9f17b9d7f95b5811ed82a74dd3cae7b2ac877317..9588663aa18b9c12b0ea1e6f269184bd7042c0a7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn select<'r>(x: &'r Option<int>, y: &'r Option<int>) -> &'r Option<int> {
     match (x, y) {
         (&None, &None) => x,
index 7ccb40c8e7b37b4475e735dce12ed6ae70cbee60..52322c41236b82504a01a1aca2d201f6135bd305 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo<T:Clone>(x: &T) -> T{
     match x {
         &ref a => (*a).clone()
index 168218e1b1e274698d2aeefd9b70aefc9c62844b..a2d76d33993bafa72d74dc23c0f094c31ebe76dd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let _a = Box::new(1);
 }
index efc3ab32a1a813841420ecd0895371040b715922..4c4600590ee262a43c23c1045ba471378e92073c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn int_id(x: int) -> int { return x; }
 
 pub fn main() { loop { int_id(break); } }
index 6498c4b461def60ad1e3d8da878c76210e4e4342..80934c48515dc8ab72a2bf7d196b8d0737a71be0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let mut i = 0;
     while i < 20 { i += 1; if i == 10 { break; } }
index a3bb02d1d0037835f8cb96ed1d03c7047b74e810..625cd98bdf80e69aebce26d2e93153d63b2e5ec5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Speak : Sized {
     fn say(&self, s:&str) -> String;
     fn hi(&self) -> String { hello(self) }
index 143ebfdabfacefd6ce8cd1fdc05c430860e7f5a2..89fd51bd5f1dc0d618905b3e2fb862630e4f0fae 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub trait Foo<T> {
     fn func1<U>(&self, t: U, w: T);
 
index 379ac12a95424c3ac1880e95e39121cd7c17dfe0..eb6d1028331be06b76f48ef8caeac3f7f8558537 100644 (file)
@@ -14,6 +14,8 @@
 // a Send. Basically this just makes sure rustc is using
 // each_bound_trait_and_supertraits in type_contents correctly.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::mpsc::{channel, Sender};
 
 trait Bar : Send { }
index cd019c21a3d056f1ad291581de645f2ac1cd0448..0ff8c0c6ba08fbeb8fde40e1ca99b4970ce3487c 100644 (file)
@@ -14,6 +14,8 @@
 // Tests "capabilities" granted by traits with super-builtin-kinds,
 // even when using them cross-crate.
 
+// pretty-expanded FIXME #23616
+
 extern crate trait_superkinds_in_metadata;
 
 use std::sync::mpsc::{channel, Sender, Receiver};
index dc61508eec4fabf7acbb7bc55c029588ca1d7ac1..d016a92f465bda74f919e2e2f85559f2c79a1f89 100644 (file)
@@ -12,6 +12,8 @@
 // builtin-kinds, e.g., if a trait requires Send to implement, then
 // at usage site of that trait, we know we have the Send capability.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::mpsc::{channel, Sender, Receiver};
 
 trait Foo : Send { }
index 7eaed910124d91ea2b31a1134f9ceb481e1d1994..e38a7bac67a86f5f3370b2a6d8c1b88e23393171 100644 (file)
@@ -13,6 +13,8 @@
 
 // Tests (correct) usage of trait super-builtin-kinds cross-crate.
 
+// pretty-expanded FIXME #23616
+
 extern crate trait_superkinds_in_metadata;
 use trait_superkinds_in_metadata::{RequiresRequiresShareAndSend, RequiresShare};
 use trait_superkinds_in_metadata::{RequiresCopy};
index 964c28dc94517a1d5da90bee404dcf02b0e4e236..6bc81f4a36bcddf56a22302b88ff80c91e11a2e4 100644 (file)
@@ -12,6 +12,8 @@
 // super-builtin-kind of a trait, if the type parameter is never used,
 // the type can implement the trait anyway.
 
+// pretty-expanded FIXME #23616
+
 use std::marker;
 
 trait Foo : Send { }
index 1d05a7baa5352b938af0eee830201e6b023263a2..924a8c023f8b6ea8935fa181d690aa0cc43f5b1c 100644 (file)
@@ -11,6 +11,8 @@
 // Tests the ability for the Self type in default methods to use
 // capabilities granted by builtin kinds as supertraits.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::mpsc::{Sender, channel};
 
 trait Foo : Send + Sized + 'static {
index 9643e2986d2e59e26028c8603e1d6acab29496e8..e8d59b267feb7a8f2a384bc4c96df537a5ecb8ce 100644 (file)
@@ -10,6 +10,8 @@
 
 // Simple test case of implementing a trait with super-builtin-kinds.
 
+// pretty-expanded FIXME #23616
+
 trait Foo : Send { }
 
 impl Foo for int { }
index d96679c69fd1b14fb87e4bdd8f6e54379608bd52..6d41774c05bf1543d1110e38cd7ce94c49d746d5 100644 (file)
@@ -11,6 +11,8 @@
 // Tests correct implementation of traits with super-builtin-kinds
 // using a bounded type parameter.
 
+// pretty-expanded FIXME #23616
+
 trait Foo : Send { }
 
 impl <T: Send> Foo for T { }
index aa88004cd11994a6a82ed20887f8d09484b9d0af..baca7dc13f1b9c6c35a2c2d452abd882ffd3d104 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct X {
     a: int
 }
index 6a1dde24d6850509e209c0fcf9a495aa2389bf04..b678f149fa240d4317f386840dbe1dbdc9ddf093 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 mod rustrt {
     extern crate libc;
 
index 1de7520d2b1d04218cf0f5b2c943991ee2a77364..a9f80de86059c3c57e254741fef5c3a867385cae 100644 (file)
@@ -9,6 +9,10 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc, std_misc)]
+
 extern crate libc;
 
 use std::ffi::CString;
index 29fcdf504de6e53ca6ef5219b3f1ed51e59b244b..cef48aadab50ae16bdbd051eca9a7a16344fbaae 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo() -> int { 22 }
 
 pub fn main() {
index 9c8bc5411ef9165df42e5fbbd61adc23ec5349f1..31b279335225f011a6f82246661d7b276b5dbc85 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
index 631133cc7ff8b6150fdf2093489def64c865742a..d2eb5c33eae8087f14545317e94334367cfec071 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 6518df11517e9d60b476d53a07125218f504e3d7..5bf6f5fb04891a749c0464dcff4f37330dabbe14 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn each<T, F>(x: &[T], mut f: F) where F: FnMut(&T) {
     for val in x {
         f(val)
index 19316590c262d6967bbd20f75b183fbdc56e8756..c4f89bbcd328d16df671ea8982cdd6497ab4115d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 fn each<'a,T,F:FnMut(&'a T)>(x: &'a [T], mut f: F) {
index be5bb628b7294f3e1b43cca2edffabb2043904f7..b20de7113ec5db60bba85cfeacb3012efbd8c6f4 100644 (file)
 
 // exec-env:RUST_LOG=info
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, old_io, rustc_private, std_misc)]
 
 #[macro_use]
 extern crate log;
index 717ca3ff9feccb24bd9d289a2e7dfa4e9af20eb1..e79bab1b7b0505825001dee61b1ee589d8a662b5 100644 (file)
@@ -10,6 +10,8 @@
 
 
 // issues #10618 and #16382
+// pretty-expanded FIXME #23616
+
 const SIZE: int = 25;
 
 fn main() {
index a298a08a1b7a099bcce4a7e20e38168a0269a735..deb0c0d0dc0df884c4c0c2ba01d3df22e309b47e 100644 (file)
@@ -9,6 +9,6 @@
 // except according to those terms.
 
 pub fn main() {
-    let x = 3;
+    let x: int = 3;
     println!("&x={:x}", (&x as *const int as uint));
 }
index fc71e6c59fcafe6f197492cf9b478d5b6742fb6c..3eec130d5a91c3bb7560f5dcbff830e5099bc44c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let i: int = 'Q' as int;
     assert_eq!(i, 0x51);
index 8b2947ba3eef03f4f94623648bc1b70d5db58747..80b75af6e441e915cf36f77aefcd62c4f2af8e32 100644 (file)
@@ -13,6 +13,8 @@
 // This test makes sure we can do cross-crate inlining on functions
 // that use capture clauses.
 
+// pretty-expanded FIXME #23616
+
 extern crate cci_capture_clause;
 
 pub fn main() {
index 778e82a8fe599f481b0b00eb8ac850cfe5180b71..665469883043c793ad5fb8125034f5050c0e1e72 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:cci_nested_lib.rs
 
+// pretty-expanded FIXME #23616
+
 #![feature(globs)]
 
 extern crate cci_nested_lib;
index ea1d0b625fcd757eab2b37ecc478b7f0d32194f5..d7a74adc02d5eaa3575f6d295dbfbdfb4bfd025f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::cell::Cell;
 
 #[derive(Copy)]
index 09ab70194864f1b6905858c6f2a866620128f451..74022d4c6c8390b76a4b713dae37caac5e1a0036 100644 (file)
@@ -11,5 +11,7 @@
 // main is conditionally compiled, but the conditional compilation
 // is conditional too!
 
+// pretty-expanded FIXME #23616
+
 #[cfg_attr(foo, cfg(bar))]
 fn main() { }
index e6bd8afad280b98e928883216ea6c851512280df..25d689475fb4b1673c13a3eecc2a5126dbabe9dc 100644 (file)
@@ -10,6 +10,8 @@
 
 // https://github.com/rust-lang/rust/issues/21833#issuecomment-72353044
 
+// pretty-expanded FIXME #23616
+
 #![cfg_attr(not_used, no_std)]
 
 fn main() { }
index 24120b69c7f0cc5a67ff209386c2d58c17d86eaf..415607aa72bfc4c47a62879eae6b7d1e2a46034a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[cfg(windows)]
 pub fn main() {
 }
index aeb6fcbbc0f01fb63f9e28a03aa29606eec6b74f..5fa1bc47f877a24c778ad768e4ee3ed9113413ef 100644 (file)
@@ -13,6 +13,8 @@
 // check that cfg correctly chooses between the macro impls (see also
 // cfg-macros-notfoo.rs)
 
+// pretty-expanded FIXME #23616
+
 #[cfg(foo)]
 #[macro_use]
 mod foo {
index adc27d556227e3fb22b3bf10e4c1216f53b50c72..7cddac160319f23e4f722f195a7ace546923fbca 100644 (file)
@@ -13,6 +13,8 @@
 // check that cfg correctly chooses between the macro impls (see also
 // cfg-macros-foo.rs)
 
+// pretty-expanded FIXME #23616
+
 #[cfg(foo)]
 #[macro_use]
 mod foo {
index 02f02862f688415bfeb566880b518bf903691156..05dc7d52424b13c281f263e3cc12395aaaa68eaf 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Foo {
     Bar,
     Baz,
index 784c9326a0186756556b567c6ee591f8eef3abbc..b6954f7c2eeaf389c72332675e28bcfdd774161d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[cfg(target_family = "windows")]
 pub fn main() {
 }
index 04912fc20037a1bd26fb9b6dc60141a5d3fe7935..b3d5ddc4283083236d3f5fde5afd297b187cf802 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:cfg_inner_static.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate cfg_inner_static;
 
 pub fn main() {
index b7cf3c4d22a3f8e33d2e041bc54f798744b9f141..7d25321fae1bc477c3813e985ab4b46943755ad1 100644 (file)
@@ -11,6 +11,8 @@
 // compile-flags: --cfg fooA --cfg fooB
 
 // fooA AND !bar
+// pretty-expanded FIXME #23616
+
 #[cfg(all(fooA, not(bar)))]
 fn foo1() -> int { 1 }
 
index f982d3723b4c2091cbeeec84762026a01a118c14..801b01918e10339ccbc87aa5413ed3295595237d 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let c: char = 'x';
     let d: char = 'x';
index af25c43005dd4c2a7b9ca3428f39dacfc572ba3b..adf041b04d6fbf3bf9765f6728114e1fab1294aa 100644 (file)
@@ -10,6 +10,8 @@
 
 // Checks that mutable static items can have mutable slices
 
+// pretty-expanded FIXME #23616
+
 static mut TEST: &'static mut [int] = &mut [1];
 
 pub fn main() {
index 4e05c263a48bafddc0486e40b311ae2e865d62a4..554853ade5be61956a12ff5fe91a8783d9e6cbaf 100644 (file)
@@ -12,7 +12,9 @@
 
 // aux-build:check_static_recursion_foreign_helper.rs
 
-#![feature(custom_attribute)]
+// pretty-expanded FIXME #23616
+
+#![feature(custom_attribute, libc)]
 
 extern crate check_static_recursion_foreign_helper;
 extern crate libc;
index 6e2cfedf9ec3ebed8eabf9d6a166043bf8ec3a17..260668e48e96b9d3fb7da717bebffb470d138176 100644 (file)
@@ -11,6 +11,8 @@
 // Check that the various ways of getting to a reference to a vec (both sized
 // and unsized) work properly.
 
+// pretty-expanded FIXME #23616
+
 const aa: [int; 3] = [1, 2, 3];
 const ab: &'static [int; 3] = &aa;
 const ac: &'static [int] = ab;
index 39af96a58e6e3b10b38504eeae868dcfbbcb534f..64642e51c094b3a23bca35d846aef9e8484db65f 100644 (file)
 
 // Reported as issue #126, child leaks the string.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc)]
+
 use std::thread::Thread;
 
 fn child2(_s: String) { }
index c98e53c8a95a9c198bc6a008222d98979e7f3c58..6884ac8c07579d7ac7f344f279976a223a027d36 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct cat {
   done : extern fn(uint),
   meows : uint,
index a3f857ab4b069a7d2d61ff6c5c26b77d8237d57d..05228b30c41d80d1dd9f2049b816fca4756608f5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /* Test that exporting a class also exports its
    public fields and methods */
 
index 55acd2e040d9e51e8b1e60fd7b2010e40fa346d1..a5c60e3a7b53c9b51ff06d55e93f856ac0cb1ac0 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:cci_class_2.rs
+// pretty-expanded FIXME #23616
+
 extern crate cci_class_2;
 use cci_class_2::kitties::cat;
 
index 34c309780b1bc12b4b903d0ba2f0c88ca6938c15..73abaf7d34bb880122072f4f60d49603b628eb1d 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:cci_class_3.rs
+// pretty-expanded FIXME #23616
+
 extern crate cci_class_3;
 use cci_class_3::kitties::cat;
 
index 8fa76342286153a1cf78df51b9c26e1520a6f4d0..2959938e3736847b323e0b3e70568c485c65eea9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct cat {
   meows : uint,
 
index edbbc4f5b342181dc85d39591065ab035de776a6..6537a931fa615a63b03979062ea4b0f3c47859b1 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:cci_class_6.rs
+// pretty-expanded FIXME #23616
+
 extern crate cci_class_6;
 use cci_class_6::kitties::cat;
 
index 557f9986238c7432a5798487df7ad05dca7fb930..9e74a1002042d2332d11dc713aa15df272ce8162 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 struct cat<U> {
     info : Vec<U> ,
     meows : uint,
index 2fb8610092bf993859092ba881d1a1bd1806e805..e3b9b56db0b5bbcc510e9d2091f7819f509a46f8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct cat {
 
   name : String,
index c50a8cc83a503ee8b8358180f17add7f82cdedb6..6cd8f4c658cdeca1b19987af7721c7e45f26965a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::marker::PhantomData;
 
 struct cat<U> {
index aae17abcc5fc65d901e4bdc921e141ff57c7d59c..36d7bd6b3ca480ead3adf6b4fef8298fbb0c9e37 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:cci_class_4.rs
+// pretty-expanded FIXME #23616
+
 extern crate cci_class_4;
 use cci_class_4::kitties::cat;
 
index a54a821a7b9b47bef62c3551c9b3580362a0d3a8..487d20729d4e780e9bb18f5173a44c2227df2e3f 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 struct kitten {
     cat: Option<cat>,
 }
index 0966045464878f364ed99be06d85e94dc5268d5c..cfa13dbe622f7b4e1c0427ba3a0ef77946564539 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:cci_class.rs
+// pretty-expanded FIXME #23616
+
 extern crate cci_class;
 use cci_class::kitties::cat;
 
index 502fa73ed93e53a58cacd7e8317271505d2375f1..8fc4f47dc027743a04ba34fd1bb14122b80a3806 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct cat {
     meows : uint,
 
index 3cf529f2958bdfcaf4c52dc202db0d8490ff3b73..ff5ef145bcddfe159d89e7099404aed86d447492 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct cat {
     meows : uint,
 
index cb152f1c64e949b9cd2e52cfb321541db7ff0004..8dff34bdc1fcdbbab7ace4e69054f169c0560852 100644 (file)
 // Test that cleanup scope for temporaries created in a match
 // arm is confined to the match arm itself.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, os)]
 
 use std::os;
 
index 83f93cb81a1e6156d7354e9ae193d11eeaa92a43..7fd7ab90fc293427df1a738534ab0a5769561b60 100644 (file)
@@ -12,6 +12,8 @@
 // This test verifies that temporaries created for `while`'s and `if`
 // conditions are dropped after the condition is evaluated.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index ff883294fd3940b4c115ef22e195b433b37e788b..24c95bbb6dea7b5b6b115d292791b2790b7cca94 100644 (file)
@@ -24,6 +24,8 @@
 // It's unclear how likely such a bug is to recur, but it seems like a
 // scenario worth testing.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 4466dda6c6927932f3c75286f951f3dfce9aa11f..d448934f781dbc97c73263730089f3ae52f4a6d2 100644 (file)
@@ -20,6 +20,8 @@
 
 // Test that cleanups for the RHS of shortcircuiting operators work.
 
+// pretty-expanded FIXME #23616
+
 use std::env;
 
 pub fn main() {
index 5cc567cb14c6efda9c6561f00cdcced39a449d0d..cfbcc52e602c465dded5c93dd4289fd0da395010 100644 (file)
@@ -8,8 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, std_misc)]
 
 use std::thread::Thread;
 
index 816b28c3a9ae1e3b8e074a9a9e5c491c6ca743f1..dbbac8a16333b53311cdce899a2c880e548346b7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 use std::sync::mpsc::channel;
index 3bd0273216de31e352315a0d7dd93e9dfa7272b5..06b6e1b5abeddb6bffd7163a08d80054fd1a7b5d 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn foo(i: isize) -> isize { i + 1 }
 
 fn apply<A, F>(f: F, v: A) -> A where F: FnOnce(A) -> A { f(v) }
index fa16ea001452c79a52e825264ed202193dd55ace..328a27b3f1e8a6735c19814239f362df5511bae7 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test a rather underspecified example:
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let f = {|i| i};
     assert_eq!(f(2), 2);
index af64553b9138712b1212b442d01de5f89ebb0a52..fefab45714f77f1e8c515b7b019e1a8d7517c6c9 100644 (file)
@@ -11,7 +11,7 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, old_io)]
 
 use std::mem;
 use std::old_io::stdio::println;
index fd040d109108fe173ceedc95a6bbe046babfe5b4..fbe871a1bffce3908629c45bcffca38cdecab12d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::cmp::Ordering;
 
 // Test default methods in PartialOrd and PartialEq
index 8a9325aecb1438832904b9deb3b6990dafdb91dd..1b12cbd33df8a314f34fdb0713d894854917dff5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 34c9875f1de733543b32d53101fd3dc80bc2f10e..b3eec9939c29e8f443dbe0565b5704f316b8db1f 100644 (file)
@@ -10,6 +10,8 @@
 
 // Check that coercions are propagated through match and if expressions.
 
+// pretty-expanded FIXME #23616
+
 use std::boxed::Box;
 
 pub fn main() {
index 2592957b738596541d5bdd1afc5058d2787e9e5f..01627f1a837666de481f24335d29ddd7efd3ccad 100644 (file)
@@ -10,6 +10,8 @@
 
 // Check that coercions are propagated through match and if expressions.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index ec8d58616dc0fc66c902c48226b32a1d0fdaeb59..a053311a0403e43bf1a3c9a056a51e739270f963 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::rc::Rc;
 
 // Examples from the "deref coercions" RFC, at rust-lang/rfcs#241.
index 0bbabcb859993007f39415a493b8ff7162c45210..7812f0088b146e56e309ab1484f793e7b7316fc9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn negate(x: &int) -> int {
     -*x
 }
index 419df84bdf55ba1b914b441cdb425d584ec399ef..4638c51bbf7025c7becd0c355804bd63987df892 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct SpeechMaker {
     speeches: uint
 }
index b6b30e2fe9b217230b2c72643de1cc53c9007974..edc8df64a2042ddfbf3c06976c8e767a103f2d1e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn sum(x: &[int]) -> int {
     let mut sum = 0;
     for y in x { sum += *y; }
index 32230c82a7253a9b604f8cfb3780620933ba1f02..dcef198320056c080852446a8f0a1815c83e8028 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn bar(v: &mut [uint]) -> Vec<uint> {
     v.to_vec()
 }
index 4a680027b46e2adb91f70047567acd5fd1e992e3..9f6444c43c737dfd715ec566da7954a26c28507a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct SpeechMaker {
     speeches: uint
 }
index 2f866955ff46cafcf836287e646e1859d9379e66..1751979db8c97f91a5e785ac1d05fe7a9d4d160f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct SpeechMaker {
     speeches: uint
 }
index 2473b4b674e5784a1fcf94cd65253014952ac748..ab8b6818f43731ace72b6ecc5f693be4503fe036 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn reverse(v: &mut [uint]) {
     v.reverse();
 }
index ea09bb3904de6b950f027f95b9094bd885ed66ef..06ff3824cd20315e0ddbfcf55b34958e1712d9b7 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn bar(v: &mut [uint]) {
     v.reverse();
     v.reverse();
index eeba9042f7c3fcfbb140ba359eef73364ce06f5b..2299a03b2a4234f47f7b36a655fc9151475a0491 100644 (file)
@@ -11,6 +11,8 @@
 // Check that coercions unify the expected return type of a polymorphic
 // function call, instead of leaving the type variables as they were.
 
+// pretty-expanded FIXME #23616
+
 struct Foo;
 impl Foo {
     fn foo<T>(self, x: T) -> Option<T> { Some(x) }
index baf2f57206d6ae2d28264998288f686797015962..cbfe30906a73feb39506a09a6f187ef205ec1431 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:coherence-lib.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "coherence-lib" as lib;
 use lib::Remote1;
 
index cdc5bc11716550cc7c463e3281a8c5fa6a0f6e1f..8537c1bb002896115ab41d33fdcc6a4c06582168 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:coherence-lib.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "coherence-lib" as lib;
 use lib::Remote1;
 
index e02117d1ca261f02b0c751c43d6ddb5b8189a76b..2f2709698a040cfa82b57398e063f7eb85893c3a 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:coherence-lib.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "coherence-lib" as lib;
 use lib::Remote1;
 
index 27f1f2dafb003628399c7cbfccdb9a5c0582ad97..7bb3a01ccf8f763098a1bb47d41452aa2bc974e7 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:coherence-lib.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "coherence-lib" as lib;
 use lib::Remote;
 
index b380372b40125171442c5c8f1763241e40b296ab..4d76f482b4e5abff92f2316921af6a8e07bd735b 100644 (file)
@@ -13,6 +13,8 @@
 // Test that it's ok for T to appear first in the self-type, as long
 // as it's covered somewhere.
 
+// pretty-expanded FIXME #23616
+
 extern crate "coherence-lib" as lib;
 use lib::{Remote,Pair};
 
index 93e507c0d639df116a4d77a5bd670627926d2da4..685432ad1cff4c9c7fb3a36561b844ff29fa0164 100644 (file)
@@ -13,6 +13,8 @@
 // Test that it's ok for T to appear second in the self-type, as long
 // as it's covered somewhere.
 
+// pretty-expanded FIXME #23616
+
 extern crate "coherence-lib" as lib;
 use lib::{Remote,Pair};
 
index 6edd7390f0f31a37ad0cf088a3dec7ff0e2ec070..f91ccf6120a6e376e931acf20a5211de731a2686 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     #[derive(Copy)]
     enum x { foo }
index 6dc2ff4588b6788a27b7cdfdbdc4e74c6b449689..e807b6ca3bc1132d58976be5ecc9e292d038955c 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:coherence-lib.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "coherence-lib" as lib;
 use lib::Remote1;
 
index 7077503f73ff9353fc82f77d48039a8e82a8fa3e..3cb3efe8e7bf6fb9bb029c7556a6c7d5cd37fd37 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:coherence-lib.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "coherence-lib" as lib;
 use lib::Remote1;
 
index a9bc3dc0e2f277b148664e0b507b6d1d1a9ae796..172066abb2b848ed145583b726e3cad165a228d4 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:coherence-lib.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "coherence-lib" as lib;
 use lib::Remote;
 
index 07a830cb1ac2daa75b545156d55e294642b4d5d8..afdea4e6b7f13abd11a84eab4ad97a2f2ffed8a5 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:coherence-lib.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "coherence-lib" as lib;
 use lib::Remote;
 
index b16b033c22fccafc6854593e9f4cbb553a63cb98..8ca79f1d4f100bf83817d86b0803503115d10783 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::fmt::Debug;
 use std::default::Default;
 
index 7844ef3faca458ae8869d6f0a364a68a18f9d803..2f42ab4988acee517a741140e767db8cdfdbdc83 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(optin_builtin_traits)]
 
 use std::marker::Send;
index 35fe447c5e657335dc32faa7ae5f466880770591..21ff6d6938a3b718bdb4261826054e795e1b5f8f 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// no-pretty-expanded
-
 use std::io::Write;
 use std::fmt;
 
index 16a21adc3fcf90067067a902b385128f267b4869..cf318c50cff6ab0566a8cc3e748d91549687edbd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread::Thread;
 use std::sync::mpsc::{channel, Sender};
 
index c6f4fecf8acc617e0779e59d26ddf32771702381..9b049ede859a66ce3ed4938c11ccf031eaa41e66 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 type an_int = int;
 
 fn cmp(x: Option<an_int>, y: Option<int>) -> bool {
index 2de881993f156f07f62b833319b25f5bb90eb79a..7441d1f21b0f92bccb423c507430f7828d7e51da 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     assert_eq!(format!(concat!("foo", "bar", "{}"), "baz"), "foobarbaz".to_string());
     assert_eq!(format!(concat!()), "".to_string());
index 0e9447bd2497d2fe23510bc5c674f77ddae8e1c4..e51270fdc8d21f50a31a1a4db1c6f23536bd0dfc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[cfg(target_arch = "x86")]
 pub fn main() { }
 
index f77be4d9c0631ab0b798d2c3e18d93033b2a657f..590912f6e91977c504ad0f7f15554fd0f8a221d0 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // Crate use statements
+// pretty-expanded FIXME #23616
+
 #[cfg(bogus)]
 use flippity;
 
index 90142350772b82693c6b3b1da58c63513aa62358..192e647f5cb209519ef567d2baf4890c30c13a61 100644 (file)
 // compile-flags: -C debug-assertions=no
 // exec-env:RUST_LOG=conditional-debug-macro-off=4
 
+// pretty-expanded FIXME #23616
+
+#![feature(rustc_private)]
+
 #[macro_use]
 extern crate log;
 
index 71312fb387845b54f5bf18f5cb129fc2c4420f86..1349b7f814bb00f48e84b318af385524a207af29 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 static A: [u8; 1] = ['h' as u8];
 static B: u8 = (&A)[0];
 static C: &'static &'static &'static &'static [u8; 1] = & & & &A;
index ca1d79e83e92c492dd3b374b2599f7d8e413a96a..158c695c548d2cb4867ca4eaf638987b7ea5a43e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Foo {
     Bar(u32),
     Baz,
index 1268fc4e4350c3f3269f0f38682bdbd6d9a1c670..8b8fcfccc1c4dabd52c1ad1266934df367e4033a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! assert_approx_eq {
     ($a:expr, $b:expr) => ({
         use std::num::Float;
index 16360ff08d059af52a1be1772bd3d516a597c8f5..853e8dc62bb704ebd8a7b6c78188749daf6650db 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:cci_const_block.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate cci_const_block;
 
 pub fn main() {
index 03afe798954d514afe053882edf4b35b0028c0cb..06fbccdec06f365ac0b41980383c67adff4f3362 100644 (file)
@@ -11,6 +11,8 @@
 // General test that function items in static blocks
 // can be generated with a macro.
 
+// pretty-expanded FIXME #23616
+
 struct MyType {
     desc: &'static str,
     data: uint,
index d55b420db083e28f882e112cbb4d4643a3ef1092..1f7e942ea5a35e0a165d858f5bdb4ac4ea54e3f0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod foo {
     pub trait Value {
         fn value(&self) -> uint;
index bdde0cf02c95895b244084d70c0ca3112906ecd9..1337a91fe05d69d9152b655880cf919d3fb549b8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 #![allow(unused_unsafe)]
 
index 9b0e7e4e75ebfa0700b202cec905dfb360297141..37101303ed916a58a1371e2cdec68305783f2cc5 100644 (file)
@@ -11,6 +11,8 @@
 // Make sure const bounds work on things, and test that a few types
 // are const.
 
+// pretty-expanded FIXME #23616
+
 fn foo<T: Sync>(x: T) -> T { x }
 
 struct F { field: int }
index 50e460bd1798a79c5752c4bc62c6683e8c5d9e0a..bbe3020ea1c654f5e9a79cc5072b0640013fbd6c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::ptr;
 
 struct TestStruct {
index b7e9c0338dd6375fdd84d395e49ee1cce538d418..f660dc5fa450e312502f668eb6a940a8b334ade1 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 extern crate libc;
 
 struct TestStruct {
index ba2947f73679028fc9eac4af5cfb3b0d27491df7..16d71f52d98715f2b9eb34e44c70f739dc78faed 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 const a: int = 1;
 const b: int = a + 2;
 
index 616826f9f950239423880b52e32523503d18240e..af6af776c3d805190f720d0843ff82bad9850ad1 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #570
 
+// pretty-expanded FIXME #23616
+
 static lsl : int = 1 << 2;
 static add : int = 1 + 2;
 static addf : f64 = 1.0 + 2.0;
index bcf58431d0dcd4b5ab9ddf528f60032e280c0317..a92c2aab31241f694831a4e59fbe59939b631581 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:cci_const.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate cci_const;
 static foo: &'static str = cci_const::foopy;
 static a: uint = cci_const::uint_val;
index a299c74aa5b065b34e186d6b39c726191788d000..98f42f91245cd571a742a3d2d1acedec510288f9 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:cci_const.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate cci_const;
 use cci_const::bar;
 static foo: extern "C" fn() = bar;
index 480fb50a1ffe5170d19f29e5e724f90c82c68c78..7b2bb0d31f9affe2e9e0d9c1cb2135e4d5bc3448 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 const C: &'static int = &1000;
 static D: int = *C;
 
index 25145bf3638403cf724ca830acf77cb71f643c7f..8dcd67c05782cd5b1d65748cf7e77914d99dd24a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E { V, VV(int) }
 static C: E = E::V;
 
index bc5daf41646b8d413228fdf94fcc11ae459156c3..7cf2dcfa8900b897b93fc2d427fefd5beb52ea38 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E { V, VV(int) }
 static C: E = E::V;
 
index 966effab33e681640d505223e43043c6c4aa0e43..11e02338f41af902ef7051b0cb4329f47f73d0c9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum A { A1, A2 }
 enum B { B1=0, B2=2 }
 
index 0953f35e4483ed62fe09af0c0d1fae5a7a2fcf84..d7503ff8d7d31365c9d623eb9295984b0d711be2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E { V0, V1(int) }
 static C: &'static E = &E::V0;
 
index 0c3656e193cb7d69ace3cf8a0433e5036e3d7d1a..71a9703ec311a3d5d35e6e38e95b4240c5bf5389 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E { V16(u16), V32(u32) }
 struct S { a: E, b: u16, c: u16 }
 static C: S = S { a: E::V16(0xDEAD), b: 0x600D, c: 0xBAD };
index 6996da8bc37e290a40e01a7b8fa28d0704cf7f26..ca56cb5b01a99f36ac8d67ab2c5c7151f3c69e02 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E { V0, V16(u16) }
 struct S { a: E, b: u16, c: u16 }
 static C: S = S { a: E::V0, b: 0x600D, c: 0xBAD };
index ac48752b0a944aef659bf9436c40fd8822217eed..57cf2b619257bd1e2013015fd94e9547e1dbf19a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E {
     S0 { s: String },
     S1 { u: uint }
index 7ea5a3fed7655698557df8162f0d44edb9b93ea4..2ab28f5fb23773d116f71af115b3ec3c447f7608 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E { V16(u16), V32(u32) }
 static C: (E, u16, u16) = (E::V16(0xDEAD), 0x600D, 0xBAD);
 
index 968c45a3298dba6f4aef22b271ff6699e8f5a007..fe1b2e051c479f190c375fe6747ddcb4d4380c24 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E { V0, V16(u16) }
 static C: (E, u16, u16) = (E::V0, 0x600D, 0xBAD);
 
index 697321e0c77e4df6a3f1f115ad79e802ee9855b3..7f9de49404d3a8d9276732aaeabaadbb329bc186 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E { V16(u16), V32(u32) }
 struct S(E, u16, u16);
 static C: S = S(E::V16(0xDEAD), 0x600D, 0xBAD);
index 254580c4e69d13895345c883d262e0a2ff918330..3d7b6c9f49f78670c1bcbd3726d6d1e73433cc73 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E { V0, V16(u16) }
 struct S(E, u16, u16);
 static C: S = S(E::V0, 0x600D, 0xBAD);
index 4c8124d28a24157c02dbe6669849294674cce707..98e236bfccb436e91a36510947fe337d1d066298 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E { V1(int), V0 }
 const C: &'static [E] = &[E::V0, E::V1(0xDEADBEE)];
 static C0: E = C[0];
index d5c299fd86eec6d085a691b4bc51464056ec06c7..8eb9a425b86be6b9c8d2c5e3e8edb1d2c9621fa2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E { V1(int), V0 }
 static C: &'static [E] = &[E::V0, E::V1(0xDEADBEE), E::V0];
 
index 6eb5c2dab38ba17fa680da8e14ccc31705d16292..64940015802786fcec169c9648a61774aea78a12 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E { V1(int), V0 }
 static C: [E; 3] = [E::V0, E::V1(0xDEADBEE), E::V0];
 
index 6317c2eec1801b34bf2a678a2c797fb43cc8108e..82d9bb2b1e1149266add7e27ea304297ce477d61 100644 (file)
@@ -11,6 +11,8 @@
 // Check that constant expressions can be used for declaring the
 // type of a fixed length vector.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
 
     const FOO: uint = 2;
index 0b097c0b060ce741380202c21ea1682843aaae54..29eefd20502673af2f69ec92afec75c225d708b5 100644 (file)
@@ -10,6 +10,8 @@
 
 // Check that constant expressions can be used in vec repeat syntax.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
 
     const FOO: uint = 2;
index 069ca6ecf49dd4c3f1ef83212d7e7fef3beebfa0..ff829711a4c6c701aeab1f9490f006e4fe868580 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 extern fn foopy() {}
 
 static f: extern "C" fn() = foopy;
index 8394c53cba5cb44c19da054f3a99ce9dc51075d2..972d4ca607b387ec0a1f6b909ad55cfb2a07227f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo() -> int {
     return 0xca7f000d;
 }
index 4e2be013c11e4c3088cabdb358b8a10a078dd845..44222609e13fc3fa73548c5b4e1f50d2a2eb5af5 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #358
 
+// pretty-expanded FIXME #23616
+
 static toplevel_mod: int = -1;
 
 pub fn main() {
index 5397a29311a01bd577ba3926fcc50155113c1a9c..fcad89470d7c52edfd16270bc88d53470ad0e17b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Foo {
     Bar,
     Baz,
index 86b194f2eb3419b1f99e46aa291bf1142c91ef98..88be3c235881bc7ad292547823c01c143744ce06 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Copy)]
 enum Foo {
     Bar = 0xDEADBEE
index e8081005d4a8ff4695ddc124e364ea86305fc53a..8af169dfce989669fcd00a959259e8e0020edbe2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 type Big = [u64; 8];
 struct Pair<'a> { a: int, b: &'a Big }
 const x: &'static Big = &([13, 14, 10, 13, 11, 14, 14, 15]);
index e846501be6ee5fc64854843b5ad73a0b929e3fe2..c5ff134ff0e9bb6dcf23913ef4757efafb4d1148 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::{str, string};
 
 const A: [u8; 2] = ['h' as u8, 'i' as u8];
index 98dbf1eaa69a4ab2f1221f7c7719f2c2923dda7e..4f38a6431b8eaa00adbdd51b0f657df00b749054 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Foo {
     IntVal(i32),
     Int64Val(i64)
index 54116dd4082ed96221fbd9cfbbcacddc03305715..55cbae6b1d2c2c73f9ba547e50bade38144eb809 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Bar(int, int);
 
 static X: Bar = Bar(1, 2);
index 7e6d9f0bee9b92e76509e1479c054def6ac79484..320f41006e569807c8ff2f2c0c6bd73334c5ada4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo;
 
 static X: Foo = Foo;
index 4b07b1d3b076e72c226422ebf5e11eb97a6ff3a2..f16fbac00797a78efcdc3d6b3b8fef3ab72e542a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /*!
  * Try to double-check that static fns have the right size (with or
  * without dummy env ptr, as appropriate) by iterating a size-2 array.
index c0566277e4eb16e330b57f9b83638c07409d395d..3485e23dd0dd5c626559cdc3456cc38035977977 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn f(_: &[int]) {}
 
 pub fn main() {
index e8f4948a16533b245003da4c82d2269d4408e21f..c66030c6045f401ccb03fbd84b37383f6f2b5c66 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 const FOO: int = 10;
 const BAR: int = 3;
 
index 2b57c1ea0da693bfc6b77587cc3be19fa70f756b..6dfcc3b2a165acfe96065b63123facc89009091e 100644 (file)
@@ -12,6 +12,8 @@
 //
 // (Compare with compile-fail/move-out-of-array-1.rs)
 
+// pretty-expanded FIXME #23616
+
 struct C { _x: u8 }
 
 impl Copy for C { }
index 88d5b74708e623804d7e348a8658259c39344044..a4413fa85d24143de41bf4184e527b3ffe8c9603 100644 (file)
@@ -16,6 +16,7 @@
 // instead of in std.
 
 #![reexport_test_harness_main = "test_main"]
+#![feature(old_io, libc, std_misc)]
 
 extern crate libc;
 
index d8b3371325b2f4944774db5390848e583807dca8..ede78ff803d00d277d41800680539e3cd9ece161 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     use ::std::mem;
     mem::drop(2_usize);
index 043bfe429add3286620f4eefd503d6d66767e09d..43507f0cb00bd475f22978c4401168c169b6ab25 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index f04a760e5f65172e48289c7224a836df4caa86da..c794e45c84522a6e0ae4c432bbb83393488fefde 100644 (file)
@@ -10,6 +10,8 @@
 
 // compile-flags:--crate-name crate-name-attr-used -F unused-attributes
 
+// pretty-expanded FIXME #23616
+
 #![crate_name = "crate-name-attr-used"]
 
 fn main() {}
diff --git a/src/test/run-pass/create-dir-all-bare.rs b/src/test/run-pass/create-dir-all-bare.rs
new file mode 100644 (file)
index 0000000..475df62
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(tempdir)]
+
+use std::env;
+use std::fs::{self, TempDir};
+
+fn main() {
+    let td = TempDir::new("create-dir-all-bare").unwrap();
+    env::set_current_dir(td.path()).unwrap();
+    fs::create_dir_all("create-dir-all-bare").unwrap();
+}
index 14be5773e84db4c53425045b820dd6250dc53195..a85541bb8ba5ff206f79486e707a56517975c86d 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:cci_const.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate cci_const;
 
 pub fn main() {
index c2083c8e705eecb18eb86421b5558568bd739960..986108c5d8fa666c23b2f70702ababb2a5afc855 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:newtype_struct_xc.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate newtype_struct_xc;
 
 pub fn main() {
index 2388a567f3043e2b10c1a8ffb439b7de3397544b..94e4665bb86abf8cbe59ad9b76580c6b9513b4f7 100644 (file)
@@ -10,6 +10,8 @@
 
 // Regression test for #15477. This test just needs to compile.
 
+// pretty-expanded FIXME #23616
+
 use std::marker::PhantomFn;
 
 trait Chromosome<X: Chromosome<i32>> : PhantomFn<(Self,X)> {
index 6e16e68610603f1f9e7123a5697ef0f515f56729..50bc9e971fbe587ade419de60ad3a7b6cbbdf8af 100644 (file)
@@ -11,6 +11,8 @@
 // Test a case where a supertrait references a type that references
 // the original trait. This poses no problem at the moment.
 
+// pretty-expanded FIXME #23616
+
 trait Chromosome: Get<Struct<i32>> {
 }
 
index b588ea9cfd025d76ac0114e0129f6c6d7ca3ab08..801ca0e64f013c71e2ea3d032f353a10c38fcb97 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![deny(dead_code)]
 
 static _X: uint = 0;
index 2f82e729adf584a3ad24c8c4732aa8d230bd1127..d691703f437939691d2e156831ca18ac0ddcea2b 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 fn f(x: int) -> int {
     if x == 1 { return 1; } else { let y: int = 1 + f(x - 1); return y; }
 }
index 639ea59585efaf1e17161b5d4661a5c2c62a5d44..d19debce00fe176475ae47f9a419f021cc07d2c9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn m(&self, _:int) { }
 }
diff --git a/src/test/run-pass/deprecated-no-split-stack.rs b/src/test/run-pass/deprecated-no-split-stack.rs
deleted file mode 100644 (file)
index 31ba5dd..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-//~ WARNING no_split_stack is a deprecated synonym for no_stack_check
-#[no_split_stack]
-fn main() {
-}
index f43be17786299ec00c8985306c3529fc5e67c258..b3c13e165dbf22a9d2457963cee2e3da33a5c297 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that `&mut T` implements `DerefMut<T>`
 
+// pretty-expanded FIXME #23616
+
 use std::ops::{Deref, DerefMut};
 
 fn inc<T: Deref<Target=int> + DerefMut>(mut t: T) {
index e95d942c8cf73c89a404aad4f7834b16a99faeae..4519a8311b009b6e77a2f50372befd8675e44578 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that `&T` and `&mut T` implement `Deref<T>`
 
+// pretty-expanded FIXME #23616
+
 use std::ops::Deref;
 
 fn deref<U:Copy,T:Deref<Target=U>>(t: T) -> U {
index fbb8a3a1720f903ecc79b68c19fc9644e8ab9192..761b29258f2af0a995201462ed7dd71aef753b9e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::rc::Rc;
 
 fn main() {
index b4ee0246d87805ae4b06e22e5339db2a24e0001d..4249801b0bc6ad12ab52d5bdeb01483b65963076 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index d3034c2d48529dfa21ed85c3fc4a4627a521b6c4..4f48549d499b2b6ff05a562e729d2df85f6fdcb6 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(no_std)]
+#![feature(no_std, core, rand, collections, rustc_private)]
 #![no_std]
 
 extern crate core;
index 6869a60838c09e695b71fb4696414196161f4e5b..e0bbd0b2b041e447855bc4524f0c4ef072f4cdee 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Copy)]
 struct Test;
 
index ce34852a917a6053cc6a8436516bc2b33b113ed8..22daffc48699ade29693526a5287ebf58f6afae6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Clone)]
 enum E {
     A,
index e174ffae75de2e6371a4152434b953b6a42aad7c..a4fd77f8993bb73240fb7ff3562d18d93782805f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Clone)]
 enum E<T,U> {
     A(T),
index 329c7dab3eb3af47a5e35bad49a3a4a88a98edd8..d80f14c36945b23bc02fcf0dc78fbde03ae498dc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Clone)]
 struct S<T> {
     foo: (),
index bb07b08859fdb95f72807fd1e11afb5ecacaae9d..f2f2ec3de76008d1378fcc5f41e046594452c87f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Clone)]
 struct S<T>(T, ());
 
index 51e615b37021a96841685edee6f93c8553a5b2b3..4e0eb37abc518588f27ecf990afd127bd1594f86 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Clone)]
 struct S {
     _int: int,
index e2784c26dbbaea4e526e936766034aa018dbeaf7..8be029ba2accc196c08addcdf4c26a2f2b6baf31 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Clone)]
 struct S((), ());
 
index b3194d5820a4e90916c9b1b32e3f0d84d37b38ae..07ad8f706eb5ce0d29bd3b43afe2b06d241e1220 100644 (file)
@@ -10,6 +10,8 @@
 
 // no-pretty-expanded FIXME #15189
 
+// pretty-expanded FIXME #23616
+
 #[derive(PartialEq, Eq, PartialOrd, Ord)]
 enum E<T> {
     E0,
index 8b54536f3abac8f4205e758b31590737c7fc4a16..5f7d184f1949d584642c447fccca694d8db68799 100644 (file)
@@ -10,6 +10,8 @@
 
 // no-pretty-expanded FIXME #15189
 
+// pretty-expanded FIXME #23616
+
 #[derive(PartialEq, Eq, PartialOrd, Ord)]
 enum ES<T> {
     ES1 { x: T },
index 86887c3411f8fabb316422f08e1bc7834220f94f..ea0017380b275991f13a9d67762b41075f2cb83a 100644 (file)
@@ -10,6 +10,8 @@
 
 // no-pretty-expanded FIXME #15189
 
+// pretty-expanded FIXME #23616
+
 #[derive(PartialEq, Eq, PartialOrd, Ord)]
 struct S<T> {
     x: T,
index c7d7f8ded83f4471d77e402f81de7ab2d0374307..702071676b90ee88740f4babbf4e0224fbe5e996 100644 (file)
@@ -10,6 +10,8 @@
 
 // no-pretty-expanded FIXME #15189
 
+// pretty-expanded FIXME #23616
+
 #[derive(PartialEq, Eq, PartialOrd, Ord)]
 struct TS<T>(T,T);
 
index bc55b9132c836314b665fa11edf39971241c1ac6..65bf040b387e68ab7b2692a91cf6d06126197cb2 100644 (file)
@@ -12,6 +12,8 @@
 // where possible, by having a type that panics when compared as the
 // second element, so this passes iff the instances shortcircuit.
 
+// pretty-expanded FIXME #23616
+
 use std::cmp::Ordering;
 
 pub struct FailCmp;
index 4d157f64fb9eda85553d93f8141692b990783a73..574a620ef0290e670aa740c0bb8f6c526fe68684 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 454156b4c9e3fa25b9c0ddcbfff14a15f9738afd..17f4d93e24c1712ee207de428fffe1721a97d7fb 100644 (file)
@@ -8,9 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
-#![feature(old_orphan_check)]
+#![feature(old_orphan_check, rustc_private)]
 
 extern crate serialize;
 
index 7d581927c30b460a1aafd7dac9182fb90a294a11..2c8efc257745014c41e7f17ab14337cbc4ced844 100644 (file)
@@ -11,7 +11,9 @@
 // This briefly tests the capability of `Cell` and `RefCell` to implement the
 // `Encodable` and `Decodable` traits via `#[derive(Encodable, Decodable)]`
 
-#![feature(old_orphan_check)]
+// pretty-expanded FIXME #23616
+
+#![feature(old_orphan_check, rustc_private)]
 
 extern crate serialize;
 
index 7ce7c5fd411055c5cff05fac663197491eb42d99..925a5875171ce6fb5d4b6d70c5ee4fba0407f033 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub type task_id = int;
 
 #[derive(PartialEq)]
index 6777cbdab960486a3b1e306301e5f7f7408597e6..842de6e4984214140583855afc016bdd2c9b5d69 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(old_orphan_check)]
+#![feature(old_orphan_check, rand, rustc_private)]
 
 extern crate serialize;
 extern crate rand;
index 5fe7c8bb94b4f2487b08aa027ea42af58a66a91b..216a4c9cf0033d581db5482e07848712fead5577 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(hash)]
+
 use std::hash::{Hash, SipHasher};
 
 #[derive(Hash)]
index c9b60d22ecb7b9bd7a6e6a8cbd3172b198be353e..b23075e6d0af43035e07d90f7c2c28e260a01011 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! define_vec {
     () => (
         mod foo {
index 3164021a72e6481483a516e8388f58c47699268c..87df9a12505daf3255a120a3013776eb0cafebb1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::hash::{Hash, SipHasher};
 
 // testing multiple separate deriving attributes
index 16df6e7004fe4542d02f981f31a7b51f111c444f..2d25cdf71b0c19dd182446e5cd34aebb49d6a69c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::hash::{Hash, SipHasher};
 
 #[derive(PartialEq, Clone, Hash)]
index 6b365c348f782b52f26c1d6e1e57500a312ee3a5..4399d741cad1e104096c0b32851df7cde3005ca9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(core)]
+
 use std::num::FromPrimitive;
 use std::isize;
 
index d6e5fedf1824a0382d3543366f8dcd2a04eda2bb..61f266f6d81ad79dcd4f4b08172e2ba0af6feb8f 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(rand)]
+
 use std::rand;
 
 #[derive(Rand)]
index 2d6997341fb5d0af2e6ba5552ee36cdf50e41a2e..c0921070bc2ba87c1429a5d593f97394805d6eff 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Hash)]
 enum Foo {
     Bar(int, char),
index 448d5bfd4cb74dfab9a079462d5e935809759b48..791d3dd9549573c624ebcc470aa1b30378244a02 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Hash)]
 struct Foo {
     x: int,
index 43271162c18125b0f4d7b3e27e393639c941bb99..22853c5ad806e550f87ce1c89d9974fb38d16fe3 100644 (file)
@@ -11,6 +11,8 @@
 // Ensure that we can do a destructuring bind of a fixed-size array,
 // even when the element type has a destructor.
 
+// pretty-expanded FIXME #23616
+
 struct D { x: u8 }
 
 impl Drop for D { fn drop(&mut self) { } }
index 565e33ce01e17721a17f2e98a08f11d274fc19a1..45b743383b110c3091e8fa40b1e3288eb5e9f594 100644 (file)
@@ -10,6 +10,8 @@
 
 // Just testing that panic!() type checks in statement or expr
 
+// pretty-expanded FIXME #23616
+
 #![allow(unreachable_code)]
 
 fn f() {
index 331cd36a69402f12c6dbabffbd38d92f3bdb3a52..f838f3554d5a79f1abf8ee23eeab060163eef942 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x: int = 15;
     let y: int = 5;
index 0cb48670f23da3043e6659fcaaf09e0028fa5003..4ee08edb52debb0def59468fca44018e2cbcdadd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn check_expr() {
     let _:         & uint =     &1;
     let _:       & & uint =    &&1;
index f875d0644a07da9136aacbce789621acb0f01c0b..a52dd133e075043ea4822c5345c9822016fed3fe 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 0786974e112071b9dbde077a3fe536a2ca15fd35..f0b5d78707a831130d1a259ec797d137175ec0fa 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 fn f() -> int {
     if true {
         let _s: String = "should not leak".to_string();
index 7a3b6df539f142b3efed8ff676fba9d3b93cfbae..bb8119d5274579d929fe195102210d323c35b778 100644 (file)
@@ -11,6 +11,8 @@
 // Test that destructor on a struct runs successfully after the struct
 // is boxed and converted to an object.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index f8c54fbab8a4ec876a9ecef76ba4f7ee5c0a59a5..9fa085b6701dde0354f345240706d606764133e3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Foo { }
 
 impl Drop for Foo {
index 4f1fc91a53cea21be560a58d67d0d9196ce79544..ea9edff4945fe3c82feb7c46db9624c8d51809f1 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(str_words)]
+
 fn main() {
     let foo = "hello".to_string();
     let foo: Vec<&str> = foo.words().collect();
index ec8de2a709e6690e5b45a0cb61c15c56f06c7d5b..ddfaf54493fb4211825df29f0af62f17ab42fc57 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections)]
+
 fn main() {
     let args = vec!("foobie", "asdf::asdf");
     let arr: Vec<&str> = args[1].split_str("::").collect();
index ad71f725864f9f9c5ba1a578ee4dc169c125ae68..df29b8e10c7aa5114308b2df4e408bbe6a5d867f 100644 (file)
 // shows a similar setup, but restricts `f` so that the struct `C<'a>`
 // is force-fed a lifetime equal to that of the borrowed arena.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unstable)]
-#![feature(unsafe_destructor)]
+#![feature(unsafe_destructor, rustc_private)]
 
 extern crate arena;
 
index 30ed0b8e4024581b9f2c360208b4fb581bcd9cd2..6b5bd6ad35e759b8ffa4e684694ca6907eb38bde 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test coercions involving DST and/or raw pointers
 
+// pretty-expanded FIXME #23616
+
 struct S;
 trait T { fn dummy(&self) { } }
 impl T for S {}
index 33548d5e298cd16600594173574b8549a810dc42..b0bc61e3f8b1c39879206fd5a5065fd211fb218e 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that a custom deref with a fat pointer return type does not ICE
 
+// pretty-expanded FIXME #23616
+
 use std::ops::{Deref, DerefMut};
 
 pub struct Arr {
index 147a27afa80ed69b683fcc0a59d994675d6c307c..838352b3a149d1d17f66afe4cbad59be84621a91 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that a custom deref with a fat pointer return type does not ICE
 
+// pretty-expanded FIXME #23616
+
 use std::ops::Deref;
 
 pub struct Arr {
index 0c7ecfcefff34bcdc9bcf3cac4e53fd5eefe9dad..62bdda95deebf311b1616b39200436a8600826c6 100644 (file)
 // Test that overloaded index expressions with DST result types
 // work and don't ICE.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::ops::Index;
 use std::fmt::Debug;
 
@@ -19,7 +23,7 @@
 impl Index<uint> for S {
     type Output = str;
 
-    fn index<'a>(&'a self, _: &uint) -> &'a str {
+    fn index<'a>(&'a self, _: uint) -> &'a str {
         "hello"
     }
 }
@@ -29,7 +33,7 @@ fn index<'a>(&'a self, _: &uint) -> &'a str {
 impl Index<uint> for T {
     type Output = Debug + 'static;
 
-    fn index<'a>(&'a self, idx: &uint) -> &'a (Debug + 'static) {
+    fn index<'a>(&'a self, idx: uint) -> &'a (Debug + 'static) {
         static X: uint = 42;
         &X as &(Debug + 'static)
     }
index 226025cd80e8c900a99aac08603fc39168ab9dbb..6e8288d36e8f6bf352c9ed16622dbddc352d4bcf 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test DST raw pointers
 
+// pretty-expanded FIXME #23616
+
 trait Trait {
     fn foo(&self) -> int;
 }
index 74f4b9e923301732b7786d14adae54d5601dd307..e3b6061cbdc979a02ca87c656917a0c8d0b58a58 100644 (file)
@@ -10,6 +10,8 @@
 
 // As dst-struct.rs, but the unsized field is the only field in the struct.
 
+// pretty-expanded FIXME #23616
+
 struct Fat<T: ?Sized> {
     ptr: T
 }
index 15558414bf58ebeeffc68cb9b478e2dcf218b0c2..50ba85ad7189761b77165b778e8bcd1a0cb64331 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 6590a8e1847dca828bc8446200ddeff140a5bae2..3fcbe71df6778d09943388cfdaa72eb36ff7f152 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index eb66423f1c7a7f0543678616f498aefae01f156d..d95f1506a9b9ea4a3b308b73cbda449b051416dc 100644 (file)
@@ -11,6 +11,8 @@
 // Regression test for a problem with the first mod attribute
 // being applied to every mod
 
+// pretty-expanded FIXME #23616
+
 #[cfg(target_os = "linux")]
 mod hello;
 
index f7b1cef83ea5397b2efda591ca40432defdf7ded..91c9887300935df525267c0e61f894493f9bbef6 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:anon-extern-mod-cross-crate-1.rs
 // aux-build:anon-extern-mod-cross-crate-1.rs
+// pretty-expanded FIXME #23616
+
 extern crate anonexternmod;
 
 pub fn main() { }
index 97e873e9aff953cb41b110a3ba9cafd236317c42..a8c20dfb8c116fb442ce30a5b31ec3965687ec5d 100644 (file)
@@ -8,5 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn wsucc(n: int) -> int { 0 + { return n + 1 } }
 pub fn main() { }
index 89fee7358a11194df025bddf729eb2d9bc923d5d..efe96b96a34c889992212ac9d15b380755952a08 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait thing<A> {
     fn foo(&self) -> Option<A>;
 }
index 476d3f42d6ee31375484ea1cbca68d3490a72ea8..79c2f45067884e90526ea0729f7b09e4124a1780 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     if 1 == 2 {
         assert!((false));
index 0459206c5b910854504bfeaa5227e69079d0a479..cec528fa0401cef21a3041cd090654b9e148ffea 100644 (file)
@@ -10,6 +10,8 @@
 
 // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     assert!(Some(Box::new(())).is_some());
 
index f56d8843acd3fae7fc37fc4ecdca227b8a064f68..f52a21a997d78a00dfff2a46f1592bf4e80b7d10 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = *Box::new(());
 }
index 42a1e563285c583710ab05aedf75fb81244c5b27..881103210e46acd16bceff3cf9b8f878fe964638 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_mut)]
 
 
index 27560986e02532a45fd9bf5362064459aa857134..ecab52326446ecc0f6161b37f7da4b7e4cdc247f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 fn addr_of<T>(ptr: &T) -> uint {
index 1cbcaac379f09c0f90d71c8e6ab6c3ea2518eb84..2920fd4f734ac5c841ed338daae6844f1931e97a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /*!
  * C-like enums have to be represented as LLVM ints, not wrapped in a
  * struct, because it's important for the FFI that they interoperate
index 97997bec2616a085a74ae65baf669704179e53cc..a1224b93418b59ae38ec6fca29ca993b0016ecfc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Animal {
     Cat = 0,
     Dog = 1,
index ef34115739dd47c7a456ffd11ae86df73d64255c..239f9821b925bb4cd954c8334c156b87fdf5804e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem::size_of;
 
 enum Ei8 {
index 16eaac082abac25da57db21d0b938dda526ae8ff..323b349643d0e75536e12f91e7803f5cbcffc136 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem::size_of;
 
 #[repr(i8)]
index b45040f6a1c53ee79244add4d4663ac6dbbf1ad6..f1306b3f08cffdbced0a14bf50e0917dffa99f48 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub enum E64 {
     H64 = 0x7FFF_FFFF_FFFF_FFFF,
     L64 = 0x8000_0000_0000_0000
index a4bd361f1828e2c4b9b2b0bcfa2e580b1054ec5c..533d328628a7a93a3cb7e693dc648f1e9c7f36c5 100644 (file)
@@ -10,6 +10,8 @@
 
 // pp-exact
 
+// pretty-expanded FIXME #23616
+
 enum color { red = 1, green, blue, imaginary = -1, }
 
 pub fn main() {
index 6330d6196a361b650d068899ed7ea1233aaf4dc8..4cf8fff2376450117c6f478ecb9a55d0fe622a58 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod a {
     pub enum Foo {
         Bar,
index 023376ce4736ee6833e205314e4017e885cd023e..b8819ab61e8992a79fe53baae369258433db7f72 100644 (file)
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
 
 extern crate core;
 
index 4b839d740fc7aeaecf574b9adf9f7394b734c0d4..2284c1427c046cd95636a3a89962f3e8a3bd0c4b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::result::Result;
 use std::result::Result::Ok;
 
index 468e5f5f4b315f5255c2b55b8f8748d3c1d69171..99554aafb042715a2bba44cf0f00349e357d4672 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 4a3a1156698aa32e73bb81e2abc3a97f12e73eae..77e6141d5592d2ed01b86b690c0de8d1d1542ba8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 #![allow(unused_variable)]
 
index 86a998100b0e46d978f1ca7d1bb63ae4853879d0..5be8ca6c6cb48ea883c612ad8bfea01ad54957de 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Flopsy {
     Bunny = 2
 }
index 5d68a25a14ada73433012e8a3a13ccdf1c9c04f0..2d0128ba89e325d579f34f75037288d290372e50 100644 (file)
@@ -8,6 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(path)]
+#![feature(convert)]
+
 use std::env::*;
 use std::path::PathBuf;
 
@@ -16,7 +21,7 @@ fn main() {
     let oldhome = var("HOME");
 
     set_var("HOME", "/home/MountainView");
-    assert!(home_dir() == Some(PathBuf::new("/home/MountainView")));
+    assert!(home_dir() == Some(PathBuf::from("/home/MountainView")));
 
     remove_var("HOME");
     if cfg!(target_os = "android") {
@@ -37,14 +42,14 @@ fn main() {
     assert!(home_dir().is_some());
 
     set_var("HOME", "/home/MountainView");
-    assert!(home_dir() == Some(PathBuf::new("/home/MountainView")));
+    assert!(home_dir() == Some(PathBuf::from("/home/MountainView")));
 
     remove_var("HOME");
 
     set_var("USERPROFILE", "/home/MountainView");
-    assert!(home_dir() == Some(PathBuf::new("/home/MountainView")));
+    assert!(home_dir() == Some(PathBuf::from("/home/MountainView")));
 
     set_var("HOME", "/home/MountainView");
     set_var("USERPROFILE", "/home/PaloAlto");
-    assert!(home_dir() == Some(PathBuf::new("/home/MountainView")));
+    assert!(home_dir() == Some(PathBuf::from("/home/MountainView")));
 }
index 659e5b3a8c2f8a93a5e4c23c655d2a89bf67b893..33bc6c596dbd0b008c22b8f3d63beebe62f2965f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::env::*;
 
 fn main() {
index 2dcf6bf6d090757d0bd84950c8ea7358d08928ba..3ca254021e5b9320c083c181b66153d1fd6ff062 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(PartialEq)]
 struct Bar;
 struct Baz;
index b562558822cd1bf2064f346d670fa17a58526175..0b24658a8f331fb3e2ac96deb500275e6efc0d75 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 
 pub fn main() {
index a71016fd88baaf6676c06df88de4340b424d1c1a..a24930732474feb6d30c262e1aa1faa14dbc41bb 100644 (file)
@@ -10,6 +10,8 @@
 
 // exec-env:TEST_EXEC_ENV=22
 
+// pretty-expanded FIXME #23616
+
 use std::env;
 
 pub fn main() {
index 96c58b106f3414ce89c984b75218a708f94bf957..6029b488f0867271872baf4e7c7a24ada62266c5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x: int = 8;
     let y = 9;
index ef9dc377bc7f7164c5db03428ccd102a869e032b..4fcac31c533a5221b5246eed27c5a73c4aeaaa06 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test to make sure that explicit self params work inside closures
 
+// pretty-expanded FIXME #23616
+
 struct Box {
     x: uint
 }
index 865fccbc3fa3a865e65dbdfebcee08ea08a1c390..c4b8099e8501cf9dbd7d41501af3d9c96bf7ce18 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 501ba01b4ce1c28d011b8427a06eaa274e879e2f..ce0cdf0d2496b389a15c83e5b5a45d62abca0882 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 3d06a5562034cc0c383bcfba68ad93a498f66bc8..1d013c3abc81b521b5be30a4f559b580438af48f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index ee74fc0b0a3262dd34057eaaf0d54929da19bc05..eaaf92fbea9cea6b34244d4dbe40ec712af9fbb3 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:explicit_self_xcrate.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate explicit_self_xcrate;
 use explicit_self_xcrate::{Foo, Bar};
 
index bfe22712de8c3b2e0b4e5b2092fd6854b8a8b1da..7e947c0be4584d0cb9a4518caaf4d53f2451b8ff 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc)]
+
 use std::num::strconv::ExponentFormat::{ExpBin, ExpDec};
 use std::num::strconv::SignificantDigits::DigMax;
 use std::num::strconv::SignFormat::{SignAll, SignNeg};
index 983ebbee9872fc8e58026a4cc0a9f569055c4211..7333d739f4b68732bd6a0420e65cd9aacfb85aac 100644 (file)
@@ -11,6 +11,8 @@
 // We can export tags without exporting the variants to create a simple
 // sort of ADT.
 
+// pretty-expanded FIXME #23616
+
 mod foo {
     pub enum t { t1, }
 
index da0a3e9e107e6cad55d8a7f935b0fa73e50d5aeb..debe9b0ddf18aed96e413c63b1a3128e0ecad5e8 100644 (file)
@@ -13,6 +13,8 @@
 
 // Modified to not use export since it's going away. --pcw
 
+// pretty-expanded FIXME #23616
+
 mod foo {
     use foo::bar::*;
     pub mod bar {
index 09e816cff0bb58d61728941ec8fb48635f905acd..e7c35fcd7562cdcf2dfd28af560a92d965e35aea 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use m::f;
 use m::g;
 
index 01fcf02ec12f66542859dc0986cecac22699e608..6257332a665662152aa199d8457e1bc16e811960 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod foo {
     pub enum t { t1, }
 }
index ed246e2cb7d7bd6008b8f2345bf2a0a00bf25239..821dfbec0be628d31619fa18d8c7e60943ec6511 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 fn test_fn() {
     fn ten() -> int { return 10; }
     let rs = ten;
index e41ce37cc3a1d5794f7e5dd45136983c3bd95d02..81d4078a3e9572f949f793f2550fd80334a9224a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 91b847d47cbcc679d6b9efda3c59594a2a674524..e4040238cd53bd35037ebffe237787ac041810ce 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn test_generic<T: Clone, F>(expected: T, eq: F) where F: FnOnce(T, T) -> bool {
     let actual: T = { expected.clone() };
     assert!(eq(expected, actual));
index cfb764e85f8d379111513e998abb0248b6f3e65f..5f4515924e7119d8dff2f5c81113acfbd43fc97b 100644 (file)
@@ -10,6 +10,8 @@
 
 // Regression test for issue #377
 
+// pretty-expanded FIXME #23616
+
 struct A { a: int }
 struct V { v: int }
 
index d7d5a39f452f3dee030474b068d7e7ba05c4fd0d..496a575c6c8b5a503145e963c5a426f1e1de46ea 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index ee1d955b0d361d9bdf54c5f7e4b182623c94c5aa..dd4c4d0cd73dca30b33869dde4ebfb638805664e 100644 (file)
@@ -13,6 +13,8 @@
 
 
 // Tests for standalone blocks as expressions
+// pretty-expanded FIXME #23616
+
 fn test_basic() { let rs: bool = { true }; assert!((rs)); }
 
 struct RS { v1: int, v2: int }
index 6c6c5085749bb9be42bad0c0a0583b2954891b10..f236f6999383abdbaff9d32ddcfdfa1708f34a67 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn f(arg: &mut A) {
     arg.a = 100;
 }
index afc7dfaf9b441bcfd51a03a5cd0c4ec4fe3f5d14..02ac2a0b67b14f1107a5790157bd7a86bbe24f3c 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #521
 
+// pretty-expanded FIXME #23616
+
 fn f() {
     let _x = match true {
         true => { 10 }
index 0ea1f3fcdaffcb7874a711d6100a731d8c60fbe5..51ef5f00ab70b119b5242caf7900fffd6c880188 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn test_int() {
     fn f() -> int { 10 }
     assert_eq!(f(), 10);
index fb2a120e6f4a17d839b2cccc2ca2736437deb667..3f1c059ffee9270c5eb70f2ec344e4605ca7f8f7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn test_generic<T, F>(expected: T, not_expected: T, eq: F) where
     T: Clone,
     F: FnOnce(T, T) -> bool,
index 52ccee05817a0ccb9ae407ccb9a0f6d294cd2c79..1e631c204798a1dab6da4958d24d63398686d7e5 100644 (file)
@@ -10,6 +10,8 @@
 
 // When all branches of an if expression result in panic, the entire if
 // expression results in panic.
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let _x = if true {
         10
index 87c7954fa49aae9387a4e23f1928089d024c4924..e8594db80393ba735178ccb675444ea2e3a8eeff 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn test_if_panic() {
     let x = if false { panic!() } else { 10 };
     assert!((x == 10));
index a58161277989870bf9da7f8a5230ecf9ec836897..99c5053588b1c3b9ae7cf11b919f1c6c2fb30063 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 23446b3f650c5a4917f86a1350b55c74aefc4ae6..345f17707c408b664353db89f809d8f610b368c4 100644 (file)
@@ -13,6 +13,8 @@
 
 
 // Tests for if as expressions
+// pretty-expanded FIXME #23616
+
 fn test_if() { let rs: bool = if true { true } else { false }; assert!((rs)); }
 
 fn test_else() {
index 9de1379f480f1bda79b4cf81f9b9f9353923c310..7cd0f6a758999dd66eeb5dc0a29944c51b923f16 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 489cd8437d21faacf5b52ddf21de41a2ca2453d0..d8e3172ea47c150da02865e2d78f9843a33a4fea 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 8e66827e0198f252528d7ee45e8d06ec394b2705..513197be8f31525ce0b2e05d32628768fb60413c 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 type compare<T> = extern "Rust" fn(T, T) -> bool;
 
 fn test_generic<T:Clone>(expected: T, eq: compare<T>) {
index 3a8955917d6496567237712b062df5c073f35752..664ead10aae09fbdc79932b6ae16038cf5f72872 100644 (file)
@@ -13,6 +13,8 @@
 
 // When all branches of a match expression result in panic, the entire
 // match expression results in panic.
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let _x =
         match true {
index da24d4c57cc798e1a2366facceeddaee1163c385..40e7a6175cf86161eb8731c35471c2f4e43b6f4d 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn test_simple() {
     let r = match true { true => { true } false => { panic!() } };
     assert_eq!(r, true);
index 9641cacddc0a682e22cc498188ed097e172df876..51eda4c7663a846305778e3d45f770198fa5562e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index b8996de41999cedb851a7b55e144b479b01a9199..2282391ef6fb478dbd9bb856c802134e135a072e 100644 (file)
@@ -13,6 +13,8 @@
 
 
 // Tests for using match as an expression
+// pretty-expanded FIXME #23616
+
 fn test_basic() {
     let mut rs: bool = match true { true => { true } false => { false } };
     assert!((rs));
index 324ff59dcb8f0c1c421b1da0d6e1b20ffe0b10f4..a1d86218846d6166cb5689e086172f569d6f2fbb 100644 (file)
@@ -10,5 +10,7 @@
 
 // Regression test for issue #762
 
+// pretty-expanded FIXME #23616
+
 pub fn f() { }
 pub fn main() { return ::f(); }
index d204f808e4471d9fdb1db81dacde7979c2000518..46cd73e11527c51c4f4e246a7cb00792ff9dcbef 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 static FOO : &'static str = concat!(concat!("hel", "lo"), "world");
 
 pub fn main() {
index bba8cbdb83dd67d7314cf07ba0a3ee4c84b3b8fd..8e050aa3f4db765242709cba5c9fac3fd1d8a162 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 use std::cell::Cell;
 
 #[derive(Copy)]
index e4b9b9dfa1686599c0e8eda763ee9dd38e4c7d3e..67f6a3e8fc48478cc952fd00085f51ad0ca4b384 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 extern fn f() {
 }
 
index 93a5752d004aa65f52d048e0abb7af4b744170d9..2138b12fb12aba7ee7a486fbc7d6a64ff0331a91 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(libc)]
+
 extern crate libc;
 
 mod rustrt {
index 3c4c1da52ea95c7e4c6ba90f18a56966b233ca50..7bbed563a99fe9dde207298ed904a2546da2008d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc, libc)]
+
 extern crate libc;
 use std::thread::Thread;
 
index 34d2b577f202c0210ccc5033437acc996e6e216f..bd05b3ce5a45cdcdb0a3ceb612ff7d1903ad367b 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test direct calls to extern fns.
 
+// pretty-expanded FIXME #23616
+
 extern fn f(x: uint) -> uint { x * 2 }
 
 pub fn main() {
index 52697d96b32d97edd9f6477710aa560ae33ffa57..4f1abbeb5c7ed79be9096fc7eaeb9a67a9737aed 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(libc)]
+
 extern crate libc;
 
 mod rustrt {
index 0dca7514dc5cf1cfed2e426fead18ad0b1f56359..069ecd92a56d099bc8572fdcd1f46a80fbb90680 100644 (file)
@@ -12,6 +12,8 @@
 // make sure the stack pointers are maintained properly in both
 // directions
 
+#![feature(libc, std_misc)]
+
 extern crate libc;
 use std::thread::Thread;
 
index bdb1326aa15c03f0e2b6c47395e32dca1ef8c0dd..12f9c22c91824d4db587f6f433b80325a32a3ce0 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:extern_calling_convention.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate extern_calling_convention;
 
 use extern_calling_convention::foo;
index 612b6ee14e196510de170be3f2d38683806ccfe0..2d633b1de69f67a23aee069027676d6754ea5d58 100644 (file)
@@ -10,6 +10,8 @@
 
 // Tests that we can compare various kinds of extern fn signatures.
 
+// pretty-expanded FIXME #23616
+
 extern fn voidret1() {}
 extern fn voidret2() {}
 
index 18e20332adc91e1693cf6c5c7dae6c9a127c4759..7157d0658be349944cdd20a5f6df698b065d70ef 100644 (file)
@@ -10,6 +10,8 @@
 
 //aux-build:extern-crosscrate-source.rs
 
+#![feature(libc)]
+
 extern crate externcallback;
 extern crate libc;
 
index 59ee9a14e2eac71a43029712023c11fc7bde6d7e..50c070483f6974ad4455c34357735e047f16cfc9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 extern crate "std" as mystd;
 
 pub fn main() {}
index 8fe69e4002494d96dfe6212ed0b023206be73d85..246f65931b70e8deac213009c9db11d374c720cf 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::marker::MarkerTrait;
 
 trait A : MarkerTrait {
index 84fd1b40bf7a50eed6bf3a823fae09bec5d45774..74f47f08703a2f9c7edfe489d63a5427e83d34c2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 extern "C" {
     fn pow(x: f64, y: f64) -> f64;
 }
index d6c6389fdb63bda3465e870000c926b281099b1e..1c64716b822b5c90f2400f64c140179c21816399 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:extern_mod_ordering_lib.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate extern_mod_ordering_lib;
 
 use extern_mod_ordering_lib::extern_mod_ordering_lib as the_lib;
index 4d4f5036fc1b8ec3d887a7e1985925f9faa0954f..37404ee7e696c17a22641831e844a0c05d31b9e4 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![allow(unused_imports)]
+#![feature(rustc_private)]
 
 extern crate serialize;
 use serialize::json::Object;
index 2e86b3774c8dd64722fc5e493606aa5002056a9a..bbdf5cf64a127fee542efb803539a5c49af31493 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test a function that takes/returns a u8.
 
+// pretty-expanded FIXME #23616
+
 #[link(name = "rust_test_helpers")]
 extern {
     pub fn rust_dbg_extern_identity_u8(v: u8) -> u8;
index c33c9ee3027f761580ecc802a3c4b61ed9a9326a..24c461f43adf8919c97509c5b7baddf9637af1ef 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[link(name = "rust_test_helpers")]
 extern {
     pub fn rust_dbg_extern_identity_double(v: f64) -> f64;
index 272dfc98148ca421186ee0d2a9ae1f6767372691..17b0bb580fce27e10a98c2945230db1a3eaed1f0 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test a foreign function that accepts empty struct.
 
+// pretty-expanded FIXME #23616
+
 struct TwoU8s {
     one: u8,
     two: u8,
index 2c01808440762e30b7038e4f10f3a2d60a2be4f5..f93d7a3ff9614f7a043b8385e9a81ebc412935d9 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test a function that takes/returns a u32.
 
+// pretty-expanded FIXME #23616
+
 #[link(name = "rust_test_helpers")]
 extern {
     pub fn rust_dbg_extern_identity_u32(v: u32) -> u32;
index e72e87d3d93635ebc142082fbfd0fd16cbb60593..961a3dce16813117cad9a1237c4009ba02d0b96e 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test a call to a function that takes/returns a u64.
 
+// pretty-expanded FIXME #23616
+
 #[link(name = "rust_test_helpers")]
 extern {
     pub fn rust_dbg_extern_identity_u64(v: u64) -> u64;
index cefc266b5c764019ccda14b0211a607964d88eb2..29bcdef5dc9ec60da7e73c57b9d048ef265aff6f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 extern {
     pub fn free(p: *const u8);
 }
index ca9767307f42ed1834d60bfcadd2a424019089cb..f149a1346229a64f1dd968e55a49729748241522 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub struct TwoU16s {
     one: u16, two: u16
 }
index 8d650459daa8de31534e62479149975d76b23835..4e9c44ef75eec5c683bd3c44f56ee60a9cc927af 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub struct TwoU32s {
     one: u32, two: u32
 }
index 924aaf811f44a55e222eec01de148edc6cbff5d1..fffd77fa897354edaba7b2bcc9a00c7b3ddaa3e4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub struct TwoU64s {
     one: u64, two: u64
 }
index 1dbce403cc8a196e4e9299b47e97c556e84d8247..fdf43d4332a9d16b4c774c1b4b69fc6d2dbb2b9f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub struct TwoU8s {
     one: u8, two: u8
 }
index 8ba39a24514cb7d872798a02a370868e7ef16328..e7f707bc334d70f9dec37d3a201bb7139b00b4d3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[repr(C)]
 pub struct Foo(u32);
 
index 1934ef8024fd4aead06bb52fc8f23b90e678a38f..c016e4e62f56f19a0cbb49e038fa0683fb2cb466 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 extern fn f() {
 }
 
index 891133c78d477fab0bf06b1cedb82a40b2a8a447..aaa8f6cf26f1d8330653a2ded9d5efbddbee93d6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     assert!(option_env!("__HOPEFULLY_DOESNT_EXIST__").is_none());
 }
index 1d4c08f0bb5def4231d1cc1fd5cf4a40e6298cd3..aab32a7e7bd3773d33ece0e2730636aac38e2dab 100644 (file)
@@ -21,6 +21,8 @@
 // declarations, but we currently run them top-to-bottom. I don't think the
 // order really matters that much as long as we define what it is.
 
+// pretty-expanded FIXME #23616
+
 struct A;
 struct B;
 struct C {
index 37f7d84aaf1e42a46742267fed395d0fc10b1d4e..fbdf817e9abb8552a9bccb4313c48299eaec2315 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     // Make sure that this view item is filtered out because otherwise it would
     // trigger a compilation error
index bbd7b9130e7b94e1afe1290803d562019bd5de81..019537a2ab8b03abbde0e833bdf1738c2f0454ba 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let arr = [1,2,3];
     let arr2 = arr;
index a673a67089a3a2289225b0572a44b05ea52cb3cd..09683c43ece222826cce557f2682de32014b2d75 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::ops::{Deref, DerefMut};
 
 // Generic unique/owned smaht pointer.
index 4d9f7d507f0a50f316d729e9a5d2f0c6dcbb7b19..b375f122082ef1e2169501785ee70805f1cf580e 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc)]
+
 use std::num::Float;
 
 pub fn main() {
index 9c75979628f3c27c2a6b8eba4969dca8679fd6bc..f84cbe52354678633226f1007084bf432947ab0e 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let a = 1.5e6f64;
     let b = 1.5E6f64;
index 09df423d2dadc97d7df945c0bc5849e91d5553f9..d45c689bfdaa764556af81af164eea7892d827a8 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let f = 4.999999999999f64;
     assert!((f > 4.90f64));
index 0bbd5ecdc3f5c4603133272da3b48152d085addf..521ed6db65be1714c5d56210083de3e796ec3525 100644 (file)
@@ -11,6 +11,8 @@
 // Ensure that declarations and types which use `extern fn` both have the same
 // ABI (#9309).
 
+// pretty-expanded FIXME #23616
+
 extern {
     fn printf();
 }
index fd8721e29e9b83767d605418f13ef14837af601e..0fd0f6a110d56fb735a75144952ee468bdaf9bdc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn f(i: int, called: &mut bool) {
     assert_eq!(i, 10);
     *called = true;
index 09508b9b136296423ce4e78f4bdbcf0173b79b0c..4ec32d23467f717d3a70564d65e01f112b5c8664 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn bare() {}
 
 fn likes_block<F>(f: F) where F: FnOnce() { f() }
index cdde98331e2d05859b27d3cf9511b89176ce3041..b373294e243f21083bfcebdacdfb1a3c13ebe3bf 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 pub fn main() {
index 4fc2c69ceb34f3dfaa37ae78999f08d09a279935..8a16724561025f31e5a8f6f0c4e93ce11485f027 100644 (file)
@@ -10,6 +10,8 @@
 
 // This is what the signature to spawn should look like with bare functions
 
+// pretty-expanded FIXME #23616
+
 fn spawn<T:Send>(val: T, f: fn(T)) {
     f(val);
 }
index bf6926050ba96b2f780a885a1b96de8dfb06e8ed..74d107d15ab0f1a4b0d62437bd7edadc3f653585 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct r<F> where F: FnOnce() {
     field: F,
 }
index bfd02f5e27b0c4bced6290d6c5973584916c27b5..7f9248f4d2ac2a40d23668d4244615ff9d76107a 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test explicit coercions from a fn item type to a fn pointer type.
 
+// pretty-expanded FIXME #23616
+
 fn foo(x: int) -> int { x * 2 }
 fn bar(x: int) -> int { x * 4 }
 type IntMap = fn(int) -> int;
index 8427a0f444621ce93cdbf25a07240b7eacfbbcdc..34489555dbc203b9b56050a0bafeb2f1e7028b35 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test implicit coercions from a fn item type to a fn pointer type.
 
+// pretty-expanded FIXME #23616
+
 fn foo(x: int) -> int { x * 2 }
 fn bar(x: int) -> int { x * 4 }
 type IntMap = fn(int) -> int;
index f21dbc6f987d21818962c88cce30d9680f37ed00..efb58474118a6196426e20e2342a8be928e0bbd5 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 fn foo(_f: fn(int) -> int) { }
 
 fn id(x: int) -> int { return x; }
index 3e81ca5125ba4b84fa16383770577d52027dd7ce..2287df4b1055299351f1691b2e466d872fa49ea8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let f = |(x, y): (int, int)| {
         assert_eq!(x, 1);
index 34417891197a422dd6db05cf34c80eabec933198..3e1674a97e089f5a311f9bdfd365fb8a77a623d7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_variable)]
 
 pub fn main() {
index 7a9b8a45b2af10d308907dbd037d4c7e5adce2e0..2db01b1aa40671e4c5319ae417bdf94a22e6e941 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Pair { x: int, y: int }
 
 pub fn main() {
index 84218befcd83bed2b3fde9fac1d796b7c0c6516a..8784af1888648990ab81e414372a0aca94eac14e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum BogusOption<T> {
     None,
     Some(T),
index 7564efbd9e56ba483ebe65f102df68dbf1f06814..109ca26056fff49c7758c5feb6ec1d6f93e640c6 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that for loops can do what RFC #235 claims
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let mut v = vec![1];
 
index 30c2aec33ad1ba51de99485c0fe4fc2b946b435c..769d9116f5a8100667b39c16a8d0478a1ee25795 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(lang_items, start, no_std)]
+// pretty-expanded FIXME #23616
+
+#![feature(lang_items, start, no_std, core, collections)]
 #![no_std]
 
 extern crate "std" as other;
index d2de1ed8c7e6f3ff032bfbfe4cbe635b586e2aa1..7664e74cd33badaf0f0bb73c40ac4fbd7cffc15b 100644 (file)
@@ -9,4 +9,6 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() { let x: Vec<int> = Vec::new(); for _ in &x { panic!("moop"); } }
index 25d625e27f6ddd40578fad4ef9424085a830778b..bc041259895f9c698ec384e0d7129a4cc1704109 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = [1; 100];
     let mut y = 0;
index a4988bf016cf2caeba27cba89f9e8c9939cba5a3..cc02ee1459b5ee0f04e8935dc317a03d902ba0ff 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections)]
+
 extern crate collections;
 
 use std::collections::HashMap;
index ed4328d94fe34b89a5eeddbac020979ae6131912..065e4cfb7682bfa76ec9d7832e32d7bf31950c0d 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections)]
+
 extern crate collections;
 
 use std::collections::HashMap;
index d9abed501237c15892c179958415a839468805b0..60cfc9be0787a5f5966ea0b03b9f7a25d1b892db 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = [1; 100];
     let mut y = 0;
index 3817e1b0edace950ce3f320474ef3881e92cf4d5..a075c08b737e04d9d7b09b2d2cbd7e4cbed02397 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = [1; 100];
     let y = [2; 100];
index 8403a1669ffcf5fecd6e2fe8f688fab6f1ec4fe0..2248132d828d15ef3bf7edfa232e1254846c1d4d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = [1; 100];
     let mut y = 0;
index f6466994955e79e537a65dd8779a46f2e079781b..45e57e8a7e8d36d5af30b687b9679f7bda8bfb07 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn two<F>(mut it: F) where F: FnMut(int) { it(0); it(1); }
 
 pub fn main() {
index 9e05f38af7a4889493ca692612af97ce5c00b89e..3c5abba902dc15dea3b37d8a9a56f414bcab9ec2 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // ignore-aarch64
+#![feature(libc)]
 
 extern crate libc;
 
index 39c7d6dda0d0a1f75cd0f0ed31b936c0ec8f5130..fd779d665071d337c0b57d94aafa8057a6a0218d 100644 (file)
 
 // calling pin_task and that's having weird side-effects.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 mod rustrt1 {
     extern crate libc;
 
index 172ece0c4bfd94ccc8bbfe861bf774eb49887187..b7fe3705e10a5a31b328d23411ba6ce6727ea488 100644 (file)
@@ -9,6 +9,10 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc, libc)]
+
 extern crate libc;
 use std::ffi::CString;
 
index 09317abce921d9383e5f28668220a2a1a938e16d..4c0633d49c65fbcf36523f33b7d6ba344af8b73a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Copy)]
 pub struct S {
     x: u64,
index 03023f032335fafa8f7c57336ba5573c16bedb2c..70d4801ae3b3c54b6751307affcff0696be40840 100644 (file)
@@ -9,6 +9,10 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 extern crate libc;
 
 mod foo {
index 2af02feb21d771445e00d57e7356947e3dda1a12..a9b3f60566d4e9326008cda848a8fdb79b8dca18 100644 (file)
 
 // ABI is cdecl by default
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 mod rustrt {
     extern crate libc;
 
index e242071fb26bc42d37f21749da066166631b55ab..8b48731ee0ba05bb51f6edc64859793884e5f94c 100644 (file)
@@ -10,6 +10,8 @@
 
 // Passing enums by value
 
+// pretty-expanded FIXME #23616
+
 pub enum void { }
 
 mod bindgen {
index 5ebc4effb3718775e0be521deda499c5568e69c0..d83bd940d197808fd8c3af284097e6b6de44ea5a 100644 (file)
@@ -9,6 +9,10 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 extern crate libc;
 
 mod bar {
index 9670d2de3efcab1aeac50b163cae1e39ef65a503..bdbbeaa9511cdef86eaedd4de718a7408e23ed4d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     use std::f64;
     let x = "NaN".to_string();
index a15a176c2238d576f1ec0ff7d4b4d9365496c8cd..71934b42c33f510ed8bf9befe8fe1f6a1508982b 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(lang_items, start, no_std)]
+// pretty-expanded FIXME #23616
+
+#![feature(lang_items, start, no_std, core, collections)]
 #![no_std]
 
 extern crate "std" as other;
index 2122759b3d3ee963224146f00e00c264e0745fed..ce26fbd4c00f9e7546f633c141e5ea237c338c51 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::cell::RefCell;
 
 pub fn main() {
index 0f8d7c24360fb40c874f5bd25a5eb53675843892..e04fa36d80b4c8dfd3902445d7de6ae701bdcfc1 100644 (file)
 // Issue 4691: Ensure that functional-struct-updates operates
 // correctly and moves rather than copy when appropriate.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, core)]
 
 use std::marker::NoCopy as NP;
 
index 3955bedb168aeb373fad6b1ce6fae029b18a0e37..526787c8b9c9e46c11204ac3dddca9c9bf344cb8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn ho<F>(f: F) -> int where F: FnOnce(int) -> int { let n: int = f(3); return n; }
 
 fn direct(x: int) -> int { return x + 1; }
index 4bff06f2a03825f5f87bf8981930f8c1af736c0b..b04377d3616c44966bc3d87f1e39c337f2546673 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 fn f() -> int { return 42; }
 
 pub fn main() {
index 581f71a737651a59f5fe1abfcac2eda76e3fd6a8..4476ce309c478e63cdf956cbbf0d994686ba35bb 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we do not leak when the arg pattern must drop part of the
 // argument (in this case, the `y` field).
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 799b865bd2d7aa5c91d50d27cadd4b42f05716c0..5893eec63f02754482387ce6d05f13727fbf1510 100644 (file)
@@ -14,6 +14,8 @@
 // boxes. Make sure that we don't free the box as we match the
 // pattern.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
index 97ba561baea39a45450b5fad2d031a0474850a71..2eb6279455ea3cffb83aeac0abe58e481c04faa1 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we can compile code that uses a `_` in function argument
 // patterns.
 
+// pretty-expanded FIXME #23616
+
 fn foo((x, _): (int, int)) -> int {
     x
 }
index bf02b82d1a0754d5fbc8678965a4652417296aea..c76d942575c425608f375507f747a4f68dba6c22 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:default_type_params_xc.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate default_type_params_xc;
 
 struct Vec<T, A = default_type_params_xc::Heap>(Option<(T,A)>);
index a2f7bdfd81709f80ae7397647b9431a67c99fec2..7265b021adc467f052568076d4332d33d97c3dae 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 062ee507864bbdf18eb46050b98369943ebfa295..4ea05a375d11121b614eb37ca13796ba2e8a790b 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::num::Int;
 
 extern "C" fn foo<T: WrappingOps>(a: T, b: T) -> T { a.wrapping_add(b) }
index 2f88a54e3f5e0535bf1e51df0cd9fec312b4b60b..0eb17c41307d0a40985a57a2eb361222897a5e95 100644 (file)
@@ -13,6 +13,8 @@
 
 
 // Issue #45: infer type parameters in function applications
+// pretty-expanded FIXME #23616
+
 fn id<T>(x: T) -> T { return x; }
 
 pub fn main() { let x: int = 42; let y: int = id(x); assert!((x == y)); }
index 6b503e711e9d3787f139475e7852304019776716..04a8824abedcbdc2efc4cf1153b6a4dd3bf75bfb 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 mod foomod {
     pub fn foo<T>() { }
 }
index eb0546063f7154396245fd1a5735c19732f1e3d2..b14a6101225e799a8ebd5a61f969db5131cb26f6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum wrapper<T> { wrapped(T), }
 
 pub fn main() { let _w = wrapper::wrapped(vec!(1, 2, 3, 4, 5)); }
index 4e3c820405263952d4eb897b0a002abd55bd6f4d..24b517280007894df71ac317d2862fa78e9582dd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct S<T>(T);
 
 pub fn main() {
index 986b35cbecf96ecbe4a795d60bbbc415da7c290d..4934b9de36c6f7dca266e0b0b76d57829cdf3243 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 010f54dd55934ea53c425066dd4bb67dde200c85..49f8d6a3adb520f89112a97519a30b9485ed09bd 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 trait vec_utils<T> {
     fn map_<U, F>(x: &Self, f: F) -> Vec<U> where F: FnMut(&T) -> U;
 }
index e39957e2bf2ef879570b3da0e20d84ce4985da63..d61ae520ada890eaffb9efd315ce2729c02af2f8 100644 (file)
@@ -12,6 +12,8 @@
 
 
 // This used to cause memory corruption in stage 0.
+// pretty-expanded FIXME #23616
+
 enum thing<K> { some(K), }
 
 pub fn main() { let _x = thing::some("hi".to_string()); }
index 24c31ab4ee66f7236f44e615279b6fe1f56ae342..9518d590279fc2ce01aeba06d539282b8fc6af02 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 enum clam<T> { a(T), }
 
 pub fn main() { let _c = clam::a(3); }
index b0d4944ba540b6ea123061115409e857c2db6841..38f6707d9eff3be31c4165204e60a6bac3febbaf 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 #![allow(unused_variable)]
 #![allow(unknown_features)]
index a1cf581fe4a81eb35169e9d2052526949bdd5984..2b3bd5ead94a2049c7cca721ea6848260a5e64db 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 struct Foo<T> {
     a: T
 }
index 0ff7cedc6c5f1d64c3cf270b4e4a5160a7bb3e87..6f93ae0d42bc2e586ab3ff11b8cb39f7407e13d7 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 struct Pair<T> {x: T, y: T}
 
 pub fn main() {
index 1d39c47417c1002c8748149775b521a6f6bb0672..4c5072b10c96726222c81151505a57487ca76405 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 3c89900fe493bad40d3d106d3948b9cfebe9c862..52b06ab2928af8dc1884dac36a970b03f3e9ba55 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(rustc_private)]
+
 extern crate getopts;
 
 use getopts::{optopt, getopts};
index 618916e8569079822d47e5dd1ad087e85c3884f6..73c15382d9ea574027c8dba7a229a6c7807dfed6 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn f() -> int { return 1; }
 
 pub mod foo {
index addd6a63836f3512b033ba144a715b620f42d5f3..f038353ada27abf709d8f8e917d240fa0b11408a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Copy)]
 enum Q { R(Option<uint>) }
 
index 188106ec107887ad751be3574a317afc526a2556..59e7c3782e11156b0794ccd3e43d8e0dcd2af92a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Copy)]
 struct Pair { x: int, y: int }
 
index 81c4054d0091013a9d9ff2fccddb52e32f327965..93ff18207341136f9b02c97154eb772a2fa82a34 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 #![allow(unknown_features)]
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, std_misc)]
 
 /**
    A somewhat reduced test case to expose some Valgrind issues.
index 5a793f7065a41fa6a0c93ac5c7e792a79fc1f1bb..495c1ccf1f4fbff65c1fea9a02eb1705337b7e43 100644 (file)
@@ -13,6 +13,8 @@
 // `&Typer<'tcx>` was getting an incorrect binder level, yielding
 // weird compilation ICEs and so forth.
 
+// pretty-expanded FIXME #23616
+
 trait Typer<'tcx> {
     fn method(&self, data: &'tcx int) -> &'tcx int { data }
 }
index 9e857a33245d16be5b060469a0d0a548e8a3ddc0..9cb588b101047e8a6077529069f9772159ba025b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Typer<'tcx> {
     fn method(&self, data: &'tcx int) -> &'tcx int { data }
     fn dummy(&self) { }
index c8992afe36ac71870b2d345fb6f7a3b054d8f64e..676c7b8245a64870b5b065211d3b1afce66ecad7 100644 (file)
@@ -10,6 +10,8 @@
 
 // A basic test of using a higher-ranked trait bound.
 
+// pretty-expanded FIXME #23616
+
 trait FnLike<A,R> {
     fn call(&self, arg: A) -> R;
 }
index 4067b922cfd6b18ef149758adb2e1851e7d3913f..d837dafc759ba8a76bc3cc592cdac9ee26707313 100644 (file)
@@ -10,6 +10,8 @@
 
 // A basic test of using a higher-ranked trait bound.
 
+// pretty-expanded FIXME #23616
+
 trait FnLike<A,R> {
     fn call(&self, arg: A) -> R;
 }
index 7b16bb867e79c30004a1ac777e9a0c8fc2efe591..8ececb3875acb045de742c8652c39517b11e6eae 100644 (file)
@@ -16,6 +16,8 @@
 // did not consider that a match (something I would like to revise in
 // a later PR).
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 use std::marker::PhantomData;
index d5307c09103a1351c01d24a2e5a71bd3658c9a7f..ecd0bc681c313c46cfe8ba09ac2d0d6fe5cbbf72 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we can parse all the various places that a `for` keyword
 // can appear representing universal quantification.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 #![allow(unused_variables)]
 #![allow(dead_code)]
index 88e6de6d3e6ff6fb93d8aef6bd74bf0cf616f804..f27fb29717611ed14f72656ea23a9bf02871ee71 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 // Test that `F : Fn(int) -> int + Send` is interpreted as two
index f4daf9a4f629789696ce65177ad9f18ea75235b3..2c247c8099057e2965f5e65c1376049f12955bb3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(unboxed_closures)]
 
index 9b37b8e49ef3c5c247639548a813c6f95ddd4af5..bdebadd54112cfc89de9f4a839f541f6d43bdaba 100644 (file)
@@ -10,6 +10,8 @@
 
 // A basic test of using a higher-ranked trait bound.
 
+// pretty-expanded FIXME #23616
+
 trait FnLike<A,R> {
     fn call(&self, arg: A) -> R;
 }
index 1b62a8e809c89dd2b4842ab4a96372f6a6ddbe5d..7741f1904f6ab1ccbc5d1e3ed7104cbc5846b42c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 // A basic test of using a higher-ranked trait bound.
index c90c3643d4e54f8dd5d301ad635b662260f903c0..1f63349b2d8da807589b1825449ac5a22af26355 100644 (file)
@@ -12,6 +12,8 @@
 // PrinterSupport<'b>`, gets properly expanded when it appears in a
 // closure type. This used to result in messed up De Bruijn indices.
 
+// pretty-expanded FIXME #23616
+
 trait PrinterSupport<'ast> {
     fn ast_map(&self) -> Option<&'ast uint> { None }
 }
index 5083bd23207306be0fe056e17c259dde134666c0..2345bb01d8ae98e5564eb42ef689f1973d9e7b7e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem::size_of;
 
 #[cfg(target_pointer_width = "32")]
index 3969394a26b93a9daaa6a7c75722b1b268aa7db3..8421f47e94d8c68ce0bccfa209a83319a7d47836 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod x {
     pub fn g() -> uint {14}
 }
index 0d8da2a93482f4649bd1ec7c351bd88cf63fba3b..2d530275ea21fda957fb6fa8ef31ced39ee9d139 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! loop_x {
     ($e: expr) => {
         // $e shouldn't be able to interact with this 'x
index cebfd89d8aae696295669b13aaaeb0380fd01a82..2cc4e880bbf5ea27f12a509b7b87088f1bde1087 100644 (file)
@@ -11,4 +11,6 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() { let mut x: i32 = -400; x = 0 - x; assert!((x == 400)); }
index c91e738b822dcd58f32155e180a055991fe3e1ed..5dd53a268b1358a9e04fdcb2e47ed1446017a241 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let mut x: i8 = -12;
     let y: i8 = -12;
index 2d2f77b099151037d97b4784f29df0d96cfcfe9a..1286b29309a295ece557ae47de39ff97b047c368 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = Some(3);
     if let Some(y) = x {
index b589c083a9789df02acc4d0b2eb7882d9b9eeb39..8d475a99b818833ac41830362b72b7ac02c4ed74 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo() { if (return) { } }
 
 pub fn main() { foo(); }
index 65fc24ae74630d87def6c7cc88f3064b6d4c8c29..839ec6457e175d9073e5a0bbac7f9831659d79da 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(advanced_slice_patterns)]
 
 struct Foo(int, int, int, int);
index a33fc4f2e7402204de52172e1d39ea64071676ef..33a44b3bcd64601a1807d0eaaaf29325158df926 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum option_<T> {
     none_,
     some_(T),
index 663ed24d60e48483ba246e1f41a977f2aa94fea8..210bc34bcd1db1ea3035eb3c18d7a419bf7b3253 100644 (file)
@@ -12,6 +12,8 @@
 // with the same name, which can be called on values that have a
 // precise enough type to allow distinguishing between the methods.
 
+// pretty-expanded FIXME #23616
+
 struct Foo<T>(T);
 
 impl Foo<usize> {
index 3031228b3ab44f5361fd2a6263e4dc706381a3cd..26f12e9730b2abd6f9c8777c52c5e52d8dcc9997 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo;
 
 trait Trait {
index c1dc68b245655b2c521be9d7fa012e50e12169a9..2ba7375d67a645450695222449ecc5e94e77a432 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod foo {
     pub struct Point {
         pub x: i32,
index d7e53f3c38ff793eafb667a9df41e8addc6d6adc..97945f4c4dac347630c06c3f8f80f5ef98ed40e9 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:impl_privacy_xc_1.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate impl_privacy_xc_1;
 
 pub fn main() {
index a949f25f41e095a5e83f86d27f3724b1c6ace29b..39c175f60da41181265162db4b5dcc571e22085a 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:crate_with_invalid_spans.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate crate_with_invalid_spans;
 
 fn main() {
index 38602bef229bcecb09c94a42f6f828228fb40009..9ac35fbb38756b9530f4a55a85d014e54341f852 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use spam::{ham, eggs};
 
 mod spam {
index f7874cc56fc77ecd81ccdb0b1a442d9f1c38f1c3..eb9ec6fe985ac94334a89683f1b0d3f4023fa236 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 
 use std::mem::*;
index 4567651e892f5c14cd9fbb532cf34806871e8165..532cdbbee3cd49e3ae9ad7efdfe5954b4f6ff377 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     use std::mem::replace;
     let mut x = 5;
index b46f81479bf0437353236303ed18267a8527cb99..c47448536223ca2b162fd0d9d5899c9d2b6a6933 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use foo::bar::{baz, quux,};
 
 mod foo {
index d87b59537df8f120968480a5940df427dfc4dd62..9a0d8e201c24391229b548042b71551bedf51026 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo(_: &[&str]) {}
 
 fn bad(a: &str, b: &str) {
diff --git a/src/test/run-pass/infer-container-across-object-cast.rs b/src/test/run-pass/infer-container-across-object-cast.rs
deleted file mode 100644 (file)
index 979e76b..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Given `<expr> as Box<Trait>`, we should be able to infer that a
-// `Box<_>` is the expected type.
-
-trait Foo { fn foo(&self) -> u32; }
-impl Foo for u32 { fn foo(&self) -> u32 { *self } }
-
-// (another impl to ensure trait-matching cannot just choose from a singleton set)
-impl Foo for  () { fn foo(&self) -> u32 { -176 } }
-
-trait Boxed { fn make() -> Self; }
-impl Boxed for Box<u32> { fn make() -> Self { Box::new(7) } }
-
-// (another impl to ensure trait-matching cannot just choose from a singleton set)
-impl Boxed for () { fn make() -> Self { () } }
-
-fn boxed_foo() {
-    let b7 = Boxed::make() as Box<Foo>;
-    assert_eq!(b7.foo(), 7);
-}
-
-trait Refed<'a,T> { fn make(&'a T) -> Self; }
-impl<'a> Refed<'a, u32> for &'a u32 { fn make(x: &'a u32) -> Self { x } }
-
-// (another impl to ensure trait-matching cannot just choose from a singleton set)
-impl<'a,'b> Refed<'a, ()> for &'b () { fn make(_: &'a ()) -> Self { static U: () = (); &U } }
-
-fn refed_foo() {
-    let a = 8;
-    let b7 = Refed::make(&a) as &Foo;
-    assert_eq!(b7.foo(), 8);
-}
-
-fn check_subtyping_works() {
-    fn inner<'short, 'long:'short>(_s: &'short u32,
-                                   l: &'long u32) -> &'short (Foo+'short) {
-        Refed::make(l) as &Foo
-    }
-
-    let a = 9;
-    let b = 10;
-    let r = inner(&b, &a);
-    assert_eq!(r.foo(), 9);
-}
-
-pub fn main() {
-    boxed_foo();
-    refed_foo();
-    check_subtyping_works();
-}
index f240a5e6de55fd64d5650cbb69cf90969bb0a731..c599f2249996a6d19f3c41ad93a74ad533fff3d6 100644 (file)
@@ -11,6 +11,8 @@
 // issue #680
 
 
+// pretty-expanded FIXME #23616
+
 fn f() -> Vec<int> { Vec::new() }
 
 pub fn main() { }
index be561dfffa6f91a34bd539a29999c8024aabcaae..fcbd4b332318eb6072adfaa04a819c478063be25 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = 2;
     let x_message = match x {
index 9674c86b379a53195660c5d900771040f40971fb..042268435c7af88460ef206dca345c3572afd18b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo;
 
 impl Foo {
index 8ee6054f8ba5634cdcdb97663cfedbe33ce5cc30..ca4dba4198c036d801986731ec7b8a2e195b53af 100644 (file)
@@ -12,7 +12,9 @@
 // Doing it incorrectly causes massive slowdown in LLVM during
 // optimisation.
 
-#![feature(intrinsics)]
+// pretty-expanded FIXME #23616
+
+#![feature(intrinsics, std_misc)]
 
 use std::thread::Thread;
 
index 4ee06d44e65656a1f8957c09f0722f8619a5a9ad..3d1fff7b5f0c316b9de3520efc8af76a72dc6689 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 #![feature(unsafe_destructor)]
index afb2b21b04ffa637add6be24dee423b7585ccd02..a807e582ff464ce71f9f0cdb66bfde8907131f9c 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 struct Foo;
 
 impl Foo {
index e4026a8fd0118a7fd5ea44920cabf0072ddb4548..48f2006ed59ba142dcdae26e10a027d58b33a2da 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:inner_static.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate inner_static;
 
 pub fn main() {
index 35897d5b823f1e9dcc628dabb704fad5eb58a0f8..e4a3f2c8d1d4b847076b4f5832da0c3612d93126 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::ptr;
 
 // check that we do not report a type like this as uninstantiable,
index 169be054282043a0ed38f74ddf50ae7c1d56d9c9..09d6501267d7063c47e93d7411d387df430c522f 100644 (file)
@@ -11,4 +11,6 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() { let _x: int = 10; }
index ea8825d22dffde280dc3530abb4f92007aaa114c..b782925fa93572387ac00fcbd5df9dbcdd12ddf2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let a = 0xBEEF_isize;
     let b = 0o755_isize;
index 77e7ee6264319d1d78bee4baa081fd3273ae7c15..e953cf2fda1af9bce4a83dceeba8a765845e7ca9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo(_: *const ()) {}
 
 fn main() {
index 542efe334597f83c682dd07f85126dce2f9f75ba..35da4b8a9364bb3cc59c6b1d2ab28c35266fadd5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     fn id_i8(n: i8) -> i8 { n }
     fn id_i16(n: i16) -> i16 { n }
index 01e305581f14e6129e7ffb4d23eea60556b58b8a..5bf8a4bc8f70740e840069c8754052a9d0f657ee 100644 (file)
 // propagation yet, and so we just saw a type variable, yielding an
 // error.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::u8;
 
 trait IntoIterator {
index d111462ed5a318510692c55a2f179e507fad0d16..c970b17d2a1d49353ea94fca27bb2891ff7ab4c5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(intrinsics, main)]
 
 mod rusti {
index 837c2d21513de88e392dacb006dbc06a9d72bed8..fc886d7e30165023cf33926a5c62677f9d99f051 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::intrinsics::assume;
 
 unsafe fn f(x: i32) -> i32 {
index e6a81dbe5d95f9d68c774ac27c87b702c7d9f062..c5fe02b9190d4dd28799d72ca526d76a670d8795 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:cci_intrinsic.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate cci_intrinsic;
 use cci_intrinsic::atomic_xchg;
 
index 1d7a74b042fac815fb7dbc48a9f70873122d607c..61a9f6109a3e8882b2836d125a16c50a4bfea732 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 #![feature(intrinsics)]
index 09dd5304ec5c21a2a75bdb0bf22c4c270507ff47..89aea93e7b35a5a3f535b2a53ea13c590ebe9402 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 #![feature(intrinsics)]
index 99578abed38e75ec1f796a53d59841d380dd1e1e..ff6346943dbcd5182a8331e39afe2d309e3f438a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(intrinsics)]
 
 use std::ptr;
index 34fd8effd4912de05a826f1a6002ba0491017ee9..834455d560e42a9a542ccc30fe3a9b5712cc806e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(intrinsics)]
 
 mod rusti {
index 5e8b758cdf68f873dec08f8ff88690caa65a7c99..c095ad1a070df906e55b4979c607749cbfd62ccf 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::intrinsics;
 
 // See also src/test/run-make/intrinsic-unreachable.
index e5724c1e0dc16ce81e211089b6097bf5ae0a94e7..a4661410ad6c0e14762248f746b9a2ccbb9cef8d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(intrinsics)]
 
 mod rusti {
index 028b2bfb0ecdb88184713d10b0891c3f71fccbd5..841ff297a2ac7ded3ac3396af8d6b8d2c078cad3 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(intrinsics)]
+// pretty-expanded FIXME #23616
+
+#![feature(intrinsics, core)]
 
 macro_rules! assert_approx_eq {
     ($a:expr, $b:expr) => ({
index ef5ef2f215cc25fdcab8966cc3ff9d75cee4f0cb..1aae8131d80080e301a46abd23a7a3ef65c099f5 100644 (file)
@@ -14,6 +14,8 @@
 // successfully (and safely) invoke external, cdecl
 // functions from outside the crate.
 
+// pretty-expanded FIXME #23616
+
 extern crate foreign_lib;
 
 pub fn main() {
index 51adeea394ca9371bf04023b5342f10165743629..0c2fbb01f48f475179b6a3ad366c1dcdca007126 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let ((),()) = ((),());
 }
index 8f494ea81fcb329517be35aab0da3a8303151a9d..1ca2476a1013b7f953a37726a1ac91777fcab31e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 unsafe extern fn foo() {}
 unsafe extern "C" fn bar() {}
 
index 826c23a782bf18a5ff1312029ebc7f6ffe40e97b..fdaa71d1cfb4c9e0918dce0b714e754f82f22102 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-10028.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-10028" as issue10028;
 
 use issue10028::ZeroLengthThingWithDestructor;
index a94ed4ed5b90a29df8cf37423256e164eebd903c..4dc1487b9af949fe515929a89ced95ff375a3d0d 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:issue_10031_aux.rs
+// pretty-expanded FIXME #23616
+
 extern crate issue_10031_aux;
 
 pub fn main() {
index 52b6677428727dd13f76bf6610d3ad496f883ec9..b5c97bd10edfe8082791e79334e54bf6031a0e28 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum StdioContainer {
     CreatePipe(bool)
 }
index 1aa9c96de1a9418f66ae165e73fd98cac338e52e..29c5a8208baecc448dd023fcd9dbbe03cf879e32 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct A { foo: int }
 struct B { a: int, b: int, c: int }
 
index da73c4b27ac4420e8b2145fc0b0a49c0e0f108c4..10b4162305432e5391df1a1b5211725a01ffc06f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub struct Foo;
 
 pub trait Bar {
index 29e4801d0a9aac66aed21b86449825d18234fd72..2c0811b69e020916669b925221e8540eae816d16 100644 (file)
@@ -12,6 +12,8 @@
 // Make sure that if a process doesn't have its stdio/stderr descriptors set up
 // that we don't die in a large ball of fire
 
+#![feature(old_io)]
+
 use std::env;
 use std::old_io::process;
 
index bc77b4c534311f0115a3fe3966238d206d4882d5..379bdffbbb22f11a289c0945ebd3a1fa0937d8a4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     //// I am not a doc comment!
     ////////////////// still not a doc comment
index 883e52b61d081bdaae2e6e4d46c399ff9922d2bc..ba003c0b1ba73af5208a3636aa10c9cf2afcc87f 100644 (file)
@@ -11,6 +11,8 @@
 // Regression test for issue #10682
 // Nested `proc` usage can't use outer owned data
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index a01d2e6f1a9ed90873de03e2efd58fa2e64f1c41..eb2177202a22b526240471c39bec9acfd6e0109c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::ascii::AsciiExt;
 
 static NAME: &'static str = "hello world";
index 90e87f96f7899e54edec7a9dad75b6d9fa140c65..795ad8fb35b82389df0ebe328083c21b6677fc0b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum v {}
 pub fn main() {
     let y: v = unsafe { ::std::mem::uninitialized() };
index c3ec3fc40e30a77559d095e4d16ddef29ff17fbe..0a6e454e181a493972fc84f51d3a9b9f7cb29d50 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 fn f<F:FnOnce()>(p: F) {
index a6af2327c9e8096f73cea2876aadb63e41742a2f..27773a42abb4bbc45db8374402d6c117afd72b1b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_no_drop_flag)]
 
 static mut drop_count: uint = 0;
index 92ea6026ff66cd06f54b0ad4364d55797c459188..3789b93ad76c9a684f67ab3ab6ceb57bd3ea7cd1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 extern "Rust" fn foo() {}
 
 fn main() {}
index f824b5fd4dcd8db53b67744a8a5949e8a69ea615..cfabf699fa278ea02fc290187114b2285d2a830e 100644 (file)
@@ -8,4 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 extern "Rust" fn main() {}
index c717053cffc74d10424f7fc5fac0afccd6161e41..9d680d1962f8f7a515e0a4146eef4aea0c256360 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 48ea00e47d696a70c2ef4bd6c72eb7b1e6d12a2d..bb322635094e549357638065e6fe738d8451e2c3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 69a23e8099076a6ebe94b85d6559debca3ec8890..5b8828cf0b550fbf9cb4d6545a404076a69b48ef 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn foo() -> int {
     3
 }
index 1717075885d7a1bfd2449762e9d68b41bd1e208b..2e6d278037902459c4e3416eaa9e7ab98401199e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![deny(missing_docs)]
 #![doc="module"]
 
index 7fab6662ee01c3d3ee02d3bca9b5e9cf55228654..9f0417a8be9ba78b20cda8f0cb74cdd7f5a230bc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub mod two_tuple {
     pub trait T { fn dummy(&self) { } }
     pub struct P<'a>(&'a (T + 'a), &'a (T + 'a));
index 9440e0c2874a0cfc1ec1b000bbd2aaa21c30adb0..4009d2a7d313fa1641657040d0f8bbec720dd9a3 100644 (file)
@@ -10,6 +10,8 @@
 
 // compile-flags: --cfg foo
 
+// pretty-expanded FIXME #23616
+
 struct Foo {
     #[cfg(fail)]
     bar: baz,
index 2ade0df7f6b68811ad371c9359237826bd0cdb1a..b3187d889a1c490e521386da4bf5f816a41743b9 100644 (file)
@@ -11,6 +11,8 @@
 // Issue #1112
 // Alignment of interior pointers to dynamic-size types
 
+// pretty-expanded FIXME #23616
+
 struct X<T> {
     a: T,
     b: u8,
index c67ce92ee0a9acebcc4bb53e0b876e0fd3728656..70bec062d17a5888a621e3618483d672d3b544bf 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
index 02c82d9c9474b0913473ffa7615db31f85cf948a..f226e25eaa4611b3d7301d16e6381c94037ca5a7 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-11224.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-11224" as unused;
 
 pub fn main() {}
index a45d129ade2f9fec24923885d2b237f77ce7a7ee..e960558e52c8ca3aaf71ea445e17389717b0f71a 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-11225-1.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-11225-1" as foo;
 
 pub fn main() {
index f07957b30ec9fe4afb9db680109df052bdbf9c62..56144edb5c74484563fa65b9c18504a41cfa228b 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-11225-2.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-11225-2" as foo;
 
 pub fn main() {
index 26634fabf5a1542f51726873c768f0689c67057b..5b4bd6c9f2bfc2edb42f6da74739bb287194d4bd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Common { fn dummy(&self) { } }
 
 impl<'t, T> Common for (T, &'t T) {}
index 4a74e4be4ce573811e82fd5461975633530eb696..535fc3669911a6bd02e56fa041411b9a57c403e8 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-11529.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-11529" as a;
 
 fn main() {
index b99a5b7ab37c51198f1a18e3f15f086a5de5f419..bf5ad945b9f4370bc3fa165304826081163db1c8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
index 687de48474058dd857b1cb5543317b8d68f6a257..06d5b66b3e8502ae1dbd7c8dae77624edf3f7c7f 100644 (file)
@@ -1,3 +1,5 @@
+// pretty-expanded FIXME #23616
+
  // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 3c69377b375c6597cd865aa23f5af8cdb3ef1125..de1b0525d84976f16feda9021c353d9ef6fa8805 100644 (file)
@@ -12,6 +12,8 @@
 // We weren't updating the auto adjustments with all the resolved
 // type information after type check.
 
+// pretty-expanded FIXME #23616
+
 trait A { fn dummy(&self) { } }
 
 struct B<'a, T:'a> {
index 4b2b3e8702427fc8725405d37e887b1831faff2f..1edd1d137a9291bafa3a987988101b9b1b58d981 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 // this code used to cause an ICE
index 4a07b5fc432c2bd99770e7cc59877eb09a695e6d..da3efb4fea8cac85ca6c1d5557ba8810547586a5 100644 (file)
@@ -15,6 +15,8 @@
 // when this bug was opened. The cases where the compiler
 // panics before the fix have a comment.
 
+#![feature(std_misc)]
+
 use std::thunk::Thunk;
 
 struct S {x:()}
index c6e0a5be76333f3c132b4fc6c2c06ec87ec2506e..72cc8d470d054537dd0e2d9b6b2b1130b778d4bc 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections)]
+
 extern crate collections;
 
 use std::collections::BitVec;
index f7aaf4953774a375ff856e4c40a7e0a2af20c50b..6d2243db30070a278ebd940443184e077a185900 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct NoClone;
 
 fn main() {
index 12a6d9a82c7b014d2b019eeaa9df4ede82d44ddb..8a9b3e4b1434e8678c18d4a49f2d2568f79f7f5d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct A {
     a: String
 }
index bc907787c7cc014314e051d2418ea10917fb55b9..4044468c3fe7c7326bcaa5733c4e3889f31fc683 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(old_orphan_check)]
+// pretty-expanded FIXME #23616
+
+#![feature(old_orphan_check, rustc_private, old_io)]
 
 extern crate rbml;
 extern crate serialize;
index 1540679b099b43b45f8fcaeb302ceefb1385fc2d..8732def0a1a1100ff85bcb66973fa41b17c41cf8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 const TEST_STR: &'static str = "abcd";
 
 fn main() {
index bb34dae77b344874fcf5123da8660bef9b22b61e..ed2009dab1bafe73dc01579b4420ed77a2245017 100644 (file)
@@ -8,7 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![forbid(warnings)]
+#![feature(std_misc)]
 
 // Pretty printing tests complain about `use std::predule::*`
 #![allow(unused_imports)]
index bf5976e9217f24792d646b99a32512fac2e305ae..7e5b0c2230141cacb2ebdfe7557a7838ad939bb7 100644 (file)
@@ -11,6 +11,8 @@
 // aux-build:issue-12133-rlib.rs
 // aux-build:issue-12133-dylib.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-12133-rlib" as a;
 extern crate "issue-12133-dylib" as b;
 
index 50977a7e039e4e8a91b2e6b0036f9bf1d031418e..76bae09bd49422e8f042b5747832780d46a28fae 100644 (file)
@@ -12,6 +12,8 @@
 // aux-build:issue-12133-dylib.rs
 // no-prefer-dynamic
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-12133-rlib" as a;
 extern crate "issue-12133-dylib" as b;
 
index ab990e55295aa2c92d8e0a927fc7b557a0e6b180..514cfeab6af1a64419b78e1019f69921dcec9cb7 100644 (file)
@@ -12,6 +12,8 @@
 // aux-build:issue-12133-dylib.rs
 // aux-build:issue-12133-dylib2.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-12133-dylib2" as other;
 
 fn main() {}
index 563771212aa3df8df9860b57b2143ae166a037d8..3a5b7e86920d74313c0ed0ab5534d8283eb33fea 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct S;
 
 fn main() {
index debb7df112597252612e0d3cebaac5898d68ce6e..ddd30ed3bb0c08a1ecee892225a43ec94a9b8155 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 #![crate_id="rust_get_test_int"]
 
 mod rustrt {
index 7d5bd9d6a74db57c3614deece86a932dab8f0bbf..44ebe362c729dacd0d1d65eaf712fc33a75fc8b1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main () {
   let mut line = "".to_string();
   let mut i = 0;
index 9ceb7366e403db935cf242145f27fd1e14519ce8..8a23e43d59ed08a6ac4ce1a855f5bf13b9385c93 100644 (file)
@@ -11,6 +11,8 @@
 // aux-build:issue-12612-1.rs
 // aux-build:issue-12612-2.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-12612-1" as foo;
 extern crate "issue-12612-2" as bar;
 
index 6b3fa587bc55b5560d54984f4996289cc2b60780..331f9d991d681ab0173059ad9673d1d001122076 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-12660-aux.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate issue12660aux;
 
 use issue12660aux::{my_fn, MyStruct};
index ef68daa8ce592a594d30e4b0b1fc1f5287b98024..493bdb30e35bcb7ec28c0bc3e91859ab53dbe1f4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let s = "Hello";
     let first = s.bytes();
index e66b5d21e17fabf498b081f82d788b015a246802..2b89915516469b4b0efcc55c425420f838bbe5ef 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(old_io, std_misc)]
+
 use std::time::Duration;
 use std::thread;
 
index b55d64777537ec4424f14a5fab03ac2725d36e52..ac5a9b728b992270655cacd6ada89a195318b721 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(old_io, std_misc)]
+
 use std::old_io::timer;
 use std::time::Duration;
 
index 9bf4c94d7e397d379124f98358ed8ace59a81aa2..1852ed212862f56353892cb1ceb31e4ea6651de2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub struct Foo;
 
 mod bar {
index a05cc9c0f74c241a16f0331650fb57b1f34e7e0d..6b66c640b6b5dc0d44ff7b9dd054780db903931e 100644 (file)
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections)]
 
 extern crate collections;
 
index 11a2e52cf9767a7da97f3cbaaa194721389c25fe..dd541ff948c9d01629a7d52295703be623bcd2c8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::collections::HashMap;
 
 fn copy<T: Copy>(&x: &T) -> T {
index 64807dc44e061002632daecc7ade4bcb8a94eb7c..14de9e90306bc6b8adf31f455d1298c61fe272fd 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::marker::MarkerTrait;
 
 trait Foo : MarkerTrait {
index 21b54ba0e793b2807261ac09ac89a8c7694fea8e..304d0297424647ed69bbfa72c02c11b6b9efd64c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::slice;
 
 pub struct PhfMapEntries<'a, T: 'a> {
index c29dc4319dc0cb87ed2065414c6c9079c9f270f2..904b8feb884b961882ef672a670323546f6c6a2c 100644 (file)
@@ -11,6 +11,8 @@
 // Test that when instantiating trait default methods, typeck handles
 // lifetime parameters defined on the method bound correctly.
 
+// pretty-expanded FIXME #23616
+
 pub trait Foo {
     fn bar<'a, I: Iterator<Item=&'a ()>>(&self, it: I) -> uint {
         let mut xs = it.filter(|_| true);
index 191e9ce8b6febfcc249b293cdf72e35ba065af98..7a3d3f4ff485a8e0e1ba04f6ad228e1e36488b2c 100644 (file)
@@ -11,6 +11,8 @@
 // defining static with struct that contains enum
 // with &'static str variant used to cause ICE
 
+// pretty-expanded FIXME #23616
+
 pub enum Foo {
     Bar,
     Baz(&'static str),
index 329ab7c921dda3ebe476af0fb67d00ba0e6d6e3f..34960b264567db037ec4a02c1da52efbba6d4bd3 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 extern crate libc;
 
 #[cfg(windows)]
index 3c76a827fb2958e546f145bd2e865bc489602b7e..07da2b286c27b9a060aa3e8580dcf46ce4e159cf 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::ops::Deref;
 
 struct Root {
index bd2ddc6b9b214db01c1100d7bfb8eb758febfe88..876b329998e08539c188436f364d25f547b2768b 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // ignore-aarch64
+#![feature(io, process_capture)]
 
 use std::env;
 use std::io::prelude::*;
index 44167ad2096decc595eb7e352de1ebeb11bc8740..90d16aaf145af8f5348d7361ee468ca29ef2baea 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index a8343712034807fcc5f3480dba8550099a3cb964..af31fee048c6a0f13997942cf9e1e73b87577331 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc, libc)]
+
 extern crate libc;
 
 use std::thunk::Thunk;
index 05943943d9533391aeab2afc783414819ebef044..d1a24e4a450d5d1f6820753fbf8affbc5bfd19c2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo<'a> {
     i: &'a bool,
     j: Option<&'a int>,
index 95562d75c3ea476ab3e6e8f2972b1a056095d48e..3fa9f66c9e3ccc0f4ef1f8a43f2b36e881367cf0 100644 (file)
 // This test may not always fail, but it can be flaky if the race it used to
 // expose is still present.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc)]
+
 use std::sync::mpsc::{channel, Sender, Receiver};
 use std::thread::Thread;
 
index 1c0283070a249be5cf66c7a9240b5ea55a656c95..0b35ccf26f3f798a9c8f612ebf3752412b6d7149 100644 (file)
@@ -9,6 +9,11 @@
 // except according to those terms.
 
 // aux-build:issue13507.rs
+
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 extern crate issue13507;
 use issue13507::testtypes;
 
index c67dd4b93a048da2e67887508bb636151c274883..8ed8426b8f5da628e619fa56c2997977aac7fda3 100644 (file)
@@ -11,6 +11,8 @@
 // aux-build:issue-13620-1.rs
 // aux-build:issue-13620-2.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-13620-2" as crate2;
 
 fn main() {
index 81a8b29461c78a6a82abfa9ea8ec0a032ea79ac2..11219b04f2b97003e55434f34b4f1312af2fe1c2 100644 (file)
@@ -8,13 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, core)]
 use std::ops::Fn;
 
 struct Foo<T>(T);
 
 impl<T: Copy> Fn<()> for Foo<T> {
-    type Output = T;
     extern "rust-call" fn call(&self, _: ()) -> T {
       match *self {
         Foo(t) => t
@@ -22,6 +21,20 @@ extern "rust-call" fn call(&self, _: ()) -> T {
     }
 }
 
+impl<T: Copy> FnMut<()> for Foo<T> {
+    extern "rust-call" fn call_mut(&mut self, _: ()) -> T {
+        self.call(())
+    }
+}
+
+impl<T: Copy> FnOnce<()> for Foo<T> {
+    type Output = T;
+
+    extern "rust-call" fn call_once(self, _: ()) -> T {
+        self.call(())
+    }
+}
+
 fn main() {
   let t: u8 = 1;
   println!("{}", Foo(t)());
index 5ccbe9a7980e8a04bcef5082cb63c5eb0eb1a3f8..f4902c8e0ac38d7d5ee83e1058a1d18972742ecc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo<'r>() {
   let maybe_value_ref: Option<&'r u8> = None;
 
index c9c78f6408bac74473da9ef3b2b1736c6ec7394d..fd482b370489fd4e400ef0a2718180de5ce9a13d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub struct Foo<'a, 'b: 'a> { foo: &'a &'b int }
 pub fn foo<'a, 'b>(x: Foo<'a, 'b>, _o: Option<&   &   ()>) { let _y = x.foo; }
 fn main() {}
index 81b6892b0f97ac4f97922a6125b02c11c82a6f44..c8bf74c5d9b4508a9f58aa2b520f48b2feeca6e5 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::u8;
 
 const NUM: uint = u8::BITS as uint;
index 8731662afa307a30a167e14e8a1e2879220c0dea..38ecab67372d04ead022a0996034cd5fe8178f74 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn bar(&self, int) {}
 }
index 96e2a0dc48539c71f620dfdf434145e038d9d119..c85c0117581a5f771657a9a91cc23a57748cefa4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo<'a> {
     listener: Box<FnMut() + 'a>,
 }
index c6847ce55dec2ca7090c97bdb090a74ceb98caa6..cd6711df7f33503c1611d3c1bf35b0936a2d4f9e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct TestStruct {
     x: *const [int; 2]
 }
index 960884c4aa501711ef55d93ca7c127df50f23ee7..8a2e1585da6838a5d1c0f39d5b5fbc82cbca7fb2 100644 (file)
@@ -11,6 +11,8 @@
 // Test that codegen works correctly when there are multiple refutable
 // patterns in match expression.
 
+// pretty-expanded FIXME #23616
+
 enum Foo {
     FooUint(uint),
     FooNullary,
index a58477e647f3af3899dd3308afd4859482235c9e..66cf37eb61fc558d236f4dc1a85387dc8aebdac7 100644 (file)
@@ -12,6 +12,8 @@
 // aux-build:issue-13872-2.rs
 // aux-build:issue-13872-3.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-13872-3" as other;
 
 fn main() {
index e850ecbba6e560d6d2ad12b0ac9c0153a44f47b1..e773f03f21217f3609e9194392365ec721b74b9c 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(old_orphan_check)]
+#![feature(old_orphan_check, rustc_private)]
 
 extern crate serialize;
 
index dd9a7c97c9ab5f5ca8a2431955e28e321607be8d..d159d55c77c560431233eaaf880bf678c76ace77 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_imports, dead_code)]
 
 use foo::Foo;
index ad4ed03e6e2c82386f09c1add758975a89ce71d5..849d7e249a8df146616b4d1d79580aad18686965 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn bar(&self);
     fn baz(&self) { }
index 0e4b4a2c9cf326ca260c26a6189bc7520c1cf06b..fd311a1e9b56284558bc92d8c647fae0d3618abc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct A(int);
 struct B;
 
index f983f233ee35680e8697439ab39d43e9fab1e40b..48c4aed50f4b160e00cbce99759ca7df7bf3f2e7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[macro_use] extern crate "std" as std2;
 
 fn main() {}
index 6c9c7e2fd3f141978aa78d1c68b4bf36c3cbb86b..88af65074951ddcdf3101bd71f156afd8b05291b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     match ("", 1_usize) {
         (_, 42_usize) => (),
index d413e323a09997738ede945cb2b603abb11e2b08..aa91f125e48e276a2e52729759d277518a4bc4ef 100644 (file)
@@ -13,6 +13,8 @@
 // value was coerced to a trait object. (v.clone() returns Box<B1>
 // which is coerced to Box<A>).
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 4bdf5a31c713b94aa1a4828efa80c536ff951dc1..e6425f7cb7a0220d8186d628a38cd4b5770f799e 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-14421.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-14421" as bug_lib;
 
 use bug_lib::B;
index 439998c597d936d86327370e9fd43aabfeae6593..d3f1858c36324c6aea7b4c3d34e755d7e0a105db 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-14422.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-14422" as bug_lib;
 
 use bug_lib::B;
index 7e4c464d9aaba7f37c5b650fe07725be6ca85505..f897b00ceffef9f8f519e5f33d3673b224e605e8 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(io, process_capture)]
+
 use std::env;
 use std::io::prelude::*;
 use std::io;
index 027826e99cb1f8b878f8b09aa5416168edc6dc4e..1cbe986e88af0ebd77cbc91d32e3a86233c6215f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_variable)]
 
 struct T { f: extern "Rust" fn() }
index 5924aa44d4d63c672dc701041d446289fdd8cfc6..7392c7a75d153a5a99bdcd1f81456340be9aae9e 100644 (file)
@@ -13,6 +13,8 @@
 
 // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     send::<Box<Foo>>(Box::new(Output(0)));
     Test::<Box<Foo>>::foo(Box::new(Output(0)));
index 44465fe5f80ee493fdacb95d5c2245638483c9f6..6d2d02d2b8b63ae9d4fd00a5089d8045fc6ce9cb 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     {|i| if 1 == i { }};
 }
index 1155027d426da833262e0f9e1bb80ec4a25d22d5..92cb30068de676c05e64bf7350a12554ca90db70 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[deny(dead_code)]
 pub enum Foo {
     Bar {
index c322346c2a605dc0430aa3f9280bc67fdff131e6..5dca6e82ba2fc5f0749aa862bfbc3628ba5e6201 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum X {
     Foo(uint),
     Bar(bool)
index abb15dae00df614e3a1451693de0e34e2b9a6415..7e7886e3a6e7659b82a5cbce04af4bb3ae420a1f 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(old_io)]
+
 use std::old_io::Reader;
 
 enum Wrapper<'a> {
index fbf08ab564d3510d9ba11ed64340cee2d1f47a3d..9a85f83c03b9524de11404f2faec33d088642d55 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Matcher {
     fn next_match(&mut self) -> Option<(uint, uint)>;
 }
index 549ed08aaf37a54130f49bcf1c6e3dbd4ba74416..0e03f13241853c1f29b7c1ec18949459d3725853 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub type BigRat<T = int> = T;
 
 fn main() {}
index ace1f00b023b58a8847ab40dae2cf496d1c98cd7..05e2fff8a44247830625279c2874360973ee1a8c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(asm)]
 
 type History = Vec<&'static str>;
index 098fa54207f39d8e592fed0feac8daa076444f0f..a530384d368c06036bcd8530c4f03b1ec15264ef 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(old_io, io)]
+
 use std::env;
 use std::process::Command;
 use std::io::{self, Write};
index 6335f79be6c7aae7b547f67e33baa240f352fce9..ec482a776def32f4e3bf940b0a09272130179b91 100644 (file)
@@ -8,17 +8,27 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 trait Foo { fn dummy(&self) { }}
 
 struct Bar;
 
 impl<'a> std::ops::Fn<(&'a (Foo+'a),)> for Bar {
-    type Output = ();
     extern "rust-call" fn call(&self, _: (&'a Foo,)) {}
 }
 
+impl<'a> std::ops::FnMut<(&'a (Foo+'a),)> for Bar {
+    extern "rust-call" fn call_mut(&mut self, a: (&'a Foo,)) { self.call(a) }
+}
+
+impl<'a> std::ops::FnOnce<(&'a (Foo+'a),)> for Bar {
+    type Output = ();
+    extern "rust-call" fn call_once(self, a: (&'a Foo,)) { self.call(a) }
+}
+
 struct Baz;
 
 impl Foo for Baz {}
index 53d0f7dae05773bf0c3f630d61114779c89d3c52..5accaf363490fae2b1e45692d78e2e9156ef7941 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 use std::ops::Fn;
 
@@ -34,9 +36,21 @@ fn find<T>(&self) -> Option<T> {
 }
 
 impl<'b> Fn<(&'b mut (Response+'b),)> for SendFile {
+    extern "rust-call" fn call(&self, (_res,): (&'b mut (Response+'b),)) {}
+}
+
+impl<'b> FnMut<(&'b mut (Response+'b),)> for SendFile {
+    extern "rust-call" fn call_mut(&mut self, (_res,): (&'b mut (Response+'b),)) {
+        self.call((_res,))
+    }
+}
+
+impl<'b> FnOnce<(&'b mut (Response+'b),)> for SendFile {
     type Output = ();
 
-    extern "rust-call" fn call(&self, (_res,): (&'b mut (Response+'b),)) {}
+    extern "rust-call" fn call_once(self, (_res,): (&'b mut (Response+'b),)) {
+        self.call((_res,))
+    }
 }
 
 impl<Rq: Request, Rs: Response> Ingot<Rq, Rs> for HelloWorld {
index edca9cbaa30fe48cb402e84b0ae43b7628fba480..fda7b9019797827792cf3feb7f0949badbd41bed 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(warnings)]
 
 struct S<T>(T);
index 9752b01e52bc1416ab0ea3cbfa23b626b834c7a3..a6d4f5fde5df94673aa437380b51fc5aaec488af 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let mut x: &[_] = &[1, 2, 3, 4];
 
index c6c9e8004558cce19afae47a568bd14ef69e7e5f..f56f3b63927546b8a10848be88d4c77fbce742e9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     assert_eq!(count_members(&[1, 2, 3, 4]), 4);
 }
index 8ae3d072362ed6b5db81a00be3becce691926a7f..aaf1e5fc18320ec81cc5e9afe44ad9c4e0ed731e 100644 (file)
@@ -8,4 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {}
index 6782310fa0aa52a7fe90ea7887a231009e854b40..9910c2e0d6007bc15627fa5e913bd93f5e89f7db 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub enum T {
     T1(()),
     T2(())
index d995ecc492e3477f65d3ac466c4d30e8e00d100c..0e194860251a8067900e846b664bf44ba1e62914 100644 (file)
@@ -10,6 +10,8 @@
 
 // no-prefer-dynamic
 
+// pretty-expanded FIXME #23616
+
 #![feature(fs, process, env, path, rand)]
 
 use std::env;
index 6310ce39d99db5671b3df7a86b401e5f91b4f24c..bb89fb2fa102f8c218956085b4ccf3a66e1dfa55 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! inner {
     ($e:pat ) => ($e)
 }
index fbbd40895b283d126930b6e164ce673dba9bf00c..b1d74e471c19bc86f3a45d41bd6b681a43c58d43 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 static mut n_mut: uint = 0;
 
 static n: &'static uint = unsafe{ &n_mut };
index 0f4978d78dd86700d0961236461cb6a7ca632250..6a11f15dc847cbf0950726375b08d09bdd3bb97d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait MyTrait {
     fn foo(&self);
 }
index 82f53ea7cd408a0333fef195c72d7269aebaf7c4..6556dba653435e7eb8523ed25f85cedbdc818b82 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-15562.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-15562" as i;
 
 pub fn main() {
index 227d8f7b8c82ab970409f07a228386646f1f0590..6c76f1595dc0de1d748e6ebac54ec76fe7357127 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::iter::AdditiveIterator;
 fn main() {
     let x: [u64; 3] = [1, 2, 3];
index 06e9e652ed25bfc06c3ed1f2a7e4c8f5df74d1e6..ddfb57f345b868de8949b546bb30efd864e670d4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(PartialEq)]
 enum Test<'a> {
     Slice(&'a int)
index 8da82c498b0b7d1eba2f76eb55e570fe94267012..71306a63e9060dc3ae7a11b06b72c2cc1f50d6d0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Clone)]
 enum Test<'a> {
     Slice(&'a int)
index 72daa0cba4104abcb20783e2f34d66589fabdb16..929580019ff64fc389804736868f44382d925a4c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let mut array = [1, 2, 3];
     let pie_slice = &array[1..2];
index 18e4190ee459f6b24acccb8d36a18733a6ca28d8..29e2a403ebc3b35de04ee1d6576e2dfe0c4e7445 100644 (file)
@@ -11,7 +11,9 @@
 // If `Index` used an associated type for its output, this test would
 // work more smoothly.
 
-#![feature(old_orphan_check)]
+// pretty-expanded FIXME #23616
+
+#![feature(old_orphan_check, core)]
 
 use std::ops::Index;
 
@@ -29,7 +31,7 @@ fn row<'a>(&'a self, row: uint) -> Row<&'a Mat<T>> {
 impl<T> Index<(uint, uint)> for Mat<T> {
     type Output = T;
 
-    fn index<'a>(&'a self, &(row, col): &(uint, uint)) -> &'a T {
+    fn index<'a>(&'a self, (row, col): (uint, uint)) -> &'a T {
         &self.data[row * self.cols + col]
     }
 }
@@ -37,7 +39,7 @@ fn index<'a>(&'a self, &(row, col): &(uint, uint)) -> &'a T {
 impl<'a, T> Index<(uint, uint)> for &'a Mat<T> {
     type Output = T;
 
-    fn index<'b>(&'b self, index: &(uint, uint)) -> &'b T {
+    fn index<'b>(&'b self, index: (uint, uint)) -> &'b T {
         (*self).index(index)
     }
 }
@@ -47,8 +49,8 @@ struct Row<M> { mat: M, row: uint, }
 impl<T, M: Index<(uint, uint), Output=T>> Index<uint> for Row<M> {
     type Output = T;
 
-    fn index<'a>(&'a self, col: &uint) -> &'a T {
-        &self.mat[(self.row, *col)]
+    fn index<'a>(&'a self, col: uint) -> &'a T {
+        &self.mat[(self.row, col)]
     }
 }
 
@@ -56,7 +58,7 @@ fn main() {
     let m = Mat::new(vec!(1, 2, 3, 4, 5, 6), 3);
     let r = m.row(1);
 
-    assert!(r.index(&2) == &6);
+    assert!(r.index(2) == &6);
     assert!(r[2] == 6);
     assert!(r[2] == 6);
     assert!(6 == r[2]);
index 7bfd8e0ab718942444aef42f8adf76889799e924..f30991a19635251797a88dc08e06e72980789f41 100644 (file)
@@ -87,12 +87,12 @@ fn main() {
     assert_eq!(cc().unwrap(), 3);
     assert_eq!(dd().unwrap(), 3);
 
-    let i = box 32 as Box<A>;
+    let i = box 32i as Box<A>;
     assert_eq!(i.aaa(), 3);
-    let i = box 32 as Box<A>;
+    let i = box 32i as Box<A>;
     assert_eq!(i.bbb(), 3);
-    let i = box 32 as Box<A>;
+    let i = box 32i as Box<A>;
     assert_eq!(i.ccc().unwrap(), 3);
-    let i = box 32 as Box<A>;
+    let i = box 32i as Box<A>;
     assert_eq!(i.ddd().unwrap(), 3);
 }
index e2f42278cbcb16f7d5367d913d05f15dce509b2d..eb3322e037058a36d57e03cbaab7aad9f10dd81c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![deny(warnings)]
 #![allow(unused_imports)]
 
index 933fa881eed5488054c89554c237e061b9e5f49a..b830234ded2b35eb1e6cc0aa5b7a9910da92a1cd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum NestedEnum {
     First,
     Second,
index 6a4f78442d149943ded6817b5663f3580dbf339c..9b300deaa497ef99d649137277d0f6349041582c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 
 static mut DROP_RAN: bool = false;
index 18e1918aea44747e945eb0056b618300c084b109..6b75e4e47978e789281d275d51b0f14c837ecccd 100644 (file)
@@ -10,6 +10,8 @@
 //
 // regression test for the model lexer handling the DOTDOTDOT syntax (#15877)
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     match 5_usize {
       1_usize...5_usize => {}
index 88b250af1c09636a8a07ac1f2150de2bda0fb1c5..6af07c422ef56baefcf2cde9d87d10f712f49e0a 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(unsafe_destructor)]
+// pretty-expanded FIXME #23616
+
+#![feature(unsafe_destructor, rustc_private)]
 
 extern crate serialize;
 
index 60d5ea8c84cee4426ccb34c2371cb268c8af6106..0f55ca707bdd3c52e2d50c8a44e2685cd2a819e4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 static mut DROP_COUNT: uint = 0;
index 48ea3a93296e3194420f2e9c79c05e23c907cade..b994fcb46b09673d7dcba4d7d4bbb96a215724b4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let mut buf = Vec::new();
     |c: u8| buf.push(c);
index 62c36e1d8863661c6331d925223b5bafe3ae48fa..4624953dea3fa85c761442f69e56de0c0349fa05 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Empty;
 
 // This used to cause an ICE
index f89dbfd2da9392b858ce7c56539d668f7f4e7c53..d9c87da57237322b013411955c5195e7a1c4f626 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     if true { return }
     match () {
index 7e3b796235d26a25367cf348590d65cf0018cc16..bf33221431ae026418b9b3d8016517929bc1c96c 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(hash)]
+
 use std::hash::{SipHasher, hash};
 
 #[derive(Hash)]
index 9448e605937f728b36c2410841f3ec3d68af1054..15a5080f5a242c09c2e43743a7c7af96c4fd83cf 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 use std::thread;
index 1ba7b142e5e15c957f35d44fd3de35ebc9f36f70..743dbbc9b99564e408bcf2d025f87a3a779e1aa6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait MatrixRow { fn dummy(&self) { }}
 
 struct Mat;
index 5c8b4be0cee1a4a642bf375639f510378e6b0c36..cc64ffcab6f93213ebd1a11eab1ae9a3daff1c49 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     static _x: int = 1<<2;
 }
index 4e57c55c5f755fd994b1b416f79dd3c6263a8016..a0d9eeb9e0bfda8ca970cbc6cdc18bc7a14a2ac7 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-16643.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-16643" as i;
 
 pub fn main() {
index 0b58df56b6f767bc2a38201c14f15df47970365c..6b0d5d7c5131330d13aa682f12bac632f396e40b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let x: (int, &[int]) = (2, &[1, 2]);
     assert_eq!(match x {
index 389baecafd14402eaa5776c593746d897035f428..99ddaba4e5514513291796aa2d90198757bf776d 100644 (file)
@@ -8,9 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, core)]
 
 // Test that unboxing shim for calling rust-call ABI methods through a
 // trait box works and does not cause an ICE.
 struct Foo { foo: u32 }
 
 impl FnMut<()> for Foo {
-    type Output = u32;
     extern "rust-call" fn call_mut(&mut self, _: ()) -> u32 { self.foo }
 }
 
-impl FnMut<(u32,)> for Foo {
+impl FnOnce<()> for Foo {
     type Output = u32;
+    extern "rust-call" fn call_once(mut self, _: ()) -> u32 { self.call_mut(()) }
+}
+
+/////////////////////////////////////////////////////////////////////////
+
+impl FnMut<(u32,)> for Foo {
     extern "rust-call" fn call_mut(&mut self, (x,): (u32,)) -> u32 { self.foo + x }
 }
 
-impl FnMut<(u32,u32)> for Foo {
+impl FnOnce<(u32,)> for Foo {
     type Output = u32;
+    extern "rust-call" fn call_once(mut self, args: (u32,)) -> u32 { self.call_mut(args) }
+}
+
+/////////////////////////////////////////////////////////////////////////
+
+impl FnMut<(u32,u32)> for Foo {
     extern "rust-call" fn call_mut(&mut self, (x, y): (u32, u32)) -> u32 { self.foo + x + y }
 }
 
+impl FnOnce<(u32,u32)> for Foo {
+    type Output = u32;
+    extern "rust-call" fn call_once(mut self, args: (u32,u32)) -> u32 { self.call_mut(args) }
+}
+
 fn main() {
     let mut f = box Foo { foo: 42 } as Box<FnMut() -> u32>;
     assert_eq!(f.call_mut(()), 42);
index 26661302242bc9c20622aa6ee684d56576aff153..e7af88647c02adc96f93cdc424e1ffd30a16fff7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 #![feature(box_patterns)]
index c2bcbe045c0cc07ac5c51e59a4cbfffd1e46893b..33cdbca14e3675853e6f05a0b773f88fabfbee0f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = [1, 2, 3];
     let y = x;
index 25909bcbfe9a82a87a6325d89cc71309df806792..1fdc27eb128452c423d37e64623c5b2556388ee7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::any::Any;
 
 fn foo(_: &u8) {
index 40e112d6fbf7637ab56636048881c872456cb5de..4c6c200c7164e9890f70e19341de145be9661443 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(collections)]
+
 extern crate collections;
 
 use std::collections::HashMap;
index 9dc78ce0d4f1ad2fbdfefb273081c44928967cb6..b8c51f2cd31129632e165e1a3c9d75a7eb7d59fd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum pattern { tabby, tortoiseshell, calico }
 enum breed { beagle, rottweiler, pug }
 type name = String;
index a0e6f2c9be96e3117bdf6e0ca65932d02792c91a..7db1b9b6f79689ceb0729dd18790e8c40484f4cf 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that regionck creates the right region links in the pattern
 // binding of a for loop
+// pretty-expanded FIXME #23616
+
 fn foo<'a>(v: &'a [uint]) -> &'a uint {
     for &ref x in v { return x; }
     unreachable!()
index d367e0e908e32565ae186dc55d9ebefb69511e54..31f6a4209de4dec5a9a6324189233d0247843156 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 static X2: u64 = -1 as u16 as u64;
 static Y2: u64 = -1 as u32 as u64;
 const X: u64 = -1 as u16 as u64;
index 6d32ffd6c43ca31791d0889a54a5ac4172ea7ef1..366ef7543fdbb9cc1a0c73d76da0cd5769213fcc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::fs::File;
 use std::io::{self, BufReader, Read};
 
index aa53a7658e1291fd5985ac06abeb89ac5d765516..f17834e8d36dc31d530cc13d18d1ad94c42ed7c0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 
 struct Leak<'a> {
index 9623613b5555a6bc4b5d9a907afa31b49c38f380..756822d4f45fad5ada8ba8fd85cb18feff633515 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 const X1: &'static [u8] = &[b'1'];
 const X2: &'static [u8] = b"1";
 const X3: &'static [u8; 1] = &[b'1'];
index b2abf2d2b1a9c60238af56ad651827f953f8092a..0c9debec3e037f7e6464eb69792719c72c0dc399 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 static mut DROPPED: [bool; 2] = [false, false];
 
 struct A(uint);
index d4c32f42188bb0b4934f073c2c21955d3ecb4c7a..a9f5476d0f86c758350057a9ec9ed57f777f1107 100644 (file)
@@ -8,8 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, io)]
 
 use std::io::{self, Write};
 
index 0966d4ea45eec9d17393252bca98b1d4031a7883..0dac3295c1bf615761864e61b1a4a2325db07568 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 fn main() {
     let _: &Str = &"x";
 }
index 092bcf661a76a2b5e2ecd7a4cef68790f0fd4196..354b0861758c5dfd87b157c3845c22c87e8d8f88 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that astconv doesn't forget about mutability of &mut str
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     fn foo<T: ?Sized>(_: &mut T) {}
     let _f: fn(&mut str) = foo;
index dbfa91553e60cdc88446cd2ee399571e47e93b90..ce1c077b23c57e45680060e87a18e566c17a226e 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-17662.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-17662" as i;
 
 use std::marker;
index 3ca6f473a7900a6fe3de06c98b6166b16ea04e44..34699cf81b44775f0ed924665f2c0e6fc356be39 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 const FOO: uint = 3;
 
 fn main() {
index cdd03244df14567d8e4b12db36f191c59b366686..3f6bfb84fbf3e947b317369dc12fa7042790e9c9 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::marker;
 use std::cell::UnsafeCell;
 
index e4782e28928748b584c031bc4405658fb70df79d..2827ab9293642cebb37b836be19468d26b22e210 100644 (file)
 
 // aux-build:issue-17718.rs
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 extern crate "issue-17718" as other;
 
 use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
index de9611f259227caf28b801016b3fec51c246774c..9a678f00157e67231a9256c16d0c9fa7fc83953e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Person {
     type string;
     fn dummy(&self) { }
index 497361969bfc3cffa1eddd796358c4c8a496eb05..3cf9c62b40d4911209fbe83c1c353772c4f9869a 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that generating drop glue for Box<str> doesn't ICE
 
+// pretty-expanded FIXME #23616
+
 fn f(s: Box<str>) -> Box<str> {
     s
 }
index 2f1b0342b8e04ad599d56f9ee164aa53b569a6f3..fc821441330a5277fbd95653170fca71b33d8003 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Aaa { fn dummy(&self) { } }
 
 impl<'a> Aaa for &'a mut (Aaa + 'a) {}
index 8e3cb414566c7577279db2ba4f0fc60d45c7af7b..65a0b51095c80cbd450c5bd0f465aa3306c998c0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 use std::marker::PhantomData;
index a7d9e6a4be6d840596171e06e354e18bb9afd000..82f324a395abd8cce3916e041c6811fd90a791a2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     assert_eq!(match [0u8; 1024] {
         _ => 42_usize,
index 3774aaa190333b97e687a0e4d76842c3e5781cfb..adc33e3eed02281afbf225aceb858c80cafdd04b 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, std_misc)]
 
 use std::thunk::Thunk;
 
index 58a0872a5719b1ee2ef54d5ab7a338d3bf35ff95..994001a82ce337e5f1ef7a91c0acc932b7580e62 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we can parse where clauses on various forms of tuple
 // structs.
 
+// pretty-expanded FIXME #23616
+
 struct Bar<T>(T) where T: Copy;
 struct Bleh<T, U>(T, U) where T: Copy, U: Sized;
 struct Baz<T> where T: Copy {
index 3d6b23c8805fc4e96814096db3dbc64595cf0e90..eecdea66cf6f7c02535609a23d219adb3750e869 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     ({return},);
 }
index a4b09eb08e0f663392de8cbbdcd25f47e8a01523..cd28d6425516dbe61fd2d95f32bb78a401884341 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, std_misc)]
 
 use std::thunk::Thunk;
 
index b7c4bb0fe00460817b2a257ebab7dfc01b5d8ef7..bdff5ba484dc8928f2623b01f993c0afdee9f29e 100644 (file)
@@ -11,6 +11,8 @@
 // Issue #1821 - Don't recurse trying to typecheck this
 
 
+// pretty-expanded FIXME #23616
+
 enum t {
     foo(Vec<t>)
 }
index 67b3239d35197044725b5f79c1011e4b9ef40af5..376d6523ccb98c0c6dcdd5202e7291428565f4af 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Cursor<'a>(::std::marker::PhantomData<&'a ()>);
 
 trait CursorNavigator {
index e5532b4550baab32c48a59b2191a8ee617f53141..4e60a7d9b5fbbe87a68d3c769a213b05b6f9785e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 const X: &'static str = "12345";
 
 fn test(s: String) -> bool {
index c734c1a322245c0e516179f1465bfe24ce9be83e..1386c9d0daa5b886661f5d388b8bb1debfd157d0 100644 (file)
@@ -11,6 +11,8 @@
 // Test that wrapping an unsized struct in an enum which gets optimised does
 // not ICE.
 
+// pretty-expanded FIXME #23616
+
 struct Str {
     f: [u8]
 }
index 63f57e0a2e85eaea056cfe042e1ca0c2e6bbbea8..edf6f5e32c31f58cea035bf434400f767574176f 100644 (file)
@@ -11,6 +11,8 @@
 // Test that non-static methods can be assigned to local variables as
 // function pointers.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn foo(&self) -> uint;
 }
index 2011b87e731021a96761aaea10b2d56ff5d963fd..eb7e504ae14518eb187d821e6797de4638d5f1bf 100644 (file)
@@ -11,6 +11,8 @@
 // Check that trans doesn't ICE when translating an array repeat
 // expression with a count of 1 and a non-Copy element type.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let _ = [Box::new(1_usize); 1];
 }
index ce026942948ca82c96597b997a8022bcc1414692..de6a5be83de38ef438aebcd0d7c123e34fe34bae 100644 (file)
@@ -13,6 +13,8 @@
 // translating the def ID of the trait during AST decoding.
 
 // aux-build:issue-18501.rs
+// pretty-expanded FIXME #23616
+
 extern crate "issue-18501" as issue;
 
 fn main() {
index c75abd62deba6721bcd7c0f851044cae09ef2137..f284ac90b4e6b0e558954daf822e801e8cb39178 100644 (file)
@@ -15,6 +15,8 @@
 // impl.
 
 // aux-build:issue-18514.rs
+// pretty-expanded FIXME #23616
+
 extern crate "issue-18514" as ice;
 use ice::{Tr, St};
 
index b92cfa1f29b52a026034c2b1391637a252b8ea6b..897a3d082ba9af12fe3a0ccb365ad49513626f14 100644 (file)
@@ -11,6 +11,8 @@
 // Test that coercing bare fn's that return a zero sized type to
 // a closure doesn't cause an LLVM ERROR
 
+// pretty-expanded FIXME #23616
+
 struct Foo;
 
 fn uint_to_foo(_: uint) -> Foo {
index 6b6296b0bd929f264fbd9c638189ad31f2f241ce..a256e619216862d5e9205ef0c7432fae46f5f4c7 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(old_io)]
+
 use std::old_io::FileType;
 
 pub fn main() {
index 8f560258d9f4795fe0aae54431c215b2df1d184b..a3affb7bf86f0a27bd292ac374033bff6aa12218 100644 (file)
@@ -12,6 +12,8 @@
 // once closure as an optimization by trans.  This used to hit an
 // incorrect assert.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 fn main() {
index 10ae2749a090202073e148129e2c2bc1e86ffbb3..a4e6e6181ee31e1956397a25004a3656ede25392 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod a {
     pub type rust_task = uint;
     pub mod rustrt {
index bb2907241c2c6bfc06c5754f46f79e04c2f7bc09..302f5ddcc6c60c5041bbd5c95fd9e66fc4706634 100644 (file)
@@ -11,7 +11,9 @@
 // Test that param substitutions from the correct environment are
 // used when translating unboxed closure calls.
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 pub fn inside<F: Fn()>(c: F) {
     c.call(());
index 698b61e5759ad98268aece46d4ccec0bbf109963..e4537e158d1231c6f947168a0823685936724a48 100644 (file)
@@ -11,6 +11,8 @@
 // Test that the self param space is not used in a conflicting
 // manner by unboxed closures within a default method on a trait
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 trait Tr {
index 0338a4eff22389e2ac1dc9a88dc51459437dcddd..81c717f8174877555de3e2dbe9ef88b7e008b115 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we don't panic on a RefCell borrow conflict in certain
 // code paths involving unboxed closures.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 // aux-build:issue-18711.rs
index 30ad827c697230d76fdcc2669839bc26240f70fc..644a429750fbc9e937ae8f4ad5c6f997195f5faa 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Eq, PartialEq, PartialOrd, Ord)]
 enum Test<'a> {
     Int(&'a int),
index 2f23b8028ecb905fb0feec7f7c80188c2e00004e..8e51a900c0cae9cef114c2a5c5c7cdc61dca931a 100644 (file)
@@ -11,6 +11,8 @@
 // Test that regionck uses the right memcat for patterns in for loops
 // and doesn't ICE.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     for &&x in Some(&0_usize).iter() {
         assert_eq!(x, 0)
index 490f7eb6bea4b7f29e9e388cb2bc2df2fed553d2..f72e7fbe30a35a14dd74df9a73b9952b805483cd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod foo {
     pub mod bar {
         pub mod baz {
index 16dd84315ed2cdadfcd1a7300b7ef1572aca864b..7cc61dd2532760d9021ac9092e2b17dab34f0ab5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub trait Borrow<Borrowed: ?Sized> {
         fn borrow(&self) -> &Borrowed;
 }
index ac181c8db7185d02f53148c0aae27d33b50ffdb0..0735693a4bd468006ecb9bdfa692006cc8a0e423 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Str([u8]);
 
 #[derive(Clone)]
index ef95b4d4f00c5834c14b31f0d82b5286942414f4..a0368063f2c1f6399a1ccb9e5cb8f14d53e81a91 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 pub trait Handler {
     fn handle(&self, &mut String);
index 222f67af437ef327ad3232e8a972e05ef3c67d0b..e02d001ee98ad69ac67b31a3d1d1976e20676bce 100644 (file)
@@ -11,6 +11,8 @@
 // Test that a partially specified trait object with unspecified associated
 // type does not ICE.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     type A;
 
index bc43874bfb3c02b16028eb3358fc1d90137aab0b..c5eb5069328016d45024acb51efda418d472fc9e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 fn foo<T, F: FnOnce(T) -> T>(f: F) {}
index 3436871b4d1fef7f16331e5b8041ef09e454faec..f9b605c44e9186f742461779195ee2a16e0c63ec 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Trait<Input> {
     type Output;
 
index cf0f48e025a0e037dd508ee1612c3a0555300f66..47b8aaacdadb8f98fde6d53ac8f2ebe4f4f92d54 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Trait<Input> {
     type Output;
 
index 35e053110dfc7ec2be2e5c9fb83fffa2d29dccf0..f25450a8918270aef0f5a05134c94eb0caccae95 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct MyStruct { field: usize }
 struct Nested { nested: MyStruct }
 struct Mix2 { nested: ((usize,),) }
index 4a446a76de38923b2e50c78222a0112d529f0268..95ca3efb099c7d0d4c891bb873673bbdf1bfc287 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:issue_19293.rs
+// pretty-expanded FIXME #23616
+
 extern crate issue_19293;
 use issue_19293::{Foo, MyEnum};
 
index 2f466d4ca8c47f59a72dc9b2e4c964955e99d8ea..ba2aaee02894d833fe74d945c064c96833553cfe 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-19340-1.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-19340-1" as lib;
 
 use lib::Homura;
index 8300220edeaff11310fc5bedc06ec6013cfee7b6..d7747201cbe4660abc616e68d89f32ee1195e1c2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Homura {
     Madoka {
         name: String,
index e603167b26be0a0c41b741d9d482e521fc4a128e..2dc5a6e99799abed0a0f3179caddaabccf09fe11 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait T {
     unsafe extern "Rust" fn foo(&self);
 }
index 38a7af3a69597b72b3b48412ccfc2a0e490d5358..7557c1b44e0dc33b5df970cab8625468769f7fed 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Base {
     fn dummy(&self) { }
 }
index 0578db8f854fcbadd9e9d9bde0160a1f4582b4b7..069ceadf91627b0e9aea35f86ac94832a5a87701 100644 (file)
@@ -14,6 +14,8 @@
 // reasonable examples) let to ambiguity errors about not being able
 // to infer sufficient type information.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let n = 0;
     let it = Some(1_usize).into_iter().inspect(|_| {n;});
index 7bb0d055b844d9279925252e47810a88588aa10e..562d2e4169e66317c8fbb558b1fe1738908718f5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait PoolManager {
     type C;
     fn dummy(&self) { }
index 4339339d74c88761f865def4492e3abf71e0cc01..1cb20011c2145fb5e90aa9807392291f59b0e242 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait PoolManager {
     type C;
     fn dummy(&self) { }
index 9d71aea01d01da7931a94c0a53a0e161fda80adc..7b33b4e7a4f391f8c268174a4f673eb33697884a 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue 1974
 // Don't double free the condition allocation
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let s = "hej".to_string();
     while s != "".to_string() {
index 23400859e54f1daa7cb464123bf7f6a845ff157c..5b415c63885e6f8446dc7e81ab375799f6731e5d 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections)]
+
 fn main() {
     let mut escaped = String::from_str("");
     for c in '\u{10401}'.escape_unicode() {
index a9ce6c7a9eb48bc7f399de8ecd60d20aae7ee8d8..4c1d30d9eed58f769ef8b9543e695766f8053bd5 100644 (file)
@@ -11,6 +11,8 @@
 // Test that `<Type as Trait>::Output` and `Self::Output` are accepted as type annotations in let
 // bindings
 
+// pretty-expanded FIXME #23616
+
 trait Int {
     fn one() -> Self;
     fn leading_zeros(self) -> uint;
index 3082fc27a7deca9afdadf84bafa32ec250efd2be..9442b039bc6cbecd1bc3573123e38f156c09d2a0 100644 (file)
@@ -8,15 +8,25 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(core,unboxed_closures)]
 
 #[allow(dead_code)]
 struct Foo;
 
 impl<'a> Fn<(&'a (),)> for Foo {
+    extern "rust-call" fn call(&self, (_,): (&(),)) {}
+}
+
+impl<'a> FnMut<(&'a (),)> for Foo {
+    extern "rust-call" fn call_mut(&mut self, (_,): (&(),)) {}
+}
+
+impl<'a> FnOnce<(&'a (),)> for Foo {
     type Output = ();
 
-    extern "rust-call" fn call(&self, (_,): (&(),)) {}
+    extern "rust-call" fn call_once(self, (_,): (&(),)) {}
 }
 
 fn main() {}
index 374460487d8f211dead321386806720688fe59ab..9d433eabe62970d2f24aaab776fcddcd5d9651a3 100644 (file)
@@ -10,6 +10,8 @@
 
 // Check that associated types are `Sized`
 
+// pretty-expanded FIXME #23616
+
 trait Trait {
     type Output;
 
index fe9ae022d88b4cc5a372ec970e5991175dc9a5c8..1fe443484665bc059d7dccc1ad9c88dc99b029a3 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // ignore-aarch64
+#![feature(std_misc, os)]
 
 #[cfg(unix)]
 fn main() {
index 47791ceecb67d3144850b758c6001cb9970e2335..0e5eaf857f35cee588d4a068fe890e867cb789c2 100644 (file)
@@ -7,6 +7,8 @@
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
+// pretty-expanded FIXME #23616
+
 #![feature(link_llvm_intrinsics)]
 
 extern {
index 2f9e8feed248234be96d211da10bc540442f03f7..70064f4e2670c5f7fdc7f4e29aebc76da954f80b 100644 (file)
@@ -10,6 +10,8 @@
 
 // Regression test for Issue #20343.
 
+// pretty-expanded FIXME #23616
+
 #![deny(dead_code)]
 
 struct B { b: u32 }
index 877cec48b5dc77c54e72542dd48e4f01df9ec246..03c7e9f8db72b4e86371959700d4a41fee72d870 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue_20389.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate issue_20389;
 
 struct Foo;
index 63a88988162a4af4b0990ce0452942833414571b..f607ed373b344e8342c2e37d83b2899826ce77f3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 trait Foo<T> {
index 92865c419b662055708dc82d373b503d50d8f10a..80541171307651f696333e3269f2d92fb82e1dc8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Trait {
         fn method(self) -> int;
 }
index fbc4cca800875b30c37b7e830cd65afe9cd79de5..0e3d4e0e40d67d5adc98c9912f63a25c36d7ee27 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread;
 
 fn main() {
index 9ebd96a685eafefbccb7c421098bee23a51cc7ba..e73492e7a7ee5216a72c41203eaa8f0a7b8b8ab6 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that overloaded calls work with zero arity closures
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
     let functions: [Box<Fn() -> Option<()>>; 1] = [Box::new(|| None)];
index 83b91c93a865f57706d9a81a2b6a55e218bb832a..72ccd82a21ec74fc1349ac571a1ab271373c19e3 100644 (file)
 // A reduced version of the rustbook ice. The problem this encountered
 // had to do with trans ignoring binders.
 
+// pretty-expanded FIXME #23616
+
+#![feature(os)]
+
 use std::iter;
 use std::os;
 use std::fs::File;
index 640774f9d24ce70de9111b2b0c1a483ce15ca4ac..df4c3923853416702aace351603b1454c83bb924 100644 (file)
@@ -12,6 +12,8 @@
 // UFCS-style calls to a method in `Trait` where `Self` was bound to a
 // trait object of type `Trait`. See also `ufcs-trait-object.rs`.
 
+// pretty-expanded FIXME #23616
+
 use std::fmt;
 
 fn main() {
index 5f2805ed354553f58dfd5d28847b20adea5cc15d..f5d34c39ee578d4126b8e7e24e6d4cc4b0ff9423 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(non_camel_case_types)]
 
 pub fn main() {
index 97c06ac98265fd6a8bec89b6cf5b93eaead6c849..98270099df9044f955ffb09d93b0d4067cb0c1bd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait T0 {
     type O;
     fn dummy(&self) { }
index d97017635718cfbcda8e502094d2b161c79ad09d..340670b41203658515a70d5a24c5db17bc161d7d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait T0 {
     type O;
     fn dummy(&self) { }
index c5badb614948f4cc738be3a1c6f94127a90e7b31..d0720ec593fa4a2e97884820a3bf67366356cbb7 100644 (file)
 
 // Regression test for #20797.
 
+// pretty-expanded FIXME #23616
+
+#![feature(convert)]
+
 use std::default::Default;
 use std::io;
 use std::fs;
-use std::path::{PathBuf, Path};
+use std::path::PathBuf;
 
 pub trait PathExtensions {
     fn is_dir(&self) -> bool { false }
@@ -94,8 +98,8 @@ fn next (&mut self) -> Option<S::P> {
     }
 }
 
-fn foo() {
-    let mut walker: Subpaths<Recursive> = Subpaths::walk(&PathBuf::new("/home")).unwrap();
+fn _foo() {
+    let _walker: Subpaths<Recursive> = Subpaths::walk(&PathBuf::from("/home")).unwrap();
 }
 
 fn main() {}
index 30c166cc67b9f45eacc6f26abfd4546e8bd94cbf..00e792c9a006ce048e12125d4db9a6db003c181a 100644 (file)
@@ -7,6 +7,8 @@
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
+// pretty-expanded FIXME #23616
+
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 
index e53fe3c44a28e8dd3b3513690093a22a35494960..d7a656be7afb0d4d3c35f1e8529f02fe146991c1 100644 (file)
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
 
 struct NT(str);
 struct DST { a: u32, b: str }
index 9205b247e1352e0edcb5b85a69824000b0e3a776..75d064a00fa89ad2e54d9aaf2677eba47c4ebef0 100644 (file)
@@ -13,6 +13,8 @@
 // insufficient type propagation caused the type of the iterator to be
 // incorrectly unified with the `*const` type to which it is coerced.
 
+// pretty-expanded FIXME #23616
+
 use std::ptr;
 
 trait IntoIterator {
index f91fb064ae27fcc8d7d5952fdf59a147b6ee44aa..2ce36b0dd44d7fb12417f3e6dbebeae5b36d4f2b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[forbid(raw_pointer_derive)]
 #[derive(Copy)]
 struct Test(*const i32);
index 235dddefacb4d2548f9299ac8f26086ccd3da82d..cabda0b500bd5d16f5b0d0a496419faba6e33561 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::Arc;
 
 fn main() {
index feafee90372d68a1dbec97e64d3edfaddf3dd8b1..ff205cd694c3a848fab7c06bc9f37d343cf391a6 100644 (file)
@@ -10,6 +10,8 @@
 
 // Make sure that "bare sequences" don't ICE in follow checking
 
+// pretty-expanded FIXME #23616
+
 macro_rules! bare {
     $($id:expr),+ => ( $($id)+ )
 }
index bb20b3a321569a8f2f24acf940002350b06c56a1..ef86634125ebddf041c04c6701cb7bd62fb16102 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let v = vec![1, 2, 3];
     let boxed: Box<Iterator<Item=i32>> = Box::new(v.into_iter());
index 71bb3d39fe1d6c01dd61832864ebea9030ad0bb7..608c60d03b3e7aa0b599dc85186427a32cac5ff0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![no_implicit_prelude]
 
 trait Iterator {
index 1d3984deac2095dfbdb109782360496138498810..e9b9aeebdaf314e97e39d146ca1654975c9f56a6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use ::std::ops::RangeFull;
 
 fn test<T : Clone>(arg: T) -> T {
index 6be7cea29280d5ef2b9b426f03b08d96f188e725..7fd329da2b72ae370285d6bae7a211356db8d0bb 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Hash)]
 struct Foo {
     a: Vec<bool>,
index 29701bd668aafc977b772460662a741bbfb65778..0666a1f133f2e144b5c7143fbc020c20f96b38d8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use m::{START, END};
 
 fn main() {
index 6eed357415226ff50b1cbec60b50806bc21f4bf4..b512fd4919356554e2f3fd0837fd4ab192559ae9 100644 (file)
@@ -11,6 +11,8 @@
 // Test that the requirement (in `Bar`) that `T::Bar : 'static` does
 // not wind up propagating to `T`.
 
+// pretty-expanded FIXME #23616
+
 pub trait Foo {
     type Bar;
 
index e5a2790917ff0a638424375e9721d5ecefd2f052..53297d0a8f3b96867c097366bc7fbb35fba3d5b0 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     if let Ok(x) = "3.1415".parse() {
         assert_eq!(false, x <= 0.0);
index b9b1e5f3337cd1b7791785550c8b191dc069321a..cb87770c565c0b117781e1e967d05ac94a5d4401 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn test(it: &mut Iterator<Item=i32>) {
     for x in it {
         assert_eq!(x, 1)
index fee14061c566ab5e6feba90476b636f053fd5619..c34ab1b0ea7ce140e00ecc8482d79eb1268262f1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     static NONE: Option<((), &'static u8)> = None;
     let ptr = unsafe {
index 09d1a3bca6901723076782e3c107d73cc7a771c2..e1d1b908e0117131c6dbd919169570fad1e1074e 100644 (file)
@@ -12,6 +12,8 @@
 // subtyping of projection types that resulted in an unconstrained
 // region, yielding region inference failures.
 
+// pretty-expanded FIXME #23616
+
 fn main() { }
 
 fn foo<'a>(s: &'a str) {
index d6e6f23191e240dd0e26096f0423277dd399011a..37acd34fbf0779e93ce2fad9ae3d8fc0125753bb 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 static foo: [uint; 3] = [1, 2, 3];
 
 static slice_1: &'static [uint] = &foo;
index 3025741694f43b4068850047628e81c0d902257f..41017134ba8a668d01616a18ae810bcbb9c84e98 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc)]
+
 use std::thread::Builder;
 use std::thunk::Thunk;
 
index 55b61dd1945566f88f5740d7de4503aaad6c3439..6a5d76de8d3f89dc0d9dc9082ceece061b039075 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait A<X> {
     fn dummy(&self, arg: X);
 }
index 7bc6393ef8915b679dc0793af22d460463cfb40b..e02ce5441a7d42f6533ad9c3fb38697d1cc3274b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait DigitCollection: Sized {
     type Iter: Iterator<Item = u8>;
     fn digit_iter(self) -> Self::Iter;
index 1dcbfd92fa05ad6ffe0e797cb6cdc939c2f4fa95..b5ea9c194a8a244b9af35a5b2e5cc5354ecd9a5e 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 extern crate libc;
 
 use std::mem;
index 7c0ab11bc44620b070b47f911a03d1fb61db0117..a54490386d0e76b099d70e628a533c85c5e46272 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::marker::{PhantomData, PhantomFn};
 
 pub struct Handle<T, I>(T, I);
index b1c8f9c23c5d0ed11a7570d7bb59e73a34700c29..ad6ade4c59f12c38d71c772646b053fe498abf37 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
   match 42 {
     x if x < 7 => (),
index b3492180a5829322f3fb49376eab4bf31fe8b761..8b2e1c3e149f7eedb646defd0631451d145dbd2f 100644 (file)
@@ -11,6 +11,8 @@
 // Regression test for Issue #22536: If a type implements Copy, then
 // moving it must not zero the original memory.
 
+// pretty-expanded FIXME #23616
+
 trait Resources {
     type Buffer: Copy;
     fn foo(&self) {}
index f668cae66c6036e9f3e4b5bd66aef82a62cc016b..a47c844e1994a3e032b35c6aef6ce6f222c0c5e0 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(fs, net, fs_walk)]
+
 use std::{fs, net};
 
 fn assert_both<T: Send + Sync>() {}
index 7bbd85d817fb96a5893cac592f019234155998e6..07ca79295bf5cacdeb91eaa667277dc99695d65e 100644 (file)
@@ -11,6 +11,8 @@
 // Test transitive analysis for associated types. Collected types
 // should be normalized and new obligations generated.
 
+// pretty-expanded FIXME #23616
+
 use std::borrow::{ToOwned, Cow};
 
 fn assert_send<T: Send>(_: T) {}
index cab33beda405f619afc786f6b5c94c64e99a2475..2dc4d775a9c45f17777f7cd00108af398068703f 100644 (file)
@@ -12,6 +12,8 @@
 // can successfully deal with a "deep" structure, which the drop-check
 // was hitting a recursion limit on at one point.
 
+// pretty-expanded FIXME #23616
+
 #![allow(non_camel_case_types)]
 
 pub fn noop_fold_impl_item() -> SmallVector<ImplItem> {
index 8ad960b3f1b45ccb441196d4f576fe8e8954f285..d6a4d7834dfce3585030cf586ccda913d6b4bec9 100644 (file)
@@ -11,6 +11,8 @@
 // Test transitive analysis for associated types. Collected types
 // should be normalized and new obligations generated.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     type A;
     fn foo(&self) {}
index b8c9ada8b1e23abe8573819a5c6c15fe26ba8ec7..d606c52607ab013c0ef5965edeb2391dbbce553f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Send {
     fn f(&self);
 }
index 18bb6fe55299d0a0c362b11ab04de38e554e24b6..d4c882655b17a1b57a3d79303090075a89b158b7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 5529d51b408c0782dde9c985ee71c364f211a5f3..c76bbaf968a6539c6637b115407e0f0fe3626ac9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait clam<A> {
     fn get(self) -> A;
 }
index b6b3114e2a487c3a07963eb8a6a1e39bfb2b1219..5a086fd6fc2dc6fe9e9b9318873996a73bee725b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait clam<A> { fn get(self) -> A; }
 trait foo<A> {
    fn bar<B,C:clam<A>>(&self, c: C) -> B;
index 3f273b56efd6cc4ab90cfec83fa4f28d3979e2d1..76bb216ed77eb6b90ba5f2629464d6eaa4e9b470 100644 (file)
@@ -10,6 +10,8 @@
 
 // Testing that the B's are resolved
 
+// pretty-expanded FIXME #23616
+
 trait clam<A> { fn get(self) -> A; }
 
 struct foo(int);
index a6fac423bb6772f1ea86a1de55e6447df7453db1..158e4570f2c702b11289efd8ec0db0ba7bdf2bc1 100644 (file)
@@ -11,6 +11,8 @@
 // aux-build:issue_2316_a.rs
 // aux-build:issue_2316_b.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate issue_2316_b;
 use issue_2316_b::cloth;
 
index dad7d0675d62759589c85814fecd879de32ad380..9b727826e6dc76b3e43df8b5cdbb42d85a773612 100644 (file)
@@ -15,6 +15,8 @@
 // instantiates all the methods, even those that could not otherwise
 // be called.
 
+// pretty-expanded FIXME #23616
+
 struct Foo {
     x: i32
 }
index 22976aac6e774ae3e5a93412c0ba96fcfdec6e10..b7041624247131d34e26f9ea779479f93d1cd89d 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-2380.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate a;
 
 pub fn main() {
index 9599a90895079d870aae2b1329e65d5b126f4150..9c400aac1dcf1d36402e680d74c487c4caee5aa6 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections)]
+
 extern crate collections;
 use std::collections::VecDeque;
 
index 0b891fbddccf14a7b04d312491dbf36de5b22cac..2e047ae0127c7396a687487f6ca2578918ed897f 100644 (file)
@@ -11,6 +11,8 @@
 // aux-build:issue-2414-a.rs
 // aux-build:issue-2414-b.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate b;
 
 pub fn main() {}
index 7ed26428be04e46898aadde8037572f612c2cb6d..df604fd8e667cbd79c348f813dff87699ccc04c6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let _foo = 100;
     const quux: int = 5;
index 91f76fc5ae0610298b65e9b7b23241ee31e0c4d0..7c72b3aad9290da09b09aa4f25d017a3af9ff8ec 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct c1<T> {
     x: T,
 }
index 6356c87bfc9610d8a25695ab6517279d191302dd..3c72aa24f9b1cce238bcd805181a0fe48dbcfdee 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct c1<T> {
     x: T,
 }
index 051ebd1ec045fbd7c526be391be553db1695a5d8..2dc913a8f93e99d852d46bbb0eb91cafccc386db 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Pair { f: int, g: int }
 
 pub fn main() {
index 53b0042405b0bb7c6175cc9fe624479a4cfee860..0cbdbda63756a4aa2db99411e610aa97597bad24 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue_2472_b.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate issue_2472_b;
 
 use issue_2472_b::{S, T};
index aa61d52b2a32d4b1648d3eca2c897ffaac72962a..1c62d6a5f4a247c6e66fb33a6c0032399da5f2eb 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct socket {
     sock: int,
 
index a62e329f106f542914543a8062475755ead843d7..63179cd14acda5deac6f904d71ad949ed0f53927 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 struct font<'a> {
     fontbuf: &'a Vec<u8> ,
 }
index 18c59dc9adc8e828b05dd79d570aa3a57042b0b8..0c68c47023194fab2067ac2021fd1d1fc9eb182c 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-2526.rs
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_imports)]
 
 extern crate issue_2526;
index c55de959a9464aee56073d392bf016de074f4a5d..d1e97e6cddf97616f852269e986e9793ff01951a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct C {
     x: uint,
 }
index c005699ce30b4f19911944ed5d64f60730a917f5..17ace84b1e8a5e5f73a4cf9dfeed862889caab70 100644 (file)
@@ -11,6 +11,8 @@
 // Tests that impls are allowed to have looser, more permissive bounds
 // than the traits require.
 
+// pretty-expanded FIXME #23616
+
 trait A {
   fn b<C:Sync,D>(&self, x: C) -> C;
 }
index 84f046499e439ca1f96c64e15c626a0a401760a2..b6d180da849c0c6e9c1c86317f49cd3e8adc2e40 100644 (file)
@@ -11,6 +11,8 @@
 
 // aux-build:issue-2631-a.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate req;
 
 use req::request;
index 0bef42b6202edfaec0291b7706f2b8a63ed10452..3812ead42f998b3c3bc37f1f6180571d890a3aa4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index dc6015545421cc61539ee61c28445983a2ee37b2..113fe620d30dee5f35b16e932bf7d0b24edad924 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn f() {
    let _x: uint = loop { loop { break; } };
 }
index 6aeec228c0d3e2f9a1bf4f3564b21daece451fa0..3f9dc46775a1b4fd72b1e538178fdb3a3836c05e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 3a1178c2824cb0800b2e4ec116facbb31e5d08dc..8d0e06549335c3595ce2d6aac589c6e8ec23f3a7 100644 (file)
@@ -10,7 +10,7 @@
 //
 // ignore-lexer-test FIXME #15883
 
-#![feature(unsafe_destructor)]
+#![feature(unsafe_destructor, std_misc)]
 
 pub type Task = int;
 
index bab7b0d24db70f2af04493989d13c80425d29f81..7fee2fc16cbed96edbce3668dfccc6459231eec1 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue_2723_a.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate issue_2723_a;
 use issue_2723_a::f;
 
index a7b53db6b0553f173988fa4b63e33ada1eac2fca..18cd9a87e6b05418fbf0ce1bc0427067e360c7b6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 0d1cf1c339227689787ff76a3712ea3719973ff3..1506b2d6bf089440705d3b8124691dbefcbf23f4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 
 use std::cell::Cell;
index 658183cf6ff5437b64fc1c74f1d58b55aa033b02..2282334d66d106b991d7ed6911f9377088c57063 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 
 use std::cell::Cell;
index 1594b94879cee099cdb31a22a7eb6bc9f1c2921d..cd6c6a59e2a6c2d30ff530820cf4404c6449442f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 23e26ca5665c5a5a3e658baa1f153c85a1198915..ac1e65ee77634de9a641b482eee0e613da90c456 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct CMap<'a> {
     buf: &'a [u8],
 }
index 3ca8d49eb864d2f53a5429c5d877d6c50bf70a7a..5590f3432d509ded1cf3ba596db39e1f5af3fd30 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn thing<'r>(x: &'r [int]) -> &'r [int] { x }
 
 pub fn main() {
index 4f89d28332a2349a5a1ff0d3e9636cba60effd41..4c09c39e4f9a657fb3482aa5d049938131d98ead 100644 (file)
 // Minimized version of issue-2804.rs. Both check that callee IDs don't
 // clobber the previous node ID in a macro expr
 
+#![feature(collections)]
+
 extern crate collections;
 
 use std::collections::HashMap;
 
 fn add_interfaces(managed_ip: String, device: HashMap<String, int>)  {
-     println!("{}, {}", managed_ip, device["interfaces".to_string()]);
+     println!("{}, {}", managed_ip, device["interfaces"]);
 }
 
 pub fn main() {}
index b9b5aec62fcdaf1f9725be141732384b08f97680..dc1bee3a38c9e8a6fb2c421c47631411f194c89d 100644 (file)
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(collections)]
+#![feature(rustc_private)]
+
 extern crate collections;
 extern crate serialize;
 
@@ -56,8 +59,7 @@ fn add_interface(_store: int, managed_ip: String, data: json::Json) -> (String,
 
 fn add_interfaces(store: int, managed_ip: String, device: HashMap<String, json::Json>)
 -> Vec<(String, object)> {
-    match device["interfaces".to_string()]
-    {
+    match device["interfaces"] {
         Json::Array(ref interfaces) =>
         {
           interfaces.iter().map(|interface| {
@@ -67,7 +69,7 @@ fn add_interfaces(store: int, managed_ip: String, device: HashMap<String, json::
         _ =>
         {
             println!("Expected list for {} interfaces, found {}", managed_ip,
-                   device["interfaces".to_string()]);
+                     device["interfaces"]);
             Vec::new()
         }
     }
index 5f7a4d87b9ae27ff984d235395cfc82058081242..af5cf97519e94a73be4e7e336b055c1f5b56819c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 struct Cat {
index 3f954c3c9180d3602082b6328745ea44862b8d88..b05baa24b7aa11c6cd1429b9f37564127a1f5cff 100644 (file)
@@ -9,7 +9,9 @@
 // except according to those terms.
 
 
-/// Map representation
+// Map representation
+
+#![feature(old_io)]
 
 use std::old_io;
 use std::fmt;
index 183eb6e079f059a9af9a73fc0ca4e8db81771526..fb72773f4908237eead973965a1e1b354fb26677 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait bar<T> {
     fn get_bar(&self) -> T;
 }
index 6f107a37e9b25b9bec97cb09f671e76b61017910..ecce5df0fc200359877a986b716df9c4edaade46 100644 (file)
 
 // aux-build:issue-3012-1.rs
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, libc)]
 
 extern crate socketlib;
 extern crate libc;
index 8da154968447160c8c9a671a8e93e7ae2ed9c78d..e7cd7926b2e828393786f5dd36d69fd4cc00afe0 100644 (file)
@@ -8,8 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, collections)]
 
 extern crate collections;
 
index 1555098f2911be5d5df7100abba6f28eb8ce0fbb..83a522a69e3d12df77f97e43f32288a1cfaf577f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum what { }
 
 fn what_to_string(x: what) -> String
index 0784c8be883c84dd39abde8723b1fd19404c1282..8f013ee4f3a0fb9039ea195fb4e87ab3a718b876 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 type Connection = Box<FnMut(Vec<u8>) + 'static>;
 
 fn f() -> Option<Connection> {
index c4c2c2b7da8785a92d951e6e73a696150b504b0b..8e59e46fc3c4c1a4587249d5d7eca3b0c27809ff 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = 1;
     let y = 1;
index b6ed85e9e4a49b5e42ee049c3d4e3096033dba73..5a1fedbdccc37c619f7b10d2ba19762b5e488ad9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index ab64fb4fbfa1f22cb03d8d580a40b5353c636a56..fa33bd8fce80bdc3ce68810aa0dcb1ef3c7a7163 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn Matrix4<T>(m11: T, m12: T, m13: T, m14: T,
               m21: T, m22: T, m23: T, m24: T,
               m31: T, m32: T, m33: T, m34: T,
index 9c44a7cfcc3073f50044d038aa353ab6d937fa7c..ae4d05c76e321c9e13404d14fc58cdb032b016a9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct thing { x: int, }
 
 impl Drop for thing {
index 1c1b329e314c1d7ad96109c6467d138005685926..3fa5b72c348f35f946c41f91e86f02ccb842f23f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 1217f32826f6d3be179ba888f22374baeba3443a..b611f11a0a1247db2386cd43f8c15a842df0cfb5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn quux<T>(x: T) -> T { let f = id::<T>; return f(x); }
 
 fn id<T>(x: T) -> T { return x; }
index e039be058defec1a6f6d1502da16eeda8172bcc5..ecce97a301345cbebfe3b84f4b7056ab6052ac7c 100644 (file)
@@ -11,7 +11,7 @@
 // rustc --test ignores2.rs && ./ignores2
 
 #![allow(unknown_features)]
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, old_path, std_misc)]
 
 use std::old_path::{Path};
 use std::old_path;
index e331a1a2d0c1dfd75c0b1ac7fedda7b79612b36f..325a3ec715124ea3c3b35e803a884f2f19c66e80 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
   let x = 1_usize;
   let y = || x;
index 99def5476f9a0bc563c83160df9e309334a7299f..f1d9f888b081612c6ac5410d2d9035358fc53843 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = &Some(1);
     match x {
index 3f1a1c75d8a78c077fad6d1c1fceb651c5be0e82..c2ea24ac6ba9996db809fe90bd45333d86f6718e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(collections)]
+
 extern crate collections;
 
 use std::collections::HashMap;
index 2cf29296b859165479841616e28705dcbe4db682..6443ba243e2769eb1c71d8437b7091f46438698f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Canvas {
     fn add_point(&self, point: &int);
     fn add_points(&self, shapes: &[int]) {
index be4d475229591bc7c5b178dc6f2b5c2eef25c53e..5dfe02cc9ec4b428d568bde176f38cdced7bd560 100644 (file)
@@ -22,6 +22,8 @@
 // that are already linked in. Using WriterUtil allows us to use the write_line
 // method.
 
+#![feature(core)]
+
 use std::fmt;
 use std::iter::repeat;
 use std::slice;
index e31f2ade125eb08d284bb47b53152b4244089a90..9a521ba376dc2eb2a2402c11edab0b5d8c4733a0 100644 (file)
@@ -10,6 +10,8 @@
 
 // rustc --test match_borrowed_str.rs.rs && ./match_borrowed_str.rs
 
+// pretty-expanded FIXME #23616
+
 fn compare(x: &str, y: &str) -> bool {
     match x {
         "foo" => y == "foo",
index b51edcf8bec4d60adad737e151b5e1d6efcc1c73..2bd56e8168787d279a6f9450cbfcdbb933677860 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![allow(unknown_features)]
+#![feature(std_misc)]
 
 use std::thread::Thread;
 use std::sync::mpsc::Sender;
index 8a39676ca17ac44a40e7266c1523e41800e53872..10930474799c5fbde163a24b0e941e3864189e00 100644 (file)
 // Incorrect struct size computation in the FFI, because of not taking
 // the alignment of elements into account.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 extern crate libc;
 use libc::{c_uint, uint32_t, c_void};
 
index 58d7aa276f15a6611ce5e1b4f34c65e60d8a6965..bbfeb94cd9de1c5c52eac3046473135225c4a991 100644 (file)
@@ -12,6 +12,8 @@
 // Issue Name: pub method preceded by attribute can't be parsed
 // Abstract: Visibility parsing failed when compiler parsing
 
+#![feature(core)]
+
 use std::f64;
 
 #[derive(Copy)]
index 9226bebd2dcea424a93b4d919480c729d39bad59..0fe1e2af0c1406e0e7750034ac5c8bd23f3e88dc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum PureCounter { PureCounterVariant(uint) }
 
 fn each<F>(thing: PureCounter, blk: F) where F: FnOnce(&uint) {
index 1f53d9ce5422fc4831c540c3725beb2c424debf6..c98110b9054bedc5bea0342ff049ecd0d0a68647 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(path_statement)]
 #![allow(unknown_features)]
 #![feature(box_syntax)]
index bf3d0b786af65c48b53ce212626d61732bc305b7..24c1a5d05c89f1e4f05cf5f220b15d01ff65137e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn vec_peek<'r, T>(v: &'r [T]) -> &'r [T] {
     &v[1..5]
 }
index b2254001320c4c90916b883f489c426ca41dd644..ca6d9faf88f4a32b264cb6bad3c9674c7bf08b8b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     enum State { BadChar, BadSyntax }
 
index f534f744a20305f7aced7081dadf122daa14c4aa..1e200e01628a501e48d3bfef96ef5ad0559dd1ec 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(PartialEq)]
 struct Bike {
     name: String,
index 39e9f5dcd2d8d466b0a4e83d16501d279b7033a4..4cd3c04bac3c260627386cd994f5b11e93c96975 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait A {
     fn a_method(&self);
 }
index 180bd292f8433152f5ae77367bb1ba45954d2321..14e1b635e9446947819e9fb8eee4528a47a5211a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::ops::Add;
 
 trait Positioned<S> {
index a062b4c71752f5a4c038415274e48d9ede867304..ddd005224523cfa7538ff2ec958ee6f9f742c0d0 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:issue_3979_traits.rs
+// pretty-expanded FIXME #23616
+
 extern crate issue_3979_traits;
 use issue_3979_traits::{Positioned, Movable};
 
index 36939a2877ec0ff6e227173f3c2ab41718a7d852..06d1cfa0e0d3a0bdecd8576e3d520773cd45bbe0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Positioned {
   fn SetX(&mut self, int);
   fn X(&self) -> int;
index 37144fb9cce771f62332a09f96cf1a00b672f614..77fb488488c2436373f81cbceca4f04049098adc 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 struct HasNested {
     nest: Vec<Vec<int> > ,
 }
index 220332f63548af28921350fec8d9cd2fe38f1c55..122de97c99c1cd283ed34542121480a56814b76c 100644 (file)
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(rustc_private)]
 
 extern crate serialize;
 
index 48e32922ce7085bc144b7357f2e6edfedeee3d4a..b4aaf4cc7e987af7cc0575ad665b3cbfd96d6492 100644 (file)
 // Issue #4036: Test for an issue that arose around fixing up type inference
 // byproducts in vtable records.
 
+// pretty-expanded FIXME #23616
+
+#![feature(rustc_private)]
+
 extern crate serialize;
 
 use serialize::{json, Decodable};
index d660f300ada99f4ac26cb4a86734966443c22d19..0be76dd1b2243d1f07af02c569efa486a8108f8d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let _id: &Mat2<f64> = &Matrix::identity(1.0);
 }
index c186f1e57f9a1dab6b8ef92b335f1b5a8315c275..52f5d53c046abc96df6238a1885912e8bb38d9ca 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-4208-cc.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate numeric;
 use numeric::{sin, Angle};
 
index 8cae8dd7915a0673cf3404f763e897e7ad28914e..3d283849b1f9cdefaf9e90dac66cadcf4ab179f2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo;
 
 impl Foo {
index 074bbf270fd7e26f87342ceca320fd7ae71ed3e7..48753e15a705d2775d00a2b951ee9f844a423c29 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(io)]
+
 use std::io;
 
 pub fn main() {
index 02601ba2f2a02780b878189c3d091a92159bfc76..9c4ae04bf7b7fd6f73319660f11e94390de3a2cd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let _foo = [0; 2*4];
 }
index b40a726a2c397223e3746eba91e9f1be0e09847f..9f8d93461a2635805376af1a941f32c4fdf46b72 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(old_io)]
+
 use std::old_io::println;
 use std::sync::mpsc::channel;
 use std::thread;
index ef30f9182ba69b2dd77f2d810068b61e204366d4..d5d3122f6834bb81436cbd02510fac574da1c707 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::mpsc::channel;
 use std::thread;
 
index 33a5c7a167f9991ab9a121c95dd3bae5188cc6ab..753500cec99e995a9f6bcd498b89387347c0a583 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn broken(v: &[u8], i: uint, j: uint) -> &[u8] { &v[i..j] }
 
 pub fn main() {}
index 521e1b40f992e5d1b305172840ee6aaa9257bad0..23e8f5b0bda0427a8591f64c473444f3763c4acc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::env;
 
 pub fn main() {
index bf03b4c45326e6871c5b1ecf38e924e9b3b2d35d..a9d04167a41db9eba4951e87a7fbd5d7d9372cf5 100644 (file)
@@ -10,5 +10,7 @@
 
 // aux-build:issue-4545.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-4545" as somelib;
 pub fn main() { somelib::mk::<int>(); }
index c08d3503fa4c13b59abf741f8c3170c7450faab9..30c8cb1bfa4581441c2aeb2574a6513d0426e7e3 100644 (file)
@@ -11,6 +11,8 @@
 // Ensures that destructors are run for expressions of the form "e;" where
 // `e` is a type which requires a destructor.
 
+// pretty-expanded FIXME #23616
+
 #![allow(path_statement)]
 
 struct A { n: int }
index 196e9748b107317df9cc0e140d0ccedf3979c042..45db84ca93af01200775bdd2c16a9c3b546e07e4 100644 (file)
@@ -9,8 +9,10 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, libc)]
 
 extern crate libc;
 
index a565460c42e28333fad057b931ed6d27ecc14fc0..3532a395b7a2d8aebc0a2f623f7b751b9320bcd0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait U { fn f(self); }
 impl U for isize { fn f(self) {} }
 pub fn main() { 4.f(); }
index 142f088a6846942dd6f90b2c18b8e836e4360c5a..c2fc559ae81d30f0871f7fe0e3ed7c31c292b173 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 7fc1c10895ef627cd928cdb0aae219d2a0a8a02e..15d870b12a719a4e13bb777af958013e97ca4f23 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub struct Scheduler {
     /// The event loop used to drive the scheduler and perform I/O
     event_loop: Box<int>
index 9c1e782ffce19cdf24e0d162854a56bcbc7567aa..7ac96c21c621a9c4072803a375235a72dd7f017a 100644 (file)
@@ -10,6 +10,8 @@
 
 // regression test for issue 4875
 
+// pretty-expanded FIXME #23616
+
 pub struct Foo<T> {
     data: T,
 }
index a6f3771bf62b450aeb9c6ab0fbdca55dd98865d3..2a871522b447e0b7314c2cd4034dfea72ca384bc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index dd9a6fb35439e99929ab417e0e8a3ce46e6cd1c8..6720bb3f0f95d1ffc1b0251162b5f671a490728c 100644 (file)
@@ -10,6 +10,8 @@
 
 // Regression test for issue #5239
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let _f = |ref x: int| { *x };
     let foo = 10;
index f5d2c38147293fed1c1f72adc6da073505f547b9..31dc8208725c07d5ef2fcec60d025e3b0c56a698 100644 (file)
@@ -12,6 +12,8 @@
 // enough for trans to consider this as non-monomorphic,
 // which led to various assertions and failures in turn.
 
+// pretty-expanded FIXME #23616
+
 struct S<'a> {
     v: &'a int
 }
index 1d2e7b79931f98dce8b83dca090af4fb973c3928..b8532c55c4cb66166ba7941503401ae9d104ad5c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct A(bool);
 
 pub fn main() {
index 1f6493d961c5a847fd4578326f671b7ba7b8f615..34ef63572ae1ee0d2e5839007cf98767f8f97978 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 const INVALID_ENUM : u32 = 0;
 const INVALID_VALUE : u32 = 1;
 
index a28bc9f825d5d0ac3d3fc491d5d74b80eb2c6e4f..e24b69bb0de1ff092140e1cc3cca74563e8b1498 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-5518.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-5518" as other;
 
 fn main() {}
index fb0e8e599eb2af9477cdbffce70a292b28b7ffd4..c9196fc66b032f5bbfc8e2bed97a57f4e44568a5 100644 (file)
 // aux-build:issue-5521.rs
 
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-5521" as foo;
 
 fn bar(a: foo::map) {
     if false {
         panic!();
     } else {
-        let _b = &(*a)[2];
+        let _b = &(*a)[&2];
     }
 }
 
index a9e1ffcb34510ecdc4af67b7a53a4dcd308ffbb6..7b3d226fe124edfd05f617bef9051b5737d11a57 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Enum {
     Foo { foo: uint },
     Bar { bar: uint }
index f87f1d8af7649fb723fdd9c707311c72059207dd..91741f938a5a0c757ac492b40af990f91c60539d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 
 pub fn main() {
index 32fca7a182c1b7c465dfc2f915fa11cbb8912bd5..63dcae41d8384b823a1c5c3e023bdac7f88d0ca2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::default::Default;
 
 pub struct X<T> {
index 4e57ed94991cba315f4a00c69348fc6bf1f20b7b..6ae9dc68a5c675e644ceb3742f4e8a45564ccef1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo<T: ::std::cmp::PartialEq>(_t: T) { }
 
 pub fn main() { }
index 59bca87bed0b61a8432cf09be88ff86ebaf2ea17..54773d71cbec0464575cabb24c2ea131181cadab 100644 (file)
@@ -41,7 +41,7 @@ fn new(inner: &Inner) -> Outer {
 }
 
 pub fn main() {
-    let inner = 5;
+    let inner: int = 5;
     let outer = Outer::new(&inner as &Inner);
     outer.inner.print();
 }
index 7e773cd799476c12f9b46b0a53c991ba0d8c57f4..8eea99cf562363bbde8c3e01da8b8b33fc873112 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 0aaa0c862410447143131e0fb8fce90e419d029b..5190bd95adadc89e368f085875ee5e61d44d4728 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unreachable_code)]
 
 pub fn main() {
index b2eeedfbdc9225071314aec2dc3d171ee6bafe03..e6bc516acc39fe07f83987b74af17e604f20d915 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct TwoDoubles {
     r: f64,
     i: f64
index 468f420624a5f8f44ede4e90b5b023fdca5c31ad..aad90bd4181d9f77e9dd4d9da133e5b37a1692f5 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 extern crate libc;
 
 extern {
index 6502c66d8582101a6dd7c120d9d5d60ffef628c3..d798560a232a1d3985b816f24c5b72db1dde5c48 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 4518b503c0dc5a61172013c34e74e32ac7743d0d..65ece1f671154257920cb79206b7cfd55797ada0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub mod foo {
     use super::Bar;
 
index 5b6012673564d03447fa52a44ef99e7f6a362d11..56122700683b789bad6a1353b3a038692e4bd666 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct T (&'static [int]);
 static t : T = T (&[5, 4, 3]);
 pub fn main () {
index 88bbba44bbe14a30135f5ad793287eabfa5814ee..b0e01db14d85a381385db3e26322042e193f351e 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub use local as local_alias;
 
 pub mod local { }
index 1ad48d326eaca423d151628cc4a1b579c071e2e5..8ec88d55721d30d69c80766c3fcc492d8c96479e 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(old_io)]
+
 use std::old_io;
 trait B {
     fn f(&self);
index 0ce8823bc99aae8b9f81489779cc37287e77b4cf..dd311c812e50ffa233ddfb1c28b82df6128629fe 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn f<T>() -> bool {
     enum E<T> { V(T) }
 
index 562e2b68af174391bd71ddbf093f919bb22445db..555272974021a5d4fbe5fb79660cf9f06600fc3d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Either<T, U> { Left(T), Right(U) }
 
 pub fn main() {
index 1746a6281dc2694a33144dc917a69f8b32327af9..84baff9aae1d826940df87cf803c8f54c018d5ae 100644 (file)
@@ -8,8 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, collections)]
 
 extern crate collections;
 
index 1a1f538a548b722ab86c40f1d2b596b5cc888b40..1f204ab896b9feb4c6d56e055cadf6bc2866bd76 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![deny(type_limits)]
 
 pub fn main() {
index b2b64e62c39a4d645043b54ceb800ac56d185ffc..5df3478c84cdaa76638fc3b611abb1de0ae402de 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn swap<F>(f: F) -> Vec<int> where F: FnOnce(Vec<int>) -> Vec<int> {
     let x = vec!(1, 2, 3);
     f(x)
index 39f387afaba048905de543623e8600b6f4c7b14b..756aaece681aba8d847cb22946f64473ebd32db8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub trait OpInt { fn call(&mut self, int, int) -> int; }
 
 impl<F> OpInt for F where F: FnMut(int, int) -> int {
index 61bc70465e0f2e63c2344054bb606297e6bd4c2f..12b71f519b1e62a59088ac15a1f50ec6a4fd5538 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 67440b6ec1c9199749f7c337f4a68eab7fda905c..fa546a80bfbc3241b0ecd861520b37fbb2f751ae 100644 (file)
@@ -11,6 +11,8 @@
 // Tests that everything still compiles and runs fine even when
 // we reorder the bounds.
 
+// pretty-expanded FIXME #23616
+
 trait A {
     fn a(&self) -> uint;
 }
index 6e49c0435665df0a693a9acc532cba6c93297279..8ca921f5a0595e947c339b06ee6e3e244424f9f2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(PartialEq)]
 struct A { x: uint }
 
index 9a5fc7763f63b4a21535cbae5f497232c248e7fc..6d2b3ffc75beba415831e9da0ccc86bb96df5539 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Foo {
     Bar(int),
     Baz,
index ef164150804b99a98b4bff37a04e39b8473e3a59..05a5dcbc3f88973b4bf65531c3cb0b6c7076aa80 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub mod Bar {
     pub struct Foo {
         v: int,
index b9f4f1cf3bd51fafb7134062bc07121bbbba0661..a618b3d2e7cd98c796ac8ebc422d5ed374f4e124 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
index 6faca339651c07b77d091200363385f9a40e6be8..43da077ab1f8f147101f29fdc5296aa1c217eba0 100644 (file)
@@ -11,6 +11,8 @@
 // Ensures that destructors are run for expressions of the form "let _ = e;"
 // where `e` is a type which requires a destructor.
 
+// pretty-expanded FIXME #23616
+
 struct Foo;
 struct Bar { x: int }
 struct Baz(int);
index 9e6293216bc116b18bac39236c8673b0553b241b..19e59ea2d73313245539eb3a7c4d6a450d5f0041 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::intrinsics;
 
 /// Returns the size of a type
index 10dae96d88d94c22c4e2a0a62ebecf9704d891ef..3495c0eb1aed34503c4589d36c203616f433774f 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:iss.rs
 
+// pretty-expanded FIXME #23616
+
 #![crate_id="issue-6919"]
 extern crate issue6919_3;
 
index 6ef740b2a50513c63d9682b996e6b81d364b14b0..3180927f74d88ea43064b99cb21e02c61ca26024 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-7178.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-7178" as cross_crate_self;
 
 pub fn main() {
index 0ca4e428bc403986c660633a3591ddb5db994db5..1bf343e23f0c1617c6635ab9e27e399784ad1ffa 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     const FOO: f64 = 10.0;
 
index 8aa95927312301e173692511acf7643277cd7fb2..626adfe292bfa421b86db957e436ad3be2511c7f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo<T: 'static>(_: T) {}
 
 fn bar<T>(x: &'static T) {
index 6e2ed27725c0fdfbd33e08e584ad3d42d3cb3e1d..fb348fb45380479a2fa76ff582e384bc967e25a3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unreachable_code)]
 
 fn foo() -> bool { false }
index 75123243f47d6209119b0e68b2de07ae4587a6fb..c5c59407ab2311a3fc15684d4e039795e54894b7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /*
 #7519 ICE pattern matching unit in function argument
 */
index 77cfc7f0cf607dc2aa15b84089e2c1d9c11b170a..471caa551498f8b3f7a3e4447cf7fe7e46f263bb 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn new() -> bool { false }
     fn dummy(&self) { }
index a0408a0359070e66f127a7b11feeb1dc1cd15b8f..799513e6e4f2112166504456666e6345a01dee9c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub mod a {
     pub struct Foo { a: usize }
 }
index 9e36b1f5082d03dad3f1a48bc3ed9a38326eb600..f044c4d3e5022710e560f808127b130e8ec7ba63 100644 (file)
 // Regression test for issue 7660
 // rvalue lifetime too short when equivalent `match` works
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections)]
+
 extern crate collections;
 
 use std::collections::HashMap;
@@ -21,6 +25,6 @@ pub fn main() {
     let mut m: HashMap<int, A> = HashMap::new();
     m.insert(1, A(0, 0));
 
-    let A(ref _a, ref _b) = m[1];
-    let (a, b) = match m[1] { A(ref _a, ref _b) => (_a, _b) };
+    let A(ref _a, ref _b) = m[&1];
+    let (a, b) = match m[&1] { A(ref _a, ref _b) => (_a, _b) };
 }
index 0ff265e483efe226a29873ce9a495c3ad9822ddf..3b954ff19481a4d0d3008273f13e3d409e987606 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_imports, dead_code)]
 
 mod test1 {
index 736860947f23cb0c149718be36ba0a940a6bfd2b..43b5a997c19a523762fcfaaecfce957bfb4bb3dd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /*
 
 #7673 Polymorphically creating traits barely works
index a61ee8c2a0bd1e22742d2ace0f28c716fd6d3c7e..9dc2bd81182850f25e6f5adb148aec4f97c74d8c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(advanced_slice_patterns)]
 
 use std::ops::Add;
index 4b3d46f483399c2354f34bbedf217c03d7ec7e21..a830de42862dfbe4dfdec1ebebe941dda48c8144 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-7899.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-7899" as testcrate;
 
 fn main() {
index 504441e3ba96b4bab8eadbf7d3dd7083e6c72934..284b0ff034815c6c14f27a8251cc737027bc2221 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-8044.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-8044" as minimal;
 use minimal::{BTree, leaf};
 
index 3238c24163e17578ae572e570ae4ad02a3e779b6..92d1c7c5a1c3d3dda91c85cad98b7be84976b4d9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /*
 
 #8171 Self is not recognised as implementing kinds in default method implementations
index 3800564b867ba03ab4ec5d3188e53533c8e7b59a..b58be361f15d02318cb05d71da2b7402ff68ae7e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait A {
     fn dummy(&self) { }
 }
index 10d3ade648d0c947e5f19cd946c58d9de7a9179d..3e65bc000ff84ae6427dbc82984f1907fbbc676e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait A {
     fn dummy(&self) { }
 }
index fb893873bc4d337bdb962d0f2eadf04d4bd66044..34e5ee5621b15df11c79fd42cb74875fae0470ab 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-8259.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-8259" as other;
 static a: other::Foo<'static> = other::Foo::A;
 
index b7e6facc58187a44868ea261e697da5a7e61ff83..4e42f943d356c3e63229bbf6e65beee9d17c1cb6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E {
     Foo{f: int},
     Bar,
index 40e0b3a8eeccb6e9f162597349e3774ea9d21220..10dd803d050c7c868e82bed23a787fdd4fa7e41f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E {
     Foo{f: int, b: bool},
     Bar,
index 86c9b8c69646941d5f6809ed467018ae989f9661..bd2e2871bdb49489279c98bcb8545faaa7465ebb 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let x = match Some(1) {
         ref _y @ Some(_) => 1,
index f8065d0bcd363943a82c29f43225cdb69298c9a5..8eb10a199eaaed3c99816df36a8b60ae5088f2b9 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(old_io, io)]
+
 use std::old_io;
 
 fn foo(a: &mut old_io::Writer) {
index 1ca91366f362c76ca0d3fde53f070b791c597945..afdd572b129a3d5421db5e36b047c9a0bf52e373 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue_8401.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate issue_8401;
 
 pub fn main() {}
index 00339a4e84b2b470e4b54c5842f8131c30fea2d2..0ef668794ec0df00489f09c214a4a79122ac12a8 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::num::Int;
 use std::thread;
 
index d4d2603bfe2449b2626257b4e9504bcbdbe550b2..825729b1e2a81509665c48ef890fd621d4ee7724 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     match &[(Box::new(5),Box::new(7))] {
         ps => {
index 54dfe2b9dab51e86c49328af5a1edd2c2f1572da..24632a0d13a10d58434bb65375bfddb8b00eaa89 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 enum Either {
index 275fe740db157ca60c5e136efde82437d80bae4a..ce392f8d881d4d1389aebd815d7e176619bb4bfd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub struct UninterpretedOption_NamePart {
     name_part: Option<String>,
 }
index e47999fc468607c2dc3a13ff6df57c67c76554a2..64b463ddf5c68660b7da10d856fd7eac9f188f39 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn f<T, F>(g: F) -> T where F: FnOnce() -> T { g() }
 
 pub fn main() {
index 865905bf50441a9143b527b7af53924cf8f20573..a75696fbe29303a6d28a070ff43e022e149d1620 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! sty {
     ($t:ty) => (stringify!($t))
 }
index 303dd191006ad88465c39633f32a67049e70241b..8097df4927adf3d61b21b022809874b7d27d9bee 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::default::Default;
 
 struct X { pub x: uint }
index d7a8674954696b8a6291a645ab3719328572295d..b2aa93d280c926c568741a894cd0b055888120cf 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread::Thread;
 use std::sync::mpsc::{channel, Receiver};
 
index b70711f9f39e25a393a5fafc2e59b3726e5ff92e..48cb2a64bb7fcc82cf193292ac308a3647f17b09 100644 (file)
@@ -13,6 +13,8 @@
 // doesn't cause capture. Making this macro hygienic (as I've done)
 // could very well make this test case completely pointless....
 
+// pretty-expanded FIXME #23616
+
 enum T {
     A(int),
     B(uint)
index 72e2a33b43eac55dad06ec1e9778da78cacff4da..968f621037fa531970a3132a27e618c9803b10fb 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 static mut DROP: int = 0;
 static mut DROP_S: int = 0;
 static mut DROP_T: int = 0;
index b1c443dd0c51b5713a2721c538bf0d84b18bbc5d..a4cad1b263952cc289ee22f6e3926e1c3d1e7c48 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn assert_repr_eq<T: std::fmt::Debug>(obj : T, expected : String) {
     assert_eq!(expected, format!("{:?}", obj));
 }
index 09d0f20c96d6c4d9eda35e3fdb22a6daf2780b4e..298ae5e6aaca81aa1fd7007b4685f495c4de30e1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! silly_macro {
     () => (
         pub mod Qux {
index f66215aa43f8ca91fa2c224b0ce4f524df50bdfb..4da0c22a0b1bfa2321b16a2b37f0723b2258f50b 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue_9123.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate issue_9123;
 
 pub fn main() {}
index 73d3b3559356943c75c14124757bc05342bfe028..1600ce22dd4d6682794627e03a571782a9e15a67 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue_9188.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate issue_9188;
 
 pub fn main() {
index 2795fd59c0c0d7cf156a3f64abd63a886888786b..e4d848dbd754cf8dc352cefc53f9a394a1c6037a 100644 (file)
@@ -8,5 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 static DATA:&'static [&'static str] = &["my string"];
 fn main() { }
index da5338b8c3c61438bdfdf74362909e788cb94fda..209c6b139612f08ee1fafe949240616d2516040d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct A<'a> {
     a: &'a [String],
     b: Option<&'a [String]>,
index c501420fa617a00c212fc6f5c2a609512da99d3e..f9cc8cb293fd1de4e30b9b3cc5eb5ca3310461fe 100644 (file)
@@ -1,3 +1,5 @@
+// pretty-expanded FIXME #23616
+
  // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 7273a45d893269254727439f0bcfa37eec582bc4..148d0760e5c02f9f96b47e9fd012e86cbd8c2cde 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Base: Base2 + Base3{
     fn foo(&self) -> String;
     fn foo1(&self) -> String;
index a98d1aba04dfd716d65efe69e7caafebf34d69cc..aeba6889f49e8ae25b0e271330bda2c2a10bba15 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(old_io, std_misc)]
+
 use std::sync::mpsc::{TryRecvError, channel};
 use std::old_io::timer::Timer;
 use std::thread::Thread;
index aa1e65efaa41e49b87a8651caa213af1b2091278..6e88379f9a41b2676b33eb65002d535cb57376a5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod a {
     pub enum Enum<T> {
         A(T),
@@ -19,7 +21,7 @@ fn dummy(&self) { }
     impl X for int {}
 
     pub struct Z<'a>(Enum<&'a (X+'a)>);
-    fn foo() { let x = 42; let z = Z(Enum::A(&x as &X)); let _ = z; }
+    fn foo() { let x: int = 42; let z = Z(Enum::A(&x as &X)); let _ = z; }
 }
 
 mod b {
@@ -32,7 +34,7 @@ struct Y<'a>{
     }
 
     fn bar() {
-        let x = 42;
+        let x: int = 42;
         let _y = Y { x: Some(&x as &X) };
     }
 }
@@ -41,7 +43,7 @@ mod c {
     pub trait X { fn f(&self); }
     impl X for int { fn f(&self) {} }
     pub struct Z<'a>(Option<&'a (X+'a)>);
-    fn main() { let x = 42; let z = Z(Some(&x as &X)); let _ = z; }
+    fn main() { let x: int = 42; let z = Z(Some(&x as &X)); let _ = z; }
 }
 
 pub fn main() {}
index 919f0aae38e0acb48a104fe9520d154ff0a75470..81edac3cef2659d9a2a8daec70692fd0aa785d14 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 
 use std::cell::Cell;
index 921965b280b28b90bf4bce7596256d7a4eef5dc6..2730f567aa3bab39346b88de38ec1d45c45bc6fa 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-9906.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-9906" as testmod;
 
 pub fn main() {
index 240a134221d3473c2ff08b69d982c04f21797516..e81a07fa68325a5b870e106c1d5e7458347a9731 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     assert_eq!((0 + 0u8) as char, '\0');
 }
index c7dea71998646463b66b72a78680128f2df49787..1c554250a1118ead9c573cac0371288a70456357 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     const S: uint = 23 as uint; [0; S]; ()
 }
index 210f647e5be2f0aa7196aa032840bb74eda65b32..63807395fb0cc0f70e7eaa05d04f3f617113bf55 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_variables)]
 
 trait Bar {
index 2c9382be9b17c82768fe9e3cdab9fc44ceeb91f7..5761c8d9438483ad74c6785281528004a9324729 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue-9968.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "issue-9968" as lib;
 
 use lib::{Trait, Struct};
index 58424089c5e02a83457c5f3b7ee309730b8ab649..d126d1f6ce1d3886e9b79efa022538eb15cfe001 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:issue2170lib.rs
+// pretty-expanded FIXME #23616
+
 extern crate issue2170lib;
 
 pub fn main() {
index d30a0be5feeb5873e89ca062c59e89e1d914ad28..8538950a895c2cc8a969966be6ca95f6b146a041 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 // This used to cause an ICE because the retslot for the "return" had the wrong type
 fn testcase<'a>() -> Box<Iterator<Item=usize> + 'a> {
     return Box::new((0..3).map(|i| { return i; }));
index a6fb993a96b0065517ab678f0416b536c4b97607..cffe3f9572b29b6b5785b58b2b50ef452670ef37 100644 (file)
@@ -10,5 +10,7 @@
 
 // aux-build:issue_3136_a.rc
 
+// pretty-expanded FIXME #23616
+
 extern crate issue_3136_a;
 pub fn main() {}
index 951cde3264b2c02d2584ee4a75112aad9cee377d..9db556bf9a22feaedfb499908fccafb6e55d532f 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:issue_9155.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate issue_9155;
 
 struct Baz;
index 15195482ed693921f39beac19f320a62450fb2a0..0013cb292e1c7d87c4914b711910be61dfc55d52 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(collections)]
+
 use std::string::String;
 
 fn test_stack_assign() {
index 6036af5c6275f9c3a68ebdb1057c07ad2158756b..e1b980d7132087ec0fde8e5ba80793bccaff0e2b 100644 (file)
@@ -12,7 +12,9 @@
 // for completeness since .rs files linked from .rc files support this
 // notation to specify their module's attributes
 
-#![feature(custom_attribute)]
+// pretty-expanded FIXME #23616
+
+#![feature(custom_attribute, libc)]
 #![allow(unused_attribute)]
 #![attr1 = "val"]
 #![attr2 = "val"]
index 9aefda4bc71164ab66a176e1e8b2b6d0953a5b30..2827a6df3373767f09fcf59581cf17a614301930 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 mod foo {
     pub fn baz() { }
 }
index 6ce226bbecac294a53f6d980981006f158f2b7f6..12f6a7caf6c399f783038f1686df4cb151368290 100644 (file)
@@ -11,6 +11,8 @@
 // Test to see that the element type of .cloned() can be inferred
 // properly. Previously this would fail to deduce the type of `sum`.
 
+// pretty-expanded FIXME #23616
+
 #![feature(core)]
 
 use std::iter::AdditiveIterator;
index 36f0d3c1c52074028d74caf425b56931858abe13..246ba19a59bc7c27cf62b76681dac18574687cfb 100644 (file)
@@ -9,5 +9,7 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn f(_a: Vec<int> ) { }
 pub fn main() { f(vec!(1, 2, 3, 4, 5)); }
index 121338823d29133497b1bfa86bf048e1c13df82a..d5138f6fdbc5968afe4a942accd3fd7441acd70a 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc)]
+
 use std::thread::Thread;
 use std::sync::mpsc::{channel, Sender};
 
index ff568b77f08ac205fffb295f9579855d92868b76..97025f209a2c210609910012cada364d0a55c599 100644 (file)
@@ -12,6 +12,8 @@
 // mod -> module
 // match -> match
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
 }
 
index 9d6ca1e9cfb1065fb468003c6f5f471a8fb145ac..ca405f54415c971bf04e30578d20719c36fd4d0d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread::Thread;
 
 fn user(_i: int) {}
index f05ac11d4138031683a6ed26ce769bbd72311d53..84156385ef438df611dfd93a1038e42b28bcd079 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index bd75f547507c7c1061fa8dbb8b14cccae6bcd088..05c6cb7f5ac6823b06332a0e2abac0eef6b690fc 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:kinds_in_metadata.rs
 
+// pretty-expanded FIXME #23616
+
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
index 30c2495d590fee7bb6a8f9407fedb56ff9376662..fe2f35c5119e038619f176cd3d3b13e5cab29125 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     'foo: loop {
         loop {
index 20ec058b9f4a1b8535b50b2e7151441a748f5ea7..6824d9a1ccebbbc2f8b54553f2d5ea4a1ccf0844 100644 (file)
@@ -12,6 +12,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 struct Large {a: int,
              b: int,
              c: int,
index 8ef5df5d6969729f2365ee0f8f99ad8bfb61c107..28fe3bf0bd1fd4ef3b336d078b8a64496e0b766c 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #1818
 
+// pretty-expanded FIXME #23616
+
 fn lp<T, F>(s: String, mut f: F) -> T where F: FnMut(String) -> T {
     while false {
         let r = f(s);
index 45964efad97c86e27ce97a0cbad38b9797aea193..f9c8fe0f2d2d5945c5bea5fdcad10325f10b207b 100644 (file)
 
 // Make sure #1399 stays fixed
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, core)]
 
 struct A { a: Box<isize> }
 
index 65808de3cf42b2122761a9704f6756fad40566b8..fe89d52bcb317f319943245ae6858f193daecd20 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index c0f674d03714f12d616df55b15d442bdabf13c78..0b38d16941bae9e79a3599478af1845e1a71a3ea 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = 3_usize;
     let ref y = x;
index d6409267eb6900219f22c281b2439b64b6f7cd95..c1e80aaf2d7b0f4f81312d48cc1dc28c2647fe32 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // shouldn't affect evaluation of $ex:
+// pretty-expanded FIXME #23616
+
 macro_rules! bad_macro {
     ($ex:expr) => ({let _x = 9; $ex})
 }
index 80a859c03bc3d70e969fac1bc91ed9d546dda28f..3c238d3fe78c6d92e86e71772f0626be67dfb794 100644 (file)
@@ -12,6 +12,8 @@
 // ignore-android: FIXME(#10379)
 // ignore-windows: std::dynamic_lib does not work on Windows well
 
+#![feature(std_misc, old_path)]
+
 extern crate "linkage-visibility" as foo;
 
 pub fn main() {
index f51312bc257719307836e0c27e81b5babcbb2416..37de5745bb48bc74f4f3729269d528d1f1b85e1f 100644 (file)
@@ -10,6 +10,8 @@
 
 // This is ok because we often use the trailing underscore to mean 'prime'
 
+// pretty-expanded FIXME #23616
+
 #[forbid(non_camel_case_types)]
 type Foo_ = int;
 
index ce3518618d0b475b4b4ca552c74a98df48a98d30..b530a3facaf180285f975112d117ac003b305af3 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 #![forbid(non_camel_case_types)]
 #![forbid(non_upper_case_globals)]
 
index e55c1b36f3e24b357c90ca70b82e6c0bafe8822c..dfd2d191d494b12a34446f4c82973c87e8c6499f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 143972fe299fe51db6dee4eddfd9a564528ca565..ce6f77633db56f7ccfa2cf6e909d3fe0497c1133 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 #![allow(unreachable_code)]
 #![allow(unused_variable)]
index f13e2826c8532bad73c5767f64d908ef51e01dbd..f10d851a463ed9ff89e0f19377679adf624694e3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unreachable_code)]
 
 fn test() {
index 9120151051ea05ab2e1b38247650cd8b4da0750f..4f1b6f3b925a618faa4fdfe7589fca708abf795a 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn take(x: int) -> int {x}
 
 fn the_loop() {
index 95a5f1003b6e356f8b39dd57e08bd7aac77513af..49328311867601af9aacbf15f81d9b446dee44cc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(trace_macros, log_syntax)]
 
 // make sure these macros can be used as in the various places that
index dfc9272827066c517138209ab1851338af90e681..59f5b0af359131b3f2acd4c4394b2cff7c4ddfab 100644 (file)
 // compile-flags:-C debug-assertions=no
 // exec-env:RUST_LOG=logging-enabled-debug=debug
 
+// pretty-expanded FIXME #23616
+
+#![feature(rustc_private)]
+
 #[macro_use]
 extern crate log;
 
index 372cdc401b54929ee084e12cbf7bcb88a16caf89..24ef02956266b1238beba43d11a4b539297a569b 100644 (file)
 
 // exec-env:RUST_LOG=logging-enabled=info
 
+// pretty-expanded FIXME #23616
+
+#![feature(rustc_private)]
+
 #[macro_use]
 extern crate log;
 
index ced1fdc4455194f734595ed133c8c3d6b7fb4eef..63993182a427d30fb91a4481c31b2c45dd519b58 100644 (file)
@@ -21,6 +21,8 @@
 // longer happens by enabling logging for *this* crate and then invoking a
 // function in an external crate which will panic when logging is enabled.
 
+// pretty-expanded FIXME #23616
+
 extern crate logging_right_crate;
 
 pub fn main() {
index 82a155b117301980bb74b123fa524a4cc74c37e7..b27080b65b78150629307bd83f0b3788518bb215 100644 (file)
@@ -12,6 +12,8 @@
 // exec-env:RUST_LOG=debug
 // compile-flags:-C debug-assertions=y
 
+#![feature(old_io, rustc_private)]
+
 #[macro_use]
 extern crate log;
 
index 8a21d60e468b0d0c9960cc27eeb4697e17f88b3f..820285188ae4ee5e6b29f36eae4335a2f93b52c8 100644 (file)
@@ -16,4 +16,6 @@
 // this test will trigger "output during runtime initialization" to make sure
 // that the bug isn't re-introduced.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {}
index cbe26844708db79e082b2bce2dbab5fd55ccf00b..2c2c2be39a49c41afe198cdce7e901004deaddb8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_variable)]
 
 pub fn main() {
index d58d2a7139665bd08fb304999c2fd13e42305e8d..eaf69dbae00f99135bb116081070623639490f88 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
   let _i = 0_usize;
   loop {
index 9c46ba2cb9bbfefdc0e3f0c074ed5c0fc120a020..c2ad9a6ef73e1e3736c585dfe9ce3f04bd380692 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /* Make sure a loop{} can be the tailexpr in the body
 of a diverging function */
 
index 090872e69eadb7a7a70fe1322a88ecb0eed9f477..399920a7e315cdb033feec21ad8c373994cff058 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #12512.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let mut foo = Vec::new();
     'foo: for i in &[1, 2, 3] {
index f71dc6869bee985905c04cd083fb8d430570be9d..4f03b45b116e70923b36b23d81d92604bd4c85c5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     'outer: loop {
         let _: i32 = loop { break 'outer };
index 2582c2e61479c254a4c1c2f56420c05d0d287cf6..689e17c170d9069c99087f77df41bb58ed854929 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct S;
 // Ensure S is moved, not copied, on assignment.
 impl Drop for S { fn drop(&mut self) { } }
index 88711a4605962b76e98906a68624d57f1582bed0..70f2830555a4b134c33d41a44abb23dae38a10f9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = vec!(10, 20, 30);
     let mut sum = 0;
index 6c568d6d493ca9d2aa352280ea4a6f3ea5e21707..496534a5362f3bfd5cd33064ddab9d53f01d769e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! do_block{
     ($val:block) => {$val}
 }
index efee9ba963a1e97393f7fa146ec1d2468df1e170..58b09fa492192639d9749854675f3ea9a8ee09e8 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:macro_crate_def_only.rs
 
+// pretty-expanded FIXME #23616
+
 #[macro_use] #[no_link]
 extern crate macro_crate_def_only;
 
index fbbe0105cf4fe3dc8e64185c363d3bf64344238e..38f646b79a5eeed4bb878c212cec8eb67e192714 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn increment(x: uint) -> uint {
     x + 1
 }
index c4012e2cf3c7e4459d30492642b5d0b879d5ce1e..fd21ed0150ab04a0a081f53273ccd72ccc5d418d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! foo2 {
     () => {
         "foo"
index a2ae3fbf83b0f6e82e0fd582f073f087cc1c38f3..6a3a495f2f1998f92755c080881775f4db6371c1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     vec![1_usize, 2, 3].len();
 }
index 1cbd4f6bc704c3895eff103446568a83f79ebbe5..9782ee146fc502ba0873a3b24e03ef53d920eee7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! overly_complicated {
     ($fnname:ident, $arg:ident, $ty:ty, $body:block, $val:expr, $pat:pat, $res:path) =>
     ({
index ce748967498387ad24166e01167ee5b23f872074..9fafeb6531dcade6b15956eda506c2636dc3c97d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! four {
     () => (4)
 }
index c58a03014246c64697cb83c30cbf0b2fb701c6dd..d20777aadc4a140fa54d96fda51cdc3ef4e14c48 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct A;
 
 macro_rules! make_thirteen_method {() => (fn thirteen(&self)->int {13})}
index c6efc2f2bc83bbbd1180c747490c68d1bab8255c..f3367ff2b410f7ba426c473a8718eebba4709f8a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! list {
     ( ($($id:ident),*) ) => (());
     ( [$($id:ident),*] ) => (());
index 1a77eee824b6d31107c86294bb3d7afc39064eeb..ebd58f772284a77320fe68b6abbb9f53090e05f7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! higher_order {
     (subst $lhs:tt => $rhs:tt) => ({
             macro_rules! anon { $lhs => $rhs }
index 7a3e55322c8e1cb5cb1c87d6bd96e147df3c4a4b..15387f908b441907c21e941797d0568d57b62ea1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! mypat {
     () => (
         Some('y')
index 4aa1587943413de7cc5fa0be6948fc642054c7ac..072bc84fb63a287c9647ff46eadd8ede670e5055 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod m {
     pub type t = int;
 }
index f180922a052a2c327969c5ca0b8f815a29cc305e..0938c16c30492985be9d483ec15f559c4c7cdc3e 100644 (file)
@@ -10,6 +10,8 @@
 
 // compile-flags: --cfg foo
 
+// pretty-expanded FIXME #23616
+
 #[cfg(foo)]
 macro_rules! foo { () => (1) }
 
index b56dff6b01fc5795dcb0dcc9281d636a03400ddd..cf48c325f1f24b6c6d795abbf960a3502487cb95 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[cfg(foo)]
 macro_rules! foo { () => (1) }
 
index cb52ba74bbd683088d2c1807cc72bb8c253766ac..80a3b8c9eddeeccdaf4f3b0291aa04bd83d8dcc6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread::Thread;
 
 macro_rules! expr { ($e: expr) => { $e } }
index 5c681b8e6e765c3a20fde78072d836235aff8ad1..9ecf186d5b11e5825c569a98d2eae534b11b9671 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:macro_with_super_1.rs
 
+// pretty-expanded FIXME #23616
+
 #[macro_use]
 extern crate macro_with_super_1;
 
index dfefe84518c405231f9fd26eead80853b69e0251..b9b78012c3df0e5369a44af6202cde10b9a7b324 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct NewBool(bool);
 
 enum Direction {
index b359614fa9adb2c365ec34174d72d8a2c858ae00..574c4b9f00eabb93de0a4520a06bb06364711e6f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unnecessary_allocation)]
 
 fn f1(ref_string: &str) -> String {
index 949fad11344de0bc6eef4eb52978c6c2fd0a22a1..00804634ea8ee472c61f83a5424ab27bae841e35 100644 (file)
@@ -9,5 +9,7 @@
 // except according to those terms.
 
 // n.b. This was only ever failing with optimization disabled.
+// pretty-expanded FIXME #23616
+
 fn a() -> int { match return 1 { 2 => 3, _ => panic!() } }
 pub fn main() { a(); }
index 5cc512abfe37c6aa516181a0743a84ea3a9ded86..5bd8db7b17b3dc3e8213ca219d52a22584b0c729 100644 (file)
@@ -10,6 +10,8 @@
 
 // regression test for issue #5625
 
+// pretty-expanded FIXME #23616
+
 enum E {
     Foo{f : int},
     Bar
index fdfadf8eb444fd55dbd7851818bdf26747bdb230..1224a5dd31403815b79ad146f3bd010d7b9dc24a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum E {
     Foo{f : int},
     Bar
index cd4802f4b397a6407f5e4525f459b842d415b99b..a49f7bcebcf7e2b68271c2d71d99eb9060c6c139 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index e4886ddaa0ed3155943fe8221cec54a23a66f638..374b1b54e0b327d87a977b265b4c4dda50fa17ad 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Foo {
     B { b1: int, bb1: int},
 }
index 433cf23626bbfa8f17b146cca75132c506e5837d..0e6bb1e62a5b2e2b278145fb6e853758e76af4e0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct X { x: int }
 
 pub fn main() {
index fe12b7c1585681f23a182737ec57a6f373976723..d8422ba6917015b1062aa881d5fef9d11a799ee2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct X { x: int }
 
 pub fn main() {
index b3c7f3db512b1823b4b05ab167abf20e77baa8e7..1b3594a0a792ef5b81ff434e53b4fc5febd24632 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 mod m1 {
     pub enum foo { foo1, foo2, }
 }
index abb78fc83107796484271a256be287d04e1e20ff..d230f18f2bd84fe8c92aa2604c70ccb8e66c0a20 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let value = Some(1);
     assert_eq!(match value {
index 92a753902228d59f9838bff9960beca574238d45..f8a6e475a3bd6939c7c5e6f38556c9042b559a95 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 fn altsimple(f: int) { match f { _x => () } }
 
 pub fn main() { }
index 2a0a2b208875fa97005f21eea6f733bdae28846c..5e15c642b67f612ae8321bc24626d4f6e1bb9cf3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 #![allow(unused_variable)]
 
index bdf12d22edd0f776dc6abf7305f1fc251b60274e..70d3639a785fa1574b48d4b3eab9867630af249c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn test1() {
     // from issue 6338
     match ((1, "a".to_string()), (2, "b".to_string())) {
index 0feeea70221a4aa3dd445f99bd745752cf2fcbd6..56e6f4dce592bd1755281c923cc1f726d2d1d1b1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 const s: int = 1;
 const e: int = 42;
 
index a83bc73457e020b4bdac0682be4294f22cdff004..1e2ebf42a9911d914df05f1bd4bc2834aebba05e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::Mutex;
 
 pub fn main() {
index 8d1e483bcd848cd3cc45d65a8b119e3c27b6aec1..41f00e58ff76915e7544cc6f96e2fd3e72c94933 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let mut v = Some(22);
     match v {
index 266f7cdde11af0281836105808fcd27b6628c018..9dfe079c8a828f285f80bed339dc4113984fefd4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Rec {
     f: int
 }
index 0b613df18ee833668e2917cf859a94dee11b2dd0..03d5c6817e471e752c0b136d19955ab8ba49fab3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn destructure(x: Option<int>) -> int {
     match x {
       None => 0,
index 164cc99e188eaa8cb8fd1d7fd3e0e7555f619843..433ef8a63197c307ca445468a2b76127de10c856 100644 (file)
@@ -16,6 +16,8 @@
 // around this problem locally by renaming the constant in the `use`
 // form to an uppercase identifier that placates the lint.
 
+// pretty-expanded FIXME #23616
+
 #![deny(non_upper_case_globals)]
 
 pub const A : int = 97;
index 301d99a7e20b32b807b9dcce761162c782b01d47..5d8958c6b9e87775b61b3678cfbb5b4eaa5f33a0 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #53
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     match "test" { "not-test" => panic!(), "test" => (), _ => panic!() }
 
index 6d5658aa13cbfcebc746a231053f359e761663ec..e550b354d40ee9301f813102e58a9c28d276cee0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo{
     f : int,
 }
index cf940a630569daece147b538e72a1b6477785d8e..4a04fd55df5b542e2bad83af44da5b026c609ca4 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 enum color {
     rgb(int, int, int),
     rgba(int, int, int, int),
index beb125492b2c154ead23fd4230606e7af6c1a15a..e008874e6d7be9b3a4e32d84a3891e22d3c73136 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index eb6b2176e5140d5a0edf1a6a237446172b35ee5d..520c2e8108d48735528fd93e92a04ef70b6e5586 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(advanced_slice_patterns)]
 
 fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) -> &'static str {
index 04a0204d206a25722817e5825d52c9a2baa07ee8..e368aeb976934f5cec109cba1e986d6b2361e093 100644 (file)
@@ -11,6 +11,8 @@
 // Tests that matching rvalues with drops does not crash.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     match vec!(1, 2, 3) {
         x => {
index 92af96e0d8f2c81068f5958e1bd72ef810c47e73..ccf5efddebefa1dbe84a5980ad91d2fc34b97e1c 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // pp-exact - Make sure we print all the attributes
+// pretty-expanded FIXME #23616
+
 #![allow(unused_attribute)]
 #![feature(custom_attribute)]
 
index cec9753a2fecaed27bcb197162ed4f4fef01cde2..3babb543bf2a1d752283922c0367569036eefff1 100644 (file)
@@ -11,6 +11,8 @@
 // Check that we successfully handle methods where the `self` type has
 // an early-bound lifetime. Issue #18208.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 use std::marker;
index f1d41a0f422167fa26da0e90a61353b96ee90f9a..e013c5b0be794b29cca573acce431da10120ea73 100644 (file)
 // type is `&mut [u8]`, passes in a pointer to the lvalue and not a
 // temporary. Issue #19147.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core, old_io)]
+
 use std::mem;
 use std::slice;
 use std::old_io::IoResult;
index 5ba5d7f8d722758b55c986555756a9c402bfab15..926a0c371e9dec0e1a9c19a893c5580e8d9c7b40 100644 (file)
@@ -14,6 +14,8 @@
 // winnowing stage of method resolution failed to handle an associated
 // type projection.
 
+// pretty-expanded FIXME #23616
+
 #![feature(associated_types)]
 
 trait Hasher {
index 6f72a163981c9d653e480ff4392c5089fa204a7e..496625213f7ead3e6016ecdfdb04741d8de3f571 100644 (file)
@@ -13,6 +13,8 @@
 
 ///////////////////////////////////////////////////////////////////////////
 
+// pretty-expanded FIXME #23616
+
 trait MakeString {
     fn make_string(&self) -> String;
 }
index 15eb2ae2e4b49dbfa97f5258e67d03a9c7b1d448..6877bf376a6589eaa0c45b90125f2b7d92bdc974 100644 (file)
@@ -13,6 +13,8 @@
 // know not to stop at the blanket, we have to recursively evaluate
 // the `T:Foo` bound.
 
+// pretty-expanded FIXME #23616
+
 use std::marker::Sized;
 
 // Note: this must be generic for the problem to show up
index 81212ee348f1f68936266cbcceb9127332e42725..768e7f94862acb194ad4858781d947f7f3dc7284 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test method calls with self as an argument (cross-crate)
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index ca81860dd080c9ed3f8fffe146ee534951ec0b80..b40333c67c6ac2ec8aa82bcfbeb7ecc1bab52f4c 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test method calls with self as an argument (cross-crate)
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 17fdd7b45c20c033a2d328420464a7f27ca6058b..8687014bfbb53c41b52edc952e3b61d74ea3e74a 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test method calls with self as an argument
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 62b3d52860ba8d2625f3928828324069834bb22f..9784149c44057ade8ba3d00c926a554dd50857ab 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test method calls with self as an argument
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 414b08b4335c6ebab29138603d61b3a5263b5406..d0e0427f37808a602924bf355ba51379a46eeee3 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we pick which version of `foo` to run based on the
 // type that is (ultimately) inferred for `x`.
 
+// pretty-expanded FIXME #23616
+
 trait foo {
     fn foo(&self) -> i32;
 }
index a49ce82617007e2921b3fb5f207af537c0b1eccb..36f16f36cc0ab0aad49e837d641522eda2d7070a 100644 (file)
@@ -16,6 +16,8 @@
 // version will run (note that the `push` occurs after the call to
 // `foo()`).
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index fbecb6851b68758dd44ad067850761c22dafde8b..de8d116255ba227a2ae18f36f8a9103871d2bca3 100644 (file)
 // Test that we select between traits A and B. To do that, we must
 // consider the `Sized` bound.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 trait A {
     fn foo(self);
 }
@@ -29,6 +33,6 @@ fn foo(self) {}
 
 fn main() {
     let x: [int; 4] = [1,2,3,4];
-    let xptr = x.as_slice() as *const _;
+    let xptr = x.as_slice() as *const [int];
     xptr.foo();
 }
index 6337538a3329d4f075a4ed1285da077ae21c451e..f2ff0abfad8b8d53c2d2d3cd7520c67706784839 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we can use method notation to call methods based on a
 // where clause type, and not only type parameters.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn foo(&self) -> i32;
 }
index 85c05d408e8ab4a9a9d3473cdc0fe411ca06ca9b..602ab95b048d30629fffb719dea2a9b6a5d2b54e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct S<T> {
     contents: T,
 }
index 388d2e4905fab9f07148e7c15d3a9c25d7403f93..60e9a2b8acba700c1d8d4e77c78b3358dfb11465 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn f() -> int {
     mod m {
         pub fn g() -> int { 720 }
index 1513eb8883527c64209a7bafe342cc491cc1ea41..40069c32cd9b01d350eb613cd57f6a7c3e708d97 100644 (file)
@@ -14,6 +14,8 @@
 // pretty-print such view items. If that happens again, this should
 // begin failing.
 
+// pretty-expanded FIXME #23616
+
 mod m {
     pub fn f() -> Vec<int> { Vec::new() }
 }
index b1c1b64ba40033ef98c1f81f343d61320cc1aa2d..1b725d6ae214f7d28c5c482b137fcda7e992edcd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod m {
     pub struct S {
         pub x: int,
index 0d563f1a714c350cecbf0f18523c9a2c7fa993ad..c9994e9b5156e2ed10d2505b2e03002577023799 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 trait vec_monad<A> {
     fn bind<B, F>(&self, f: F ) -> Vec<B> where F: FnMut(&A) -> Vec<B> ;
 }
index 1164ef1a3c98e2406e83e7c0992cd2b0440c383a..b45805902dfd7af7abc18613ef3f93d32753046f 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::marker::MarkerTrait;
 
 trait Serializer : MarkerTrait {
index ff06df079b05e029717153c437d1d7a6ff28432f..74f474b87525d29faf30cb4bfeaaadf316b4fbf0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 590caff3c2dc850c168fb376c7c72b8137efba7a..175c369e62842725affdd20117f6fd5083fb4232 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 0bff2c2292e74be2caf7c884473571bc40f038f0..faf45f8ae09b86db0e2fd1aa05ffebe4eceb55a1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 8241424124e0e0e3373913c695927e0cd14a61f4..171c455e8075c1b53434bf33d7fb90c4e8e5d5ae 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 9e5eeef75527c1595ba1a601c4988a5d4e852ac0..94fa3dbca0e4093ce6401755248fedf25453f1af 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index c902677c645314b41ad8e998dac7b2824a078b69..5c80e683ba42c64cfcb2be8a83c85c6031f0c591 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index e496e9e2105334fcc74ca8abbbcb392fcfda9b78..fd13db560e094f4fca34244e5521c1b1862e419a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index fdb6799b90f793cb9857007e3030c98666eef39e..fd8eddd0c1c1ed93e82211c8ad73497c692b0c10 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 87db5cbe2f13ed2a4e049f0b3deff663ea8d6e15..197f044ea782d0d50b3f6dce85b5f95f6069cdbe 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn test(foo: int) { assert!((foo == 10)); }
 
 pub fn main() { let x = 10; test(x); }
index d68a7c831f212ca4ae683e5e4469e4cc9c818d83..6e49538e98a3a5f5b29fd65898576000e4567926 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(box_syntax)]
 
 fn main() {
index b7cd3003e750c4204394ce865daf9209bd80654f..cec1e43997206a485cc4e2096acebe8de2809951 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // Issue #922
+// pretty-expanded FIXME #23616
+
 fn f2<F>(_thing: F) where F: FnOnce() { }
 
 fn f<F>(thing: F) where F: FnOnce() {
index cb487a34f338876dc9e60557be588322c8577b2c..a0eba4685b88734c1b486dbdaf43c5ae6f18d4b6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::string::String;
 
 struct StringBuffer {
index 845cb8ab6011ec10d310af52142a57f73f826c3e..a0ca9a43a5d4b88f615f4d59b0fc37b39f26222a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
 
     let y: int = 42;
index 3596fa1a0063ffb5b31fcdeb2b91a1689730d95d..f0eba366e711763d7f4dc6ec40fc6826b37991b9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread::Thread;
 
 pub fn main() {
index 16f15804e0e927fd1e45d49fc72a3e4762953529..a313ec998f0a1c7f5c1794450bcf1116f6ea227d 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:moves_based_on_type_lib.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate moves_based_on_type_lib;
 use moves_based_on_type_lib::f;
 
index eb1444be37844d8d7e3d6412343a5a21ad760e68..658b34e13f99badd0ccd22b834443b6fd20f0ada 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = 10;
     let y = x;
index b9435afdc7a934b93d89eb4e4a6b14c86af87f1b..4243b28614cef14ea8b3def1723e092d6ba145d5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::fmt::Debug;
 
 trait MyTrait<T> {
index 6b52ea9dfa7a33c19fd424b80993bb21b8548793..0655552c85bb4fecb249e87aa1b260db96c7f6e1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::fmt::Debug;
 use std::default::Default;
 
index 6203d47be5e6b8a62b0497fabbfab2d8f983c619..8c74326d1c34af0d4e496203f17610a0fc061038 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 /*
  * This is a multi-line oldcomment.
  */
index 7ce1afb52a274dec37491d016c8100f733af8e17..2746205b637dcb3cbe5915751522cc11f7ab2f45 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn f<T:PartialEq + PartialOrd>(_: T) {
 }
 
index b1f7da17c8f80767bee34c713ab15627319fe355..311eaf27da9f0bdffbf13f0e7654c1528e13a2a2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index d3ae80861f231c5f29aaa57ed211104b7c59c5b8..f97dc9a5dd727cf2b92dfffff87a28dd61c88050 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn foo(&self, mut x: int) -> int {
         let val = x;
index a276e902fbcfca6172680ed17d0e94e7b18ff3c2..bc90a8cf0d77b280af160d8fe2ecd8da9be6e912 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let _x: &mut [int] = &mut [ 1, 2, 3 ];
 }
index e074c3fb3d7834fe262f97db131cdad8dd752a1f..bed3b87def58b30b4ec940aa2bfe941639dca6d4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn test1() {
     let mut ints = [0; 32];
     ints[0] += 1;
index 8444a632fe889c699f0cf932b524f83a1a56be3a..cb2361dd5698ec335eb0ffced718c5a22497571a 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 enum colour { red, green, blue, }
 
 enum tree { children(Box<list>), leaf(colour), }
index ea7e05d24e2f3d34e430742181f036951b6478b1..f275e9b7425bd960abf6c21a15e7c6b27e0f84e0 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:namespaced_enum_emulate_flat.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate namespaced_enum_emulate_flat;
 
 use namespaced_enum_emulate_flat::{Foo, A, B, C};
index e4a8ec19eb8e84ce231739a702cff4bf956f3e92..c557d624586bb67c1927deeb39b71dfbb01c628f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub use Foo::*;
 use nest::{Bar, D, E, F};
 
index e5317c2f57302ae63ee84e3ff237f5a18ee783b1..7bfe90bad7f4facd8138e37d315328831b1bf6a7 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:namespaced_enums.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate namespaced_enums;
 
 fn _f(f: namespaced_enums::Foo) {
index c48be3af248f0982577fa3671a5ee3712b8dd168..8d58cd950a8db846a76f570a95439c0a1ff801d2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod m2 {
     pub enum Foo {
         A,
index 3b56d6c59a162c6b04d53d49389be9531e673434..0046d80e086d1ed24d28d1415bbf582083709e27 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:namespaced_enums.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate namespaced_enums;
 
 use namespaced_enums::Foo;
index 13f70f6a740aef76ed24b76fd1a9d67544e73064..a0b8109b93b2ee229fbf628b9e7888fd0aeffab7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Foo {
     A,
     B(int),
index 435382666f1a2dde3e99c01973a5b8d234fd6bbb..c5b6a6a035bbaa1b518eeb9ab12a58b0ad19134d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     match -5 {
       -5 => {}
index a6d932935ade6b1a227112b36af992e3a8a89974..650e28548c17a800eeba6336ff881f554380ab15 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /* This test checks that nested comments are supported
 
    /*
index 19eba0808c88237cdc4f5b79430a57ad24dfd238..8b156ae364dd66e889155dcdb26d9e2f135a2876 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     struct b {
         i: int,
index 33c4ed6234eaa772fbef539564cf5101edeb373c..c0baab66c597ad03d5ffa7a07e74d3d6466afcc8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /*
 
 #7770 ICE with sibling methods containing same-name-enum containing
index b2a47e0ccb88b0145113f4c17ef84dab4cc59d74..0b30cc2cde3661e26405b247759b8aded71cb525 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo { foo: bool, bar: Option<int>, baz: int }
 
 pub fn main() {
index f697f0b59d65f7c837d5ebe4b32a672931eb2ca7..488a722f67411a56b31db59bb342fc50192b4bea 100644 (file)
@@ -13,6 +13,8 @@
 //
 // Issue #8587
 
+// pretty-expanded FIXME #23616
+
 pub struct X;
 
 impl X {
index d73fba561430a53c9476fe8ea97ef79ecf0b9afd..3c0123f7519ddf403a86f8d9a2b57383dc27754e 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:nested_item.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate nested_item;
 
 pub fn main() {
index 3d4847a119a55ca41af953e62f7111e0d76680df..8482dd84d876cd2260de85539b3ff91a5630dbea 100644 (file)
@@ -8,11 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, alloc)]
 
 // Tests that the new `box` syntax works with unique pointers.
 
index 7430f730f3b17d0799c24873434ea9e184128053..8c2d5e09adb47edb90bab4ec422644a05d1af6a3 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections)]
+
 pub fn main() {
     let s = "\u{2603}";
     assert_eq!(s, "☃");
index 96ccb1a37a2a01fbbf38ca403ee28ce0f7138177..db387224c3879e498cef4cd432d54f6e9ee1e57c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let _a: *const int = 3 as *const int;
     let _a: *mut int = 3 as *mut int;
index 039e53cab8044805db0dd51f51c63c482867bcd0..543dbb36b2850a218001fb9513774018b73f4e6a 100644 (file)
@@ -12,6 +12,8 @@
 // expression
 
 // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
+// pretty-expanded FIXME #23616
+
 fn unique() -> Box<FnMut()+'static> { return Box::new(|| ()); }
 
 pub fn main() {
index b7216c87c30bbc22a7f174ca07c3f25ea4447d61..e8297173a58345fe8e383a9de7056c87e50f637a 100644 (file)
@@ -12,6 +12,8 @@
 // expression
 
 // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
+// pretty-expanded FIXME #23616
+
 fn unique() -> Box<FnMut()+'static> { Box::new(|| ()) }
 
 pub fn main() {
index 01875288aef0e97cdbc73e40769567af7a6f2826..0fe1227523f63a0bfedd48a659490aec4193ddcd 100644 (file)
@@ -10,6 +10,8 @@
 
 // Tests for the new |args| expr lambda syntax
 
+// pretty-expanded FIXME #23616
+
 fn f<F>(i: int, f: F) -> int where F: FnOnce(int) -> int { f(i) }
 
 fn g<G>(_g: G) where G: FnOnce() { }
index 4b7dbdc9e5b9ec6262437f8bcbff09847e237f68..424d518895cfb129de656804e008716397a5036d 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 #[derive(Clone)]
 struct myvec<X>(Vec<X> );
 
index 8c35abad7f1e61e273b53a0595acb7a92e6ee06f..ad878fe4b319de94d6d9d98b355b07231b4ab850 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 
 // Make sure the destructor is run for newtype structs.
index 15c4e8b04533939a2804f572562ff240ab08e008..d1ad5614e3f35f36e0855c971aa4aff1ab0e51af 100644 (file)
@@ -9,6 +9,10 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 extern crate libc;
 use libc::c_int;
 
index 0302a0588e4cfece646c26c558292a047b3c1e85..ac03f65750df5a213c3f039a4daed16f47c7d490 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:newtype_struct_xc.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate newtype_struct_xc;
 use newtype_struct_xc::Au;
 
index 3e375c48316c86d16a2b627f0bd045451b6d4ed0..0cac4530faf32604e3830d009c014a3c5119246e 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:newtype_struct_xc.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate newtype_struct_xc;
 
 pub fn main() {
index e23c970e29a582baa3e827fee9ebc3225edaa692..97ee237771f3fae9bd6e8e307f8c1d44714c63f4 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // Issue #901
+// pretty-expanded FIXME #23616
+
 mod libc {
     extern {
         pub fn printf(x: ());
index 329590b547db3a5aaa525d86f47f7ce5d8c6c0a1..342644e03843725b332a86a8baf5a91b0a26d0c9 100644 (file)
@@ -8,4 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() { let x = (); match x { () => { } } }
index 5ce32e4fe2ccb54975d20fe9c3db3dc826ace517..da57c81a66978422319c4f7ff243011d355652b9 100644 (file)
@@ -10,6 +10,8 @@
 
 // compile-flags: -Z no-landing-pads
 
+// pretty-expanded FIXME #23616
+
 use std::thread;
 
 static mut HIT: bool = false;
index 8b41670734f95bee52407cf7c9065ef205728e05..6c0df5f4c14e753c3c966b0bc1f0909179d2d424 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! quote_tokens { () => (()) }
 
 pub fn main() {
index e422cb803215bb591be773f40c4413a555290a0b..1eeea662383223a7e9b68e3e291baee12a1d3cd1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct X {
     repr: int
 }
index bbce9a8f4a6ad20db285f21fd2ef7c87ae94fb3b..a28f2b15b92856f1333a94c74ce3fce9b5257e5c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::cell::Cell;
 
 struct C<'a> {
index 4a14969209f027dbeb5d8128d7b549851ee57c9e..25c111daad597331010d1a51568cd8962130a908 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main()
 {
     let all_nuls1 = "\0\x00\u{0}\u{0}";
index 32432c07dcf415fd84f59f228c9cfa5210939c55..42cef21f8849640f163e19635ffddd982450c450 100644 (file)
@@ -20,6 +20,8 @@
 // then we simply express the enum as just a pointer and not wrap it
 // in a struct.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 #[inline(never)]
index 03027e40d6c1e50c345e4615cc08fa07f1625440..b92ae3f23ec1a2df4d7f568c1e6d7d260ae430b8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 02fc0cf0291d43ba23e1eee7986f7efa39460e93..2b908a6c5b775bfd3cc4a524e2ed2d55f8e4eb11 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 enum E<T> { Thing(int, T), Nothing((), ((), ()), [i8; 0]) }
index 565ef278d5d7c307f6a9de8b1e4e994e079b1aa9..4369e4095fbe5b295d2dc1c9cd0d4de9cd4eedc6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum blah { a, b, }
 
 fn or_alt(q: blah) -> int {
index eccc2a41a8d2d3f6bd15eb9ab8485a403c46e400..cb41949a722c2b64f4d5bba64a71d07469489bcc 100644 (file)
 // necessary. Testing the methods of the impls is done within the source
 // file for each numeric type.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::ops::Add;
 use std::num::ToPrimitive;
 
index c385a0195b6b20868b36a53180df2fdd9ca79c1b..1b631f171eb79f9e9ea1f12b561bbc78a7fa6a2a 100644 (file)
@@ -11,6 +11,8 @@
 // Test that `Box<Test>` is equivalent to `Box<Test+'static>`, both in
 // fields and fn arguments.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 trait Test {
index 24da9603679065f404866242f82aa9210200de87..910d933d46f0879bd726e7f8efb2d8cb22b547b9 100644 (file)
@@ -11,6 +11,8 @@
 // Test that the lifetime of the enclosing `&` is used for the object
 // lifetime bound.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 trait Test {
index 825800e1d4447e1fd9daf28db8ad0c47610612e0..e2047ee3256d1a1ef6808686b6d1657e52d84c07 100644 (file)
@@ -11,6 +11,8 @@
 // Test that the lifetime from the enclosing `&` is "inherited"
 // through the `Box` struct.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 trait Test {
index 0f34d945c8fb9976e7dc7884a48ed166b43a1815..edd0bdb32c2b1778b6f5151ae4eac4009ba22b7c 100644 (file)
@@ -11,6 +11,8 @@
 // Test that the lifetime of the enclosing `&` is used for the object
 // lifetime bound.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 trait Test {
index 9d5dac536f10ade4c0e41136cfc8d56876e737a5..3c2419e420d3da6d2d2e124143c90866598a2b49 100644 (file)
@@ -11,6 +11,8 @@
 // Test that the lifetime from the enclosing `&` is "inherited"
 // through the `MyBox` struct.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 trait Test {
index b7a28a5c524156764809cf9a2443635e46d4e837..d9e0b22fbfa4be5bcc34cf9d3ddf3358c0cfd81e 100644 (file)
@@ -11,6 +11,8 @@
 // Test that the lifetime of the enclosing `&` is used for the object
 // lifetime bound.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 trait Test {
index 9c7a925b5bbc2a932190c9567bc695fbb6ab19e0..8b8c56aee83911c45a8e3091ff7147ec399cf7d9 100644 (file)
@@ -11,6 +11,8 @@
 // Test for using an object with an associated type binding as the
 // instantiation for a generic type with a bound.
 
+// pretty-expanded FIXME #23616
+
 trait SomeTrait {
     type SomeType;
 
index f8a3ce7cda01708bb6e0ddf4faec337b4f974313..baf8c6e4c97913e459911e0940be8e47220833d3 100644 (file)
@@ -35,7 +35,7 @@ fn is<T:'static>(x: &Any) -> bool {
 }
 
 fn main() {
-    let x = box 22 as Box<Wrap>;
+    let x = box 22isize as Box<Wrap>;
     println!("x={}", x.get());
     let y = x.wrap();
 }
index ae092333134ea0f0b53c988058387c4bfdb41c18..b735743927c896b1d87d2bb24db40c3f52a403df 100644 (file)
@@ -11,6 +11,8 @@
 // Check that a trait is still object-safe (and usable) if it has
 // methods with by-value self so long as they require `Self : Sized`.
 
+// pretty-expanded FIXME #23616
+
 trait Counter {
     fn tick(&mut self) -> u32;
     fn get(self) -> u32 where Self : Sized;
index 1a42c4b6ef6649be36b0e8bae0b765c4e2b1b150..696c5a097091446424c04633cbc8c03b5767caa2 100644 (file)
@@ -11,6 +11,8 @@
 // Check that a trait is still object-safe (and usable) if it has
 // generic methods so long as they require `Self : Sized`.
 
+// pretty-expanded FIXME #23616
+
 trait Counter {
     fn tick(&mut self) -> u32;
     fn with<F:FnOnce(u32)>(&self, f: F) where Self : Sized;
index 7f075bbb6c2f226bb1a38ef4b1cd9193e737fdf3..17c41f2194b69abdba93876f87653d867bbac872 100644 (file)
@@ -11,6 +11,8 @@
 // Check that a trait is still object-safe (and usable) if it has
 // methods that return `Self` so long as they require `Self : Sized`.
 
+// pretty-expanded FIXME #23616
+
 trait Counter {
     fn new() -> Self where Self : Sized;
     fn tick(&mut self) -> u32;
index d2523bc4f246f34ec0fb1c4e4383aeed577fe930..368842ed1b0304244841ae3d233670baf9351281 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that we can coerce an `@Object` to an `&Object`
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn foo(&self) -> uint;
     fn bar(&mut self) -> uint;
@@ -40,7 +42,7 @@ fn do_it_imm(obj: &Foo, v: uint) {
 }
 
 pub fn main() {
-    let mut x = 22;
+    let mut x: uint = 22;
     let obj = &mut x as &mut Foo;
     do_it_mut(obj);
     do_it_imm(obj, 23);
index 9cee266c4a7b9f1aa8eabb2052e82268697dca5b..15ed94e62bad93cb37ebd9e9624b6d0f43fa02ff 100644 (file)
@@ -12,6 +12,8 @@
 // closed over do not contain managed values, and thus the boxes do
 // not have headers.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index d355999c506068115f15991eab5a3a4ae0d93acc..e72065885324e4fc9a35064d68d32cc2c964d88a 100644 (file)
@@ -12,6 +12,8 @@
 // closed over contain managed values. This implies that the boxes
 // will have headers that must be skipped over.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 8fe57a655aa5334b3400e93bd0042ac74af28c67..7bf8b693d9bbf844918082ef1c42d64952f60168 100644 (file)
@@ -11,6 +11,8 @@
 // Testing guarantees provided by once functions.
 
 
+// pretty-expanded FIXME #23616
+
 use std::sync::Arc;
 
 fn foo<F:FnOnce()>(blk: F) {
index 8377a45a1d8a079672c58aa9f4fc613e109be3bd..6520e42dbe3f8ad3e3c14dad8e786aaf1771ac84 100644 (file)
@@ -10,6 +10,8 @@
 
 // Why one-tuples? Because macros.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     match ('c',) {
         (x,) => {
index bee6d23a27d6245eef08d96588f22910c95cb9da..ccfdb83ab8aa14e61edc85e4591d5a4011f81760 100644 (file)
@@ -12,4 +12,6 @@
 
 
 // Testcase for issue #130, operator associativity.
+// pretty-expanded FIXME #23616
+
 pub fn main() { assert!((3 * 5 / 2 == 7)); }
index 3ddc666cd384c0ce2c551b5df122201a48992a4a..69542042c4fbfcc578ef0f87f368952a76c71427 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(core)]
+
 use std::cmp;
 use std::ops;
 
@@ -52,8 +54,8 @@ fn not(self) -> Point {
 impl ops::Index<bool> for Point {
     type Output = int;
 
-    fn index(&self, x: &bool) -> &int {
-        if *x {
+    fn index(&self, x: bool) -> &int {
+        if x {
             &self.x
         } else {
             &self.y
index 7a816f913350130dfc9b53efcbb023099ea5f8ba..8f5a5e8ece75dbb0cd22735b2d74fa8db681256d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(collections)]
+
 pub fn main() {
     let thing = "{{ f }}";
     let f = thing.find_str("{{");
index 71323016e835e4ed965e2bfd8a7b551054700d4e..b0f5d8e53bd5dbe41136ee4d4475239409afdfed 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 
 use std::cell::Cell;
index ef399044abc99347c11d258a0f59ea5ec740b7da..1aaef7b817440d38c70326f11afce5bc4d34c44f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum blah { a(int, int, uint), b(int, int), c, }
 
 fn or_alt(q: blah) -> int {
index 3710f1b9d3052e2a27c08e3376a44f00f8649d80..a42720d3cb430244018502c2c7d7ee1529a6dfde 100644 (file)
@@ -14,6 +14,8 @@
 // in ORDER matching up to when it ran.
 // Correct order is: matched, inner, outer
 
+// pretty-expanded FIXME #23616
+
 static mut ORDER: [uint; 3] = [0, 0, 0];
 static mut INDEX: uint = 0;
 
index aa4e91320f755b7191aef46ab1f8cfdd9f192677..41b34dc79bd954d274f098a255ad2560576819ca 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 extern crate libc;
 
 #[cfg(target_os = "macos")]
index 41bf7fe2dfa637eab39b708d7949e7024d80cce9..3c322f72b75b699f95cc6a3dd668da9ac337c255 100644 (file)
@@ -14,7 +14,7 @@
 //ignore-dragonfly
 //ignore-bitrig
 
-#![feature(asm)]
+#![feature(asm, old_io, std_misc)]
 
 use std::old_io::process::Command;
 use std::env;
index e4c7f4ef095222bdc2f64cc2d7ba9bfe63c00066..8887e1937c6f7b1308d55143453df7abe117b26a 100644 (file)
@@ -15,7 +15,7 @@
 //ignore-dragonfly
 //ignore-bitrig
 
-#![feature(asm)]
+#![feature(asm, old_io)]
 
 use std::old_io::process::Command;
 use std::env;
index cc5eb69bb87e39ced535bccb2618f5bf29af23da..47f83eab4c1f4a569661dd1cbaba4b1a01287876 100644 (file)
@@ -10,7 +10,7 @@
 
 // ignore-android: FIXME (#20004)
 
-#![feature(asm)]
+#![feature(asm, old_io)]
 
 use std::old_io::process::Command;
 use std::env;
index eee9838da21ee68a96ef021397c716d49a4efb2c..1a6c60426afa86ef5254aca7d248c5a7eb4bc4c4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Copy)]
 pub struct Foo {
     f1: int,
index fb87cd5eb69cd25096874acba50f235237f26cdd..f80fbdeb1e3769d8edc548ff83632d2f605bad9a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 #![allow(unused_variable)]
 #![allow(unknown_features)]
index 4cb7ece4ab87643248f6ce60f9206d8465c82a83..fdf42423b662b25fc8d3124c9a75fc204d21ee7d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::ops::Deref;
 
 struct DerefArray<'a, T:'a> {
index d023a01f4b1ddf16a253faf3b6832bed75d1ad06..fdd7a5000b2ee3e64f9e864d1c438d4ec43840e3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::rc::Rc;
 use std::ops::Deref;
 
index d50f2efe0e7b4cab54f64e42ffb2c990619cfa43..f949f6e4ef43a0dd7ecef6231d8e810d6de391ed 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::ops::Deref;
 
 struct DerefWithHelper<H, T> {
index f8dd729ec67dcd9bf2c919e86e299c886c1d911a..b97fb491124842af4d635b0433086ba7962a3b4e 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:overloaded_autoderef_xc.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate overloaded_autoderef_xc;
 
 fn main() {
index 6436165968d678801130a581164d5a9e85b9f6fa..7b956dc772f54a28f2e4675c6d1cfad9ec056ea7 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, collections, core)]
 
 use std::cell::RefCell;
 use std::rc::Rc;
index 25b63cd14c4357f2a70bca5c8116a391d4255875..7cb57a912535a819f585d6c4981cf4d1617b70d3 100644 (file)
@@ -11,6 +11,8 @@
 // Tests calls to closure arguments where the closure takes 1 argument.
 // This is a bit tricky due to rust-call ABI.
 
+// pretty-expanded FIXME #23616
+
 fn foo(f: &mut FnMut(int) -> int) -> int {
     f(22)
 }
index 026ebc308408fcac54583dc2f2892e94c90aef84..65a63a33d1bb63c84ac121bc37588cf4c3fef381 100644 (file)
@@ -11,6 +11,8 @@
 // Tests calls to closure arguments where the closure takes 2 arguments.
 // This is a bit tricky due to rust-call ABI.
 
+// pretty-expanded FIXME #23616
+
 fn foo(f: &mut FnMut(int, int) -> int) -> int {
     f(1, 2)
 }
index b38f8213b4ab83480908be73aa047f05466734a5..46fa0619082091a44ee2836f673e99f74bd51b67 100644 (file)
@@ -11,6 +11,8 @@
 // Tests calls to closure arguments where the closure takes 0 arguments.
 // This is a bit tricky due to rust-call ABI.
 
+// pretty-expanded FIXME #23616
+
 fn foo(f: &mut FnMut() -> int) -> int {
     f()
 }
index 0ac9c97532bffd29b33b8cc483724b0f1dad9e48..597075c550051bc8664e3b0e63853468757f8932 100644 (file)
@@ -10,7 +10,9 @@
 
 // Tests that nested vtables work with overloaded calls.
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 use std::marker::PhantomData;
 use std::ops::Fn;
 struct G<A>(PhantomData<A>);
 
 impl<'a, A: Add<i32, Output=i32>> Fn<(A,)> for G<A> {
-    type Output = i32;
-
     extern "rust-call" fn call(&self, (arg,): (A,)) -> i32 {
         arg.add(1)
     }
 }
 
+impl<'a, A: Add<i32, Output=i32>> FnMut<(A,)> for G<A> {
+    extern "rust-call" fn call_mut(&mut self, args: (A,)) -> i32 { self.call(args) }
+}
+
+impl<'a, A: Add<i32, Output=i32>> FnOnce<(A,)> for G<A> {
+    type Output = i32;
+    extern "rust-call" fn call_once(self, args: (A,)) -> i32 { self.call(args) }
+}
+
 fn main() {
     // ICE trigger
     (G(PhantomData))(1);
index d18a91c5452807b4e1d87f37aec14e2ed643c81e..eeb705a2e3c99b5db12af2de0530c1a98b1c1399 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(lang_items, unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(lang_items, unboxed_closures, core)]
 
 use std::ops::{Fn, FnMut, FnOnce};
 
@@ -18,24 +20,38 @@ struct S1 {
 }
 
 impl FnMut<(i32,)> for S1 {
-    type Output = i32;
     extern "rust-call" fn call_mut(&mut self, (z,): (i32,)) -> i32 {
         self.x * self.y * z
     }
 }
 
+impl FnOnce<(i32,)> for S1 {
+    type Output = i32;
+    extern "rust-call" fn call_once(mut self, args: (i32,)) -> i32 {
+        self.call_mut(args)
+    }
+}
+
 struct S2 {
     x: i32,
     y: i32,
 }
 
 impl Fn<(i32,)> for S2 {
-    type Output = i32;
     extern "rust-call" fn call(&self, (z,): (i32,)) -> i32 {
         self.x * self.y * z
     }
 }
 
+impl FnMut<(i32,)> for S2 {
+    extern "rust-call" fn call_mut(&mut self, args: (i32,)) -> i32 { self.call(args) }
+}
+
+impl FnOnce<(i32,)> for S2 {
+    type Output = i32;
+    extern "rust-call" fn call_once(self, args: (i32,)) -> i32 { self.call(args) }
+}
+
 struct S3 {
     x: i32,
     y: i32,
index 78e84b9d55bcaf47a8d1780682f1bd115ec66919..110109018db59d672476ca3f9e9deea720b69b59 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 use std::ops::{FnMut};
 
@@ -18,12 +20,16 @@ struct S {
 }
 
 impl FnMut<()> for S {
-    type Output = i32;
     extern "rust-call" fn call_mut(&mut self, (): ()) -> i32 {
         self.x * self.y
     }
 }
 
+impl FnOnce<()> for S {
+    type Output = i32;
+    extern "rust-call" fn call_once(mut self, args: ()) -> i32 { self.call_mut(args) }
+}
+
 fn main() {
     let mut s = S {
         x: 3,
index f3091b53e8badc02e5223d2b4a30feb595f0889e..187b032b0f17031e4d57e7852446c7cbc01b0bad 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::cell::Cell;
 use std::ops::{Deref, DerefMut};
 use std::vec::Vec;
index bb1694be5e29b7765b8d2ae00449fbb84fa948a0..20e55de2f058a5dddcf679197c276e03f4b91254 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(collections)]
+
 use std::cell::RefCell;
 use std::rc::Rc;
 use std::string::String;
index 0064748e883699dc3968e813eae7c5c389ed89b9..131098d7c94e2af8e35fa8d5218a379c813ae018 100644 (file)
 // Test overloading of the `[]` operator.  In particular test that it
 // takes its argument *by reference*.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::ops::Index;
 
 struct AssociationList<K,V> {
@@ -28,7 +32,7 @@ fn push(&mut self, key: K, value: V) {
     }
 }
 
-impl<K: PartialEq + std::fmt::Debug, V:Clone> Index<K> for AssociationList<K,V> {
+impl<'a, K: PartialEq + std::fmt::Debug, V:Clone> Index<&'a K> for AssociationList<K,V> {
     type Output = V;
 
     fn index<'a>(&'a self, index: &K) -> &'a V {
@@ -49,9 +53,9 @@ pub fn main() {
     list.push(foo.clone(), 22);
     list.push(bar.clone(), 44);
 
-    assert!(list[foo] == 22);
-    assert!(list[bar] == 44);
+    assert!(list[&foo] == 22);
+    assert!(list[&bar] == 44);
 
-    assert!(list[foo] == 22);
-    assert!(list[bar] == 44);
+    assert!(list[&foo] == 22);
+    assert!(list[&bar] == 44);
 }
index 8f655f0517ddf47fe56224d420ba0e0a34992a59..37de83aef33b391b99ae752dc8f0d5c8aad06dec 100644 (file)
 
 // Test overloaded indexing combined with autoderef.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, core)]
 
 use std::ops::{Index, IndexMut};
 
@@ -23,8 +25,8 @@ struct Foo {
 impl Index<int> for Foo {
     type Output = int;
 
-    fn index(&self, z: &int) -> &int {
-        if *z == 0 {
+    fn index(&self, z: int) -> &int {
+        if z == 0 {
             &self.x
         } else {
             &self.y
@@ -33,8 +35,8 @@ fn index(&self, z: &int) -> &int {
 }
 
 impl IndexMut<int> for Foo {
-    fn index_mut(&mut self, z: &int) -> &mut int {
-        if *z == 0 {
+    fn index_mut(&mut self, z: int) -> &mut int {
+        if z == 0 {
             &mut self.x
         } else {
             &mut self.y
index 487fb93c9fee8f3a09135d7503989ade445b6158..2370c6a28566f97b0161c93a051463d6c36a92c1 100644 (file)
 // Test using overloaded indexing when the "map" is stored in a
 // field. This caused problems at some point.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::ops::Index;
 
 struct Foo {
@@ -25,8 +29,8 @@ struct Bar {
 impl Index<int> for Foo {
     type Output = int;
 
-    fn index(&self, z: &int) -> &int {
-        if *z == 0 {
+    fn index(&self, z: int) -> &int {
+        if z == 0 {
             &self.x
         } else {
             &self.y
index 10ca3804eaedbc187ab128e619f45d20cd7c41dd..79c2b14aa93d3e23cead0ddb193492e3eced6406 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::ops::{Index, IndexMut};
 
 struct Foo {
@@ -18,8 +22,8 @@ struct Foo {
 impl Index<int> for Foo {
     type Output = int;
 
-    fn index(&self, z: &int) -> &int {
-        if *z == 0 {
+    fn index(&self, z: int) -> &int {
+        if z == 0 {
             &self.x
         } else {
             &self.y
@@ -28,8 +32,8 @@ fn index(&self, z: &int) -> &int {
 }
 
 impl IndexMut<int> for Foo {
-    fn index_mut(&mut self, z: &int) -> &mut int {
-        if *z == 0 {
+    fn index_mut(&mut self, z: int) -> &mut int {
+        if z == 0 {
             &mut self.x
         } else {
             &mut self.y
index 9be6b212a3caabd0b7259800b96999d68cf5ceee..f698b660751aba3872dd8dcb5860a3b668618b53 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn f<T: 'static>(_x: T) {}
 
 pub fn main() {
index c6c74fe3fda1d59aac5fca873a4c64d78b904091..e7a662c5260928028b4c9f9d868808cd4d18ef2e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[repr(packed)]
 struct Foo {
     bar: u8,
index 004a30220183ed101a9b5b28010625286121a397..5d518749d9aefec9bf221b6ecc191ccc998f7f4b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 #[repr(packed)]
index 45791332bbedfae08a6b635a1cf3da428ef73c86..6c24b71971e3876aa5f15cd6ad08037ea36a6145 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 #[repr(packed)]
index 9e94502a92a6384199380bd85bc708ed62d80cea..5d2454be2fbd5ee26cc358d7475c2d10fef7aa31 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 #[repr(packed)]
index 46ffed0cba9684004caddf2f751bfb65b4c0c0b9..6df761d1b21fe1cbf3e630546a70fa9b5c751a5d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[repr(packed)]
 struct Foo {
     bar: u8,
index c2968956785faa3032c21321d077db0ff87350c7..b7ea720caf76d3829a778fe03ac0708cc493608d 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:packed.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate packed;
 
 use std::mem;
index 846d51e2e7ecc916e29e1fad89a53541ab5bc610..3d748c404228bcae59536346aee914b29b489e46 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 #[repr(packed)]
index c41d678b0f5b702826f1b7e098112bc9a5b37f5d..9d96adc29dd36e614d4030cc4961bfb90f60cd57 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 #[repr(packed)]
index a0b88ea53c5a4f3d60d54de588ffbeba0e8cd883..7b7cd5929883d3b07694da74cf2e447eedab555f 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 #[repr(packed)]
index 6da15b97acaae220453ed519593bd5c2e992251f..c1ebd2a530451bf7f364349144562c9d7f5995d5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::thread;
 
 static mut dropped: bool = false;
index 061c9168955a49c73db68dc7ba3700ed72b20a3d..eb483009662bf1b9c1ee71c580df094f97191583 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 
index 5649c4c784dafdab7a19cb563ab3dbe76e10a544..c81677220539e90ddb10ff5732013ed6c72bd1b3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     type T;
     fn foo() -> Box<<Self as Foo>::T>;
index 0995910fd4cf64ffbc9c786330f40a0fc7884866..e4c9fd9d8ef836494597ab48416a6ba8ed3d8279 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test parsing binary operators after macro invocations.
 
+// pretty-expanded FIXME #23616
+
 #![feature(macro_rules)]
 
 macro_rules! id {
index 08d00d4dc035b37a648e6fd6de66487cb2681f1c..b1a761d09fda053f4cd54bd8d4a65dc1cca25508 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 mod foo {
     pub fn bar(_offset: uint) { }
 }
index 7d9c3d324f070c227f8cac3a2db2303981409a65..ad12775a31df805aaf4f751cfff96a2c51729aa9 100644 (file)
@@ -12,6 +12,8 @@
 // pattern-bound var is an upvar (when translating
 // the for-each body)
 
+// pretty-expanded FIXME #23616
+
 fn foo(src: uint) {
 
     match Some(src) {
index c4cf8357baa616d2e2c6a92f0cf59fc27684246f..7ac624e6814dbb6c95eeb97ff32c58ef5961ff5c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(rustc_private)]
+
 extern crate arena;
 use arena::Arena;
 
index 15bf05fc0cbec3f56ade87a4229a776b0216dd87..d761f1610d4a87a767fed1e5ea0fcdfd41bd8005 100644 (file)
@@ -11,6 +11,8 @@
 // this checks that a pred with a non-bool return
 // type is rejected, even if the pred is never used
 
+// pretty-expanded FIXME #23616
+
 fn bad(_a: int) -> int { return 37; } //~ ERROR Non-boolean return type
 
 pub fn main() { }
index 679aa3d668f49286868a7e7f116f1fb4d4ba2883..17fb5aad6d097d7dd439534f80e803e8df9c2c29 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:priv-impl-prim-ty.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "priv-impl-prim-ty" as bar;
 
 pub fn main() {
index e9b8e694d60605c3e445102a97571429b1eaada5..8082816c4361159dec9d05f3d9748ac377508c44 100644 (file)
@@ -12,6 +12,8 @@
 // Check we do the correct privacy checks when we import a name and there is an
 // item with that name in both the value and type namespaces.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 #![allow(unused_imports)]
 
index b40aacdafc1faa4c2f8f58500899c4565ac3a65c..d9d107d900b6a946cb6bb760795857f845c242c2 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:privacy_reexport.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate privacy_reexport;
 
 pub fn main() {
index 7a07c97090223c4434193ac6ae482b204db786f8..329c4aaa873a98de6ce1387836012ecc99c3a0bf 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub mod test2 {
     // This used to generate an ICE (make sure that default functions are
     // parented to their trait to find the first private thing as the trait).
index b4d04ba18f98ef032c4c4d62c341b56cc7380303..27b8d5965e9809524e7d6861e01d32fb8bb8156b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct cat {
     meows : uint,
 
index 498bd04e37cc2a2bbdd92270163183198ed08b0a..a15c7b58ce119b50251fd9b5a328b71a03956a00 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct cat {
     meows : uint,
 
index 9eb7d624c9921bf602fbc7ab34ddebcd994d73d9..6429352f4491888728de2894ec380baeb792d70d 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(old_io)]
+
 use std::old_io::Command;
 use std::env;
 
index 72998133af19ddecd89565b0b708e0b050854acd..32448d100fb9b0b4dfff27a9ae50685c0656edd8 100644 (file)
@@ -17,6 +17,7 @@
 // intact.
 
 // ignore-aarch64
+#![feature(path, fs, os, io, old_path)]
 
 use std::io::prelude::*;
 use std::io;
index a6a8890101c5b04ceaf1f8585a41606631134da3..85897f171b6ce4d7a5bf1f89d1cff4645e6c28c2 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test coercions between pointers which don't do anything fancy like unsizing.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     // &mut -> &
     let x: &mut int = &mut 42;
index 7428377b59fc40e53922bee2d6cb8dedab1b0006..b9a3f788f9794445eda83e51b64303718e371ab2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem::transmute;
 
 mod a {
index 442eea13d6bacb6c8cf69c767be40d3c8d6d68ba..d082ca624e0989b7a204641c98008e3fda57f5f8 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #14660
 
+// pretty-expanded FIXME #23616
+
 mod bleh {
     macro_rules! foo {
         () => {
index af2f217c1fbb2ca31d6a03f7e74fe74d554222d0..2e2e261b6d021d5e4b729fb367e3f17e01fb3aed 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #17436
 
+// pretty-expanded FIXME #23616
+
 mod bleh {
     macro_rules! foo {
         () => {
index cdc184898fd68b9d020ef586f0e6ae21c5fb4d5a..3318c0380be74f3e493ecd26f7c31786c1bb4647 100644 (file)
@@ -11,6 +11,8 @@
 // aux-build:pub_use_xcrate1.rs
 // aux-build:pub_use_xcrate2.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate pub_use_xcrate2;
 
 use pub_use_xcrate2::Foo;
index ceba89523b5f9f3f8a2a208d18cdc58e8ea9d0ca..9373b7945d55abb6c3d83e48ee6ec30cffd6a95b 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:pub_use_mods_xcrate.rs
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_imports)]
 
 extern crate pub_use_mods_xcrate;
index f12cf82f939c7d2356a0cea330deb6171d5cdfdf..2612a21bc01b53fb32fec9aabf67261fa906fb4e 100644 (file)
@@ -10,6 +10,8 @@
 
 // Check that functions can modify local state.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 51945a4677d916c41a81dd48cc90b77717fc659f..2d664c00ed527ff628f41844e11b72259874b249 100644 (file)
@@ -12,6 +12,8 @@
 // good as the old one. Check out issue #21672, #21595 and #21649 for
 // more details.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let xs = (0..8).map(|i| i == 1u64).collect::<Vec<_>>();
     assert_eq!(xs[1], true);
index 50b90b1a5ee0b409bc14e5d88b5334333dca47f7..f2aa17d4069a882d852afc3ac3bceb4048a7beee 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test range syntax.
 
+// pretty-expanded FIXME #23616
+
 fn foo() -> int { 42 }
 
 // Test that range syntax works in return statements
index 18afcdd7f3f797ce257fac4392b443b53dc61443..bad3621cbf06a27a77722012e76afd094d28c7cf 100644 (file)
@@ -11,6 +11,8 @@
 // Test that the precedence of ranges is correct
 
 
+// pretty-expanded FIXME #23616
+
 struct Foo {
     foo: uint,
 }
index 51e955c47610939248611f4910204c118e5f0ea0..ff00dc0ab5336db0350f4352937bffdc2970f5d9 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 struct Point {x: int, y: int, z: int}
 
 fn f(p: Point) { assert!((p.z == 12)); }
index e8bcff38131a66ea43546f211c4c5f859f5319a4..0b714578c66bf31aa09ac6f161ff3f2c15825edb 100644 (file)
@@ -13,6 +13,8 @@
 // Ideally this would be revised to use no_std, but for now it serves
 // well enough to reproduce (and illustrate) the bug from #16687.
 
+#![feature(alloc)]
+
 extern crate alloc;
 
 use alloc::heap;
index de2e937ee84c0bf92ff3c5ab8151d8b18834b9f2..f511db8db5a71278148f5b447434a793bfc57729 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 struct Point {x: int, y: int}
 
 pub fn main() {
index dab7d26cc820039db62ed98f70a80afa3d10f866..eb3fe430c4b10f88d42b26d92b9297a49ff3458b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Copy)]
 struct Point {x: int, y: int}
 
index f59538c51a07802b1ed6e453bb935c599826b5e7..9be1884267d09df83350a7709e50752e011217f6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Copy)]
 struct Rect {x: int, y: int, w: int, h: int}
 
index b152470fbb640941a2668140138c33470f7370dd..79cc4e47f5eb690d5c209c7e6e19816ea0a68d30 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum t1 { a(int), b(uint), }
 struct T2 {x: t1, y: int}
 enum t3 { c(T2, uint), }
index ba74386f975fb967e8ce72546cb4cf403fe39bbf..2c92965ee7a6740a331708d6e1d77b61453ea5a5 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:reexport-should-still-link.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "reexport-should-still-link" as foo;
 
 pub fn main() {
index 22ca737d421987ac99cfe78fcc3b5c17083b3543..a8d052f407fcc2c847dd6eac90c7c2739f72bfa2 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 mod a {
     pub fn f() {}
     pub fn g() {}
index 5399f3cfd359752bf8d7d0d3ff9f86082ab706ac..374d0d8d9b961d724db512750c8bd41ce3d8a8ff 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:reexported_static_methods.rs
+// pretty-expanded FIXME #23616
+
 extern crate reexported_static_methods;
 
 use reexported_static_methods::Foo;
index bb2885a21778525045bc9cae919fa85a8d2013f0..c211d8d704d09fc184caf5b602155eabac4a7a1a 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 struct Point {
     x: int,
     y: int
index 77e1a214764540d7226f6fe1f543f6fdb0986442..b51d62f490f3c8dfe10c56616a8c5fc36009f5fd 100644 (file)
@@ -11,6 +11,8 @@
 // Test that the compiler considers the 'a bound declared in the
 // trait. Issue #20890.
 
+// pretty-expanded FIXME #23616
+
 trait Foo<'a> {
     type Value: 'a;
 
index 80ae371e5091e76638e104697a0ff63799b7a450..344f707aefc0149c833f63daa1e5d11b2b3d2597 100644 (file)
@@ -11,6 +11,8 @@
 // Test that the compiler considers the 'static bound declared in the
 // trait. Issue #20890.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     type Value: 'static;
     fn dummy(&self) { }
index 0264e64f70d2a4ef659fe3df13cecde2863752f5..1258dfe3306646a9c7d233b2ff83b219cbdb1627 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo(x: &[int]) -> int {
     x[0]
 }
index 16eeb99982e91411c9504b861be391263683c8cd..dd42eb2717a000dee158a3a6f2d1fd018dd20912 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn foo(x: &[int]) -> int {
     x[0]
 }
index 0673179eef0062ab4871d29f8d44188b9c42c2f3..c0c985fa0d1dbc70afcc9247124e816410efe6e7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 75c52f63041a5f037d445f1839162f11bf13904f..43cf6bd42ff8c4d9b5d8e7d4b923ba3f6832613a 100644 (file)
@@ -10,6 +10,8 @@
 
 // A very limited test of the "bottom" region
 
+// pretty-expanded FIXME #23616
+
 fn produce_static<T>() -> &'static T { panic!(); }
 
 fn foo<T>(_x: &T) -> &uint { produce_static() }
index 3922cb1219c03655564b6c97c4e9ae82890b26ea..d0157788cc9a40787df2933d7bc805d355f17c3e 100644 (file)
@@ -11,6 +11,8 @@
 // A test where we (successfully) close over a reference into
 // an object.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index b39343b1f5743ea3416c6255436b7fdd1df585b5..9e3fe79197d5d9109d9802c0d9d68a41211b611e 100644 (file)
@@ -8,8 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, core)]
 
 struct closure_box<'a> {
     cl: Box<FnMut() + 'a>,
index f23626643e7c7dfddbe53795b391c454dbebaf34..8bd3bd4c0ddf53afb6e9904fab5f68af12ca0961 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum ast<'a> {
     num(uint),
     add(&'a ast<'a>, &'a ast<'a>)
index c7d26e2d92b597d40c4b2ecd56a37d5f78c3942e..032ed068d5a298b868dcfc72170ac3727a07b5b3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum ast<'a> {
     num(uint),
     add(&'a ast<'a>, &'a ast<'a>)
index b9d3ed49c625f6bb1376a2993c18d294e8d45883..9f2d27f024bb0925ce9a90c8e09abed55f733b27 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct ctxt<'tcx> {
     x: &'tcx i32
 }
index b51be0f0f79f7d0f0bde57e4ed6f90dd56ba30d2..0439cb81c47ed6d06b2c1b48fbc38838ca1abbcf 100644 (file)
@@ -11,6 +11,8 @@
 // Test lifetimes are linked properly when we create dependent region pointers.
 // Issue #3148.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
index e7dc5e99c2bb97e05b6d981ff62e64f2a0560df9..ef05fc595df14bba4a57016e7b927f798bff4ea0 100644 (file)
@@ -11,6 +11,8 @@
 // Test lifetimes are linked properly when we autoslice a vector.
 // Issue #3148.
 
+// pretty-expanded FIXME #23616
+
 fn subslice<F>(v: F) -> F where F: FnOnce() { v }
 
 fn both<F>(v: F) -> F where F: FnOnce() {
index bcf74729fdbfba1acf7a3b7c2f5b7c6ea0c08b82..4652fed8a9dc709e140cd9fe5fe3a7bf549e433b 100644 (file)
@@ -12,6 +12,8 @@
 // Issue #3148.
 
 
+// pretty-expanded FIXME #23616
+
 fn subslice1<'r>(v: &'r [uint]) -> &'r [uint] { v }
 
 fn both<'r>(v: &'r [uint]) -> &'r [uint] {
index 980fcfb2e9eb9e0abe55963e21bc9eb4e77030c4..4d3fed5031fe47ab8779af98b4e791944798a069 100644 (file)
@@ -11,6 +11,8 @@
 // Test lifetimes are linked properly when we take reference
 // to interior.
 
+// pretty-expanded FIXME #23616
+
 struct Foo(int);
 pub fn main() {
     // Here the lifetime of the `&` should be at least the
index bdc0d41c94e823cdaa9777b1589aa5fb278c3f86..2dc4071830779d31722a1c0486179705ee6f739d 100644 (file)
@@ -14,6 +14,8 @@
 // lifetime parameters must be early bound in the type of the
 // associated item.
 
+// pretty-expanded FIXME #23616
+
 use std::marker;
 
 pub enum Value<'v> {
index 3f434a4838d42bb10f720f278e4be48660b5ea11..c87c79ca24edaab83cd7ac4aba3063342ff95493 100644 (file)
@@ -11,6 +11,8 @@
 // Tests that you can use an early-bound lifetime parameter as
 // on of the generic parameters in a trait.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
@@ -81,7 +83,10 @@ fn short<'b>(&'b self) -> int {
 }
 
 impl<'t> MakerTrait for Box<Trait<'t>+'static> {
-    fn mk() -> Box<Trait<'t>+'static> { box() (4,5) as Box<Trait> }
+    fn mk() -> Box<Trait<'t>+'static> {
+        let tup: Box<(int, int)> = box() (4,5);
+        tup as Box<Trait>
+    }
 }
 
 enum List<'l> {
index 410415e57a0679be7fe84e6203a99e9722ff1696..360457cf3f1d6c9f30510dfce831570218c1af3a 100644 (file)
@@ -11,6 +11,8 @@
 // Tests that you can use a fn lifetime parameter as part of
 // the value for a type parameter in a bound.
 
+// pretty-expanded FIXME #23616
+
 trait GetRef<'a> {
     fn get(&self) -> &'a int;
 }
index a3602c5fbec14aa911753d29c0092fcf8902bb91..924f9b8f70b90cd658d19f98a60062dc835c7349 100644 (file)
@@ -11,6 +11,8 @@
 // Tests that you can use a fn lifetime parameter as part of
 // the value for a type parameter in a bound.
 
+// pretty-expanded FIXME #23616
+
 trait GetRef<'a, T> {
     fn get(&self) -> &'a T;
 }
index caef4e3fa9cbe85be2a2ee3e9e75606a92bacca5..c31d4d45fb92f940b3ed3b9debfd078cec57b0b3 100644 (file)
@@ -11,6 +11,8 @@
 // Tests that you can use a fn lifetime parameter as part of
 // the value for a type parameter in a bound.
 
+// pretty-expanded FIXME #23616
+
 trait Get<T> {
     fn get(&self) -> T;
 }
index 3708d187d7161077e9cb411e564420d7ae8a3029..cd32c426527e2b3628d8bbb56d118dfc24a202c8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 58c13885e036cea44a8998eadb16de9ed69c21c2..ee4bbcebb7800ea3f7457080b4ef885c1e2ab676 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that you can insert an explicit lifetime in explicit self.
 
+// pretty-expanded FIXME #23616
+
 struct Foo {
     f: uint
 }
index 70c90ee05b35764713de34b22b72f89c8e1886aa..b8b5f6fb05f2c78db059593e1a1d532f0a985df5 100644 (file)
@@ -13,6 +13,8 @@
 // Here, `f` is a function that takes a pointer `x` and a function
 // `g`, where `g` requires its argument `y` to be in the same region
 // that `x` is in.
+// pretty-expanded FIXME #23616
+
 fn has_same_region(f: Box<for<'a> FnMut(&'a int, Box<FnMut(&'a int)>)>) {
     // `f` should be the type that `wants_same_region` wants, but
     // right now the compiler complains that it isn't.
index 0057a51012dd0bdaef6fdeda53b048a37e14aaf0..d9079dfe3f599c27ddf889e8c6ec726daae5bf78 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #2263.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 #![allow(unused_variable)]
 #![allow(unknown_features)]
index 9f1a383fd64b869880d6cf2ccad55c73f618e506..5d171811732a12a96505f263feed571f4ce64f31 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem::swap;
 
 pub fn main() {
index 1fdf3a92a3fdbdea5fbb4bd419e122374cd0ee9c..9c200a370ad85e456333d09c1b151055e5d01275 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn view<T>(x: &[T]) -> &[T] {x}
 
 pub fn main() {
index 86f4f2dd18e643377501f2444adadfce20133a99..59221afcefffef0f6247c2b1ea30fae9399af903 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index ebbc5b70f604153934b97bcd208ee3b1413dd42f..acbe091a6a4560bea130e62cfc030f605da312d6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index cfb6c8585634d7049a4ded78a2992c78e7936bfb..cc1bf05db5f59245118780a6894ccba093bac88b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn takes_two(x: &int, y: &int) -> int { *x + *y }
 
 fn with<T, F>(f: F) -> T where F: FnOnce(&int) -> T {
index fdb7485efc35bcf176e65f16501659b8db450abc..c1044b59af26f09b4fbe97335fc5cfe7bbde41bb 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn takes_two(x: &int, y: &int) -> int { *x + *y }
 
 fn has_two<'a,'b>(x: &'a int, y: &'b int) -> int {
index 7e328f3bb0354ce453f80f52b913e0dfdb26acf1..11c3ab111cf5a72cb1a7406fa22e3de34adb331b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct boxed_int<'a> {
     f: &'a int,
 }
index efe3994dbb7b98e928fb735fb4b635d014f7b81d..6b143908f052839f2d865e477cf7ada6eee925f1 100644 (file)
@@ -11,6 +11,8 @@
 // Test an edge case in region inference: the lifetime of the borrow
 // of `*x` must be extended to at least 'a.
 
+// pretty-expanded FIXME #23616
+
 fn foo<'a,'b>(x: &'a &'b mut int) -> &'a int {
     let y = &*x; // should be inferred to have type &'a &'b mut int...
 
index 9174b53be86e6bd595834e25e92d0e169f9fcbc0..586c9ab3a72efb8d308ba97453ba3ab8a0afad7a 100644 (file)
@@ -11,6 +11,8 @@
 
 // check that the &int here does not cause us to think that `foo`
 // contains region pointers
+// pretty-expanded FIXME #23616
+
 struct foo(Box<FnMut(&int)+'static>);
 
 fn take_foo<T:'static>(x: T) {}
index cb45b8e131d284f2414a565beebebd28efa90d1a..391501014b3ae13a1c1bceb93ff53a4ded81ca53 100644 (file)
@@ -12,6 +12,8 @@
 // region variables contained within (otherwise, region inference will
 // give `x` a very short lifetime).
 
+// pretty-expanded FIXME #23616
+
 static i: uint = 3;
 fn foo<F:FnOnce()+'static>(_: F) {}
 fn read(_: uint) { }
index c59bf15afc3b0205dfbb790b51939e2222f23f57..ecc170a1462aabfc1423defa31d7d92f02f243df 100644 (file)
@@ -12,6 +12,8 @@
 // add inference constraints that the operands of a binary operator
 // should outlive the binary operation itself.
 
+// pretty-expanded FIXME #23616
+
 pub struct P<'a> {
     _ptr: *const &'a u8,
 }
index f5c34d6b34e9d8761be05546615cb4056c9ab21e..16236f94655948c0b1c3a62900573685f0bac694 100644 (file)
@@ -11,6 +11,8 @@
 // Regression test for issue #22246 -- we should be able to deduce
 // that `&'a B::Owned` implies that `B::Owned : 'a`.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 use std::ops::Deref;
index a2b6d569ac9a72f0937219612d86e43c47a0a1be..99a4f5647bb44c75078a898f3ed544fca941d4f7 100644 (file)
@@ -22,6 +22,8 @@
 // doing region-folding, when really all clients of the region-folding
 // case only want to see FREE lifetime variables, not bound ones.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index b16b934d73cc64dcd2df66a34be0fd641c890a0d..077d4f5a25e3b43cb8bbab2170a3f9560be24a8a 100644 (file)
@@ -11,6 +11,8 @@
 // This test verifies that temporary lifetime is correctly computed
 // for static objects in enclosing scopes.
 
+// pretty-expanded FIXME #23616
+
 use std::cmp::PartialEq;
 
 fn f<T:PartialEq>(o: &mut Option<T>) {
index 8822d3880397a8f57ef12370bc4fba3f4d7ba53b..0b5ab35f7fe8621b09ecf80402abd49dc87ff46b 100644 (file)
@@ -11,6 +11,8 @@
 // Test that region inference correctly links up the regions when a
 // `ref` borrow occurs inside a fn argument.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 fn with<'a, F>(_: F) where F: FnOnce(&'a Vec<int>) -> &'a Vec<int> { }
index bf789d5364500df680752103028111dccdb92c33..f2e0837c6ea0e8429d1949d9eabc414cf03cdc9d 100644 (file)
@@ -15,6 +15,8 @@
 // - Multiple lifetime parameters
 // - Arenas
 
+#![feature(rustc_private, libc, collections)]
+
 extern crate arena;
 extern crate collections;
 extern crate libc;
index e6b997f758814475e30f21cc634ea1d7e782e048..b6ba7d979ac670e1a9e13df99c8711dc0fdc8946 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 extern crate libc;
 use std::mem;
 
index 5964ac65d5f6e977dc24b1bc0c7226ab93ed3146..6cc32301cc46eb6c9bd2cec41e7acd42930ab4ce 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 
 use std::marker;
index 80c478afa644f2b2b1be49301bb3fd75fef35f18..89bdbfaed9e0a465259c30a8ea75e6aa535b609b 100644 (file)
@@ -12,6 +12,8 @@
 // should not upset the variance inference for actual occurrences of
 // that lifetime in type expressions.
 
+// pretty-expanded FIXME #23616
+
 pub trait HasLife<'a> {
     fn dummy(&'a self) { } // just to induce a variance on 'a
 }
index e1359725f9b9fb6a82bd3266d867e2ed59ea8b62..c2a8f7e66c654cad3a96a30f489b0d23f2adeef6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum roption<'a> {
     a, b(&'a uint)
 }
index 181d962cfae50da52d80bdcd061c36af7086356c..c7ee3213f37417c447cf4f913b635b617d3af24f 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn region_identity(x: &uint) -> &uint { x }
 
 fn apply<T, F>(t: T, f: F) -> T where F: FnOnce(T) -> T { f(t) }
index ecf79de6222225dae29db4ff1f68bf3968cb2abd..89a9d3f1290a9117b2200da015d6a30ba8e82195 100644 (file)
@@ -12,6 +12,8 @@
 // started out with a longer lifetime and was reassigned to a shorter
 // one (it should infer to be the intersection).
 
+// pretty-expanded FIXME #23616
+
 fn foo(x: &int) {
     let a = 1;
     let mut z = x;
index 18312b17339ce3ab29a7dfa983637530bc75c8bf..02c59dde1d6b3a972e3ca5a69d2c74cf7eeafdd0 100644 (file)
@@ -12,6 +12,8 @@
 // started out with a longer lifetime and was reassigned to a shorter
 // one (it should infer to be the intersection).
 
+// pretty-expanded FIXME #23616
+
 fn foo(x: &int) {
     let a = 1;
     match x {
index 30d8fc34d00744bbed427c1c5e5059204bda9ca7..febf5f92ef6ea70eb055ffa3f4a28b140bdc0f06 100644 (file)
@@ -12,6 +12,8 @@
 // attempting to bootstrap librustc with new destructor lifetime
 // semantics.
 
+// pretty-expanded FIXME #23616
+
 use std::collections::HashMap;
 use std::cell::RefCell;
 
index 1ad96d4bc55933e7c1d783b5e777027dda87ca0a..310902d4d0a8511eff0ea6497ee6f793a457cb44 100644 (file)
@@ -17,6 +17,8 @@
 // changes were caught. However, those uses in the compiler could
 // easily get changed or refactored away in the future.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index ee1d66873077b5f48b257a250606adef8b4f7aa9..e6ab4a81426c25db15d77c772741d69f8cd2473d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn get<T>(opt: &Option<T>) -> &T {
     match *opt {
       Some(ref v) => v,
index e5ef88006c7df9925f52b9cee8a46b403c27d7c2..185d5db1f511202146702e72e78186548ed1a199 100644 (file)
@@ -16,6 +16,8 @@
 // wrong path. The new algorithm avoids this problem and hence this
 // example typechecks correctly.
 
+// pretty-expanded FIXME #23616
+
 enum ScopeChain<'a> {
     Link(Scope<'a>),
     End
index 1bcde77261b930d9ada9754a9a7e290f19bb7e61..ae39c266808946bb7dda387a7f9ce478023a89c3 100644 (file)
@@ -10,7 +10,7 @@
 
 #![allow(unknown_features)]
 #![feature(box_syntax)]
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, core)]
 
 struct closure_box<'a> {
     cl: Box<FnMut() + 'a>,
index 807227d47db8f2d4eaa1154bcf3d378b1d75ca33..d23529885793992663897840b3d39a801c27063a 100644 (file)
@@ -12,6 +12,8 @@
 // attempting to bootstrap libsyntax; it is adapted from
 // `syntax::ext::tt::generic_extension`.
 
+// pretty-expanded FIXME #23616
+
 pub struct E<'a> {
     pub f: &'a u8,
 }
index ffc2f07a1530e0b118dd08a9e050108d187c3b28..1b174580b0e14fd32bd912a006919a49daf5a06b 100644 (file)
@@ -14,6 +14,8 @@
 // Note: see compile-fail/variance-regions-*.rs for the tests that check that the
 // variance inference works in the first place.
 
+// pretty-expanded FIXME #23616
+
 struct Contravariant<'a> {
     f: &'a int
 }
index 7e0ca41501833a1ae8746d8d28d6421c7247df90..4021048232724e94d6c9ab99741f995db9471901 100644 (file)
@@ -17,6 +17,8 @@
 // This is covariant with respect to 'a, meaning that
 // Covariant<'foo> <: Covariant<'static> because
 // 'foo <= 'static
+// pretty-expanded FIXME #23616
+
 struct Covariant<'a> {
     f: extern "Rust" fn(&'a int)
 }
index 656fe89896932bf159e146b975d7abada6dcb9ee..f149a70817a8a292fdcc7a9b318ff811078b61e1 100644 (file)
 // This test can't be a unit test in std,
 // because it needs TempDir, which is in extra
 
+// pretty-expanded FIXME #23616
+
+#![feature(tempdir, path_ext)]
+
 use std::ffi::CString;
 use std::fs::{self, TempDir, File, PathExt};
 
index a53f1da4ce605ee7a1bdc3bbb8bd115c2ba10732..12cf0c0de45b446e389d97cffc47fd75a50804c8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 static FOO: [int; 4] = [32; 4];
 static BAR: [int; 4] = [32, 32, 32, 32];
 
index 016357b5df985ee41cd98a1d6011c8317ea8b68c..39b89bb3e4e94e84010a84dadeafaa85dd08e112 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 const foo: int = 4 >> 1;
 enum bs { thing = foo }
 pub fn main() { assert!((bs::thing as int == foo)); }
index 33ae0af250a5397fdcb378aa046ab78b38abfce2..a8426f90cc4890db7dde965c84dbcfc0b7101855 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 
 // Ensures that class dtors run if the object is inside an enum
index 8d7faffae7f338aff10f4aac929b467d70655fdb..ea0de67572ded25b70c000e7b7c42fba8688c4f4 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 enum option<T> { none, some(T), }
 
 fn f<T>() -> option<T> { return option::none; }
index 60856ee60425b310f1441f41b5960099f596b7ee..0a87e76ef4e077c629110d92723bfd5b87995b48 100644 (file)
@@ -10,6 +10,8 @@
 
 // just to make sure that `return` is only returning from the closure,
 // not the surrounding function.
+// pretty-expanded FIXME #23616
+
 static mut calls: uint = 0;
 
 fn surrounding() {
index b5a81268a2dcf7a3c9332e35bc66feb92ceda939..fe4244084cb194ff398d0dfa2fad10b8bd80d984 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 fn f() { let x: () = (); return x; }
 
 pub fn main() { let _x = f(); }
index abb16c39d113643a22aa1271773fc0a277055cdd..75f66d5bf26776097cbbab863bdc3ada1bba3ce4 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(start)]
+#![feature(start, os, std_misc, old_io)]
 
 use std::ffi;
 use std::old_io::process::{Command, ProcessOutput};
index 5d6657c7e12e653e9a4bd837dfb4c47b23fb345a..0f7fb31fbae1b59972773f063f18ef5dd6a6f369 100644 (file)
 
 // exec-env:RUST_LOG=rust-log-filter/foo
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, std_misc, rustc_private)]
 
 #[macro_use]
 extern crate log;
index 492736c2252a0148612a2e948a6ebb6ceb169bb2..1b3020b8dbe9b399620567174d81f93354061717 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(old_io)]
+
 use std::old_io::process::Command;
 use std::env;
 
index af2b2de8ab8ba19473b9108dc5601be028ea88e9..75a68677e5203103e0efd5010f0d8fdd631088a8 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that we can use `Self` types in impls in the expected way.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 92582177989b6d234d5dc26eb664898ce7dcc411..64d49215f22a7654418c550e6592132d9e65e32d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index a4b5ea1d682823e1d93e8ab401ac1940fb19c5d1..69cad7ab3dd4428d4f633cf2a795f01832be5c17 100644 (file)
@@ -11,6 +11,8 @@
 // Assert that `mut self` on an immediate value doesn't
 // allow mutating the original - issue #10615.
 
+// pretty-expanded FIXME #23616
+
 #[derive(Copy)]
 struct Value {
     n: int
index b71b907fcf0432b23ae33ca4bee943041ccf282f..b3c81cab3c1cea7bfffc98529081f8aa82aa629d 100644 (file)
@@ -11,6 +11,8 @@
 // Ensure assigning an owned or managed variable to itself works. In particular,
 // that we do not glue_drop before we glue_take (#3290).
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 47380287ab65e975c40fc8a39dbea586db42eef8..6621de0d8beefc0b1f27f71c86e6247f57471135 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod a {
     pub mod b {
         pub mod a {
index 5c4e2f5ebd52b297e557424eac52d1a18c42101b..ea2bec8c86126c79fcbd83393b4d8f7cb3f71200 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait MyTrait {
     fn f(&self) -> Self;
 }
index c6b64d97fbdd50709b8bb164fe263d5409ce4a3f..5815eaa01ea822ec18ef01e196675df4541794aa 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(core, std_misc)]
 use std::thread::Thread;
 use std::sync::Mutex;
index a920d76e7ca1b75bc942e2f58e421501036082af..47c3766797a106f8df5de4ae0df8ce3074e21285 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc)]
+
 use std::thread::Thread;
 use std::sync::mpsc::channel;
 
index 60093803f0b77745e77c7fde8879d070ab39fbbb..84d491d052404a2d0f06e00093e04a5d47b1637a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::mpsc::{channel, Sender};
 
 // tests that ctrl's type gets inferred properly
index 33e4fa85bcb81003f155d1f4030e98c37b84acac..d109f7abde44abc2fac4767f46cdbcedbb842f46 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections, into_cow)]
+
 extern crate collections;
 
 use std::collections::HashMap;
index 3390369242d13943222cd5d9077b53712d0d9f29..07dd54433480c9e5d6ef89720a43bf4035d696d3 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections, into_cow)]
+
 extern crate collections;
 
 use self::collections::BTreeMap;
index 8691d5e875bfc401fa3c0878b05a7d159b20a0b0..993ae2a43fb6927861e6b04ec21e34a7276bd92e 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that a class with only sendable fields can be sent
 
+// pretty-expanded FIXME #23616
+
 use std::sync::mpsc::channel;
 
 struct foo {
index 51c20bcd09852e7dd1ab39a0bf64842cced73ac7..5f23b72edb7f893687461fffed78a2eab18a5898 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 fn test<F>(f: F) -> uint where F: FnOnce(uint) -> uint {
     return f(22);
 }
index 0178b5e786d65c6d36b73dd5e4ee52eacde77492..07393d83e67b660ed54a532011fc72eaa042109c 100644 (file)
@@ -13,6 +13,8 @@
 
 // Test accessing cross-crate inlined items from multiple compilation units.
 
+// pretty-expanded FIXME #23616
+
 extern crate sepcomp_cci_lib;
 use sepcomp_cci_lib::{cci_fn, CCI_STATIC};
 
index a5506e3fc761dc1deddd1a589041e17444168f42..fc85fc223a467203fdd4913d8556b5b1c8855cf2 100644 (file)
@@ -13,6 +13,8 @@
 
 // Test accessing external items from multiple compilation units.
 
+// pretty-expanded FIXME #23616
+
 #[link(name = "sepcomp-extern-lib")]
 extern {
     #[allow(ctypes)]
index 35a8c9330bff3c82b9155d5d2fc16fe11f68abb4..7998841322925e4949ea7fd0f080def80e4d63f4 100644 (file)
@@ -15,6 +15,8 @@
 // Generate some code in the first compilation unit before declaring any
 // modules.  This ensures that the first module doesn't go into the same
 // compilation unit as the top-level module.
+// pretty-expanded FIXME #23616
+
 fn pad() -> uint { 0 }
 
 mod b {
index 09f2a4281be084021c8d7c8af21f58330de3149d..f3673dfdbf2c567cb32e9a80dda89daf3189d2ac 100644 (file)
@@ -17,6 +17,8 @@
 // Generate some code in the first compilation unit before declaring any
 // modules.  This ensures that the first module doesn't go into the same
 // compilation unit as the top-level module.
+// pretty-expanded FIXME #23616
+
 fn one() -> uint { 1 }
 
 mod a {
index 28adb55399b44afdb998e0f0d11de88b3460d331..00e83a570579d2bdaad709bef7910ad83a75e1bc 100644 (file)
@@ -12,6 +12,8 @@
 
 // Test linking against a library built with -C codegen-units > 1
 
+// pretty-expanded FIXME #23616
+
 extern crate sepcomp_lib;
 use sepcomp_lib::a::one;
 use sepcomp_lib::b::two;
index 0e8d33f74f806bbe665fdd8903ab4503975a413d..43d03e2bb6b03f1accd7d72d875286b22420f9f0 100644 (file)
@@ -12,6 +12,8 @@
 
 // Test references to static items across compilation units.
 
+// pretty-expanded FIXME #23616
+
 fn pad() -> uint { 0 }
 
 const ONE: uint = 1;
index 21c5a6fc83a123fc54f697b52516677716dfe6fc..6b39510c8c25afa32841acb42d7f0330d87cb8bc 100644 (file)
@@ -19,6 +19,8 @@
 // In any case, this test should let us know if enabling parallel codegen ever
 // breaks unwinding.
 
+// pretty-expanded FIXME #23616
+
 use std::thread;
 
 fn pad() -> uint { 0 }
index ef14e0ba931b5525d42131e35a5315c1ab610ec5..743f54abcfa662ebaa3cddd99041c47a8e04792c 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     assert!(("hello".to_string() < "hellr".to_string()));
     assert!(("hello ".to_string() > "hello".to_string()));
index 26dc6c5316b160b9b68fa9fc4837086b97d25a9a..b0ab72c650d74fb599e543243a97e236d76a6d3b 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that we can do shifts by any integral type.
 
+// pretty-expanded FIXME #23616
+
 struct Panolpy {
     i8: i8,
     i16: i16,
index 918da535099272fdb43e703393301ddb1d32f7c9..138a681ce2acbc767cad85d8866e4aa29c1506e6 100644 (file)
@@ -11,6 +11,8 @@
 // Testing shifts for various combinations of integers
 // Issue #1570
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     test_misc();
     test_expr();
index 776d897938dd3c5ae556c8043430aae50cd0b90c..90bb36f25f75eb3e3c431b92786e011fbc28e82b 100644 (file)
@@ -10,6 +10,9 @@
 
 // ignore-windows
 
+#![feature(old_io)]
+#![feature(os)]
+
 use std::env;
 use std::old_io::process::{Command, ExitSignal, ExitStatus};
 
index 2acb93f48f92619fc1c78e519e54207c5a48cbf4..eab4a0dfb7fcc402e94bd16a652c5a39971c8797 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum test { thing = -5 >> 1_usize }
 pub fn main() {
     assert_eq!(test::thing as int, -3);
index 665b582581cfb88f42745995fd31e183c76452e0..b81d0f2407bf0c17f09191e782b06f8d6115f72a 100644 (file)
@@ -11,6 +11,8 @@
 // Be sure that when a SIGPIPE would have been received that the entire process
 // doesn't die in a ball of fire, but rather it's gracefully handled.
 
+// pretty-expanded FIXME #23616
+
 use std::env;
 use std::io::prelude::*;
 use std::io;
index 779e507f43dfdff3cd77aafb98dfa53c0682a084..0d26b75c2ad7f6ded6febd04e81a04bb5fecc7f1 100644 (file)
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
 
 use std::simd::{i32x4, f32x4, u32x4};
 
index 1371c4cc5f4ad7f6405eaa290ad719d4bbbc4727..201da8dbc948941c119f7f510faafe2ce6ce138f 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 #![feature(simd)]
 
 use std::ops;
index 7f1be4b7d7060f0b8ac5ca485ffddc11ded05a64..8dca78b28e802d686b1568373a2c04ac178a594e 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
 
+#![feature(core)]
 #![feature(simd)]
 
 pub fn main() {
index 582810f0def339528bf4d6316901f18974636b6b..8324efc64172771199e51c8738c861c60e09d98c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(simd)]
 #![allow(non_camel_case_types)]
 
index a1a7457811280304cd856a4caf2e43ffb75026a7..540666f41ae2bb4328128cd793d962c85930f37f 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 #![feature(simd)]
 
 #[simd]
index 27d4f105f3740c33e654bf0a8d7324d1ce04e7f4..3273b73b4e286fd50504103ee1c7088bc00bf11c 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 enum clam<T> { a(T), }
 
 pub fn main() { let c = clam::a(2); match c { clam::a::<int>(_) => { } } }
index 8a36f9e17f383c66ef8bb73a2be144ec172b1a4e..2e8d8f61bc8a74331f6f3574c574d056bc1c0e71 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 enum clam<T> { a(T), }
 
 pub fn main() { }
index cc5d8fc78911d79d012163a0eaf4e6cf8cb95f36..addc56e9c4210c8dac31e80ceb6af700f821beb4 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(custom_derive)]
 
 #[derive_Clone]
index 348b7562f8460ae139a67cbda83fc1bf0cc6daaf..76c06d560d754417f786c7f4a09d8634acaee546 100644 (file)
@@ -10,6 +10,8 @@
 
 // Possibly-dynamic size of typaram should be cleared at pointer boundary.
 
+// pretty-expanded FIXME #23616
+
 fn bar<T: Sized>() { }
 fn foo<T>() { bar::<&T>() }
 pub fn main() { }
index e64917a97a637f6cc312fe138595fa80a66e0a0d..d3a6b104dba55f441f526482f63c69d680258c55 100644 (file)
@@ -11,6 +11,8 @@
 // Possibly-dynamic size of typaram should be cleared at pointer boundary.
 
 
+// pretty-expanded FIXME #23616
+
 fn bar<T: Sized>() { }
 fn foo<T>() { bar::<Box<T>>() }
 pub fn main() { }
index 6e256be69dac74c1d463ebe30f493c2518e0c306..1d0d28d5f95b9e0b90a54ff976def2029c91faf8 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test slicing expressions on slices and Vecs.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let x: &[int] = &[1, 2, 3, 4, 5];
     let cmp: &[int] = &[1, 2, 3, 4, 5];
index 639ffd56002ec381da9d7c0a10725b0bb11a0193..bb8db83ccdc057787fcd9e4b23854696e75754f7 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that if a slicing expr[..] fails, the correct cleanups happen.
 
+// pretty-expanded FIXME #23616
+
 use std::thread;
 
 struct Foo;
index 4a2038175d2e63b6ec8bfc7569c41a06813f44d9..94ea026d87d1f76aa1e709cfd22dd115466a8caf 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that if a slicing expr[..] fails, the correct cleanups happen.
 
+// pretty-expanded FIXME #23616
+
 use std::thread;
 
 struct Foo;
index 30b53dbb0ad5bea0bdf96b7ddb419345e2749ad6..ec6cdf448303db2e00fac23493d5d3226a45d814 100644 (file)
@@ -10,7 +10,9 @@
 
 // Test slicing sugar.
 
-#![feature(associated_types)]
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
 
 extern crate core;
 use core::ops::{Index, IndexMut, Range, RangeTo, RangeFrom, RangeFull};
 
 impl Index<Range<Foo>> for Foo {
     type Output = Foo;
-    fn index(&self, index: &Range<Foo>) -> &Foo {
+    fn index(&self, index: Range<Foo>) -> &Foo {
         unsafe { COUNT += 1; }
         self
     }
 }
 impl Index<RangeTo<Foo>> for Foo {
     type Output = Foo;
-    fn index(&self, index: &RangeTo<Foo>) -> &Foo {
+    fn index(&self, index: RangeTo<Foo>) -> &Foo {
         unsafe { COUNT += 1; }
         self
     }
 }
 impl Index<RangeFrom<Foo>> for Foo {
     type Output = Foo;
-    fn index(&self, index: &RangeFrom<Foo>) -> &Foo {
+    fn index(&self, index: RangeFrom<Foo>) -> &Foo {
         unsafe { COUNT += 1; }
         self
     }
 }
 impl Index<RangeFull> for Foo {
     type Output = Foo;
-    fn index(&self, _index: &RangeFull) -> &Foo {
+    fn index(&self, _index: RangeFull) -> &Foo {
         unsafe { COUNT += 1; }
         self
     }
 }
 
 impl IndexMut<Range<Foo>> for Foo {
-    fn index_mut(&mut self, index: &Range<Foo>) -> &mut Foo {
+    fn index_mut(&mut self, index: Range<Foo>) -> &mut Foo {
         unsafe { COUNT += 1; }
         self
     }
 }
 impl IndexMut<RangeTo<Foo>> for Foo {
-    fn index_mut(&mut self, index: &RangeTo<Foo>) -> &mut Foo {
+    fn index_mut(&mut self, index: RangeTo<Foo>) -> &mut Foo {
         unsafe { COUNT += 1; }
         self
     }
 }
 impl IndexMut<RangeFrom<Foo>> for Foo {
-    fn index_mut(&mut self, index: &RangeFrom<Foo>) -> &mut Foo {
+    fn index_mut(&mut self, index: RangeFrom<Foo>) -> &mut Foo {
         unsafe { COUNT += 1; }
         self
     }
 }
 impl IndexMut<RangeFull> for Foo {
-    fn index_mut(&mut self, _index: &RangeFull) -> &mut Foo {
+    fn index_mut(&mut self, _index: RangeFull) -> &mut Foo {
         unsafe { COUNT += 1; }
         self
     }
index 35283e466c1c099f4c6a6993cf5aa439652d8ff0..df204065d163e6a76769dc5993a4a9b599e58be5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /*!
  * Tests the range assertion wraparound case in trans::middle::adt::load_discr.
  */
index 61b2fc8b50f5b6ac13fc49dd14a4aa0368164f52..d7926ec8b29c75c5d172fd0ae2fa752a61ed6cbc 100644 (file)
@@ -10,7 +10,9 @@
 
 // Smallest "hello world" with a libc runtime
 
-#![feature(intrinsics, lang_items, start, no_std)]
+// pretty-expanded FIXME #23616
+
+#![feature(intrinsics, lang_items, start, no_std, libc)]
 #![no_std]
 
 extern crate libc;
index 2220761a026667cbcf408b9d794536cda8785f44..90ea7537c6e607aea721549fca788db37ea8c6d7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(non_ascii_idents)]
 #![deny(non_snake_case)]
 
index c8fe400c4c3c617bbb4203aac35a6a88c51a4777..4f8ba7f655ee6d48d6f8405db6d17163a0bc2506 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread::Thread;
 
 fn x(s: String, n: int) {
index bf2f03b3e6de9bf3da43927036129a99e95d90e4..baf7bb6308f712a86091fe96e52a729549f92fa9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 /*
   Make sure we can spawn tasks that take different types of
   parameters. This is based on a test case for #520 provided by Rob
index 515198f7a71eb0faa4bdaffc4301c93346fda479..920cd9e03ab6b4ee97fd876a94e5c60bbfa44d92 100644 (file)
@@ -10,7 +10,9 @@
 
 // Issue #2040
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
-    let foo = 1;
+    let foo: int = 1;
     assert_eq!(&foo as *const int, &foo as *const int);
 }
index 1ccc189dc81808f7479e5c03d6afab77ab20cf5b..c453f9252efe6aedd03cf9bfd704d9fb32ffe269 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(tempdir, path_ext)]
+
 use std::fs::{File, TempDir};
 use std::io::prelude::*;
 
index f650e56bb6b772ccf34ea72cff50b1ce21dbec86..e5583a3c697b6714f269b4dccd1e511d411e1f04 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(static_assert)]
 
 #[static_assert]
index efc374e25bbff097011a424e5644dfd5cacf1d4c..b2fbff67ac7c2718f677cd992774a617b2e7c280 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:static_fn_inline_xc_aux.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "static_fn_inline_xc_aux" as mycore;
 
 use mycore::num;
index cb9f7c3da02485d237c834120b36e85e4189ec56..7c9049ffacfc20181e15672562c534c28706d161 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:static_fn_trait_xc_aux.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "static_fn_trait_xc_aux" as mycore;
 
 use mycore::num;
index 6e12c5fa73de15c4c217d806a077f9cdd6f5f64b..f4d6e89d170a7c3c66892e7375b011afff8d1036 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:static-function-pointer-aux.rs
+// pretty-expanded FIXME #23616
+
 extern crate "static-function-pointer-aux" as aux;
 
 fn f(x: int) -> int { x }
index ff1091e07ef169ebcdb1d19363e3fbfdaf06be6c..a2b1572db6360f85375f814e644d4c488efb945d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn f(x: int) -> int { x }
 fn g(x: int) -> int { 2 * x }
 
index b66999c8e67229083cb4a52328a701f7b317ea9b..6af348b0e3ed3438ac23d091112585f52cd31eef 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub trait plus {
     fn plus(&self) -> int;
 }
index d1fcc4659b93764a7550ce3617e9b990c24a7aa3..1eb20370f687c270cd389eeba7b3d2544db48b09 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Deserializer {
     fn read_int(&self) -> int;
 }
index 076c56bcc4d2af1f7c8f172ffb9deb642cdb0206..ed9160e1d5850c6532936bf48cc503a08c70bf7d 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:static-methods-crate.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate static_methods_crate;
 
 use static_methods_crate::read;
index 47f46041c224a38063b397a96ec3004bc2f84ad8..33c1ce4d2c3d5d8527da22054e20a4fc935d41c2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod a {
     pub trait Foo {
         fn foo() -> Self;
index d0448de2c49705302b0f80dc1e317a0e39a46903..cd8406983fbb34c97bca3d02f30d7e5ecf3a03f5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub trait Number: NumConv {
     fn from<T:Number>(n: T) -> Self;
 }
index e5d4591361a6351d257f4bcbeb633e434ce96f57..c6b919c9738d4e3e37c913225c6cbb8d5a58d0cc 100644 (file)
 // statics cannot. This ensures that there's some form of error if this is
 // attempted.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc)]
+
 extern crate libc;
 
 #[link(name = "rust_test_helpers")]
index 5aa28ad80fae8a0bda8187f9805fe3c5d1cf8942..a32bf7a7af2758677fe14cd9b45e81050b12575a 100644 (file)
@@ -14,6 +14,8 @@
 
 // aux-build:static_mut_xc.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate static_mut_xc;
 
 unsafe fn static_bound(_: &'static int) {}
index d2d72ed16618df6e74be3321eb5f9346043cc665..058777bb05e5e2a98fa7492d7fc4bdf41087bdf8 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc, alloc)]
+
 use std::sync;
 
 fn assert_both<T: Sync + Send>() {}
index 918715f81e85a58bef879ed3ed624a7f8cdf16a0..0d0d56fcafb0b16ab17850842379e6ef026930c7 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let a: String = "this \
 is a test".to_string();
index 7abe8276a97823b67e314c2b8b304b9fa2d5f294..e0fc1c4ce46a7e791f579d95b313430e1a88ad03 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let x = "\\\\\
     ";
index 7d99a2d1dcf54f4983005952b2f5351ec00e674a..17cb8acea6fadda71cae36233bfc15dd6afbe45c 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:xcrate_struct_aliases.rs
+// pretty-expanded FIXME #23616
+
 extern crate xcrate_struct_aliases;
 
 use xcrate_struct_aliases::{S, S2};
index 2e24bb64bedb706501648e0aecbfcf485cff36f7..c27e6e4576cbc52d54cea556899a012987d3a5a8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct S {
     x: int,
     y: int,
index 2de2bcc958471c2566f0106dbb9030486c45a2ae..5fed712bd663a026e3c695d7c4f193fb587dbadf 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:struct_destructuring_cross_crate.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate struct_destructuring_cross_crate;
 
 pub fn main() {
index 364c6da980393263bd5075f6e753371738d61858..8ff17bf08f8ce93bfe3d1c2a4615d3a27c771b2b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Foo {
     Bar {
         a: int,
index 3afa44a3142b40b8d40fac406b3cd4417f17946f..36b9a6d9e8dd4e3cc2ebbe244f24d81c62a31470 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Foo {
     Bar {
         x: int,
index 21eb0ae99b4af9f39cb50ea3a15f7506afd594bc..22a57cbf0430c034bf3d3226d9a0ce4e7e3a64f9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo {
     new: int,
 }
index a64477242c08fb43eb7b2fadbc81c5e866c95b50..1c7101402ab93434a5c4fb3967952a78cc89b8fe 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct S { f0: String, f1: int }
 
 pub fn main() {
index 359ecdab630eccc56fefe0bd811ac916dbc81bd4..45755608ff56a780bb67ff3606efc3ed39d7688f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct S {
     f0: String,
     f1: String,
index 856ed7c105e8a29add09aec52b547f8bd6886580..37b6de8e17ef1b79319622cb88f34e90361e20f1 100644 (file)
@@ -11,6 +11,8 @@
 // Checks that functional-record-update order-of-eval is as expected
 // even when no Drop-implementations are involved.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::atomic::{Ordering, AtomicUsize, ATOMIC_USIZE_INIT};
 
 struct W { wrapped: u32 }
index 25923beffdde4e871e630d2829fbc0d10a1f2938..1b53895f7d1a7ae8cf36901084d0179d29d847bd 100644 (file)
@@ -11,6 +11,8 @@
 // Checks that struct-literal expression order-of-eval is as expected
 // even when no Drop-implementations are involved.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::atomic::{Ordering, AtomicUsize, ATOMIC_USIZE_INIT};
 
 struct W { wrapped: u32 }
index aad3ba01a487e24c21bdac5c354c0cc1045c54af..383292fe097edf0101022375773ec274972f7a9d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod foo {
     pub enum Foo {
         Bar { a: int }
index 923a1427869f53bd1f73e251d33049a519be4860..602650e4e06a3444fe740eb66e59d3fc499dfbf4 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:struct_variant_xc_aux.rs
+// pretty-expanded FIXME #23616
+
 extern crate struct_variant_xc_aux;
 
 use struct_variant_xc_aux::Enum::StructVariant;
index 41dcb7ddbc86bc084853500799c585aadb1358ea..f43dd2332a17a1cbd2089b7369fa89f289d420ed 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:struct_variant_xc_aux.rs
+// pretty-expanded FIXME #23616
+
 extern crate struct_variant_xc_aux;
 
 use struct_variant_xc_aux::Enum::{StructVariant, Variant};
index 95aeff425e8a90c6fe090d822f3e894b1c6e1b14..51520c77751b0678b56bfa09b47f212b86a9722a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub mod a {
     pub fn f() {}
     pub mod b {
index e158ae672aa5e038f07bebcbfab4723fd0b8f82c..351c4259b5ef3bc2df3a9671cd710f57d550c673 100644 (file)
@@ -10,6 +10,8 @@
 
 // There is some other borrowck bug, so we make the stuff not mut.
 
+// pretty-expanded FIXME #23616
+
 use std::ops::Add;
 
 trait Positioned<S> {
index 3fffef060a1b4514841ddc1261bfb4432765e6ce..7f705146aaa128937c8b2bba08bc98f51720d165 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(libc)]
+
 extern crate libc;
 
 pub fn main() {
index 235c4e74d085740f5fa9408b65ce2097c245af55..4d7b61e08f51922f47cb6a3a0ccf90afc1781359 100644 (file)
@@ -13,6 +13,8 @@
 // aux-build:svh-b.rs
 // aux-build:svh-a-comment.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate a;
 extern crate b;
 
index 365960b96e4e956a2de4b7cabf09baa7b6f50b10..ea07ebe364661a01fad995170177a26aed84aad8 100644 (file)
@@ -13,6 +13,8 @@
 // aux-build:svh-b.rs
 // aux-build:svh-a-doc.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate a;
 extern crate b;
 
index a0dbc96cdb02abe7eddcc721f9016a439d381c00..4e0192c40c230af5858937426a264beaa32db283 100644 (file)
@@ -13,6 +13,8 @@
 // aux-build:svh-b.rs
 // aux-build:svh-a-macro.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate a;
 extern crate b;
 
index 98b7663c58ebb1f9e3e0d239cdda759036511d38..9aa56ed2a769da1f00a0f49345e84acd0293de7d 100644 (file)
@@ -13,6 +13,8 @@
 // aux-build:svh-b.rs
 // aux-build:svh-a-no-change.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate a;
 extern crate b;
 
index 650f76d729a54a676fe64c6748ca566d110445a0..2da3004aaf1e527a108a62fc3885a3e83b555cee 100644 (file)
@@ -13,6 +13,8 @@
 // aux-build:svh-b.rs
 // aux-build:svh-a-redundant-cfg.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate a;
 extern crate b;
 
index 6612c93e90bc536e8b41ecb8c13a2fde180fff9f..bfc676bde263adaf28c533e10a4b04307cfd4b74 100644 (file)
@@ -13,6 +13,8 @@
 // aux-build:svh-b.rs
 // aux-build:svh-a-whitespace.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate a;
 extern crate b;
 
index 82a76512e08f7d5d1895f57f2067479e664f8ddf..e60c672f00f9b7d6027dc5db70c034a487690286 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem::swap;
 
 pub fn main() {
index 1dbd29a781effb127c488a3769c1a88a39dfbc5b..45bcba61b152830dd92f22d58c5b43abc758af52 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem::swap;
 
 pub fn main() {
index b25b350aa4b72320ae95ae8a75be596b0cbf4056..96cab66ab661f6379afc933d3bd1a8076b500e7d 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #5041 - avoid overlapping memcpy when src and dest of a swap are the same
 
+// pretty-expanded FIXME #23616
+
 use std::ptr;
 
 pub fn main() {
index 6d29d5f2b3e91a80e7a4a8a5311c43cc92e4e068..7103fa7c33e3b8f9d05fcdbd2dcc7c1b74b8c545 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_mut)]
 #![feature(collections)]
 
index 8c888ff03624f701aed29c3f1c38bc38b2cfbe49..8766cba5dbb450e11803969d383fdaad140cfde1 100644 (file)
@@ -10,6 +10,8 @@
 
 // compile-flags: --cfg foo --cfg qux="foo"
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     // check
     if ! cfg!(foo) { panic!() }
index 684ca7fa2b62d30e6daa53613d5b9de78824381d..b3f503aad3444e808a128cf2e3135a07c5704621 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(core)]
+
 // This test is brittle!
 // ignore-pretty - the pretty tests lose path information, breaking include!
 
@@ -22,9 +24,9 @@ pub fn where_am_i() -> String {
 macro_rules! indirect_line { () => ( line!() ) }
 
 pub fn main() {
-    assert_eq!(line!(), 25);
+    assert_eq!(line!(), 27);
     assert!((column!() == 4));
-    assert_eq!(indirect_line!(), 27);
+    assert_eq!(indirect_line!(), 29);
     assert!((file!().ends_with("syntax-extension-source-utils.rs")));
     assert_eq!(stringify!((2*3) + 5).to_string(), "( 2 * 3 ) + 5".to_string());
     assert!(include!("syntax-extension-source-utils-files/includeme.\
@@ -42,7 +44,7 @@ pub fn main() {
     // The Windows tests are wrapped in an extra module for some reason
     assert!((m1::m2::where_am_i().ends_with("m1::m2")));
 
-    assert!(match (45, "( 2 * 3 ) + 5") {
+    assert!(match (47, "( 2 * 3 ) + 5") {
         (line!(), stringify!((2*3) + 5)) => true,
         _ => false
     })
index 340ad2a531a738188d19b7596dd5e99f859c81da..ba8a3f77aacefe0b65d679f6403fe70de64372db 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(optin_builtin_traits)]
+// pretty-expanded FIXME #23616
+
+#![feature(optin_builtin_traits, core)]
 
 use std::marker::{MarkerTrait, Send};
 
index 8d8d4caad2404ee69f149a52b4ca3afa3e54a098..b0d4b4c4404c8cd29b3132e3c6c477f94c7ada92 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 enum Tag<A> {
index 917f2c5b37468fe90bf1ddc4e28fafb19a6e632c..672a63824aa36eb2ecd8b8e0fc50e047ce2fdd6f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 enum Tag<A,B> {
index df99d77142c1b2880cac249744b04ff85f0e0f80..ca0e3ee95f880e06b629f3fbce07e3eb35813c70 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 enum Tag {
index 2eff97d31b25d4875a39ce06c9127b2f9b8a51c8..d797fd2e54f4659d8a73968a1f65fea7ca82c45d 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 use alder::*;
 
 mod alder {
index 4cb189ee43ffeeab6d4141791a5ebc592a433284..f1a820c8d816e0afc7014b113b1ccab6886d0fe8 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 fn foo() {
     fn zed(_z: bar) { }
     enum bar { nil, }
index 7e4bd9ab2738c93ba30a0d6cd3353599f0e9e447..d31eacc99769fc2e056d25feb9e787d15beb8134 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum color {
     red = 1,
     blue = 2,
index 915a0b5b7e3b76bb87c3dc2ba76e5aa4d756e527..95bfb7868991836671eccbff2105ea869ad19478 100644 (file)
@@ -7,6 +7,8 @@
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
+// pretty-expanded FIXME #23616
+
 use color::{red, green, blue, black, white, imaginary, purple, orange};
 
 #[derive(Copy)]
index 45b6871e401bdfe1a78afba03c342ab1e06798da..d6d4cd2de78a2331a81e4b05bce2a52af641d02e 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 enum colour { red(int, int), green, }
 
 impl PartialEq for colour {
index a5447606d87c8b29788f6ff85b9aa499f3cebebb..8842e1b85915b767702d4d0c8581275fc0770f5a 100644 (file)
@@ -12,6 +12,8 @@
 
 
 // use of tail calls causes arg slot leaks, issue #160.
+// pretty-expanded FIXME #23616
+
 fn inner(dummy: String, b: bool) { if b { return inner(dummy, false); } }
 
 pub fn main() {
index fd03d28050326d68a07b3e37fa0f142501f0a285..640da0697ac2a2edab40ec62f1599133f3021a36 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() { assert!((even(42))); assert!((odd(45))); }
 
 fn even(n: int) -> bool { if n == 0 { return true; } else { return odd(n - 1); } }
index 78826666f53ffc0407aa796ee2c97cd68158c2ad..a24d61c8ceaf98ca17d47e74528f85431cbc8b06 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread::Thread;
 use std::sync::mpsc::{channel, Sender};
 
index 180f6e09ba99bb12b0f341e85dfa5c215912e306..e882d8506fc6598b954121f6cc86ac2bbfa5628b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread::Thread;
 
 pub fn main() { test00(); }
index 60af3afec2b3d9b77fcb4ec4cf913752e26289f8..99eebdb601a29316b0b836434bd12a1007efd0df 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread::Thread;
 use std::sync::mpsc::{channel, Sender};
 
index 1740c49c7720b347636f95cd6c21b74c42b22c72..952adf1cd78a69fb309bf6eb1e203877518938cb 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc)]
+
 use std::sync::mpsc::{channel, Sender};
 use std::thread::Thread;
 
index 08dce2a76489b7df79c876e4851ff50835d8e046..ff6d959327d03e6bd3771a062ad2cdbc7c170340 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread::Thread;
 
 pub fn main() { test00(); }
index 429c6ce9fb3711531cf0f1765730d8839b29182c..1f7da10252bd5d2a755a8a65aff805880a62218a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::sync::mpsc::{channel, Sender};
 use std::thread::Thread;
 
index 0735e3996eec10ec81986948a1157616b598d143..785df73317aa1ee4018ef348f15a7b7028e9475e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::sync::mpsc::{channel, Sender};
 use std::thread::Thread;
 
index 28eea784f361cac61a813bbc1aa1f3e50175e0ab..4db4333c9647e44fc22e9c68f335267868bef25d 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc)]
+
 use std::sync::mpsc::{channel, Sender};
 use std::thread::Thread;
 
index 9db5465f7e96e77e03d0dbaa66fdb1490644f28b..6c27292d19d598cce5daa4764f9e5480293db4d6 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc)]
+
 // Issue #922
 
 // This test is specifically about spawning temporary closures.
index 902829468381de01093ec8d74bbe3bfb59451699..bb0749eb8c005abc44a808092c56fc362fcd830e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 // no-pretty-expanded FIXME #15189
 
 use std::thread::Thread;
index 039308d5cfed736c903f87f5ff4bc4248e811bdc..9bae0ad069cd37861ee39d195d06bff137eddd1d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::mpsc::channel;
 
 pub fn main() { test00(); }
index 7cdfddcdeb113ff4fe3fd2c9ffca3d3aebad30a0..2657951ca48763209821bff730b9889cdddbf51d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 
 use std::sync::mpsc::channel;
index 6f3b47b8bfa7a607e870496ce87d9636194a43b6..44e3bab20ef74afba0b6dbae22f002022b675ffd 100644 (file)
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc)]
 #![allow(dead_assignment)]
 
 use std::sync::mpsc::{channel, Sender};
index 6d8de4a6a53d6c090b2cfa7fae564fe5b1739bec..81d9148955a64c71c2d3511effd1743b5a34f0a8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread::Thread;
 use std::sync::mpsc::{channel, Sender};
 
index 78a42632001d0dec1208b3c5022724e79982071f..77571504fea274f27100020317538f3a2e5838de 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::mpsc::channel;
 
 // rustboot can't transmit nils across channels because they don't have
index 3f229926480a95ef300ace0bbd599e9eb4d7b339..7da7a1afb9af89cb480634d0c4698685427a4fc0 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(std_misc)]
+
 use std::thread::Thread;
 
 pub fn main() {
index 46f9e991347e42bc601c200cf0fd39d8b8fcb9c4..5c0d0fe9a63d8ed74b4ff05042e1562a6debf52c 100644 (file)
@@ -8,8 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, std_misc)]
 
 use std::thread::Thread;
 use std::sync::mpsc::channel;
@@ -17,7 +19,7 @@
 pub fn main() {
     let (tx, rx) = channel::<uint>();
 
-    let x: Box<_> = box 1;
+    let x: Box<int> = box 1;
     let x_in_parent = &(*x) as *const int as uint;
 
     let _t = Thread::spawn(move || {
index 3131cda1dbc3aa7a89b72b067191c524c9c58863..7bcde7b83cd1b6c7b5012c92d95b0a2c0c6f2e00 100644 (file)
@@ -8,8 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, old_io, std_misc, io, set_panic, set_stdio)]
 
 use std::io::prelude::*;
 use std::io;
index b87718ba4680c00e83bf2db4db6b53224943a943..5633ef2ecfc9b2f409c8da38c87b6f6cd3ba6754 100644 (file)
@@ -13,6 +13,8 @@
 //              quite quickly and it takes a few seconds for the sockets to get
 //              recycled.
 
+#![feature(old_io, io, std_misc)]
+
 use std::old_io::{TcpListener, Listener, Acceptor, EndOfFile, TcpStream};
 use std::sync::Arc;
 use std::sync::atomic::{AtomicUsize, Ordering};
index 5462a996f73d974d071a4ca31b6845cc68228dc1..a9a16cd72dff7dbf48ba6761188986581aa7712a 100644 (file)
@@ -19,6 +19,7 @@
 #![reexport_test_harness_main = "test_main"]
 
 #![allow(unused_imports)]
+#![feature(old_io, std_misc, io)]
 
 use std::old_io::*;
 use std::old_io::test::*;
index e06e6883a75aa4d2e05532280d2c7ed6ca33f9ce..489abf163c0b2d80cc9d9ab9a28527d8c5e03c0a 100644 (file)
@@ -13,6 +13,9 @@
 // ignore-openbsd system ulimit (Too many open files)
 // exec-env:RUST_LOG=debug
 
+#![feature(rustc_private, libc, old_io, io, std_misc)]
+#![allow(deprecated, unused_must_use)]
+
 #[macro_use]
 extern crate log;
 extern crate libc;
index bc655837babb9d74a35b9ee73576afacb4fa8106..74290518364d08b6776b1b84be23314c67f09cd5 100644 (file)
@@ -18,6 +18,8 @@
 // they're in a different location than before. Hence, these tests are all run
 // serially here.
 
+#![feature(old_io, old_path, os, old_fs)]
+
 use std::old_path::{Path, GenericPath};
 use std::old_io::fs::PathExtensions;
 use std::old_io::{fs, TempDir};
index bef9efa9eb68dc47b99cc01393ab056366732d59..b59d11d8674c7479c285aa10f56afa4ee24dc9a2 100644 (file)
@@ -12,6 +12,8 @@
 // Issue #787
 // Don't try to clean up uninitialized locals
 
+// pretty-expanded FIXME #23616
+
 use std::thread;
 
 fn test_break() { loop { let _x: Box<int> = break; } }
index df3c9a0f119ecb5a681b5a58b7d1765282126583..d58b5d3a00fece428918bcfd2e27a060021b8114 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(test)]
+
 // compile-flags: --test
 // no-pretty-expanded
 extern crate test;
index abc2938df00bb8b19bf3d35b9b57a8f53d3504ec..436fb1fe9b5d27c8d0a01d37af556a55f5361f75 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(std_misc)]
+
 use std::thread::Thread;
 
 pub fn main() {
index 76c62a83e758c4cdeea93c688da99ac12992f01f..79e0df0133b4410fce3f56f22e78901cfb42733d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(advanced_slice_patterns,)]
 
 fn f<T,>(_: T,) {}
index ed25bf8b02e88fd6852338287eab01bc53640638..50c9c43ba2b8ba892fb5d9348e02811cc9ee4af9 100644 (file)
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
 
 trait Foo : ::std::marker::MarkerTrait {
 }
index 5c913f7921d7d52323bf63eeccf8a552427965ca..7357c387511376ee15e7acb4f647c6d58c309a98 100644 (file)
@@ -12,6 +12,8 @@
 // trait exactly, as long as the implementation doesn't demand *more* bounds
 // than the trait.
 
+// pretty-expanded FIXME #23616
+
 trait A {
     fn foo<T: Eq + Ord>(&self);
 }
index cf23785b844482d226a02b63ee008f5042505076..d2782976463808c77c25cc696eee2cca7035e54a 100644 (file)
@@ -14,7 +14,7 @@
 // ignore-pretty
 
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, std_misc)]
 #![feature(unboxed_closures)]
 
 use std::sync::Arc;
index 976120908b27ab376ebbee497f13573a3b07bca0..60c1816b1632c2df873681e958595f964f9f23ff 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 trait U : ::std::marker::MarkerTrait {}
 trait T<X: U> { fn get(self) -> X; }
 
index 7135dad7d190c9d96950581753986c946157c04b..250390f70b448b29d9f8cecca1fbe4a002f9540f 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 trait I { fn i(&self) -> Self; }
 
 trait A<T:I> : ::std::marker::MarkerTrait {
index 7ec6ffbd46458f13dcdc05bb3928ba98bd21aeae..0db77ec2f79d0c1b17aa100e88af312788950f61 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait connection {
     fn read(&self) -> int;
 }
index a5efb32079de854d3514c79f327c479de99dd1e0..9cc2b2fadc60713b39d8e7a5c17346893cb467a9 100644 (file)
@@ -13,6 +13,8 @@
 //
 // See issue #18209.
 
+// pretty-expanded FIXME #23616
+
 pub trait Foo {
     fn load_from() -> Box<Self>;
     fn load() -> Box<Self> {
index d1af6b746ac421af95a2016adbf4714d226f61c8..6f2fc8ba79aea7e71e42133b15e607a18ed13b59 100644 (file)
@@ -8,7 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(box_syntax)]
+#![allow(unknown_features)]
+#![feature(box_syntax, old_io, io)]
 
 use std::io::{self, Write};
 
index de130bf1b41fe05116086754be6ac58f4e8b8533..4138413c5b552809d857fde6f91707e82c96ab94 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn foo(&self);
 }
index 5f0e149eb288d854f5c84de360529682741d3c33..e936989537e0f7146f2538cc5b456c619e255582 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 trait A<T> {
     fn g<U>(&self, x: T, y: U) -> (T, U) { (x, y) }
 }
index 1ea3879e7faf88e1f52a62205c5a0f1a2dd573b4..49ac66167cd8f038a896cf0f6f6e875b4cd057b5 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 trait A<T> {
     fn g(&self, x: T) -> T { x }
 }
index aff20ffe962a2323203a3e5e8f3867e6886960e2..abf135a668576f93b27516fe7ce8b99b10f66b16 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 trait A {
     fn g<T>(&self, x: T, y: T) -> (T, T) { (x, y) }
 }
index acaa74373f01f20f39c78a1f73791f11cc52a5fb..ba94fc4cd3601bc196b2568d07f4d46318c888c7 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 trait A<T> {
     fn g(&self, x: uint) -> uint { x }
     fn h(&self, x: T) { }
index 8a2f1b1743b09f779d843baa4f4341a7d5b65709..4f1127c0b09494be6c99fdcd0e196f5a19fdfc31 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 trait A {
     fn g(&self) -> int { 10 }
 }
index b28e8bd24aa2b3d78277b5772164a7ac2293b08e..b3e83f747a395b7260baf3fd3546196687ca369b 100644 (file)
@@ -12,6 +12,8 @@
 // aux-build:trait_default_method_xc_aux_2.rs
 
 
+// pretty-expanded FIXME #23616
+
 extern crate "trait_default_method_xc_aux" as aux;
 extern crate "trait_default_method_xc_aux_2" as aux2;
 use aux::A;
index 4745d057952aec524f2d7ee740b7fb20124f1846..eb2a75f62fb81f0c019db6f2927e8606febf454b 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:trait_default_method_xc_aux.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "trait_default_method_xc_aux" as aux;
 use aux::{A, TestEquality, Something};
 use aux::B;
index ca66a106c437efab2ddf15ede1018e7bcfc42907..b9ca8971d3893eca4d3f1de21723be67f172bd05 100644 (file)
@@ -12,6 +12,8 @@
 // between the builtin rules for Sized and the where clause. Issue
 // #20959.
 
+// pretty-expanded FIXME #23616
+
 fn foo<K>(x: Option<K>)
     where Option<K> : Sized
 {
index 0dedf621a4f2887f0f6205142239e505e9e638bf..2a5f9b80e9d82f006f084f4296b7e33c5a254f1b 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 trait to_str {
     fn to_string_(&self) -> String;
 }
index abc35bcc29d415b8655687ee8c7a9d548399fa74..c94b517f6a7d613fd93ee268a4b1fa1681fc33e5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub mod Foo {
     pub trait Trait {
         fn foo(&self);
index 325fba8a0ee4288fe1852189e716733692faa59f..0caa4c2d2d2b316812d2cc4523285bc02fd689aa 100644 (file)
@@ -11,6 +11,8 @@
 // Test calling methods on an impl for a bare trait.
 
 // aux-build:traitimpl.rs
+// pretty-expanded FIXME #23616
+
 extern crate traitimpl;
 use traitimpl::Bar;
 
index d45d7ebe90adc1a0374a5e3d831d63fd403e8533..9db1af230d5f2bb6931a7a03643a5cb4d13096fd 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:trait_inheritance_auto_xc_2_aux.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "trait_inheritance_auto_xc_2_aux" as aux;
 
 // aux defines impls of Foo, Bar and Baz for A
index f4e1908aaeed972609d13bd54df84f030ab20803..b58839931b0c5f47e1dee692e09d679331954f42 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:trait_inheritance_auto_xc_aux.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "trait_inheritance_auto_xc_aux" as aux;
 
 use aux::{Foo, Bar, Baz, Quux};
index c5a7720e3c34139d5ba85056649502897a7cbcf6..dfd541c6932d41bc194b4cd91986a11ccd176f50 100644 (file)
@@ -10,6 +10,8 @@
 
 // Testing that this impl turns A into a Quux, because
 // A is already a Foo Bar Baz
+// pretty-expanded FIXME #23616
+
 impl<T:Foo + Bar + Baz> Quux for T { }
 
 trait Foo { fn f(&self) -> int; }
index 46258902f9caef1781d459ab2f03d4fa34ce6593..c62941a517490fc4ce9b2a348da3dfca92950bb2 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo { fn f(&self) -> int; }
 trait Bar : Foo { fn g(&self) -> int; }
 
index 7b79ad42ed2b3cb2632ff78d57e4e7b52289f1ba..2ee3a2ec124ec829c009aee3cc789c667ceb64fb 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo { fn f(&self) -> int; }
 trait Bar : Foo { fn g(&self) -> int; }
 trait Baz : Bar { fn h(&self) -> int; }
index 68a31ba9dbe64b179f8385694e1b5af9fb91c45d..5afdc60b0e83ab6ea354ae869564c8271fa7be63 100644 (file)
@@ -11,6 +11,8 @@
 // Testing that we can cast to a subtrait and call subtrait
 // methods. Not testing supertrait methods
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn f(&self) -> int;
 }
index 51bc2751873faa566dc41c1b0f465248360a5574..84ffb395588dd9bceb9869053eb233662c111d4c 100644 (file)
@@ -10,6 +10,8 @@
 
 // Testing that supertrait methods can be called on subtrait object types
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn f(&self) -> int;
 }
index 3ee046e8bfe6cf434d54d7c1538c97036f4d4179..8de867eff9082dcdbfbfb201b7b29f5c80ff45f4 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:trait_inheritance_cross_trait_call_xc_aux.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "trait_inheritance_cross_trait_call_xc_aux" as aux;
 
 use aux::Foo;
index 7b047b5cc800a0c653caa21108d33dd40d0fe6c6..88645a36b6ee8da1e2120ff7da75d73bb7b4802a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo { fn f(&self) -> int; }
 trait Bar : Foo { fn g(&self) -> int; }
 
index 253c10ac6f1b037196c2d4980f20d9f3ed5123cc..69f97d8d6526dd89d34870156d77ffed20bf46ba 100644 (file)
@@ -10,6 +10,8 @@
 
 // B and C both require A, so D does as well, twice, but that's just fine
 
+// pretty-expanded FIXME #23616
+
 trait A { fn a(&self) -> int; }
 trait B: A { fn b(&self) -> int; }
 trait C: A { fn c(&self) -> int; }
index 6cd3d62473692cfe117c805c13c20b8f1f2751c6..47c8726c3e7f8f4b95544d8a01d297e6232bb993 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait A { fn a(&self) -> int; }
 trait B: A { fn b(&self) -> int; }
 trait C: A { fn c(&self) -> int; }
index b5524c6dda6cd2d667cd9ab45851b86082929973..da57d9a4e97c057f3d66190fa591d00b78163eb5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait A { fn a(&self) -> int; }
 trait B: A { fn b(&self) -> int; }
 trait C: A { fn c(&self) -> int; }
index 5fb28eb9d8dd2b5257d162c0210c62d5bf228232..4af049fc0c3af92b3892ae1ff7e7816fc0680146 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::cmp::{PartialEq, PartialOrd};
 use std::num::NumCast;
 
index 183d6659062fec7ec9531be880836dd08075d4c4..a4b0d5b88ca5a2959fbe0464f826117e3cf2ffda 100644 (file)
 
 // Extending Num and using inherited static methods
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::cmp::PartialOrd;
 use std::num::NumCast;
 
index 15fb5df46264ad098fd9709b9bb628866d2c8eb3..02ebf6bfa5375afd029f202c5adca1e65f400002 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::cmp::PartialOrd;
 use std::num::NumCast;
 
index 1fb28c50652b417d9856ea83fcf05a7da81fa435..df751a6d00461d69c401ada8c9aa9f3a1f169a8f 100644 (file)
@@ -10,6 +10,8 @@
 
 // A more complex example of numeric extensions
 
+#![feature(core)]
+
 use std::cmp::{PartialEq, PartialOrd};
 use std::num::NumCast;
 
index 09015d983ea7cca35b5690dd3d2d96ea25e7e31f..b5cf25bc5a8f4cd6664824a9fa7c191b2f4d273d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(core)]
+
 use std::cmp::{PartialEq, PartialOrd};
 use std::num::NumCast;
 
index a21026839a7c1b3e2113d6c2285bba8fa3adff60..cce9bd3c7146d5da8020ef19ac81d211994f5143 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::cmp::PartialEq;
 use std::num::NumCast;
 
index 2a087e5e425ad23d976baf8a98ab48f131ddde20..20d6817fcddf07973680633807f75adf50f3ef93 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:trait_inheritance_overloading_xc.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate trait_inheritance_overloading_xc;
 use trait_inheritance_overloading_xc::{MyNum, MyInt};
 
index 96f1c940dcf2cdabaf617be2e50683e08ae178e0..87a36ba7b90ccf9ff0978c753e8a6abdf6a847d6 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test for issue #4183: use of Self in supertraits.
 
+// pretty-expanded FIXME #23616
+
 use std::num::Float as StdFloat;
 
 pub static FUZZY_EPSILON: f64 = 0.1;
index 113efa663afaf760ec6032e62ecae9f63f925067..f06ae1104c08c873c1f6db1a76962fafadbd68e8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo { fn f(&self) -> int; }
 trait Bar : Foo { fn g(&self) -> int; }
 
index 611c3e006ec1937b6a35efe34be3729c55108b60..cd486754e7845a9af06d7e7fda4a2ce697578166 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub trait MyNum {
     fn from_int(int) -> Self;
 }
index 8f3b325a513fe2f739a0d28f9c7ffd433d6de06e..86bfe0aa5c84cd9cf685041f13674634d0ed04ec 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 pub trait MyEq : ::std::marker::MarkerTrait { }
 
 pub trait MyNum : ::std::marker::MarkerTrait {
index cd57e6a7dd05966caf8cf8cfccb07ef290bf2576..d7cddbe62ca5c8b060d7c0ab849d2e5a9abddc1d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub trait Add<RHS,Result> {
     fn add(&self, rhs: &RHS) -> Result;
 }
index ebddfafc3b4381ffb262011469684e4e206a0c5d..5949308a7ebc1393abdbd0b3e20864a1a51fec2f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Panda<T> {
     fn chomp(&self, bamboo: &T) -> T;
 }
index 3cdedd884a42c22d7689ba466b048538221390f6..225e0ee90eb4fb590e0cfce58771f1845c853fbd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 mod traits {
     pub trait Foo { fn f(&self) -> int; }
 
index 7fa895ddf988802b1896224c67f1448b1e119962..2885afd7bd622a8f308a307d6e36ea4621fb24cd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo { fn f(&self) -> int; }
 trait Bar { fn g(&self) -> int; }
 trait Baz { fn h(&self) -> int; }
index 18097b59b08e26e8c5b7abe2d1855d3abaaaee50..b528cbe271a4728c1aeafc1f8cd14c723d3248b5 100644 (file)
@@ -10,6 +10,8 @@
 
 // test for #8664
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 99910f1573887fef3f9c6031bfd424ba39554470..30a05ee1c562e3d1c36d50782d24dea1efbfa7bb 100644 (file)
@@ -11,6 +11,8 @@
 // Uncovered during work on new scoping rules for safe destructors
 // as an important use case to support properly.
 
+// pretty-expanded FIXME #23616
+
 pub struct E<'a> {
     pub f: &'a u8,
 }
index 99203d3e24acc7e569a1be3e7fdb99637cdfe7e2..11a58de45322a94e48b22a9a7d7dd6868f4ce482 100644 (file)
@@ -12,6 +12,8 @@
 
 // Simple smoke test that unsafe traits can be compiled across crates.
 
+// pretty-expanded FIXME #23616
+
 extern crate "trait-safety-lib" as lib;
 
 use lib::Foo;
index a24796a7d0c31025929372e3a6a20464835d7ec9..c5679627fc34267ff8bf85cf64f7935f19c8447f 100644 (file)
@@ -10,6 +10,8 @@
 
 // Simple smoke test that unsafe traits can be compiled etc.
 
+// pretty-expanded FIXME #23616
+
 unsafe trait Foo {
     fn foo(&self) -> int;
 }
index 772310d47335f0fcce37d795806cba825001a899..f3dcb51f97a291cc92118f40f9b9876e798ae4d9 100644 (file)
@@ -13,6 +13,8 @@
 //
 // Issue #18453.
 
+// pretty-expanded FIXME #23616
+
 use std::rc::Rc;
 
 pub trait Foo<M> {
index 6a4a6710131e384646fa9c7d1889f3425b226154..751cd504413625d4e5429263391ffd990a124249 100644 (file)
@@ -11,6 +11,8 @@
 // Test case where an associated type is referenced from within the
 // supertrait definition. Issue #20220.
 
+// pretty-expanded FIXME #23616
+
 use std::vec::IntoIter;
 
 pub trait Foo: Iterator<Item=<Self as Foo>::Key> {
index 650688dd9088fc9d8da4f90ff55c98233e0111d8..5edd3dfbc9ef5e1b474a1ad10a435668ed69a4c6 100644 (file)
@@ -12,6 +12,8 @@
 // blanket impl for T:Copy coexists with an impl for Box<T>, because
 // Box does not impl Copy.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 92ba5aad05958f7f142c11027d5bb63f92f76ac6..c9f003a022068c19268fd0cb28af776f016a8ac1 100644 (file)
@@ -14,6 +14,8 @@
 
 // aux-build:go_trait.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate go_trait;
 
 use go_trait::{Go, GoMut, GoOnce, go, go_mut, go_once};
index 245ae540ee89521db51c04918917a0bcf2f7e3ef..1ec58eac58bbd1dc8e14488fa3de1aaa4199e371 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn bar(&self) -> String {
         format!("test")
index a3a1076ecba52fcbc1fc338d01ac3444770d5e68..29b52ea5897c980e4c75bfb4c8d8434fa0a391a6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 #![allow(unused_variable)]
 
index 7e0f60d55a827acb3dbfff0b0e28408c1ce8b90f..2f3e0c64f6c117f899f61904ed27bb7d1e4ac2b3 100644 (file)
@@ -12,6 +12,8 @@
 // distinct scopes to be compared (`'g` and `'h`). The only important
 // thing is that compilation succeeds here.
 
+// pretty-expanded FIXME #23616
+
 #![allow(missing_copy_implementations)]
 #![allow(unused_variables)]
 
index 9cdcf4945d8ba6d52af24171c1bfb7ba26ff89f1..3da8c253978345f70aa3a1a781b20949f256f913 100644 (file)
@@ -12,6 +12,8 @@
 // and the blanket impl. The only important thing is that compilation
 // succeeds here. Issue #22110.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 trait Foo<A> {
index 18c7cfb0850ceace40ecdb59a275d76c3e9be5eb..ded17422c498d14c1288cace6997bd9fd5c9dc6d 100644 (file)
@@ -11,6 +11,8 @@
 // Regression test for issue #22655: This test should not lead to
 // infinite recursion.
 
+// pretty-expanded FIXME #23616
+
 unsafe impl<T: Send + ?Sized> Send for Unique<T> { }
 
 pub struct Unique<T:?Sized> {
index 37b13d319aaf7a78a80a01569cd54bacfca3badd..46cd22f22baa4b065c32acb2fa245eb497c51f6e 100644 (file)
@@ -13,6 +13,8 @@
 // Async>::Cancel` be WF. This normalizes to `Receipt<Complete>`
 // again, leading to an infinite cycle. Issue #23003.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 #![allow(unused_variables)]
 
index 532ef7cbec6f37b3e6c31af5924025f2c4591ac2..f81b753acbb9b21dfb160ac663359c02857772dc 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that we can infer the Target based on the Self or vice versa.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 trait Convert<Target> {
index fdaa8d6f4d6efdb2cf6b1ab6060f6e4eb556d12b..509a6e36afdec8271a8fad28e53410f056553887 100644 (file)
@@ -13,6 +13,8 @@
 // various methods in various ways successfully.
 // See also `compile-fail/trait-repeated-supertrait-ambig.rs`.
 
+// pretty-expanded FIXME #23616
+
 trait CompareTo<T> {
     fn same_as(&self, t: T) -> bool;
 }
index 6d0ae8f67cd4d9d291857da1830546f16fd6f7c7..3e2297f008f02b0e9ed175cf8af309c39b60e987 100644 (file)
@@ -21,6 +21,8 @@
 // Last 7 bytes of Request struct are not occupied by any fields.
 
 
+// pretty-expanded FIXME #23616
+
 enum TestOption<T> {
     TestNone,
     TestSome(T),
index 70a41f773a3e0a2c4cdd45ebfe12087525b6e630..d8314005082c7e0291ae2b25fc613e33736b542e 100644 (file)
@@ -11,6 +11,8 @@
 // Issue #7988
 // Transmuting non-immediate type to immediate type
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     unsafe {
         ::std::mem::transmute::<[int; 1],int>([1])
diff --git a/src/test/run-pass/trivial_casts.rs b/src/test/run-pass/trivial_casts.rs
new file mode 100644 (file)
index 0000000..3da1ba0
--- /dev/null
@@ -0,0 +1,71 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test that all coercions can actually be done using casts (modulo the lints).
+
+#![allow(trivial_casts, trivial_numeric_casts)]
+
+trait Foo {
+    fn foo(&self) {}
+}
+
+pub struct Bar;
+
+impl Foo for Bar {}
+
+pub fn main() {
+    // Numeric
+    let _ = 42_i32 as i32;
+    let _ = 42_u8 as u8;
+
+    // & to * pointers
+    let x: &u32 = &42;
+    let _ = x as *const u32;
+
+    let x: &mut u32 = &mut 42;
+    let _ = x as *mut u32;
+
+    // unsize array
+    let x: &[u32; 3] = &[42, 43, 44];
+    let _ = x as &[u32];
+    let _ = x as *const [u32];
+
+    let x: &mut [u32; 3] = &mut [42, 43, 44];
+    let _ = x as &mut [u32];
+    let _ = x as *mut [u32];
+
+    let x: Box<[u32; 3]> = Box::new([42, 43, 44]);
+    let _ = x as Box<[u32]>;
+
+    // unsize trait
+    let x: &Bar = &Bar;
+    let _ = x as &Foo;
+    let _ = x as *const Foo;
+
+    let x: &mut Bar = &mut Bar;
+    let _ = x as &mut Foo;
+    let _ = x as *mut Foo;
+
+    let x: Box<Bar> = Box::new(Bar);
+    let _ = x as Box<Foo>;
+
+    // functions
+    fn baz(_x: i32) {}
+    let _ = &baz as &Fn(i32);
+    let x = |_x: i32| {};
+    let _ = &x as &Fn(i32);
+}
+
+// subtyping
+pub fn test_subtyping<'a, 'b: 'a>(a: &'a Bar, b: &'b Bar) {
+    let _ = a as &'a Bar;
+    let _ = b as &'a Bar;
+    let _ = b as &'b Bar;
+}
index dd508d6e90ca0e2633cbfad1b8ade1d94c35ff0f..396d6911cf23565bfc8f75549829b8e29181711b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 type point = (int, int);
 
 fn f(p: point, x: int, y: int) {
index 924b861a911c82803bc7de58f2070f095616d12c..7d6f42c7ddcf5d57e23b78fc15be6b89223115cf 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo<'a>(&'a [int]);
 
 fn main() {
index abdf6172779307ab642c2e9bbc626eb804b62636..004e7e33d4e141aee57c6a9bef754ea78022bc45 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Point(int, int);
 
 fn main() {
index c22c812760c78e53ca2488275c98868f881de901..5b25dcbb347a70292c37d7663b96de69a93e59f8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct Foo(int, int, int);
 
 pub fn main() {
index 2e7717fcfe15463e2bce6f36b2570dfd184c95a2..cc97959e41a3d6b81e97605af7a8008f5a2b423a 100644 (file)
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
 
 use std::intrinsics::type_name;
 
index d33ebeadba86e7008e586df25ab1a99c366b3c96..5670c45b68ad00a2865149ed54f42cef3c20fd98 100644 (file)
@@ -11,7 +11,9 @@
 // Test that type IDs correctly account for higher-rank lifetimes
 // Also acts as a regression test for an ICE (issue #19791)
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 use std::any::TypeId;
 
index f0b7ee072ea5eecae00270f7ea3795b45068ff71..02b7fa50a2da82b9f040cf242189692ed27cde8e 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 mod a {
     pub mod b {
         pub type t = int;
index e9b0324456a2f951292fc29ba91fd9cabbd5b109..00b7b0c359b8875dbc8a0063dbe909e95ff15d0f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct A { a: int }
 
 fn a(a: A) -> int { return a.a; }
index 432dbd72a294887c30c2f8d3ac7820077a9aac06..5b8e78ba71ab67e6bf3906fce1f240474a74e616 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 209dade8d0c8d6819141185c1cf413e461dfd222..c59e40934fb4b2762ce69a1f734fa0ab1cfaff07 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 type lteq<T> = extern fn(T) -> bool;
 
 pub fn main() { }
index 5d80cec2a05fda51ce76b1d5fa18f4b8eaca1a23..3bfc61ddcbea54dd57766fff7d94f5a1b9a82c5e 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 struct S<T> {
     a: T,
     b: uint,
index 410e3df9e2ac9fa28321e0b0bd25b65e1c024665..3b97cbbaa9050deb5e7d4a228b5a1cbcb0fd03ca 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn f(a: *const int) -> *const int { return a; }
 
 fn g(a: *const int) -> *const int { let b = f(a); return b; }
index 961a4472bd4e7cae4ed0e1d77889f196b7ebe019..286a12100c45200d73120f625e82c3ae6a61f299 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem::size_of;
 
 struct t {a: u8, b: i8}
index 99c68ac8100c8df0206a98b3cbf841f656089d1e..6cef9c3be172db89268be5d97facab133fc97b52 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::ptr;
 
 pub fn main() {
index 673e852356266bafc5c35152453260d889201923..6a684fe9d8c68673f45fbf2a88c3a15df4dadfd6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum T {
     A(int),
     B(f64)
index c850c01753bd880cb8033e2eedfc91599b9c1cb9..53e78db68b19d485d7a4b81abc9fd4cfb0cd6c08 100644 (file)
 // This test checks that the `_` type placeholder works
 // correctly for enabling type inference.
 
+// pretty-expanded FIXME #23616
+
 struct TestStruct {
-    x: *const int
+    x: *const isize
 }
 
 unsafe impl Sync for TestStruct {}
 
-static CONSTEXPR: TestStruct = TestStruct{x: &413 as *const _};
+static CONSTEXPR: TestStruct = TestStruct{ x: &413 };
 
 
 pub fn main() {
     let x: Vec<_> = (0..5).collect();
-    let expected: &[uint] = &[0,1,2,3,4];
+    let expected: &[usize] = &[0,1,2,3,4];
     assert_eq!(x, expected);
 
     let x = (0..5).collect::<Vec<_>>();
@@ -31,8 +33,8 @@ pub fn main() {
     let y: _ = "hello";
     assert_eq!(y.len(), 5);
 
-    let ptr = &5;
+    let ptr: &usize = &5;
     let ptr2 = ptr as *const _;
 
-    assert_eq!(ptr as *const uint as uint, ptr2 as uint);
+    assert_eq!(ptr as *const usize as usize, ptr2 as usize);
 }
index a251fcc7327201b51e68ebaf16fdf90505f48d1b..9dfd25b4fc4e18adf167c51a3e1dad6db0bd3b92 100644 (file)
 // aux-build:typeid-intrinsic.rs
 // aux-build:typeid-intrinsic2.rs
 
+// pretty-expanded FIXME #23616
+
+#![feature(hash, core)]
+
 extern crate "typeid-intrinsic" as other1;
 extern crate "typeid-intrinsic2" as other2;
 
index 37d06bf4f830880c8ad9c87b276855f3ab772387..86184f6cf0f4370d06f4bc7cbf5394c30b1ef6da 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 #![allow(unused_variable)]
 
index 42910c47005811e95ad887cb2f4871534774db12..c7762a8464d6baac3d536c41a1f94c453c04ec3e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let (x, y) = (10, 20);
     let z = x + y;
index 027bd7ca6806fccf19392ff09deae365a38c3ec9..4955ac8a4be6339ff66bf1260463585c36b3ed42 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let mut word: u32 = 200000;
     word = word - 1;
index ff25d95d1fd211d0da4246e733377ef5e0650670..7c67d304edb681afecc1647dae51c0ade32552ca 100644 (file)
@@ -14,6 +14,8 @@
 
 // These constants were chosen because they aren't used anywhere
 // in the rest of the generated code so they're easily grep-able.
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let mut x: u8 = 19; // 0x13
 
index 7f69d0781345f17500c8f7e96fa5e8ee9da1bf7c..e15576c3fabce2da9d09c7feff0a2f3f1c442c32 100644 (file)
@@ -11,6 +11,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let mut x: u8 = 12;
     let y: u8 = 12;
index 29b1c8f81d3c610f5ecda098fbed2fa110eff5fb..a6ea0f76dc2f9f63b05accb78619da76cd7e677b 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(macro_rules)]
+// pretty-expanded FIXME #23616
+
+#![feature(collections, rand, into_cow)]
 
 use std::borrow::{Cow, IntoCow};
 use std::collections::BitVec;
index 34cf44bba2efbf55508ea919425817d966f92fa8..b242018458dfc073214c208480e15fe6ee3a3120 100644 (file)
@@ -11,6 +11,8 @@
 // Test that when you use ufcs form to invoke a trait method (on a
 // trait object) everything works fine.
 
+// pretty-expanded FIXME #23616
+
 trait Foo {
     fn test(&self) -> i32;
 }
index ccd5a225222da2e29bcbde97da17aa5cba88b76a..d72fde1a3332fb904d3692b6567eff565cb87502 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo<T> {
     fn get(&self) -> T;
 }
index 876e37c5351c15bec8c573d7b518fcd0ef133c90..79ca103a29449748eefb4d5156508eab0f5eede8 100644 (file)
@@ -11,4 +11,6 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() { let _x: uint = 10 as uint; }
index b4b0d2b014852337bc2ca3e40f5c528314081d94..b98f5549b012b62cab35193937a2362ac6628d56 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(lang_items, unboxed_closures)]
 
 fn a<F:Fn(int, int) -> int>(f: F) -> int {
index 178865897e5a9c9e940eea13f5c17481879a8310..7855cf6ba0c2a1e1ded5373f90a46c10fb78248c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 // Test by-ref capture of environment in unboxed closure types
index 0303954ce2a96733e122810f1fd5e872d630b9f9..7eb5e988424fc34ad66d0807a511df3857c3d0de 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that the call operator autoderefs when calling a bounded type parameter.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 use std::ops::FnMut;
index 305f496e668a8a97a7ea2b302651e10d5aba326b..6e8253d49ea09f15f81954f6ee3de32b32615da7 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that the call operator autoderefs when calling a bounded type parameter.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 use std::ops::FnMut;
index 0b85916d224108922dc2b3bd735cf5464def66ce..792d17227766e34b6cb32729d11f0f7fe3354393 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test that we mutate a counter on the stack only when we expect to.
 
+// pretty-expanded FIXME #23616
+
 fn call<F>(f: F) where F : FnOnce() {
     f();
 }
index 96d75592627bec6e41e67f1a66dbd91a6cb36840..31a901756717e20657e779a3de4eb23d392bf16d 100644 (file)
@@ -12,6 +12,8 @@
 // Acts as a regression test for #16790, #18378 and #18543
 
 // aux-build:unboxed-closures-cross-crate.rs
+// pretty-expanded FIXME #23616
+
 extern crate "unboxed-closures-cross-crate" as ubcc;
 
 fn main() {
index 6b2dcfa69b4efa7f40d85b4ebffd0bee5ce96e36..c91aa6ed0d923e0523ec19a67cdb860fd538cebb 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 fn main() {
index e61d454023f5af09b388361314eadc9fd7afa0a5..156934f909d9d6e44dd9b415ba4e3c6af1162e11 100644 (file)
@@ -11,6 +11,8 @@
 // A battery of tests to ensure destructors of unboxed closure environments
 // run at the right times.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 static mut DROP_COUNT: uint = 0;
index 6a071f6a4c51f2754c5056c4feccb2f60ba787e5..83fe32f9ca3a5be466e62d940b437d3032663e4b 100644 (file)
@@ -10,7 +10,9 @@
 
 // Checks that higher-ranked extern fn pointers implement the full range of Fn traits.
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 use std::ops::{Fn,FnMut,FnOnce};
 
index ed941ac0fdb996601754e3278c0347c35f53920f..570627374b747f899f4e6a1ce1175359d6dba03b 100644 (file)
@@ -10,6 +10,8 @@
 
 // Checks that extern fn pointers implement the full range of Fn traits.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 #![feature(unboxed_closures)]
 
index 0aab5be2877e10d830f4f390b60af44c89abd99d..9b71abf3653318c21fbc558cdb07822bba9845a5 100644 (file)
 // Checks that the Fn trait hierarchy rules permit
 // any Fn trait to be used where Fn is implemented.
 
-#![feature(unboxed_closures)]
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 use std::ops::{Fn,FnMut,FnOnce};
 
 struct S;
 
 impl Fn<(i32,)> for S {
-    type Output = i32;
     extern "rust-call" fn call(&self, (x,): (i32,)) -> i32 {
         x * x
     }
 }
 
+impl FnMut<(i32,)> for S {
+    extern "rust-call" fn call_mut(&mut self, args: (i32,)) -> i32 { self.call(args) }
+}
+
+impl FnOnce<(i32,)> for S {
+    type Output = i32;
+    extern "rust-call" fn call_once(self, args: (i32,)) -> i32 { self.call(args) }
+}
+
 fn call_it<F:Fn(i32)->i32>(f: &F, x: i32) -> i32 {
     f(x)
 }
index a8bb0918932713443af01031716867283f30dd2a..6261058b86742a2f9d4edc91597ab03ef65e2638 100644 (file)
 // Checks that the Fn trait hierarchy rules permit
 // FnMut or FnOnce to be used where FnMut is implemented.
 
-#![feature(unboxed_closures)]
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 use std::ops::{FnMut,FnOnce};
 
 struct S;
 
 impl FnMut<(i32,)> for S {
-    type Output = i32;
-
     extern "rust-call" fn call_mut(&mut self, (x,): (i32,)) -> i32 {
         x * x
     }
 }
 
+impl FnOnce<(i32,)> for S {
+    type Output = i32;
+
+    extern "rust-call" fn call_once(mut self, args: (i32,)) -> i32 { self.call_mut(args) }
+}
+
 fn call_it_mut<F:FnMut(i32)->i32>(f: &mut F, x: i32) -> i32 {
     f(x)
 }
index 56de15961101f063f9da4785c6e6eb1c0086a919..790272c257ccba77131257ce4c7bb180a67a1ad7 100644 (file)
@@ -11,7 +11,9 @@
 // Test that we are able to infer that the type of `x` is `int` based
 // on the expected type from the object.
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 use std::num::ToPrimitive;
 
index c74ed665e7a071d9d70f6c98c306a5e44538245b..8f4e4f353f34188ce125e60fce940f1e47cb6926 100644 (file)
@@ -11,7 +11,9 @@
 // Test that we are able to infer that the type of `x` is `int` based
 // on the expected type from the object.
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 use std::num::ToPrimitive;
 
index a61dd095a0d4da2e6792afcc1bfeef3bb8637e8a..1b8c9af8d4e09651b3f7a73998b5d5334f485061 100644 (file)
@@ -11,7 +11,9 @@
 // Test that we are able to infer that the type of `x` is `int` based
 // on the expected type from the object.
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 use std::num::ToPrimitive;
 
index 17833033492d09b064c233da18a6649c8e0d9912..798959f69d6879c83a6c2e7ec9ad921514bcf204 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we are able to infer a suitable kind for this closure
 // that is just called (`FnMut`).
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let mut counter = 0;
 
index 794527249bffaaf55d9da303bbd046c70de181e9..5b1e35a3e5c724f67d4b510636871f1f45aaf28f 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we are able to infer a suitable kind for this `move`
 // closure that is just called (`FnMut`).
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let mut counter = 0;
 
index 67f36b9a9203cfa0fe04b69df050ef7eb7665151..cd7f26bba2676813e325a314024a8bc0a2377b35 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we are able to infer a suitable kind for this closure
 // that is just called (`FnMut`).
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let mut counter = 0;
 
index 9f8fc80819bfd39331be9016d3de78e9ad4264ab..dc106614b53dd890b3963a4381da6a5ebbac31c1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 
 // Test that we are able to infer a suitable kind for this `move`
index f0f10139c5b86fa3d4570789098fd1c4d5c58b9e..036b32a44d2557f30e88b524389403cb9efd1d9b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 
 // Test that we are able to infer a suitable kind for this closure
index 36c8400be7879dc1291fe1fdbea45a435555e8e5..edc01d91f58fc2e110cbc7d5e4b7ffddbdf330c8 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we can infer the "kind" of an unboxed closure based on
 // the expected type.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 // Test by-ref capture of environment in unboxed closure types
index 2d1ba7f39b27bbd8115525bf99c077c64d635279..e02784f917a97e71ca134242bfd9013ac55f188c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(core,unboxed_closures)]
 
 use std::marker::PhantomData;
@@ -30,13 +32,20 @@ fn new(f: F) -> YCombinator<F,A,R> {
 }
 
 impl<A,R,F : Fn(&Fn(A) -> R, A) -> R> Fn<(A,)> for YCombinator<F,A,R> {
-    type Output = R;
-
     extern "rust-call" fn call(&self, (arg,): (A,)) -> R {
         (self.func)(self, arg)
     }
 }
 
+impl<A,R,F : Fn(&Fn(A) -> R, A) -> R> FnMut<(A,)> for YCombinator<F,A,R> {
+    extern "rust-call" fn call_mut(&mut self, args: (A,)) -> R { self.call(args) }
+}
+
+impl<A,R,F : Fn(&Fn(A) -> R, A) -> R> FnOnce<(A,)> for YCombinator<F,A,R> {
+    type Output = R;
+    extern "rust-call" fn call_once(self, args: (A,)) -> R { self.call(args) }
+}
+
 fn main() {
     let factorial = |recur: &Fn(u32) -> u32, arg: u32| -> u32 {
         if arg == 0 {1} else {arg * recur(arg-1)}
index 1401fe7470b0a1d71f0772e2d9217414625cdbde..e29632b007b3fdc188bd4201efb181e148995236 100644 (file)
@@ -11,6 +11,8 @@
 // Test that the type variable in the type(`Vec<_>`) of a closed over
 // variable does not interfere with type inference.
 
+// pretty-expanded FIXME #23616
+
 fn f<F: FnMut()>(mut f: F) {
     f();
 }
index f1b79a1829eab12758dce80e2bf8399e9bfabccd..38f15d6e4499b30c7f970eb83ebb482bbf025b45 100644 (file)
@@ -8,20 +8,26 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(unboxed_closures)]
+// pretty-expanded FIXME #23616
+
+#![feature(unboxed_closures, core)]
 
 use std::ops::FnMut;
 
 struct S;
 
 impl FnMut<(i32,)> for S {
-    type Output = i32;
-
     extern "rust-call" fn call_mut(&mut self, (x,): (i32,)) -> i32 {
         x * x
     }
 }
 
+impl FnOnce<(i32,)> for S {
+    type Output = i32;
+
+    extern "rust-call" fn call_once(mut self, args: (i32,)) -> i32 { self.call_mut(args) }
+}
+
 fn call_it<F:FnMut(i32)->i32>(mut f: F, x: i32) -> i32 {
     f(x) + 3
 }
index 056ae63b68488d5773ea9fb23d7a484744790367..e221811948c3b85cf26baebc5227ba45a0b1cce6 100644 (file)
@@ -13,7 +13,7 @@
 
 #![allow(unknown_features)]
 #![feature(box_syntax)]
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, core)]
 
 fn main(){
     fn bar<'a, T:Clone+'a> (t: T) -> Box<FnMut()->T + 'a> {
index 069e93b86baaa7352b00d456dfae9f6438b63027..88baa16c9457f4614eea28770592d418d2657710 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 #![deny(unused_mut)]
 
index 99663646254e73969c9a22bfeabbb40d26749540..b69153b73a3693bbc83a481a3fe9497b587f34bd 100644 (file)
@@ -11,6 +11,8 @@
 // Test that in a by-ref once closure we move some variables even as
 // we capture others by mutable reference.
 
+// pretty-expanded FIXME #23616
+
 fn call<F>(f: F) where F : FnOnce() {
     f();
 }
index 4ed3fa5ca2daca665ae86829e3ff369e956740e7..e8c977b4ed1d78a13d3260599cad3c13311abd42 100644 (file)
 
 // Tests that the reexports of `FnOnce` et al from the prelude work.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
-#![feature(unboxed_closures)]
+#![feature(unboxed_closures, core)]
 
 fn main() {
     // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
index 9f29e75be7ccaec301935a0a4b14b38188291fec..9335bc936d94287733648d7cade5d7600d67ac4f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 use std::ops::FnMut;
index 84544d6d24b35f33c0f83246b350d50277211c93..1517698fc82dce979dff06011d4b1e810c70521a 100644 (file)
@@ -11,6 +11,8 @@
 // Ensures that single-word environments work right in unboxed closures.
 // These take a different path in codegen.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 fn a<F:Fn(int, int) -> int>(f: F) -> int {
index 1f5481ccde955af392d2904d10904193e896c512..e90a3443610cb302addd834e1597a47d7dcd1209 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 fn main() {
index fff841a2f052d6511b77e04b1364ab609b1e72d6..77beeb13fb0295696126410de8c71aad2db7b41b 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test unboxed closure sugar used in object types.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 #![feature(unboxed_closures)]
 
index ce05f077357f87c78ca53f593a7c262db297f012..e827833bbb2108232cd5270690e756d36db5e3de 100644 (file)
@@ -19,6 +19,8 @@
 //
 // compile-flags: -g
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 use std::ptr;
index c81b0515aec6bce76ea41cd4991ca224d81c9766..cb3a18a18c13a0480d74df161e5bb81bb449c7c1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 fn main() {
index 2af38047264fcf72f06ef428f3150d41f6ff8901..a0c2b6c0a220245770b0486f84050eddc04659fa 100644 (file)
 
 // no-pretty-expanded FIXME #15189
 
+// pretty-expanded FIXME #23616
+
+#![feature(core)]
+
 use std::iter::Unfold;
 
 // Unfold had a bug with 'a that mean it didn't work
index 1a65f685a5e82cb803c1a3a53a2195a8511ba955..b8184b62db1e372f1bfcf78a448209bb2d19696f 100644 (file)
@@ -12,6 +12,8 @@
 // unified with the type *T, and so the type variable
 // in that type gets resolved.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 fn null<T>() -> *const T {
index a0cf984cbb901512bcc763c03ea52f2ff7d86fca..8c69704b3bd19441bb3c239fa0d5796a213e1b3a 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test the uninit() construct returning various empty types.
 
+// pretty-expanded FIXME #23616
+
 use std::mem;
 
 #[derive(Clone)]
index d44a8cdcc24756ec1968e787bdb5270c6c9940fd..49f552edd83922e14cb02e529ae142bdf4444abc 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 78578bdb3c3a1159d8badf59cea88674fe9f5ba1..32a0713ca9397368d8853307f839a22e6d53abbf 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 9edd83d2c7cb96a4ed107a70cf9ccf181d4a85da..715fa548a7d767541d30206d1629e05bf99c5fa5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_assignment)]
 #![allow(unknown_features)]
 #![feature(box_syntax)]
index 64f8b998096ed6e76a8e62fdd84eca1a5ccf03d0..ca145479a381f939179f64c3fc3f6498176c41f5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index c9cbaf27c4f2ff73d0d0edd3a32ce41da3d3f31b..e4e7b69671b8205ab1611fab3a77b13c15fb591b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 3bab3a6b79a116b0d7f8b950fe7454a1cedc8c82..290adcfb0149df3198adca7af51a90afcc9e8d5c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 1c94447392160ce0226f5fde8364eed03241ce18..9dc98cf2e3c47db7245a73612809b84c017e5fbe 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 8fe86455b4525785601685136f34b1d7b838131c..be7e46c8699d7c0c32a3332a9e836278f363862a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index cb6e84ae1aa7387b052dc45a76bbb86854298ef7..21433d6c39bfc5bb18ae958039e9fe2d98c5026f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 7264b9fee9524d672ba809b9bc1ae003091fe114..8469ae702009a72b95cfc6343f75a17029543a59 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 14bb72f4412bed49871b612cb5a0605b049d0f28..0840f1308cc1f530084eb7ed4e709d297a8dd364 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 803e7ba16ed4003aaeadc0f692cb8e809a81a579..1d5a44f45abbaa0ea4dbcbb2a688cb566708fa32 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 360adaa638f96fcbcd9c5bec045948da8dfda016..203a30e76bc1a5f00b484fedef56c6f4965926bd 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index a902fef288f002dff362435962264d8573ae728e..6c8177e6cd8b3a0c00f2d0e4d56129044b45632c 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let _: Box<int>;
 }
index 1c1228f924145090952bc7958017b50612cc777d..44681742a7041129d22a919442d9fdc41e2bcc51 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 9e71e850b3d4f69eefeb73d562a79d6ecb73e543..92fa8d7af66563301faa28e2566d2019bd0ea53c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
index 745a55e06510facf894e3764eb21c3ed045bb6fb..056acd162082b795468cda8e7abf3b54eae8222f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 1b3f7e72a4d61eb9e699e70b8a424d919bac2c0a..c79dc6a6cfdb3978d9da119cabf8c57fb7a8f15f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index e1d148cc9a555359d912a7777da1f124f2f21df3..82d724831c335d3d6a669f19ff40026230f86811 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 301994a74a85a6c5ca519227e86da6648f411fc8..a4687cae65360997a3c8bc813559db0caf5711c5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index de2c265089bedfc1d2fdd1e36d9697bd0cbd9592..5e248ebeb3328f77c758437b1fafdb7adeb47f6e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 58470637a11e56bfdd828fd60cd06caaa234a331..2da3b9f05f68e1a17e84fb198a15762d8f73357a 100644 (file)
@@ -11,6 +11,8 @@
 // Issue #976
 
 
+// pretty-expanded FIXME #23616
+
 fn f<T>(x: Box<T>) {
     let _x2 = x;
 }
index 20bf4bef1714dae413a5f886f154cab440456fe8..129c0784cca5e85cbb16bdf3876d82a1e5f3afda 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index c24ec8fe44a3c396c9c2ad99128d0b098b949fa2..dc94fa6ca4fce89cacfe0903be68c4be64ab50b5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 44e8703aaf2febcf6f662c84c43a7721b4c2ee05..bd7a64952604cf90b9316d5518b50c0d674320ee 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 6bb1fdcf5627a5b72a20644832bff3bc7171a848..96d54193ac86d1eca0f42e3d821fd3f5bfe8ec27 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 93614e86c7303fb0cebe3aa5ddf3352126599a97..1b0392341e72d9ab40e85fb63d4fc88366896c32 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #961
 
+// pretty-expanded FIXME #23616
+
 fn altsimple() {
     match Box::new(true) {
       _ => { }
index 126cc646833a14b83bb938680b83ee1341096da3..e81095d548e07daa834a49c99ae174b7840b2238 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_variable)]
 #![allow(unknown_features)]
 #![feature(box_syntax)]
index 9ac5e86f87b54af426e54b9182a065020a2e9d13..634a1569acffdb8cfc8e1ec629c86ae9128781c9 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index a54b343f2fa3d21862d88f6b412bdc9ea358fe6d..29bf113926572b572f38a2d910f56dc7b201cb84 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index ca01c07ab80431e73f6dabfe2866e71a16eab114..106481e3189eed750dd8b724a60c4359b398ff9e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index f01a56142e0730184635b00609050db1ce8333c6..0677e6a8df3ca796d9ccfd761f07ecb09b139f12 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #5192
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 8141e3bce3c2482003c6fd71536ca4c0ddb2acae..9063f15e7e73ec7de9392a24978a1a9686ed0aeb 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
index bff2d4e917faee1211040a869f3eb158bb84392d..ae76179b5ec2243b79ba7ddcaacf8d0a6c32366f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
index c20604406b94c823769c184dbb1287848f003279..6770fa5fb16ecd4342d162ce29ebf7b80bcb330d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index e0785779ab3c29667665c77b94aac8c7b21cc6db..1fb39ee8ca7021a6ccc6373efd8b47e38ce07a3c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 72022afe5fd99a489415f631fd9a1ea35e3ac0ce..c9649ef60d303145e7109db52d2da68e6c5da40e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 1315e443816228c61613df4cf6a0eace2977d742..454011a9ec31e8f8c5f1960d5cac9960f00ec35e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 66cc8d658c0a63ac3acdffb8816f39480c4614d8..9e1ced364024f3487799f5f75f1702684c179ed4 100644 (file)
 
 // Make sure the destructor is run for unit-like structs.
 
+// pretty-expanded FIXME #23616
+
+#![feature(alloc)]
+
 use std::boxed::BoxAny;
 use std::thread;
 
index 3b52dcce4bf61207840c02395c8484d7e5197c1c..2679c4c033121111574ef566c4cecea176ef5558 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_variable)]
 #![allow(dead_assignment)]
 
index d22a6652e16f3d29333ae449a4dca4b29a474737..64a6d40f2c8de19de5c8d4631d195d6da61d2494 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn good(_a: &int) {
 }
 
index d8a8913e58ad9b1bc8fdcd5cd34893940db3fa23..612beabb03586d74f3ad94f122862016993fc179 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unreachable_code)]
 #![allow(unused_variable)]
 
index a28dc2c1f1599669a465843b290c8913dcea3387..4f58df66256be5d0ca2979fb86cccc1dd30f60c1 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(path_statement)]
 #![allow(unreachable_code)]
 #![allow(unused_variable)]
index 06980e162c83b0a75eef36fa7d7ef651c37de764..d0c633e8278ea40bd646167ff4c1751bf9ea89d7 100644 (file)
@@ -10,6 +10,8 @@
 
 // Check that safe fns are not a subtype of unsafe fns.
 
+// pretty-expanded FIXME #23616
+
 fn foo(x: i32) -> i32 {
     x * 22
 }
index 4ce3f2c53b3e0c7e6a646c50afb5ec92f66dea17..f3a2ad749a16824c1f0cff7c0c4f20d4f110f8b9 100644 (file)
@@ -11,6 +11,8 @@
 //
 // See also: compile-fail/unsafe-fn-called-from-safe.rs
 
+// pretty-expanded FIXME #23616
+
 unsafe fn f() { return; }
 
 fn g() {
index e68b868a246940e0222c84da8200db98e6589d96..37c72ba8ab06565bb5cc9173a6fd823c0905a992 100644 (file)
@@ -11,6 +11,8 @@
 //
 // See also: compile-fail/unsafe-fn-called-from-safe.rs
 
+// pretty-expanded FIXME #23616
+
 unsafe fn f() { return; }
 
 unsafe fn g() {
index 7a624109a5507a72defdb859f0f53699737829a3..171f4cb8a891a0139ce0560e88041b4b4ee08706 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn f(x: *const int) {
     unsafe {
         assert_eq!(*x, 3);
index 1a479d05d50936ff52b8902d2bbdef06f7866528..8ff8169ef497cb89ae4320240f1778cae5919996 100644 (file)
@@ -10,6 +10,8 @@
 
 // Test syntax checks for `?Sized` syntax.
 
+// pretty-expanded FIXME #23616
+
 use std::marker::{PhantomData, PhantomFn};
 
 trait T1 : PhantomFn<Self> { }
index e0d37ff40de59b4b62b475f31a1eefd9e61a6af5..9eee782a630cae5ee452478a600175dbd56e6b62 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index f9185cd2642eeb3e344d83afc147fdc6fe8ee02e..8db294bdcc1c055df7632cd63e5f23952d80a24a 100644 (file)
 
 // Test structs with always-unsized fields.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
-#![feature(box_syntax)]
+#![feature(box_syntax, core)]
 
 use std::mem;
 use std::raw;
index 9f20426aa218ecbb1ddb4e62558d6201a87e0198..b155620e5196ce4d58af4f6080137abe868ae497 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 57534feec31214ac1377fae6bc1ad209cd19bd35..015b6f80946f837e2925783054574271058b6bf8 100644 (file)
@@ -12,6 +12,8 @@
 // Issue Name: Unused move causes a crash
 // Abstract: zero-fill to block after drop
 
+// pretty-expanded FIXME #23616
+
 #![allow(path_statement)]
 #![allow(unknown_features)]
 #![feature(box_syntax)]
index b7229a00480cb0c112e73b150090b3197fed1eec..1d6ce626c28c542641b08273916af7ad847ee73c 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index 4751b4666f1d59e2e7aeb3062c82730a5df464e6..2821de6f1e75183ed177090c05aa3ae4f7c2080c 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // Issue #1706
+// pretty-expanded FIXME #23616
+
 extern crate "std" as stdlib;
 
 pub fn main() {}
index ec8033ff3b04e193343b755d92609c22a36e2e4a..2106da6d25f92d399c97ab8d56adf9093e155289 100644 (file)
@@ -10,6 +10,8 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 mod foo {
     pub fn x() -> int { return 1; }
 }
index cca9c8f2df422cbb6b78f76eb2b01793a7491517..49ad171eaa2b6ff699cbebb22f91ff5441ff53a0 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub use foo::bar::{self, First};
 use self::bar::Second;
 
index 0b59ced98c908f4362a58c25e667aafc52e04da1..5f44b5723610dcb3f34ccf34d6986fe90538b431 100644 (file)
@@ -10,6 +10,8 @@
 
 // Issue #1761
 
+// pretty-expanded FIXME #23616
+
 impl foo for int { fn foo(&self) -> int { 10 } }
 trait foo { fn foo(&self) -> int; }
 pub fn main() {}
index c25cd15b2cd4b45bbe623c0b3fccf15e7fd3b8b8..446bb4a148e9e7ce2ef46ba205b63e765d4b7e0a 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unused_imports)]
 #![feature(start, no_std)]
 #![no_std]
index 18cb478be38fdba0f88471734e23b659a5d935ae..0f55a357a00f48c791e8865028c42a3e862463f7 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:inline_dtor.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate inline_dtor;
 
 pub fn main() {
index c54b3b69c688053d8a22cbb1b52b9ca29f35ae69..45a3f2327aaa6b559f4e2c71c438658497028c1a 100644 (file)
@@ -10,6 +10,8 @@
 //
 // ignore-lexer-test FIXME #15679
 
+#![feature(collections, core, str_char)]
+
 use std::str;
 
 pub fn main() {
index 60d617822cd7fd1ee6207b33df1e2b0aaf1d398e..1688482ca37606b1ace3552e43312cf91ffb69fe 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc, std_misc)]
+
 extern crate libc;
 
 use std::ffi::{self, CString};
index 948d68e0ccd7d7d84c402166413f4aa1c5ed8129..e21ea025d8ff4390ec900137eb4473bac862d7e6 100644 (file)
 // us from approximating the lifetimes of `field1` and `field2` to a
 // common intersection.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
+#![feature(core)]
 
 struct List<'l> {
     field1: &'l i32,
index d46ffa801836f1e3457b3fabfed536355e4c319f..5a179bfc7d47f8b28c1384e822df68b2a660433d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
 
 // Get<T> is covariant in T
index caec6df5a4d81a56c5c16da8999f8a11786209e4..2f554c3c4f3f5f9854ba7ce2d9c22fafe4482d39 100644 (file)
 
 // Test that vec is now covariant in its argument type.
 
+// pretty-expanded FIXME #23616
+
 #![allow(dead_code)]
+#![feature(core)]
 
 fn foo<'a,'b>(v1: Vec<&'a i32>, v2: Vec<&'b i32>) -> i32 {
     bar(v1, v2).cloned().unwrap_or(0) // only type checks if we can intersect 'a and 'b
index 16dca2db396e7f716d3f13ef35fa5baf1c7eca92..18987d1e016b1fa6a1a7f9d9212d34bf952447a6 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // pp-exact - Make sure we actually print the attributes
+// pretty-expanded FIXME #23616
+
 #![feature(custom_attribute)]
 
 enum crew_of_enterprise_d {
index e078fa1485d14978fac563396a35283ea35ee889..34c9fb5038a58339cfbec83a744535a54fe5723d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 enum Foo {
     Bar { x: int },
     Baz { y: int }
index 64c4c17386b3253341153b4fff7a0312105d8435..870d48213c74c703d29e066505818d968f224c15 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(collections)]
+
 use std::vec;
 
 pub fn main() {
index 40073c2b742197834e58828d75efab50f125ab63..23b1ff7417e40ab230bee95e67874a6452af0094 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index a0b3564d84e17f3d58373be729f334fd503939b6..bd196aa4e4e66781066f8f7709f9eed39418358d 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::mem::size_of;
 
 pub fn main() {
index b8626b9c8a9d6655820018c0c5c34d2f25a4772a..d5e6a9c4245155bc53eb27fd3d264bb7e288adda 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let mut v = vec!(1);
     v.push(2);
index 47b87fce2abaf7b6d0669241a75ad48902178a73..360cecb9e6a8ac5f0e383061b08eaffe3acaf687 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(lang_items, start, no_std)]
+// pretty-expanded FIXME #23616
+
+#![feature(lang_items, start, no_std, core, libc, collections)]
 #![no_std]
 
 extern crate "std" as other;
index 76e7b92ea046b1ae957db05dae51bd9a77c42bdf..2a83ccaba82e29f5e261f4b5edfad802fcbf2a06 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     assert_eq!(vec![1; 3], vec![1, 1, 1]);
     assert_eq!(vec![1; 2], vec![1, 1]);
index 68dedfc6a2e63084faf3f7a8f50935268901fc1e..5869558eacaffb2d88e06399457f1556733cba27 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn one() -> i32 { 1 }
 
 // Make sure the vec![...] macro doesn't introduce hidden rvalue
index 5d1f43fb230ed52ce67c17fbe755fd3863863f21..cccf807572a4246c61d22b7e4b25d4a44c725c9b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 macro_rules! vec [
     ($($e:expr),*) => ({
         let mut _temp = ::std::vec::Vec::new();
index 07033d60497477c51630ba9f1ca231ae991cae53..3018a746b4a9db46c9ce44d83678f022f366184c 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     assert_eq!(vec!(1), vec!(1,));
     assert_eq!(vec!(1, 2, 3), vec!(1, 2, 3,));
index 4ed73dc230181260345c97ab004902244f7955c5..8f38123fe2852b94119cf016ac79e6b25f118229 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let x = [1, 2, 3];
     match x {
index 6ef1dc4ea26349a440d725c7258fb7b8b43ed0e1..b03a9a64b21be21a0396e8666bf9ade8428eb307 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(advanced_slice_patterns)]
 
 fn a() {
index e72170cb7303c2c4294545242d5c8de60620a231..494a9d658a1d71d7bf307aa17126596d328d8992 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(advanced_slice_patterns)]
 
 fn foldl<T, U, F>(values: &[T],
index 8dcf4612f47eb58403ea1638ff672a59c02ecb50..306d200319dc2896532af8f3a2a15d28bd35ed96 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(advanced_slice_patterns)]
 
 fn a() {
index 33f01c5bd41c8b3bf37bd3645c3b5bcfa78c97b5..b69bd53cb8c4d739ce13d37ae15ed83fa622d9a1 100644 (file)
@@ -8,4 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() { let mut v = vec!(1, 2, 3); v.push(1); }
index 22ca6c37a8e6ca9c85d550827898655534e072ac..11a96ca533f3c8b8b56f966576534f4bfb527fd0 100644 (file)
@@ -8,4 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() { let _a = [0; 1 as uint]; }
index 498ec0e8fbaf1ae8974bea837a057c763bd8ae43..25dc5db5a6071f6ca1d64eb034d598410650d8d3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_destructor)]
 
 use std::cell::Cell;
index 5375e54e27f262bd5c1664fa1d966a37bb24613c..6baeb99df9e8cebfdbb79732e8090ecdb27bdc67 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let  v = vec![1,2,3,4,5];
     let v2 = &v[1..3];
index 401d629c3821b1e5aa66659d782c614a823c5702..3ee0cf33e432c6ed48c72107dcbdcb20f2ee91c2 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 struct Foo {
     string: String
 }
index 5d132b2a7491f5accbda5b34bb0c9577405052d0..d34c6bd4d0b59a149ddd6f25e1e1faabd2328e8e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     assert_eq!(format!("{:?}", vec!(0, 1)), "[0, 1]".to_string());
 
index 5e19868de1ddde2f933eca2c3b1f9209e34a63b4..ff4077b249de7aebb67851798a335ee226d8ca7c 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let v: Vec<int> = vec!(10, 20);
     assert_eq!(v[0], 10);
index 6391893b9a4845c09475c4608965466935163ec4..eb5b75639d59640bd76cb0d4830d46937ca52471 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
index a6f4b8299cb6898284ffa9e784b610173aad9cb7..09ecdf45b939e3d4636a0f2eb6191f633c449381 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(rand, core)]
+
 use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
 use std::rand::{thread_rng, Rng, Rand};
 use std::thread;
index 3060c12d39aa6dad0541601d5c75b9caa5521ca8..4aa0867ae478e4edd314f090d614815199ed7633 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(visible_private_types)]
 
 trait Foo { fn dummy(&self) { } }
index dcbecb859e53720eaee053499769b03c0fa66447..079c97013abeec7953259b1c36b296f9581f78d9 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(libc, old_io)]
+
 extern crate libc;
 
 use std::old_io::process::Command;
index 73121918259a73543379ebc7294f97ea8d69edc8..c22a584f6d45524ff3d1e462e0806d0eb46acdf7 100644 (file)
@@ -10,6 +10,8 @@
 
 // compile-flags:-D improper-ctypes
 
+// pretty-expanded FIXME #23616
+
 #![allow(improper_ctypes)]
 
 mod libc {
index 741e8be02f72c4250d9bfad06ba6d8ac3c797bd7..ec346a248a99f49dfef1531e8e56c32794f6d8be 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:weak-lang-items.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "weak-lang-items" as other;
 
 use std::thread;
index 256b199d7292059d510575220494fc4f5101ad85..47066232b870fabb9c827d209ebaacfa5cd42f9c 100644 (file)
@@ -11,6 +11,8 @@
 // Test that the `wf` checker properly handles bound regions in object
 // types. Compiling this code used to trigger an ICE.
 
+// pretty-expanded FIXME #23616
+
 pub struct Context<'tcx> {
     vec: &'tcx Vec<int>
 }
index 3374f47ed5f80b8908b395b106a5cdc803fc467c..d4823b8a33cc505be84c250e885fe97c53425810 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Bound {
     fn dummy(&self) { }
 }
index 4a149d4d3df44ed8050e5205dc1fcb90f682bdf8..c73e5a774eb420eb5ee251f20b6d4ffa379cad43 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait TheTrait { fn dummy(&self) { } }
 
 impl TheTrait for &'static int { }
index e2280f0b07b781aaa7960aa5ff1496deb36ef78b..d7aaa0b2f9ca34bfb3b9473aadf5a36e054647ba 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 trait Foo<T> { fn dummy(&self, arg: T) { } }
 
 trait Bar<A> {
index aa39325277e7c0c736fb2ac1b3b193f8f1a87d35..1972b11d2cb641a1af761f7c60fabd895d05798f 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 struct A<'a, 'b> where 'a : 'b { x: &'a int, y: &'b int }
 
 fn main() {
index e3ea7cd80e78d04027ef9ec7f6917e26df5f3a10..2803890d9d1b2e4f979e2d93e39a7b6ab780f786 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn foo<'a, I>(mut it: I) where I: Iterator<Item=&'a int> {}
 
 fn main() {
index dbff4b9599b7807da2f9016290d61aeedb4c82f7..c509cbe2a5e99a0862573b2975caa79fa77aa93e 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unboxed_closures)]
 
 struct Bencher;
index 4e841029a6b2056713351523a3df7908c06f5023..8535d76d4714c08f0fd55b8c923bf84b1ac99a50 100644 (file)
@@ -11,6 +11,8 @@
 // Test that we can quantify lifetimes outside a constraint (i.e., including
 // the self type) in a where clause.
 
+// pretty-expanded FIXME #23616
+
 use std::marker::PhantomFn;
 
 static mut COUNT: u32 = 1;
index 8239afb3594d6289ff9f0c292098b58e9f5e0171..3ea075d15869366f27adda30213eba119279d905 100644 (file)
@@ -10,4 +10,6 @@
 
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() { let x: int = 10; while x == 10 && x == 11 { let _y = 0xf00_usize; } }
index 4a3cd115d20433c14482242e437de008af429cb1..076ba8f428f061dcb2201183fcea709228ab6b3c 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 
+// pretty-expanded FIXME #23616
+
 pub fn main() {
     let mut i = 100;
     'w: while 1 + 1 == 2 {
index 1780445fb3b2d0ce18dcc04a3b931eb3cf28c1de..fa45d084060bfb928b872db1d8bd43a4fed736d5 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections)]
+
 use std::collections::BinaryHeap;
 
 fn make_pq() -> BinaryHeap<int> {
index bfabcb4d87b562df318e59bf34e14076baf277cf..b8473abb06db07b6a314c889a202da8b848216ce 100644 (file)
@@ -8,6 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
+#![feature(collections)]
+
 use std::string::String;
 
 #[derive(PartialEq)]
index dacfeb0081925ab0bcd6d4fc617cc60c70d0a53f..874360e6399d7734872c0dc68bbae75c643f9e79 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 use std::sync::Mutex;
 
 struct Point {x: int, y: int, z: int}
index b5b9d95d87f8c9701c3ad8ae77299d97b2abba74..b359251a394cd2a48187e6ed0fec32144d72207b 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 pub type HANDLE = u32;
 pub type DWORD = u32;
 pub type SIZE_T = u32;
index 236ff0838e59097ef1ebb27c111e9458d5d4ecb5..f133396a72592a4df429a457cdfe485b6bb4eae0 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:xcrate_address_insignificant.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "xcrate_address_insignificant" as foo;
 
 pub fn main() {
index 6afa02fce55149a45552a0953c317d684b9fe5d4..43bae9c7ce0725fb3961cd5189b48326ddebf3ca 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:xcrate_static_addresses.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate xcrate_static_addresses;
 
 use xcrate_static_addresses as other;
index aa61237417e9e67d5030cb1be53be43577ea34df..016ebc777f1dab9124f080147002c0e57397a786 100644 (file)
@@ -10,6 +10,8 @@
 
 // aux-build:xcrate-trait-lifetime-param.rs
 
+// pretty-expanded FIXME #23616
+
 extern crate "xcrate-trait-lifetime-param" as other;
 
 struct Reader<'a> {
index 30b5f47b2ae2e30e166affded3ab62a561fb4c61..78e92053a11204fec992e0e23ba5646c49415880 100644 (file)
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 // aux-build:xcrate_unit_struct.rs
+// pretty-expanded FIXME #23616
+
 extern crate xcrate_unit_struct;
 
 const s1: xcrate_unit_struct::Struct = xcrate_unit_struct::Struct;
index f4d03a5cda400aa603017f7d5d7b22daab2e97a2..76fe8150d3fca4bd99979d4cef2e406f01235636 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 #![feature(unsafe_no_drop_flag)]
 
 static mut destructions : int = 3;
index 65882d39375c3f0f7638081205ac594b6712c109..ba12599747068ac7666d0655578f3181456dcc4d 100644 (file)
@@ -8,12 +8,14 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// pretty-expanded FIXME #23616
+
 fn main() {
     let x = [(), ()];
 
     // The subslice used to go out of bounds for zero-sized array items, check that this doesn't
     // happen anymore
     match x {
-        [_, y..] => assert_eq!(&x[1] as *const _, &y[0] as *const _)
+        [_, y..] => assert_eq!(&x[1] as *const (), &y[0] as *const ())
     }
 }