]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #53110 - Xanewok:save-analysis-remap-path, r=nrc
authorkennytm <kennytm@gmail.com>
Thu, 9 Aug 2018 08:58:42 +0000 (16:58 +0800)
committerGitHub <noreply@github.com>
Thu, 9 Aug 2018 08:58:42 +0000 (16:58 +0800)
Account for --remap-path-prefix in save-analysis

Fixes #52549.

Didn't add a test since save-analysis is still unstable, only tested this locally. Should I add a test for that? If so, is run-make-fulldeps an appropriate format?

Session is already created with remapped working directory, so use that instead of the actual cwd.
This was the only place affected, since the rest of the paths in save-analysis are directly derived from files in spans from `sess.codemap()`, which already creates remapped ones.

r? @nrc

728 files changed:
.travis.yml
src/Cargo.lock
src/bootstrap/check.rs
src/bootstrap/compile.rs
src/bootstrap/lib.rs
src/etc/test-float-parse/many-digits.rs
src/etc/test-float-parse/rand-f64.rs
src/liballoc/benches/lib.rs
src/liballoc/boxed.rs
src/liballoc/collections/vec_deque.rs
src/liballoc/lib.rs
src/liballoc/tests/lib.rs
src/libcore/char/methods.rs
src/libcore/lib.rs
src/libcore/num/mod.rs
src/libcore/slice/mod.rs
src/libcore/str/mod.rs
src/libcore/task/context.rs
src/libcore/task/executor.rs [deleted file]
src/libcore/task/mod.rs
src/libcore/task/spawn.rs [new file with mode: 0644]
src/libcore/tests/lib.rs
src/liblibc
src/libpanic_unwind/lib.rs
src/librustc/dep_graph/dep_node.rs
src/librustc/diagnostics.rs
src/librustc/hir/def.rs
src/librustc/hir/intravisit.rs
src/librustc/hir/lowering.rs
src/librustc/hir/map/mod.rs
src/librustc/hir/mod.rs
src/librustc/ich/impls_hir.rs
src/librustc/ich/impls_syntax.rs
src/librustc/infer/error_reporting/mod.rs
src/librustc/infer/error_reporting/nice_region_error/mod.rs
src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs
src/librustc/infer/error_reporting/nice_region_error/util.rs
src/librustc/lib.rs
src/librustc/lint/builtin.rs
src/librustc/lint/context.rs
src/librustc/lint/mod.rs
src/librustc/middle/dead.rs
src/librustc/middle/lib_features.rs [new file with mode: 0644]
src/librustc/middle/reachable.rs
src/librustc/middle/resolve_lifetime.rs
src/librustc/middle/stability.rs
src/librustc/traits/auto_trait.rs
src/librustc/traits/error_reporting.rs
src/librustc/traits/query/outlives_bounds.rs
src/librustc/traits/select.rs
src/librustc/ty/context.rs
src/librustc/ty/instance.rs
src/librustc/ty/query/config.rs
src/librustc/ty/query/mod.rs
src/librustc/ty/query/plumbing.rs
src/librustc_allocator/expand.rs
src/librustc_borrowck/lib.rs
src/librustc_codegen_llvm/Cargo.toml
src/librustc_codegen_llvm/allocator.rs
src/librustc_codegen_llvm/back/write.rs
src/librustc_codegen_llvm/base.rs
src/librustc_codegen_llvm/consts.rs
src/librustc_codegen_llvm/declare.rs
src/librustc_codegen_llvm/lib.rs
src/librustc_codegen_llvm/llvm/ffi.rs
src/librustc_codegen_llvm/meth.rs
src/librustc_codegen_llvm/mir/block.rs
src/librustc_codegen_llvm/mir/constant.rs
src/librustc_codegen_llvm/mir/place.rs
src/librustc_data_structures/lib.rs
src/librustc_errors/emitter.rs
src/librustc_incremental/lib.rs
src/librustc_lint/builtin.rs
src/librustc_lint/lib.rs
src/librustc_lint/types.rs
src/librustc_metadata/cstore_impl.rs
src/librustc_metadata/decoder.rs
src/librustc_metadata/encoder.rs
src/librustc_metadata/lib.rs
src/librustc_metadata/schema.rs
src/librustc_mir/borrow_check/error_reporting.rs
src/librustc_mir/borrow_check/nll/escaping_locals.rs [deleted file]
src/librustc_mir/borrow_check/nll/liveness_map.rs
src/librustc_mir/borrow_check/nll/mod.rs
src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
src/librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs
src/librustc_mir/borrow_check/nll/region_infer/mod.rs
src/librustc_mir/borrow_check/nll/type_check/liveness.rs
src/librustc_mir/borrow_check/nll/type_check/mod.rs
src/librustc_mir/diagnostics.rs
src/librustc_mir/lib.rs
src/librustc_mir/monomorphize/partitioning.rs
src/librustc_mir/transform/const_prop.rs
src/librustc_mir/transform/qualify_consts.rs
src/librustc_passes/hir_stats.rs
src/librustc_privacy/lib.rs
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/lib.rs
src/librustc_resolve/macros.rs
src/librustc_save_analysis/json_dumper.rs
src/librustc_save_analysis/lib.rs
src/librustc_target/lib.rs
src/librustc_target/spec/riscv32imac_unknown_none_elf.rs
src/librustc_typeck/check/compare_method.rs
src/librustc_typeck/check/method/probe.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/coherence/builtin.rs
src/librustc_typeck/lib.rs
src/librustdoc/clean/auto_trait.rs
src/librustdoc/clean/blanket_impl.rs
src/librustdoc/core.rs
src/librustdoc/html/highlight.rs
src/librustdoc/html/markdown.rs
src/librustdoc/html/render.rs
src/librustdoc/html/static/main.js
src/librustdoc/html/static/rustdoc.css
src/librustdoc/lib.rs
src/libstd/lib.rs
src/libstd/net/ip.rs
src/libstd/sync/once.rs
src/libstd/sys/redox/net/netc.rs
src/libstd/sys/unix/mutex.rs
src/libsyntax/diagnostic_list.rs
src/libsyntax/ext/base.rs
src/libsyntax/ext/expand.rs
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/feature_gate.rs
src/libsyntax/lib.rs
src/libsyntax/parse/token.rs
src/libsyntax/test.rs
src/libsyntax/tokenstream.rs
src/libsyntax_ext/env.rs
src/libsyntax_ext/format.rs
src/rustc/libc_shim/Cargo.toml
src/rustllvm/RustWrapper.cpp
src/test/codegen/consts.rs
src/test/codegen/remap_path_prefix/main.rs
src/test/compile-fail-fulldeps/auxiliary/pub_and_stability.rs
src/test/compile-fail-fulldeps/proc-macro/attr-invalid-exprs.rs
src/test/compile-fail-fulldeps/proc-macro/attr-stmt-expr.rs
src/test/compile-fail-fulldeps/proc-macro/issue-41211.rs
src/test/compile-fail-fulldeps/proc-macro/issue-50493.rs
src/test/compile-fail-fulldeps/proc-macro/lints_in_proc_macros.rs
src/test/compile-fail-fulldeps/proc-macro/macros-in-extern.rs
src/test/compile-fail-fulldeps/proc-macro/proc-macro-custom-attr-mutex.rs [deleted file]
src/test/compile-fail-fulldeps/proc-macro/proc-macro-gates.rs
src/test/compile-fail-fulldeps/proc-macro/proc-macro-gates2.rs
src/test/compile-fail/auxiliary/inherited_stability.rs
src/test/compile-fail/auxiliary/lint_output_format.rs
src/test/compile-fail/auxiliary/lint_stability.rs
src/test/compile-fail/auxiliary/lint_stability_fields.rs
src/test/compile-fail/auxiliary/stability_attribute_issue.rs
src/test/compile-fail/auxiliary/stability_cfg2.rs
src/test/compile-fail/auxiliary/unstable-macros.rs
src/test/compile-fail/cast-ptr-to-int-const.rs
src/test/compile-fail/deprecation-in-staged-api.rs
src/test/compile-fail/enable-unstable-lib-feature.rs
src/test/compile-fail/issue-28075.rs
src/test/compile-fail/issue-28388-3.rs
src/test/compile-fail/lint-renamed-allow.rs
src/test/compile-fail/lint-renamed-cmdline.rs
src/test/compile-fail/lint-renamed.rs
src/test/compile-fail/lint-stability-2.rs
src/test/compile-fail/lint-stability-deprecated.rs
src/test/compile-fail/lint-stability-fields-deprecated.rs
src/test/compile-fail/lint-stability-fields.rs
src/test/compile-fail/lint-stability.rs
src/test/compile-fail/lint-unknown-feature-default.rs
src/test/compile-fail/lint-unknown-feature.rs
src/test/compile-fail/macro-with-seps-err-msg.rs
src/test/compile-fail/macros-in-extern.rs
src/test/compile-fail/missing-stability.rs
src/test/compile-fail/nll/where_clauses_in_functions.rs
src/test/compile-fail/nll/where_clauses_in_structs.rs
src/test/compile-fail/rfc-2126-extern-absolute-paths/non-existent-1.rs
src/test/compile-fail/rfc-2126-extern-absolute-paths/non-existent-2.rs
src/test/compile-fail/rfc-2126-extern-absolute-paths/non-existent-3.rs
src/test/compile-fail/rfc-2126-extern-absolute-paths/single-segment.rs
src/test/compile-fail/stability-attribute-issue.rs
src/test/compile-fail/stability-attribute-sanity-2.rs
src/test/compile-fail/stability-attribute-sanity-3.rs
src/test/compile-fail/stability-attribute-sanity.rs
src/test/compile-fail/stable-features.rs
src/test/compile-fail/stmt_expr_attrs_no_feature.rs
src/test/compile-fail/unknown-tool-name.rs
src/test/debuginfo/constant-debug-locs.rs
src/test/pretty/attr-literals.rs
src/test/run-fail/args-panic.rs
src/test/run-fail/panic-macro-any.rs
src/test/run-fail/panic-set-handler.rs
src/test/run-fail/panic-set-unset-handler.rs
src/test/run-fail/panic-take-handler-nop.rs
src/test/run-make-fulldeps/allow-warnings-cmdline-stability/bar.rs
src/test/run-make-fulldeps/allow-warnings-cmdline-stability/foo.rs
src/test/run-make-fulldeps/link-path-order/main.rs
src/test/run-make-fulldeps/save-analysis-rfc2126/extern_absolute_paths.rs
src/test/run-make-fulldeps/symbols-are-reasonable/Makefile [deleted file]
src/test/run-make-fulldeps/symbols-are-reasonable/lib.rs [deleted file]
src/test/run-make/wasm-custom-section/bar.rs
src/test/run-make/wasm-custom-section/foo.rs
src/test/run-make/wasm-symbols-not-exported/Makefile [new file with mode: 0644]
src/test/run-make/wasm-symbols-not-exported/bar.rs [new file with mode: 0644]
src/test/run-make/wasm-symbols-not-exported/foo.rs [new file with mode: 0644]
src/test/run-make/wasm-symbols-not-exported/verify-exported-symbols.js [new file with mode: 0644]
src/test/run-pass-fulldeps/auxiliary/cond_plugin.rs
src/test/run-pass-fulldeps/auxiliary/hello_macro.rs
src/test/run-pass-fulldeps/auxiliary/proc_macro_def.rs
src/test/run-pass-fulldeps/compiler-calls.rs
src/test/run-pass-fulldeps/deriving-encodable-decodable-box.rs
src/test/run-pass-fulldeps/deriving-global.rs
src/test/run-pass-fulldeps/macro-quote-cond.rs
src/test/run-pass-fulldeps/macro-quote-test.rs
src/test/run-pass-fulldeps/myriad-closures.rs
src/test/run-pass-fulldeps/proc-macro/attr-stmt-expr.rs
src/test/run-pass-fulldeps/proc-macro/auxiliary/count_compound_ops.rs
src/test/run-pass-fulldeps/proc-macro/auxiliary/hygiene_example_codegen.rs
src/test/run-pass-fulldeps/proc-macro/bang-macro.rs
src/test/run-pass-fulldeps/proc-macro/call-site.rs
src/test/run-pass-fulldeps/proc-macro/count_compound_ops.rs
src/test/run-pass-fulldeps/proc-macro/derive-b.rs
src/test/run-pass-fulldeps/proc-macro/hygiene_example.rs
src/test/run-pass-fulldeps/proc-macro/macros-in-extern.rs
src/test/run-pass-fulldeps/proc_macro.rs
src/test/run-pass-valgrind/coerce-match.rs
src/test/run-pass/alignment-gep-tup-like-1.rs
src/test/run-pass/allocator/auxiliary/custom.rs
src/test/run-pass/allocator/xcrate-use2.rs
src/test/run-pass/associated-types-doubleendediterator-object.rs
src/test/run-pass/associated-types-nested-projections.rs
src/test/run-pass/async-await.rs
src/test/run-pass/attr-shebang.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/auxiliary/cci_nested_lib.rs
src/test/run-pass/auxiliary/edition-kw-macro-2018.rs
src/test/run-pass/auxiliary/issue-2380.rs
src/test/run-pass/auxiliary/issue13507.rs
src/test/run-pass/auxiliary/method_self_arg1.rs
src/test/run-pass/auxiliary/method_self_arg2.rs
src/test/run-pass/auxiliary/typeid-intrinsic-aux1.rs
src/test/run-pass/auxiliary/typeid-intrinsic-aux2.rs
src/test/run-pass/auxiliary/unstable-macros.rs
src/test/run-pass/borrowck/borrowck-borrow-from-expr-block.rs
src/test/run-pass/borrowck/borrowck-field-sensitivity.rs
src/test/run-pass/borrowck/borrowck-move-by-capture-ok.rs
src/test/run-pass/borrowck/borrowck-mut-uniq.rs
src/test/run-pass/borrowck/borrowck-use-mut-borrow.rs
src/test/run-pass/c-stack-returning-int64.rs
src/test/run-pass/cancel-clean-via-immediate-rvalue-ref.rs
src/test/run-pass/cci_borrow.rs
src/test/run-pass/child-outlives-parent.rs
src/test/run-pass/class-cast-to-trait-cross-crate-2.rs
src/test/run-pass/class-separate-impl.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/clone-with-exterior.rs
src/test/run-pass/close-over-big-then-small-data.rs
src/test/run-pass/coerce-expect-unsized.rs
src/test/run-pass/comm.rs
src/test/run-pass/core-run-destroy.rs
src/test/run-pass/crate-method-reexport-grrrrrrr.rs
src/test/run-pass/deref-lval.rs
src/test/run-pass/deref.rs
src/test/run-pass/deriving-associated-types.rs
src/test/run-pass/deriving-default-box.rs
src/test/run-pass/deriving-hash.rs
src/test/run-pass/drop-on-empty-block-exit.rs
src/test/run-pass/drop-struct-as-object.rs
src/test/run-pass/drop-trait-enum.rs
src/test/run-pass/dst-index.rs
src/test/run-pass/dst-struct.rs
src/test/run-pass/dst-trait.rs
src/test/run-pass/dst-tuple.rs
src/test/run-pass/edition-keywords-2018-2015.rs
src/test/run-pass/edition-keywords-2018-2018.rs
src/test/run-pass/enum-nullable-simplifycfg-misopt.rs
src/test/run-pass/env-home-dir.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/expr-block-generic-unique1.rs
src/test/run-pass/expr-block-generic-unique2.rs
src/test/run-pass/expr-block-unique.rs
src/test/run-pass/expr-if-unique.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-unique.rs
src/test/run-pass/extern-call-scrub.rs
src/test/run-pass/foreign-fn-linkname.rs
src/test/run-pass/fsu-moves-and-copies.rs
src/test/run-pass/func-arg-incomplete-pattern.rs
src/test/run-pass/func-arg-ref-pattern.rs
src/test/run-pass/futures-api.rs
src/test/run-pass/generic-alias-unique.rs
src/test/run-pass/generic-exterior-unique.rs
src/test/run-pass/generic-extern-mangle.rs
src/test/run-pass/generic-fn-unique.rs
src/test/run-pass/generic-object.rs
src/test/run-pass/generic-recursive-tag.rs
src/test/run-pass/generic-tag.rs
src/test/run-pass/generic-unique.rs
src/test/run-pass/hashmap-memory.rs
src/test/run-pass/hrtb-precedence-of-plus.rs
src/test/run-pass/init-large-type.rs
src/test/run-pass/intrinsic-atomics.rs
src/test/run-pass/issue-10682.rs
src/test/run-pass/issue-10767.rs
src/test/run-pass/issue-10802.rs
src/test/run-pass/issue-11552.rs
src/test/run-pass/issue-13259-windows-tcb-trash.rs
src/test/run-pass/issue-13304.rs
src/test/run-pass/issue-13323.rs
src/test/run-pass/issue-14399.rs
src/test/run-pass/issue-14456.rs
src/test/run-pass/issue-15571.rs
src/test/run-pass/issue-15734.rs
src/test/run-pass/issue-15763.rs
src/test/run-pass/issue-16668.rs
src/test/run-pass/issue-16739.rs
src/test/run-pass/issue-16774.rs
src/test/run-pass/issue-17322.rs
src/test/run-pass/issue-17351.rs
src/test/run-pass/issue-20091.rs
src/test/run-pass/issue-20454.rs
src/test/run-pass/issue-21562.rs
src/test/run-pass/issue-22346.rs
src/test/run-pass/issue-22577.rs
src/test/run-pass/issue-2288.rs
src/test/run-pass/issue-2633-2.rs
src/test/run-pass/issue-2708.rs
src/test/run-pass/issue-2718.rs
src/test/run-pass/issue-2734.rs
src/test/run-pass/issue-2735.rs
src/test/run-pass/issue-2935.rs
src/test/run-pass/issue-3121.rs
src/test/run-pass/issue-3290.rs
src/test/run-pass/issue-3447.rs
src/test/run-pass/issue-3563-3.rs
src/test/run-pass/issue-3609.rs
src/test/run-pass/issue-3753.rs
src/test/run-pass/issue-3794.rs
src/test/run-pass/issue-38226.rs
src/test/run-pass/issue-3878.rs
src/test/run-pass/issue-4333.rs
src/test/run-pass/issue-4759.rs
src/test/run-pass/issue-5192.rs
src/test/run-pass/issue-52169.rs [new file with mode: 0644]
src/test/run-pass/issue-5666.rs
src/test/run-pass/issue-5718.rs
src/test/run-pass/issue-5884.rs
src/test/run-pass/issue-6318.rs
src/test/run-pass/issue-6557.rs
src/test/run-pass/issue-7673-cast-generically-implemented-trait.rs
src/test/run-pass/issue-8827.rs
src/test/run-pass/issue-9129.rs
src/test/run-pass/issue-9382.rs
src/test/run-pass/ivec-tag.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/last-use-is-capture.rs
src/test/run-pass/leak-unique-as-tydesc.rs
src/test/run-pass/let-assignability.rs
src/test/run-pass/list.rs
src/test/run-pass/match-implicit-copy-unique.rs
src/test/run-pass/match-unique-bind.rs
src/test/run-pass/match-value-binding-in-guard-3291.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-2.rs
src/test/run-pass/method-two-traits-distinguished-via-where-clause.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/moves-based-on-type-capture-clause.rs
src/test/run-pass/mut-function-arguments.rs
src/test/run-pass/new-box.rs
src/test/run-pass/nullable-pointer-iotareduction.rs
src/test/run-pass/object-one-type-two-traits.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/operator-overloading.rs
src/test/run-pass/output-slot-variants.rs
src/test/run-pass/overloaded-autoderef.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/panic-handler-chain.rs
src/test/run-pass/panic-handler-flail-wildly.rs
src/test/run-pass/panic-handler-set-twice.rs
src/test/run-pass/panic-recover-propagate.rs
src/test/run-pass/panic-runtime/abort-link-to-unwinding-crates.rs
src/test/run-pass/panic-runtime/abort.rs
src/test/run-pass/panic-runtime/link-to-abort.rs
src/test/run-pass/parallel-codegen-closures.rs
src/test/run-pass/pure-sum.rs
src/test/run-pass/rcvr-borrowed-to-region.rs
src/test/run-pass/realloc-16687.rs
src/test/run-pass/regions-borrow-at.rs
src/test/run-pass/regions-borrow-uniq.rs
src/test/run-pass/regions-close-over-type-parameter-successfully.rs
src/test/run-pass/regions-dependent-addr-of.rs
src/test/run-pass/regions-early-bound-trait-param.rs
src/test/run-pass/regions-escape-into-other-fn.rs
src/test/run-pass/regions-fn-subtyping.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-lifetime-nonfree-late-bound.rs
src/test/run-pass/regions-relate-bound-regions-on-closures-to-inference-variables.rs
src/test/run-pass/rfc-2126-extern-absolute-paths/basic.rs
src/test/run-pass/rfc-2126-extern-absolute-paths/test.rs
src/test/run-pass/self-impl.rs
src/test/run-pass/self-in-mut-slot-default-method.rs
src/test/run-pass/self-re-assign.rs
src/test/run-pass/send-resource.rs
src/test/run-pass/sendfn-spawn-with-fn-arg.rs
src/test/run-pass/slice.rs
src/test/run-pass/small-enum-range-edge.rs
src/test/run-pass/std-sync-right-kind-impls.rs
src/test/run-pass/sync-send-iterators-in-libcollections.rs
src/test/run-pass/sync-send-iterators-in-libcore.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-7.rs
src/test/run-pass/task-comm-9.rs
src/test/run-pass/task-life-0.rs
src/test/run-pass/task-spawn-move-and-copy.rs
src/test/run-pass/threads.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-inheritance-num0.rs
src/test/run-pass/trait-object-generics.rs
src/test/run-pass/traits-conditional-dispatch.rs
src/test/run-pass/type-id-higher-rank.rs
src/test/run-pass/type-param-constraints.rs
src/test/run-pass/typeclasses-eq-example-static.rs
src/test/run-pass/typeclasses-eq-example.rs
src/test/run-pass/ufcs-explicit-self.rs
src/test/run-pass/unboxed-closures-boxed.rs
src/test/run-pass/unboxed-closures-call-sugar-object-autoderef.rs
src/test/run-pass/unboxed-closures-call-sugar-object.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-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-in-tag.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-log.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-3.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/unsized2.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/utf8_chars.rs
src/test/run-pass/variance-intersection-of-ref-and-opt-ref.rs
src/test/run-pass/variance-vec-covariant.rs
src/test/run-pass/vec-dst.rs
src/test/run-pass/vector-no-ann-2.rs
src/test/run-pass/x86stdcall2.rs
src/test/rustdoc/auxiliary/rustdoc-default-impl.rs
src/test/rustdoc/const-evalutation-ice.rs
src/test/rustdoc/issue-51236.rs [new file with mode: 0644]
src/test/rustdoc/synthetic_auto/static-region.rs [new file with mode: 0644]
src/test/ui-fulldeps/auxiliary/attr_proc_macro.rs
src/test/ui-fulldeps/auxiliary/bang_proc_macro.rs
src/test/ui-fulldeps/auxiliary/lifetimes.rs
src/test/ui-fulldeps/lifetimes.rs
src/test/ui-fulldeps/proc-macro/auxiliary/generate-mod.rs
src/test/ui-fulldeps/proc-macro/generate-mod.rs
src/test/ui-fulldeps/proc-macro/invalid-attributes.rs
src/test/ui-fulldeps/proc-macro/invalid-attributes.stderr
src/test/ui-fulldeps/proc-macro/macro-namespace-reserved.rs
src/test/ui-fulldeps/proc-macro/non-root.rs
src/test/ui-fulldeps/proc-macro/non-root.stderr
src/test/ui-fulldeps/proc-macro/three-equals.rs
src/test/ui-fulldeps/resolve-error.rs
src/test/ui-fulldeps/resolve-error.stderr
src/test/ui/E0705.rs [new file with mode: 0644]
src/test/ui/E0705.stderr [new file with mode: 0644]
src/test/ui/auxiliary/edition-kw-macro-2018.rs
src/test/ui/auxiliary/lint_output_format.rs
src/test/ui/auxiliary/svh-a-change-type-static.rs
src/test/ui/borrowck/issue-45983.ast.stderr [new file with mode: 0644]
src/test/ui/borrowck/issue-45983.migrate.stderr [new file with mode: 0644]
src/test/ui/borrowck/issue-45983.nll.stderr
src/test/ui/borrowck/issue-45983.rs
src/test/ui/borrowck/issue-45983.stderr [deleted file]
src/test/ui/borrowck/issue-52713-bug.rs [new file with mode: 0644]
src/test/ui/borrowck/issue-52713-bug.stderr [new file with mode: 0644]
src/test/ui/borrowck/promote-ref-mut-in-let-issue-46557.nll.stderr
src/test/ui/codemap_tests/bad-format-args.stderr
src/test/ui/const-deref-ptr.rs
src/test/ui/const-deref-ptr.stderr
src/test/ui/const-eval/const_raw_ptr_ops.rs [new file with mode: 0644]
src/test/ui/const-eval/const_raw_ptr_ops.stderr [new file with mode: 0644]
src/test/ui/const-eval/const_transmute.rs
src/test/ui/const-eval/feature-gate-const_fn_union.rs [new file with mode: 0644]
src/test/ui/const-eval/feature-gate-const_fn_union.stderr [new file with mode: 0644]
src/test/ui/const-eval/issue-53157.rs [new file with mode: 0644]
src/test/ui/const-eval/match-test-ptr-null.rs
src/test/ui/const-eval/match-test-ptr-null.stderr
src/test/ui/const-eval/promoted_const_fn_fail.rs
src/test/ui/const-eval/promoted_raw_ptr_ops.rs [new file with mode: 0644]
src/test/ui/const-eval/promoted_raw_ptr_ops.stderr [new file with mode: 0644]
src/test/ui/const-eval/ref_to_float_transmute.rs
src/test/ui/const-eval/ref_to_int_match.rs
src/test/ui/const-eval/ref_to_int_match.stderr
src/test/ui/custom-attribute-multisegment.rs [new file with mode: 0644]
src/test/ui/custom-attribute-multisegment.stderr [new file with mode: 0644]
src/test/ui/edition-keywords-2018-2015-expansion.rs
src/test/ui/edition-keywords-2018-2015-parsing.rs
src/test/ui/edition-keywords-2018-2015-parsing.stderr
src/test/ui/edition-keywords-2018-2018-expansion.rs
src/test/ui/edition-keywords-2018-2018-expansion.stderr
src/test/ui/edition-keywords-2018-2018-parsing.rs
src/test/ui/edition-keywords-2018-2018-parsing.stderr
src/test/ui/error-codes/E0395.rs
src/test/ui/error-codes/E0395.stderr
src/test/ui/error-codes/E0396-fixed.rs [new file with mode: 0644]
src/test/ui/error-codes/E0396-fixed.stderr [new file with mode: 0644]
src/test/ui/error-codes/E0396.rs
src/test/ui/error-codes/E0396.stderr
src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr
src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.rs [new file with mode: 0644]
src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.stderr [new file with mode: 0644]
src/test/ui/feature-gate-impl_header_lifetime_elision.rs [new file with mode: 0644]
src/test/ui/feature-gate-impl_header_lifetime_elision.stderr [new file with mode: 0644]
src/test/ui/feature-gate-in_band_lifetimes-impl.rs [deleted file]
src/test/ui/feature-gate-in_band_lifetimes-impl.stderr [deleted file]
src/test/ui/feature-gate-in_band_lifetimes.rs
src/test/ui/feature-gate-in_band_lifetimes.stderr
src/test/ui/feature-gate-macros_in_extern.rs
src/test/ui/feature-gate-macros_in_extern.stderr
src/test/ui/feature-gate-unwind-attributes.rs
src/test/ui/feature-gate/duplicate-features.rs [new file with mode: 0644]
src/test/ui/feature-gate/duplicate-features.stderr [new file with mode: 0644]
src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs
src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr
src/test/ui/feature-gate/stability-attribute-consistency.rs [new file with mode: 0644]
src/test/ui/feature-gate/stability-attribute-consistency.stderr [new file with mode: 0644]
src/test/ui/feature-gate/unknown-feature.rs [new file with mode: 0644]
src/test/ui/feature-gate/unknown-feature.stderr [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/assoc-type.rs [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/assoc-type.stderr [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/dyn-trait.rs [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/path-elided.rs [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/path-elided.stderr [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/path-underscore.rs [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/ref-underscore.rs [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/trait-elided.rs [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/trait-elided.stderr [new file with mode: 0644]
src/test/ui/impl-header-lifetime-elision/trait-underscore.rs [new file with mode: 0644]
src/test/ui/imports/macros.rs
src/test/ui/in-band-lifetimes/impl/assoc-type.rs [deleted file]
src/test/ui/in-band-lifetimes/impl/assoc-type.stderr [deleted file]
src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr [deleted file]
src/test/ui/in-band-lifetimes/impl/dyn-trait.rs [deleted file]
src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr [deleted file]
src/test/ui/in-band-lifetimes/impl/path-elided.rs [deleted file]
src/test/ui/in-band-lifetimes/impl/path-elided.stderr [deleted file]
src/test/ui/in-band-lifetimes/impl/path-underscore.rs [deleted file]
src/test/ui/in-band-lifetimes/impl/ref-underscore.rs [deleted file]
src/test/ui/in-band-lifetimes/impl/trait-elided.rs [deleted file]
src/test/ui/in-band-lifetimes/impl/trait-elided.stderr [deleted file]
src/test/ui/in-band-lifetimes/impl/trait-underscore.rs [deleted file]
src/test/ui/in-band-lifetimes/mismatched.nll.stderr
src/test/ui/in-band-lifetimes/mismatched.stderr
src/test/ui/in-band-lifetimes/mismatched_trait.nll.stderr
src/test/ui/in-band-lifetimes/mismatched_trait.stderr
src/test/ui/issue-11692-2.rs
src/test/ui/issue-11692-2.stderr
src/test/ui/issue-13058.stderr
src/test/ui/issue-14285.nll.stderr
src/test/ui/issue-14285.stderr
src/test/ui/issue-15034.nll.stderr
src/test/ui/issue-15034.stderr
src/test/ui/issue-16922.nll.stderr
src/test/ui/issue-16922.stderr
src/test/ui/issue-17337.rs
src/test/ui/issue-17458.rs
src/test/ui/issue-17458.stderr
src/test/ui/issue-18294.rs
src/test/ui/issue-18294.stderr
src/test/ui/issue-25826.rs
src/test/ui/issue-25826.stderr
src/test/ui/issue-3154.nll.stderr
src/test/ui/issue-3154.stderr
src/test/ui/issue-40288-2.nll.stderr
src/test/ui/issue-40288-2.stderr
src/test/ui/issue-40510-1.nll.stderr
src/test/ui/issue-40510-3.nll.stderr
src/test/ui/issue-46983.stderr
src/test/ui/issue-49824.nll.stderr
src/test/ui/issue-52023-array-size-pointer-cast.rs
src/test/ui/issue-52023-array-size-pointer-cast.stderr
src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr
src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr
src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr
src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr
src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr
src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr
src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr
src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr
src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr
src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr
src/test/ui/lint-ctypes.rs
src/test/ui/lint-output-format-2.rs
src/test/ui/lint-output-format-2.stderr
src/test/ui/macro-path-prelude-fail-3.rs
src/test/ui/macro-path-prelude-fail-3.stderr
src/test/ui/macros/missing-comma.rs [new file with mode: 0644]
src/test/ui/macros/missing-comma.stderr [new file with mode: 0644]
src/test/ui/nll/closure-requirements/propagate-approximated-ref.rs
src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr
src/test/ui/nll/closure-requirements/propagate-approximated-val.rs
src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr
src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.stderr
src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.rs
src/test/ui/nll/closure-requirements/region-lbr1-does-not-outlive-ebr2.stderr
src/test/ui/nll/get_default.nll.stderr
src/test/ui/nll/get_default.stderr
src/test/ui/nll/guarantor-issue-46974.stderr
src/test/ui/nll/issue-48238.stderr
src/test/ui/nll/issue-52113.rs
src/test/ui/nll/issue-52113.stderr
src/test/ui/nll/issue-53119.rs [new file with mode: 0644]
src/test/ui/nll/return-ref-mut-issue-46557.stderr
src/test/ui/nll/ty-outlives/impl-trait-captures.stderr
src/test/ui/tool-attributes-disabled-2.rs
src/test/ui/tool-attributes-disabled-2.stderr [new file with mode: 0644]
src/test/ui/tool-attributes-misplaced-1.rs
src/test/ui/tool-attributes-misplaced-1.stderr
src/test/ui/tool-attributes-misplaced-2.rs
src/test/ui/tool-attributes-misplaced-2.stderr
src/test/ui/union/union-const-eval.rs
src/tools/clippy
src/tools/compiletest/src/main.rs
src/tools/rls
src/tools/rustfmt
src/tools/tidy/src/deps.rs
src/tools/tidy/src/features.rs

index a860aaa5b7e6b0becc86e9bda37fb674203bbe0d..d010a8370b502b2159ac4ecfe6750d6cda9a9303 100644 (file)
@@ -277,6 +277,8 @@ after_success:
       du . | sort -nr | head -n100
 
 after_failure:
+  # Requested by travis to debug "shutting down NOW" errors
+  - sudo tail -n 500 /var/log/syslog
   - >
       echo "#### Build failed; Disk usage after running script:";
       df -h;
index 7c57cf32d1b14448323ac54edbf321aaad03a5cd..2a7dbce2ddc913949ae8e72a0ef0edba98177fcc 100644 (file)
@@ -90,7 +90,7 @@ name = "atty"
 version = "0.2.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -102,7 +102,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
  "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -113,7 +113,7 @@ version = "0.1.23"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -136,7 +136,7 @@ dependencies = [
  "filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "petgraph 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)",
  "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -196,7 +196,7 @@ dependencies = [
  "jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "libgit2-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -243,7 +243,7 @@ dependencies = [
  "jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazycell 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "libgit2-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -426,7 +426,7 @@ name = "commoncrypto-sys"
 version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -446,7 +446,7 @@ dependencies = [
  "filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -465,7 +465,7 @@ dependencies = [
  "diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -488,7 +488,7 @@ version = "0.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -497,7 +497,7 @@ version = "0.6.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "core-foundation-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -505,7 +505,7 @@ name = "core-foundation-sys"
 version = "0.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -627,7 +627,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "curl-sys 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)",
  "schannel 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -641,7 +641,7 @@ version = "0.4.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -790,7 +790,7 @@ version = "0.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -804,7 +804,7 @@ name = "flate2"
 version = "1.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -835,7 +835,7 @@ name = "fs2"
 version = "0.4.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -887,7 +887,7 @@ version = "0.7.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "libgit2-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1035,7 +1035,7 @@ name = "isatty"
 version = "0.1.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -1058,7 +1058,7 @@ name = "jobserver"
 version = "0.1.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -1129,7 +1129,7 @@ dependencies = [
 
 [[package]]
 name = "libc"
-version = "0.2.42"
+version = "0.2.43"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -1140,7 +1140,7 @@ dependencies = [
  "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
  "curl-sys 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "libssh2-sys 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1153,7 +1153,7 @@ version = "0.2.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1166,7 +1166,7 @@ version = "1.0.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -1206,7 +1206,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -1273,7 +1273,7 @@ name = "memchr"
 version = "2.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1281,7 +1281,7 @@ name = "memmap"
 version = "0.6.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -1304,7 +1304,7 @@ version = "0.1.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1372,7 +1372,7 @@ name = "num_cpus"
 version = "1.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1389,7 +1389,7 @@ dependencies = [
  "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -1404,7 +1404,7 @@ version = "0.9.33"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -1461,7 +1461,7 @@ name = "parking_lot_core"
 version = "0.2.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1636,7 +1636,7 @@ dependencies = [
 
 [[package]]
 name = "racer"
-version = "2.1.2"
+version = "2.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1648,7 +1648,7 @@ dependencies = [
  "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1657,7 +1657,7 @@ version = "0.4.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -1668,7 +1668,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -1694,7 +1694,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -1770,7 +1770,7 @@ dependencies = [
 
 [[package]]
 name = "rls"
-version = "0.130.2"
+version = "0.130.4"
 dependencies = [
  "cargo 0.30.0",
  "cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1785,7 +1785,7 @@ dependencies = [
  "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "ordslice 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "racer 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "racer 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rls-analysis 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1795,7 +1795,7 @@ dependencies = [
  "rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rls-vfs 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-workspace-hack 1.0.0",
- "rustfmt-nightly 0.99.1",
+ "rustfmt-nightly 0.99.2",
  "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1897,32 +1897,15 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-arena"
-version = "209.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rustc-ap-rustc_data_structures 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-arena"
-version = "211.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rustc-ap-rustc_data_structures 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-rustc_cratesio_shim"
-version = "209.0.0"
+version = "218.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "rustc-ap-rustc_cratesio_shim"
-version = "211.0.0"
+version = "218.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1931,25 +1914,7 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_data_structures"
-version = "209.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "ena 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-rustc_data_structures"
-version = "211.0.0"
+version = "218.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1957,8 +1922,8 @@ dependencies = [
  "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_cratesio_shim 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1967,114 +1932,57 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_errors"
-version = "209.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-rustc_errors"
-version = "211.0.0"
+version = "218.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "rustc-ap-rustc_target"
-version = "209.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-rustc_target"
-version = "211.0.0"
+version = "218.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_cratesio_shim 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_cratesio_shim 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "rustc-ap-serialize"
-version = "209.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "rustc-ap-serialize"
-version = "211.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "rustc-ap-syntax"
-version = "209.0.0"
+version = "218.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_errors 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_target 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
 
 [[package]]
 name = "rustc-ap-syntax"
-version = "211.0.0"
+version = "218.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_errors 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_target 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rustc-ap-syntax_pos"
-version = "209.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-arena 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_errors 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_target 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "rustc-ap-syntax_pos"
-version = "211.0.0"
+version = "218.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-arena 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_data_structures 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-serialize 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-arena 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_data_structures 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-serialize 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -2116,7 +2024,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -2184,30 +2092,10 @@ dependencies = [
 name = "rustc_codegen_llvm"
 version = "0.0.0"
 dependencies = [
- "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc 0.0.0",
  "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc_allocator 0.0.0",
- "rustc_apfloat 0.0.0",
- "rustc_codegen_utils 0.0.0",
- "rustc_data_structures 0.0.0",
- "rustc_errors 0.0.0",
- "rustc_incremental 0.0.0",
  "rustc_llvm 0.0.0",
- "rustc_mir 0.0.0",
- "rustc_platform_intrinsics 0.0.0",
- "rustc_target 0.0.0",
- "serialize 0.0.0",
- "syntax 0.0.0",
- "syntax_pos 0.0.0",
- "tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -2566,7 +2454,7 @@ dependencies = [
 
 [[package]]
 name = "rustfmt-nightly"
-version = "0.99.1"
+version = "0.99.2"
 dependencies = [
  "assert_cli 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2580,9 +2468,9 @@ dependencies = [
  "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-rustc_target 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-ap-syntax_pos 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-rustc_target 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-ap-syntax_pos 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2698,7 +2586,7 @@ version = "0.3.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -2876,7 +2764,7 @@ version = "0.4.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -2886,7 +2774,7 @@ name = "tempfile"
 version = "3.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2937,7 +2825,7 @@ name = "termion"
 version = "1.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -2981,7 +2869,7 @@ name = "time"
 version = "0.1.40"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -3181,7 +3069,7 @@ name = "xattr"
 version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -3293,7 +3181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fb497c35d362b6a331cfd94956a07fc2c78a4604cdbee844a81170386b996dd3"
 "checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef"
 "checksum lazycell 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d33a48d0365c96081958cc663eef834975cb1e8d8bea3378513fc72bdbf11e50"
-"checksum libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" = "b685088df2b950fccadf07a7187c8ef846a959c142338a48f9dc0b94517eb5f1"
+"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
 "checksum libgit2-sys 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c9051a4b288ba6f8728e9e52bb2510816946b8bcb2e20259e4d4cdc93b9ecafd"
 "checksum libssh2-sys 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c628b499e8d1a4f4bd09a95d6cb1f8aeb231b46a9d40959bbd0408f14dd63adf"
 "checksum libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "87f737ad6cc6fd6eefe3d9dc5412f1573865bded441300904d2f42269e140f16"
@@ -3347,7 +3235,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
 "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8"
 "checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035"
-"checksum racer 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c20890fccfc19a28835ee4ffab6af13d300a60a33be29162cfdf8db981811f25"
+"checksum racer 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "dcbc5ababaffee8d8f34910f925287c8f716b1ead48561c4278a152d08264f7c"
 "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5"
 "checksum rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "12397506224b2f93e6664ffc4f664b29be8208e5157d3d90b44f09b5fae470ea"
 "checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2"
@@ -3366,22 +3254,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum rls-rustc 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9dba7390427aefa953608429701e3665192ca810ba8ae09301e001b7c7bed0"
 "checksum rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d7c7046dc6a92f2ae02ed302746db4382e75131b9ce20ce967259f6b5867a6a"
 "checksum rls-vfs 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ecbc8541b4c341d6271eae10f869dd9d36db871afe184f5b6f9bffbd6ed0373f"
-"checksum rustc-ap-arena 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b098827864368459cbc7a79fbc54eafb92df7e00a46c0cda352b5a21583ee436"
-"checksum rustc-ap-arena 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eec75ed880706dd9a05bc770c327ed142fa7d4b648d9757fbc71d821d68448a5"
-"checksum rustc-ap-rustc_cratesio_shim 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef4d923dea14fb085bca743fb982f6a3bc11c0d5d30b822bcf6fa16e9464a56c"
-"checksum rustc-ap-rustc_cratesio_shim 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0f5d54615bedbae65a976e0835edf0de90dd962ec818c0149fe181d5cd81da9e"
-"checksum rustc-ap-rustc_data_structures 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18c6a5c9edc6b4ae035cdc03af7d8662d39fad7879c5501d103e7087dfaebc80"
-"checksum rustc-ap-rustc_data_structures 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7c51cc6e79eab25c7ea84a7e104e81e6f44cca32709df54c2cdb4e7059d7843"
-"checksum rustc-ap-rustc_errors 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9a1e9bdc597abd95cebce0c14c1da58943a9e5b8255530a0fec30659d144eb0b"
-"checksum rustc-ap-rustc_errors 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff050095b7afb254506591ee7d3a5d0fb9c03c16f8c2741b588178085e563d49"
-"checksum rustc-ap-rustc_target 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "142ddef3dc12dda2bcd3412f0d96d3745413a8fbc2f224f0cc97afa04c071d89"
-"checksum rustc-ap-rustc_target 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "53c7a8c21c3b05f24998fa6ab9ded6269810a2f3ae12ff301c432c1e9fa8e111"
-"checksum rustc-ap-serialize 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8b08f8f175b038a82caa7e51fc52b72ff96cfe8c1429755da30380dbd4199c7f"
-"checksum rustc-ap-serialize 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad4713c2c0c26a45ead8fb16fee88e16fecf999588ae6920847cbaeb19565b7f"
-"checksum rustc-ap-syntax 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4c802e0e1fbc64eddc21e0798527eb1f5fdbd5781d119bd2c44b6130afdc81cc"
-"checksum rustc-ap-syntax 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "768e2698f912913be2ccd355b2dea62c978efc356f75db1400605f3642905d53"
-"checksum rustc-ap-syntax_pos 209.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "008d47cc54ed12a2784217b9e6630a7fa1c8dc3591a283f65ad4b7fa307d49d5"
-"checksum rustc-ap-syntax_pos 211.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a280dc8919aa7f684832ba3eeab2f6c96dbe2e2e4f6a922f7f0bdb3a9dd9e641"
+"checksum rustc-ap-arena 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e905467184ce31ccdbd33ac33b9ba377f8cc7aefb340a733ab7e5efe34cddda"
+"checksum rustc-ap-rustc_cratesio_shim 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2a1a45817e78d0c1e2800fb933c526747ef2c5ee4b2dc0946e0c2d901329b88"
+"checksum rustc-ap-rustc_data_structures 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4e9e5588883318e0e58bb7ea7cde2a66eaca55b25e32908f0982365988657"
+"checksum rustc-ap-rustc_errors 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d233c0d9beda42a52d329a5df865c8f20c64773d2ab7aa6b4ae4248bacf3188"
+"checksum rustc-ap-rustc_target 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eec0bc13feecf9e88e39439b24b4b3ca54db8caf12fb7172d0c430451c8b377c"
+"checksum rustc-ap-serialize 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffcfb1102cd7cbf5f25c008a00f7253427af9dfac8989ede48c19bd47f556893"
+"checksum rustc-ap-syntax 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3a2ca0ef078a735c81a0d33589e04148dcf41f80ee7ebe30e72904a631b7c669"
+"checksum rustc-ap-syntax_pos 218.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1bbd31d1bbc7210983c3bbbcb9ee35bac443c6c899f979b8114e58bb7101c28"
 "checksum rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "76d7ba1feafada44f2d38eed812bd2489a03c0f5abb975799251518b68848649"
 "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8"
 "checksum rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c6d5a683c6ba4ed37959097e88d71c9e8e26659a3cb5be8b389078e7ad45306"
index 2f0ae7d9d2cfac31da3407a8a07ee6141c46a4c2..133e5aa37a7db9715e55b83867e8a9ab0ad3fff2 100644 (file)
@@ -137,8 +137,10 @@ fn run(self, builder: &Builder) {
         let target = self.target;
         let backend = self.backend;
 
+        let out_dir = builder.cargo_out(compiler, Mode::Codegen, target);
+        builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target));
+
         let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "check");
-        let features = builder.rustc_features().to_string();
         cargo.arg("--manifest-path").arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml"));
         rustc_cargo_env(builder, &mut cargo);
 
@@ -146,7 +148,7 @@ fn run(self, builder: &Builder) {
 
         let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage));
         run_cargo(builder,
-                  cargo.arg("--features").arg(features),
+                  &mut cargo,
                   &codegen_backend_stamp(builder, compiler, target, backend),
                   true);
     }
index 8c4f2df60fe6ff1ca0f7576bb91365613987504a..2f8816d111a9d2b4d6f89171d897d8fcca36088b 100644 (file)
@@ -670,16 +670,17 @@ fn run(self, builder: &Builder) {
             return;
         }
 
+        let out_dir = builder.cargo_out(compiler, Mode::Codegen, target);
+        builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target));
+
         let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "build");
-        let mut features = builder.rustc_features().to_string();
         cargo.arg("--manifest-path")
             .arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml"));
         rustc_cargo_env(builder, &mut cargo);
 
-        features += &build_codegen_backend(&builder, &mut cargo, &compiler, target, backend);
+        let features = build_codegen_backend(&builder, &mut cargo, &compiler, target, backend);
 
-        let tmp_stamp = builder.cargo_out(compiler, Mode::Codegen, target)
-            .join(".tmp.stamp");
+        let tmp_stamp = out_dir.join(".tmp.stamp");
 
         let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage));
         let files = run_cargo(builder,
index 1efff19dfb993a69da84014b34587d77ab484499..38965949bf22f6ce594090aa6c25812c4549f32f 100644 (file)
@@ -555,8 +555,8 @@ fn stage_out(&self, compiler: Compiler, mode: Mode) -> PathBuf {
         let suffix = match mode {
             Mode::Std => "-std",
             Mode::Test => "-test",
-            Mode::Codegen => "-rustc",
             Mode::Rustc => "-rustc",
+            Mode::Codegen => "-codegen",
             Mode::ToolBootstrap => "-bootstrap-tools",
             Mode::ToolStd => "-tools",
             Mode::ToolRustc => "-tools",
index 674c30ad84ed531da78959dd197a5885bea235cb..469a38da2b8312426589baef8928b7ad0a5d9e96 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rand)]
-
 extern crate rand;
 
 mod _common;
index 1d82912054e2abc45725bbb320c7e1154361bac3..2994dd9d5e6446511698fd96162dab55767cd7c1 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rand)]
-
 extern crate rand;
 
 mod _common;
index 4f69aa6670b563fa9aced927148d88116446aa88..b4f4fd74f3a39ac41815df8681ef3261b2fc1a6d 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rand)]
 #![feature(repr_simd)]
 #![feature(slice_sort_by_cached_key)]
 #![feature(test)]
index 2cf9b13a67a2750754b0f98070a52aec2e979d34..08db5136d040450c0164841ed8fed83d0be2ad1f 100644 (file)
@@ -67,7 +67,7 @@
 use core::mem::{self, PinMut};
 use core::ops::{CoerceUnsized, Deref, DerefMut, Generator, GeneratorState};
 use core::ptr::{self, NonNull, Unique};
-use core::task::{Context, Poll, Executor, SpawnErrorKind, SpawnObjError};
+use core::task::{Context, Poll, Spawn, SpawnErrorKind, SpawnObjError};
 
 use raw_vec::RawVec;
 use str::from_boxed_utf8_unchecked;
@@ -973,11 +973,14 @@ unsafe fn drop(ptr: *mut ()) {
 }
 
 #[unstable(feature = "futures_api", issue = "50547")]
-impl<E> Executor for Box<E>
-    where E: Executor + ?Sized
+impl<Sp> Spawn for Box<Sp>
+    where Sp: Spawn + ?Sized
 {
-    fn spawn_obj(&mut self, task: FutureObj<'static, ()>) -> Result<(), SpawnObjError> {
-        (**self).spawn_obj(task)
+    fn spawn_obj(
+        &mut self,
+        future: FutureObj<'static, ()>,
+    ) -> Result<(), SpawnObjError> {
+        (**self).spawn_obj(future)
     }
 
     fn status(&self) -> Result<(), SpawnErrorKind> {
index ba92b886138c02efbeec9b421154965da89e41e7..7787102ba8266b4dd23c8cc13ed2ab18ba50af2b 100644 (file)
@@ -2370,7 +2370,7 @@ macro_rules! __impl_slice_eq1 {
         __impl_slice_eq1! { $Lhs, $Rhs, Sized }
     };
     ($Lhs: ty, $Rhs: ty, $Bound: ident) => {
-        #[stable(feature = "vec-deque-partial-eq-slice", since = "1.17.0")]
+        #[stable(feature = "vec_deque_partial_eq_slice", since = "1.17.0")]
         impl<'a, 'b, A: $Bound, B> PartialEq<$Rhs> for $Lhs where A: PartialEq<B> {
             fn eq(&self, other: &$Rhs) -> bool {
                 if self.len() != other.len() {
index ca1b7507b5e9b0dcc8062c632dd785883b7ae4c3..d1b607bbe9b534d7d4984ac2dfaf50952d37f688 100644 (file)
 #![needs_allocator]
 #![deny(missing_debug_implementations)]
 
-#![cfg_attr(test, allow(deprecated))] // rand
-#![cfg_attr(not(test), feature(exact_size_is_empty))]
+#![cfg_attr(not(test), feature(fn_traits))]
 #![cfg_attr(not(test), feature(generator_trait))]
-#![cfg_attr(test, feature(rand, test))]
+#![cfg_attr(test, feature(test))]
+
 #![feature(allocator_api)]
 #![feature(allow_internal_unstable)]
 #![feature(arbitrary_self_types)]
-#![feature(ascii_ctype)]
 #![feature(box_into_raw_non_null)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(cfg_target_has_atomic)]
 #![feature(coerce_unsized)]
-#![feature(collections_range)]
 #![feature(const_fn)]
 #![feature(core_intrinsics)]
 #![feature(custom_attribute)]
 #![feature(dropck_eyepatch)]
 #![feature(exact_size_is_empty)]
 #![feature(fmt_internals)]
-#![feature(from_ref)]
 #![feature(fundamental)]
 #![feature(futures_api)]
 #![feature(lang_items)]
 #![feature(allocator_internals)]
 #![feature(on_unimplemented)]
 #![feature(exact_chunks)]
-#![feature(pointer_methods)]
-#![feature(inclusive_range_methods)]
 #![feature(rustc_const_unstable)]
 #![feature(const_vec_new)]
 
-#![cfg_attr(not(test), feature(fn_traits, i128))]
-#![cfg_attr(test, feature(test))]
-
 // Allow testing this library
 
 #[cfg(test)]
index 618aff963f22dd59bc8d549bd4fc585ecd4d8847..c12c7a81f79c8905a3ee3b77f7eb2662919ea488 100644 (file)
 #![feature(drain_filter)]
 #![feature(exact_size_is_empty)]
 #![feature(pattern)]
-#![feature(rand)]
 #![feature(slice_sort_by_cached_key)]
-#![feature(splice)]
 #![feature(str_escape)]
-#![feature(string_retain)]
 #![feature(try_reserve)]
 #![feature(unboxed_closures)]
 #![feature(exact_chunks)]
index 33fd6947c1e4b6471d978a13bd69058695cf33e6..64a17786b0a6b1b7bb92ec7df180190c2458bc1f 100644 (file)
@@ -1050,8 +1050,6 @@ pub fn make_ascii_lowercase(&mut self) {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1084,8 +1082,6 @@ pub fn is_ascii_alphabetic(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1118,8 +1114,6 @@ pub fn is_ascii_uppercase(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1155,8 +1149,6 @@ pub fn is_ascii_lowercase(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1189,8 +1181,6 @@ pub fn is_ascii_alphanumeric(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1226,8 +1216,6 @@ pub fn is_ascii_digit(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1264,8 +1252,6 @@ pub fn is_ascii_hexdigit(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1298,8 +1284,6 @@ pub fn is_ascii_punctuation(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1349,8 +1333,6 @@ pub fn is_ascii_graphic(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
@@ -1385,8 +1367,6 @@ pub fn is_ascii_whitespace(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = 'A';
     /// let uppercase_g = 'G';
     /// let a = 'a';
index 72074e1dbce1873fa386585f05a1092691bb0fe8..dc4a2d7c0d7b15ebdc9e3946a4c4fb01538ccddf 100644 (file)
@@ -82,7 +82,7 @@
 #![feature(concat_idents)]
 #![feature(const_fn)]
 #![feature(const_int_ops)]
-#![feature(core_float)]
+#![feature(const_fn_union)]
 #![feature(custom_attribute)]
 #![feature(doc_cfg)]
 #![feature(doc_spotlight)]
 #![feature(rustc_attrs)]
 #![feature(rustc_const_unstable)]
 #![feature(simd_ffi)]
-#![feature(core_slice_ext)]
-#![feature(core_str_ext)]
 #![feature(specialization)]
 #![feature(staged_api)]
 #![feature(stmt_expr_attributes)]
 #![feature(untagged_unions)]
 #![feature(unwind_attributes)]
 #![feature(doc_alias)]
-#![feature(inclusive_range_methods)]
 #![feature(mmx_target_feature)]
 #![feature(tbm_target_feature)]
 #![feature(sse4a_target_feature)]
index 6e2fbf6f84f0f48a63832f877f69d78256362187..44a3b310ebe4d2e92ab99c24e02ed167df5456d3 100644 (file)
@@ -3761,8 +3761,6 @@ pub fn make_ascii_lowercase(&mut self) {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -3799,8 +3797,6 @@ pub fn is_ascii_alphabetic(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -3837,8 +3833,6 @@ pub fn is_ascii_uppercase(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -3878,8 +3872,6 @@ pub fn is_ascii_lowercase(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -3916,8 +3908,6 @@ pub fn is_ascii_alphanumeric(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -3957,8 +3947,6 @@ pub fn is_ascii_digit(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -3999,8 +3987,6 @@ pub fn is_ascii_hexdigit(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -4037,8 +4023,6 @@ pub fn is_ascii_punctuation(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -4092,8 +4076,6 @@ pub fn is_ascii_graphic(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
@@ -4132,8 +4114,6 @@ pub fn is_ascii_whitespace(&self) -> bool {
     /// # Examples
     ///
     /// ```
-    /// #![feature(ascii_ctype)]
-    ///
     /// let uppercase_a = b'A';
     /// let uppercase_g = b'G';
     /// let a = b'a';
index dfebe460ff80150eb1f44e1075f723d18e6fb9ce..187ac3c7a7f06ab7b1bea4c1ea6f2e4fa2466bf5 100644 (file)
@@ -2007,7 +2007,7 @@ pub trait SliceIndex<T: ?Sized>: private_slice_index::Sealed {
     fn index_mut(self, slice: &mut T) -> &mut Self::Output;
 }
 
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
 impl<T> SliceIndex<[T]> for usize {
     type Output = T;
 
@@ -2056,7 +2056,7 @@ fn index_mut(self, slice: &mut [T]) -> &mut T {
     }
 }
 
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
 impl<T> SliceIndex<[T]> for  ops::Range<usize> {
     type Output = [T];
 
@@ -2117,7 +2117,7 @@ fn index_mut(self, slice: &mut [T]) -> &mut [T] {
     }
 }
 
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
 impl<T> SliceIndex<[T]> for ops::RangeTo<usize> {
     type Output = [T];
 
@@ -2152,7 +2152,7 @@ fn index_mut(self, slice: &mut [T]) -> &mut [T] {
     }
 }
 
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
 impl<T> SliceIndex<[T]> for ops::RangeFrom<usize> {
     type Output = [T];
 
@@ -2187,7 +2187,7 @@ fn index_mut(self, slice: &mut [T]) -> &mut [T] {
     }
 }
 
-#[stable(feature = "slice-get-slice-impls", since = "1.15.0")]
+#[stable(feature = "slice_get_slice_impls", since = "1.15.0")]
 impl<T> SliceIndex<[T]> for ops::RangeFull {
     type Output = [T];
 
index 86b8349fa3c89cd1894f39d8172b4d02e9465873..356534a91879cde36e2ef26405b6e1030c910a7b 100644 (file)
@@ -2117,8 +2117,6 @@ impl str {
     /// This length is in bytes, not [`char`]s or graphemes. In other words,
     /// it may not be what a human considers the length of the string.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Examples
     ///
     /// Basic usage:
@@ -2590,8 +2588,6 @@ pub fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str) {
     /// Value, and may not match your idea of what a 'character' is. Iteration
     /// over grapheme clusters may be what you actually want.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Examples
     ///
     /// Basic usage:
@@ -2643,8 +2639,6 @@ pub fn chars(&self) -> Chars {
     /// The iterator yields tuples. The position is first, the [`char`] is
     /// second.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Examples
     ///
     /// Basic usage:
@@ -2946,7 +2940,6 @@ pub fn ends_with<'a, P: Pattern<'a>>(&'a self, pat: P) -> bool
     /// The pattern can be a `&str`, [`char`], or a closure that determines if
     /// a character matches.
     ///
-    /// [`char`]: primitive.char.html
     /// [`None`]: option/enum.Option.html#variant.None
     ///
     /// # Examples
@@ -2994,7 +2987,6 @@ pub fn find<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize> {
     /// The pattern can be a `&str`, [`char`], or a closure that determines if
     /// a character matches.
     ///
-    /// [`char`]: primitive.char.html
     /// [`None`]: option/enum.Option.html#variant.None
     ///
     /// # Examples
@@ -3050,7 +3042,6 @@ pub fn rfind<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize>
     /// If the pattern allows a reverse search but its results might differ
     /// from a forward search, the [`rsplit`] method can be used.
     ///
-    /// [`char`]: primitive.char.html
     /// [`rsplit`]: #method.rsplit
     ///
     /// # Examples
@@ -3157,8 +3148,6 @@ pub fn split<'a, P: Pattern<'a>>(&'a self, pat: P) -> Split<'a, P> {
     /// The pattern can be a `&str`, [`char`], or a closure that determines the
     /// split.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Iterator behavior
     ///
     /// The returned iterator requires that the pattern supports a reverse
@@ -3224,7 +3213,6 @@ pub fn rsplit<'a, P: Pattern<'a>>(&'a self, pat: P) -> RSplit<'a, P>
     /// elements. This is true for, eg, [`char`] but not for `&str`.
     ///
     /// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
-    /// [`char`]: primitive.char.html
     ///
     /// If the pattern allows a reverse search but its results might differ
     /// from a forward search, the [`rsplit_terminator`] method can be used.
@@ -3259,8 +3247,6 @@ pub fn split_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitTerminator
     /// Additional libraries might provide more complex patterns like
     /// regular expressions.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// Equivalent to [`split`], except that the trailing substring is
     /// skipped if empty.
     ///
@@ -3306,8 +3292,6 @@ pub fn rsplit_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> RSplitTerminat
     /// The pattern can be a `&str`, [`char`], or a closure that determines the
     /// split.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Iterator behavior
     ///
     /// The returned iterator will not be double ended, because it is
@@ -3361,8 +3345,6 @@ pub fn splitn<'a, P: Pattern<'a>>(&'a self, n: usize, pat: P) -> SplitN<'a, P> {
     /// The pattern can be a `&str`, [`char`], or a closure that
     /// determines the split.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Iterator behavior
     ///
     /// The returned iterator will not be double ended, because it is not
@@ -3407,8 +3389,6 @@ pub fn rsplitn<'a, P: Pattern<'a>>(&'a self, n: usize, pat: P) -> RSplitN<'a, P>
     /// The pattern can be a `&str`, [`char`], or a closure that
     /// determines if a character matches.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Iterator behavior
     ///
     /// The returned iterator will be a [`DoubleEndedIterator`] if the pattern
@@ -3416,7 +3396,6 @@ pub fn rsplitn<'a, P: Pattern<'a>>(&'a self, n: usize, pat: P) -> RSplitN<'a, P>
     /// elements. This is true for, eg, [`char`] but not for `&str`.
     ///
     /// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
-    /// [`char`]: primitive.char.html
     ///
     /// If the pattern allows a reverse search but its results might differ
     /// from a forward search, the [`rmatches`] method can be used.
@@ -3446,8 +3425,6 @@ pub fn matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> Matches<'a, P> {
     /// The pattern can be a `&str`, [`char`], or a closure that determines if
     /// a character matches.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Iterator behavior
     ///
     /// The returned iterator requires that the pattern supports a reverse
@@ -3488,8 +3465,6 @@ pub fn rmatches<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatches<'a, P>
     /// The pattern can be a `&str`, [`char`], or a closure that determines
     /// if a character matches.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Iterator behavior
     ///
     /// The returned iterator will be a [`DoubleEndedIterator`] if the pattern
@@ -3532,8 +3507,6 @@ pub fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P
     /// The pattern can be a `&str`, [`char`], or a closure that determines if a
     /// character matches.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Iterator behavior
     ///
     /// The returned iterator requires that the pattern supports a reverse
@@ -3665,8 +3638,6 @@ pub fn trim_right(&self) -> &str {
     /// The pattern can be a [`char`] or a closure that determines if a
     /// character matches.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Examples
     ///
     /// Simple patterns:
@@ -3711,8 +3682,6 @@ pub fn trim_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
     /// The pattern can be a `&str`, [`char`], or a closure that determines if
     /// a character matches.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Text directionality
     ///
     /// A string is a sequence of bytes. 'Left' in this context means the first
@@ -3750,8 +3719,6 @@ pub fn trim_left_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str {
     /// The pattern can be a `&str`, [`char`], or a closure that
     /// determines if a character matches.
     ///
-    /// [`char`]: primitive.char.html
-    ///
     /// # Text directionality
     ///
     /// A string is a sequence of bytes. 'Right' in this context means the last
index 121f93b666bcecbe3dbe4e180e1a68e5fa33473b..5a29c8528ef3a0801c9a467a4f1ec21d5abd267c 100644 (file)
@@ -13,7 +13,7 @@
             issue = "50547")]
 
 use fmt;
-use super::{Executor, Waker, LocalWaker};
+use super::{Spawn, Waker, LocalWaker};
 
 /// Information about the currently-running task.
 ///
@@ -21,7 +21,7 @@
 /// when performing a single `poll` step on a task.
 pub struct Context<'a> {
     local_waker: &'a LocalWaker,
-    executor: &'a mut dyn Executor,
+    spawner: &'a mut dyn Spawn,
 }
 
 impl<'a> fmt::Debug for Context<'a> {
@@ -32,13 +32,14 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'a> Context<'a> {
-    /// Create a new task `Context` with the provided `local_waker`, `waker`, and `executor`.
+    /// Create a new task `Context` with the provided `local_waker`, `waker`,
+    /// and `spawner`.
     #[inline]
-    pub fn new(local_waker: &'a LocalWaker, executor: &'a mut dyn Executor) -> Context<'a> {
-        Context {
-            local_waker,
-            executor,
-        }
+    pub fn new(
+        local_waker: &'a LocalWaker,
+        spawner: &'a mut dyn Spawn,
+    ) -> Context<'a> {
+        Context { local_waker, spawner }
     }
 
     /// Get the `LocalWaker` associated with the current task.
@@ -53,40 +54,45 @@ pub fn waker(&self) -> &'a Waker {
         unsafe { &*(self.local_waker as *const LocalWaker as *const Waker) }
     }
 
-    /// Get the default executor associated with this task.
+    /// Get the spawner associated with this task.
     ///
     /// This method is useful primarily if you want to explicitly handle
     /// spawn failures.
     #[inline]
-    pub fn executor(&mut self) -> &mut dyn Executor {
-        self.executor
+    pub fn spawner(&mut self) -> &mut dyn Spawn {
+        self.spawner
     }
 
-    /// Produce a context like the current one, but using the given waker instead.
+    /// Produce a context like the current one, but using the given waker
+    /// instead.
     ///
     /// This advanced method is primarily used when building "internal
     /// schedulers" within a task, where you want to provide some customized
     /// wakeup logic.
     #[inline]
-    pub fn with_waker<'b>(&'b mut self, local_waker: &'b LocalWaker) -> Context<'b> {
+    pub fn with_waker<'b>(
+        &'b mut self,
+        local_waker: &'b LocalWaker,
+    ) -> Context<'b> {
         Context {
             local_waker,
-            executor: self.executor,
+            spawner: self.spawner,
         }
     }
 
-    /// Produce a context like the current one, but using the given executor
+    /// Produce a context like the current one, but using the given spawner
     /// instead.
     ///
     /// This advanced method is primarily used when building "internal
     /// schedulers" within a task.
     #[inline]
-    pub fn with_executor<'b, E>(&'b mut self, executor: &'b mut E) -> Context<'b>
-        where E: Executor
-    {
+    pub fn with_spawner<'b, Sp: Spawn>(
+        &'b mut self,
+        spawner: &'b mut Sp,
+    ) -> Context<'b> {
         Context {
             local_waker: self.local_waker,
-            executor,
+            spawner,
         }
     }
 }
diff --git a/src/libcore/task/executor.rs b/src/libcore/task/executor.rs
deleted file mode 100644 (file)
index affcbf4..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright 2018 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.
-
-#![unstable(feature = "futures_api",
-            reason = "futures in libcore are unstable",
-            issue = "50547")]
-
-use fmt;
-use future::{FutureObj, LocalFutureObj};
-
-/// A task executor.
-///
-/// Futures are polled until completion by tasks, a kind of lightweight
-/// "thread". A *task executor* is responsible for the creation of these tasks
-/// and the coordination of their execution on real operating system threads. In
-/// particular, whenever a task signals that it can make further progress via a
-/// wake-up notification, it is the responsibility of the task executor to put
-/// the task into a queue to continue executing it, i.e. polling the future in
-/// it, later.
-pub trait Executor {
-    /// Spawns a new task with the given future. The future will be polled until
-    /// completion.
-    ///
-    /// # Errors
-    ///
-    /// The executor may be unable to spawn tasks, either because it has
-    /// been shut down or is resource-constrained.
-    fn spawn_obj(
-        &mut self,
-        future: FutureObj<'static, ()>,
-    ) -> Result<(), SpawnObjError>;
-
-    /// Determines whether the executor is able to spawn new tasks.
-    ///
-    /// # Returns
-    ///
-    /// An `Ok` return means the executor is *likely* (but not guaranteed)
-    /// to accept a subsequent spawn attempt. Likewise, an `Err` return
-    /// means that `spawn` is likely, but not guaranteed, to yield an error.
-    #[inline]
-    fn status(&self) -> Result<(), SpawnErrorKind> {
-        Ok(())
-    }
-}
-
-/// Provides the reason that an executor was unable to spawn.
-pub struct SpawnErrorKind {
-    _hidden: (),
-}
-
-impl fmt::Debug for SpawnErrorKind {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        f.debug_tuple("SpawnErrorKind")
-            .field(&"shutdown")
-            .finish()
-    }
-}
-
-impl SpawnErrorKind {
-    /// Spawning is failing because the executor has been shut down.
-    pub fn shutdown() -> SpawnErrorKind {
-        SpawnErrorKind { _hidden: () }
-    }
-
-    /// Check whether this error is the `shutdown` error.
-    pub fn is_shutdown(&self) -> bool {
-        true
-    }
-}
-
-/// The result of a failed spawn
-#[derive(Debug)]
-pub struct SpawnObjError {
-    /// The kind of error
-    pub kind: SpawnErrorKind,
-
-    /// The future for which spawning inside a task was attempted
-    pub future: FutureObj<'static, ()>,
-}
-
-/// The result of a failed spawn
-#[derive(Debug)]
-pub struct SpawnLocalObjError {
-    /// The kind of error
-    pub kind: SpawnErrorKind,
-
-    /// The future for which spawning inside a task was attempted
-    pub future: LocalFutureObj<'static, ()>,
-}
index c4f075361640f1b887e099b8c797b0ded7082265..f51e5f7ce0e311d3a37e07589e2f1cd984cd59fd 100644 (file)
 mod context;
 pub use self::context::Context;
 
-mod executor;
-pub use self::executor::{
-  Executor, SpawnErrorKind, SpawnObjError, SpawnLocalObjError
-};
+mod spawn;
+pub use self::spawn::{Spawn, SpawnErrorKind, SpawnObjError, SpawnLocalObjError};
 
 mod poll;
 pub use self::poll::Poll;
diff --git a/src/libcore/task/spawn.rs b/src/libcore/task/spawn.rs
new file mode 100644 (file)
index 0000000..58ee85d
--- /dev/null
@@ -0,0 +1,93 @@
+// Copyright 2018 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.
+
+#![unstable(feature = "futures_api",
+            reason = "futures in libcore are unstable",
+            issue = "50547")]
+
+use fmt;
+use future::{FutureObj, LocalFutureObj};
+
+/// Spawns tasks that poll futures to completion onto its associated task
+/// executor.
+///
+/// The term "task" refers to a kind of lightweight "thread". Task executors
+/// are responsible for scheduling the execution of tasks on operating system
+/// threads.
+pub trait Spawn {
+    /// Spawns a new task with the given future. The future will be polled until
+    /// completion.
+    ///
+    /// # Errors
+    ///
+    /// The executor may be unable to spawn tasks, either because it has
+    /// been shut down or is resource-constrained.
+    fn spawn_obj(
+        &mut self,
+        future: FutureObj<'static, ()>,
+    ) -> Result<(), SpawnObjError>;
+
+    /// Determines whether the executor is able to spawn new tasks.
+    ///
+    /// # Returns
+    ///
+    /// An `Ok` return means the executor is *likely* (but not guaranteed)
+    /// to accept a subsequent spawn attempt. Likewise, an `Err` return
+    /// means that `spawn` is likely, but not guaranteed, to yield an error.
+    #[inline]
+    fn status(&self) -> Result<(), SpawnErrorKind> {
+        Ok(())
+    }
+}
+
+/// Provides the reason that an executor was unable to spawn.
+pub struct SpawnErrorKind {
+    _hidden: (),
+}
+
+impl fmt::Debug for SpawnErrorKind {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_tuple("SpawnErrorKind")
+            .field(&"shutdown")
+            .finish()
+    }
+}
+
+impl SpawnErrorKind {
+    /// Spawning is failing because the executor has been shut down.
+    pub fn shutdown() -> SpawnErrorKind {
+        SpawnErrorKind { _hidden: () }
+    }
+
+    /// Check whether this error is the `shutdown` error.
+    pub fn is_shutdown(&self) -> bool {
+        true
+    }
+}
+
+/// The result of a failed spawn
+#[derive(Debug)]
+pub struct SpawnObjError {
+    /// The kind of error
+    pub kind: SpawnErrorKind,
+
+    /// The future for which spawning inside a task was attempted
+    pub future: FutureObj<'static, ()>,
+}
+
+/// The result of a failed spawn
+#[derive(Debug)]
+pub struct SpawnLocalObjError {
+    /// The kind of error
+    pub kind: SpawnErrorKind,
+
+    /// The future for which spawning inside a task was attempted
+    pub future: LocalFutureObj<'static, ()>,
+}
index 2323b30a0104a132a2450a512a2aef0f0cd71dc6..fc92a5a222512a660da46ce339ae631b3220db37 100644 (file)
@@ -8,18 +8,14 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(ascii_ctype)]
 #![feature(box_syntax)]
 #![feature(cell_update)]
-#![feature(core_float)]
 #![feature(core_private_bignum)]
 #![feature(core_private_diy_float)]
 #![feature(dec2flt)]
-#![feature(decode_utf8)]
 #![feature(euclidean_division)]
 #![feature(exact_size_is_empty)]
 #![feature(fixed_size_array)]
-#![feature(float_internals)]
 #![feature(flt2dec)]
 #![feature(fmt_internals)]
 #![feature(hashmap_internals)]
@@ -29,7 +25,6 @@
 #![feature(refcell_map_split)]
 #![feature(refcell_replace_swap)]
 #![feature(slice_patterns)]
-#![feature(slice_rotate)]
 #![feature(sort_internals)]
 #![feature(specialization)]
 #![feature(step_trait)]
index b6d23ed45d72918239c0bfac11dc547895e59b81..6bdbf5dc937459bd10e6bc4dc52b0adbd8cf4358 160000 (submodule)
@@ -1 +1 @@
-Subproject commit b6d23ed45d72918239c0bfac11dc547895e59b81
+Subproject commit 6bdbf5dc937459bd10e6bc4dc52b0adbd8cf4358
index 5c320bb369e709b63024f43b7f00bf846abf29e4..2abdf7cee63210e46ee43e8e312d1f2080a78198 100644 (file)
@@ -39,7 +39,6 @@
 #![feature(staged_api)]
 #![feature(std_internals)]
 #![feature(unwind_attributes)]
-#![cfg_attr(target_env = "msvc", feature(raw))]
 
 #![panic_runtime]
 #![feature(panic_runtime)]
index 14a818ddafb710f09f8197d853480d097347fb23..b7281cf0445cdf0a30c72cfc7f5c44030a215d4f 100644 (file)
@@ -615,7 +615,9 @@ pub fn fingerprint_needed_for_crate_hash(self) -> bool {
     [input] CrateName(CrateNum),
     [] ItemChildren(DefId),
     [] ExternModStmtCnum(DefId),
-    [input] GetLangItems,
+    [eval_always] GetLibFeatures,
+    [] DefinedLibFeatures(CrateNum),
+    [eval_always] GetLangItems,
     [] DefinedLangItems(CrateNum),
     [] MissingLangItems(CrateNum),
     [] VisibleParentMap,
index 5ace8397d9f827bbf17b434ddb8f0edd10edd44a..a3c0688dcc8edcaad3955249d64f03ba0cd7ab8c 100644 (file)
@@ -1918,6 +1918,30 @@ fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
 ```
 "##,
 
+E0635: r##"
+The `#![feature]` attribute specified an unknown feature.
+
+Erroneous code example:
+
+```compile_fail,E0635
+#![feature(nonexistent_rust_feature)] // error: unknown feature
+```
+
+"##,
+
+E0636: r##"
+A `#![feature]` attribute was declared multiple times.
+
+Erroneous code example:
+
+```compile_fail,E0636
+#![allow(stable_features)]
+#![feature(rust1)]
+#![feature(rust1)] // error: the feature `rust1` has already been declared
+```
+
+"##,
+
 E0644: r##"
 A closure or generator was constructed that references its own type.
 
@@ -2138,4 +2162,5 @@ trait Foo { }
     E0708, // `async` non-`move` closures with arguments are not currently supported
     E0709, // multiple different lifetimes used in arguments of `async fn`
     E0710, // an unknown tool name found in scoped lint
+    E0711, // a feature has been declared with conflicting stability attributes
 }
index cb5e1e600d3d2e8659b21d7bdcc8cc84231dd5a3..4a14223eb88f78b4b6b23f90e6c3e24270a471b2 100644 (file)
@@ -28,6 +28,18 @@ pub enum CtorKind {
     Fictive,
 }
 
+#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
+pub enum NonMacroAttrKind {
+    /// Single-segment attribute defined by the language (`#[inline]`)
+    Builtin,
+    /// Multi-segment custom attribute living in a "tool module" (`#[rustfmt::skip]`).
+    Tool,
+    /// Single-segment custom attribute registered by a derive macro (`#[serde(default)]`).
+    DeriveHelper,
+    /// Single-segment custom attribute not registered in any way (`#[my_attr]`).
+    Custom,
+}
+
 #[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
 pub enum Def {
     // Type namespace
@@ -68,9 +80,7 @@ pub enum Def {
 
     // Macro namespace
     Macro(DefId, MacroKind),
-    NonMacroAttr, // e.g. `#[inline]` or `#[rustfmt::skip]`
-
-    GlobalAsm(DefId),
+    NonMacroAttr(NonMacroAttrKind), // e.g. `#[inline]` or `#[rustfmt::skip]`
 
     // Both namespaces
     Err,
@@ -242,6 +252,17 @@ pub fn from_hir(vdata: &hir::VariantData) -> CtorKind {
     }
 }
 
+impl NonMacroAttrKind {
+    fn descr(self) -> &'static str {
+        match self {
+            NonMacroAttrKind::Builtin => "built-in attribute",
+            NonMacroAttrKind::Tool => "tool attribute",
+            NonMacroAttrKind::DeriveHelper => "derive helper attribute",
+            NonMacroAttrKind::Custom => "custom attribute",
+        }
+    }
+}
+
 impl Def {
     pub fn def_id(&self) -> DefId {
         match *self {
@@ -251,8 +272,7 @@ pub fn def_id(&self) -> DefId {
             Def::AssociatedTy(id) | Def::TyParam(id) | Def::Struct(id) | Def::StructCtor(id, ..) |
             Def::Union(id) | Def::Trait(id) | Def::Method(id) | Def::Const(id) |
             Def::AssociatedConst(id) | Def::Macro(id, ..) |
-            Def::Existential(id) | Def::AssociatedExistential(id) |
-            Def::GlobalAsm(id) | Def::TyForeign(id) => {
+            Def::Existential(id) | Def::AssociatedExistential(id) | Def::TyForeign(id) => {
                 id
             }
 
@@ -262,7 +282,7 @@ pub fn def_id(&self) -> DefId {
             Def::PrimTy(..) |
             Def::SelfTy(..) |
             Def::ToolMod |
-            Def::NonMacroAttr |
+            Def::NonMacroAttr(..) |
             Def::Err => {
                 bug!("attempted .def_id() on invalid def: {:?}", self)
             }
@@ -302,9 +322,8 @@ pub fn kind_name(&self) -> &'static str {
             Def::Label(..) => "label",
             Def::SelfTy(..) => "self type",
             Def::Macro(.., macro_kind) => macro_kind.descr(),
-            Def::GlobalAsm(..) => "global asm",
             Def::ToolMod => "tool module",
-            Def::NonMacroAttr => "non-macro attribute",
+            Def::NonMacroAttr(attr_kind) => attr_kind.descr(),
             Def::Err => "unresolved item",
         }
     }
index 4274cd3a0a6559e6759a13b5734714503f22588c..d853d3d9a7fb4975601bc311b1c538455d131c4d 100644 (file)
@@ -353,10 +353,10 @@ fn visit_generic_arg(&mut self, generic_arg: &'v GenericArg) {
     fn visit_lifetime(&mut self, lifetime: &'v Lifetime) {
         walk_lifetime(self, lifetime)
     }
-    fn visit_qpath(&mut self, qpath: &'v QPath, id: NodeId, span: Span) {
+    fn visit_qpath(&mut self, qpath: &'v QPath, id: HirId, span: Span) {
         walk_qpath(self, qpath, id, span)
     }
-    fn visit_path(&mut self, path: &'v Path, _id: NodeId) {
+    fn visit_path(&mut self, path: &'v Path, _id: HirId) {
         walk_path(self, path)
     }
     fn visit_path_segment(&mut self, path_span: Span, path_segment: &'v PathSegment) {
@@ -456,7 +456,7 @@ pub fn walk_trait_ref<'v, V>(visitor: &mut V, trait_ref: &'v TraitRef)
     where V: Visitor<'v>
 {
     visitor.visit_id(trait_ref.ref_id);
-    visitor.visit_path(&trait_ref.path, trait_ref.ref_id)
+    visitor.visit_path(&trait_ref.path, trait_ref.hir_ref_id)
 }
 
 pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
@@ -471,7 +471,7 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
         }
         ItemKind::Use(ref path, _) => {
             visitor.visit_id(item.id);
-            visitor.visit_path(path, item.id);
+            visitor.visit_path(path, item.hir_id);
         }
         ItemKind::Static(ref typ, _, body) |
         ItemKind::Const(ref typ, body) => {
@@ -602,7 +602,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
             visitor.visit_fn_decl(&function_declaration.decl);
         }
         TyKind::Path(ref qpath) => {
-            visitor.visit_qpath(qpath, typ.id, typ.span);
+            visitor.visit_qpath(qpath, typ.hir_id, typ.span);
         }
         TyKind::Array(ref ty, ref length) => {
             visitor.visit_ty(ty);
@@ -621,7 +621,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
     }
 }
 
-pub fn walk_qpath<'v, V: Visitor<'v>>(visitor: &mut V, qpath: &'v QPath, id: NodeId, span: Span) {
+pub fn walk_qpath<'v, V: Visitor<'v>>(visitor: &mut V, qpath: &'v QPath, id: HirId, span: Span) {
     match *qpath {
         QPath::Resolved(ref maybe_qself, ref path) => {
             if let Some(ref qself) = *maybe_qself {
@@ -670,14 +670,14 @@ pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat) {
     visitor.visit_id(pattern.id);
     match pattern.node {
         PatKind::TupleStruct(ref qpath, ref children, _) => {
-            visitor.visit_qpath(qpath, pattern.id, pattern.span);
+            visitor.visit_qpath(qpath, pattern.hir_id, pattern.span);
             walk_list!(visitor, visit_pat, children);
         }
         PatKind::Path(ref qpath) => {
-            visitor.visit_qpath(qpath, pattern.id, pattern.span);
+            visitor.visit_qpath(qpath, pattern.hir_id, pattern.span);
         }
         PatKind::Struct(ref qpath, ref fields, _) => {
-            visitor.visit_qpath(qpath, pattern.id, pattern.span);
+            visitor.visit_qpath(qpath, pattern.hir_id, pattern.span);
             for field in fields {
                 visitor.visit_id(field.node.id);
                 visitor.visit_ident(field.node.ident);
@@ -985,7 +985,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
             visitor.visit_anon_const(count)
         }
         ExprKind::Struct(ref qpath, ref fields, ref optional_base) => {
-            visitor.visit_qpath(qpath, expression.id, expression.span);
+            visitor.visit_qpath(qpath, expression.hir_id, expression.span);
             for field in fields {
                 visitor.visit_id(field.id);
                 visitor.visit_ident(field.ident);
@@ -1062,7 +1062,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
             visitor.visit_expr(index_expression)
         }
         ExprKind::Path(ref qpath) => {
-            visitor.visit_qpath(qpath, expression.id, expression.span);
+            visitor.visit_qpath(qpath, expression.hir_id, expression.span);
         }
         ExprKind::Break(ref destination, ref opt_expr) => {
             if let Some(ref label) = destination.label {
@@ -1108,9 +1108,9 @@ pub fn walk_arm<'v, V: Visitor<'v>>(visitor: &mut V, arm: &'v Arm) {
 }
 
 pub fn walk_vis<'v, V: Visitor<'v>>(visitor: &mut V, vis: &'v Visibility) {
-    if let VisibilityKind::Restricted { ref path, id } = vis.node {
+    if let VisibilityKind::Restricted { ref path, id, hir_id } = vis.node {
         visitor.visit_id(id);
-        visitor.visit_path(path, id)
+        visitor.visit_path(path, hir_id)
     }
 }
 
index 4b69e3b6bc70db8d0db5ba99597f68e0b9f649d6..6b66fd8a2b2ff0af74171613dd0f8503624296a3 100644 (file)
@@ -123,8 +123,8 @@ pub struct LoweringContext<'a> {
     // Whether or not in-band lifetimes are being collected. This is used to
     // indicate whether or not we're in a place where new lifetimes will result
     // in in-band lifetime definitions, such a function or an impl header.
-    // This will always be false unless the `in_band_lifetimes` feature is
-    // enabled.
+    // This will always be false unless the `in_band_lifetimes` or
+    // `impl_header_lifetime_elision` feature is enabled.
     is_collecting_in_band_lifetimes: bool,
 
     // Currently in-scope lifetimes defined in impl headers, fn headers, or HRTB.
@@ -658,9 +658,11 @@ fn collect_in_band_defs<T, F>(
         assert!(self.lifetimes_to_define.is_empty());
         let old_anonymous_lifetime_mode = self.anonymous_lifetime_mode;
 
-        self.is_collecting_in_band_lifetimes = self.sess.features_untracked().in_band_lifetimes;
-        if self.is_collecting_in_band_lifetimes {
+        if self.sess.features_untracked().impl_header_lifetime_elision {
             self.anonymous_lifetime_mode = anonymous_lifetime_mode;
+            self.is_collecting_in_band_lifetimes = true;
+        } else if self.sess.features_untracked().in_band_lifetimes {
+            self.is_collecting_in_band_lifetimes = true;
         }
 
         let (in_band_ty_params, res) = f(self);
@@ -718,6 +720,10 @@ fn maybe_collect_in_band_lifetime(&mut self, ident: Ident) {
             return;
         }
 
+        if !self.sess.features_untracked().in_band_lifetimes {
+            return;
+        }
+
         if self.in_scope_lifetimes.contains(&ident.modern()) {
             return;
         }
@@ -2149,12 +2155,14 @@ fn visit_lifetime(&mut self, lifetime: &'v hir::Lifetime) {
             let future_path =
                 this.std_path(span, &["future", "Future"], Some(future_params), false);
 
+            let LoweredNodeId { node_id, hir_id } = this.next_id();
             let mut bounds = vec![
                 hir::GenericBound::Trait(
                     hir::PolyTraitRef {
                         trait_ref: hir::TraitRef {
                             path: future_path,
-                            ref_id: this.next_id().node_id,
+                            ref_id: node_id,
+                            hir_ref_id: hir_id,
                         },
                         bound_generic_params: hir_vec![],
                         span,
@@ -2476,9 +2484,11 @@ fn lower_trait_ref(&mut self, p: &TraitRef, itctx: ImplTraitContext) -> hir::Tra
             hir::QPath::Resolved(None, path) => path.and_then(|path| path),
             qpath => bug!("lower_trait_ref: unexpected QPath `{:?}`", qpath),
         };
+        let LoweredNodeId { node_id, hir_id } = self.lower_node_id(p.ref_id);
         hir::TraitRef {
             path,
-            ref_id: self.lower_node_id(p.ref_id).node_id,
+            ref_id: node_id,
+            hir_ref_id: hir_id,
         }
     }
 
@@ -2837,11 +2847,13 @@ fn lower_use_tree(
                             hir::VisibilityKind::Public => hir::VisibilityKind::Public,
                             hir::VisibilityKind::Crate(sugar) => hir::VisibilityKind::Crate(sugar),
                             hir::VisibilityKind::Inherited => hir::VisibilityKind::Inherited,
-                            hir::VisibilityKind::Restricted { ref path, id: _ } => {
+                            hir::VisibilityKind::Restricted { ref path, id: _, hir_id: _ } => {
+                                let id = this.next_id();
                                 hir::VisibilityKind::Restricted {
                                     path: path.clone(),
                                     // We are allocating a new NodeId here
-                                    id: this.next_id().node_id,
+                                    id: id.node_id,
+                                    hir_id: id.hir_id,
                                 }
                             }
                         };
@@ -2910,11 +2922,13 @@ fn lower_use_tree(
                             hir::VisibilityKind::Public => hir::VisibilityKind::Public,
                             hir::VisibilityKind::Crate(sugar) => hir::VisibilityKind::Crate(sugar),
                             hir::VisibilityKind::Inherited => hir::VisibilityKind::Inherited,
-                            hir::VisibilityKind::Restricted { ref path, id: _ } => {
+                            hir::VisibilityKind::Restricted { ref path, id: _, hir_id: _ } => {
+                                let id = this.next_id();
                                 hir::VisibilityKind::Restricted {
                                     path: path.clone(),
                                     // We are allocating a new NodeId here
-                                    id: this.next_id().node_id,
+                                    id: id.node_id,
+                                    hir_id: id.hir_id,
                                 }
                             }
                         };
@@ -4344,13 +4358,17 @@ fn lower_visibility(
         let node = match v.node {
             VisibilityKind::Public => hir::VisibilityKind::Public,
             VisibilityKind::Crate(sugar) => hir::VisibilityKind::Crate(sugar),
-            VisibilityKind::Restricted { ref path, id } => hir::VisibilityKind::Restricted {
-                path: P(self.lower_path(id, path, ParamMode::Explicit)),
-                id: if let Some(owner) = explicit_owner {
-                    self.lower_node_id_with_owner(id, owner).node_id
+            VisibilityKind::Restricted { ref path, id } => {
+                let lowered_id = if let Some(owner) = explicit_owner {
+                    self.lower_node_id_with_owner(id, owner)
                 } else {
-                    self.lower_node_id(id).node_id
-                },
+                    self.lower_node_id(id)
+                };
+                hir::VisibilityKind::Restricted {
+                    path: P(self.lower_path(id, path, ParamMode::Explicit)),
+                    id: lowered_id.node_id,
+                    hir_id: lowered_id.hir_id,
+                }
             },
             VisibilityKind::Inherited => hir::VisibilityKind::Inherited,
         };
@@ -4669,6 +4687,7 @@ fn ty_path(&mut self, id: LoweredNodeId, span: Span, qpath: hir::QPath) -> hir::
                         trait_ref: hir::TraitRef {
                             path: path.and_then(|path| path),
                             ref_id: id.node_id,
+                            hir_ref_id: id.hir_id,
                         },
                         span,
                     };
index 49231e58cf0fc574d39cad754c6f46cea58dbf22..b05bcadf82649daa57cb8573a60d2a613ce8263a 100644 (file)
@@ -432,7 +432,6 @@ pub fn describe_def(&self, node_id: NodeId) -> Option<Def> {
                     ItemKind::Const(..) => Some(Def::Const(def_id())),
                     ItemKind::Fn(..) => Some(Def::Fn(def_id())),
                     ItemKind::Mod(..) => Some(Def::Mod(def_id())),
-                    ItemKind::GlobalAsm(..) => Some(Def::GlobalAsm(def_id())),
                     ItemKind::Existential(..) => Some(Def::Existential(def_id())),
                     ItemKind::Ty(..) => Some(Def::TyAlias(def_id())),
                     ItemKind::Enum(..) => Some(Def::Enum(def_id())),
@@ -445,6 +444,7 @@ pub fn describe_def(&self, node_id: NodeId) -> Option<Def> {
                     ItemKind::ExternCrate(_) |
                     ItemKind::Use(..) |
                     ItemKind::ForeignMod(..) |
+                    ItemKind::GlobalAsm(..) |
                     ItemKind::Impl(..) => None,
                 }
             }
index 610add90b8577253eaee6501e7d8b535a9425cfb..0003790e6d552cfc066ed946c8789206b4f1f8c5 100644 (file)
@@ -1912,6 +1912,7 @@ pub enum UseKind {
 pub struct TraitRef {
     pub path: Path,
     pub ref_id: NodeId,
+    pub hir_ref_id: HirId,
 }
 
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
@@ -1931,7 +1932,7 @@ pub struct PolyTraitRef {
 pub enum VisibilityKind {
     Public,
     Crate(CrateSugar),
-    Restricted { path: P<Path>, id: NodeId },
+    Restricted { path: P<Path>, id: NodeId, hir_id: HirId },
     Inherited,
 }
 
index cac0d182d3a48923c43ad897e4c7ab32dc0cf4a1..76e57558bfe072be3dac8cdf594a9b81fd33d00e 100644 (file)
@@ -360,6 +360,7 @@ fn hash_stable<W: StableHasherResult>(&self,
 impl_stable_hash_for!(struct hir::TraitRef {
     // Don't hash the ref_id. It is tracked via the thing it is used to access
     ref_id -> _,
+    hir_ref_id -> _,
     path,
 });
 
@@ -723,9 +724,10 @@ fn hash_stable<W: StableHasherResult>(&self,
             hir::VisibilityKind::Crate(sugar) => {
                 sugar.hash_stable(hcx, hasher);
             }
-            hir::VisibilityKind::Restricted { ref path, id } => {
+            hir::VisibilityKind::Restricted { ref path, id, hir_id } => {
                 hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
                     id.hash_stable(hcx, hasher);
+                    hir_id.hash_stable(hcx, hasher);
                 });
                 path.hash_stable(hcx, hasher);
             }
@@ -988,6 +990,13 @@ fn to_stable_hash_key(&self,
     Fictive
 });
 
+impl_stable_hash_for!(enum hir::def::NonMacroAttrKind {
+    Builtin,
+    Tool,
+    DeriveHelper,
+    Custom,
+});
+
 impl_stable_hash_for!(enum hir::def::Def {
     Mod(def_id),
     Struct(def_id),
@@ -1015,9 +1024,8 @@ fn to_stable_hash_key(&self,
     Upvar(def_id, index, expr_id),
     Label(node_id),
     Macro(def_id, macro_kind),
-    GlobalAsm(def_id),
     ToolMod,
-    NonMacroAttr,
+    NonMacroAttr(attr_kind),
     Err
 });
 
@@ -1072,6 +1080,11 @@ fn to_stable_hash_key(&self, hcx: &StableHashingContext<'a>) -> DefPathHash {
     span
 });
 
+impl_stable_hash_for!(struct ::middle::lib_features::LibFeatures {
+    stable,
+    unstable
+});
+
 impl<'a> HashStable<StableHashingContext<'a>> for ::middle::lang_items::LangItem {
     fn hash_stable<W: StableHasherResult>(&self,
                                           _: &mut StableHashingContext<'a>,
index 2ab0124397bbb1b1a8749e153e5ef6057a77f9a2..d086d3bd28df00227bda9bedc7b92467270a8873 100644 (file)
@@ -511,7 +511,7 @@ fn hash_stable<W: StableHasherResult>(&self,
                                           hasher: &mut StableHasher<W>) {
         // Unfortunately we cannot exhaustively list fields here, since the
         // struct is macro generated.
-        self.declared_stable_lang_features.hash_stable(hcx, hasher);
+        self.declared_lang_features.hash_stable(hcx, hasher);
         self.declared_lib_features.hash_stable(hcx, hasher);
 
         self.walk_feature_fields(|feature_name, value| {
index 90248e89fa73a395ecbb99511a345e3158e8a961..212821cac2e4aa53d9d5fcdae750d7656c8becb4 100644 (file)
@@ -303,7 +303,14 @@ pub fn report_region_errors(
     ) {
         debug!("report_region_errors(): {} errors to start", errors.len());
 
-        if will_later_be_reported_by_nll && self.tcx.use_mir_borrowck() {
+        if will_later_be_reported_by_nll &&
+            // FIXME: `use_mir_borrowck` seems wrong here...
+            self.tcx.use_mir_borrowck() &&
+            // ... this is a band-aid; may be better to explicitly
+            // match on every borrowck_mode variant to guide decision
+            // here.
+            !self.tcx.migrate_borrowck() {
+
             // With `#![feature(nll)]`, we want to present a nice user
             // experience, so don't even mention the errors from the
             // AST checker.
index f50c23b0aa75209e498c70f3d2df5ddb2d546a9b..ddeb291a13aa32b2a82a233387db7cdca51e903a 100644 (file)
@@ -64,6 +64,12 @@ pub fn new_from_span(
         Self { tcx, error: None, regions: Some((span, sub, sup)), tables }
     }
 
+    pub fn try_report_from_nll(&self) -> Option<ErrorReported> {
+        // Due to the improved diagnostics returned by the MIR borrow checker, only a subset of
+        // the nice region errors are required when running under the MIR borrow checker.
+        self.try_report_named_anon_conflict()
+    }
+
     pub fn try_report(&self) -> Option<ErrorReported> {
         self.try_report_named_anon_conflict()
             .or_else(|| self.try_report_anon_anon_conflict())
index 51abfa2505ab5cf49943000072e1493d6f50faad..ca71b0aeed9a56b3309f2c6d5bd5f2211993ba67 100644 (file)
@@ -65,9 +65,10 @@ pub(super) fn try_report_named_anon_conflict(&self) -> Option<ErrorReported> {
             region_info
         );
 
-        let (arg, new_ty, br, is_first, scope_def_id, is_impl_item) = (
+        let (arg, new_ty, new_ty_span, br, is_first, scope_def_id, is_impl_item) = (
             anon_arg_info.arg,
             anon_arg_info.arg_ty,
+            anon_arg_info.arg_ty_span,
             anon_arg_info.bound_region,
             anon_arg_info.is_first,
             region_info.def_id,
@@ -110,9 +111,10 @@ pub(super) fn try_report_named_anon_conflict(&self) -> Option<ErrorReported> {
             E0621,
             "explicit lifetime required in {}",
             error_var
-        ).span_label(
-            arg.pat.span,
-            format!("consider changing {} to `{}`", span_label_var, new_ty),
+        ).span_suggestion(
+            new_ty_span,
+            &format!("add explicit lifetime `{}` to {}", named, span_label_var),
+            new_ty.to_string()
         )
             .span_label(span, format!("lifetime `{}` required", named))
             .emit();
index 1cc2b9d50b99ba1eb57de1f4bd1526558be7c1eb..28320ce3ad1ba8392e4805952c0d591209fc2ac9 100644 (file)
@@ -27,6 +27,8 @@ pub(super) struct AnonymousArgInfo<'tcx> {
     pub arg_ty: Ty<'tcx>,
     // the ty::BoundRegion corresponding to the anonymous region
     pub bound_region: ty::BoundRegion,
+    // arg_ty_span contains span of argument type
+    pub arg_ty_span : Span,
     // corresponds to id the argument is the first parameter
     // in the declaration
     pub is_first: bool,
@@ -74,12 +76,16 @@ pub(super) fn find_arg_with_region(
         if let Some(node_id) = hir.as_local_node_id(id) {
             if let Some(body_id) = hir.maybe_body_owned_by(node_id) {
                 let body = hir.body(body_id);
+                let owner_id = hir.body_owner(body_id);
+                let fn_decl = hir.fn_decl(owner_id).unwrap();
                 if let Some(tables) = self.tables {
                     body.arguments
                         .iter()
                         .enumerate()
                         .filter_map(|(index, arg)| {
                             // May return None; sometimes the tables are not yet populated.
+                            let ty_hir_id = fn_decl.inputs[index].hir_id;
+                            let arg_ty_span = hir.span(hir.hir_to_node_id(ty_hir_id));
                             let ty = tables.node_id_to_type_opt(arg.hir_id)?;
                             let mut found_anon_region = false;
                             let new_arg_ty = self.tcx.fold_regions(&ty, &mut false, |r, _| {
@@ -95,6 +101,7 @@ pub(super) fn find_arg_with_region(
                                 Some(AnonymousArgInfo {
                                     arg: arg,
                                     arg_ty: new_arg_ty,
+                                    arg_ty_span : arg_ty_span,
                                     bound_region: bound_region,
                                     is_first: is_first,
                                 })
index bac511aac1fe10108f01adb76258d4df01fdcbdf..804481846afdcc63ac03421febfa6cc1f816ad16 100644 (file)
@@ -45,8 +45,6 @@
 #![feature(const_fn)]
 #![feature(core_intrinsics)]
 #![feature(drain_filter)]
-#![feature(from_ref)]
-#![feature(fs_read_write)]
 #![feature(iterator_find_map)]
 #![cfg_attr(windows, feature(libc))]
 #![feature(macro_vis_matcher)]
@@ -70,9 +68,9 @@
 #![feature(step_trait)]
 #![feature(integer_atomics)]
 #![feature(test)]
+#![cfg_attr(not(stage0), feature(impl_header_lifetime_elision))]
 #![feature(in_band_lifetimes)]
 #![feature(macro_at_most_once_rep)]
-#![feature(inclusive_range_methods)]
 #![feature(crate_in_paths)]
 
 #![recursion_limit="512"]
@@ -141,6 +139,7 @@ pub mod middle {
     pub mod exported_symbols;
     pub mod free_region;
     pub mod intrinsicck;
+    pub mod lib_features;
     pub mod lang_items;
     pub mod liveness;
     pub mod mem_categorization;
index 47f7c759d94ec12607193754ab1b204f2340ff3c..590b59568c4aa398a5f9f0371e4f7597efc45db8 100644 (file)
 declare_lint! {
     pub UNUSED_FEATURES,
     Warn,
-    "unused or unknown features found in crate-level #[feature] directives"
+    "unused features found in crate-level #[feature] directives"
 }
 
 declare_lint! {
index 15630157722fa502ea3c715648c4ad01f7508914..315ed38ad07703fc14566a3efe808490d6253826 100644 (file)
@@ -869,7 +869,7 @@ fn visit_lifetime(&mut self, lt: &'tcx hir::Lifetime) {
         hir_visit::walk_lifetime(self, lt);
     }
 
-    fn visit_path(&mut self, p: &'tcx hir::Path, id: ast::NodeId) {
+    fn visit_path(&mut self, p: &'tcx hir::Path, id: hir::HirId) {
         run_lints!(self, check_path, p, id);
         hir_visit::walk_path(self, p);
     }
index d267c1812773b07ab6116b4bd3851af2326a6c7e..231a70f873fdc833bb9f2a1163063f28db59e7de 100644 (file)
@@ -242,7 +242,7 @@ fn check_struct_def_post(
             fn check_variant(a: &$hir hir::Variant, b: &$hir hir::Generics);
             fn check_variant_post(a: &$hir hir::Variant, b: &$hir hir::Generics);
             fn check_lifetime(a: &$hir hir::Lifetime);
-            fn check_path(a: &$hir hir::Path, b: ast::NodeId);
+            fn check_path(a: &$hir hir::Path, b: hir::HirId);
             fn check_attribute(a: &$hir ast::Attribute);
 
             /// Called when entering a syntax node that can have lint attributes such
index 0f889549b58e39ddd058b0db12e96262a02adce5..d0e3ae2b9fc465254b731ae70cbe57c5d6a4457b 100644 (file)
@@ -279,7 +279,7 @@ fn visit_pat(&mut self, pat: &'tcx hir::Pat) {
         self.in_pat = false;
     }
 
-    fn visit_path(&mut self, path: &'tcx hir::Path, _: ast::NodeId) {
+    fn visit_path(&mut self, path: &'tcx hir::Path, _: hir::HirId) {
         self.handle_definition(path.def);
         intravisit::walk_path(self, path);
     }
diff --git a/src/librustc/middle/lib_features.rs b/src/librustc/middle/lib_features.rs
new file mode 100644 (file)
index 0000000..47c6bfb
--- /dev/null
@@ -0,0 +1,178 @@
+// Copyright 2018 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.
+
+// Detecting lib features (i.e. features that are not lang features).
+//
+// These are declared using stability attributes (e.g. `#[stable (..)]`
+// and `#[unstable (..)]`), but are not declared in one single location
+// (unlike lang features), which means we need to collect them instead.
+
+use ty::TyCtxt;
+use syntax::symbol::Symbol;
+use syntax::ast::{Attribute, MetaItem, MetaItemKind};
+use syntax_pos::{Span, DUMMY_SP};
+use hir;
+use hir::itemlikevisit::ItemLikeVisitor;
+use rustc_data_structures::fx::{FxHashSet, FxHashMap};
+use errors::DiagnosticId;
+
+pub struct LibFeatures {
+    // A map from feature to stabilisation version.
+    pub stable: FxHashMap<Symbol, Symbol>,
+    pub unstable: FxHashSet<Symbol>,
+}
+
+impl LibFeatures {
+    fn new() -> LibFeatures {
+        LibFeatures {
+            stable: FxHashMap(),
+            unstable: FxHashSet(),
+        }
+    }
+
+    pub fn to_vec(&self) -> Vec<(Symbol, Option<Symbol>)> {
+        let mut all_features: Vec<_> = self.stable.iter().map(|(f, s)| (*f, Some(*s)))
+            .chain(self.unstable.iter().map(|f| (*f, None)))
+            .collect();
+        all_features.sort_unstable_by_key(|f| f.0.as_str());
+        all_features
+    }
+}
+
+pub struct LibFeatureCollector<'a, 'tcx: 'a> {
+    tcx: TyCtxt<'a, 'tcx, 'tcx>,
+    lib_features: LibFeatures,
+}
+
+impl<'a, 'tcx> LibFeatureCollector<'a, 'tcx> {
+    fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> LibFeatureCollector<'a, 'tcx> {
+        LibFeatureCollector {
+            tcx,
+            lib_features: LibFeatures::new(),
+        }
+    }
+
+    fn extract(&self, attrs: &[Attribute]) -> Vec<(Symbol, Option<Symbol>, Span)> {
+        let stab_attrs = vec!["stable", "unstable", "rustc_const_unstable"];
+        let mut features = vec![];
+
+        for attr in attrs {
+            // Find a stability attribute (i.e. `#[stable (..)]`, `#[unstable (..)]`,
+            // `#[rustc_const_unstable (..)]`).
+            if let Some(stab_attr) = stab_attrs.iter().find(|stab_attr| {
+                attr.check_name(stab_attr)
+            }) {
+                let meta_item = attr.meta();
+                if let Some(MetaItem { node: MetaItemKind::List(ref metas), .. }) = meta_item {
+                    let mut feature = None;
+                    let mut since = None;
+                    for meta in metas {
+                        if let Some(mi) = meta.meta_item() {
+                            // Find the `feature = ".."` meta-item.
+                            match (&*mi.name().as_str(), mi.value_str()) {
+                                ("feature", val) => feature = val,
+                                ("since", val) => since = val,
+                                _ => {}
+                            }
+                        }
+                    }
+                    if let Some(feature) = feature {
+                        // This additional check for stability is to make sure we
+                        // don't emit additional, irrelevant errors for malformed
+                        // attributes.
+                        if *stab_attr != "stable" || since.is_some() {
+                            features.push((feature, since, attr.span));
+                        }
+                    }
+                    // We need to iterate over the other attributes, because
+                    // `rustc_const_unstable` is not mutually exclusive with
+                    // the other stability attributes, so we can't just `break`
+                    // here.
+                }
+            }
+        }
+
+        features
+    }
+
+    fn collect_feature(&mut self, feature: Symbol, since: Option<Symbol>, span: Span) {
+        let already_in_stable = self.lib_features.stable.contains_key(&feature);
+        let already_in_unstable = self.lib_features.unstable.contains(&feature);
+
+        match (since, already_in_stable, already_in_unstable) {
+            (Some(since), _, false) => {
+                if let Some(prev_since) = self.lib_features.stable.get(&feature) {
+                    if *prev_since != since {
+                        let msg = format!(
+                            "feature `{}` is declared stable since {}, \
+                             but was previously declared stable since {}",
+                            feature,
+                            since,
+                            prev_since,
+                        );
+                        self.tcx.sess.struct_span_err_with_code(span, &msg,
+                            DiagnosticId::Error("E0711".into())).emit();
+                        return;
+                    }
+                }
+
+                self.lib_features.stable.insert(feature, since);
+            }
+            (None, false, _) => {
+                self.lib_features.unstable.insert(feature);
+            }
+            (Some(_), _, true) | (None, true, _) => {
+                let msg = format!(
+                    "feature `{}` is declared {}, but was previously declared {}",
+                    feature,
+                    if since.is_some() { "stable"} else { "unstable" },
+                    if since.is_none() { "stable"} else { "unstable" },
+                );
+                self.tcx.sess.struct_span_err_with_code(span, &msg,
+                    DiagnosticId::Error("E0711".into())).emit();
+            }
+        }
+    }
+
+    fn collect_from_attrs(&mut self, attrs: &[Attribute]) {
+        for (feature, stable, span) in self.extract(attrs) {
+            self.collect_feature(feature, stable, span);
+        }
+    }
+}
+
+impl<'a, 'v, 'tcx> ItemLikeVisitor<'v> for LibFeatureCollector<'a, 'tcx> {
+    fn visit_item(&mut self, item: &hir::Item) {
+        self.collect_from_attrs(&item.attrs);
+    }
+
+    fn visit_trait_item(&mut self, trait_item: &hir::TraitItem) {
+        self.collect_from_attrs(&trait_item.attrs);
+    }
+
+    fn visit_impl_item(&mut self, impl_item: &hir::ImplItem) {
+        self.collect_from_attrs(&impl_item.attrs);
+    }
+}
+
+pub fn collect<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> LibFeatures {
+    let mut collector = LibFeatureCollector::new(tcx);
+    for &cnum in tcx.crates().iter() {
+        for &(feature, since) in tcx.defined_lib_features(cnum).iter() {
+            collector.collect_feature(feature, since, DUMMY_SP);
+        }
+    }
+    collector.collect_from_attrs(&tcx.hir.krate().attrs);
+    tcx.hir.krate().visit_all_item_likes(&mut collector);
+    for exported_macro in &tcx.hir.krate().exported_macros {
+        collector.collect_from_attrs(&exported_macro.attrs);
+    }
+    collector.lib_features
+}
index 94246db37069aedb56d409b6be983842279f4182..a09942258e22d9b2aba6d54b974b75b9b4544bf9 100644 (file)
@@ -15,7 +15,7 @@
 // makes all other generics or inline functions that it references
 // reachable as well.
 
-use hir::CodegenFnAttrs;
+use hir::{CodegenFnAttrs, CodegenFnAttrFlags};
 use hir::map as hir_map;
 use hir::def::Def;
 use hir::def_id::{DefId, CrateNum};
@@ -28,7 +28,6 @@
 
 use rustc_target::spec::abi::Abi;
 use syntax::ast;
-use syntax::attr;
 use hir;
 use hir::def_id::LOCAL_CRATE;
 use hir::intravisit::{Visitor, NestedVisitorMap};
@@ -359,8 +358,12 @@ struct CollectPrivateImplItemsVisitor<'a, 'tcx: 'a> {
 impl<'a, 'tcx: 'a> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a, 'tcx> {
     fn visit_item(&mut self, item: &hir::Item) {
         // Anything which has custom linkage gets thrown on the worklist no
-        // matter where it is in the crate.
-        if attr::contains_name(&item.attrs, "linkage") {
+        // matter where it is in the crate, along with "special std symbols"
+        // which are currently akin to allocator symbols.
+        let def_id = self.tcx.hir.local_def_id(item.id);
+        let codegen_attrs = self.tcx.codegen_fn_attrs(def_id);
+        if codegen_attrs.linkage.is_some() ||
+            codegen_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL) {
             self.worklist.push(item.id);
         }
 
index ca8fe463119c1b9c60ea651acc8a762cb025c6e4..f2d39a905ee5f496d4a33e1a4d2e1413015d6632 100644 (file)
@@ -903,7 +903,7 @@ fn visit_lifetime(&mut self, lifetime_ref: &'tcx hir::Lifetime) {
         self.resolve_lifetime_ref(lifetime_ref);
     }
 
-    fn visit_path(&mut self, path: &'tcx hir::Path, _: ast::NodeId) {
+    fn visit_path(&mut self, path: &'tcx hir::Path, _: hir::HirId) {
         for (i, segment) in path.segments.iter().enumerate() {
             let depth = path.segments.len() - i - 1;
             if let Some(ref args) = segment.args {
index 262a617cb6924c9b7651d9d0fc3227db0db4c927..8af8d463b112bbfeb9e978a8cc71f5efea7f30d0 100644 (file)
 use hir::def_id::{CrateNum, CRATE_DEF_INDEX, DefId, LOCAL_CRATE};
 use ty::{self, TyCtxt};
 use middle::privacy::AccessLevels;
-use session::DiagnosticMessageId;
+use session::{DiagnosticMessageId, Session};
 use syntax::symbol::Symbol;
 use syntax_pos::{Span, MultiSpan};
 use syntax::ast;
 use syntax::ast::{NodeId, Attribute};
-use syntax::feature_gate::{GateIssue, emit_feature_err, find_lang_feature_accepted_version};
+use syntax::feature_gate::{GateIssue, emit_feature_err};
 use syntax::attr::{self, Stability, Deprecation};
 use util::nodemap::{FxHashSet, FxHashMap};
 
@@ -780,7 +780,8 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
         intravisit::walk_item(self, item);
     }
 
-    fn visit_path(&mut self, path: &'tcx hir::Path, id: ast::NodeId) {
+    fn visit_path(&mut self, path: &'tcx hir::Path, id: hir::HirId) {
+        let id = self.tcx.hir.hir_to_node_id(id);
         match path.def {
             Def::Local(..) | Def::Upvar(..) |
             Def::PrimTy(..) | Def::SelfTy(..) | Def::Err => {}
@@ -813,37 +814,70 @@ pub fn check_unused_or_stable_features<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
         krate.visit_all_item_likes(&mut missing.as_deep_visitor());
     }
 
-    let ref declared_lib_features = tcx.features().declared_lib_features;
-    let mut remaining_lib_features: FxHashMap<Symbol, Span>
-        = declared_lib_features.clone().into_iter().collect();
-    remaining_lib_features.remove(&Symbol::intern("proc_macro"));
-
-    for &(ref stable_lang_feature, span) in &tcx.features().declared_stable_lang_features {
-        let version = find_lang_feature_accepted_version(&stable_lang_feature.as_str())
-            .expect("unexpectedly couldn't find version feature was stabilized");
-        tcx.lint_node(lint::builtin::STABLE_FEATURES,
-                      ast::CRATE_NODE_ID,
-                      span,
-                      &format_stable_since_msg(version));
-    }
-
-    // FIXME(#44232) the `used_features` table no longer exists, so we don't
-    //               lint about unknown or unused features. We should reenable
-    //               this one day!
-    //
-    // let index = tcx.stability();
-    // for (used_lib_feature, level) in &index.used_features {
-    //     remaining_lib_features.remove(used_lib_feature);
-    // }
-    //
-    // for &span in remaining_lib_features.values() {
-    //     tcx.lint_node(lint::builtin::UNUSED_FEATURES,
-    //                   ast::CRATE_NODE_ID,
-    //                   span,
-    //                   "unused or unknown feature");
-    // }
+    let declared_lang_features = &tcx.features().declared_lang_features;
+    let mut lang_features = FxHashSet();
+    for &(feature, span, since) in declared_lang_features {
+        if let Some(since) = since {
+            // Warn if the user has enabled an already-stable lang feature.
+            unnecessary_stable_feature_lint(tcx, span, feature, since);
+        }
+        if lang_features.contains(&feature) {
+            // Warn if the user enables a lang feature multiple times.
+            duplicate_feature_err(tcx.sess, span, feature);
+        }
+        lang_features.insert(feature);
+    }
+
+    let declared_lib_features = &tcx.features().declared_lib_features;
+    let mut remaining_lib_features = FxHashMap();
+    for (feature, span) in declared_lib_features {
+        if remaining_lib_features.contains_key(&feature) {
+            // Warn if the user enables a lib feature multiple times.
+            duplicate_feature_err(tcx.sess, *span, *feature);
+        }
+        remaining_lib_features.insert(feature, span.clone());
+    }
+    // `stdbuild` has special handling for `libc`, so we need to
+    // recognise the feature when building std.
+    // Likewise, libtest is handled specially, so `test` isn't
+    // available as we'd like it to be.
+    // FIXME: only remove `libc` when `stdbuild` is active.
+    // FIXME: remove special casing for `test`.
+    remaining_lib_features.remove(&Symbol::intern("libc"));
+    remaining_lib_features.remove(&Symbol::intern("test"));
+
+    for (feature, stable) in tcx.lib_features().to_vec() {
+        if let Some(since) = stable {
+            if let Some(span) = remaining_lib_features.get(&feature) {
+                // Warn if the user has enabled an already-stable lib feature.
+                unnecessary_stable_feature_lint(tcx, *span, feature, since);
+            }
+        }
+        remaining_lib_features.remove(&feature);
+    }
+
+    for (feature, span) in remaining_lib_features {
+        struct_span_err!(tcx.sess, span, E0635, "unknown feature `{}`", feature).emit();
+    }
+
+    // FIXME(#44232): the `used_features` table no longer exists, so we
+    // don't lint about unused features. We should reenable this one day!
+}
+
+fn unnecessary_stable_feature_lint<'a, 'tcx>(
+    tcx: TyCtxt<'a, 'tcx, 'tcx>,
+    span: Span,
+    feature: Symbol,
+    since: Symbol
+) {
+    tcx.lint_node(lint::builtin::STABLE_FEATURES,
+        ast::CRATE_NODE_ID,
+        span,
+        &format!("the feature `{}` has been stable since {} and no longer requires \
+                  an attribute to enable", feature, since));
 }
 
-fn format_stable_since_msg(version: &str) -> String {
-    format!("this feature has been stable since {}. Attribute no longer needed", version)
+fn duplicate_feature_err(sess: &Session, span: Span, feature: Symbol) {
+    struct_span_err!(sess, span, E0636, "the feature `{}` has already been declared", feature)
+        .emit();
 }
index f48739799203fb9c41453c7a2f7592f42daf72a6..1ffe8157a0fb43a764ef0918940e325d36ffee6a 100644 (file)
@@ -358,7 +358,8 @@ pub fn evaluate_predicates<'b, 'gcx, 'c>(
                 &Err(SelectionError::Unimplemented) => {
                     if self.is_of_param(pred.skip_binder().trait_ref.substs) {
                         already_visited.remove(&pred);
-                        user_computed_preds.insert(ty::Predicate::Trait(pred.clone()));
+                        self.add_user_pred(&mut user_computed_preds,
+                                           ty::Predicate::Trait(pred.clone()));
                         predicates.push_back(pred);
                     } else {
                         debug!(
@@ -393,6 +394,92 @@ pub fn evaluate_predicates<'b, 'gcx, 'c>(
         return Some((new_env, final_user_env));
     }
 
+    // This method is designed to work around the following issue:
+    // When we compute auto trait bounds, we repeatedly call SelectionContext.select,
+    // progressively building a ParamEnv based on the results we get.
+    // However, our usage of SelectionContext differs from its normal use within the compiler,
+    // in that we capture and re-reprocess predicates from Unimplemented errors.
+    //
+    // This can lead to a corner case when dealing with region parameters.
+    // During our selection loop in evaluate_predicates, we might end up with
+    // two trait predicates that differ only in their region parameters:
+    // one containing a HRTB lifetime parameter, and one containing a 'normal'
+    // lifetime parameter. For example:
+    //
+    // T as MyTrait<'a>
+    // T as MyTrait<'static>
+    //
+    // If we put both of these predicates in our computed ParamEnv, we'll
+    // confuse SelectionContext, since it will (correctly) view both as being applicable.
+    //
+    // To solve this, we pick the 'more strict' lifetime bound - i.e. the HRTB
+    // Our end goal is to generate a user-visible description of the conditions
+    // under which a type implements an auto trait. A trait predicate involving
+    // a HRTB means that the type needs to work with any choice of lifetime,
+    // not just one specific lifetime (e.g. 'static).
+    fn add_user_pred<'c>(&self, user_computed_preds: &mut FxHashSet<ty::Predicate<'c>>,
+                         new_pred: ty::Predicate<'c>) {
+        let mut should_add_new = true;
+        user_computed_preds.retain(|&old_pred| {
+            match (&new_pred, old_pred) {
+                (&ty::Predicate::Trait(new_trait), ty::Predicate::Trait(old_trait)) => {
+                    if new_trait.def_id() == old_trait.def_id() {
+                        let new_substs = new_trait.skip_binder().trait_ref.substs;
+                        let old_substs = old_trait.skip_binder().trait_ref.substs;
+                        if !new_substs.types().eq(old_substs.types()) {
+                            // We can't compare lifetimes if the types are different,
+                            // so skip checking old_pred
+                            return true
+                        }
+
+                        for (new_region, old_region) in new_substs
+                            .regions()
+                            .zip(old_substs.regions()) {
+
+                            match (new_region, old_region) {
+                                // If both predicates have an 'ReLateBound' (a HRTB) in the
+                                // same spot, we do nothing
+                                (
+                                    ty::RegionKind::ReLateBound(_, _),
+                                    ty::RegionKind::ReLateBound(_, _)
+                                ) => {},
+
+                                (ty::RegionKind::ReLateBound(_, _), _) => {
+                                    // The new predicate has a HRTB in a spot where the old
+                                    // predicate does not (if they both had a HRTB, the previous
+                                    // match arm would have executed).
+                                    //
+                                    // The means we want to remove the older predicate from
+                                    // user_computed_preds, since having both it and the new
+                                    // predicate in a ParamEnv would confuse SelectionContext
+                                    // We're currently in the predicate passed to 'retain',
+                                    // so we return 'false' to remove the old predicate from
+                                    // user_computed_preds
+                                    return false;
+                                },
+                                (_, ty::RegionKind::ReLateBound(_, _)) => {
+                                    // This is the opposite situation as the previous arm - the
+                                    // old predicate has a HRTB lifetime in a place where the
+                                    // new predicate does not. We want to leave the old
+                                    // predicate in user_computed_preds, and skip adding
+                                    // new_pred to user_computed_params.
+                                    should_add_new = false
+                                }
+                                _ => {}
+                            }
+                        }
+                    }
+                },
+                _ => {}
+            }
+            return true
+        });
+
+        if should_add_new {
+            user_computed_preds.insert(new_pred);
+        }
+    }
+
     pub fn region_name(&self, region: Region) -> Option<String> {
         match region {
             &ty::ReEarlyBound(r) => Some(r.name.to_string()),
@@ -555,7 +642,7 @@ pub fn evaluate_nested_obligations<
                     let substs = &p.skip_binder().trait_ref.substs;
 
                     if self.is_of_param(substs) && !only_projections && is_new_pred {
-                        computed_preds.insert(predicate);
+                        self.add_user_pred(computed_preds, predicate);
                     }
                     predicates.push_back(p.clone());
                 }
@@ -563,7 +650,7 @@ pub fn evaluate_nested_obligations<
                     // If the projection isn't all type vars, then
                     // we don't want to add it as a bound
                     if self.is_of_param(p.skip_binder().projection_ty.substs) && is_new_pred {
-                        computed_preds.insert(predicate);
+                        self.add_user_pred(computed_preds, predicate);
                     } else {
                         match poly_project_and_unify_type(select, &obligation.with(p.clone())) {
                             Err(e) => {
@@ -594,10 +681,7 @@ pub fn evaluate_nested_obligations<
                     }
                 }
                 &ty::Predicate::RegionOutlives(ref binder) => {
-                    if let Err(_) = select
-                        .infcx()
-                        .region_outlives_predicate(&dummy_cause, binder)
-                    {
+                    if select.infcx().region_outlives_predicate(&dummy_cause, binder).is_err() {
                         return false;
                     }
                 }
index c04785aac2095f7a2b62c475773f0700427fabee..a02b63755dc129cee8fe0bf8aae8cbe19df3067e 100644 (file)
@@ -143,7 +143,7 @@ fn error_implies(&self,
                 // Eventually I'll need to implement param-env-aware
                 // `Γ₁ ⊦ φ₁ => Γ₂ ⊦ φ₂` logic.
                 let param_env = ty::ParamEnv::empty();
-                if let Ok(_) = self.can_sub(param_env, error, implication) {
+                if self.can_sub(param_env, error, implication).is_ok() {
                     debug!("error_implies: {:?} -> {:?} -> {:?}", cond, error, implication);
                     return true
                 }
index f79ce73ad928a933dc8081d8ca5dec71380ec9aa..0127ae423da54fcba742953751d8894feb9901b9 100644 (file)
@@ -137,7 +137,7 @@ pub fn implied_outlives_bounds(
         // variables. Process these constraints.
         let mut fulfill_cx = FulfillmentContext::new();
         fulfill_cx.register_predicate_obligations(self, result.obligations);
-        if let Err(_) = fulfill_cx.select_all_or_error(self) {
+        if fulfill_cx.select_all_or_error(self).is_err() {
             self.tcx.sess.delay_span_bug(
                 span,
                 "implied_outlives_bounds failed to solve obligations from instantiation"
index 35184ca6a2559cc3c3f2527db555a3addb414fc3..1e3fe70535bcc591e4206a1c7d678d317a91aaec 100644 (file)
@@ -1587,8 +1587,8 @@ fn match_projection(&mut self,
                         -> bool
     {
         assert!(!skol_trait_ref.has_escaping_regions());
-        if let Err(_) = self.infcx.at(&obligation.cause, obligation.param_env)
-                                  .sup(ty::Binder::dummy(skol_trait_ref), trait_bound) {
+        if self.infcx.at(&obligation.cause, obligation.param_env)
+                     .sup(ty::Binder::dummy(skol_trait_ref), trait_bound).is_err() {
             return false;
         }
 
index 0cfdea68e881c80ee4625ec52eda3175a0cb2fa6..bb14af29a7afe4d71bf4d6747c57296cc2d9c088 100644 (file)
@@ -1192,6 +1192,10 @@ pub fn consider_optimizing<T: Fn() -> String>(&self, msg: T) -> bool {
         self.sess.consider_optimizing(&cname, msg)
     }
 
+    pub fn lib_features(self) -> Lrc<middle::lib_features::LibFeatures> {
+        self.get_lib_features(LOCAL_CRATE)
+    }
+
     pub fn lang_items(self) -> Lrc<middle::lang_items::LanguageItems> {
         self.get_lang_items(LOCAL_CRATE)
     }
@@ -2840,17 +2844,13 @@ pub fn provide(providers: &mut ty::query::Providers) {
         assert_eq!(id, LOCAL_CRATE);
         tcx.crate_name
     };
+    providers.get_lib_features = |tcx, id| {
+        assert_eq!(id, LOCAL_CRATE);
+        Lrc::new(middle::lib_features::collect(tcx))
+    };
     providers.get_lang_items = |tcx, id| {
         assert_eq!(id, LOCAL_CRATE);
-        // FIXME(#42293) Right now we insert a `with_ignore` node in the dep
-        // graph here to ignore the fact that `get_lang_items` below depends on
-        // the entire crate.  For now this'll prevent false positives of
-        // recompiling too much when anything changes.
-        //
-        // Once red/green incremental compilation lands we should be able to
-        // remove this because while the crate changes often the lint level map
-        // will change rarely.
-        tcx.dep_graph.with_ignore(|| Lrc::new(middle::lang_items::collect(tcx)))
+        Lrc::new(middle::lang_items::collect(tcx))
     };
     providers.freevars = |tcx, id| tcx.gcx.freevars.get(&id).cloned();
     providers.maybe_unused_trait_import = |tcx, id| {
index 66edbeff749f712f8762bf84f0035bf4c3452a5a..7329f4832f2e27022ce4fd8d57bc3bb5d5db22f9 100644 (file)
@@ -294,7 +294,7 @@ fn resolve_associated_item<'a, 'tcx>(
             })
         }
         traits::VtableBuiltin(..) => {
-            if let Some(_) = tcx.lang_items().clone_trait() {
+            if tcx.lang_items().clone_trait().is_some() {
                 Some(Instance {
                     def: ty::InstanceDef::CloneShim(def_id, trait_ref.self_ty()),
                     substs: rcvr_substs
index d2648cad55ee9fa11dd03372af55cc510952b906..ecf35c1b0da391b7a24558f277f4ea327c1b1d27 100644 (file)
@@ -626,6 +626,18 @@ fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
     }
 }
 
+impl<'tcx> QueryDescription<'tcx> for queries::get_lib_features<'tcx> {
+    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+        format!("calculating the lib features map")
+    }
+}
+
+impl<'tcx> QueryDescription<'tcx> for queries::defined_lib_features<'tcx> {
+    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+        format!("calculating the lib features defined in a crate")
+    }
+}
+
 impl<'tcx> QueryDescription<'tcx> for queries::get_lang_items<'tcx> {
     fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
         "calculating the lang items map".to_string()
index ab9bdd82e01ebf6cb97aa00f404f6810c93d571e..35080123d3e10ff20cee4331e24229b7e8e38666 100644 (file)
@@ -24,6 +24,7 @@
 use middle::region;
 use middle::resolve_lifetime::{ResolveLifetimes, Region, ObjectLifetimeDefault};
 use middle::stability::{self, DeprecationEntry};
+use middle::lib_features::LibFeatures;
 use middle::lang_items::{LanguageItems, LangItem};
 use middle::exported_symbols::{SymbolExportLevel, ExportedSymbol};
 use mir::interpret::ConstEvalResult;
         [] fn item_children: ItemChildren(DefId) -> Lrc<Vec<Export>>,
         [] fn extern_mod_stmt_cnum: ExternModStmtCnum(DefId) -> Option<CrateNum>,
 
+        [] fn get_lib_features: get_lib_features_node(CrateNum) -> Lrc<LibFeatures>,
+        [] fn defined_lib_features: DefinedLibFeatures(CrateNum)
+            -> Lrc<Vec<(Symbol, Option<Symbol>)>>,
         [] fn get_lang_items: get_lang_items_node(CrateNum) -> Lrc<LanguageItems>,
         [] fn defined_lang_items: DefinedLangItems(CrateNum) -> Lrc<Vec<(DefId, usize)>>,
         [] fn missing_lang_items: MissingLangItems(CrateNum) -> Lrc<Vec<LangItem>>,
@@ -800,6 +804,10 @@ fn link_args_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
     DepConstructor::LinkArgs
 }
 
+fn get_lib_features_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
+    DepConstructor::GetLibFeatures
+}
+
 fn get_lang_items_node<'tcx>(_: CrateNum) -> DepConstructor<'tcx> {
     DepConstructor::GetLangItems
 }
index 0fa643d796e0e1c7a3451ad84c35b9f133bcd78e..f59e48cb35158070ca1dc4720935d12f519683a3 100644 (file)
@@ -1218,6 +1218,8 @@ macro_rules! force {
         DepKind::CrateName => { force!(crate_name, krate!()); }
         DepKind::ItemChildren => { force!(item_children, def_id!()); }
         DepKind::ExternModStmtCnum => { force!(extern_mod_stmt_cnum, def_id!()); }
+        DepKind::GetLibFeatures => { force!(get_lib_features, LOCAL_CRATE); }
+        DepKind::DefinedLibFeatures => { force!(defined_lib_features, krate!()); }
         DepKind::GetLangItems => { force!(get_lang_items, LOCAL_CRATE); }
         DepKind::DefinedLangItems => { force!(defined_lang_items, krate!()); }
         DepKind::MissingLangItems => { force!(missing_lang_items, krate!()); }
index ffbbd8a33a1d04fdc748fe13475a0902c5f42a50..05843852ee0de713c0a25a4b51ecc152bbce6bbb 100644 (file)
@@ -13,7 +13,7 @@
 use syntax::{
     ast::{
         self, Arg, Attribute, Crate, Expr, FnHeader, Generics, Ident, Item, ItemKind,
-        LitKind, Mac, Mod, Mutability, StrStyle, Ty, TyKind, Unsafety, VisibilityKind,
+        Mac, Mod, Mutability, Ty, TyKind, Unsafety, VisibilityKind,
     },
     attr,
     codemap::{
@@ -236,17 +236,12 @@ fn call_allocator(&self, method: &str, mut args: Vec<P<Expr>>) -> P<Expr> {
     }
 
     fn attrs(&self) -> Vec<Attribute> {
-        let key = Symbol::intern("linkage");
-        let value = LitKind::Str(Symbol::intern("external"), StrStyle::Cooked);
-        let linkage = self.cx.meta_name_value(self.span, key, value);
-
         let no_mangle = Symbol::intern("no_mangle");
         let no_mangle = self.cx.meta_word(self.span, no_mangle);
 
         let special = Symbol::intern("rustc_std_internal_symbol");
         let special = self.cx.meta_word(self.span, special);
         vec![
-            self.cx.attribute(self.span, linkage),
             self.cx.attribute(self.span, no_mangle),
             self.cx.attribute(self.span, special),
         ]
index a5a20af0e4e4ae880558ce2a5bbd653984987c65..c7e7465a353fea9db2865ea9ade4a02a6c277430 100644 (file)
@@ -14,7 +14,6 @@
 
 #![allow(non_camel_case_types)]
 
-#![feature(from_ref)]
 #![feature(quote)]
 
 #![recursion_limit="256"]
index 6ddae57e336ede3c2059cf1105b1a35ca1701d4c..28fa49846b7369de67024aacf0ac81e4121952b4 100644 (file)
@@ -10,39 +10,12 @@ crate-type = ["dylib"]
 test = false
 
 [dependencies]
-bitflags = "1.0.1"
 cc = "1.0.1"
-flate2 = "1.0"
-jobserver = "0.1.5"
-libc = "0.2"
-log = "0.4"
 num_cpus = "1.0"
-rustc = { path = "../librustc" }
 rustc-demangle = "0.1.4"
-rustc_allocator = { path = "../librustc_allocator" }
-rustc_apfloat = { path = "../librustc_apfloat" }
-rustc_target = { path = "../librustc_target" }
-rustc_data_structures = { path = "../librustc_data_structures" }
-rustc_errors = { path = "../librustc_errors" }
-rustc_incremental = { path = "../librustc_incremental" }
 rustc_llvm = { path = "../librustc_llvm" }
-rustc_platform_intrinsics = { path = "../librustc_platform_intrinsics" }
-rustc_codegen_utils = { path = "../librustc_codegen_utils" }
-rustc_mir = { path = "../librustc_mir" }
-serialize = { path = "../libserialize" }
-syntax = { path = "../libsyntax" }
-syntax_pos = { path = "../libsyntax_pos" }
-tempfile = "3.0"
-
-# not actually used but needed to make sure we enable the same feature set as
-# winapi used in librustc
-env_logger = { version = "0.5", default-features = false }
 
 [features]
-# Used to communicate the feature to `rustc_target` in the same manner that the
-# `rustc` driver script communicate this.
-jemalloc = ["rustc_target/jemalloc"]
-
 # This is used to convince Cargo to separately cache builds of `rustc_codegen_llvm`
 # when this option is enabled or not. That way we can build two, cache two
 # artifacts, and have nice speedy rebuilds.
index 2d401da958b13fa6465af1612a64b95774198862..0beb8a8844c958f281f98f9e902c4b8dcb9a3fb3 100644 (file)
@@ -67,14 +67,15 @@ pub(crate) unsafe fn codegen(tcx: TyCtxt, mods: &ModuleLlvm, kind: AllocatorKind
         if tcx.sess.target.target.options.default_hidden_visibility {
             llvm::LLVMRustSetVisibility(llfn, llvm::Visibility::Hidden);
         }
-       if tcx.sess.target.target.options.requires_uwtable {
-           attributes::emit_uwtable(llfn, true);
-       }
+        if tcx.sess.target.target.options.requires_uwtable {
+            attributes::emit_uwtable(llfn, true);
+        }
 
         let callee = CString::new(kind.fn_name(method.name)).unwrap();
         let callee = llvm::LLVMRustGetOrInsertFunction(llmod,
                                                        callee.as_ptr(),
                                                        ty);
+        llvm::LLVMRustSetVisibility(callee, llvm::Visibility::Hidden);
 
         let llbb = llvm::LLVMAppendBasicBlockInContext(llcx,
                                                        llfn,
index a5c6a0d5cd690e4828b2b4595db3220b9a7cb291..5e23c6e868f47200e2a4d2131ae18dfee4bf357c 100644 (file)
@@ -541,11 +541,23 @@ unsafe fn optimize(cgcx: &CodegenContext,
             };
 
             if config.verify_llvm_ir { assert!(addpass("verify")); }
+
+            // Some options cause LLVM bitcode to be emitted, which uses ThinLTOBuffers, so we need
+            // to make sure we run LLVM's NameAnonGlobals pass when emitting bitcode; otherwise
+            // we'll get errors in LLVM.
+            let using_thin_buffers = llvm::LLVMRustThinLTOAvailable() && (config.emit_bc
+                || config.obj_is_bitcode || config.emit_bc_compressed || config.embed_bitcode);
+            let mut have_name_anon_globals_pass = false;
             if !config.no_prepopulate_passes {
                 llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
                 llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);
                 let opt_level = config.opt_level.unwrap_or(llvm::CodeGenOptLevel::None);
                 let prepare_for_thin_lto = cgcx.lto == Lto::Thin || cgcx.lto == Lto::ThinLocal;
+                have_name_anon_globals_pass = have_name_anon_globals_pass || prepare_for_thin_lto;
+                if using_thin_buffers && !prepare_for_thin_lto {
+                    assert!(addpass("name-anon-globals"));
+                    have_name_anon_globals_pass = true;
+                }
                 with_llvm_pmb(llmod, &config, opt_level, prepare_for_thin_lto, &mut |b| {
                     llvm::LLVMPassManagerBuilderPopulateFunctionPassManager(b, fpm);
                     llvm::LLVMPassManagerBuilderPopulateModulePassManager(b, mpm);
@@ -557,6 +569,9 @@ unsafe fn optimize(cgcx: &CodegenContext,
                     diag_handler.warn(&format!("unknown pass `{}`, ignoring",
                                             pass));
                 }
+                if pass == "name-anon-globals" {
+                    have_name_anon_globals_pass = true;
+                }
             }
 
             for pass in &cgcx.plugin_passes {
@@ -565,6 +580,22 @@ unsafe fn optimize(cgcx: &CodegenContext,
                                             `{}` but LLVM does not \
                                             recognize it", pass));
                 }
+                if pass == "name-anon-globals" {
+                    have_name_anon_globals_pass = true;
+                }
+            }
+
+            if using_thin_buffers && !have_name_anon_globals_pass {
+                // As described above, this will probably cause an error in LLVM
+                if config.no_prepopulate_passes {
+                    diag_handler.err("The current compilation is going to use thin LTO buffers \
+                                     without running LLVM's NameAnonGlobals pass. \
+                                     This will likely cause errors in LLVM. Consider adding \
+                                     -C passes=name-anon-globals to the compiler command line.");
+                } else {
+                    bug!("We are using thin LTO buffers without running the NameAnonGlobals pass. \
+                         This will likely cause errors in LLVM and shoud never happen.");
+                }
             }
         }
 
index 41336165684f61ff630eb59570c7653610dbd0b9..0a8bc03d8d41cf38edc31116bba2055d39793ba2 100644 (file)
@@ -809,8 +809,28 @@ pub fn codegen_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
         rx,
         codegen_units.len());
 
-    // Codegen an allocator shim, if any
-    let allocator_module = if let Some(kind) = *tcx.sess.allocator_kind.get() {
+    // Codegen an allocator shim, if necessary.
+    //
+    // If the crate doesn't have an `allocator_kind` set then there's definitely
+    // no shim to generate. Otherwise we also check our dependency graph for all
+    // our output crate types. If anything there looks like its a `Dynamic`
+    // linkage, then it's already got an allocator shim and we'll be using that
+    // one instead. If nothing exists then it's our job to generate the
+    // allocator!
+    let any_dynamic_crate = tcx.sess.dependency_formats.borrow()
+        .iter()
+        .any(|(_, list)| {
+            use rustc::middle::dependency_format::Linkage;
+            list.iter().any(|linkage| {
+                match linkage {
+                    Linkage::Dynamic => true,
+                    _ => false,
+                }
+            })
+        });
+    let allocator_module = if any_dynamic_crate {
+        None
+    } else if let Some(kind) = *tcx.sess.allocator_kind.get() {
         unsafe {
             let llmod_id = "allocator";
             let modules = ModuleLlvm::new(tcx.sess, llmod_id);
index 72ff65361cada9d3e6974d100f27f1a61f2f76fe..21bf490beb0fb352c1d3168e5d3dca675d345ca8 100644 (file)
@@ -66,16 +66,22 @@ pub fn addr_of_mut(
     cx: &CodegenCx<'ll, '_>,
     cv: &'ll Value,
     align: Align,
-    kind: &str,
+    kind: Option<&str>,
 ) -> &'ll Value {
     unsafe {
-        let name = cx.generate_local_symbol_name(kind);
-        let gv = declare::define_global(cx, &name[..], val_ty(cv)).unwrap_or_else(||{
-            bug!("symbol `{}` is already defined", name);
-        });
+        let gv = match kind {
+            Some(kind) if !cx.tcx.sess.fewer_names() => {
+                let name = cx.generate_local_symbol_name(kind);
+                let gv = declare::define_global(cx, &name[..], val_ty(cv)).unwrap_or_else(||{
+                    bug!("symbol `{}` is already defined", name);
+                });
+                llvm::LLVMRustSetLinkage(gv, llvm::Linkage::PrivateLinkage);
+                gv
+            },
+            _ => declare::define_private_global(cx, val_ty(cv)),
+        };
         llvm::LLVMSetInitializer(gv, cv);
         set_global_alignment(cx, gv, align);
-        llvm::LLVMRustSetLinkage(gv, llvm::Linkage::PrivateLinkage);
         SetUnnamedAddr(gv, true);
         gv
     }
@@ -85,7 +91,7 @@ pub fn addr_of(
     cx: &CodegenCx<'ll, '_>,
     cv: &'ll Value,
     align: Align,
-    kind: &str,
+    kind: Option<&str>,
 ) -> &'ll Value {
     if let Some(&gv) = cx.const_globals.borrow().get(&cv) {
         unsafe {
index 9812d7f9a41a21cc81ad0642606fa13e700b4505..a0310eecd591d4f30da92605628f54eb4dfb34a5 100644 (file)
@@ -35,7 +35,6 @@
 
 use std::ffi::CString;
 
-
 /// Declare a global value.
 ///
 /// If there’s a value with the same name already declared, the function will
@@ -170,6 +169,15 @@ pub fn define_global(cx: &CodegenCx<'ll, '_>, name: &str, ty: &'ll Type) -> Opti
     }
 }
 
+/// Declare a private global
+///
+/// Use this function when you intend to define a global without a name.
+pub fn define_private_global(cx: &CodegenCx<'ll, '_>, ty: &'ll Type) -> &'ll Value {
+    unsafe {
+        llvm::LLVMRustInsertPrivateGlobal(cx.llmod, ty)
+    }
+}
+
 /// Declare a Rust function with an intention to define it.
 ///
 /// Use this function when you intend to define a function. This function will
index c01ef37d1b8cca664653b8e90d249c09f51d2680..9599ccfe97964849b3f548804795eed8c5cd4fc6 100644 (file)
@@ -23,7 +23,6 @@
 #![feature(crate_visibility_modifier)]
 #![feature(custom_attribute)]
 #![feature(extern_types)]
-#![feature(fs_read_write)]
 #![feature(in_band_lifetimes)]
 #![allow(unused_attributes)]
 #![feature(libc)]
index 989498ea92bcefd770af80cee557ac8f6741648b..a894f8e2fdb96a95686ceec3986ba3b4308870ba 100644 (file)
@@ -623,6 +623,7 @@ pub fn LLVMConstExtractValue(AggConstant: &Value,
     pub fn LLVMAddGlobal(M: &'a Module, Ty: &'a Type, Name: *const c_char) -> &'a Value;
     pub fn LLVMGetNamedGlobal(M: &Module, Name: *const c_char) -> Option<&Value>;
     pub fn LLVMRustGetOrInsertGlobal(M: &'a Module, Name: *const c_char, T: &'a Type) -> &'a Value;
+    pub fn LLVMRustInsertPrivateGlobal(M: &'a Module, T: &'a Type) -> &'a Value;
     pub fn LLVMGetFirstGlobal(M: &Module) -> Option<&Value>;
     pub fn LLVMGetNextGlobal(GlobalVar: &Value) -> Option<&Value>;
     pub fn LLVMDeleteGlobal(GlobalVar: &Value);
index 9c0dd0dc3d8b54f54e5409c381c7cdeb3d68467e..8a1159bc4773cfa4f231d309eb665cd1281044f4 100644 (file)
@@ -106,7 +106,7 @@ pub fn get_vtable(
 
     let vtable_const = C_struct(cx, &components, false);
     let align = cx.data_layout().pointer_align;
-    let vtable = consts::addr_of(cx, vtable_const, align, "vtable");
+    let vtable = consts::addr_of(cx, vtable_const, align, Some("vtable"));
 
     debuginfo::create_vtable_metadata(cx, ty, vtable);
 
index 684ecfaeec8f159d858f736e22b2d45b6a6699cd..4e389c3b915f011ebb4eb35a1f59dc2a2c7b7a45 100644 (file)
@@ -377,7 +377,7 @@ fn codegen_terminator(&mut self,
                         let file_line_col = consts::addr_of(bx.cx,
                                                             file_line_col,
                                                             align,
-                                                            "panic_bounds_check_loc");
+                                                            Some("panic_bounds_check_loc"));
                         (lang_items::PanicBoundsCheckFnLangItem,
                          vec![file_line_col, index, len])
                     }
@@ -391,7 +391,7 @@ fn codegen_terminator(&mut self,
                         let msg_file_line_col = consts::addr_of(bx.cx,
                                                                 msg_file_line_col,
                                                                 align,
-                                                                "panic_loc");
+                                                                Some("panic_loc"));
                         (lang_items::PanicFnLangItem,
                          vec![msg_file_line_col])
                     }
index 267db4467c21a23e376e7c89c9099404c000628d..a6e14a99f3c8eafe156d2756b59095c21cccc907 100644 (file)
@@ -58,9 +58,9 @@ pub fn scalar_to_llvm(
                 Some(AllocType::Memory(alloc)) => {
                     let init = const_alloc_to_llvm(cx, alloc);
                     if alloc.runtime_mutability == Mutability::Mutable {
-                        consts::addr_of_mut(cx, init, alloc.align, "byte_str")
+                        consts::addr_of_mut(cx, init, alloc.align, None)
                     } else {
-                        consts::addr_of(cx, init, alloc.align, "byte_str")
+                        consts::addr_of(cx, init, alloc.align, None)
                     }
                 }
                 Some(AllocType::Function(fn_instance)) => {
index abc3dbdab2f5b04d307bfce1424d717814499cf1..6fa0845dd0cebf14d45e56f5e6bcdf8b64675acf 100644 (file)
@@ -63,7 +63,7 @@ pub fn from_const_alloc(
         offset: Size,
     ) -> PlaceRef<'ll, 'tcx> {
         let init = const_alloc_to_llvm(bx.cx, alloc);
-        let base_addr = consts::addr_of(bx.cx, init, layout.align, "byte_str");
+        let base_addr = consts::addr_of(bx.cx, init, layout.align, None);
 
         let llval = unsafe { LLVMConstInBoundsGEP(
             consts::bitcast(base_addr, Type::i8p(bx.cx)),
index a9e582e510e7850c1248581908af5593882cb24d..dd90cf7ae19e45bf246a9f2ca36a2001fd152ef6 100644 (file)
@@ -20,7 +20,6 @@
       html_favicon_url = "https://www.rust-lang.org/favicon.ico",
       html_root_url = "https://doc.rust-lang.org/nightly/")]
 
-#![feature(collections_range)]
 #![feature(unboxed_closures)]
 #![feature(fn_traits)]
 #![feature(unsize)]
index 09295e2c7ff0024dae5f43cd7f06f3f39d8c1d02..6b1298750fba0533fd44735d8dc0688a3972e32f 100644 (file)
@@ -1295,7 +1295,7 @@ fn emit_suggestion_default(&mut self,
                 }
 
                 // if we elided some lines, add an ellipsis
-                if let Some(_) = lines.next() {
+                if lines.next().is_some() {
                     buffer.puts(row_num, max_line_num_len - 1, "...", Style::LineNumber);
                 } else if !show_underline {
                     draw_col_separator_no_space(&mut buffer, row_num, max_line_num_len + 1);
index 3839c133a6eb22692d99b1bd8b4597257299c184..73886e5e2816caa695539b3dc044780667e05efc 100644 (file)
@@ -14,7 +14,6 @@
       html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
       html_root_url = "https://doc.rust-lang.org/nightly/")]
 
-#![feature(fs_read_write)]
 #![feature(specialization)]
 
 #![recursion_limit="256"]
index 4ef4397d974c420254d2b3b465690a56a298d285..3a449b6a68e4c260f8c7dc3d13b16e174d2573a1 100644 (file)
@@ -1526,7 +1526,6 @@ fn suggest_changing_assoc_types(ty: &hir::Ty, err: &mut DiagnosticBuilder) {
 
         // We use a HIR visitor to walk the type.
         use rustc::hir::intravisit::{self, Visitor};
-        use syntax::ast::NodeId;
         struct WalkAssocTypes<'a, 'db> where 'db: 'a {
             err: &'a mut DiagnosticBuilder<'db>
         }
@@ -1536,7 +1535,7 @@ fn nested_visit_map<'this>(&'this mut self) -> intravisit::NestedVisitorMap<'thi
                 intravisit::NestedVisitorMap::None
             }
 
-            fn visit_qpath(&mut self, qpath: &'v hir::QPath, id: NodeId, span: Span) {
+            fn visit_qpath(&mut self, qpath: &'v hir::QPath, id: hir::HirId, span: Span) {
                 if TypeAliasBounds::is_type_variable_assoc(qpath) {
                     self.err.span_help(span,
                         "use fully disambiguated paths (i.e., `<T as Trait>::Assoc`) to refer to \
index b92ac0ff57bd88478b5fb40c95520c55e884173a..75d16232a37e099cdf0bb505556d708ae9dba945 100644 (file)
@@ -342,7 +342,7 @@ macro_rules! add_lint_group {
     store.register_renamed("bare_trait_object", "bare_trait_objects");
     store.register_renamed("unstable_name_collision", "unstable_name_collisions");
     store.register_renamed("unused_doc_comment", "unused_doc_comments");
-    store.register_renamed("unknown_features", "unused_features");
+    store.register_removed("unknown_features", "replaced by an error");
     store.register_removed("unsigned_negation", "replaced by negate_unsigned feature gate");
     store.register_removed("negate_unsigned", "cast a signed value instead");
     store.register_removed("raw_pointer_derive", "using derive with raw pointers is ok");
index 4dc66fb812144d884476b0d5ef354824caee9ae9..f1636c4dcb08afce27807f76dcd05e7a21a4b0bb 100644 (file)
@@ -790,21 +790,18 @@ fn get_lints(&self) -> LintArray {
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImproperCTypes {
-    fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
+    fn check_foreign_item(&mut self, cx: &LateContext, it: &hir::ForeignItem) {
         let mut vis = ImproperCTypesVisitor { cx: cx };
-        if let hir::ItemKind::ForeignMod(ref nmod) = it.node {
-            if nmod.abi != Abi::RustIntrinsic && nmod.abi != Abi::PlatformIntrinsic {
-                for ni in &nmod.items {
-                    match ni.node {
-                        hir::ForeignItemKind::Fn(ref decl, _, _) => {
-                            vis.check_foreign_fn(ni.id, decl);
-                        }
-                        hir::ForeignItemKind::Static(ref ty, _) => {
-                            vis.check_foreign_static(ni.id, ty.span);
-                        }
-                        hir::ForeignItemKind::Type => ()
-                    }
+        let abi = cx.tcx.hir.get_foreign_abi(it.id);
+        if abi != Abi::RustIntrinsic && abi != Abi::PlatformIntrinsic {
+            match it.node {
+                hir::ForeignItemKind::Fn(ref decl, _, _) => {
+                    vis.check_foreign_fn(it.id, decl);
+                }
+                hir::ForeignItemKind::Static(ref ty, _) => {
+                    vis.check_foreign_static(it.id, ty.span);
                 }
+                hir::ForeignItemKind::Type => ()
             }
         }
     }
index 916c0920e0b4b2dfa7c20376d9f668ed9122d61c..060dddd5343885d60119a5c7aec7d49720448633 100644 (file)
@@ -240,6 +240,7 @@ fn into_args(self) -> (DefId, DefId) { (self.0.as_def_id(), self.1) }
         cdata.each_child_of_item(def_id.index, |child| result.push(child), tcx.sess);
         Lrc::new(result)
     }
+    defined_lib_features => { Lrc::new(cdata.get_lib_features()) }
     defined_lang_items => { Lrc::new(cdata.get_lang_items()) }
     missing_lang_items => { Lrc::new(cdata.get_missing_lang_items()) }
 
index ab566654c389cd366c5be633b33149f4bb57f922..5121b682d36a736a60702a6dfbe16bde1687d945 100644 (file)
@@ -427,10 +427,10 @@ fn to_def(&self, did: DefId) -> Option<Def> {
             EntryKind::Trait(_) => Def::Trait(did),
             EntryKind::Enum(..) => Def::Enum(did),
             EntryKind::MacroDef(_) => Def::Macro(did, MacroKind::Bang),
-            EntryKind::GlobalAsm => Def::GlobalAsm(did),
             EntryKind::ForeignType => Def::TyForeign(did),
 
             EntryKind::ForeignMod |
+            EntryKind::GlobalAsm |
             EntryKind::Impl(_) |
             EntryKind::Field |
             EntryKind::Generator(_) |
@@ -645,6 +645,14 @@ pub fn get_impl_trait(&self,
         self.get_impl_data(id).trait_ref.map(|tr| tr.decode((self, tcx)))
     }
 
+    /// Iterates over all the stability attributes in the given crate.
+    pub fn get_lib_features(&self) -> Vec<(ast::Name, Option<ast::Name>)> {
+        self.root
+            .lib_features
+            .decode(self)
+            .collect()
+    }
+
     /// Iterates over the language items in the given crate.
     pub fn get_lang_items(&self) -> Vec<(DefId, usize)> {
         self.root
index 4a02a278bc14ebb5bbe38370124840a98c739f90..96d6c5b75f49e677b475ea161dc9b43f5275bde1 100644 (file)
@@ -394,6 +394,11 @@ fn encode_crate_root(&mut self) -> Lazy<CrateRoot> {
             ());
         let dep_bytes = self.position() - i;
 
+        // Encode the lib features.
+        i = self.position();
+        let lib_features = self.tracked(IsolatedEncoder::encode_lib_features, ());
+        let lib_feature_bytes = self.position() - i;
+
         // Encode the language items.
         i = self.position();
         let lang_items = self.tracked(IsolatedEncoder::encode_lang_items, ());
@@ -513,6 +518,7 @@ fn encode_crate_root(&mut self) -> Lazy<CrateRoot> {
 
             crate_deps,
             dylib_dependency_formats,
+            lib_features,
             lang_items,
             lang_items_missing,
             native_libraries,
@@ -537,6 +543,7 @@ fn encode_crate_root(&mut self) -> Lazy<CrateRoot> {
 
             println!("metadata stats:");
             println!("             dep bytes: {}", dep_bytes);
+            println!("     lib feature bytes: {}", lib_feature_bytes);
             println!("       lang item bytes: {}", lang_item_bytes);
             println!("          native bytes: {}", native_lib_bytes);
             println!("         codemap bytes: {}", codemap_bytes);
@@ -1456,6 +1463,12 @@ fn encode_crate_deps(&mut self, _: ()) -> LazySeq<CrateDep> {
         self.lazy_seq_ref(deps.iter().map(|&(_, ref dep)| dep))
     }
 
+    fn encode_lib_features(&mut self, _: ()) -> LazySeq<(ast::Name, Option<ast::Name>)> {
+        let tcx = self.tcx;
+        let lib_features = tcx.lib_features();
+        self.lazy_seq(lib_features.to_vec())
+    }
+
     fn encode_lang_items(&mut self, _: ()) -> LazySeq<(DefIndex, usize)> {
         let tcx = self.tcx;
         let lang_items = tcx.lang_items();
index 798b631989bd57ad642ed9cc4ae30e91f4c74306..98946ad6081eba20f49ed9fc56cc070b07be7287 100644 (file)
@@ -13,7 +13,6 @@
        html_root_url = "https://doc.rust-lang.org/nightly/")]
 
 #![feature(box_patterns)]
-#![feature(fs_read_write)]
 #![feature(libc)]
 #![feature(macro_at_most_once_rep)]
 #![feature(proc_macro_internals)]
index d7c54cbc81d9414b66c4c7253c112c1868237a0f..894c7cbf683dcae2d1ecddf009d09b9ec55ce23c 100644 (file)
@@ -198,6 +198,7 @@ pub struct CrateRoot {
 
     pub crate_deps: LazySeq<CrateDep>,
     pub dylib_dependency_formats: LazySeq<Option<LinkagePreference>>,
+    pub lib_features: LazySeq<(Symbol, Option<Symbol>)>,
     pub lang_items: LazySeq<(DefIndex, usize)>,
     pub lang_items_missing: LazySeq<lang_items::LangItem>,
     pub native_libraries: LazySeq<NativeLibrary>,
index aabed6686858fddf6fe579d235b019a4130454f0..67b92d92a343d4264c685bdddfac0b9875231ca5 100644 (file)
@@ -138,7 +138,7 @@ pub(super) fn report_use_of_moved_or_uninitialized(
                         let tables = self.tcx.typeck_tables_of(id);
                         let node_id = self.tcx.hir.as_local_node_id(id).unwrap();
                         let hir_id = self.tcx.hir.node_to_hir_id(node_id);
-                        if let Some(_) = tables.closure_kind_origins().get(hir_id) {
+                        if tables.closure_kind_origins().get(hir_id).is_some() {
                             false
                         } else {
                             true
@@ -735,7 +735,7 @@ fn append_place_to_string(
                             &including_downcast,
                         )?;
                         buf.push_str("[");
-                        if let Err(_) = self.append_local_to_string(index, buf) {
+                        if self.append_local_to_string(index, buf).is_err() {
                             buf.push_str("..");
                         }
                         buf.push_str("]");
diff --git a/src/librustc_mir/borrow_check/nll/escaping_locals.rs b/src/librustc_mir/borrow_check/nll/escaping_locals.rs
deleted file mode 100644 (file)
index 7e39f3d..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-// Copyright 2016 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.
-
-//! Identify those variables whose entire value will eventually be
-//! returned from the fn via the RETURN_PLACE. As an optimization, we
-//! can skip computing liveness results for those variables. The idea
-//! is that the return type of the fn only ever contains free
-//! regions. Therefore, the types of those variables are going to
-//! ultimately be contrained to outlive those free regions -- since
-//! free regions are always live for the entire body, this implies
-//! that the liveness results are not important for those regions.
-//! This is most important in the "fns" that we create to represent static
-//! values, since those are often really quite large, and all regions in them
-//! will ultimately be constrained to be `'static`. Two examples:
-//!
-//! ```
-//! fn foo() -> &'static [u32] { &[] }
-//! static FOO: &[u32] = &[];
-//! ```
-//!
-//! In both these cases, the return value will only have static lifetime.
-//!
-//! NB: The simple logic here relies on the fact that outlives
-//! relations in our analysis don't have locations. Otherwise, we
-//! would have to restrict ourselves to values that are
-//! *unconditionally* returned (which would still cover the "big
-//! static value" case).
-//!
-//! The way that this code works is to use union-find -- we iterate
-//! over the MIR and union together two variables X and Y if all
-//! regions in the value of Y are going to be stored into X -- that
-//! is, if `typeof(X): 'a` requires that `typeof(Y): 'a`. This means
-//! that e.g. we can union together `x` and `y` if we have something
-//! like `x = (y, 22)`, but not something like `x = y.f` (since there
-//! may be regions in the type of `y` that do not appear in the field
-//! `f`).
-
-use rustc::mir::visit::Visitor;
-use rustc::mir::*;
-
-use rustc_data_structures::indexed_vec::Idx;
-use rustc_data_structures::unify as ut;
-
-crate struct EscapingLocals {
-    unification_table: ut::UnificationTable<ut::InPlace<AssignedLocal>>,
-}
-
-impl EscapingLocals {
-    crate fn compute(mir: &Mir<'tcx>) -> Self {
-        let mut visitor = GatherAssignedLocalsVisitor::new();
-        visitor.visit_mir(mir);
-
-        EscapingLocals {
-            unification_table: visitor.unification_table,
-        }
-    }
-
-    /// True if `local` is known to escape into static
-    /// memory.
-    crate fn escapes_into_return(&mut self, local: Local) -> bool {
-        let return_place = AssignedLocal::from(RETURN_PLACE);
-        let other_place = AssignedLocal::from(local);
-        self.unification_table.unioned(return_place, other_place)
-    }
-}
-
-/// The MIR visitor gathering the union-find of the locals used in
-/// assignments.
-struct GatherAssignedLocalsVisitor {
-    unification_table: ut::UnificationTable<ut::InPlace<AssignedLocal>>,
-}
-
-#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
-struct AssignedLocal(u32);
-
-impl ut::UnifyKey for AssignedLocal {
-    type Value = ();
-
-    fn index(&self) -> u32 {
-        self.0
-    }
-
-    fn from_index(i: u32) -> AssignedLocal {
-        AssignedLocal(i)
-    }
-
-    fn tag() -> &'static str {
-        "AssignedLocal"
-    }
-}
-
-impl From<Local> for AssignedLocal {
-    fn from(item: Local) -> Self {
-        // newtype_indexes use usize but are u32s.
-        assert!(item.index() < ::std::u32::MAX as usize);
-        AssignedLocal(item.index() as u32)
-    }
-}
-
-impl GatherAssignedLocalsVisitor {
-    fn new() -> Self {
-        Self {
-            unification_table: ut::UnificationTable::new(),
-        }
-    }
-
-    fn union_locals_if_needed(&mut self, lvalue: Option<Local>, rvalue: Option<Local>) {
-        if let Some(lvalue) = lvalue {
-            if let Some(rvalue) = rvalue {
-                if lvalue != rvalue {
-                    debug!("EscapingLocals: union {:?} and {:?}", lvalue, rvalue);
-                    self.unification_table
-                        .union(AssignedLocal::from(lvalue), AssignedLocal::from(rvalue));
-                }
-            }
-        }
-    }
-}
-
-// Returns the potential `Local` associated to this `Place` or `PlaceProjection`
-fn find_local_in_place(place: &Place) -> Option<Local> {
-    match place {
-        Place::Local(local) => Some(*local),
-
-        // If you do e.g. `x = a.f` then only *part* of the type of
-        // `a` escapes into `x` (the part contained in `f`); if `a`'s
-        // type has regions that don't appear in `f`, those might not
-        // escape.
-        Place::Projection(..) => None,
-
-        Place::Static { .. } | Place::Promoted { .. } => None,
-    }
-}
-
-// Returns the potential `Local` in this `Operand`.
-fn find_local_in_operand(op: &Operand) -> Option<Local> {
-    // Conservatively check a subset of `Operand`s we know our
-    // benchmarks track, for example `html5ever`.
-    match op {
-        Operand::Copy(place) | Operand::Move(place) => find_local_in_place(place),
-        Operand::Constant(_) => None,
-    }
-}
-
-impl Visitor<'tcx> for GatherAssignedLocalsVisitor {
-    fn visit_mir(&mut self, mir: &Mir<'tcx>) {
-        // We need as many union-find keys as there are locals
-        for _ in 0..mir.local_decls.len() {
-            self.unification_table.new_key(());
-        }
-
-        self.super_mir(mir);
-    }
-
-    fn visit_assign(
-        &mut self,
-        block: BasicBlock,
-        place: &Place<'tcx>,
-        rvalue: &Rvalue<'tcx>,
-        location: Location,
-    ) {
-        let local = find_local_in_place(place);
-
-        // Find those cases where there is a `Place` consumed by
-        // `rvalue` and we know that all regions in its type will be
-        // incorporated into `place`, the `Place` we are assigning to.
-        match rvalue {
-            // `x = y` is the simplest possible case.
-            Rvalue::Use(op) => self.union_locals_if_needed(local, find_local_in_operand(op)),
-
-            // `X = &'r P` -- the type of `X` will be `&'r T_P`, where
-            // `T_P` is the type of `P`.
-            Rvalue::Ref(_, _, place) => {
-                // Special case: if you have `X = &*Y` (or `X = &**Y`
-                // etc), then the outlives relationships will ensure
-                // that all regions in `Y` are constrained by regions
-                // in `X` -- this is because the lifetimes of the
-                // references we deref through are required to outlive
-                // the borrow lifetime `'r` (which appears in `X`).
-                //
-                // (We don't actually need to check the type of `Y`:
-                // since `ProjectionElem::Deref` represents a built-in
-                // deref and not an overloaded deref, if the thing we
-                // deref through is not a reference, then it must be a
-                // `Box` or `*const`, in which case it contains no
-                // references.)
-                let mut place_ref = place;
-                while let Place::Projection(proj) = place_ref {
-                    if let ProjectionElem::Deref = proj.elem {
-                        place_ref = &proj.base;
-                    } else {
-                        break;
-                    }
-                }
-
-                self.union_locals_if_needed(local, find_local_in_place(place_ref))
-            }
-
-            Rvalue::Cast(kind, op, _) => match kind {
-                CastKind::Unsize => {
-                    // Casting a `&[T; N]` to `&[T]` or `&Foo` to `&Trait` --
-                    // in both cases, no regions are "lost".
-                    self.union_locals_if_needed(local, find_local_in_operand(op))
-                }
-                _ => (),
-            },
-
-            // Constructing an aggregate like `(x,)` or `Foo { x }`
-            // includes the full type of `x`.
-            Rvalue::Aggregate(_, ops) => {
-                for rvalue in ops.iter().map(find_local_in_operand) {
-                    self.union_locals_if_needed(local, rvalue);
-                }
-            }
-
-            // For other things, be conservative and do not union.
-            _ => (),
-        };
-
-        self.super_assign(block, place, rvalue, location);
-    }
-}
index d018a9277d83420158a50b2f0c14333f3d89d6ef..cbd9c9a4e1a85368906de6d91bd210585a731c7b 100644 (file)
 //! liveness code so that it only operates over variables with regions in their
 //! types, instead of all variables.
 
-use borrow_check::nll::escaping_locals::EscapingLocals;
-use rustc::mir::{Local, Mir};
 use rustc::ty::TypeFoldable;
 use rustc_data_structures::indexed_vec::IndexVec;
+use rustc::mir::{Mir, Local};
 use util::liveness::LiveVariableMap;
 
 use rustc_data_structures::indexed_vec::Idx;
 crate struct NllLivenessMap {
     /// For each local variable, contains either None (if the type has no regions)
     /// or Some(i) with a suitable index.
-    from_local: IndexVec<Local, Option<LocalWithRegion>>,
-
+    pub from_local: IndexVec<Local, Option<LocalWithRegion>>,
     /// For each LocalWithRegion, maps back to the original Local index.
-    to_local: IndexVec<LocalWithRegion, Local>,
+    pub to_local: IndexVec<LocalWithRegion, Local>,
+
 }
 
 impl LiveVariableMap for NllLivenessMap {
+
     fn from_local(&self, local: Local) -> Option<Self::LiveVar> {
         self.from_local[local]
     }
@@ -55,43 +55,21 @@ fn num_variables(&self) -> usize {
 impl NllLivenessMap {
     /// Iterates over the variables in Mir and assigns each Local whose type contains
     /// regions a LocalWithRegion index. Returns a map for converting back and forth.
-    crate fn compute(mir: &Mir<'tcx>) -> Self {
-        let mut escaping_locals = EscapingLocals::compute(mir);
-
+    pub fn compute(mir: &Mir) -> Self {
         let mut to_local = IndexVec::default();
-        let mut escapes_into_return = 0;
-        let mut no_regions = 0;
-        let from_local: IndexVec<Local, Option<_>> = mir
+        let from_local: IndexVec<Local,Option<_>> = mir
             .local_decls
             .iter_enumerated()
             .map(|(local, local_decl)| {
-                if escaping_locals.escapes_into_return(local) {
-                    // If the local escapes into the return value,
-                    // then the return value will force all of the
-                    // regions in its type to outlive free regions
-                    // (e.g., `'static`) and hence liveness is not
-                    // needed. This is particularly important for big
-                    // statics.
-                    escapes_into_return += 1;
-                    None
-                } else if local_decl.ty.has_free_regions() {
-                    let l = to_local.push(local);
-                    debug!("liveness_map: {:?} = {:?}", local, l);
-                    Some(l)
-                } else {
-                    no_regions += 1;
-                    None
+                if local_decl.ty.has_free_regions() {
+                    Some(to_local.push(local))
                 }
+                    else {
+                        None
+                    }
             }).collect();
 
-        debug!("liveness_map: {} variables need liveness", to_local.len());
-        debug!("liveness_map: {} escapes into return", escapes_into_return);
-        debug!("liveness_map: {} no regions", no_regions);
-
-        Self {
-            from_local,
-            to_local,
-        }
+        Self { from_local, to_local }
     }
 }
 
index 44ed6b7676c0c61e18e517f8eaf1dc1cf554ca39..973568a67f030e8fdf04c89d45a8e59cfc5376c2 100644 (file)
@@ -39,9 +39,7 @@
 use util as mir_util;
 use util::pretty::{self, ALIGN};
 
-mod constraints;
 mod constraint_generation;
-mod escaping_locals;
 pub mod explain_borrow;
 mod facts;
 mod invalidation;
@@ -51,6 +49,8 @@
 mod universal_regions;
 crate mod liveness_map;
 
+mod constraints;
+
 use self::facts::AllFacts;
 use self::region_infer::RegionInferenceContext;
 use self::universal_regions::UniversalRegions;
@@ -120,7 +120,6 @@ pub(in borrow_check) fn compute_regions<'cx, 'gcx, 'tcx>(
         location_table,
         borrow_set,
         &liveness,
-        &liveness_map,
         &mut all_facts,
         flow_inits,
         move_data,
@@ -206,7 +205,6 @@ pub(in borrow_check) fn compute_regions<'cx, 'gcx, 'tcx>(
     dump_mir_results(
         infcx,
         &liveness,
-        &liveness_map,
         MirSource::item(def_id),
         &mir,
         &regioncx,
@@ -223,7 +221,6 @@ pub(in borrow_check) fn compute_regions<'cx, 'gcx, 'tcx>(
 fn dump_mir_results<'a, 'gcx, 'tcx>(
     infcx: &InferCtxt<'a, 'gcx, 'tcx>,
     liveness: &LivenessResults<LocalWithRegion>,
-    liveness_map: &NllLivenessMap,
     source: MirSource,
     mir: &Mir<'tcx>,
     regioncx: &RegionInferenceContext,
@@ -233,6 +230,8 @@ fn dump_mir_results<'a, 'gcx, 'tcx>(
         return;
     }
 
+    let map = &NllLivenessMap::compute(mir);
+
     let regular_liveness_per_location: FxHashMap<_, _> = mir
         .basic_blocks()
         .indices()
@@ -240,7 +239,7 @@ fn dump_mir_results<'a, 'gcx, 'tcx>(
             let mut results = vec![];
             liveness
                 .regular
-                .simulate_block(&mir, bb, liveness_map, |location, local_set| {
+                .simulate_block(&mir, bb, map, |location, local_set| {
                     results.push((location, local_set.clone()));
                 });
             results
@@ -254,7 +253,7 @@ fn dump_mir_results<'a, 'gcx, 'tcx>(
             let mut results = vec![];
             liveness
                 .drop
-                .simulate_block(&mir, bb, liveness_map, |location, local_set| {
+                .simulate_block(&mir, bb, map, |location, local_set| {
                     results.push((location, local_set.clone()));
                 });
             results
index 8fbb4aafc1f67d2ad37e81cf456cfa57040c0833..c2670389e2d69cbccb05edb051cd032bb88b0692 100644 (file)
@@ -310,7 +310,7 @@ pub(super) fn report_error(
         if let (Some(f), Some(o)) = (self.to_error_region(fr), self.to_error_region(outlived_fr)) {
             let tables = infcx.tcx.typeck_tables_of(mir_def_id);
             let nice = NiceRegionError::new_from_span(infcx.tcx, span, o, f, Some(tables));
-            if let Some(_error_reported) = nice.try_report() {
+            if let Some(_error_reported) = nice.try_report_from_nll() {
                 return;
             }
         }
index 79165276430d34b2a20dcd8eb575036bb50d44b9..8c2a5f19038bb37e28492da198cd0e569379889d 100644 (file)
@@ -10,6 +10,7 @@
 
 use borrow_check::nll::region_infer::RegionInferenceContext;
 use borrow_check::nll::ToRegionVid;
+use borrow_check::nll::universal_regions::DefiningTy;
 use rustc::hir;
 use rustc::hir::def_id::DefId;
 use rustc::infer::InferCtxt;
@@ -72,7 +73,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
             })
             .or_else(|| {
                 self.give_name_if_anonymous_region_appears_in_output(
-                    infcx.tcx, mir, fr, counter, diag)
+                    infcx, mir, mir_def_id, fr, counter, diag)
             })
             .unwrap_or_else(|| span_bug!(mir.span, "can't make a name for free region {:?}", fr))
     }
@@ -107,13 +108,46 @@ fn give_name_from_error_region(
                 },
 
                 ty::BoundRegion::BrEnv => {
-                    let closure_span = tcx.hir.span_if_local(mir_def_id).unwrap();
-                    let region_name = self.synthesize_region_name(counter);
-                    diag.span_label(
-                        closure_span,
-                        format!("lifetime `{}` represents the closure body", region_name),
-                    );
-                    Some(region_name)
+                    let mir_node_id = tcx.hir.as_local_node_id(mir_def_id).expect("non-local mir");
+                    let def_ty = self.universal_regions.defining_ty;
+
+                    if let DefiningTy::Closure(def_id, substs) = def_ty {
+                        let args_span = if let hir::ExprKind::Closure(_, _, _, span, _)
+                            = tcx.hir.expect_expr(mir_node_id).node
+                        {
+                            span
+                        } else {
+                            bug!("Closure is not defined by a closure expr");
+                        };
+                        let region_name = self.synthesize_region_name(counter);
+                        diag.span_label(
+                            args_span,
+                            format!("lifetime `{}` represents this closure's body", region_name),
+                        );
+
+                        let closure_kind_ty = substs.closure_kind_ty(def_id, tcx);
+                        let note = match closure_kind_ty.to_opt_closure_kind() {
+                            Some(ty::ClosureKind::Fn) => {
+                                "closure implements `Fn`, so references to captured variables \
+                                 can't escape the closure"
+                            }
+                            Some(ty::ClosureKind::FnMut) => {
+                                "closure implements `FnMut`, so references to captured variables \
+                                 can't escape the closure"
+                            }
+                            Some(ty::ClosureKind::FnOnce) => {
+                                bug!("BrEnv in a `FnOnce` closure");
+                            }
+                            None => bug!("Closure kind not inferred in borrow check"),
+                        };
+
+                        diag.note(note);
+
+                        Some(region_name)
+                    } else {
+                        // Can't have BrEnv in functions, constants or generators.
+                        bug!("BrEnv outside of closure.");
+                    }
                 }
 
                 ty::BoundRegion::BrAnon(_) | ty::BoundRegion::BrFresh(_) => None,
@@ -543,28 +577,51 @@ fn give_name_if_anonymous_region_appears_in_upvars(
     /// or be early bound (named, not in argument).
     fn give_name_if_anonymous_region_appears_in_output(
         &self,
-        tcx: TyCtxt<'_, '_, 'tcx>,
+        infcx: &InferCtxt<'_, '_, 'tcx>,
         mir: &Mir<'tcx>,
+        mir_def_id: DefId,
         fr: RegionVid,
         counter: &mut usize,
         diag: &mut DiagnosticBuilder<'_>,
     ) -> Option<InternedString> {
+        let tcx = infcx.tcx;
+
         let return_ty = self.universal_regions.unnormalized_output_ty;
         debug!(
             "give_name_if_anonymous_region_appears_in_output: return_ty = {:?}",
             return_ty
         );
-        if !tcx.any_free_region_meets(&return_ty, |r| r.to_region_vid() == fr) {
+        if !infcx.tcx.any_free_region_meets(&return_ty, |r| r.to_region_vid() == fr) {
             return None;
         }
 
-        let region_name = self.synthesize_region_name(counter);
+        let type_name = with_highlight_region(fr, *counter, || {
+            infcx.extract_type_name(&return_ty)
+        });
+
+                let mir_node_id = tcx.hir.as_local_node_id(mir_def_id).expect("non-local mir");
+
+        let (return_span, mir_description) = if let hir::ExprKind::Closure(_, _, _, span, gen_move)
+            = tcx.hir.expect_expr(mir_node_id).node
+        {
+            (
+                tcx.sess.codemap().end_point(span),
+                if gen_move.is_some() { " of generator" } else { " of closure" }
+            )
+        } else {
+            // unreachable?
+            (mir.span, "")
+        };
+
         diag.span_label(
-            mir.span,
-            format!("lifetime `{}` appears in return type", region_name),
+            return_span,
+            format!("return type{} is {}", mir_description, type_name),
         );
 
-        Some(region_name)
+        // This counter value will already have been used, so this function will increment it
+        // so the next value will be used next and return the region name that would have been
+        // used.
+        Some(self.synthesize_region_name(counter))
     }
 
     /// Create a synthetic region named `'1`, incrementing the
index afd4e2859aced768268d115e4c867da0bd4d5e53..0798a45b3becd61b67152259afad683242b04bd2 100644 (file)
@@ -645,6 +645,30 @@ pub fn to_error_region(&self, r: RegionVid) -> Option<ty::Region<'tcx>> {
         }
     }
 
+    /// Invoked when we have some type-test (e.g., `T: 'X`) that we cannot
+    /// prove to be satisfied. If this is a closure, we will attempt to
+    /// "promote" this type-test into our `ClosureRegionRequirements` and
+    /// hence pass it up the creator. To do this, we have to phrase the
+    /// type-test in terms of external free regions, as local free
+    /// regions are not nameable by the closure's creator.
+    ///
+    /// Promotion works as follows: we first check that the type `T`
+    /// contains only regions that the creator knows about. If this is
+    /// true, then -- as a consequence -- we know that all regions in
+    /// the type `T` are free regions that outlive the closure body. If
+    /// false, then promotion fails.
+    ///
+    /// Once we've promoted T, we have to "promote" `'X` to some region
+    /// that is "external" to the closure. Generally speaking, a region
+    /// may be the union of some points in the closure body as well as
+    /// various free lifetimes. We can ignore the points in the closure
+    /// body: if the type T can be expressed in terms of external regions,
+    /// we know it outlives the points in the closure body. That
+    /// just leaves the free regions.
+    ///
+    /// The idea then is to lower the `T: 'X` constraint into multiple
+    /// bounds -- e.g., if `'X` is the union of two free lifetimes,
+    /// `'1` and `'2`, then we would create `T: '1` and `T: '2`.
     fn try_promote_type_test<'gcx>(
         &self,
         infcx: &InferCtxt<'_, 'gcx, 'tcx>,
@@ -661,28 +685,33 @@ fn try_promote_type_test<'gcx>(
             test: _,
         } = type_test;
 
+
         let generic_ty = generic_kind.to_ty(tcx);
         let subject = match self.try_promote_type_test_subject(infcx, generic_ty) {
             Some(s) => s,
             None => return false,
         };
 
-        // Find some bounding subject-region R+ that is a super-region
-        // of the existing subject-region R. This should be a non-local, universal
-        // region, which ensures it can be encoded in a `ClosureOutlivesRequirement`.
-        let lower_bound_plus = self.non_local_universal_upper_bound(*lower_bound);
-        assert!(self.universal_regions.is_universal_region(lower_bound_plus));
-        assert!(
-            !self
+        // For each region outlived by lower_bound find a non-local,
+        // universal region (it may be the same region) and add it to
+        // `ClosureOutlivesRequirement`.
+        let r_scc = self.constraint_sccs.scc(*lower_bound);
+        for ur in self.scc_values.universal_regions_outlived_by(r_scc) {
+            let non_local_ub = self.universal_region_relations.non_local_upper_bound(ur);
+
+            assert!(self.universal_regions.is_universal_region(non_local_ub));
+            assert!(
+                !self
                 .universal_regions
-                .is_local_free_region(lower_bound_plus)
-        );
+                .is_local_free_region(non_local_ub)
+            );
 
-        propagated_outlives_requirements.push(ClosureOutlivesRequirement {
-            subject,
-            outlived_free_region: lower_bound_plus,
-            blame_span: locations.span(mir),
-        });
+            propagated_outlives_requirements.push(ClosureOutlivesRequirement {
+                subject,
+                outlived_free_region: non_local_ub,
+                blame_span: locations.span(mir),
+            });
+        }
         true
     }
 
index d02f54dc4b87df4feb35bac7279b1c82526c4cad..2b9307db59af9feb3821760f2c52f059845d3d39 100644 (file)
@@ -37,7 +37,6 @@ pub(super) fn generate<'gcx, 'tcx>(
     cx: &mut TypeChecker<'_, 'gcx, 'tcx>,
     mir: &Mir<'tcx>,
     liveness: &LivenessResults<LocalWithRegion>,
-    liveness_map: &NllLivenessMap,
     flow_inits: &mut FlowAtLocation<MaybeInitializedPlaces<'_, 'gcx, 'tcx>>,
     move_data: &MoveData<'tcx>,
 ) {
@@ -45,10 +44,10 @@ pub(super) fn generate<'gcx, 'tcx>(
         cx,
         mir,
         liveness,
-        liveness_map,
         flow_inits,
         move_data,
         drop_data: FxHashMap(),
+        map: &NllLivenessMap::compute(mir),
     };
 
     for bb in mir.basic_blocks().indices() {
@@ -66,10 +65,10 @@ struct TypeLivenessGenerator<'gen, 'typeck, 'flow, 'gcx, 'tcx>
     cx: &'gen mut TypeChecker<'typeck, 'gcx, 'tcx>,
     mir: &'gen Mir<'tcx>,
     liveness: &'gen LivenessResults<LocalWithRegion>,
-    liveness_map: &'gen NllLivenessMap,
     flow_inits: &'gen mut FlowAtLocation<MaybeInitializedPlaces<'flow, 'gcx, 'tcx>>,
     move_data: &'gen MoveData<'tcx>,
     drop_data: FxHashMap<Ty<'tcx>, DropData<'tcx>>,
+    map: &'gen NllLivenessMap,
 }
 
 struct DropData<'tcx> {
@@ -87,9 +86,9 @@ fn add_liveness_constraints(&mut self, bb: BasicBlock) {
 
         self.liveness
             .regular
-            .simulate_block(self.mir, bb, self.liveness_map, |location, live_locals| {
+            .simulate_block(self.mir, bb, self.map, |location, live_locals| {
                 for live_local in live_locals.iter() {
-                    let local = self.liveness_map.from_live_var(live_local);
+                    let local = self.map.from_live_var(live_local);
                     let live_local_ty = self.mir.local_decls[local].ty;
                     Self::push_type_live_constraint(&mut self.cx, live_local_ty, location);
                 }
@@ -98,7 +97,7 @@ fn add_liveness_constraints(&mut self, bb: BasicBlock) {
         let mut all_live_locals: Vec<(Location, Vec<LocalWithRegion>)> = vec![];
         self.liveness
             .drop
-            .simulate_block(self.mir, bb, self.liveness_map, |location, live_locals| {
+            .simulate_block(self.mir, bb, self.map, |location, live_locals| {
                 all_live_locals.push((location, live_locals.iter().collect()));
             });
         debug!(
@@ -125,7 +124,7 @@ fn add_liveness_constraints(&mut self, bb: BasicBlock) {
                     });
                 }
 
-                let local = self.liveness_map.from_live_var(live_local);
+                let local = self.map.from_live_var(live_local);
                 let mpi = self.move_data.rev_lookup.find_local(local);
                 if let Some(initialized_child) = self.flow_inits.has_any_child_of(mpi) {
                     debug!(
@@ -134,7 +133,7 @@ fn add_liveness_constraints(&mut self, bb: BasicBlock) {
                         self.move_data.move_paths[initialized_child]
                     );
 
-                    let local = self.liveness_map.from_live_var(live_local);
+                    let local = self.map.from_live_var(live_local);
                     let live_local_ty = self.mir.local_decls[local].ty;
                     self.add_drop_live_constraint(live_local, live_local_ty, location);
                 }
index 15afc6c52bf2b34eec323282f19e110bad45aec2..a18e2368bf724d55b81f5f5afba76711e8d149d3 100644 (file)
 use borrow_check::location::LocationTable;
 use borrow_check::nll::constraints::{ConstraintSet, OutlivesConstraint};
 use borrow_check::nll::facts::AllFacts;
-use borrow_check::nll::liveness_map::NllLivenessMap;
-use borrow_check::nll::region_infer::values::{LivenessValues, RegionValueElements};
+use borrow_check::nll::region_infer::values::{RegionValueElements, LivenessValues};
 use borrow_check::nll::region_infer::{ClosureRegionRequirementsExt, TypeTest};
-use borrow_check::nll::type_check::free_region_relations::{
-    CreateResult, UniversalRegionRelations,
-};
+use borrow_check::nll::type_check::free_region_relations::{CreateResult, UniversalRegionRelations};
 use borrow_check::nll::universal_regions::UniversalRegions;
 use borrow_check::nll::LocalWithRegion;
 use borrow_check::nll::ToRegionVid;
@@ -119,7 +116,6 @@ pub(crate) fn type_check<'gcx, 'tcx>(
     location_table: &LocationTable,
     borrow_set: &BorrowSet<'tcx>,
     liveness: &LivenessResults<LocalWithRegion>,
-    liveness_map: &NllLivenessMap,
     all_facts: &mut Option<AllFacts>,
     flow_inits: &mut FlowAtLocation<MaybeInitializedPlaces<'_, 'gcx, 'tcx>>,
     move_data: &MoveData<'tcx>,
@@ -170,7 +166,7 @@ pub(crate) fn type_check<'gcx, 'tcx>(
             Some(&mut borrowck_context),
             Some(errors_buffer),
             |cx| {
-                liveness::generate(cx, mir, liveness, liveness_map, flow_inits, move_data);
+                liveness::generate(cx, mir, liveness, flow_inits, move_data);
                 cx.equate_inputs_and_outputs(
                     mir,
                     mir_def_id,
index 3c751d52b066498f93102a1aaf04c57bf2f9669c..79b7d042dd6dbe1c920577cff08efd3aef5ab8d5 100644 (file)
@@ -619,38 +619,6 @@ struct Bar {x: u8}
 `UnsafeCell`.
 "##,
 
-E0018: r##"
-
-The value of static and constant integers must be known at compile time. You
-can't cast a pointer to an integer because the address of a pointer can
-vary.
-
-For example, if you write:
-
-```compile_fail,E0018
-static MY_STATIC: u32 = 42;
-static MY_STATIC_ADDR: usize = &MY_STATIC as *const _ as usize;
-static WHAT: usize = (MY_STATIC_ADDR^17) + MY_STATIC_ADDR;
-```
-
-Then `MY_STATIC_ADDR` would contain the address of `MY_STATIC`. However,
-the address can change when the program is linked, as well as change
-between different executions due to ASLR, and many linkers would
-not be able to calculate the value of `WHAT`.
-
-On the other hand, static and constant pointers can point either to
-a known numeric address or to the address of a symbol.
-
-```
-static MY_STATIC: u32 = 42;
-static MY_STATIC_ADDR: &'static u32 = &MY_STATIC;
-const CONST_ADDR: *const u8 = 0x5f3759df as *const u8;
-```
-
-This does not pose a problem by itself because they can't be
-accessed directly.
-"##,
-
 E0019: r##"
 A function call isn't allowed in the const's initialization expression
 because the expression's value must be known at compile-time. Erroneous code
@@ -1145,36 +1113,6 @@ fn main() {
 ```
 "##,
 
-E0395: r##"
-The value assigned to a constant scalar must be known at compile time,
-which is not the case when comparing raw pointers.
-
-Erroneous code example:
-
-```compile_fail,E0395
-static FOO: i32 = 42;
-static BAR: i32 = 42;
-
-static BAZ: bool = { (&FOO as *const i32) == (&BAR as *const i32) };
-// error: raw pointers cannot be compared in statics!
-```
-
-The address assigned by the linker to `FOO` and `BAR` may or may not
-be identical, so the value of `BAZ` can't be determined.
-
-If you want to do the comparison, please do it at run-time.
-
-For example:
-
-```
-static FOO: i32 = 42;
-static BAR: i32 = 42;
-
-let baz: bool = { (&FOO as *const i32) == (&BAR as *const i32) };
-// baz isn't a constant expression so it's ok
-```
-"##,
-
 E0161: r##"
 A value was moved. However, its size was not known at compile time, and only
 values of a known size can be moved.
@@ -1208,29 +1146,6 @@ fn main() {
 ```
 "##,
 
-E0396: r##"
-The value behind a raw pointer can't be determined at compile-time
-(or even link-time), which means it can't be used in a constant
-expression. Erroneous code example:
-
-```compile_fail,E0396
-const REG_ADDR: *const u8 = 0x5f3759df as *const u8;
-
-const VALUE: u8 = unsafe { *REG_ADDR };
-// error: raw pointers cannot be dereferenced in constants
-```
-
-A possible fix is to dereference your pointer at some point in run-time.
-
-For example:
-
-```
-const REG_ADDR: *const u8 = 0x5f3759df as *const u8;
-
-let reg_value = unsafe { *REG_ADDR };
-```
-"##,
-
 E0492: r##"
 A borrow of a constant containing interior mutability was attempted. Erroneous
 code example:
@@ -1281,9 +1196,7 @@ struct C { a: Cell<usize> }
 ```
 
 This is because cell types do operations that are not thread-safe. Due to this,
-they don't implement Sync and thus can't be placed in statics. In this
-case, `StaticMutex` would work just fine, but it isn't stable yet:
-https://doc.rust-lang.org/nightly/std/sync/struct.StaticMutex.html
+they don't implement Sync and thus can't be placed in statics.
 
 However, if you still wish to use these types, you can achieve this by an unsafe
 wrapper:
index 3f32d307409edb35c8ce34f672c80ea4700e26f1..05c843096d27d1f2655f219eb3fc26696a789d6e 100644 (file)
@@ -18,7 +18,6 @@
 #![feature(in_band_lifetimes)]
 #![feature(slice_patterns)]
 #![feature(slice_sort_by_cached_key)]
-#![feature(from_ref)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(catch_expr)]
 #![feature(const_fn)]
 #![feature(core_intrinsics)]
 #![feature(decl_macro)]
-#![feature(fs_read_write)]
-#![feature(in_band_lifetimes)]
 #![feature(macro_vis_matcher)]
 #![feature(exhaustive_patterns)]
 #![feature(range_contains)]
 #![feature(rustc_diagnostic_macros)]
-#![feature(crate_visibility_modifier)]
 #![feature(never_type)]
 #![feature(specialization)]
 #![feature(try_trait)]
index 8d6d01633a12ef8d5faa6bb52f12bef0475ec9fa..4e32ca483a1253e9dffee63e63aedcdc8d52adfc 100644 (file)
 
 use monomorphize::collector::InliningMap;
 use rustc::dep_graph::WorkProductId;
+use rustc::hir::CodegenFnAttrFlags;
 use rustc::hir::def_id::DefId;
 use rustc::hir::map::DefPathData;
 use rustc::mir::mono::{Linkage, Visibility};
@@ -322,146 +323,16 @@ fn place_root_mono_items<'a, 'tcx, I>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
             None => fallback_cgu_name(tcx),
         };
 
-        let make_codegen_unit = || {
-            CodegenUnit::new(codegen_unit_name.clone())
-        };
-
         let codegen_unit = codegen_units.entry(codegen_unit_name.clone())
-                                            .or_insert_with(make_codegen_unit);
+            .or_insert_with(|| CodegenUnit::new(codegen_unit_name.clone()));
 
         let mut can_be_internalized = true;
-        let default_visibility = |id: DefId, is_generic: bool| {
-            if !tcx.sess.target.target.options.default_hidden_visibility {
-                return Visibility::Default
-            }
-
-            // Generic functions never have export level C
-            if is_generic {
-                return Visibility::Hidden
-            }
-
-            // Things with export level C don't get instantiated in downstream
-            // crates
-            if !id.is_local() {
-                return Visibility::Hidden
-            }
-
-            if let Some(&SymbolExportLevel::C) = tcx.reachable_non_generics(id.krate)
-                                                    .get(&id) {
-                Visibility::Default
-            } else {
-                Visibility::Hidden
-            }
-        };
-        let (linkage, visibility) = match mono_item.explicit_linkage(tcx) {
-            Some(explicit_linkage) => (explicit_linkage, Visibility::Default),
-            None => {
-                match mono_item {
-                    MonoItem::Fn(ref instance) => {
-                        let visibility = match instance.def {
-                            InstanceDef::Item(def_id) => {
-                                let is_generic = instance.substs
-                                                         .types()
-                                                         .next()
-                                                         .is_some();
-
-                                // The `start_fn` lang item is actually a
-                                // monomorphized instance of a function in the
-                                // standard library, used for the `main`
-                                // function. We don't want to export it so we
-                                // tag it with `Hidden` visibility but this
-                                // symbol is only referenced from the actual
-                                // `main` symbol which we unfortunately don't
-                                // know anything about during
-                                // partitioning/collection. As a result we
-                                // forcibly keep this symbol out of the
-                                // `internalization_candidates` set.
-                                //
-                                // FIXME: eventually we don't want to always
-                                // force this symbol to have hidden
-                                // visibility, it should indeed be a candidate
-                                // for internalization, but we have to
-                                // understand that it's referenced from the
-                                // `main` symbol we'll generate later.
-                                if tcx.lang_items().start_fn() == Some(def_id) {
-                                    can_be_internalized = false;
-                                    Visibility::Hidden
-                                } else if def_id.is_local() {
-                                    if is_generic {
-                                        if export_generics {
-                                            if tcx.is_unreachable_local_definition(def_id) {
-                                                // This instance cannot be used
-                                                // from another crate.
-                                                Visibility::Hidden
-                                            } else {
-                                                // This instance might be useful in
-                                                // a downstream crate.
-                                                can_be_internalized = false;
-                                                default_visibility(def_id, true)
-                                            }
-                                        } else {
-                                            // We are not exporting generics or
-                                            // the definition is not reachable
-                                            // for downstream crates, we can
-                                            // internalize its instantiations.
-                                            Visibility::Hidden
-                                        }
-                                    } else {
-                                        // This isn't a generic function.
-                                        if tcx.is_reachable_non_generic(def_id) {
-                                            can_be_internalized = false;
-                                            debug_assert!(!is_generic);
-                                            default_visibility(def_id, false)
-                                        } else {
-                                            Visibility::Hidden
-                                        }
-                                    }
-                                } else {
-                                    // This is an upstream DefId.
-                                    if export_generics && is_generic {
-                                        // If it is a upstream monomorphization
-                                        // and we export generics, we must make
-                                        // it available to downstream crates.
-                                        can_be_internalized = false;
-                                        default_visibility(def_id, true)
-                                    } else {
-                                        Visibility::Hidden
-                                    }
-                                }
-                            }
-                            InstanceDef::FnPtrShim(..) |
-                            InstanceDef::Virtual(..) |
-                            InstanceDef::Intrinsic(..) |
-                            InstanceDef::ClosureOnceShim { .. } |
-                            InstanceDef::DropGlue(..) |
-                            InstanceDef::CloneShim(..) => {
-                                Visibility::Hidden
-                            }
-                        };
-                        (Linkage::External, visibility)
-                    }
-                    MonoItem::Static(def_id) => {
-                        let visibility = if tcx.is_reachable_non_generic(def_id) {
-                            can_be_internalized = false;
-                            default_visibility(def_id, false)
-                        } else {
-                            Visibility::Hidden
-                        };
-                        (Linkage::External, visibility)
-                    }
-                    MonoItem::GlobalAsm(node_id) => {
-                        let def_id = tcx.hir.local_def_id(node_id);
-                        let visibility = if tcx.is_reachable_non_generic(def_id) {
-                            can_be_internalized = false;
-                            default_visibility(def_id, false)
-                        } else {
-                            Visibility::Hidden
-                        };
-                        (Linkage::External, visibility)
-                    }
-                }
-            }
-        };
+        let (linkage, visibility) = mono_item_linkage_and_visibility(
+            tcx,
+            &mono_item,
+            &mut can_be_internalized,
+            export_generics,
+        );
         if visibility == Visibility::Hidden && can_be_internalized {
             internalization_candidates.insert(mono_item);
         }
@@ -487,6 +358,200 @@ fn place_root_mono_items<'a, 'tcx, I>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     }
 }
 
+fn mono_item_linkage_and_visibility(
+    tcx: TyCtxt<'a, 'tcx, 'tcx>,
+    mono_item: &MonoItem<'tcx>,
+    can_be_internalized: &mut bool,
+    export_generics: bool,
+) -> (Linkage, Visibility) {
+    if let Some(explicit_linkage) = mono_item.explicit_linkage(tcx) {
+        return (explicit_linkage, Visibility::Default)
+    }
+    let vis = mono_item_visibility(
+        tcx,
+        mono_item,
+        can_be_internalized,
+        export_generics,
+    );
+    (Linkage::External, vis)
+}
+
+fn mono_item_visibility(
+    tcx: TyCtxt<'a, 'tcx, 'tcx>,
+    mono_item: &MonoItem<'tcx>,
+    can_be_internalized: &mut bool,
+    export_generics: bool,
+) -> Visibility {
+    let instance = match mono_item {
+        // This is pretty complicated, go below
+        MonoItem::Fn(instance) => instance,
+
+        // Misc handling for generics and such, but otherwise
+        MonoItem::Static(def_id) => {
+            return if tcx.is_reachable_non_generic(*def_id) {
+                *can_be_internalized = false;
+                default_visibility(tcx, *def_id, false)
+            } else {
+                Visibility::Hidden
+            };
+        }
+        MonoItem::GlobalAsm(node_id) => {
+            let def_id = tcx.hir.local_def_id(*node_id);
+            return if tcx.is_reachable_non_generic(def_id) {
+                *can_be_internalized = false;
+                default_visibility(tcx, def_id, false)
+            } else {
+                Visibility::Hidden
+            };
+        }
+    };
+
+    let def_id = match instance.def {
+        InstanceDef::Item(def_id) => def_id,
+
+        // These are all compiler glue and such, never exported, always hidden.
+        InstanceDef::FnPtrShim(..) |
+        InstanceDef::Virtual(..) |
+        InstanceDef::Intrinsic(..) |
+        InstanceDef::ClosureOnceShim { .. } |
+        InstanceDef::DropGlue(..) |
+        InstanceDef::CloneShim(..) => {
+            return Visibility::Hidden
+        }
+    };
+
+    // The `start_fn` lang item is actually a monomorphized instance of a
+    // function in the standard library, used for the `main` function. We don't
+    // want to export it so we tag it with `Hidden` visibility but this symbol
+    // is only referenced from the actual `main` symbol which we unfortunately
+    // don't know anything about during partitioning/collection. As a result we
+    // forcibly keep this symbol out of the `internalization_candidates` set.
+    //
+    // FIXME: eventually we don't want to always force this symbol to have
+    //        hidden visibility, it should indeed be a candidate for
+    //        internalization, but we have to understand that it's referenced
+    //        from the `main` symbol we'll generate later.
+    //
+    //        This may be fixable with a new `InstanceDef` perhaps? Unsure!
+    if tcx.lang_items().start_fn() == Some(def_id) {
+        *can_be_internalized = false;
+        return Visibility::Hidden
+    }
+
+    let is_generic = instance.substs.types().next().is_some();
+
+    // Upstream `DefId` instances get different handling than local ones
+    if !def_id.is_local() {
+        return if export_generics && is_generic {
+            // If it is a upstream monomorphization
+            // and we export generics, we must make
+            // it available to downstream crates.
+            *can_be_internalized = false;
+            default_visibility(tcx, def_id, true)
+        } else {
+            Visibility::Hidden
+        }
+    }
+
+    if is_generic {
+        if export_generics {
+            if tcx.is_unreachable_local_definition(def_id) {
+                // This instance cannot be used
+                // from another crate.
+                Visibility::Hidden
+            } else {
+                // This instance might be useful in
+                // a downstream crate.
+                *can_be_internalized = false;
+                default_visibility(tcx, def_id, true)
+            }
+        } else {
+            // We are not exporting generics or
+            // the definition is not reachable
+            // for downstream crates, we can
+            // internalize its instantiations.
+            Visibility::Hidden
+        }
+    } else {
+
+        // If this isn't a generic function then we mark this a `Default` if
+        // this is a reachable item, meaning that it's a symbol other crates may
+        // access when they link to us.
+        if tcx.is_reachable_non_generic(def_id) {
+            *can_be_internalized = false;
+            debug_assert!(!is_generic);
+            return default_visibility(tcx, def_id, false)
+        }
+
+        // If this isn't reachable then we're gonna tag this with `Hidden`
+        // visibility. In some situations though we'll want to prevent this
+        // symbol from being internalized.
+        //
+        // There's two categories of items here:
+        //
+        // * First is weak lang items. These are basically mechanisms for
+        //   libcore to forward-reference symbols defined later in crates like
+        //   the standard library or `#[panic_implementation]` definitions. The
+        //   definition of these weak lang items needs to be referenceable by
+        //   libcore, so we're no longer a candidate for internalization.
+        //   Removal of these functions can't be done by LLVM but rather must be
+        //   done by the linker as it's a non-local decision.
+        //
+        // * Second is "std internal symbols". Currently this is primarily used
+        //   for allocator symbols. Allocators are a little weird in their
+        //   implementation, but the idea is that the compiler, at the last
+        //   minute, defines an allocator with an injected object file. The
+        //   `alloc` crate references these symbols (`__rust_alloc`) and the
+        //   definition doesn't get hooked up until a linked crate artifact is
+        //   generated.
+        //
+        //   The symbols synthesized by the compiler (`__rust_alloc`) are thin
+        //   veneers around the actual implementation, some other symbol which
+        //   implements the same ABI. These symbols (things like `__rg_alloc`,
+        //   `__rdl_alloc`, `__rde_alloc`, etc), are all tagged with "std
+        //   internal symbols".
+        //
+        //   The std-internal symbols here **should not show up in a dll as an
+        //   exported interface**, so they return `false` from
+        //   `is_reachable_non_generic` above and we'll give them `Hidden`
+        //   visibility below. Like the weak lang items, though, we can't let
+        //   LLVM internalize them as this decision is left up to the linker to
+        //   omit them, so prevent them from being internalized.
+        let codegen_fn_attrs = tcx.codegen_fn_attrs(def_id);
+        let std_internal_symbol = codegen_fn_attrs.flags
+            .contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL);
+        if tcx.is_weak_lang_item(def_id) || std_internal_symbol {
+            *can_be_internalized = false;
+        }
+
+        Visibility::Hidden
+    }
+}
+
+fn default_visibility(tcx: TyCtxt, id: DefId, is_generic: bool) -> Visibility {
+    if !tcx.sess.target.target.options.default_hidden_visibility {
+        return Visibility::Default
+    }
+
+    // Generic functions never have export level C
+    if is_generic {
+        return Visibility::Hidden
+    }
+
+    // Things with export level C don't get instantiated in
+    // downstream crates
+    if !id.is_local() {
+        return Visibility::Hidden
+    }
+
+    // C-export level items remain at `Default`, all other internal
+    // items become `Hidden`
+    match tcx.reachable_non_generics(id.krate).get(&id) {
+        Some(SymbolExportLevel::C) => Visibility::Default,
+        _ => Visibility::Hidden,
+    }
+}
+
 fn merge_codegen_units<'tcx>(initial_partitioning: &mut PreInliningPartitioning<'tcx>,
                              target_cgu_count: usize,
                              crate_name: &str) {
index 05e51c5430d7fe5aafd0f4b9741974e09722dc70..5912eee758dbf185f300f7c5b45ee52b8075ef3d 100644 (file)
@@ -333,11 +333,6 @@ fn const_prop(
     ) -> Option<Const<'tcx>> {
         let span = source_info.span;
         match *rvalue {
-            // This branch exists for the sanity type check
-            Rvalue::Use(Operand::Constant(ref c)) => {
-                assert_eq!(c.ty, place_layout.ty);
-                self.eval_constant(c, source_info)
-            },
             Rvalue::Use(ref op) => {
                 self.eval_operand(op, source_info)
             },
index 208679d2aa08adf3aa50a4c66c13b475c27ed8ea..d876ee77e76cf7ccbdf5c0a20d0e778a05895bbb 100644 (file)
@@ -491,41 +491,46 @@ fn visit_place(&mut self,
                     this.super_place(place, context, location);
                     match proj.elem {
                         ProjectionElem::Deref => {
-                            this.add(Qualif::NOT_CONST);
-
-                            let base_ty = proj.base.ty(this.mir, this.tcx).to_ty(this.tcx);
-                            if let ty::TyRawPtr(_) = base_ty.sty {
-                                if this.mode != Mode::Fn {
-                                    let mut err = struct_span_err!(
-                                        this.tcx.sess,
-                                        this.span,
-                                        E0396,
-                                        "raw pointers cannot be dereferenced in {}s",
-                                        this.mode
-                                    );
-                                    err.span_label(this.span,
-                                                   "dereference of raw pointer in constant");
-                                    if this.tcx.sess.teach(&err.get_code().unwrap()) {
-                                        err.note(
-                                            "The value behind a raw pointer can't be determined \
-                                             at compile-time (or even link-time), which means it \
-                                             can't be used in a constant expression."
+                            if let Mode::Fn = this.mode {
+                                this.add(Qualif::NOT_CONST);
+                            } else {
+                                let base_ty = proj.base.ty(this.mir, this.tcx).to_ty(this.tcx);
+                                if let ty::TyRawPtr(_) = base_ty.sty {
+                                    if !this.tcx.sess.features_untracked().const_raw_ptr_deref {
+                                        emit_feature_err(
+                                            &this.tcx.sess.parse_sess, "const_raw_ptr_deref",
+                                            this.span, GateIssue::Language,
+                                            &format!(
+                                                "dereferencing raw pointers in {}s is unstable",
+                                                this.mode,
+                                            ),
                                         );
-                                        err.help("A possible fix is to dereference your pointer \
-                                                  at some point in run-time.");
                                     }
-                                    err.emit();
                                 }
                             }
                         }
 
                         ProjectionElem::Field(..) |
                         ProjectionElem::Index(_) => {
-                            if this.mode == Mode::Fn {
-                                let base_ty = proj.base.ty(this.mir, this.tcx).to_ty(this.tcx);
-                                if let Some(def) = base_ty.ty_adt_def() {
-                                    if def.is_union() {
-                                        this.not_const();
+                            let base_ty = proj.base.ty(this.mir, this.tcx).to_ty(this.tcx);
+                            if let Some(def) = base_ty.ty_adt_def() {
+                                if def.is_union() {
+                                    match this.mode {
+                                        Mode::Fn => this.not_const(),
+                                        Mode::ConstFn => {
+                                            if !this.tcx.sess.features_untracked().const_fn_union {
+                                                emit_feature_err(
+                                                    &this.tcx.sess.parse_sess, "const_fn_union",
+                                                    this.span, GateIssue::Language,
+                                                    "unions in const fn are unstable",
+                                                );
+                                            }
+                                        },
+
+                                        | Mode::Static
+                                        | Mode::StaticMut
+                                        | Mode::Const
+                                        => {},
                                     }
                                 }
                             }
@@ -722,44 +727,17 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
                 match (cast_in, cast_out) {
                     (CastTy::Ptr(_), CastTy::Int(_)) |
                     (CastTy::FnPtr, CastTy::Int(_)) => {
-                        self.add(Qualif::NOT_CONST);
-                        if self.mode != Mode::Fn {
-                            let mut err = struct_span_err!(
-                                self.tcx.sess,
-                                self.span,
-                                E0018,
-                                "raw pointers cannot be cast to integers in {}s",
-                                self.mode
+                        if let Mode::Fn = self.mode {
+                            self.add(Qualif::NOT_CONST);
+                        } else if !self.tcx.sess.features_untracked().const_raw_ptr_to_usize_cast {
+                            emit_feature_err(
+                                &self.tcx.sess.parse_sess, "const_raw_ptr_to_usize_cast",
+                                self.span, GateIssue::Language,
+                                &format!(
+                                    "casting pointers to integers in {}s is unstable",
+                                    self.mode,
+                                ),
                             );
-                            if self.tcx.sess.teach(&err.get_code().unwrap()) {
-                                err.note("\
-The value of static and constant integers must be known at compile time. You can't cast a pointer \
-to an integer because the address of a pointer can vary.
-
-For example, if you write:
-
-```
-static MY_STATIC: u32 = 42;
-static MY_STATIC_ADDR: usize = &MY_STATIC as *const _ as usize;
-static WHAT: usize = (MY_STATIC_ADDR^17) + MY_STATIC_ADDR;
-```
-
-Then `MY_STATIC_ADDR` would contain the address of `MY_STATIC`. However, the address can change \
-when the program is linked, as well as change between different executions due to ASLR, and many \
-linkers would not be able to calculate the value of `WHAT`.
-
-On the other hand, static and constant pointers can point either to a known numeric address or to \
-the address of a symbol.
-
-```
-static MY_STATIC: u32 = 42;
-static MY_STATIC_ADDR: &'static u32 = &MY_STATIC;
-const CONST_ADDR: *const u8 = 0x5f3759df as *const u8;
-```
-
-This does not pose a problem by itself because they can't be accessed directly.");
-                            }
-                            err.emit();
                         }
                     }
                     _ => {}
@@ -773,16 +751,16 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
                             op == BinOp::Ge || op == BinOp::Gt ||
                             op == BinOp::Offset);
 
-                    self.add(Qualif::NOT_CONST);
-                    if self.mode != Mode::Fn {
-                        struct_span_err!(
-                            self.tcx.sess, self.span, E0395,
-                            "raw pointers cannot be compared in {}s",
-                            self.mode)
-                        .span_label(
+                    if let Mode::Fn = self.mode {
+                        self.add(Qualif::NOT_CONST);
+                    } else if !self.tcx.sess.features_untracked().const_compare_raw_pointers {
+                        emit_feature_err(
+                            &self.tcx.sess.parse_sess,
+                            "const_compare_raw_pointers",
                             self.span,
-                            "comparing raw pointers in static")
-                        .emit();
+                            GateIssue::Language,
+                            &format!("comparing raw pointers inside {}", self.mode),
+                        );
                     }
                 }
             }
index e7b2869dfe61eaaea68c0f03df8350a07f7c9c5e..3c5a0590c20235ef59de29b070c03a2d8e597a8e 100644 (file)
@@ -224,11 +224,11 @@ fn visit_lifetime(&mut self, lifetime: &'v hir::Lifetime) {
         self.record("Lifetime", Id::Node(lifetime.id), lifetime);
         hir_visit::walk_lifetime(self, lifetime)
     }
-    fn visit_qpath(&mut self, qpath: &'v hir::QPath, id: NodeId, span: Span) {
+    fn visit_qpath(&mut self, qpath: &'v hir::QPath, id: hir::HirId, span: Span) {
         self.record("QPath", Id::None, qpath);
         hir_visit::walk_qpath(self, qpath, id, span)
     }
-    fn visit_path(&mut self, path: &'v hir::Path, _id: NodeId) {
+    fn visit_path(&mut self, path: &'v hir::Path, _id: hir::HirId) {
         self.record("Path", Id::None, path);
         hir_visit::walk_path(self, path)
     }
index 5c3a016a82b4c599955f62c1204333966b530bc3..b6dd0e8b9b21db9d2d440199675bb736ad46c216 100644 (file)
@@ -815,7 +815,7 @@ fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
     // we prohibit access to private statics from other crates, this allows to give
     // more code internal visibility at link time. (Access to private functions
     // is already prohibited by type privacy for function types.)
-    fn visit_qpath(&mut self, qpath: &'tcx hir::QPath, id: ast::NodeId, span: Span) {
+    fn visit_qpath(&mut self, qpath: &'tcx hir::QPath, id: hir::HirId, span: Span) {
         let def = match *qpath {
             hir::QPath::Resolved(_, ref path) => match path.def {
                 Def::Method(..) | Def::AssociatedConst(..) |
@@ -823,8 +823,7 @@ fn visit_qpath(&mut self, qpath: &'tcx hir::QPath, id: ast::NodeId, span: Span)
                 _ => None,
             }
             hir::QPath::TypeRelative(..) => {
-                let hir_id = self.tcx.hir.node_to_hir_id(id);
-                self.tables.type_dependent_defs().get(hir_id).cloned()
+                self.tables.type_dependent_defs().get(id).cloned()
             }
         };
         if let Some(def) = def {
index c782f2072b9aaaacaed4b844c11f4f0691a6e033..0be1bf3011e78dcc21801915fce229c0b22fc322 100644 (file)
@@ -630,8 +630,10 @@ pub fn macro_def_scope(&mut self, expansion: Mark) -> Module<'a> {
     pub fn get_macro(&mut self, def: Def) -> Lrc<SyntaxExtension> {
         let def_id = match def {
             Def::Macro(def_id, ..) => def_id,
-            Def::NonMacroAttr => return Lrc::new(SyntaxExtension::NonMacroAttr),
-            _ => panic!("Expected Def::Macro(..) or Def::NonMacroAttr"),
+            Def::NonMacroAttr(attr_kind) => return Lrc::new(SyntaxExtension::NonMacroAttr {
+                mark_used: attr_kind == NonMacroAttrKind::Tool,
+            }),
+            _ => panic!("expected `Def::Macro` or `Def::NonMacroAttr`"),
         };
         if let Some(ext) = self.macro_map.get(&def_id) {
             return ext.clone();
index a7fcc89f6b974209c651911f59c49c41a045d506..7e54f176e102b2fca3dee9a43c168eced9d0a96b 100644 (file)
@@ -2698,7 +2698,7 @@ fn resolve_block(&mut self, block: &Block) {
             self.label_ribs.pop();
         }
         self.ribs[ValueNS].pop();
-        if let Some(_) = anonymous_module {
+        if anonymous_module.is_some() {
             self.ribs[TypeNS].pop();
         }
         debug!("(resolving block) leaving block");
@@ -3485,8 +3485,9 @@ fn resolve_path(
             let binding = if let Some(module) = module {
                 self.resolve_ident_in_module(module, ident, ns, record_used, path_span)
             } else if opt_ns == Some(MacroNS) {
-                self.resolve_lexical_macro_path_segment(ident, ns, record_used, path_span)
-                    .map(MacroBinding::binding)
+                assert!(ns == TypeNS);
+                self.resolve_lexical_macro_path_segment(ident, ns, record_used, record_used,
+                                                        false, path_span).map(MacroBinding::binding)
             } else {
                 let record_used_id =
                     if record_used { crate_lint.node_id().or(Some(CRATE_NODE_ID)) } else { None };
@@ -3514,7 +3515,8 @@ fn resolve_path(
                     if let Some(next_module) = binding.module() {
                         module = Some(next_module);
                     } else if def == Def::ToolMod && i + 1 != path.len() {
-                        return PathResult::NonModule(PathResolution::new(Def::NonMacroAttr))
+                        let def = Def::NonMacroAttr(NonMacroAttrKind::Tool);
+                        return PathResult::NonModule(PathResolution::new(def));
                     } else if def == Def::Err {
                         return PathResult::NonModule(err_path_resolution());
                     } else if opt_ns.is_some() && (is_last || maybe_assoc) {
@@ -4254,7 +4256,7 @@ fn find_module(&mut self,
 
         while let Some((in_module, path_segments)) = worklist.pop() {
             // abort if the module is already found
-            if let Some(_) = result { break; }
+            if result.is_some() { break; }
 
             self.populate_module_if_necessary(in_module);
 
@@ -4548,6 +4550,8 @@ fn check_proc_macro_attrs(&mut self, attrs: &[ast::Attribute]) {
             let result = self.resolve_lexical_macro_path_segment(ident,
                                                                  MacroNS,
                                                                  false,
+                                                                 false,
+                                                                 true,
                                                                  attr.path.span);
             if let Ok(binding) = result {
                 if let SyntaxExtension::AttrProcMacro(..) = *binding.binding().get_macro(self) {
index 993874d7c0be883298fafce544016075b8088271..d680b2d9f7d745112bdaede946922cf5f4ae3aec 100644 (file)
 use resolve_imports::ImportResolver;
 use rustc::hir::def_id::{DefId, BUILTIN_MACROS_CRATE, CRATE_DEF_INDEX, DefIndex,
                          DefIndexAddressSpace};
-use rustc::hir::def::{Def, Export};
+use rustc::hir::def::{Def, Export, NonMacroAttrKind};
 use rustc::hir::map::{self, DefCollector};
 use rustc::{ty, lint};
 use rustc::middle::cstore::CrateStore;
 use syntax::ast::{self, Name, Ident};
-use syntax::attr::{self, HasAttrs};
+use syntax::attr;
 use syntax::errors::DiagnosticBuilder;
-use syntax::ext::base::{self, Annotatable, Determinacy, MultiModifier, MultiDecorator};
+use syntax::ext::base::{self, Determinacy, MultiModifier, MultiDecorator};
 use syntax::ext::base::{MacroKind, SyntaxExtension, Resolver as SyntaxResolver};
-use syntax::ext::expand::{self, AstFragment, AstFragmentKind, Invocation, InvocationKind};
+use syntax::ext::expand::{AstFragment, Invocation, InvocationKind};
 use syntax::ext::hygiene::{self, Mark};
-use syntax::ext::placeholders::placeholder;
 use syntax::ext::tt::macro_rules;
 use syntax::feature_gate::{self, feature_err, emit_feature_err, is_builtin_attr_name, GateIssue};
 use syntax::fold::{self, Folder};
@@ -320,7 +319,7 @@ fn find_legacy_attr_invoc(&mut self, attrs: &mut Vec<ast::Attribute>, allow_deri
         None
     }
 
-    fn resolve_invoc(&mut self, invoc: &mut Invocation, scope: Mark, force: bool)
+    fn resolve_invoc(&mut self, invoc: &Invocation, scope: Mark, force: bool)
                      -> Result<Option<Lrc<SyntaxExtension>>, Determinacy> {
         let def = match invoc.kind {
             InvocationKind::Attr { attr: None, .. } => return Ok(None),
@@ -329,17 +328,37 @@ fn resolve_invoc(&mut self, invoc: &mut Invocation, scope: Mark, force: bool)
         if let Def::Macro(_, MacroKind::ProcMacroStub) = def {
             self.report_proc_macro_stub(invoc.span());
             return Err(Determinacy::Determined);
-        } else if let Def::NonMacroAttr = def {
-            if let InvocationKind::Attr { .. } = invoc.kind {
-                if !self.session.features_untracked().tool_attributes {
-                    feature_err(&self.session.parse_sess, "tool_attributes",
-                                invoc.span(), GateIssue::Language,
-                                "tool attributes are unstable").emit();
+        } else if let Def::NonMacroAttr(attr_kind) = def {
+            // Note that not only attributes, but anything in macro namespace can result in a
+            // `Def::NonMacroAttr` definition (e.g. `inline!()`), so we must report the error
+            // below for these cases.
+            let is_attr_invoc =
+                if let InvocationKind::Attr { .. } = invoc.kind { true } else { false };
+            let path = invoc.path().expect("no path for non-macro attr");
+            match attr_kind {
+                NonMacroAttrKind::Tool | NonMacroAttrKind::DeriveHelper |
+                NonMacroAttrKind::Custom if is_attr_invoc => {
+                    if attr_kind == NonMacroAttrKind::Tool &&
+                       !self.session.features_untracked().tool_attributes {
+                        feature_err(&self.session.parse_sess, "tool_attributes",
+                                    invoc.span(), GateIssue::Language,
+                                    "tool attributes are unstable").emit();
+                    }
+                    if attr_kind == NonMacroAttrKind::Custom &&
+                       !self.session.features_untracked().custom_attribute {
+                        let msg = format!("The attribute `{}` is currently unknown to the compiler \
+                                           and may have meaning added to it in the future", path);
+                        feature_err(&self.session.parse_sess, "custom_attribute", invoc.span(),
+                                    GateIssue::Language, &msg).emit();
+                    }
+                    return Ok(Some(Lrc::new(SyntaxExtension::NonMacroAttr {
+                        mark_used: attr_kind == NonMacroAttrKind::Tool,
+                    })));
+                }
+                _ => {
+                    self.report_non_macro_attr(path.span, def);
+                    return Err(Determinacy::Determined);
                 }
-                return Ok(Some(Lrc::new(SyntaxExtension::NonMacroAttr)));
-            } else {
-                self.report_non_macro_attr(invoc.path_span());
-                return Err(Determinacy::Determined);
             }
         }
         let def_id = def.def_id();
@@ -363,8 +382,8 @@ fn resolve_macro(&mut self, scope: Mark, path: &ast::Path, kind: MacroKind, forc
             if let Def::Macro(_, MacroKind::ProcMacroStub) = def {
                 self.report_proc_macro_stub(path.span);
                 return Err(Determinacy::Determined);
-            } else if let Def::NonMacroAttr = def {
-                self.report_non_macro_attr(path.span);
+            } else if let Def::NonMacroAttr(..) = def {
+                self.report_non_macro_attr(path.span, def);
                 return Err(Determinacy::Determined);
             }
             self.unused_macros.remove(&def.def_id());
@@ -396,15 +415,14 @@ fn report_proc_macro_stub(&self, span: Span) {
                               "can't use a procedural macro from the same crate that defines it");
     }
 
-    fn report_non_macro_attr(&self, span: Span) {
-        self.session.span_err(span,
-                              "expected a macro, found non-macro attribute");
+    fn report_non_macro_attr(&self, span: Span, def: Def) {
+        self.session.span_err(span, &format!("expected a macro, found {}", def.kind_name()));
     }
 
-    fn resolve_invoc_to_def(&mut self, invoc: &mut Invocation, scope: Mark, force: bool)
+    fn resolve_invoc_to_def(&mut self, invoc: &Invocation, scope: Mark, force: bool)
                             -> Result<Def, Determinacy> {
-        let (attr, traits, item) = match invoc.kind {
-            InvocationKind::Attr { ref mut attr, ref traits, ref mut item } => (attr, traits, item),
+        let (attr, traits) = match invoc.kind {
+            InvocationKind::Attr { ref attr, ref traits, .. } => (attr, traits),
             InvocationKind::Bang { ref mac, .. } => {
                 return self.resolve_macro_to_def(scope, &mac.node.path, MacroKind::Bang, force);
             }
@@ -413,62 +431,43 @@ fn resolve_invoc_to_def(&mut self, invoc: &mut Invocation, scope: Mark, force: b
             }
         };
 
-
         let path = attr.as_ref().unwrap().path.clone();
-        let mut determinacy = Determinacy::Determined;
-        match self.resolve_macro_to_def(scope, &path, MacroKind::Attr, force) {
-            Ok(def) => return Ok(def),
-            Err(Determinacy::Undetermined) => determinacy = Determinacy::Undetermined,
-            Err(Determinacy::Determined) if force => return Err(Determinacy::Determined),
-            Err(Determinacy::Determined) => {}
+        let def = self.resolve_macro_to_def(scope, &path, MacroKind::Attr, force);
+        if let Ok(Def::NonMacroAttr(NonMacroAttrKind::Custom)) = def {} else {
+            return def;
         }
 
-        // Ok at this point we've determined that the `attr` above doesn't
-        // actually resolve at this time, so we may want to report an error.
-        // It could be the case, though, that `attr` won't ever resolve! If
-        // there's a custom derive that could be used it might declare `attr` as
-        // a custom attribute accepted by the derive. In this case we don't want
-        // to report this particular invocation as unresolved, but rather we'd
-        // want to move on to the next invocation.
+        // At this point we've found that the `attr` is determinately unresolved and thus can be
+        // interpreted as a custom attribute. Normally custom attributes are feature gated, but
+        // it may be a custom attribute whitelisted by a derive macro and they do not require
+        // a feature gate.
         //
-        // This loop here looks through all of the derive annotations in scope
-        // and tries to resolve them. If they themselves successfully resolve
-        // *and* the resolve mentions that this attribute's name is a registered
-        // custom attribute then we flag this attribute as known and update
-        // `invoc` above to point to the next invocation.
-        //
-        // By then returning `Undetermined` we should continue resolution to
-        // resolve the next attribute.
-        let attr_name = match path.segments.len() {
-            1 => path.segments[0].ident.name,
-            _ => return Err(determinacy),
-        };
+        // So here we look through all of the derive annotations in scope and try to resolve them.
+        // If they themselves successfully resolve *and* one of the resolved derive macros
+        // whitelists this attribute's name, then this is a registered attribute and we can convert
+        // it from a "generic custom attrite" into a "known derive helper attribute".
+        enum ConvertToDeriveHelper { Yes, No, DontKnow }
+        let mut convert_to_derive_helper = ConvertToDeriveHelper::No;
+        let attr_name = path.segments[0].ident.name;
         for path in traits {
             match self.resolve_macro(scope, path, MacroKind::Derive, force) {
                 Ok(ext) => if let SyntaxExtension::ProcMacroDerive(_, ref inert_attrs, _) = *ext {
                     if inert_attrs.contains(&attr_name) {
-                        // FIXME(jseyfried) Avoid `mem::replace` here.
-                        let dummy_item = placeholder(AstFragmentKind::Items, ast::DUMMY_NODE_ID)
-                            .make_items().pop().unwrap();
-                        let dummy_item = Annotatable::Item(dummy_item);
-                        *item = mem::replace(item, dummy_item).map_attrs(|mut attrs| {
-                            let inert_attr = attr.take().unwrap();
-                            attr::mark_known(&inert_attr);
-                            if self.use_extern_macros {
-                                *attr = expand::find_attr_invoc(&mut attrs);
-                            }
-                            attrs.push(inert_attr);
-                            attrs
-                        });
-                        return Err(Determinacy::Undetermined)
+                        convert_to_derive_helper = ConvertToDeriveHelper::Yes;
+                        break
                     }
                 },
-                Err(Determinacy::Undetermined) => determinacy = Determinacy::Undetermined,
+                Err(Determinacy::Undetermined) =>
+                    convert_to_derive_helper = ConvertToDeriveHelper::DontKnow,
                 Err(Determinacy::Determined) => {}
             }
         }
 
-        Err(determinacy)
+        match convert_to_derive_helper {
+            ConvertToDeriveHelper::Yes => Ok(Def::NonMacroAttr(NonMacroAttrKind::DeriveHelper)),
+            ConvertToDeriveHelper::No => def,
+            ConvertToDeriveHelper::DontKnow => Err(Determinacy::determined(force)),
+        }
     }
 
     fn resolve_macro_to_def(&mut self, scope: Mark, path: &ast::Path, kind: MacroKind, force: bool)
@@ -481,7 +480,8 @@ fn resolve_macro_to_def(&mut self, scope: Mark, path: &ast::Path, kind: MacroKin
                                       "generic arguments in macro path");
             });
         }
-        if kind != MacroKind::Bang && path.segments.len() > 1 && def != Ok(Def::NonMacroAttr) {
+        if kind != MacroKind::Bang && path.segments.len() > 1 &&
+           def != Ok(Def::NonMacroAttr(NonMacroAttrKind::Tool)) {
             if !self.session.features_untracked().proc_macro_path_invoc {
                 emit_feature_err(
                     &self.session.parse_sess,
@@ -550,10 +550,11 @@ pub fn resolve_macro_to_def_inner(&mut self, scope: Mark, path: &ast::Path,
         let result = if let Some(MacroBinding::Legacy(binding)) = legacy_resolution {
             Ok(Def::Macro(binding.def_id, MacroKind::Bang))
         } else {
-            match self.resolve_lexical_macro_path_segment(path[0], MacroNS, false, span) {
+            match self.resolve_lexical_macro_path_segment(path[0], MacroNS, false, force,
+                                                          kind == MacroKind::Attr, span) {
                 Ok(binding) => Ok(binding.binding().def_ignoring_ambiguity()),
-                Err(Determinacy::Undetermined) if !force => return Err(Determinacy::Undetermined),
-                Err(_) => {
+                Err(Determinacy::Undetermined) => return Err(Determinacy::Undetermined),
+                Err(Determinacy::Determined) => {
                     self.found_unresolved_macro = true;
                     Err(Determinacy::Determined)
                 }
@@ -574,6 +575,8 @@ pub fn resolve_lexical_macro_path_segment(&mut self,
                                               mut ident: Ident,
                                               ns: Namespace,
                                               record_used: bool,
+                                              force: bool,
+                                              is_attr: bool,
                                               path_span: Span)
                                               -> Result<MacroBinding<'a>, Determinacy> {
         // General principles:
@@ -604,6 +607,7 @@ pub fn resolve_lexical_macro_path_segment(&mut self,
         // 3. Builtin attributes (closed, controlled).
 
         assert!(ns == TypeNS  || ns == MacroNS);
+        assert!(force || !record_used); // `record_used` implies `force`
         ident = ident.modern();
 
         // Names from inner scope that can't shadow names from outer scopes, e.g.
@@ -647,8 +651,9 @@ enum WhereToResolve<'a> {
                 }
                 WhereToResolve::BuiltinAttrs => {
                     if is_builtin_attr_name(ident.name) {
-                        let binding = (Def::NonMacroAttr, ty::Visibility::Public,
-                                       ident.span, Mark::root()).to_name_binding(self.arenas);
+                        let binding = (Def::NonMacroAttr(NonMacroAttrKind::Builtin),
+                                       ty::Visibility::Public, ident.span, Mark::root())
+                                       .to_name_binding(self.arenas);
                         Ok(MacroBinding::Global(binding))
                     } else {
                         Err(Determinacy::Determined)
@@ -776,7 +781,7 @@ macro_rules! continue_search { () => {
                 Err(Determinacy::Determined) => {
                     continue_search!();
                 }
-                Err(Determinacy::Undetermined) => return Err(Determinacy::Undetermined),
+                Err(Determinacy::Undetermined) => return Err(Determinacy::determined(force)),
             }
         }
 
@@ -785,7 +790,19 @@ macro_rules! continue_search { () => {
             return Ok(previous_result);
         }
 
-        if record_used { Err(Determinacy::Determined) } else { Err(Determinacy::Undetermined) }
+        let determinacy = Determinacy::determined(force);
+        if determinacy == Determinacy::Determined && is_attr {
+            // For single-segment attributes interpret determinate "no resolution" as a custom
+            // attribute. (Lexical resolution implies the first segment and is_attr should imply
+            // the last segment, so we are certainly working with a single-segment attribute here.)
+            assert!(ns == MacroNS);
+            let binding = (Def::NonMacroAttr(NonMacroAttrKind::Custom),
+                           ty::Visibility::Public, ident.span, Mark::root())
+                           .to_name_binding(self.arenas);
+            Ok(MacroBinding::Global(binding))
+        } else {
+            Err(determinacy)
+        }
     }
 
     pub fn resolve_legacy_scope(&mut self,
@@ -869,7 +886,8 @@ pub fn finalize_current_module_macro_resolutions(&mut self) {
             let span = ident.span;
             let legacy_scope = &self.invocations[&mark].legacy_scope;
             let legacy_resolution = self.resolve_legacy_scope(legacy_scope, ident, true);
-            let resolution = self.resolve_lexical_macro_path_segment(ident, MacroNS, true, span);
+            let resolution = self.resolve_lexical_macro_path_segment(ident, MacroNS, true, true,
+                                                                     kind == MacroKind::Attr, span);
 
             let check_consistency = |this: &Self, binding: MacroBinding| {
                 if let Some(def) = def {
index 2fe7d73de8aa02b3532edeebfa029da9ca32bd1e..d2e52f98238dd99012e429bbce818df934744e78 100644 (file)
@@ -39,7 +39,7 @@ pub struct WriteOutput<'b, W: Write + 'b> {
 
 impl<'b, W: Write> DumpOutput for WriteOutput<'b, W> {
     fn dump(&mut self, result: &Analysis) {
-        if let Err(_) = write!(self.output, "{}", as_json(&result)) {
+        if write!(self.output, "{}", as_json(&result)).is_err() {
             error!("Error writing output");
         }
     }
index 431147e0829af65531c7bddacfbcf41c037a17f0..e256f1761f146655aa8b76de226997cad52f949c 100644 (file)
@@ -810,9 +810,8 @@ fn fn_type(path: &ast::Path) -> bool {
             HirDef::SelfTy(..) |
             HirDef::Label(..) |
             HirDef::Macro(..) |
-            HirDef::GlobalAsm(..) |
             HirDef::ToolMod |
-            HirDef::NonMacroAttr |
+            HirDef::NonMacroAttr(..) |
             HirDef::Err => None,
         }
     }
index a50a5a2d1cbe711014b1587563da7b3782177a81..af2697f62f79eee60fce18b12ba9cb7a3514ee73 100644 (file)
@@ -23,8 +23,6 @@
 
 #![feature(box_syntax)]
 #![feature(const_fn)]
-#![feature(fs_read_write)]
-#![feature(inclusive_range)]
 #![feature(slice_patterns)]
 
 #[macro_use]
index cfd73e371ddacad71372f84857d1e35f971093a3..f8cd1b5b81207b95a5ded060b4bf72ad36b4aa58 100644 (file)
@@ -33,6 +33,7 @@ pub fn target() -> TargetResult {
             executables: true,
             panic_strategy: PanicStrategy::Abort,
             relocation_model: "static".to_string(),
+            emit_debug_gdb_scripts: false,
             abi_blacklist: vec![
                 Abi::Cdecl,
                 Abi::Stdcall,
index 0ca92d724b55934e1717a593f6cd9f24b0b4ae13..546553ac2455de6dd5ad1e038b6c2a3fa8fb59e2 100644 (file)
@@ -68,9 +68,7 @@ pub fn compare_impl_method<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 
     if let Err(ErrorReported) = compare_synthetic_generics(tcx,
                                                            impl_m,
-                                                           impl_m_span,
-                                                           trait_m,
-                                                           trait_item_span) {
+                                                           trait_m) {
         return;
     }
 
@@ -729,14 +727,11 @@ trait `{}` has {}",
 
 fn compare_synthetic_generics<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                         impl_m: &ty::AssociatedItem,
-                                        _impl_m_span: Span, // FIXME necessary?
-                                        trait_m: &ty::AssociatedItem,
-                                        _trait_item_span: Option<Span>) // FIXME necessary?
+                                        trait_m: &ty::AssociatedItem)
                                         -> Result<(), ErrorReported> {
     // FIXME(chrisvittal) Clean up this function, list of FIXME items:
     //     1. Better messages for the span labels
     //     2. Explanation as to what is going on
-    //     3. Correct the function signature for what we actually use
     // If we get here, we already have the same number of generics, so the zip will
     // be okay.
     let mut error_found = false;
index 8d8482208b97d3d1f317772cbdf684a6e65cd7e3..68e851446dc964014f96de7c533abef8e0659c4a 100644 (file)
@@ -758,8 +758,9 @@ pub fn matches_return_type(&self,
                         self.span, infer::FnCall, &fty);
 
                     if let Some(self_ty) = self_ty {
-                        if let Err(_) = self.at(&ObligationCause::dummy(), self.param_env)
-                            .sup(fty.inputs()[0], self_ty)
+                        if self.at(&ObligationCause::dummy(), self.param_env)
+                               .sup(fty.inputs()[0], self_ty)
+                               .is_err()
                         {
                             return false
                         }
index 8c47df8b04221318e4ca7ddf1db159d303c57349..9b6772e2dbb21b21ac0b2a7e5fc7695c9d3439c2 100644 (file)
@@ -3915,7 +3915,7 @@ fn check_expr_kind(&self,
 
             }
             hir::ExprKind::Continue(destination) => {
-                if let Ok(_) = destination.target_id {
+                if destination.target_id.is_ok() {
                     tcx.types.never
                 } else {
                     // There was an error, make typecheck fail
index 4d9a4a03a6b50326bdc92c48f9dfdc8a3657dba3..ba65d0606b37267ee00a4f837b1b420628b707e6 100644 (file)
@@ -41,21 +41,19 @@ struct Checker<'a, 'tcx: 'a> {
 
 impl<'a, 'tcx> Checker<'a, 'tcx> {
     fn check<F>(&self, trait_def_id: Option<DefId>, mut f: F) -> &Self
-        where F: FnMut(TyCtxt<'a, 'tcx, 'tcx>, DefId, DefId)
+        where F: FnMut(TyCtxt<'a, 'tcx, 'tcx>, DefId)
     {
         if Some(self.trait_def_id) == trait_def_id {
             for &impl_id in self.tcx.hir.trait_impls(self.trait_def_id) {
                 let impl_def_id = self.tcx.hir.local_def_id(impl_id);
-                f(self.tcx, self.trait_def_id, impl_def_id);
+                f(self.tcx, impl_def_id);
             }
         }
         self
     }
 }
 
-fn visit_implementation_of_drop<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
-                                          _drop_did: DefId,
-                                          impl_did: DefId) {
+fn visit_implementation_of_drop<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_did: DefId) {
     match tcx.type_of(impl_did).sty {
         ty::TyAdt(..) => {}
         _ => {
@@ -87,9 +85,7 @@ fn visit_implementation_of_drop<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     }
 }
 
-fn visit_implementation_of_copy<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
-                                          _copy_did: DefId,
-                                          impl_did: DefId) {
+fn visit_implementation_of_copy<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_did: DefId) {
     debug!("visit_implementation_of_copy: impl_did={:?}", impl_did);
 
     let impl_node_id = if let Some(n) = tcx.hir.as_local_node_id(impl_did) {
@@ -157,9 +153,7 @@ fn visit_implementation_of_copy<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     }
 }
 
-fn visit_implementation_of_coerce_unsized<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
-                                                    _: DefId,
-                                                    impl_did: DefId) {
+fn visit_implementation_of_coerce_unsized<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_did: DefId) {
     debug!("visit_implementation_of_coerce_unsized: impl_did={:?}",
            impl_did);
 
index 9fd5db16fb1089081bc6c552bd4a4ad8704b7f06..ecc167d5a196776c77214d05298198bdc03ca6e7 100644 (file)
@@ -74,7 +74,6 @@
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(crate_visibility_modifier)]
-#![feature(from_ref)]
 #![feature(exhaustive_patterns)]
 #![feature(iterator_find_map)]
 #![feature(quote)]
index 507aff0c3c727c5cab548ad824d9ca9c5a7ee6b7..5fd0b88870736c0d82d0a265458d1a0d7deec4ad 100644 (file)
@@ -126,6 +126,7 @@ fn get_auto_trait_impl_for<F>(
             let trait_ = hir::TraitRef {
                 path: get_path_for_type(self.cx.tcx, trait_def_id, hir::def::Def::Trait),
                 ref_id: ast::DUMMY_NODE_ID,
+                hir_ref_id: hir::DUMMY_HIR_ID,
             };
 
             let polarity;
@@ -418,8 +419,8 @@ fn extract_for_generics<'b, 'c, 'd>(
                                 name: name.to_string(),
                                 kind: GenericParamDefKind::Lifetime,
                             })
-                        }
-                        &ty::ReVar(_) | &ty::ReEarlyBound(_) => None,
+                        },
+                        &ty::ReVar(_) | &ty::ReEarlyBound(_) | &ty::ReStatic => None,
                         _ => panic!("Unexpected region type {:?}", r),
                     }
                 })
index 5b352ffb725d0cc03eb3ae1dc731bc2f8cc82861..83e0827340dafbb3e4fa9fe5a1af05d1c65be175 100644 (file)
@@ -119,6 +119,7 @@ pub fn get_blanket_impls<F>(
                                                         trait_def_id,
                                                         hir::def::Def::Trait),
                                 ref_id: ast::DUMMY_NODE_ID,
+                                hir_ref_id: hir::DUMMY_HIR_ID,
                             };
                             let provided_trait_methods =
                                 infcx.tcx.provided_trait_methods(trait_def_id)
index 86e5bbeab706a2dafa72c089270bd171ec9373df..68e4618328077cc6030e309c031703c4ed14186b 100644 (file)
@@ -486,7 +486,7 @@ pub fn run_core(search_paths: SearchPaths,
                                                         &name,
                                                         &output_filenames,
                                                         |tcx, analysis, _, result| {
-            if let Err(_) = result {
+            if result.is_err() {
                 sess.fatal("Compilation failed, aborting rustdoc");
             }
 
index 73d7a9ab8599d75015d62301eeb2c21e1cdddc3b..ff2cc35fce807622012c1ddac4ef177d24704b62 100644 (file)
@@ -44,7 +44,7 @@ pub fn render_with_highlighting(src: &str, class: Option<&str>,
     write_header(class, &mut out).unwrap();
 
     let mut classifier = Classifier::new(lexer::StringReader::new(&sess, fm, None), sess.codemap());
-    if let Err(_) = classifier.write_source(&mut out) {
+    if classifier.write_source(&mut out).is_err() {
         return format!("<pre>{}</pre>", src);
     }
 
index b22e239e20a0eeaf166b3b34935ceb6eaaed5655..c104b883340615d88948f4d1b48f464c42cd0abc 100644 (file)
@@ -625,7 +625,7 @@ fn parse(string: &str, allow_error_code_check: ErrorCodes) -> LangString {
                     data.no_run = true;
                 }
                 x if allow_error_code_check && x.starts_with("E") && x.len() == 5 => {
-                    if let Ok(_) = x[1..].parse::<u32>() {
+                    if x[1..].parse::<u32>().is_ok() {
                         data.error_codes.push(x.to_owned());
                         seen_rust_tags = !seen_other_tags || seen_rust_tags;
                     } else {
index c2978a62489a0d86bd787212f9abc144d2d4dc81..470aa2c10e977898f31b54d6c95d3c17c68dc33c 100644 (file)
@@ -1613,7 +1613,6 @@ impl fmt::Display for AllTypes {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f,
 "<h1 class='fqn'>\
-     <span class='in-band'>List of all items</span>\
      <span class='out-of-band'>\
          <span id='render-detail'>\
              <a id=\"toggle-all-docs\" href=\"javascript:void(0)\" title=\"collapse all docs\">\
@@ -1621,6 +1620,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
              </a>\
          </span>
      </span>
+     <span class='in-band'>List of all items</span>\
 </h1>")?;
         print_entries(f, &self.structs, "Structs", "structs")?;
         print_entries(f, &self.enums, "Enums", "enums")?;
@@ -2068,7 +2068,34 @@ impl<'a> fmt::Display for Item<'a> {
     fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
         debug_assert!(!self.item.is_stripped());
         // Write the breadcrumb trail header for the top
-        write!(fmt, "<h1 class='fqn'><span class='in-band'>")?;
+        write!(fmt, "<h1 class='fqn'><span class='out-of-band'>")?;
+        if let Some(version) = self.item.stable_since() {
+            write!(fmt, "<span class='since' title='Stable since Rust version {0}'>{0}</span>",
+                   version)?;
+        }
+        write!(fmt,
+               "<span id='render-detail'>\
+                   <a id=\"toggle-all-docs\" href=\"javascript:void(0)\" \
+                      title=\"collapse all docs\">\
+                       [<span class='inner'>&#x2212;</span>]\
+                   </a>\
+               </span>")?;
+
+        // Write `src` tag
+        //
+        // When this item is part of a `pub use` in a downstream crate, the
+        // [src] link in the downstream documentation will actually come back to
+        // this page, and this link will be auto-clicked. The `id` attribute is
+        // used to find the link to auto-click.
+        if self.cx.shared.include_sources && !self.item.is_primitive() {
+            if let Some(l) = self.src_href() {
+                write!(fmt, "<a class='srclink' href='{}' title='{}'>[src]</a>",
+                       l, "goto source code")?;
+            }
+        }
+
+        write!(fmt, "</span>")?; // out-of-band
+        write!(fmt, "<span class='in-band'>")?;
         match self.item.inner {
             clean::ModuleItem(ref m) => if m.is_crate {
                     write!(fmt, "Crate ")?;
@@ -2105,34 +2132,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
         write!(fmt, "<a class=\"{}\" href=''>{}</a>",
                self.item.type_(), self.item.name.as_ref().unwrap())?;
 
-        write!(fmt, "</span>")?; // in-band
-        write!(fmt, "<span class='out-of-band'>")?;
-        if let Some(version) = self.item.stable_since() {
-            write!(fmt, "<span class='since' title='Stable since Rust version {0}'>{0}</span>",
-                   version)?;
-        }
-        write!(fmt,
-               "<span id='render-detail'>\
-                   <a id=\"toggle-all-docs\" href=\"javascript:void(0)\" \
-                      title=\"collapse all docs\">\
-                       [<span class='inner'>&#x2212;</span>]\
-                   </a>\
-               </span>")?;
-
-        // Write `src` tag
-        //
-        // When this item is part of a `pub use` in a downstream crate, the
-        // [src] link in the downstream documentation will actually come back to
-        // this page, and this link will be auto-clicked. The `id` attribute is
-        // used to find the link to auto-click.
-        if self.cx.shared.include_sources && !self.item.is_primitive() {
-            if let Some(l) = self.src_href() {
-                write!(fmt, "<a class='srclink' href='{}' title='{}'>[src]</a>",
-                       l, "goto source code")?;
-            }
-        }
-
-        write!(fmt, "</span></h1>")?; // out-of-band
+        write!(fmt, "</span></h1>")?; // in-band
 
         match self.item.inner {
             clean::ModuleItem(ref m) =>
index 62ef5626ee5bb4f1165ac09b34d4e3413ac38872..07507047dc2c95c76039fcfe245a33a20cce7938 100644 (file)
     };
 
     autoCollapse(getPageId(), getCurrentValue("rustdoc-collapse") === "true");
+
+    if (window.location.hash && window.location.hash.length > 0) {
+        var hash = getPageId();
+        if (hash !== null) {
+            var elem = document.getElementById(hash);
+            if (elem && elem.offsetParent === null) {
+                console.log(elem, elem.parentNode);
+                if (elem.parentNode && elem.parentNode.previousSibling) {
+                    var collapses = elem.parentNode
+                                        .previousSibling
+                                        .getElementsByClassName("collapse-toggle");
+                    if (collapses.length > 0) {
+                        // The element is not visible, we need to make it appear!
+                        collapseDocs(collapses[0], "show");
+                    }
+                }
+            }
+        }
+    }
 }());
 
 // Sets the focus on the search bar at the top of the page
index 496029e33fc65cebf2541ec3155aa68b1a788d5a..57a111daa897718b5920d831350a3a228f992716 100644 (file)
@@ -97,7 +97,7 @@ h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.important), h4
 h1.fqn {
        border-bottom: 1px dashed;
        margin-top: 0;
-       position: relative;
+       overflow: auto;
 }
 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
        border-bottom: 1px solid;
@@ -352,14 +352,11 @@ nav.sub {
 }
 
 .content .out-of-band {
+       float: right;
        font-size: 23px;
        margin: 0px;
        padding: 0px;
-       text-align: right;
-       display: inline-block;
        font-weight: normal;
-       position: absolute;
-       right: 0;
 }
 
 h3.impl > .out-of-band {
index bd7f7386fd14b6aa7ce56898ee182dd592460d81..78ecfd13e2f96bdf647cd7ef7e6403d15b3ec2c3 100644 (file)
        html_root_url = "https://doc.rust-lang.org/nightly/",
        html_playground_url = "https://play.rust-lang.org/")]
 
-#![feature(ascii_ctype)]
 #![feature(rustc_private)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
-#![feature(fs_read_write)]
 #![feature(iterator_find_map)]
 #![feature(set_stdio)]
 #![feature(slice_sort_by_cached_key)]
 #![feature(test)]
 #![feature(vec_remove_item)]
-#![feature(entry_and_modify)]
 #![feature(ptr_offset_from)]
 #![feature(crate_visibility_modifier)]
 #![feature(const_fn)]
index 3c01de2e997c9cbc4a82adf509bbb2e7db9ee41f..0bc968b6c5cda20b8937fba1ab76f2b1811865b0 100644 (file)
 
 // std is implemented with unstable features, many of which are internal
 // compiler details that will never be stable
+#![cfg_attr(test, feature(test, update_panic_count))]
 #![feature(alloc)]
 #![feature(alloc_error_handler)]
 #![feature(alloc_system)]
 #![feature(align_offset)]
 #![feature(arbitrary_self_types)]
 #![feature(array_error_internals)]
-#![feature(ascii_ctype)]
 #![feature(asm)]
 #![feature(attr_literals)]
 #![feature(box_syntax)]
 #![feature(cfg_target_thread_local)]
 #![feature(cfg_target_vendor)]
 #![feature(char_error_internals)]
-#![feature(char_internals)]
-#![feature(collections_range)]
 #![feature(compiler_builtins_lib)]
 #![feature(const_fn)]
+#![feature(const_int_ops)]
+#![feature(const_ip)]
 #![feature(core_intrinsics)]
 #![feature(dropck_eyepatch)]
 #![feature(exact_size_is_empty)]
 #![feature(external_doc)]
-#![feature(fs_read_write)]
 #![feature(fixed_size_array)]
-#![feature(float_from_str_radix)]
 #![feature(fn_traits)]
 #![feature(fnbox)]
 #![feature(futures_api)]
 #![feature(hashmap_internals)]
 #![feature(int_error_internals)]
 #![feature(integer_atomics)]
-#![feature(into_cow)]
 #![feature(lang_items)]
 #![feature(libc)]
 #![feature(link_args)]
 #![feature(needs_panic_runtime)]
 #![feature(never_type)]
 #![feature(exhaustive_patterns)]
-#![feature(num_bits_bytes)]
-#![feature(old_wrapping)]
 #![feature(on_unimplemented)]
-#![feature(oom)]
 #![feature(optin_builtin_traits)]
 #![feature(panic_internals)]
 #![feature(panic_unwind)]
-#![feature(peek)]
 #![feature(pin)]
-#![feature(placement_new_protocol)]
 #![feature(prelude_import)]
 #![feature(ptr_internals)]
-#![feature(rand)]
 #![feature(raw)]
 #![feature(rustc_attrs)]
+#![feature(rustc_const_unstable)]
 #![feature(std_internals)]
 #![feature(stdsimd)]
 #![feature(shrink_to)]
-#![feature(slice_bytes)]
 #![feature(slice_concat_ext)]
 #![feature(slice_internals)]
 #![feature(slice_patterns)]
 #![feature(staged_api)]
 #![feature(stmt_expr_attributes)]
-#![feature(str_char)]
 #![feature(str_internals)]
-#![feature(str_utf16)]
-#![feature(test, rustc_private)]
+#![feature(rustc_private)]
 #![feature(thread_local)]
 #![feature(toowned_clone_into)]
 #![feature(try_from)]
 #![feature(untagged_unions)]
 #![feature(unwind_attributes)]
 #![feature(use_extern_macros)]
-#![feature(vec_push_all)]
 #![feature(doc_cfg)]
 #![feature(doc_masked)]
 #![feature(doc_spotlight)]
-#![cfg_attr(test, feature(update_panic_count))]
 #![cfg_attr(windows, feature(used))]
 #![feature(doc_alias)]
 #![feature(doc_keyword)]
-#![feature(float_internals)]
 #![feature(panic_info_message)]
 #![feature(panic_implementation)]
 
index fcec8d06853f67949c229d50b2e6807d8c3785c6..d601a0c42e980480d7fd02fea4d7e2daf8aa39ac 100644 (file)
@@ -16,8 +16,6 @@
 use cmp::Ordering;
 use fmt;
 use hash;
-use mem;
-use net::{hton, ntoh};
 use sys::net::netc as c;
 use sys_common::{AsInner, FromInner};
 
@@ -340,18 +338,21 @@ impl Ipv4Addr {
     /// let addr = Ipv4Addr::new(127, 0, 0, 1);
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
+    #[rustc_const_unstable(feature = "const_ip")]
+    pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
         Ipv4Addr {
             inner: c::in_addr {
-                s_addr: hton(((a as u32) << 24) |
-                             ((b as u32) << 16) |
-                             ((c as u32) <<  8) |
-                              (d as u32)),
+                s_addr: u32::to_be(
+                    ((a as u32) << 24) |
+                    ((b as u32) << 16) |
+                    ((c as u32) <<  8) |
+                    (d as u32)
+                ),
             }
         }
     }
 
-    /// Creates a new IPv4 address with the address pointing to localhost: 127.0.0.1.
+    /// An IPv4 address with the address pointing to localhost: 127.0.0.1.
     ///
     /// # Examples
     ///
@@ -359,17 +360,15 @@ pub fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
     /// #![feature(ip_constructors)]
     /// use std::net::Ipv4Addr;
     ///
-    /// let addr = Ipv4Addr::localhost();
+    /// let addr = Ipv4Addr::LOCALHOST;
     /// assert_eq!(addr, Ipv4Addr::new(127, 0, 0, 1));
     /// ```
     #[unstable(feature = "ip_constructors",
                reason = "requires greater scrutiny before stabilization",
                issue = "44582")]
-    pub fn localhost() -> Ipv4Addr {
-        Ipv4Addr::new(127, 0, 0, 1)
-    }
+    pub const LOCALHOST: Self = Ipv4Addr::new(127, 0, 0, 1);
 
-    /// Creates a new IPv4 address representing an unspecified address: 0.0.0.0
+    /// An IPv4 address representing an unspecified address: 0.0.0.0
     ///
     /// # Examples
     ///
@@ -377,15 +376,29 @@ pub fn localhost() -> Ipv4Addr {
     /// #![feature(ip_constructors)]
     /// use std::net::Ipv4Addr;
     ///
-    /// let addr = Ipv4Addr::unspecified();
+    /// let addr = Ipv4Addr::UNSPECIFIED;
     /// assert_eq!(addr, Ipv4Addr::new(0, 0, 0, 0));
     /// ```
     #[unstable(feature = "ip_constructors",
                reason = "requires greater scrutiny before stabilization",
                issue = "44582")]
-    pub fn unspecified() -> Ipv4Addr {
-        Ipv4Addr::new(0, 0, 0, 0)
-    }
+    pub const UNSPECIFIED: Self = Ipv4Addr::new(0, 0, 0, 0);
+
+    /// An IPv4 address representing the broadcast address: 255.255.255.255
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// #![feature(ip_constructors)]
+    /// use std::net::Ipv4Addr;
+    ///
+    /// let addr = Ipv4Addr::BROADCAST;
+    /// assert_eq!(addr, Ipv4Addr::new(255, 255, 255, 255));
+    /// ```
+    #[unstable(feature = "ip_constructors",
+               reason = "requires greater scrutiny before stabilization",
+               issue = "44582")]
+    pub const BROADCAST: Self = Ipv4Addr::new(255, 255, 255, 255);
 
     /// Returns the four eight-bit integers that make up this address.
     ///
@@ -399,7 +412,7 @@ pub fn unspecified() -> Ipv4Addr {
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn octets(&self) -> [u8; 4] {
-        let bits = ntoh(self.inner.s_addr);
+        let bits = u32::from_be(self.inner.s_addr);
         [(bits >> 24) as u8, (bits >> 16) as u8, (bits >> 8) as u8, bits as u8]
     }
 
@@ -573,8 +586,7 @@ pub fn is_multicast(&self) -> bool {
     /// ```
     #[stable(since = "1.7.0", feature = "ip_17")]
     pub fn is_broadcast(&self) -> bool {
-        self.octets()[0] == 255 && self.octets()[1] == 255 &&
-        self.octets()[2] == 255 && self.octets()[3] == 255
+        self == &Self::BROADCAST
     }
 
     /// Returns [`true`] if this address is in a range designated for documentation.
@@ -763,7 +775,7 @@ fn partial_cmp(&self, other: &IpAddr) -> Option<Ordering> {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl Ord for Ipv4Addr {
     fn cmp(&self, other: &Ipv4Addr) -> Ordering {
-        ntoh(self.inner.s_addr).cmp(&ntoh(other.inner.s_addr))
+        u32::from_be(self.inner.s_addr).cmp(&u32::from_be(other.inner.s_addr))
     }
 }
 
@@ -856,21 +868,27 @@ impl Ipv6Addr {
     /// let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff);
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
-    pub fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16,
-               h: u16) -> Ipv6Addr {
-        let mut addr: c::in6_addr = unsafe { mem::zeroed() };
-        addr.s6_addr = [(a >> 8) as u8, a as u8,
-                        (b >> 8) as u8, b as u8,
-                        (c >> 8) as u8, c as u8,
-                        (d >> 8) as u8, d as u8,
-                        (e >> 8) as u8, e as u8,
-                        (f >> 8) as u8, f as u8,
-                        (g >> 8) as u8, g as u8,
-                        (h >> 8) as u8, h as u8];
-        Ipv6Addr { inner: addr }
+    #[rustc_const_unstable(feature = "const_ip")]
+    pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16,
+                     g: u16, h: u16) -> Ipv6Addr {
+        Ipv6Addr {
+            inner: c::in6_addr {
+                s6_addr: [
+                    (a >> 8) as u8, a as u8,
+                    (b >> 8) as u8, b as u8,
+                    (c >> 8) as u8, c as u8,
+                    (d >> 8) as u8, d as u8,
+                    (e >> 8) as u8, e as u8,
+                    (f >> 8) as u8, f as u8,
+                    (g >> 8) as u8, g as u8,
+                    (h >> 8) as u8, h as u8
+                ],
+            }
+        }
+
     }
 
-    /// Creates a new IPv6 address representing localhost: `::1`.
+    /// An IPv6 address representing localhost: `::1`.
     ///
     /// # Examples
     ///
@@ -878,17 +896,15 @@ pub fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16,
     /// #![feature(ip_constructors)]
     /// use std::net::Ipv6Addr;
     ///
-    /// let addr = Ipv6Addr::localhost();
+    /// let addr = Ipv6Addr::LOCALHOST;
     /// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
     /// ```
     #[unstable(feature = "ip_constructors",
                reason = "requires greater scrutiny before stabilization",
                issue = "44582")]
-    pub fn localhost() -> Ipv6Addr {
-        Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)
-    }
+    pub const LOCALHOST: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1);
 
-    /// Creates a new IPv6 address representing the unspecified address: `::`
+    /// An IPv6 address representing the unspecified address: `::`
     ///
     /// # Examples
     ///
@@ -896,15 +912,13 @@ pub fn localhost() -> Ipv6Addr {
     /// #![feature(ip_constructors)]
     /// use std::net::Ipv6Addr;
     ///
-    /// let addr = Ipv6Addr::unspecified();
+    /// let addr = Ipv6Addr::UNSPECIFIED;
     /// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0));
     /// ```
     #[unstable(feature = "ip_constructors",
                reason = "requires greater scrutiny before stabilization",
                issue = "44582")]
-    pub fn unspecified() -> Ipv6Addr {
-        Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)
-    }
+    pub const UNSPECIFIED: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0);
 
     /// Returns the eight 16-bit segments that make up this address.
     ///
@@ -1414,8 +1428,7 @@ fn from(ip: u128) -> Ipv6Addr {
 #[stable(feature = "ipv6_from_octets", since = "1.9.0")]
 impl From<[u8; 16]> for Ipv6Addr {
     fn from(octets: [u8; 16]) -> Ipv6Addr {
-        let mut inner: c::in6_addr = unsafe { mem::zeroed() };
-        inner.s6_addr = octets;
+        let inner = c::in6_addr { s6_addr: octets };
         Ipv6Addr::from_inner(inner)
     }
 }
@@ -1846,18 +1859,20 @@ fn test_int_to_ipv6() {
 
     #[test]
     fn ipv4_from_constructors() {
-        assert_eq!(Ipv4Addr::localhost(), Ipv4Addr::new(127, 0, 0, 1));
-        assert!(Ipv4Addr::localhost().is_loopback());
-        assert_eq!(Ipv4Addr::unspecified(), Ipv4Addr::new(0, 0, 0, 0));
-        assert!(Ipv4Addr::unspecified().is_unspecified());
+        assert_eq!(Ipv4Addr::LOCALHOST, Ipv4Addr::new(127, 0, 0, 1));
+        assert!(Ipv4Addr::LOCALHOST.is_loopback());
+        assert_eq!(Ipv4Addr::UNSPECIFIED, Ipv4Addr::new(0, 0, 0, 0));
+        assert!(Ipv4Addr::UNSPECIFIED.is_unspecified());
+        assert_eq!(Ipv4Addr::BROADCAST, Ipv4Addr::new(255, 255, 255, 255));
+        assert!(Ipv4Addr::BROADCAST.is_broadcast());
     }
 
     #[test]
     fn ipv6_from_contructors() {
-        assert_eq!(Ipv6Addr::localhost(), Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
-        assert!(Ipv6Addr::localhost().is_loopback());
-        assert_eq!(Ipv6Addr::unspecified(), Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0));
-        assert!(Ipv6Addr::unspecified().is_unspecified());
+        assert_eq!(Ipv6Addr::LOCALHOST, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
+        assert!(Ipv6Addr::LOCALHOST.is_loopback());
+        assert_eq!(Ipv6Addr::UNSPECIFIED, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0));
+        assert!(Ipv6Addr::UNSPECIFIED.is_unspecified());
     }
 
     #[test]
index 3abc260b4586878b8d17b139e1a2e8387c2d20e1..f6cb8beae84158e6fe6715676c16d60d420b2794 100644 (file)
 // initialization closure panics, the Once enters a "poisoned" state which means
 // that all future calls will immediately panic as well.
 //
-// So to implement this, one might first reach for a `StaticMutex`, but those
-// unfortunately need to be deallocated (e.g. call `destroy()`) to free memory
-// on all OSes (some of the BSDs allocate memory for mutexes). It also gets a
-// lot harder with poisoning to figure out when the mutex needs to be
-// deallocated because it's not after the closure finishes, but after the first
-// successful closure finishes.
+// So to implement this, one might first reach for a `Mutex`, but those cannot
+// be put into a `static`. It also gets a lot harder with poisoning to figure
+// out when the mutex needs to be deallocated because it's not after the closure
+// finishes, but after the first successful closure finishes.
 //
 // All in all, this is instead implemented with atomics and lock-free
 // operations! Whee! Each `Once` has one word of atomic state, and this state is
index d443a4d68a170bf3ce90843441c08a56f0cc19fd..b6d9f4562953ad3192fd3a52ee16fb544751343c 100644 (file)
@@ -24,10 +24,10 @@ pub struct in_addr {
 }
 
 #[derive(Copy, Clone)]
+#[repr(align(4))]
 #[repr(C)]
 pub struct in6_addr {
     pub s6_addr: [u8; 16],
-    __align: [u32; 0],
 }
 
 #[derive(Copy, Clone)]
index 52cf3f97c5c83ba49e12fb37a746710d87840160..60b03cdbeb0e9923b8c6b640b386090d126f2dcf 100644 (file)
@@ -49,9 +49,6 @@ pub unsafe fn init(&mut self) {
         // references, we instead create the mutex with type
         // PTHREAD_MUTEX_NORMAL which is guaranteed to deadlock if we try to
         // re-lock it from the same thread, thus avoiding undefined behavior.
-        //
-        // We can't do anything for StaticMutex, but that type is deprecated
-        // anyways.
         let mut attr: libc::pthread_mutexattr_t = mem::uninitialized();
         let r = libc::pthread_mutexattr_init(&mut attr);
         debug_assert_eq!(r, 0);
index 8534969c623bc5c906c0c40625b6a7435b33d7c2..15abad555f4b65c05dde873d7458f0e072356635 100644 (file)
@@ -374,6 +374,20 @@ fn main() {}
 
 "##,
 
+E0705: r##"
+A `#![feature]` attribute was declared for a feature that is stable in
+the current edition.
+
+Erroneous code example:
+
+```ignore (limited to a warning during 2018 edition development)
+#![feature(rust_2018_preview)]
+#![feature(raw_identifiers)] // error: the feature `raw_identifiers` is
+                             // included in the Rust 2018 edition
+```
+
+"##,
+
 }
 
 register_diagnostics! {
index 8450daa3f7c943fc93dc1de90f9f97730c8aaa2a..de391ee4219a470b0a427abdf8aec917e4d435d7 100644 (file)
@@ -589,7 +589,7 @@ pub fn descr(self) -> &'static str {
 /// An enum representing the different kinds of syntax extensions.
 pub enum SyntaxExtension {
     /// A trivial "extension" that does nothing, only keeps the attribute and marks it as known.
-    NonMacroAttr,
+    NonMacroAttr { mark_used: bool },
 
     /// A syntax extension that is attached to an item and creates new items
     /// based upon it.
@@ -670,7 +670,7 @@ pub fn kind(&self) -> MacroKind {
             SyntaxExtension::IdentTT(..) |
             SyntaxExtension::ProcMacro { .. } =>
                 MacroKind::Bang,
-            SyntaxExtension::NonMacroAttr |
+            SyntaxExtension::NonMacroAttr { .. } |
             SyntaxExtension::MultiDecorator(..) |
             SyntaxExtension::MultiModifier(..) |
             SyntaxExtension::AttrProcMacro(..) =>
@@ -700,7 +700,7 @@ pub fn edition(&self) -> Edition {
             SyntaxExtension::AttrProcMacro(.., edition) |
             SyntaxExtension::ProcMacroDerive(.., edition) => edition,
             // Unstable legacy stuff
-            SyntaxExtension::NonMacroAttr |
+            SyntaxExtension::NonMacroAttr { .. } |
             SyntaxExtension::IdentTT(..) |
             SyntaxExtension::MultiDecorator(..) |
             SyntaxExtension::MultiModifier(..) |
@@ -726,7 +726,7 @@ fn visit_ast_fragment_with_placeholders(&mut self, mark: Mark, fragment: &AstFra
     fn find_legacy_attr_invoc(&mut self, attrs: &mut Vec<Attribute>, allow_derive: bool)
                               -> Option<Attribute>;
 
-    fn resolve_invoc(&mut self, invoc: &mut Invocation, scope: Mark, force: bool)
+    fn resolve_invoc(&mut self, invoc: &Invocation, scope: Mark, force: bool)
                      -> Result<Option<Lrc<SyntaxExtension>>, Determinacy>;
     fn resolve_macro(&mut self, scope: Mark, path: &ast::Path, kind: MacroKind, force: bool)
                      -> Result<Lrc<SyntaxExtension>, Determinacy>;
@@ -739,6 +739,12 @@ pub enum Determinacy {
     Undetermined,
 }
 
+impl Determinacy {
+    pub fn determined(determined: bool) -> Determinacy {
+        if determined { Determinacy::Determined } else { Determinacy::Undetermined }
+    }
+}
+
 pub struct DummyResolver;
 
 impl Resolver for DummyResolver {
@@ -754,7 +760,7 @@ fn add_builtin(&mut self, _ident: ast::Ident, _ext: Lrc<SyntaxExtension>) {}
     fn resolve_imports(&mut self) {}
     fn find_legacy_attr_invoc(&mut self, _attrs: &mut Vec<Attribute>, _allow_derive: bool)
                               -> Option<Attribute> { None }
-    fn resolve_invoc(&mut self, _invoc: &mut Invocation, _scope: Mark, _force: bool)
+    fn resolve_invoc(&mut self, _invoc: &Invocation, _scope: Mark, _force: bool)
                      -> Result<Option<Lrc<SyntaxExtension>>, Determinacy> {
         Err(Determinacy::Determined)
     }
index 8bd30e434767be5a3397e1cf8c78ffd9450e2a64..12941a85669876c456c6595f774a9a502615ad14 100644 (file)
@@ -244,19 +244,12 @@ pub fn span(&self) -> Span {
         }
     }
 
-    pub fn path_span(&self) -> Span {
+    pub fn path(&self) -> Option<&Path> {
         match self.kind {
-            InvocationKind::Bang { ref mac, .. } => mac.node.path.span,
-            InvocationKind::Attr { attr: Some(ref attr), .. } => attr.path.span,
-            InvocationKind::Attr { attr: None, .. } => DUMMY_SP,
-            InvocationKind::Derive { ref path, .. } => path.span,
-        }
-    }
-
-    pub fn attr_id(&self) -> Option<ast::AttrId> {
-        match self.kind {
-            InvocationKind::Attr { attr: Some(ref attr), .. } => Some(attr.id),
-            _ => None,
+            InvocationKind::Bang { ref mac, .. } => Some(&mac.node.path),
+            InvocationKind::Attr { attr: Some(ref attr), .. } => Some(&attr.path),
+            InvocationKind::Attr { attr: None, .. } => None,
+            InvocationKind::Derive { ref path, .. } => Some(path),
         }
     }
 }
@@ -338,7 +331,7 @@ fn expand_fragment(&mut self, input_fragment: AstFragment) -> AstFragment {
         let mut undetermined_invocations = Vec::new();
         let (mut progress, mut force) = (false, !self.monotonic);
         loop {
-            let mut invoc = if let Some(invoc) = invocations.pop() {
+            let invoc = if let Some(invoc) = invocations.pop() {
                 invoc
             } else {
                 self.resolve_imports();
@@ -350,20 +343,10 @@ fn expand_fragment(&mut self, input_fragment: AstFragment) -> AstFragment {
 
             let scope =
                 if self.monotonic { invoc.expansion_data.mark } else { orig_expansion_data.mark };
-            let attr_id_before = invoc.attr_id();
-            let ext = match self.cx.resolver.resolve_invoc(&mut invoc, scope, force) {
+            let ext = match self.cx.resolver.resolve_invoc(&invoc, scope, force) {
                 Ok(ext) => Some(ext),
                 Err(Determinacy::Determined) => None,
                 Err(Determinacy::Undetermined) => {
-                    // Sometimes attributes which we thought were invocations
-                    // end up being custom attributes for custom derives. If
-                    // that's the case our `invoc` will have changed out from
-                    // under us. If this is the case we're making progress so we
-                    // want to flag it as such, and we test this by looking if
-                    // the `attr_id()` method has been changing over time.
-                    if invoc.attr_id() != attr_id_before {
-                        progress = true;
-                    }
                     undetermined_invocations.push(invoc);
                     continue
                 }
@@ -533,6 +516,15 @@ fn fully_configure(&mut self, item: Annotatable) -> Annotatable {
     }
 
     fn expand_invoc(&mut self, invoc: Invocation, ext: &SyntaxExtension) -> Option<AstFragment> {
+        if invoc.fragment_kind == AstFragmentKind::ForeignItems &&
+           !self.cx.ecfg.macros_in_extern_enabled() {
+            if let SyntaxExtension::NonMacroAttr { .. } = *ext {} else {
+                emit_feature_err(&self.cx.parse_sess, "macros_in_extern",
+                                 invoc.span(), GateIssue::Language,
+                                 "macro invocations in `extern {}` blocks are experimental");
+            }
+        }
+
         let result = match invoc.kind {
             InvocationKind::Bang { .. } => self.expand_bang_invoc(invoc, ext)?,
             InvocationKind::Attr { .. } => self.expand_attr_invoc(invoc, ext)?,
@@ -565,7 +557,11 @@ fn expand_attr_invoc(&mut self,
             _ => unreachable!(),
         };
 
-        attr::mark_used(&attr);
+        if let NonMacroAttr { mark_used: false } = *ext {} else {
+            // Macro attrs are always used when expanded,
+            // non-macro attrs are considered used when the field says so.
+            attr::mark_used(&attr);
+        }
         invoc.expansion_data.mark.set_expn_info(ExpnInfo {
             call_site: attr.span,
             def_site: None,
@@ -577,7 +573,7 @@ fn expand_attr_invoc(&mut self,
         });
 
         match *ext {
-            NonMacroAttr => {
+            NonMacroAttr { .. } => {
                 attr::mark_known(&attr);
                 let item = item.map_attrs(|mut attrs| { attrs.push(attr); attrs });
                 Some(invoc.fragment_kind.expect_from_annotatables(iter::once(item)))
@@ -827,7 +823,7 @@ fn expand_bang_invoc(&mut self,
             }
 
             MultiDecorator(..) | MultiModifier(..) |
-            AttrProcMacro(..) | SyntaxExtension::NonMacroAttr => {
+            AttrProcMacro(..) | SyntaxExtension::NonMacroAttr { .. } => {
                 self.cx.span_err(path.span,
                                  &format!("`{}` can only be used in attributes", path));
                 self.cx.trace_macros_diag();
@@ -1497,20 +1493,7 @@ fn fold_foreign_item(&mut self,
                          foreign_item: ast::ForeignItem) -> SmallVector<ast::ForeignItem> {
         let (attr, traits, foreign_item) = self.classify_item(foreign_item);
 
-        let explain = if self.cx.ecfg.use_extern_macros_enabled() {
-            feature_gate::EXPLAIN_PROC_MACROS_IN_EXTERN
-        } else {
-            feature_gate::EXPLAIN_MACROS_IN_EXTERN
-        };
-
-        if attr.is_some() || !traits.is_empty()  {
-            if !self.cx.ecfg.macros_in_extern_enabled() {
-                if let Some(ref attr) = attr {
-                    emit_feature_err(&self.cx.parse_sess, "macros_in_extern", attr.span,
-                                     GateIssue::Language, explain);
-                }
-            }
-
+        if attr.is_some() || !traits.is_empty() {
             let item = Annotatable::ForeignItem(P(foreign_item));
             return self.collect_attr(attr, traits, item, AstFragmentKind::ForeignItems)
                 .make_foreign_items();
@@ -1518,12 +1501,6 @@ fn fold_foreign_item(&mut self,
 
         if let ast::ForeignItemKind::Macro(mac) = foreign_item.node {
             self.check_attributes(&foreign_item.attrs);
-
-            if !self.cx.ecfg.macros_in_extern_enabled() {
-                emit_feature_err(&self.cx.parse_sess, "macros_in_extern", foreign_item.span,
-                                 GateIssue::Language, explain);
-            }
-
             return self.collect_bang(mac, foreign_item.span, AstFragmentKind::ForeignItems)
                 .make_foreign_items();
         }
index c9ec2c7d1e86adeef111c98ea0a1112c5260d3cb..e7e94614ac8658e1683332953703486e2139e8e6 100644 (file)
@@ -174,7 +174,32 @@ fn generic_extension<'cx>(cx: &'cx mut ExtCtxt,
     }
 
     let best_fail_msg = parse_failure_msg(best_fail_tok.expect("ran no matchers"));
-    cx.span_err(best_fail_spot.substitute_dummy(sp), &best_fail_msg);
+    let mut err = cx.struct_span_err(best_fail_spot.substitute_dummy(sp), &best_fail_msg);
+
+    // Check whether there's a missing comma in this macro call, like `println!("{}" a);`
+    if let Some((arg, comma_span)) = arg.add_comma() {
+        for lhs in lhses { // try each arm's matchers
+            let lhs_tt = match *lhs {
+                quoted::TokenTree::Delimited(_, ref delim) => &delim.tts[..],
+                _ => cx.span_bug(sp, "malformed macro lhs")
+            };
+            match TokenTree::parse(cx, lhs_tt, arg.clone()) {
+                Success(_) => {
+                    if comma_span == DUMMY_SP {
+                        err.note("you might be missing a comma");
+                    } else {
+                        err.span_suggestion_short(
+                            comma_span,
+                            "missing comma here",
+                            ",".to_string(),
+                        );
+                    }
+                }
+                _ => {}
+            }
+        }
+    }
+    err.emit();
     cx.trace_macros_diag();
     DummyResult::any(sp)
 }
index 77e3faa5b1faca25b7d386c1e0f44eb394009626..65eeaff3f10783ec49bea70fb68f3866728063c0 100644 (file)
 use self::AttributeType::*;
 use self::AttributeGate::*;
 
+use rustc_data_structures::fx::FxHashMap;
 use rustc_target::spec::abi::Abi;
 use ast::{self, NodeId, PatKind, RangeEnd};
 use attr;
 use codemap::Spanned;
 use edition::{ALL_EDITIONS, Edition};
 use syntax_pos::{Span, DUMMY_SP};
-use errors::{DiagnosticBuilder, Handler, FatalError};
+use errors::{DiagnosticBuilder, Handler};
 use visit::{self, FnKind, Visitor};
 use parse::ParseSess;
 use symbol::{keywords, Symbol};
@@ -59,8 +60,8 @@ macro_rules! declare_features {
         /// A set of features to be used by later passes.
         #[derive(Clone)]
         pub struct Features {
-            /// `#![feature]` attrs for stable language features, for error reporting
-            pub declared_stable_lang_features: Vec<(Symbol, Span)>,
+            /// `#![feature]` attrs for language features, for error reporting
+            pub declared_lang_features: Vec<(Symbol, Span, Option<Symbol>)>,
             /// `#![feature]` attrs for non-language (library) features
             pub declared_lib_features: Vec<(Symbol, Span)>,
             $(pub $feature: bool),+
@@ -69,7 +70,7 @@ pub struct Features {
         impl Features {
             pub fn new() -> Features {
                 Features {
-                    declared_stable_lang_features: Vec::new(),
+                    declared_lang_features: Vec::new(),
                     declared_lib_features: Vec::new(),
                     $($feature: false),+
                 }
@@ -82,8 +83,14 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
             }
 
             pub fn use_extern_macros(&self) -> bool {
-                // The `decl_macro` and `tool_attributes` features imply `use_extern_macros`.
-                self.use_extern_macros || self.decl_macro || self.tool_attributes
+                // A number of "advanced" macro features enable
+                // macro modularization (`use_extern_macros`) implicitly.
+                self.use_extern_macros || self.decl_macro ||
+                self.tool_attributes || self.custom_attribute ||
+                self.macros_in_extern || self.proc_macro_path_invoc ||
+                self.proc_macro_mod || self.proc_macro_expr ||
+                self.proc_macro_non_items || self.proc_macro_gen ||
+                self.stmt_expr_attributes
             }
         }
     };
@@ -140,7 +147,6 @@ pub fn use_extern_macros(&self) -> bool {
     (active, linkage, "1.0.0", Some(29603), None),
     (active, quote, "1.0.0", Some(29601), None),
 
-
     // rustc internal
     (active, rustc_diagnostic_macros, "1.0.0", None, None),
     (active, rustc_const_unstable, "1.0.0", None, None),
@@ -216,6 +222,18 @@ pub fn use_extern_macros(&self) -> bool {
     // Allows let bindings and destructuring in `const fn` functions and constants.
     (active, const_let, "1.22.1", Some(48821), None),
 
+    // Allows accessing fields of unions inside const fn
+    (active, const_fn_union, "1.27.0", Some(51909), None),
+
+    // Allows casting raw pointers to `usize` during const eval
+    (active, const_raw_ptr_to_usize_cast, "1.27.0", Some(51910), None),
+
+    // Allows dereferencing raw pointers during const eval
+    (active, const_raw_ptr_deref, "1.27.0", Some(51911), None),
+
+    // Allows comparing raw pointers during const eval
+    (active, const_compare_raw_pointers, "1.27.0", Some(53020), None),
+
     // Allows using #[prelude_import] on glob `use` items.
     //
     // rustc internal
@@ -322,9 +340,8 @@ pub fn use_extern_macros(&self) -> bool {
     // `extern "x86-interrupt" fn()`
     (active, abi_x86_interrupt, "1.17.0", Some(40180), None),
 
-
     // Allows the `catch {...}` expression
-    (active, catch_expr, "1.17.0", Some(31436), Some(Edition::Edition2018)),
+    (active, catch_expr, "1.17.0", Some(31436), None),
 
     // Used to preserve symbols (see llvm.used)
     (active, used, "1.18.0", Some(40289), None),
@@ -381,7 +398,7 @@ pub fn use_extern_macros(&self) -> bool {
     (active, crate_in_paths, "1.23.0", Some(45477), Some(Edition::Edition2018)),
 
     // In-band lifetime bindings (e.g. `fn foo(x: &'a u8) -> &'a u8`)
-    (active, in_band_lifetimes, "1.23.0", Some(44524), Some(Edition::Edition2018)),
+    (active, in_band_lifetimes, "1.23.0", Some(44524), None),
 
     // generic associated types (RFC 1598)
     (active, generic_associated_types, "1.23.0", Some(44265), None),
@@ -482,6 +499,10 @@ pub fn use_extern_macros(&self) -> bool {
     (active, alloc_error_handler, "1.29.0", Some(51540), None),
 
     (active, abi_amdgpu_kernel, "1.29.0", Some(51575), None),
+
+    // impl<I:Iterator> Iterator for &mut Iterator
+    // impl Debug for Foo<'_>
+    (active, impl_header_lifetime_elision, "1.30.0", Some(15872), Some(Edition::Edition2018)),
 );
 
 declare_features! (
@@ -699,7 +720,7 @@ pub fn is_builtin_attr_name(name: ast::Name) -> bool {
 }
 
 pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
-    BUILTIN_ATTRIBUTES.iter().any(|&(builtin_name, _, _)| attr.check_name(builtin_name)) ||
+    BUILTIN_ATTRIBUTES.iter().any(|&(builtin_name, _, _)| attr.path == builtin_name) ||
     attr.name().as_str().starts_with("rustc_")
 }
 
@@ -1220,10 +1241,6 @@ pub fn check_attribute(attr: &ast::Attribute, parse_sess: &ParseSess, features:
     cx.check_attribute(attr, true);
 }
 
-pub fn find_lang_feature_accepted_version(feature: &str) -> Option<&'static str> {
-    ACCEPTED_FEATURES.iter().find(|t| t.0 == feature).map(|t| t.1)
-}
-
 fn find_lang_feature_issue(feature: &str) -> Option<u32> {
     if let Some(info) = ACTIVE_FEATURES.iter().find(|t| t.0 == feature) {
         let issue = info.2;
@@ -1353,13 +1370,6 @@ fn leveled_feature_err<'a>(sess: &'a ParseSess, feature: &str, span: Span, issue
 pub const EXPLAIN_MACRO_AT_MOST_ONCE_REP: &'static str =
     "using the `?` macro Kleene operator for \"at most one\" repetition is unstable";
 
-pub const EXPLAIN_MACROS_IN_EXTERN: &'static str =
-    "macro invocations in `extern {}` blocks are experimental.";
-
-// mention proc-macros when enabled
-pub const EXPLAIN_PROC_MACROS_IN_EXTERN: &'static str =
-    "macro and proc-macro invocations in `extern {}` blocks are experimental.";
-
 struct PostExpansionVisitor<'a> {
     context: &'a Context<'a>,
 }
@@ -1903,13 +1913,13 @@ fn feature_removed(span_handler: &Handler, span: Span, reason: Option<&str>) {
     }
 
     let mut features = Features::new();
+    let mut edition_enabled_features = FxHashMap();
 
-    let mut feature_checker = FeatureChecker::default();
-
-    for &(.., f_edition, set) in ACTIVE_FEATURES.iter() {
+    for &(name, .., f_edition, set) in ACTIVE_FEATURES.iter() {
         if let Some(f_edition) = f_edition {
             if f_edition <= crate_edition {
                 set(&mut features, DUMMY_SP);
+                edition_enabled_features.insert(Symbol::intern(name), crate_edition);
             }
         }
     }
@@ -1937,35 +1947,18 @@ fn feature_removed(span_handler: &Handler, span: Span, reason: Option<&str>) {
                 continue
             };
 
-            if let Some((.., set)) = ACTIVE_FEATURES.iter().find(|f| name == f.0) {
-                set(&mut features, mi.span);
-                feature_checker.collect(&features, mi.span);
-                continue
-            }
-
-            let removed = REMOVED_FEATURES.iter().find(|f| name == f.0);
-            let stable_removed = STABLE_REMOVED_FEATURES.iter().find(|f| name == f.0);
-            if let Some((.., reason)) = removed.or(stable_removed) {
-                feature_removed(span_handler, mi.span, *reason);
-                continue
-            }
-
-            if ACCEPTED_FEATURES.iter().any(|f| name == f.0) {
-                features.declared_stable_lang_features.push((name, mi.span));
-                continue
-            }
-
             if let Some(edition) = ALL_EDITIONS.iter().find(|e| name == e.feature_name()) {
                 if *edition <= crate_edition {
                     continue
                 }
 
-                for &(.., f_edition, set) in ACTIVE_FEATURES.iter() {
+                for &(name, .., f_edition, set) in ACTIVE_FEATURES.iter() {
                     if let Some(f_edition) = f_edition {
-                        if *edition >= f_edition {
+                        if f_edition <= *edition {
                             // FIXME(Manishearth) there is currently no way to set
                             // lib features by edition
                             set(&mut features, DUMMY_SP);
+                            edition_enabled_features.insert(Symbol::intern(name), *edition);
                         }
                     }
                 }
@@ -1973,47 +1966,41 @@ fn feature_removed(span_handler: &Handler, span: Span, reason: Option<&str>) {
                 continue
             }
 
-            features.declared_lib_features.push((name, mi.span));
-        }
-    }
-
-    feature_checker.check(span_handler);
-
-    features
-}
+            if let Some((.., set)) = ACTIVE_FEATURES.iter().find(|f| name == f.0) {
+                if let Some(edition) = edition_enabled_features.get(&name) {
+                    struct_span_warn!(
+                        span_handler,
+                        mi.span,
+                        E0705,
+                        "the feature `{}` is included in the Rust {} edition",
+                        name,
+                        edition,
+                    ).emit();
+                } else {
+                    set(&mut features, mi.span);
+                    features.declared_lang_features.push((name, mi.span, None));
+                }
+                continue
+            }
 
-/// A collector for mutually exclusive and interdependent features and their flag spans.
-#[derive(Default)]
-struct FeatureChecker {
-    use_extern_macros: Option<Span>,
-    custom_attribute: Option<Span>,
-}
+            let removed = REMOVED_FEATURES.iter().find(|f| name == f.0);
+            let stable_removed = STABLE_REMOVED_FEATURES.iter().find(|f| name == f.0);
+            if let Some((.., reason)) = removed.or(stable_removed) {
+                feature_removed(span_handler, mi.span, *reason);
+                continue
+            }
 
-impl FeatureChecker {
-    // If this method turns out to be a hotspot due to branching,
-    // the branching can be eliminated by modifying `set!()` to set these spans
-    // only for the features that need to be checked for mutual exclusion.
-    fn collect(&mut self, features: &Features, span: Span) {
-        if features.use_extern_macros() {
-            // If self.use_extern_macros is None, set to Some(span)
-            self.use_extern_macros = self.use_extern_macros.or(Some(span));
-        }
+            if let Some((_, since, ..)) = ACCEPTED_FEATURES.iter().find(|f| name == f.0) {
+                let since = Some(Symbol::intern(since));
+                features.declared_lang_features.push((name, mi.span, since));
+                continue
+            }
 
-        if features.custom_attribute {
-            self.custom_attribute = self.custom_attribute.or(Some(span));
+            features.declared_lib_features.push((name, mi.span));
         }
     }
 
-    fn check(self, handler: &Handler) {
-        if let (Some(pm_span), Some(ca_span)) = (self.use_extern_macros, self.custom_attribute) {
-            handler.struct_span_err(pm_span, "Cannot use `#![feature(use_extern_macros)]` and \
-                                              `#![feature(custom_attribute)] at the same time")
-                .span_note(ca_span, "`#![feature(custom_attribute)]` declared here")
-                .emit();
-
-            FatalError.raise();
-        }
-    }
+    features
 }
 
 pub fn check_crate(krate: &ast::Crate,
index 0c105865e0c2e13e3c916d8c1a7f0b9af7d55d8f..c8e60620248b3c9205304b630171dc70720d2d69 100644 (file)
@@ -19,7 +19,6 @@
        html_root_url = "https://doc.rust-lang.org/nightly/",
        test(attr(deny(warnings))))]
 
-#![feature(const_atomic_usize_new)]
 #![feature(crate_visibility_modifier)]
 #![feature(macro_at_most_once_rep)]
 #![feature(rustc_attrs)]
index c449cc0a6525a9bdcb41136908f536706311a421..1d0c6b5317a38d3484de1adbfd1ed0ef95eb9f5a 100644 (file)
@@ -302,6 +302,10 @@ pub fn from_ast_ident(ident: ast::Ident) -> Token {
             BinOp(Minus) => true,
             Ident(ident, false) if ident.name == keywords::True.name() => true,
             Ident(ident, false) if ident.name == keywords::False.name() => true,
+            Interpolated(ref nt) => match nt.0 {
+                NtLiteral(..) => true,
+                _             => false,
+            },
             _            => false,
         }
     }
index d8b8d13a38c2ea3fb28f4914296f774152eeb951..62dd00387d3abbef747cef214d35793e5b1a52f4 100644 (file)
@@ -631,7 +631,7 @@ fn path_name_i(idents: &[Ident]) -> String {
     let mut idents_iter = idents.iter().peekable();
     while let Some(ident) = idents_iter.next() {
         path_name.push_str(&ident.as_str());
-        if let Some(_) = idents_iter.peek() {
+        if idents_iter.peek().is_some() {
             path_name.push_str("::")
         }
     }
index 1a4236b280b45b6ddf1da0309217d06834ee31ab..f84b5307a1137895e4240590621d723789cc1267 100644 (file)
@@ -182,6 +182,31 @@ pub struct TokenStream {
     kind: TokenStreamKind,
 }
 
+impl TokenStream {
+    /// Given a `TokenStream` with a `Stream` of only two arguments, return a new `TokenStream`
+    /// separating the two arguments with a comma for diagnostic suggestions.
+    pub(crate) fn add_comma(&self) -> Option<(TokenStream, Span)> {
+        // Used to suggest if a user writes `println!("{}" a);`
+        if let TokenStreamKind::Stream(ref slice) = self.kind {
+            if slice.len() == 2 {
+                let comma_span = match slice[0] {
+                    TokenStream { kind: TokenStreamKind::Tree(TokenTree::Token(sp, _)) } |
+                    TokenStream { kind: TokenStreamKind::Tree(TokenTree::Delimited(sp, _)) } => {
+                        sp.shrink_to_hi()
+                    }
+                    _ => DUMMY_SP,
+                };
+                let comma = TokenStream {
+                    kind: TokenStreamKind::Tree(TokenTree::Token(comma_span, token::Comma)),
+                };
+                let slice = RcSlice::new(vec![slice[0].clone(), comma, slice[1].clone()]);
+                return Some((TokenStream { kind: TokenStreamKind::Stream(slice) }, comma_span));
+            }
+        }
+        None
+    }
+}
+
 #[derive(Clone, Debug)]
 enum TokenStreamKind {
     Empty,
index 3c34bf496da594a460022f81773d3291755299fe..8f26b2402aadfce024d8e2067767414d47a5dbd7 100644 (file)
@@ -81,7 +81,7 @@ pub fn expand_env<'cx>(cx: &'cx mut ExtCtxt,
         }
     };
 
-    if let Some(_) = exprs.next() {
+    if exprs.next().is_some() {
         cx.span_err(sp, "env! takes 1 or 2 arguments");
         return DummyResult::expr(sp);
     }
index 46c85497ee78ff4cb3795bfe22550ad1ffe4cb43..53f8fe2b0c2230c942b8fbe8b9599edb1f5f8f0f 100644 (file)
@@ -147,7 +147,7 @@ fn parse_args(ecx: &mut ExtCtxt,
     let mut named = false;
     while p.token != token::Eof {
         if !p.eat(&token::Comma) {
-            ecx.span_err(sp, "expected token: `,`");
+            ecx.span_err(p.span, "expected token: `,`");
             return None;
         }
         if p.token == token::Eof {
index e77897d6433136603451492472ebd6834a1fd561..ee037ac68c59bd6083ff78a0d848d3f8f2774779 100644 (file)
@@ -36,4 +36,5 @@ compiler_builtins = { path = "../compiler_builtins_shim" }
 # Certain parts of libc are conditionally compiled differently than when used
 # outside rustc. See https://github.com/rust-lang/libc/search?l=Rust&q=stdbuild&type=&utf8=%E2%9C%93.
 stdbuild = []
-default = ["stdbuild"]
+default = ["stdbuild", "align"]
+align = []
index 4bcb4fd7ad385a4ec1c0db8593a65cb578d248e6..9b9c908ea52721ff3f5e4121e322541cbfd5fdab 100644 (file)
@@ -12,6 +12,7 @@
 #include "llvm/IR/DebugInfoMetadata.h"
 #include "llvm/IR/DiagnosticInfo.h"
 #include "llvm/IR/DiagnosticPrinter.h"
+#include "llvm/IR/GlobalVariable.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/Object/Archive.h"
 #include "llvm/Object/ObjectFile.h"
@@ -116,6 +117,15 @@ LLVMRustGetOrInsertGlobal(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty) {
   return wrap(unwrap(M)->getOrInsertGlobal(Name, unwrap(Ty)));
 }
 
+extern "C" LLVMValueRef
+LLVMRustInsertPrivateGlobal(LLVMModuleRef M, LLVMTypeRef Ty) {
+  return wrap(new GlobalVariable(*unwrap(M),
+                                 unwrap(Ty),
+                                 false,
+                                 GlobalValue::PrivateLinkage,
+                                 nullptr));
+}
+
 extern "C" LLVMTypeRef LLVMRustMetadataTypeInContext(LLVMContextRef C) {
   return wrap(Type::getMetadataTy(*unwrap(C)));
 }
index 30fffbb769b30dc2aa0484021446a1f4891cb585..301f5544486270b68cfa652b3e36c5e46be9dc73 100644 (file)
 // CHECK: @STATIC = {{.*}}, align 4
 
 // This checks the constants from inline_enum_const
-// CHECK: @byte_str.{{[0-9]+}} = {{.*}}, align 2
+// CHECK: @{{[0-9]+}} = {{.*}}, align 2
 
 // This checks the constants from {low,high}_align_const, they share the same
 // constant, but the alignment differs, so the higher one should be used
-// CHECK: [[LOW_HIGH:@byte_str.[0-9]+]] = {{.*}}, align 4
+// CHECK: [[LOW_HIGH:@[0-9]+]] = {{.*}}, align 4
 
 #[derive(Copy, Clone)]
 
index 4fb8c37558d48bbaa7ce1333709cbddf024bf8fa..dd0f89c931d8aa13d64374490584e4848875d1ac 100644 (file)
@@ -22,7 +22,7 @@
 include!("aux_mod.rs");
 
 // Here we check that the expansion of the file!() macro is mapped.
-// CHECK: @byte_str.1 = private unnamed_addr constant <{ [34 x i8] }> <{ [34 x i8] c"/the/src/remap_path_prefix/main.rs" }>, align 1
+// CHECK: @0 = private unnamed_addr constant <{ [34 x i8] }> <{ [34 x i8] c"/the/src/remap_path_prefix/main.rs" }>, align 1
 pub static FILE_PATH: &'static str = file!();
 
 fn main() {
index dfbe35dfd56ba2e68a01fc90ea5b41c7b1858355..eedc1e745e270c15d883ce060277aac5f767e734 100644 (file)
 
 #![feature(staged_api)]
 
-#![stable(feature = "unit_test", since = "0.0.0")]
+#![stable(feature = "unit_test", since = "1.0.0")]
 
-#[stable(feature = "unit_test", since = "0.0.0")]
+#[stable(feature = "unit_test", since = "1.0.0")]
 pub use m::{Record, Trait, Tuple};
 
 mod m {
     #[derive(Default)]
-    #[stable(feature = "unit_test", since = "0.0.0")]
+    #[stable(feature = "unit_test", since = "1.0.0")]
     pub struct Record {
-        #[stable(feature = "unit_test", since = "0.0.0")]
+        #[stable(feature = "unit_test", since = "1.0.0")]
         pub a_stable_pub: i32,
         #[unstable(feature = "unstable_declared", issue = "38412")]
         pub a_unstable_declared_pub: i32,
@@ -55,14 +55,14 @@ pub struct Record {
         pub(crate) b_crate: i32,
         #[unstable(feature = "unstable_declared", issue = "38412")] // SILLY
         pub(in m) c_mod: i32,
-        #[stable(feature = "unit_test", since = "0.0.0")] // SILLY
+        #[stable(feature = "unit_test", since = "1.0.0")] // SILLY
         d_priv: i32
     }
 
     #[derive(Default)]
     #[stable(feature = "unit_test", since = "1.0.0")]
     pub struct Tuple(
-        #[stable(feature = "unit_test", since = "0.0.0")]
+        #[stable(feature = "unit_test", since = "1.0.0")]
         pub i32,
         #[unstable(feature = "unstable_declared", issue = "38412")]
         pub i32,
@@ -84,11 +84,11 @@ pub fn new() -> Self { Default::default() }
     }
 
 
-    #[stable(feature = "unit_test", since = "0.0.0")]
+    #[stable(feature = "unit_test", since = "1.0.0")]
     pub trait Trait {
-        #[stable(feature = "unit_test", since = "0.0.0")]
+        #[stable(feature = "unit_test", since = "1.0.0")]
         type Type;
-        #[stable(feature = "unit_test", since = "0.0.0")]
+        #[stable(feature = "unit_test", since = "1.0.0")]
         fn stable_trait_method(&self) -> Self::Type;
         #[unstable(feature = "unstable_undeclared", issue = "38412")]
         fn unstable_undeclared_trait_method(&self) -> Self::Type;
@@ -96,7 +96,7 @@ pub trait Trait {
         fn unstable_declared_trait_method(&self) -> Self::Type;
     }
 
-    #[stable(feature = "unit_test", since = "0.0.0")]
+    #[stable(feature = "unit_test", since = "1.0.0")]
     impl Trait for Record {
         type Type = i32;
         fn stable_trait_method(&self) -> i32 { self.d_priv }
@@ -104,7 +104,7 @@ fn unstable_undeclared_trait_method(&self) -> i32 { self.d_priv }
         fn unstable_declared_trait_method(&self) -> i32 { self.d_priv }
     }
 
-    #[stable(feature = "unit_test", since = "0.0.0")]
+    #[stable(feature = "unit_test", since = "1.0.0")]
     impl Trait for Tuple {
         type Type = i32;
         fn stable_trait_method(&self) -> i32 { self.3 }
@@ -117,14 +117,14 @@ impl Record {
         pub fn unstable_undeclared(&self) -> i32 { self.d_priv }
         #[unstable(feature = "unstable_declared", issue = "38412")]
         pub fn unstable_declared(&self) -> i32 { self.d_priv }
-        #[stable(feature = "unit_test", since = "0.0.0")]
+        #[stable(feature = "unit_test", since = "1.0.0")]
         pub fn stable(&self) -> i32 { self.d_priv }
 
         #[unstable(feature = "unstable_undeclared", issue = "38412")] // SILLY
         pub(crate) fn pub_crate(&self) -> i32 { self.d_priv }
         #[unstable(feature = "unstable_declared", issue = "38412")] // SILLY
         pub(in m) fn pub_mod(&self) -> i32 { self.d_priv }
-        #[stable(feature = "unit_test", since = "0.0.0")] // SILLY
+        #[stable(feature = "unit_test", since = "1.0.0")] // SILLY
         fn private(&self) -> i32 { self.d_priv }
     }
 
@@ -133,7 +133,7 @@ impl Tuple {
         pub fn unstable_undeclared(&self) -> i32 { self.0 }
         #[unstable(feature = "unstable_declared", issue = "38412")]
         pub fn unstable_declared(&self) -> i32 { self.0 }
-        #[stable(feature = "unit_test", since = "0.0.0")]
+        #[stable(feature = "unit_test", since = "1.0.0")]
         pub fn stable(&self) -> i32 { self.0 }
 
         pub(crate) fn pub_crate(&self) -> i32 { self.0 }
index 64af21dbe10dcc8f286716578b9010022ad49b3b..91b72510e3e540fb63738ee2b8e9c3325d0ecf98 100644 (file)
@@ -13,7 +13,7 @@
 
 //! Attributes producing expressions in invalid locations
 
-#![feature(use_extern_macros, stmt_expr_attributes, proc_macro_expr)]
+#![feature(stmt_expr_attributes, proc_macro_expr)]
 
 extern crate attr_stmt_expr;
 use attr_stmt_expr::{duplicate, no_output};
index 05b5c918ef0156ae86195c3b1c9caabeeb312aa3..52b2a473ecd75c277d18b5ce64c790e55056894f 100644 (file)
@@ -11,7 +11,7 @@
 // aux-build:attr-stmt-expr.rs
 // ignore-stage1
 
-#![feature(use_extern_macros, proc_macro_expr)]
+#![feature(proc_macro_expr)]
 
 extern crate attr_stmt_expr;
 use attr_stmt_expr::{expect_let, expect_print_stmt, expect_expr, expect_print_expr};
index 8fced7d8c70da134a6a9d9988ec86be2e83cc477..f71d4b86f1e0147f40878fce5c509e519abdf654 100644 (file)
@@ -15,7 +15,7 @@
 
 #![feature(use_extern_macros)]
 #![emit_unchanged]
-//~^ ERROR: cannot find attribute macro `emit_unchanged` in this scope
+//~^ ERROR attribute `emit_unchanged` is currently unknown to the compiler
 extern crate issue_41211;
 use issue_41211::emit_unchanged;
 
index 51112f202c8970fee02c728b89247125456983a4..eaa64c6ba3692a2cc4d71351a764c096e75fd5e4 100644 (file)
@@ -11,8 +11,6 @@
 // aux-build:issue_50493.rs
 // ignore-stage1
 
-#![feature(proc_macro)]
-
 #[macro_use]
 extern crate issue_50493;
 
index 6473b69b4591d3169163caed83305dbe33d85dfd..6e9d231ea99a4513468f702429d22510eac99489 100644 (file)
@@ -11,7 +11,7 @@
 // aux-build:bang_proc_macro2.rs
 // ignore-stage1
 
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
 #![allow(unused_macros)]
 
 extern crate bang_proc_macro2;
index 9a35dc0edc4484b66d4bfb3550539b4476f0660c..e418ecc114cc1112a16e7494773a9fce987df938 100644 (file)
@@ -26,13 +26,13 @@ fn main() {
 #[link(name = "rust_test_helpers", kind = "static")]
 extern {
     #[no_output]
-    //~^ ERROR macro and proc-macro invocations in `extern {}` blocks are experimental.
+    //~^ ERROR macro invocations in `extern {}` blocks are experimental
     fn some_definitely_unknown_symbol_which_should_be_removed();
 
     #[nop_attr]
-    //~^ ERROR macro and proc-macro invocations in `extern {}` blocks are experimental.
+    //~^ ERROR macro invocations in `extern {}` blocks are experimental
     fn rust_get_test_int() -> isize;
 
     emit_input!(fn rust_dbg_extern_identity_u32(arg: u32) -> u32;);
-    //~^ ERROR macro and proc-macro invocations in `extern {}` blocks are experimental.
+    //~^ ERROR macro invocations in `extern {}` blocks are experimental
 }
diff --git a/src/test/compile-fail-fulldeps/proc-macro/proc-macro-custom-attr-mutex.rs b/src/test/compile-fail-fulldeps/proc-macro/proc-macro-custom-attr-mutex.rs
deleted file mode 100644 (file)
index 9ed665b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2016 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.
-
-// aux-build:attr_proc_macro.rs
-// ignore-tidy-linelength
-
-#![feature(use_extern_macros, custom_attribute)]
-//~^ ERROR Cannot use `#![feature(use_extern_macros)]` and `#![feature(custom_attribute)] at the same time
-
-extern crate attr_proc_macro;
-use attr_proc_macro::attr_proc_macro;
-
-#[attr_proc_macro]
-fn foo() {}
-
-fn main() {
-    foo();
-}
index 51b1bfca294e48c05678628c10354ea30e96335c..9a0171c2ae5ea205296d129bfae6d8c965c104fc 100644 (file)
@@ -16,7 +16,7 @@
 // gate-test-proc_macro_mod
 // gate-test-proc_macro_gen
 
-#![feature(use_extern_macros, stmt_expr_attributes)]
+#![feature(stmt_expr_attributes)]
 
 extern crate proc_macro_gates as foo;
 
index ef6d4557f4cd746f7b59c6e107739929469fd91f..dc182414a1ddcc196a6500d5d299f193c5d8c760 100644 (file)
@@ -10,7 +10,7 @@
 
 // aux-build:proc-macro-gates.rs
 
-#![feature(use_extern_macros, stmt_expr_attributes)]
+#![feature(stmt_expr_attributes)]
 
 extern crate proc_macro_gates as foo;
 
index 0b1aee68f44927b2ec1a9625b0b3f2d5a8ce1ef8..f690cbd029d5fc59ff81f2a484111a1e5ca9b471 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 #![crate_name="inherited_stability"]
 #![crate_type = "lib"]
-#![unstable(feature = "test_feature", issue = "0")]
+#![unstable(feature = "unstable_test_feature", issue = "0")]
 #![feature(staged_api)]
 
 pub fn unstable() {}
@@ -19,16 +19,16 @@ pub fn stable() {}
 
 #[stable(feature = "rust1", since = "1.0.0")]
 pub mod stable_mod {
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub fn unstable() {}
 
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn stable() {}
 }
 
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub mod unstable_mod {
-    #[stable(feature = "test_feature", since = "1.0.0")]
+    #[stable(feature = "stable_test_feature", since = "1.0.0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub fn deprecated() {}
 
@@ -37,7 +37,7 @@ pub fn unstable() {}
 
 #[stable(feature = "rust1", since = "1.0.0")]
 pub trait Stable {
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     fn unstable(&self);
 
     #[stable(feature = "rust1", since = "1.0.0")]
index 0553b4a49b7aed9fc08ea927a9ea56fd6e041426..6ba66f3e45fece9f5e7e0eec334526d6ac6278fe 100644 (file)
 #![crate_name="lint_output_format"]
 #![crate_type = "lib"]
 #![feature(staged_api)]
-#![unstable(feature = "test_feature", issue = "0")]
+#![unstable(feature = "unstable_test_feature", issue = "0")]
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub fn foo() -> usize {
     20
 }
 
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub fn bar() -> usize {
     40
 }
 
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub fn baz() -> usize {
     30
 }
index 07e80b61cd0a69cc764a016b88c15c940a9efe3d..5547458abbef8e1a8fd281adc66f9751af639e02 100644 (file)
 #![feature(associated_type_defaults)]
 #![stable(feature = "lint_stability", since = "1.0.0")]
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub fn deprecated() {}
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub fn deprecated_text() {}
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 #[rustc_deprecated(since = "99.99.99", reason = "text")]
 pub fn deprecated_future() {}
 
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub fn deprecated_unstable() {}
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub fn deprecated_unstable_text() {}
 
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub fn unstable() {}
-#[unstable(feature = "test_feature", reason = "text", issue = "0")]
+#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
 pub fn unstable_text() {}
 
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -46,23 +46,23 @@ pub fn stable_text() {}
 pub struct MethodTester;
 
 impl MethodTester {
-    #[stable(feature = "test_feature", since = "1.0.0")]
+    #[stable(feature = "stable_test_feature", since = "1.0.0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub fn method_deprecated(&self) {}
-    #[stable(feature = "test_feature", since = "1.0.0")]
+    #[stable(feature = "stable_test_feature", since = "1.0.0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub fn method_deprecated_text(&self) {}
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub fn method_deprecated_unstable(&self) {}
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub fn method_deprecated_unstable_text(&self) {}
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub fn method_unstable(&self) {}
-    #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
     pub fn method_unstable_text(&self) {}
 
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -71,25 +71,25 @@ pub fn method_stable(&self) {}
     pub fn method_stable_text(&self) {}
 }
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 pub trait Trait {
-    #[stable(feature = "test_feature", since = "1.0.0")]
+    #[stable(feature = "stable_test_feature", since = "1.0.0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     fn trait_deprecated(&self) {}
-    #[stable(feature = "test_feature", since = "1.0.0")]
+    #[stable(feature = "stable_test_feature", since = "1.0.0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     fn trait_deprecated_text(&self) {}
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     fn trait_deprecated_unstable(&self) {}
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     fn trait_deprecated_unstable_text(&self) {}
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     fn trait_unstable(&self) {}
-    #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
     fn trait_unstable_text(&self) {}
 
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -98,100 +98,100 @@ fn trait_stable(&self) {}
     fn trait_stable_text(&self) {}
 }
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 pub trait TraitWithAssociatedTypes {
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     type TypeUnstable = u8;
-    #[stable(feature = "test_feature", since = "1.0.0")]
+    #[stable(feature = "stable_test_feature", since = "1.0.0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     type TypeDeprecated = u8;
 }
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 impl Trait for MethodTester {}
 
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub trait UnstableTrait { fn dummy(&self) { } }
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub trait DeprecatedTrait {
-    #[stable(feature = "test_feature", since = "1.0.0")] fn dummy(&self) { }
+    #[stable(feature = "stable_test_feature", since = "1.0.0")] fn dummy(&self) { }
 }
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub struct DeprecatedStruct {
-    #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
+    #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
 }
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub struct DeprecatedUnstableStruct {
-    #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
+    #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
 }
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub struct UnstableStruct {
-    #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
+    #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
 }
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct StableStruct {
-    #[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
+    #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
 }
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub enum UnstableEnum {}
 #[stable(feature = "rust1", since = "1.0.0")]
 pub enum StableEnum {}
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub struct DeprecatedUnitStruct;
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub struct DeprecatedUnstableUnitStruct;
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub struct UnstableUnitStruct;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct StableUnitStruct;
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 pub enum Enum {
-    #[stable(feature = "test_feature", since = "1.0.0")]
+    #[stable(feature = "stable_test_feature", since = "1.0.0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     DeprecatedVariant,
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     DeprecatedUnstableVariant,
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     UnstableVariant,
 
     #[stable(feature = "rust1", since = "1.0.0")]
     StableVariant,
 }
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 #[macro_export]
 macro_rules! macro_test {
     () => (deprecated());
 }
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 #[macro_export]
 macro_rules! macro_test_arg {
     ($func:expr) => ($func);
 }
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 #[macro_export]
 macro_rules! macro_test_arg_nested {
     ($func:ident) => (macro_test_arg!($func()));
index 8c6b98ab5104195e027c2bfa49803fce7293722f..6b79c36fc0587ea9c663edcf0a458eef5e47e314 100644 (file)
 pub struct Stable {
     #[stable(feature = "rust1", since = "1.0.0")]
     pub inherit: u8, // it's a lie (stable doesn't inherit)
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub override1: u8,
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub override2: u8,
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct Stable2(#[stable(feature = "rust1", since = "1.0.0")] pub u8,
-                   #[unstable(feature = "test_feature", issue = "0")] pub u8,
-                   #[unstable(feature = "test_feature", issue = "0")]
+                   #[unstable(feature = "unstable_test_feature", issue = "0")] pub u8,
+                   #[unstable(feature = "unstable_test_feature", issue = "0")]
                    #[rustc_deprecated(since = "1.0.0", reason = "text")] pub u8);
 
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub struct Unstable {
     pub inherit: u8,
     #[stable(feature = "rust1", since = "1.0.0")]
     pub override1: u8,
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub override2: u8,
 }
 
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub struct Unstable2(pub u8,
                      #[stable(feature = "rust1", since = "1.0.0")] pub u8,
-                     #[unstable(feature = "test_feature", issue = "0")]
+                     #[unstable(feature = "unstable_test_feature", issue = "0")]
                      #[rustc_deprecated(since = "1.0.0", reason = "text")] pub u8);
 
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub struct Deprecated {
     pub inherit: u8,
     #[stable(feature = "rust1", since = "1.0.0")]
     pub override1: u8,
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub override2: u8,
 }
 
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub struct Deprecated2(pub u8,
                        #[stable(feature = "rust1", since = "1.0.0")] pub u8,
-                       #[unstable(feature = "test_feature", issue = "0")] pub u8);
+                       #[unstable(feature = "unstable_test_feature", issue = "0")] pub u8);
index 22c13f69af96db0f3ff30c13b2c55ec4508c324f..1ee623c34fb48d9cd6333de6074da3e33b45b38e 100644 (file)
@@ -9,11 +9,11 @@
 // except according to those terms.
 
 #![feature(staged_api)]
-#![stable(feature = "foo", since = "1.2.0")]
+#![stable(feature = "stable_test_feature", since = "1.2.0")]
 
 
-#[unstable(feature = "foo", issue = "1")]
+#[unstable(feature = "unstable_test_feature", issue = "1")]
 pub fn unstable() {}
 
-#[unstable(feature = "foo", reason = "message", issue = "2")]
+#[unstable(feature = "unstable_test_feature", reason = "message", issue = "2")]
 pub fn unstable_msg() {}
index c1e2b1d1bfe12af2a81e560bd788a96256cec919..a59f4b4e8f44b9760b72452564435acd3a4f6f6b 100644 (file)
@@ -10,6 +10,6 @@
 
 // compile-flags:--cfg foo
 
-#![cfg_attr(foo, unstable(feature = "test_feature", issue = "0"))]
+#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "0"))]
 #![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))]
 #![feature(staged_api)]
index 6462c11af481fe659b6b4e93059a56706fb7e156..836164a721a4603a1015adf2616a51ee710976b8 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 #![feature(staged_api)]
-#![stable(feature = "unit_test", since = "0.0.0")]
+#![stable(feature = "unit_test", since = "1.0.0")]
 
 #[unstable(feature = "unstable_macros", issue = "0")]
 #[macro_export]
index 7c32e31d23b24f4a92a6d262eeaae2bcb0f66b38..8764cb72b8cc1ad48f545ab442939a8e00e0f5a4 100644 (file)
@@ -8,8 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// gate-test-const_raw_ptr_to_usize_cast
+
 fn main() {
-    const X: u32 = main as u32; //~ ERROR E0018
+    const X: u32 = main as u32; //~ ERROR casting pointers to integers in constants is unstable
     const Y: u32 = 0;
-    const Z: u32 = &Y as *const u32 as u32; //~ ERROR E0018
+    const Z: u32 = &Y as *const u32 as u32; //~ ERROR is unstable
 }
index 8170c9fd8f161db0ebf4bceafd079d94576c804c..5c6facbf01436ad6abf05e175638236c49a83ace 100644 (file)
@@ -12,7 +12,7 @@
 
 #![feature(staged_api)]
 
-#![stable(feature = "test_feature", since = "1.0.0")]
+#![stable(feature = "stable_test_feature", since = "1.0.0")]
 
 #[deprecated]
 fn main() { } //~ERROR `#[deprecated]` cannot be used in staged api
index bc9e2345f0ebb57a098ea525585f98da4d8ecd1b..b10a0a60f1471598562f94b9b4a1e9a53aec50b6 100644 (file)
@@ -12,7 +12,7 @@
 
 // aux-build:stability_cfg2.rs
 
-#![feature(test_feature)]
+#![feature(unstable_test_feature)]
 #![deny(non_snake_case)] // To trigger a hard error
 
 // Shouldn't generate a warning about unstable features
index 057c99f930510aa9a6add482b10a499f1b550991..0f6b9d1b5dc4fc5a6c6a893b440090b02b267f57 100644 (file)
@@ -16,7 +16,8 @@
 
 extern crate lint_stability;
 
-use lint_stability::{unstable, deprecated}; //~ ERROR use of unstable library feature 'test_feature'
+use lint_stability::{unstable, deprecated};
+//~^ ERROR use of unstable library feature 'unstable_test_feature'
 
 fn main() {
 }
index 12357779b5171e3b7ae5e5a144f0621edf43dcdf..12e3457ef9e34c0b5817a34a7ee98dccd0178710 100644 (file)
@@ -14,7 +14,8 @@
 
 extern crate lint_stability;
 
-use lint_stability::UnstableEnum::{}; //~ ERROR use of unstable library feature 'test_feature'
+use lint_stability::UnstableEnum::{};
+//~^ ERROR use of unstable library feature 'unstable_test_feature'
 use lint_stability::StableEnum::{}; // OK
 
 fn main() {}
index ae010b64bfdfc75cfe945d07385ae90293638bbd..f6b94e89826329a5dfd9067788ec1b9ae6fb6217 100644 (file)
@@ -13,6 +13,6 @@
 
 #![allow(renamed_and_removed_lints)]
 
-#[deny(unknown_features)]
+#[deny(single_use_lifetime)]
 #[deny(unused)]
 fn main() { let unused = (); } //~ ERROR unused
index a5246206d9504726872fd4e565c5cf536eb6010d..f5abf2733b97793c28e64d8229daaf30f565cd5f 100644 (file)
@@ -8,10 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags:-D unknown_features
+// compile-flags:-D bare_trait_object
 
-// error-pattern:lint `unknown_features` has been renamed to `unused_features`
-// error-pattern:requested on the command line with `-D unknown_features`
+// error-pattern:lint `bare_trait_object` has been renamed to `bare_trait_objects`
+// error-pattern:requested on the command line with `-D bare_trait_object`
 // error-pattern:unused
 
 #[deny(unused)]
index afe4aee7a1d947ef43394060654f99090464cf41..c147ec5cf95052dd35e7e99e5ded2148b9f1bb4d 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[deny(unknown_features)] //~ WARN lint `unknown_features` has been renamed to `unused_features`
+#[deny(bare_trait_object)]
+//~^ WARN lint `bare_trait_object` has been renamed to `bare_trait_objects`
 #[deny(unused)]
 fn main() { let unused = (); } //~ ERROR unused
index 77917ff3cd3e5c9c456d77898690106d0e1a6497..1f2fa077cafc8292a6d82590091d7e2739c28cce 100644 (file)
@@ -76,15 +76,15 @@ fn test() {
         <Foo>::trait_unstable(&foo); //~ ERROR use of unstable library feature
 
         foo.method_unstable_text();
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
         Foo::method_unstable_text(&foo);
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
         <Foo>::method_unstable_text(&foo);
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
         foo.trait_unstable_text();
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
         <Foo>::trait_unstable_text(&foo);
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
 
         stable();
         foo.method_stable();
@@ -149,9 +149,9 @@ fn test_method_param<Foo: Trait>(foo: Foo) {
         foo.trait_unstable(); //~ ERROR use of unstable library feature
         <Foo>::trait_unstable(&foo); //~ ERROR use of unstable library feature
         foo.trait_unstable_text();
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
         <Foo>::trait_unstable_text(&foo);
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
         foo.trait_stable();
         Trait::trait_stable(&foo);
         <Foo>::trait_stable(&foo);
@@ -167,7 +167,7 @@ fn test_method_object(foo: &Trait) {
         //~^ ERROR use of unstable library feature
         foo.trait_unstable(); //~ ERROR use of unstable library feature
         foo.trait_unstable_text();
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
         foo.trait_stable();
     }
 
@@ -178,16 +178,16 @@ trait LocalTrait2 : DeprecatedTrait { }
 }
 
 mod this_crate {
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub fn deprecated() {}
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub fn deprecated_text() {}
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub fn unstable() {}
-    #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
     pub fn unstable_text() {}
 
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -199,16 +199,16 @@ pub fn stable_text() {}
     pub struct MethodTester;
 
     impl MethodTester {
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         pub fn method_deprecated(&self) {}
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         pub fn method_deprecated_text(&self) {}
 
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         pub fn method_unstable(&self) {}
-        #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
         pub fn method_unstable_text(&self) {}
 
         #[stable(feature = "rust1", since = "1.0.0")]
@@ -218,16 +218,16 @@ pub fn method_stable_text(&self) {}
     }
 
     pub trait Trait {
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         fn trait_deprecated(&self) {}
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         fn trait_deprecated_text(&self) {}
 
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         fn trait_unstable(&self) {}
-        #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
         fn trait_unstable_text(&self) {}
 
         #[stable(feature = "rust1", since = "1.0.0")]
@@ -238,43 +238,43 @@ fn trait_stable_text(&self) {}
 
     impl Trait for MethodTester {}
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub struct DeprecatedStruct {
-        #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+        #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
     }
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub struct UnstableStruct {
-        #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+        #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
     }
     #[stable(feature = "rust1", since = "1.0.0")]
     pub struct StableStruct {
-        #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+        #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub struct DeprecatedUnitStruct;
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub struct UnstableUnitStruct;
     #[stable(feature = "rust1", since = "1.0.0")]
     pub struct StableUnitStruct;
 
     pub enum Enum {
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         DeprecatedVariant,
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         UnstableVariant,
 
         #[stable(feature = "rust1", since = "1.0.0")]
         StableVariant,
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub struct DeprecatedTupleStruct(isize);
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub struct UnstableTupleStruct(isize);
     #[stable(feature = "rust1", since = "1.0.0")]
     pub struct StableTupleStruct(isize);
@@ -391,7 +391,7 @@ fn test_method_object(foo: &Trait) {
         foo.trait_stable();
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     fn test_fn_body() {
         fn fn_in_body() {}
@@ -399,7 +399,7 @@ fn fn_in_body() {}
     }
 
     impl MethodTester {
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         fn test_method_body(&self) {
             fn fn_in_body() {}
@@ -407,7 +407,7 @@ fn fn_in_body() {}
         }
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub trait DeprecatedTrait {
         fn dummy(&self) { }
index f2defc1d421b09f8e587411f8b03d0d8ceb0dd64..de2c27bdcbcca690fc1c03337780db68b29566ce 100644 (file)
@@ -16,7 +16,7 @@
 
 #![warn(deprecated)]
 #![allow(dead_code, unused_extern_crates)]
-#![feature(staged_api, test_feature, rustc_attrs)]
+#![feature(staged_api, unstable_test_feature, rustc_attrs)]
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
@@ -227,16 +227,16 @@ fn test_inheritance() {
 }
 
 mod this_crate {
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub fn deprecated() {}
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub fn deprecated_text() {}
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub fn unstable() {}
-    #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
     pub fn unstable_text() {}
 
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -248,16 +248,16 @@ pub fn stable_text() {}
     pub struct MethodTester;
 
     impl MethodTester {
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         pub fn method_deprecated(&self) {}
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         pub fn method_deprecated_text(&self) {}
 
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         pub fn method_unstable(&self) {}
-        #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
         pub fn method_unstable_text(&self) {}
 
         #[stable(feature = "rust1", since = "1.0.0")]
@@ -267,16 +267,16 @@ pub fn method_stable_text(&self) {}
     }
 
     pub trait Trait {
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         fn trait_deprecated(&self) {}
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         fn trait_deprecated_text(&self) {}
 
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         fn trait_unstable(&self) {}
-        #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
         fn trait_unstable_text(&self) {}
 
         #[stable(feature = "rust1", since = "1.0.0")]
@@ -287,43 +287,43 @@ fn trait_stable_text(&self) {}
 
     impl Trait for MethodTester {}
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub struct DeprecatedStruct {
-        #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+        #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
     }
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub struct UnstableStruct {
-        #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+        #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
     }
     #[stable(feature = "rust1", since = "1.0.0")]
     pub struct StableStruct {
-        #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+        #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub struct DeprecatedUnitStruct;
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub struct UnstableUnitStruct;
     #[stable(feature = "rust1", since = "1.0.0")]
     pub struct StableUnitStruct;
 
     pub enum Enum {
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         DeprecatedVariant,
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         UnstableVariant,
 
         #[stable(feature = "rust1", since = "1.0.0")]
         StableVariant,
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub struct DeprecatedTupleStruct(isize);
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub struct UnstableTupleStruct(isize);
     #[stable(feature = "rust1", since = "1.0.0")]
     pub struct StableTupleStruct(isize);
@@ -441,7 +441,7 @@ fn test_method_object(foo: &Trait) {
         foo.trait_stable();
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     fn test_fn_body() {
         fn fn_in_body() {}
@@ -449,7 +449,7 @@ fn fn_in_body() {}
     }
 
     impl MethodTester {
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         fn test_method_body(&self) {
             fn fn_in_body() {}
@@ -457,7 +457,7 @@ fn fn_in_body() {}
         }
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub trait DeprecatedTrait {
         fn dummy(&self) { }
index 5da3e1a930d7dd6e98fc7119fc506399f422fd72..0ad4466d0e271142071cae0b9a1dbf9ab4ffe289 100644 (file)
@@ -9,9 +9,10 @@
 // except according to those terms.
 
 // aux-build:lint_stability_fields.rs
+
 #![deny(deprecated)]
 #![allow(dead_code)]
-#![feature(staged_api, test_feature)]
+#![feature(staged_api, unstable_test_feature)]
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
@@ -162,50 +163,50 @@ mod this_crate {
     #[stable(feature = "rust1", since = "1.0.0")]
     struct Stable {
         inherit: u8,
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         override1: u8,
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         override2: u8,
     }
 
     #[stable(feature = "rust1", since = "1.0.0")]
     struct Stable2(u8,
                    #[stable(feature = "rust1", since = "1.0.0")] u8,
-                   #[unstable(feature = "test_feature", issue = "0")]
+                   #[unstable(feature = "unstable_test_feature", issue = "0")]
                    #[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     struct Unstable {
         inherit: u8,
         #[stable(feature = "rust1", since = "1.0.0")]
         override1: u8,
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         override2: u8,
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     struct Unstable2(u8,
                      #[stable(feature = "rust1", since = "1.0.0")] u8,
-                     #[unstable(feature = "test_feature", issue = "0")]
+                     #[unstable(feature = "unstable_test_feature", issue = "0")]
                      #[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     struct Deprecated {
         inherit: u8,
         #[stable(feature = "rust1", since = "1.0.0")]
         override1: u8,
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         override2: u8,
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     struct Deprecated2(u8,
                        #[stable(feature = "rust1", since = "1.0.0")] u8,
-                       #[unstable(feature = "test_feature", issue = "0")] u8);
+                       #[unstable(feature = "unstable_test_feature", issue = "0")] u8);
 
     pub fn foo() {
         let x = Stable {
index b1b1a9a1fbf8e7d5789f4e155f89e7b26c866f25..db6b64dabfe4b446dc4eabc897e23c2c63f7d254 100644 (file)
@@ -138,50 +138,50 @@ mod this_crate {
     #[stable(feature = "rust1", since = "1.0.0")]
     struct Stable {
         inherit: u8,
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         override1: u8,
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         override2: u8,
     }
 
     #[stable(feature = "rust1", since = "1.0.0")]
     struct Stable2(u8,
                    #[stable(feature = "rust1", since = "1.0.0")] u8,
-                   #[unstable(feature = "test_feature", issue = "0")]
+                   #[unstable(feature = "unstable_test_feature", issue = "0")]
                    #[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     struct Unstable {
         inherit: u8,
         #[stable(feature = "rust1", since = "1.0.0")]
         override1: u8,
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         override2: u8,
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     struct Unstable2(u8,
                      #[stable(feature = "rust1", since = "1.0.0")] u8,
-                     #[unstable(feature = "test_feature", issue = "0")]
+                     #[unstable(feature = "unstable_test_feature", issue = "0")]
                      #[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     struct Deprecated {
         inherit: u8,
         #[stable(feature = "rust1", since = "1.0.0")]
         override1: u8,
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         override2: u8,
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     struct Deprecated2(u8,
                        #[stable(feature = "rust1", since = "1.0.0")] u8,
-                       #[unstable(feature = "test_feature", issue = "0")] u8);
+                       #[unstable(feature = "unstable_test_feature", issue = "0")] u8);
 
     pub fn foo() {
         let x = Stable {
index bd390108bd8f3c40468fc1e122bae926a345f8c3..720b1235d47f684c45d5bfe307ce99816a94e7f7 100644 (file)
@@ -71,11 +71,11 @@ fn test() {
         <Foo as Trait>::trait_unstable(&foo); //~ ERROR use of unstable library feature
 
         unstable_text();
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
         Trait::trait_unstable_text(&foo);
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
         <Foo as Trait>::trait_unstable_text(&foo);
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
 
         stable();
         foo.method_stable();
@@ -162,9 +162,9 @@ fn test_method_param<Foo: Trait>(foo: Foo) {
         Trait::trait_unstable(&foo); //~ ERROR use of unstable library feature
         <Foo as Trait>::trait_unstable(&foo); //~ ERROR use of unstable library feature
         Trait::trait_unstable_text(&foo);
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
         <Foo as Trait>::trait_unstable_text(&foo);
-        //~^ ERROR use of unstable library feature 'test_feature': text
+        //~^ ERROR use of unstable library feature 'unstable_test_feature': text
         foo.trait_stable();
         Trait::trait_stable(&foo);
         <Foo>::trait_stable(&foo);
@@ -213,10 +213,10 @@ fn test_inheritance() {
 }
 
 mod this_crate {
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub fn deprecated() {}
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub fn deprecated_text() {}
 
@@ -224,9 +224,9 @@ pub fn deprecated_text() {}
     #[rustc_deprecated(since = "99.99.99", reason = "text")]
     pub fn deprecated_future() {}
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub fn unstable() {}
-    #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
     pub fn unstable_text() {}
 
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -238,16 +238,16 @@ pub fn stable_text() {}
     pub struct MethodTester;
 
     impl MethodTester {
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         pub fn method_deprecated(&self) {}
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         pub fn method_deprecated_text(&self) {}
 
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         pub fn method_unstable(&self) {}
-        #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
         pub fn method_unstable_text(&self) {}
 
         #[stable(feature = "rust1", since = "1.0.0")]
@@ -257,16 +257,16 @@ pub fn method_stable_text(&self) {}
     }
 
     pub trait Trait {
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         fn trait_deprecated(&self) {}
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         fn trait_deprecated_text(&self) {}
 
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         fn trait_unstable(&self) {}
-        #[unstable(feature = "test_feature", reason = "text", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
         fn trait_unstable_text(&self) {}
 
         #[stable(feature = "rust1", since = "1.0.0")]
@@ -277,43 +277,43 @@ fn trait_stable_text(&self) {}
 
     impl Trait for MethodTester {}
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub struct DeprecatedStruct {
-        #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+        #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
     }
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub struct UnstableStruct {
-        #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+        #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
     }
     #[stable(feature = "rust1", since = "1.0.0")]
     pub struct StableStruct {
-        #[stable(feature = "test_feature", since = "1.0.0")] i: isize
+        #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub struct DeprecatedUnitStruct;
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub struct UnstableUnitStruct;
     #[stable(feature = "rust1", since = "1.0.0")]
     pub struct StableUnitStruct;
 
     pub enum Enum {
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         DeprecatedVariant,
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         UnstableVariant,
 
         #[stable(feature = "rust1", since = "1.0.0")]
         StableVariant,
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub struct DeprecatedTupleStruct(isize);
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     pub struct UnstableTupleStruct(isize);
     #[stable(feature = "rust1", since = "1.0.0")]
     pub struct StableTupleStruct(isize);
@@ -432,7 +432,7 @@ fn test_method_object(foo: &Trait) {
         foo.trait_stable();
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     fn test_fn_body() {
         fn fn_in_body() {}
@@ -440,7 +440,7 @@ fn fn_in_body() {}
     }
 
     impl MethodTester {
-        #[unstable(feature = "test_feature", issue = "0")]
+        #[unstable(feature = "unstable_test_feature", issue = "0")]
         #[rustc_deprecated(since = "1.0.0", reason = "text")]
         fn test_method_body(&self) {
             fn fn_in_body() {}
@@ -448,7 +448,7 @@ fn fn_in_body() {}
         }
     }
 
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     pub trait DeprecatedTrait {
         fn dummy(&self) { }
index 79ba3ea45e1878ed20b54fcb2d64edae800e041e..5a0568f05e6e154fd28fabed515b688736a41ac4 100644 (file)
@@ -10,8 +10,9 @@
 
 // Tests the default for the unused_features lint
 
+#![allow(stable_features)]
 // FIXME(#44232) we should warn that this isn't used.
-#![feature(this_is_not_a_feature)]
+#![feature(rust1)]
 
 #![feature(rustc_attrs)]
 
index d230297aaba01cbd108e4502bee0cd7023fd1569..81f99f9949284b0823069c292d1b819da44a926a 100644 (file)
@@ -10,8 +10,9 @@
 
 #![warn(unused_features)]
 
+#![allow(stable_features)]
 // FIXME(#44232) we should warn that this isn't used.
-#![feature(this_is_not_a_feature)]
+#![feature(rust1)]
 
 #![feature(rustc_attrs)]
 
index 6567a100d8c0664caedda024cc8b097dd9489514..1281adce5c58e694e8f55ef274433317c41961bd 100644 (file)
 
 // gate-test-use_extern_macros
 
-#![feature(proc_macro_path_invoc)]
-
 fn main() {
     globnar::brotz!(); //~ ERROR non-ident macro paths are experimental
-    #[derive(foo::Bar)] struct T; //~ ERROR non-ident macro paths are experimental
-    ::foo!(); //~ ERROR non-ident macro paths are experimental
 }
index b6e273881ccd62636a50a64d95e1314ca4b5d0ed..40053853b15a7e2802fba2c2b88ee41abb346b6a 100644 (file)
@@ -34,9 +34,9 @@ fn main() {
 #[link(name = "rust_test_helpers", kind = "static")]
 extern {
     returns_isize!(rust_get_test_int);
-    //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+    //~^ ERROR macro invocations in `extern {}` blocks are experimental
     takes_u32_returns_u32!(rust_dbg_extern_identity_u32);
-    //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+    //~^ ERROR macro invocations in `extern {}` blocks are experimental
     emits_nothing!();
-    //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+    //~^ ERROR macro invocations in `extern {}` blocks are experimental
 }
index a727ecc76b7beb9481ecd32d0f5ef0185feaa8b2..1922efb5e19dc379b04b7e3a455bcda7ff0eef61 100644 (file)
 #![crate_type="lib"]
 #![feature(staged_api)]
 
-#![stable(feature = "test_feature", since = "1.0.0")]
+#![stable(feature = "stable_test_feature", since = "1.0.0")]
 
 pub fn unmarked() {
     //~^ ERROR This node does not have a stability attribute
     ()
 }
 
-#[unstable(feature = "foo", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub mod foo {
     // #[unstable] is inherited
     pub fn unmarked() {}
 }
 
-#[stable(feature = "bar", since="1.0.0")]
+#[stable(feature = "stable_test_feature", since="1.0.0")]
 pub mod bar {
     // #[stable] is not inherited
     pub fn unmarked() {}
index 1a3dc76005db4629f86595c575aef3e1e5641b04..0efdd19df3c884e4def262a3f6047630e0a79b51 100644 (file)
@@ -21,7 +21,7 @@ fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32)
 
 fn bar<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
     foo(x, y)
-    //~^ ERROR lifetime mismatch [E0623]
+    //~^ ERROR unsatisfied lifetime constraints
     //~| WARNING not reporting region error due to nll
 }
 
index 69f0f43af13425af0d5942286d4cefc3d1806a51..92e7db861734432398c73f28dd6b07091608b479 100644 (file)
@@ -21,7 +21,7 @@ struct Foo<'a: 'b, 'b> {
 
 fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) {
     Foo { x, y };
-    //~^ ERROR lifetime mismatch [E0623]
+    //~^ ERROR unsatisfied lifetime constraints
     //~| WARNING not reporting region error due to nll
 }
 
index e04bb27f43500723d39886c97e8a74507a1df05b..826bf675bd699899da0638a33c1b7b8edd8ba420 100644 (file)
@@ -10,8 +10,6 @@
 
 // edition:2018
 
-#![feature(extern_absolute_paths)]
-
 use xcrate::S; //~ ERROR can't find crate for `xcrate`
 
 fn main() {}
index bebf0236bb4d03e7b1f377a0719e8ec94a027927..053bf92f4d196a2aa0108d5062a397a4ff995ea5 100644 (file)
@@ -10,8 +10,6 @@
 
 // edition:2018
 
-#![feature(extern_absolute_paths)]
-
 fn main() {
     let s = ::xcrate::S; //~ ERROR can't find crate for `xcrate`
 }
index 5906a0719c842cfd1305b49a122db46c627579d1..1b9e5a75e83071f82bc8f0bccc067d6f85bf030d 100644 (file)
@@ -10,8 +10,6 @@
 
 // edition:2018
 
-#![feature(extern_absolute_paths)]
-
 use ycrate; //~ ERROR can't find crate for `ycrate`
 
 fn main() {}
index 7111176dbd9af8e68ae6369315487515899d72b8..e9de0f01b30d92924fd6cbe0ada6c21dd93c40f8 100644 (file)
@@ -11,9 +11,6 @@
 // aux-build:xcrate.rs
 // edition:2018
 
-#![feature(crate_in_paths)]
-#![feature(extern_absolute_paths)]
-
 use crate; //~ ERROR unresolved import `crate`
            //~^ NOTE crate root imports need to be explicitly named: `use crate as name;`
 use *; //~ ERROR unresolved import `*`
index c473bdd23b5c40000b3f45e946b8c74470baeef7..754c6f792f95dc5e594e14cb584735683243c3db 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // aux-build:stability_attribute_issue.rs
+// ignore-tidy-linelength
 
 #![deny(deprecated)]
 
@@ -16,6 +17,8 @@
 use stability_attribute_issue::*;
 
 fn main() {
-    unstable(); //~ ERROR use of unstable library feature 'foo' (see issue #1)
-    unstable_msg(); //~ ERROR use of unstable library feature 'foo': message (see issue #2)
+    unstable();
+    //~^ ERROR use of unstable library feature 'unstable_test_feature' (see issue #1)
+    unstable_msg();
+    //~^ ERROR use of unstable library feature 'unstable_test_feature': message (see issue #2)
 }
index 0ddc3a8dcebb8cd8f64d676a070025057a827d81..9c54315bfd0045a55eea0d09b606beb35de0cee9 100644 (file)
@@ -12,7 +12,7 @@
 
 #![feature(staged_api)]
 
-#![stable(feature = "test_feature", since = "1.0.0")]
+#![stable(feature = "stable_test_feature", since = "1.0.0")]
 
 #[stable(feature = "a", feature = "b", since = "1.0.0")] //~ ERROR multiple 'feature' items
 fn f1() { }
index ddefd24b92fd9f8091167c65fdc6f9b633d0ef6b..d4821e009f22353077940792a573e1a50290f8a1 100644 (file)
@@ -12,7 +12,7 @@
 
 #![feature(staged_api)]
 
-#![stable(feature = "test_feature", since = "1.0.0")]
+#![stable(feature = "stable_test_feature", since = "1.0.0")]
 
 #[macro_export]
 macro_rules! mac { //~ ERROR This node does not have a stability attribute
index 263ac427b7676a25a11f5979c9061584bb677f72..794ae1ca08707a1a5f2d0f194fef16c70a2f5e5d 100644 (file)
@@ -15,7 +15,7 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 mod bogus_attribute_types_1 {
-    #[stable(feature = "a", since = "a", reason)] //~ ERROR unknown meta item 'reason' [E0541]
+    #[stable(feature = "a", since = "b", reason)] //~ ERROR unknown meta item 'reason' [E0541]
     fn f1() { }
 
     #[stable(feature = "a", since)] //~ ERROR incorrect meta item [E0539]
@@ -35,7 +35,7 @@ mod bogus_attribute_types_2 {
     #[unstable] //~ ERROR incorrect stability attribute type [E0548]
     fn f1() { }
 
-    #[unstable = "a"] //~ ERROR incorrect stability attribute type [E0548]
+    #[unstable = "b"] //~ ERROR incorrect stability attribute type [E0548]
     fn f2() { }
 
     #[stable] //~ ERROR incorrect stability attribute type [E0548]
@@ -57,7 +57,7 @@ mod missing_feature_names {
     #[unstable(issue = "0")] //~ ERROR missing 'feature' [E0546]
     fn f1() { }
 
-    #[unstable(feature = "a")] //~ ERROR missing 'issue' [E0547]
+    #[unstable(feature = "b")] //~ ERROR missing 'issue' [E0547]
     fn f2() { }
 
     #[stable(since = "a")] //~ ERROR missing 'feature' [E0546]
@@ -73,12 +73,12 @@ fn f1() { }
     fn f2() { }
 }
 
-#[unstable(feature = "a", issue = "0")]
+#[unstable(feature = "b", issue = "0")]
 #[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544]
 fn multiple1() { }
 
-#[unstable(feature = "a", issue = "0")]
-#[unstable(feature = "a", issue = "0")] //~ ERROR multiple stability levels [E0544]
+#[unstable(feature = "b", issue = "0")]
+#[unstable(feature = "b", issue = "0")] //~ ERROR multiple stability levels [E0544]
 fn multiple2() { }
 
 #[stable(feature = "a", since = "b")]
@@ -88,8 +88,8 @@ fn multiple3() { }
 #[stable(feature = "a", since = "b")]
 #[rustc_deprecated(since = "b", reason = "text")]
 #[rustc_deprecated(since = "b", reason = "text")]
-#[rustc_const_unstable(feature = "a")]
-#[rustc_const_unstable(feature = "b")]
+#[rustc_const_unstable(feature = "c")]
+#[rustc_const_unstable(feature = "d")]
 pub const fn multiple4() { } //~ ERROR multiple rustc_deprecated attributes [E0540]
 //~^ ERROR Invalid stability or deprecation version found
 //~| ERROR multiple rustc_const_unstable attributes
index 5993f4b5a0941add1e740afb04eb490c68f2e6b2..32991dd6499b5ceaaad0175bd1a109ffa13a3ac4 100644 (file)
 
 #![deny(stable_features)]
 
-#![feature(test_accepted_feature)] //~ ERROR this feature has been stable since 1.0.0
+#![feature(test_accepted_feature)]
+//~^ ERROR the feature `test_accepted_feature` has been stable since 1.0.0
 
-// FIXME(#44232) we should error that this isn't used.
 #![feature(rust1)]
+//~^ ERROR the feature `rust1` has been stable since 1.0.0
 
 fn main() {
     let _foo: Vec<()> = Vec::new();
index d8626dfd39ee805897b89fecc2b8ff5a57060249..896817bb85832f11ffe35885afd41aeb9be2d07b 100644 (file)
@@ -20,7 +20,7 @@ fn main() {
     #[attr]
     fn a() {}
 
-    #[attr]
+    #[attr] //~ ERROR attributes on expressions are experimental
     {
 
     }
index c4d22e6d392102ab9489797e4e844d04ecc31663..99c336c28cd29c6db14a37e3c37594cf9ad39635 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(use_extern_macros, proc_macro_path_invoc)]
+#![feature(proc_macro_path_invoc)]
 
 #[foo::bar] //~ ERROR failed to resolve. Use of undeclared type or module `foo`
 fn main() {}
index 8fc910d8a6daa46a63be49e2039a6348c8cdc2e4..f5dab5a55b45cc3e59693839d73f509b7bfb6434 100644 (file)
@@ -15,7 +15,6 @@
 #![allow(dead_code, unused_variables)]
 #![feature(omit_gdb_pretty_printer_section)]
 #![omit_gdb_pretty_printer_section]
-#![feature(static_mutex)]
 
 // This test makes sure that the compiler doesn't crash when trying to assign
 // debug locations to const-expressions.
index ba8c580cb0a01d1f5753ad737663b3aafb49ad72..ce157e3632c70a5f67f07331e0f9ad23e43fc3a3 100644 (file)
@@ -18,6 +18,6 @@ fn main() {
     #[align = 8]
     fn f() { }
 
-    #[vec(1, 2, 3)]
+    #[vector(1, 2, 3)]
     fn g() { }
 }
index b8fb03faf0802b9680f74292606238ad5e09351b..3eca89fbed3310ab6f16b54c3953cbfe3b6dfe4d 100644 (file)
@@ -11,7 +11,6 @@
 
 // error-pattern:meep
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn f(_a: isize, _b: isize, _c: Box<isize>) {
index 7ca45565d854bee82f59a485a11ce83353ca86c0..c8f851be556d7ddfa953006df6f907e210631502 100644 (file)
@@ -10,7 +10,6 @@
 
 // error-pattern:panicked at 'Box<Any>'
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn main() {
index 68f1c4ed0bceddc17d52ac9b413d64c95fb1bc96..2d430be07ef2f2eff1f3fe97566a15696f18ba9f 100644 (file)
@@ -10,8 +10,6 @@
 
 // error-pattern:greetings from the panic handler
 
-#![feature(panic_handler)]
-
 use std::panic;
 
 fn main() {
index 072139a8c9b802c8fe653c82ef1a0f06cade2537..e7659d0bd88b7cb5354047aed6bd792c1e41364e 100644 (file)
@@ -10,8 +10,6 @@
 
 // error-pattern:thread 'main' panicked at 'foobar'
 
-#![feature(panic_handler)]
-
 use std::panic;
 
 fn main() {
index 0add63c6d64f22db63633884f735b119c47f4676..46e937c5d9b79709522d24e17e6be0d079485c15 100644 (file)
@@ -10,8 +10,6 @@
 
 // error-pattern:thread 'main' panicked at 'foobar'
 
-#![feature(panic_handler)]
-
 use std::panic;
 
 fn main() {
index fed1405b7f4d284f447af620ce070efa4918fb1d..1dad2ed90521dc60b59ec5e9807b2fe61eb9ea45 100644 (file)
@@ -10,6 +10,6 @@
 
 #![crate_type = "lib"]
 #![feature(staged_api)]
-#![unstable(feature = "test_feature", issue = "0")]
+#![unstable(feature = "unstable_test_feature", issue = "0")]
 
-pub fn baz() { }
+pub fn baz() {}
index a36cc474c2bf052054aa6614b805302073987703..b728136a89e294d31e9b67405c02cfc2c3cad8bb 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(test_feature)]
+#![feature(unstable_test_feature)]
 
 extern crate bar;
 
index aaac3927f1cf3996eaf47324843a46e8a5c2fea0..f3502e8bcd4139d423237a95bae05576a5669adb 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(libc, exit_status)]
+#![feature(libc)]
 
 extern crate libc;
 
index b1fe535766d21af915b30ebeba95898b4b9213f6..7e5343df84141863793de151f7b8fca9b33d471f 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(extern_absolute_paths)]
-
 use krate2::hello;
 
 fn main() {
diff --git a/src/test/run-make-fulldeps/symbols-are-reasonable/Makefile b/src/test/run-make-fulldeps/symbols-are-reasonable/Makefile
deleted file mode 100644 (file)
index a6d294d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
--include ../tools.mk
-
-# check that the compile generated symbols for strings, binaries,
-# vtables, etc. have semisane names (e.g. `str.1234`); it's relatively
-# easy to accidentally modify the compiler internals to make them
-# become things like `str"str"(1234)`.
-
-OUT=$(TMPDIR)/lib.s
-
-all:
-       $(RUSTC) lib.rs --emit=asm --crate-type=staticlib
-       # just check for symbol declarations with the names we're expecting.
-       $(CGREP) -e 'str\.[0-9]+:' 'byte_str\.[0-9]+:' 'vtable\.[0-9]+' < $(OUT)
diff --git a/src/test/run-make-fulldeps/symbols-are-reasonable/lib.rs b/src/test/run-make-fulldeps/symbols-are-reasonable/lib.rs
deleted file mode 100644 (file)
index b9285b2..0000000
+++ /dev/null
@@ -1,21 +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.
-
-pub static X: &'static str = "foobarbaz";
-pub static Y: &'static [u8] = include_bytes!("lib.rs");
-
-trait Foo { fn dummy(&self) { } }
-impl Foo for usize {}
-
-#[no_mangle]
-pub extern "C" fn dummy() {
-    // force the vtable to be created
-    let _x = &1usize as &Foo;
-}
index ed537280e6c520163c966eed0752b2b8824c6d8a..6b165f1f7009268a4dca4f790fd492528d8bf008 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 #![crate_type = "cdylib"]
-#![feature(wasm_custom_section)]
 #![deny(warnings)]
 
 extern crate foo;
index fb3bec31ada7fcd4ff91c6b6b50990d118ea74f0..6a35d743710dd40cb137d908c4398d30e6c5ee09 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 #![crate_type = "rlib"]
-#![feature(wasm_custom_section)]
 #![deny(warnings)]
 
 #[link_section = "foo"]
diff --git a/src/test/run-make/wasm-symbols-not-exported/Makefile b/src/test/run-make/wasm-symbols-not-exported/Makefile
new file mode 100644 (file)
index 0000000..8728251
--- /dev/null
@@ -0,0 +1,16 @@
+-include ../../run-make-fulldeps/tools.mk
+
+ifeq ($(TARGET),wasm32-unknown-unknown)
+all:
+       $(RUSTC) foo.rs --target wasm32-unknown-unknown
+       $(NODE) verify-exported-symbols.js $(TMPDIR)/foo.wasm
+       $(RUSTC) foo.rs --target wasm32-unknown-unknown -O
+       $(NODE) verify-exported-symbols.js $(TMPDIR)/foo.wasm
+       $(RUSTC) bar.rs --target wasm32-unknown-unknown
+       $(NODE) verify-exported-symbols.js $(TMPDIR)/bar.wasm
+       $(RUSTC) bar.rs --target wasm32-unknown-unknown -O
+       $(NODE) verify-exported-symbols.js $(TMPDIR)/bar.wasm
+else
+all:
+endif
+
diff --git a/src/test/run-make/wasm-symbols-not-exported/bar.rs b/src/test/run-make/wasm-symbols-not-exported/bar.rs
new file mode 100644 (file)
index 0000000..979ec44
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright 2018 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(panic_implementation, alloc_error_handler)]
+#![crate_type = "cdylib"]
+#![no_std]
+
+use core::alloc::*;
+
+struct B;
+
+unsafe impl GlobalAlloc for B {
+    unsafe fn alloc(&self, x: Layout) -> *mut u8 {
+        1 as *mut u8
+    }
+
+    unsafe fn dealloc(&self, ptr: *mut u8, x: Layout) {
+    }
+}
+
+#[global_allocator]
+static A: B = B;
+
+#[no_mangle]
+pub extern fn foo(a: u32) -> u32 {
+    assert_eq!(a, 3);
+    a * 2
+}
+
+#[alloc_error_handler]
+fn a(_: core::alloc::Layout) -> ! {
+    loop {}
+}
+
+#[panic_implementation]
+fn b(_: &core::panic::PanicInfo) -> ! {
+    loop {}
+}
diff --git a/src/test/run-make/wasm-symbols-not-exported/foo.rs b/src/test/run-make/wasm-symbols-not-exported/foo.rs
new file mode 100644 (file)
index 0000000..cd8c7cb
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright 2018 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.
+
+#![crate_type = "cdylib"]
+
+#[no_mangle]
+pub extern fn foo() {
+    println!("foo");
+    panic!("test");
+}
diff --git a/src/test/run-make/wasm-symbols-not-exported/verify-exported-symbols.js b/src/test/run-make/wasm-symbols-not-exported/verify-exported-symbols.js
new file mode 100644 (file)
index 0000000..060830e
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright 2018 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.
+
+const fs = require('fs');
+const process = require('process');
+const assert = require('assert');
+const buffer = fs.readFileSync(process.argv[2]);
+
+let m = new WebAssembly.Module(buffer);
+let list = WebAssembly.Module.exports(m);
+console.log('exports', list);
+
+let bad = false;
+for (let i = 0; i < list.length; i++) {
+  const e = list[i];
+  if (e.name == "foo" || e.kind != "function")
+    continue;
+
+  console.log('unexpected exported symbol:', e.name);
+  bad = true;
+}
+
+if (bad)
+  process.exit(1);
index ec6f54fb1378f4d703bf1cb33edec5b78da1f725..94c5b208a370799733b8416904bec1b8dcff0053 100644 (file)
@@ -11,7 +11,7 @@
 // no-prefer-dynamic
 
 #![crate_type = "proc-macro"]
-#![feature(proc_macro, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
 
 extern crate proc_macro;
 
index 545eabe00ff2e339945d9f46efaf01e093745b76..b54543c73fbd21147e053ff0ffeb31a22fdc21aa 100644 (file)
@@ -11,7 +11,7 @@
 // no-prefer-dynamic
 
 #![crate_type = "proc-macro"]
-#![feature(use_extern_macros, proc_macro_non_items, proc_macro_quote)]
+#![feature(proc_macro_non_items, proc_macro_quote)]
 
 extern crate proc_macro;
 
index 9a5bffb92a4937112106c1fc937781d858df5d29..9faa7366ec5f19fba069c5db92945726f8487a1d 100644 (file)
@@ -11,7 +11,7 @@
 // no-prefer-dynamic
 
 #![crate_type = "proc-macro"]
-#![feature(proc_macro, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
 
 extern crate proc_macro;
 
index cc2b6c641e90cd70d0bc08a841f43a1261b93205..baf9e0d5dc5a6165bd06b4b2688cde9c13c921a1 100644 (file)
@@ -12,8 +12,7 @@
 
 // ignore-cross-compile
 
-#![feature(rustc_private, path)]
-#![feature(core)]
+#![feature(rustc_private)]
 
 extern crate getopts;
 extern crate rustc;
index 1573b0807173f3061906c565d31a69b7612f4d9d..4c5b3259902eb39a7479bbd09baeeae8d9393ed3 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 #![feature(rustc_private)]
 
index 10e8ddc41f3f9e71da6585ad1decea0dda069f22..e967873280470431417e1246ee6bec5f8b8d777a 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rand, rustc_private)]
+#![feature(rustc_private)]
 
 extern crate serialize;
 
index f1dcec8af6906a5478fabcce97cc7a8c58a690fe..3eb7e8cc9a46dfbb2ff6d4dc6ea38dfc91158ca4 100644 (file)
@@ -11,7 +11,7 @@
 // aux-build:cond_plugin.rs
 // ignore-stage1
 
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
 
 extern crate cond_plugin;
 
index 2349fa68c65f0b5ce28e5c12c0d260acf08ea800..1005a6bfc50c7fa00f29428bb52162bd25506df2 100644 (file)
@@ -13,7 +13,7 @@
 // aux-build:hello_macro.rs
 // ignore-stage1
 
-#![feature(use_extern_macros, proc_macro_non_items, proc_macro_gen)]
+#![feature(proc_macro_non_items, proc_macro_gen)]
 
 extern crate hello_macro;
 
index a946ec635b29ffdccbdc8a56a4d959d9229230e7..baf27d6f57c3cda9c3c45953636b2e59eb9c1452 100644 (file)
@@ -14,7 +14,7 @@
 // See https://github.com/rust-lang/rust/issues/34793 for more information.
 
 // Make sure we don't optimize anything away:
-// compile-flags: -C no-prepopulate-passes
+// compile-flags: -C no-prepopulate-passes -Cpasses=name-anon-globals
 
 // Expand something exponentially
 macro_rules! go_bacterial {
index 021b10e033fe9b374fc56171292cf0b83280ffb9..b5272e6608bbfd31d47d7ca7407d3ea94092f66c 100644 (file)
@@ -11,7 +11,7 @@
 // aux-build:attr-stmt-expr.rs
 // ignore-stage1
 
-#![feature(use_extern_macros, stmt_expr_attributes, proc_macro_stmt, proc_macro_expr)]
+#![feature(stmt_expr_attributes, proc_macro_expr)]
 
 extern crate attr_stmt_expr;
 use attr_stmt_expr::{expect_let, expect_print_stmt, expect_expr, expect_print_expr,
index c6bcc37ac4a5480a0a0bd003c33bf538cf191b79..a84e029f9d87d22dc56dd9ce2f46f6625c67633c 100644 (file)
@@ -10,7 +10,7 @@
 
 // no-prefer-dynamic
 
-#![feature(proc_macro_non_items, proc_macro_quote, use_extern_macros)]
+#![feature(proc_macro_non_items, proc_macro_quote)]
 #![crate_type = "proc-macro"]
 
 extern crate proc_macro;
index 8f95bdd9c3919e57da49dac4d37e218430357784..43c1d5fcc8d4996a653e383322d17cde24771941 100644 (file)
@@ -10,7 +10,7 @@
 
 // no-prefer-dynamic
 
-#![feature(use_extern_macros, proc_macro_quote, proc_macro_non_items)]
+#![feature(proc_macro_quote, proc_macro_non_items)]
 #![crate_type = "proc-macro"]
 
 extern crate proc_macro as proc_macro_renamed; // This does not break `quote!`
index f9d17a9decbb6b5134775e8f0ca018dfdfb9f02f..955b6ab986d07b3575e819f1c6b7804f97a5af92 100644 (file)
@@ -11,7 +11,7 @@
 // aux-build:bang-macro.rs
 // ignore-stage1
 
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
 
 extern crate bang_macro;
 use bang_macro::rewrite;
index 505994f66e7e553c339ccfc49e7a59b7b3064b01..dfe97eb587cfb9f1cb6c60406419b880014cd51d 100644 (file)
@@ -11,7 +11,7 @@
 // aux-build:call-site.rs
 // ignore-stage1
 
-#![feature(proc_macro_non_items, use_extern_macros)]
+#![feature(proc_macro_non_items)]
 
 extern crate call_site;
 use call_site::*;
index f4a51d0624ae6152af9ed255e8abda7eb365d3ba..6601d66e586a3aa7e961ccdd47e0772dab59393e 100644 (file)
@@ -11,7 +11,7 @@
 // aux-build:count_compound_ops.rs
 // ignore-stage1
 
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
 
 extern crate count_compound_ops;
 use count_compound_ops::count_compound_ops;
index 35d5084d9f650a3aa3a9bc8d09596be450f2a62d..4a7c8f3e8343baa79f95ecadde8255fe28df7233 100644 (file)
@@ -11,7 +11,7 @@
 // aux-build:derive-b.rs
 // ignore-stage1
 
-#![feature(use_extern_macros, proc_macro_path_invoc)]
+#![feature(proc_macro_path_invoc)]
 
 extern crate derive_b;
 
index 5ee164415a1a583770f2f6aa1a21e674483e27e3..579e8c337733af325147ecb3fbb7ff98e17de121 100644 (file)
@@ -12,7 +12,7 @@
 // aux-build:hygiene_example.rs
 // ignore-stage1
 
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
 
 extern crate hygiene_example;
 use hygiene_example::hello;
index e5f8c844b6b70cd4bac6b79b589cf1263533569d..bd76cc380544fc06121fd0275097d53c7781d1ab 100644 (file)
@@ -12,7 +12,7 @@
 // ignore-stage1
 // ignore-wasm32
 
-#![feature(use_extern_macros, macros_in_extern)]
+#![feature(macros_in_extern)]
 
 extern crate test_macros;
 
index 46b62d7e34a5284e5b7b1914278ac1024914736c..c9d7b0423ec5929c643639a146809c2056066508 100644 (file)
@@ -12,7 +12,7 @@
 // ignore-stage1
 // ignore-cross-compile
 
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
 
 extern crate proc_macro_def;
 
index 6bf5c4d596f08ce1471d77696b574a22c3351ca0..360e8c9cc4f4fb4bc7754545228586d5afd713e6 100644 (file)
@@ -12,7 +12,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 72a79e188b3dc3cac58e8ff1b0c05b7af0aea5b3..c1f75d5ee74ea828e208e081d6432dace8bfab6b 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct pair<A,B> {
index 02e86fa19f8645a86500866088c37f41c10561e4..b17464e04190f459bfebe1101c1360e3c714b71b 100644 (file)
@@ -10,7 +10,7 @@
 
 // no-prefer-dynamic
 
-#![feature(heap_api, allocator_api)]
+#![feature(allocator_api)]
 #![crate_type = "rlib"]
 
 use std::alloc::{GlobalAlloc, System, Layout};
index fbde7e855c2b06cdbb36c47d25779a211f436b6d..7a45fd28bdbc57713f20b7526f2ff1ed1deaf5ef 100644 (file)
@@ -13,7 +13,7 @@
 // aux-build:helper.rs
 // no-prefer-dynamic
 
-#![feature(heap_api, allocator_api)]
+#![feature(allocator_api)]
 
 extern crate custom;
 extern crate custom_as_global;
index 0a6135080bb6e8c93743efa8d88ee1b21e7c5123..de83e4edd8527d475fae6b629fc917ab6039b7e9 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn pairwise_sub(mut t: Box<DoubleEndedIterator<Item=isize>>) -> isize {
index 83f0d360e6122cd7b6f5572ecb8af8c1267efa01..62fa07e20b6b0020a0c1a112a911299734b8cc18 100644 (file)
@@ -12,8 +12,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
 use std::slice;
 
 trait Bound {}
index 0ac37485d3dc81df976de0d747b979be4c3e0592..99b8ad83bf6ccfe44c76d2f25274cbf4da569b6a 100644 (file)
@@ -22,7 +22,7 @@
 use std::future::FutureObj;
 use std::task::{
     Context, Poll, Wake,
-    Executor, SpawnObjError,
+    Spawn, SpawnObjError,
     local_waker_from_nonlocal,
 };
 
@@ -36,8 +36,8 @@ fn wake(this: &Arc<Self>) {
     }
 }
 
-struct NoopExecutor;
-impl Executor for NoopExecutor {
+struct NoopSpawner;
+impl Spawn for NoopSpawner {
     fn spawn_obj(&mut self, _: FutureObj<'static, ()>) -> Result<(), SpawnObjError> {
         Ok(())
     }
@@ -127,8 +127,8 @@ fn test_future_yields_once_then_returns<F, Fut>(f: F)
     let mut fut = PinBox::new(f(9));
     let counter = Arc::new(Counter { wakes: AtomicUsize::new(0) });
     let waker = local_waker_from_nonlocal(counter.clone());
-    let executor = &mut NoopExecutor;
-    let cx = &mut Context::new(&waker, executor);
+    let spawner = &mut NoopSpawner;
+    let cx = &mut Context::new(&waker, spawner);
 
     assert_eq!(0, counter.wakes.load(atomic::Ordering::SeqCst));
     assert_eq!(Poll::Pending, fut.as_pin_mut().poll(cx));
index 95f3ea61dd87e6c309ff6e714816dc98721e4ea0..73f1041082825f453ccfd95fc0c650e7071715f9 100644 (file)
@@ -1,4 +1,4 @@
-#![allow(unknown_features)]
-#![feature(bogus)]
+#![allow(stable_features)]
+#![feature(rust1)]
 pub fn main() { }
 // ignore-license
index 5c5364de6a86b59d63c66aee92ed80057ea9834d..f6ff9a31fa13c85c5eabd9dcb63c2a837cf1775d 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait double {
index c80a92a185a2e26c007ec799db6ef995cad3cb24..234af92610abe3ae0b3d45c091c76fa42fb64a1f 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait double {
index 2a782cfa176ee1566658c71dbc63bba0d63d7f72..5890fe44166616213ad0348f690d4d28596eed2d 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait double {
index a1bcf65ab75fabece2f93c2b6f85c685c9e4ada5..2598ec17d2aea9240a6bd3c2143e446939cc7f54 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait double {
index 326218674ae3f7ad5da77a0d0d3d95fa4d514545..7c83b9c982fbd13d8b2d31101de62718663cf9b8 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait double {
index 05f12fd089ad476c6dd9ca706ebcd96c42d57b3a..4096d45d8df8dfc2f18a97287520e87200b7852e 100644 (file)
@@ -8,9 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait Foo {
index 8c1a283a72d77b98e3909af7c7e858e104c9b262..91de734ec3a678b13cd1380cfed5483540e9a28a 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::cell::RefCell;
index 415988586a066f18f379df16afda7dbf54b363a5..36562fd0049284da178aa9b80e9a6640bd5fe300 100644 (file)
@@ -10,8 +10,6 @@
 
 // edition:2018
 
-#![feature(raw_identifiers)]
-
 #[macro_export]
 macro_rules! produces_async {
     () => (pub fn async() {})
index cfebc4abaaa6150d0c8689c82c5bb7368812b278..b3e0f06148593999ca861beba973a2fdc764f5e9 100644 (file)
@@ -11,7 +11,6 @@
 #![crate_name="a"]
 #![crate_type = "lib"]
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub trait i<T>
index ee7d45b77bf4d9afe9d7a361697b1acf5200e3a0..dee40b2fc573558641977edcf574eb99b991cfaf 100644 (file)
@@ -8,8 +8,6 @@
 // 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 348b71faf0cdbd39632ff5ab9c98a677571b6d6c..785a8b05664315e0092d2a8305eebaafc6c9351c 100644 (file)
@@ -10,7 +10,6 @@
 
 #![crate_type = "lib"]
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 static mut COUNT: u64 = 1;
index b67ec1b9bfc655e8014e923abbacc7f28d0df50d..3761d58087e0d06a9513ca48c4e4b1359a6d5d9a 100644 (file)
@@ -10,7 +10,6 @@
 
 #![crate_type = "lib"]
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 static mut COUNT: u64 = 1;
index 10e315f269f971af023e23a5148a1f72b90b96a0..0d0f1b3a482ea8423d9eac0b44fadf453a2737ae 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(core)]
-
 use std::any::{Any, TypeId};
 
 pub struct A;
index 10e315f269f971af023e23a5148a1f72b90b96a0..0d0f1b3a482ea8423d9eac0b44fadf453a2737ae 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(core)]
-
 use std::any::{Any, TypeId};
 
 pub struct A;
index 6462c11af481fe659b6b4e93059a56706fb7e156..836164a721a4603a1015adf2616a51ee710976b8 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 #![feature(staged_api)]
-#![stable(feature = "unit_test", since = "0.0.0")]
+#![stable(feature = "unit_test", since = "1.0.0")]
 
 #[unstable(feature = "unstable_macros", issue = "0")]
 #[macro_export]
index 7fdc65a96e238d3894ba661577ffe4fc18272f38..1d7230510df2baf65290a1e95189aff3e9b016f2 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn borrow<F>(x: &isize, f: F) where F: FnOnce(&isize) {
index d97564a29144fed9851cbd4ff33a40b2e741ca85..a465c9cf811aa4b83241c2ba5121d257708de56a 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct A { a: isize, b: Box<isize> }
index 158594df8cac01865530b8a7a8fa7eeef510475f..c3645867117d262fc31d92430fd45504a0f5e9dc 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index f535c5fcfc90463164adf28afbbc819dad149d9d..ec868bc5c85ef8ea26ddf782a6b04e2b876883bf 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::mem::swap;
index 7ad81b6be6ef54f44a6a44eb7831753ff4fb3ccf..8c94df6dbf454ee205545be4f4f83d4afa5f5d5e 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct A { a: isize, b: Box<isize> }
index 46b3fd1f1e746e0914993a167ddb09dc8ea36196..56a0437146b9ef542567abadb6e0e33d987a3474 100644 (file)
@@ -10,7 +10,7 @@
 
 // ignore-wasm32-bare no libc to test with
 
-#![feature(libc, std_misc)]
+#![feature(libc)]
 
 extern crate libc;
 
index d2eb5c33eae8087f14545317e94334367cfec071..ac309216250553f60bddbc77d12467c7cba6d58f 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn foo(x: &mut Box<u8>) {
index cd8f783a2e523ab2756e1414791ed09c11fa0c4b..1535ddfb4de0e47d0e9cefd1ec9c81eac1a12ccd 100644 (file)
@@ -10,7 +10,6 @@
 
 // aux-build:cci_borrow_lib.rs
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 extern crate cci_borrow_lib;
index e45f7c2bba66860ad255c82ebb8e591bb38c97b9..03c80e497410ef3e9b88a25196364cd948d2ceb4 100644 (file)
@@ -13,8 +13,6 @@
 // pretty-expanded FIXME #23616
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::thread;
 
 fn child2(_s: String) { }
index da51ad761c70a15db384c8ae3e606d94dffdd420..04c4b2cb37765842bd55d6a20a713dd5e2ab2ed8 100644 (file)
@@ -10,7 +10,6 @@
 
 // aux-build:cci_class_cast.rs
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 extern crate cci_class_cast;
index 52853658c825b2cd897d0d4e022150d6ed2beabe..343d414758cc0eef926bca878245cd0aff32f101 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::fmt;
index 58d7c1df19c13babfbac085258699c2b0ba66ebb..dd900c56b40b1109c006934a7b9637bc32c67734 100644 (file)
@@ -13,7 +13,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax, os)]
 
 use std::os;
index d813a6d8102360e8ea6ae31a9e0bffa251cf59ef..b117f4abd9572ed91b53bc93f6111d1b0882591c 100644 (file)
@@ -8,12 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
 // This test verifies that temporaries created for `while`'s and `if`
 // conditions are dropped after the condition is evaluated.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Temporary;
index c401b529c30d9e54794635931d1d8ae360cc3401..ae455d916b6f9fe984cee5af9e64ac1e6c1a4cfc 100644 (file)
@@ -26,7 +26,6 @@
 
 // ignore-emscripten no threads support
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::thread;
index 384fb92954de2fcca1ba8db6f22d9f3f3b085b1e..6ac7acd2a6b6821951b901f5bcf718f9fdec8816 100644 (file)
@@ -10,8 +10,7 @@
 
 // ignore-emscripten no threads support
 
-#![allow(unknown_features)]
-#![feature(box_syntax, std_misc)]
+#![feature(box_syntax)]
 
 use std::thread;
 
index 99fdc34602617bb2ecc7f77bd3a70c519a8c00ba..ba700e4e326515c55afc4f7afb5bc20f4ffa7998 100644 (file)
@@ -12,7 +12,6 @@
 // storing closure data (as we used to do), the u64 would
 // overwrite the u16.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Pair<A,B> {
index a074aea9caa5c35a47a7ee3100e20adea18dd01e..5a1953b563aa4cf04ce58967696f0e74f8b70b49 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::cell::RefCell;
index d7cb8bc991ada836f3497cd5d6984578cdae311b..7c78cbdce0853faa2ad58faac062ba40005613d9 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::thread;
 use std::sync::mpsc::{channel, Sender};
 
index 13118c48d6e95fc10f4dc926fa79d69748de8e14..eaec9b1926a20dc51211c17ff44969b11f0fb3b9 100644 (file)
@@ -16,7 +16,7 @@
 // memory, which makes for some *confusing* logs. That's why these are here
 // instead of in std.
 
-#![feature(libc, std_misc, duration)]
+#![feature(libc, duration)]
 
 extern crate libc;
 
index 028b3f43e2ae8ba44fea79ca1db254a471283600..c0bc97b1f659dc90ce1f94ac15d6c79af20509c4 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 // This is a regression test that the metadata for the
index fc97b22a4a99e3cedd167e1789ca91091854e4b6..0e65e5b43b732c60c57199e22c914741c578ca76 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::cell::Cell;
index 4722ddd64c8e4d561541826c6f6c2530f5bd52ec..0e6b3d87d345b43bc5a8b9dffaf024e1d72001d0 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 632ef5e0c8ad6b1eba099a638329304422b4a371..d3aaa3ded69d800a52079ec2441f94821f9a5a57 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(core)]
-
 pub trait DeclaredTrait {
     type Type;
 }
index c9e5b014da37ae16af1d7fb1c7b1326aacb23da9..70ac284cd30c9c0c804e484395ee3f65d9074b4b 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::default::Default;
index 18b2fbe015b425ee89c4c4cb87242fbf975a022a..ceeb42663965f1b3e24fa3b625de416569abee0c 100644 (file)
@@ -8,9 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![feature(hash_default)]
-
 use std::hash::{Hash, SipHasher, Hasher};
 use std::mem::size_of;
 
index 268de8ec55c9cda97023b9e3a74b68f11bdd628c..8dea648508d6deedc1efa62d705f5a6a6ebdaac9 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 enum t { foo(Box<isize>), }
index 33d5c72772c579e9597ee650298d9569967b1412..17603e11dddd99b501e0fe7f8270ea99c88a4487 100644 (file)
@@ -11,8 +11,6 @@
 // Test that destructor on a struct runs successfully after the struct
 // is boxed and converted to an object.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 static mut value: usize = 0;
index 912cb4c5e877500055966d9e39931e9ed4b0fa8a..a6027615adb5a8ea04d4af4b50543825054896cd 100644 (file)
@@ -10,7 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::thread;
index 34a187fa6f2d2ca66a5301c2858b2366fba8cfe4..6bda400a7cdbb6c3240b575e720ab325b4f4a1cd 100644 (file)
@@ -11,9 +11,6 @@
 // Test that overloaded index expressions with DST result types
 // work and don't ICE.
 
-
-#![feature(core)]
-
 use std::ops::Index;
 use std::fmt::Debug;
 
index 56199c1aa61fa5506586781cabcf4c68e6414fb3..40ca847278722a222cef5beea9016db44f79aebe 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Fat<T: ?Sized> {
index d8d7d9a28bfbdb5ffc8f12aa439e57b23a9903b4..a412306b96645dcba42b1615a3e31a14d184029f 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Fat<T: ?Sized> {
index 2f5b28495b8aed7c3d8b3b0745dadcbf57b18ec1..7c2125d00f9bab499670a992e7246ed55fe69484 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 #![feature(unsized_tuple_coercion)]
 
index 4c22667d0bf4302e9cf3de452cf3f592c404ea0f..7d5de00cdb8c2b3702555d5bc10d03dbdf691899 100644 (file)
@@ -11,8 +11,6 @@
 // edition:2018
 // aux-build:edition-kw-macro-2015.rs
 
-#![feature(raw_identifiers)]
-
 #[macro_use]
 extern crate edition_kw_macro_2015;
 
index 2a98b904da5dbedb716e7c4e2208bf5eb0343166..6462fc4da60a02125c45235ecf7577ec1508ffc8 100644 (file)
@@ -11,8 +11,6 @@
 // edition:2018
 // aux-build:edition-kw-macro-2018.rs
 
-#![feature(raw_identifiers)]
-
 #[macro_use]
 extern crate edition_kw_macro_2018;
 
index c8a1047cfa8180987a8da946a54673bc35405f23..b5db8d913204af4d8e09263db0dac616940d7f3b 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 /*!
index 9bbff1eeb81f3870004c02c6fe90cfce2577661b..e92f24a27519e8d6bfcb3c4dc5bdd148953c5fd3 100644 (file)
@@ -11,8 +11,6 @@
 // ignore-cloudabi no environment variables present
 // ignore-emscripten env vars don't work?
 
-#![feature(path)]
-
 use std::env::*;
 use std::path::PathBuf;
 
index 1b50d3028b1e254e6870e5607d08593691008cd9..d2274ced55610f282a5be7d7c64384d43a3a077f 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 #[derive(Copy, Clone)]
index 4021ae89e3629fc7bea5585ab7863f7bacfcb96c..bb7e612a9f2a788fbbfe2a2685abb1d63a523be4 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait Foo {
index d2a0d60eb661447ab42d0aa6ddabaecbd53ad4d1..11711e6ab74be939f30de60f60c26c340e0ea2d3 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 static tau: f64 = 2.0*3.14159265358979323;
index 1654c87c6a484dc418bbf528f60491f844f450f4..304f1c7a2eacd72db6bc51982a2bc3e940a43478 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn test_generic<T, F>(expected: Box<T>, eq: F) where T: Clone, F: FnOnce(Box<T>, Box<T>) -> bool {
index 5477a9227aa1d30d55f828fccb2d8b237074ef63..af3f5547867a1294e154260c3e536c31d7e6f7d8 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn test_generic<T, F>(expected: T, eq: F) where T: Clone, F: FnOnce(T, T) -> bool {
index eb24d70de90f6c5d6fa14c503bb70723f941f90d..2426ee5966c9f5961bd96648c70d11b294cb9efb 100644 (file)
@@ -8,9 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() { let x: Box<_> = { box 100 }; assert_eq!(*x, 100); }
index 12000fd54e7e73365a33bf20c1b1b6a3e62200bc..a8547536603adecaac28b186f6629488f09f50a1 100644 (file)
@@ -8,12 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
-
 // Tests for if as expressions returning boxed types
 fn test_box() {
     let rs: Box<_> = if true { box 100 } else { box 101 };
index 738fcecb2e0db96f00fe3d652cdea1b4903280e8..3fce798c285c0ad1627c70d0d86f544c10ff336f 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn test_generic<T: Clone, F>(expected: Box<T>, eq: F) where F: FnOnce(Box<T>, Box<T>) -> bool {
index 88ea2415241093016478d137fc0522a75758326e..5500edcf239f50ee319a5d22270a87d9dc51c4e6 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn test_generic<T: Clone, F>(expected: T, eq: F) where F: FnOnce(T, T) -> bool {
index e752c20a5124251cf240f6731298266d8a99059e..e66f09c63ea4bcd0cf4a936c18fc475888ad6598 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 // Tests for match as expressions resulting in boxed types
index a27474dcf866a1669bcf24c633d63184a53ff2fe..a29ea377947c794b43b9c5bb7eb210ea93a4f1ad 100644 (file)
@@ -14,7 +14,7 @@
 
 // ignore-emscripten no threads support
 
-#![feature(libc, std_misc)]
+#![feature(libc)]
 
 extern crate libc;
 use std::thread;
index ab8e4fbedcff7c22436db3c341816a4fd6e9b287..fd827efbfdd440a0b2f17ed65ab5566d3ef98e36 100644 (file)
@@ -10,7 +10,7 @@
 
 // ignore-wasm32-bare no libc to test ffi with
 
-#![feature(std_misc, libc)]
+#![feature(libc)]
 
 extern crate libc;
 use std::ffi::CString;
index e6ac8b52c51855c6f3e43826b402ab33f444cce1..efd7f66e93b837d92e73ccc3aaca2c7542ebf625 100644 (file)
@@ -11,8 +11,6 @@
 // Issue 4691: Ensure that functional-struct-updates operates
 // correctly and moves rather than copy when appropriate.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax, core)]
 
 struct ncint { v: isize }
index 6030da44e4ade6982dc4c3238ea3e91c5408b7f1..7d9501879d0a9be06a6ab6c690144e89b699f6e4 100644 (file)
@@ -11,8 +11,6 @@
 // Test that we do not leak when the arg pattern must drop part of the
 // argument (in this case, the `y` field).
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Foo {
index ab565e7abcaceda8e3feb9c385a828f716bfe21e..5214f2d02f51d9398d9f78b989a358d82dfde96e 100644 (file)
@@ -14,8 +14,6 @@
 // boxes. Make sure that we don't free the box as we match the
 // pattern.
 
-
-#![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 
index 6cb975a9560b9403cb726ea043dee7744eaf7bb9..476cb48c0d2ee7af5169b9616a3b425bb83f5f12 100644 (file)
@@ -23,7 +23,7 @@
 use std::task::{
     Context, Poll,
     Wake, Waker, LocalWaker,
-    Executor, SpawnObjError,
+    Spawn, SpawnObjError,
     local_waker, local_waker_from_nonlocal,
 };
 
@@ -42,9 +42,9 @@ unsafe fn wake_local(this: &Arc<Self>) {
     }
 }
 
-struct NoopExecutor;
+struct NoopSpawner;
 
-impl Executor for NoopExecutor {
+impl Spawn for NoopSpawner {
     fn spawn_obj(&mut self, _: FutureObj<'static, ()>) -> Result<(), SpawnObjError> {
         Ok(())
     }
@@ -59,7 +59,7 @@ fn poll(self: PinMut<Self>, cx: &mut Context) -> Poll<Self::Output> {
         cx.waker().wake();
         cx.waker().wake();
         cx.local_waker().wake();
-        cx.executor().spawn_obj(PinBox::new(MyFuture).into()).unwrap();
+        cx.spawner().spawn_obj(PinBox::new(MyFuture).into()).unwrap();
         Poll::Ready(())
     }
 }
@@ -70,8 +70,8 @@ fn test_local_waker() {
         nonlocal_wakes: AtomicUsize::new(0),
     });
     let waker = unsafe { local_waker(counter.clone()) };
-    let executor = &mut NoopExecutor;
-    let cx = &mut Context::new(&waker, executor);
+    let spawner = &mut NoopSpawner;
+    let cx = &mut Context::new(&waker, spawner);
     assert_eq!(Poll::Ready(()), PinMut::new(&mut MyFuture).poll(cx));
     assert_eq!(1, counter.local_wakes.load(atomic::Ordering::SeqCst));
     assert_eq!(2, counter.nonlocal_wakes.load(atomic::Ordering::SeqCst));
@@ -83,8 +83,8 @@ fn test_local_as_nonlocal_waker() {
         nonlocal_wakes: AtomicUsize::new(0),
     });
     let waker: LocalWaker = local_waker_from_nonlocal(counter.clone());
-    let executor = &mut NoopExecutor;
-    let cx = &mut Context::new(&waker, executor);
+    let spawner = &mut NoopSpawner;
+    let cx = &mut Context::new(&waker, spawner);
     assert_eq!(Poll::Ready(()), PinMut::new(&mut MyFuture).poll(cx));
     assert_eq!(0, counter.local_wakes.load(atomic::Ordering::SeqCst));
     assert_eq!(3, counter.nonlocal_wakes.load(atomic::Ordering::SeqCst));
index b8d7c2140be6fcb5caf82718c0d27915a3a2018d..c4fd31196153158d80682e34c9a8996bc322f580 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn id<T:Send>(t: T) -> T { return t; }
index 8dbe6de83886919e00728df07f3b24545d6ddfe2..64091d2926c97714c33a09d30d5bfd54b1f955c3 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Recbox<T> {x: Box<T>}
index 67aea1f9f8ae8e8f48d7b6545bc0a40daa9635a9..debe3706891ce1a129aff75f2e1bee58c05aedc5 100644 (file)
@@ -8,9 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![feature(core)]
-
 use std::ops::Add;
 
 extern "C" fn foo<T: Add>(a: T, b: T) -> T::Output { a + b }
index 6599aa7412467bb501b14e625267b9648b65d149..3585cd2e0797d7954af2dc2d18ec326221a41ecc 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn f<T>(x: Box<T>) -> Box<T> { return x; }
index 0a59a925a5ff6cf815b56e2dc62911f8b4d5fb9c..7e737fe00afd4fa77accae075d3e0a5f4bfcaf8d 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait Foo<T> {
index 433bd7cd906ec3fb52bc0720f9f7daf6baa590b5..ca2bf0ac224594bfdaefbc09eb61a1b47e0f36ca 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 enum list<T> { cons(Box<T>, Box<list<T>>), nil, }
index 75fd9fcb7b6d835e369504deecdc55a28e8afde0..a79465c8cd86034f2da4ba2a7af53b2bf9d4b08b 100644 (file)
@@ -12,7 +12,6 @@
 
 #![allow(dead_assignment)]
 #![allow(unused_variables)]
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 enum option<T> { some(Box<T>), none, }
index 21e9a9a80d0aedf65139e0605130a15ee191ba6d..1b1355ea336a6d196c9666a4f642293b4dc88d8d 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Triple<T> { x: T, y: T, z: T }
index bd90ce683c45202dc8b468a2d4ea25d874a71eaf..2e98e0fe5ca3d24a3b5547ad89bff219576b5427 100644 (file)
@@ -10,9 +10,6 @@
 
 // ignore-emscripten No support for threads
 
-#![allow(unknown_features)]
-#![feature(std_misc)]
-
 /**
    A somewhat reduced test case to expose some Valgrind issues.
 
index 516278df178eb5eb11e8469f9045647a6d776b49..511d32348576e2c98769e25bc3e6f4cc9766845b 100644 (file)
@@ -10,8 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
-
 // Test that `Fn(isize) -> isize + 'static` parses as `(Fn(isize) -> isize) +
 // 'static` and not `Fn(isize) -> (isize + 'static)`. The latter would
 // cause a compilation error. Issue #18772.
index 2ff024a693aae4f4f0d609045a0200b78d86a21d..c8f9a0e4cab6d9b7e07c593c163fea185c892ab8 100644 (file)
@@ -15,7 +15,7 @@
 // pretty-expanded FIXME #23616
 // ignore-emscripten no threads support
 
-#![feature(intrinsics, std_misc)]
+#![feature(intrinsics)]
 
 use std::thread;
 
index a675528424ed23f810a5a1d56324604c42e6d80c..4b11158e8c3d1c8926cc3faf9c3502c85f2c9277 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 #![feature(intrinsics)]
 
index c049bdfe83cf142216dcdc8f535e0aec49b0b2f9..67b73bdadbb62b86aa0404835b5c3108eb566025 100644 (file)
@@ -13,7 +13,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn work(_: Box<isize>) {}
index b5ef6020b57d0fdcfa6755f1014df5c34b197e6a..2184aa00fa409ef03206ef7a8d858cdc62c113fa 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 2256315a379ae60a4f299215f703ab5de10e7ff6..1e700d4e18b270c79eac8d7a7a8fc915bc17fcaf 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct DroppableStruct;
index 5193330a45a3612b3ddc9a5b6aec3cc551121d4c..aa980e48c5ee74be0c1ca4f08d800dacdac85b5a 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 
index cca27aebfa44fbb7b7f16026ef854db5d3a1187e..634046e86ee6c45969f41bb73f731bd6678b4a8f 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(libc, std_misc)]
+#![feature(libc)]
 
 extern crate libc;
 
index 264db106491a44c28cbd9cff4570c701888a17b5..36036ae241e2105c6092038df08403f20722d0b7 100644 (file)
@@ -11,8 +11,6 @@
 // ignore-cloudabi no processes
 // ignore-emscripten no processes
 
-#![feature(io, process_capture)]
-
 use std::env;
 use std::io::prelude::*;
 use std::io;
index 68c6ce7a7b7ba40332e69726db7501921f2823a6..de72d7152f8ec8bebb1cf4d007a0d10f11a9c4b3 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct StrWrap {
index aa91f125e48e276a2e52729759d277518a4bc4ef..d5c67bea099f54af25f9f40c9a84225789e0a299 100644 (file)
@@ -15,7 +15,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 #[derive(Clone)]
index c4745a6e1f1ff5d6b33bbc3a18a189f78139eef8..601fafbf02eb9edac8dc8f93fd464a9bf25dcf35 100644 (file)
@@ -11,8 +11,6 @@
 // ignore-cloudabi no processes
 // ignore-emscripten no processes
 
-#![feature(io, process_capture)]
-
 use std::env;
 use std::io::prelude::*;
 use std::io;
index 3dc76f4a089d9a50114b79b3be8ebcc38ce3f58d..35915a62102d389828354c4a987b30f3ff3bfb73 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn match_on_local() {
index daf14b4c2ffc4e0c33ba335c092ef7c3d869e4f7..5a35239cf72d25c1cb347afcde8fba58cd5a07bf 100644 (file)
@@ -11,9 +11,6 @@
 // If `Index` used an associated type for its output, this test would
 // work more smoothly.
 
-
-#![feature(core)]
-
 use std::ops::Index;
 
 struct Mat<T> { data: Vec<T>, cols: usize, }
index 0baaaac26768571ca91c8d118794d0bb2a4d5c50..e1176d470636c6c24fb2c7b88ae1f2c90e86d6c4 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 #[derive(PartialEq, Debug)]
index 5613211b31df427f85c18940b2fc04e81f013a0d..7944e80a42860fbe6a7b238c1634236b5fba276b 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
-
 struct Parser<'a, I, O> {
     parse: Box<FnMut(I) -> Result<O, String> + 'a>
 }
index ca2b9209eba51db81c8f299945d34c50fe02e427..2bdedfebe3e99f6857fb669dd2dab9527e71c401 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 #![feature(unboxed_closures, fn_traits)]
 
index 9ec5910c2f67938c79803351a73c0d8816a0de94..1309d2ffab8e05abca5c478f1e27073d2aaac193 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 #![feature(box_patterns)]
 
index a9f5476d0f86c758350057a9ec9ed57f777f1107..c94345f794d17c1dac055808dbaf9ebad834cc8c 100644 (file)
@@ -10,8 +10,7 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
-#![feature(box_syntax, io)]
+#![feature(box_syntax)]
 
 use std::io::{self, Write};
 
index 6e93194647ad2c8aea38bbfa4e80361f5100b485..88f83a300a785eeb3e7b9a57a2a44c7352e4547a 100644 (file)
@@ -10,8 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
 trait Str { fn foo(&self) {} }
 impl Str for str {}
 impl<'a, S: ?Sized> Str for &'a S where S: Str {}
index f84cfd232f2dff1b667a8ebb15abc02ecab3155a..7671b43d493e1b2440c5e9c96d714907df554b74 100644 (file)
@@ -11,7 +11,7 @@
 // ignore-cloudabi no processes
 // ignore-emscripten no processes
 
-#![feature(std_misc, os)]
+#![feature(os)]
 
 #[cfg(unix)]
 fn main() {
index 522f544a21c1037c87e89c7142c8ecb8d2a31efd..15cb79ac6a86f5dc65200579de8517d4f79eb99b 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(std_misc)]
-
 use std::thread;
 
 fn _foo() {
index aa784ba432cd99fe1728b1fd6731ea1707507109..51896786d0c35a73fac35bd97d0e8f22d8ba3c5d 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(core)]
-
 extern crate core;
 use core::marker::Sync;
 
index 8538950a895c2cc8a969966be6ca95f6b146a041..895b9d222a8565e0599734a9fb98c13ba007edbb 100644 (file)
@@ -10,8 +10,6 @@
 
 // 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 ec4be812f9a23ed57d8030937ff12ed13cf8e53a..83ffdb3bf4424419b80f9aa57e5d0e1fb2babebf 100644 (file)
@@ -11,8 +11,6 @@
 // pretty-expanded FIXME #23616
 // ignore-cloudabi no std::fs
 
-#![feature(fs, net)]
-
 use std::{fs, net};
 
 fn assert_both<T: Send + Sync>() {}
index 379715f539039a0089ad4460c52a323861f757d4..b8353ea4413669857ff9769e17c2d548a3ae95e4 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait clam<A> {
index 7b5a055d33435de68f6a0745a99c96cb2fe5ea69..b955947c4101bc00569aa9274f6ffa0ec6f5e36d 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 
index d3916db3f755b6bdf75b2606ddf5429cbb1f842d..cf565b9f901975ea8e2afe37e8357dd26f775b06 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Font {
index 2da2f1e82a693310fed1887fe42eeed042ea4fa3..d59f2956ee4027614e973b5840c143f0edbbdcac 100644 (file)
@@ -9,8 +9,6 @@
 // except according to those terms.
 //
 
-#![feature(std_misc)]
-
 pub type Task = isize;
 
 // tjc: I don't know why
index 18cd9a87e6b05418fbf0ce1bc0427067e360c7b6..916e3dd689fcf84ac589db22a52cd6a8386d0ec3 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait hax {
index cd6c6a59e2a6c2d30ff530820cf4404c6449442f..af8eef557f821b4e43fb7adb592927b0fcb285b3 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait hax {
index 511344a792f46c43a05d3040bd7718a684153272..b2ea183e9f8787f212d2ab2678040b4e29a23c2c 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 //type t = { a: isize };
index 6e9ee7fb15c34620e6445dfe9f3463f89e6551fa..a0bdcf18ec520f56c557353bdbefef30cd509867 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 #[derive(Copy, Clone)]
index b09820146f5b84b671ae323fb5299840b065e739..6c775e15fb56ec8e2adbc82077e56b0b53b0843e 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 12c2155dd57a7f858e30e9ac947a9a668a90d356..1558d94bae79914af08c8dae1a30045a76165238 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::cell::RefCell;
index ecee2fd0faaca04542198f0c8baa8f6bad57eda8..56208d08779cb56ca8f5da6c06baa62913c9e931 100644 (file)
@@ -22,8 +22,6 @@
 // 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 d1bf7e066cb5ae098c067bfea9e95cbb56941c78..f53053f2edcb778ecb729977e897fbd50004880e 100644 (file)
@@ -8,9 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
-#![feature(std_misc)]
-
 use std::thread;
 use std::sync::mpsc::Sender;
 
index e81025d8464507b1cd5ffc55b89d781062a3ca4f..e6eb8efe442f3d88d3c4cd8dfa86287ebbfa42f4 100644 (file)
@@ -12,8 +12,6 @@
 // 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, Clone)]
index 3d5f38e38cc56e37e0534ab644a8938e0c7e1b1d..badb833ee800bca94c2420c3dbf2b66e97d3fe29 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait T {
index 33604212af9516c0357c7e7d6b1a53cfaa6ffb6d..dd9f9be7da713de4bfa956db02e81f85c161a843 100644 (file)
@@ -15,7 +15,7 @@
 
 // Need -Cno-prepopulate-passes to really disable inlining, otherwise the faulty
 // code gets optimized out:
-// compile-flags: -Cno-prepopulate-passes
+// compile-flags: -Cno-prepopulate-passes -Cpasses=name-anon-globals
 
 extern crate issue_38226_aux;
 
index 5d094af2149e13082526f363ba750a60589bfc92..e0e11b4fd865019e18835f5c6ec4a662595ca0e4 100644 (file)
@@ -11,7 +11,6 @@
 // pretty-expanded FIXME #23616
 
 #![allow(path_statements)]
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 48753e15a705d2775d00a2b951ee9f844a423c29..a84d7f3fe8287b2bf2da25f23ccc1a7d0c2ff050 100644 (file)
@@ -10,8 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![feature(io)]
-
 use std::io;
 
 pub fn main() {
index a26d6b05d7ee7ad8a8b8600008bd51da636c48fa..7788a8f3ec2332c76719924040af56460dd62ad7 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct T { a: Box<isize> }
index d8f7f25508dd8aa0fb1c10f9609a7765bca337b4..0758ace42da9055e9a441b5cbddd51a73887baec 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub trait EventLoop {
diff --git a/src/test/run-pass/issue-52169.rs b/src/test/run-pass/issue-52169.rs
new file mode 100644 (file)
index 0000000..f216341
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright 2018 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(macro_literal_matcher)]
+
+macro_rules! a {
+    ($i:literal) => { "right" };
+    ($i:tt) => { "wrong" };
+}
+
+macro_rules! b {
+    ($i:literal) => { a!($i) };
+}
+
+fn main() {
+    assert_eq!(b!(0), "right");
+}
index e28a929d527238c43773aba6bf2f3444622ae543..eba83227f449b4c829fdd1d2faf6ea497557044e 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Dog {
index 964809631d9cdc1b82287df666f83b7513a3988e..0bc9a07cb002379f86ea24e4c544b5d7e07b4bed 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Element;
index 2096bebd2b2d3c50126055b32ff7da1b86a45857..c3247876c7ab9f6a148a68b43fecaa62d3e9016f 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub struct Foo {
index 12b71f519b1e62a59088ac15a1f50ec6a4fd5538..69c7ec4cf1f8ade1e448c8ae264339f4353ff185 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub enum Thing {
index eba87f418e48974c16e13afc6e7e3ce88fa3112e..109383b343bf8977cbf3d0c327177e0cf8103390 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 
index 43b5a997c19a523762fcfaaecfce957bfb4bb3dd..f5acebf3a66fae69323e1ec0e37bb3304f6ccbd9 100644 (file)
@@ -16,7 +16,6 @@
 
 */
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {}
index 6e01131cfcaa41562f0789af8f3161bd08bdc679..6b573698a36002738f53face68f4472940900963 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::thread;
 use std::sync::mpsc::{channel, Receiver};
 
index a9f29fdb38cafd07165acb691a3944e0148feda3..485f10357b3f329b187a54ba16e85f9514fa8082 100644 (file)
@@ -10,7 +10,6 @@
 
 // ignore-pretty unreported
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub trait bomb { fn boom(&self, _: Ident); }
index fb7ffdcd515bb4a7370e1191cefbe2e700cea4ca..7538e55fd95df6af2eab19af5d1d10dc9880324d 100644 (file)
@@ -11,7 +11,6 @@
 // except according to those terms.
 
 #![allow(unnecessary_allocation)]
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 // Tests for a previous bug that occurred due to an interaction
index a511db8e9397dc718a9aa55934f0c088a642b29b..0da1d18afd8efed4e1d9c7efe4e35a7b6a0f11a1 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::thread;
 use std::sync::mpsc::{channel, Sender};
 
index a81c0846a279489534080fc789c3cb7ef5509040..1c5d8a69bf3406a9a7eb7d9f9ddea8376f6fba87 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(std_misc)]
-
 use std::thread;
 
 fn user(_i: isize) {}
index 9df72f4760a1f9d51cef0f9ee3eaa62d04be25ca..9b56666fd464cd68eae2ee49394589053e88a38b 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait repeat<A> { fn get(&self) -> A; }
index 35a17150787775ce9f3fa79ed3aa297119786d01..cb2a2061406a243d9928d439c9fccb92d1ec6a98 100644 (file)
@@ -10,7 +10,6 @@
 
 // Make sure #1399 stays fixed
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct A { a: Box<isize> }
index 30838b3121a95692c2bb250fd68211a0c8f40849..d89888927e1bdef212b0f04fa925e7388e4aa3b9 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn leaky<T>(_t: T) { }
index c53bc83ef6b7862f24d085654bdac7987ca37683..69b0eab99f71f5c5cf15d861d7d55302b59e1c12 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn f() {
index 8f0cbf96b604999aaaf7baaf0657622821b837a8..37612415555099880cca736a9bdb71aa99168693 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 enum list { cons(isize, Box<list>), nil, }
index caf76b3ab2fe177e8ef538334ff3edeba5595b9f..10de6eeabddaaf278d0e100855e2e18d9774b378 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Pair { a: Box<isize>, b: Box<isize> }
index 78b02d709e2929d15b84e4aaf4194a1d195d9732..ca864c05cfdc8f6ce1b08cb89984bfa833df06dc 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 
index d4f4f3bb27eac8b247993d8d59985dbd837fc565..ab56a8cfc9392e781fff1f993869eb9ef2891430 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn foo(x: Option<Box<isize>>, b: bool) -> isize {
index e7615711b4cfdb66c06b2fd472846326856caf5c..2572baf68fd12e35e3015384e9cfb1ba975a4fe1 100644 (file)
@@ -10,8 +10,6 @@
 
 // Test method calls with self as an argument (cross-crate)
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 // aux-build:method_self_arg1.rs
index 0a1efc96fcfee5a4e7c58ed0b21a45a3d695b2ca..51de69ff01f0fb422dc38e55f4b58a942b5f9ef8 100644 (file)
@@ -10,8 +10,6 @@
 
 // Test method calls with self as an argument (cross-crate)
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 // aux-build:method_self_arg2.rs
index d93cf2b0983ee85730c68881730d0323d508f582..34e849bd0d2d85965018eca62e2f971184347c80 100644 (file)
@@ -10,8 +10,6 @@
 
 // Test method calls with self as an argument
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 static mut COUNT: u64 = 1;
index 4361c9b05635c74affb1f005f2692ce98c68f9e4..b7fb2fa138da902a65585013b17f81ec0f24ea66 100644 (file)
@@ -10,8 +10,6 @@
 
 // Test method calls with self as an argument
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 static mut COUNT: usize = 1;
index 82d747b6c27a1e6ae9485a2a978cc9794cefab04..f403f5260395038ec4c888cbc62e105e894c4783 100644 (file)
@@ -19,8 +19,6 @@
 // codegen the call as `Foo::foo(&x)` and let the specific impl get
 // chosen later.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait Foo {
index 77072bdec905190cb483a1cacd74e29c7fa49c36..3f0f4f357453419e28e6a7eba12da47cbb63df20 100644 (file)
@@ -13,8 +13,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
 trait A {
     fn foo(self);
 }
index 34a3bdf876538b912483bad8040dc8232e515c13..5c8dd41c6466383a6263a8cf4c7657a37644ac29 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 #[derive(Clone)]
index 2babf19e164784ec6d5c9c62607ba694f3e969ed..0b67e54e234580726bf1a5dec34ca17e95fd9305 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct X { x: isize, y: isize, z: isize }
index 926e28ed155f55c77688c564ad8b1ff5245458b9..0fbc2de91e6cd3f66144a43b8501136c8bae381f 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct X { x: isize, y: isize, z: isize }
index 360593ffe4882dacbd29ee00e00ba8aedae944e5..36ad3a40b3f56b881e722f59f7a6def4b0a15429 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 #[derive(Clone)]
index 153da8e1339a6f56fd3edd1125c6be75a1e45ee7..266e34c98a40d767c52b2d985608a910983513b6 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Triple {a: isize, b: isize, c: isize}
index 1346860d51d7bed5e6b9dc3e9d09bf101b68a1ce..481068869e34d48d4d976731743130c0f0352c9a 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Triple { a: isize, b: isize, c: isize }
index 0ff5a66adc269c4efc80977afedd111e5b141ef1..b6e225cc8b73e8f683562e4d912db6ac57c5e6e9 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn test(foo: Box<Vec<isize>> ) { assert_eq!((*foo)[0], 10); }
index 8de487bc3631ce105dea5f93ec7ced741a72c108..78774854c9f1606ea67a0540c100e27db1e0997f 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn test(foo: Box<Vec<isize>>) { assert_eq!((*foo)[0], 10); }
index d3c028070fd143cfd97a1ee515c44df5ef42df62..548a62f4603de67c320ec0dc488ca0079206c2b2 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::thread;
 
 pub fn main() {
index 010f656d53141521cbead35054a0d0abd5b3b1ca..bf4d4ea921aa58209eb468925589bad3e7f08199 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn f(mut y: Box<isize>) {
index 17f71c3de432fce4273e6721a5140dbae0d9a790..d6881ea90afb6fbe3f4003b2589b298e6a3caaf5 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn f(x: Box<isize>) {
index 7e8d082a286a8991bfcc9c7b32916b27486875b9..d33102a38f96e4b3b5024c756d91d65080be2f17 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 // Iota-reduction is a rule in the Calculus of (Co-)Inductive Constructions,
index aa2dbf03bb2c4f69cb84cba5d14ee941818f52e1..284beccdb29566d54dabebfca93b37ce38aa17a3 100644 (file)
@@ -11,7 +11,6 @@
 // Testing creating two vtables with the same self type, but different
 // traits.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::any::Any;
index 768f126e4edfe2d1b102c99b6ec8e4d5767c225a..c27bc62ada803e19e7949f8abe16ec902b64bab7 100644 (file)
@@ -12,8 +12,6 @@
 // closed over do not contain managed values, and thus the boxes do
 // not have headers.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 
index 71ed995e76c8200ac0e4e0c116eef465b0370224..5d9658dc15d63aed48680e7094b591fc8d9f4776 100644 (file)
@@ -12,8 +12,6 @@
 // closed over contain managed values. This implies that the boxes
 // will have headers that must be skipped over.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait FooTrait {
index 045af79189acd36cb74f4200a8011bfd76b055de..c3a1164ba9c6af2e1c229e7e2311fefe822bb09e 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(core)]
-
 use std::cmp;
 use std::ops;
 
index 4c3017c066e81b313521fc8da64cba10c9461be1..2171b8c481d1fd7c24b7f4f882437ba67534bf1f 100644 (file)
@@ -12,7 +12,6 @@
 
 #![allow(dead_assignment)]
 #![allow(unused_variables)]
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct A { a: isize, b: isize }
index d9ffbe51aa59631a97934bb768366ca28e92c50b..759e2aace6104b3be5f38777195270b00c72084e 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax, core)]
 
 use std::cell::RefCell;
index e0f61fd84974ae1ecf207b8792346d34be77b14d..50140d1aab9da1316726afff77eb1c9d79ebf4c0 100644 (file)
@@ -11,9 +11,6 @@
 // Test overloading of the `[]` operator.  In particular test that it
 // takes its argument *by reference*.
 
-
-#![feature(core)]
-
 use std::ops::Index;
 
 struct AssociationList<K,V> {
index efa0051493414f31e772512f8cc86f35088f7d9b..9988599d59dcc8392407c98051d68f1f736e1c1c 100644 (file)
@@ -10,8 +10,6 @@
 
 // Test overloaded indexing combined with autoderef.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax, core)]
 
 use std::ops::{Index, IndexMut};
index ff867e76810a6876c4d3a512d59c2b3cc0a40fda..7e2b586631dce84758e01b4fe518767348a69229 100644 (file)
@@ -11,9 +11,6 @@
 // Test using overloaded indexing when the "map" is stored in a
 // field. This caused problems at some point.
 
-
-#![feature(core)]
-
 use std::ops::Index;
 
 struct Foo {
index fa3c107697e6790662086e4123c47d86cc8e6188..b54a18f722a729eb2a827f6bc56a8e1c6806181d 100644 (file)
@@ -8,9 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![feature(core)]
-
 use std::ops::{Index, IndexMut};
 
 struct Foo {
index 8d692f2241bc79171b1fa139a356788704f18d8e..e2de795bdb72b315af722e2bbc6d6373fc6cec0a 100644 (file)
@@ -10,7 +10,7 @@
 
 // ignore-emscripten no threads support
 
-#![feature(panic_handler, std_panic)]
+#![feature(std_panic)]
 
 use std::sync::atomic::{AtomicUsize, Ordering};
 use std::panic;
index 311310712df8360096fd7cac349c3dd55cd9d699..f0c50f842ab3c55fc4596971bf87244f0071f596 100644 (file)
@@ -7,10 +7,11 @@
 // <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(panic_handler, std_panic)]
 
 // ignore-emscripten no threads support
 
+#![feature(std_panic)]
+
 use std::panic;
 use std::thread;
 
index 81da13afaa59e6b49c6d6a87174b896a3e14f6c6..120483ab336ffbf8ed1ab595c1faca2c55cfc76d 100644 (file)
@@ -7,7 +7,7 @@
 // <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(panic_handler, std_panic)]
+#![feature(std_panic)]
 
 // ignore-emscripten no threads support
 
index 0210017b47efb63f20519c12d648a24777f4f353..cc2cfb6be969bc7ef6b632f15b40dd55a079c170 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(panic_handler)]
-
 use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
 use std::panic;
 use std::thread;
index 6917c2db3b47df5957752d4350752025a8a4dd31..731603606e426fc68dd5d06849902237b35eb80e 100644 (file)
@@ -13,6 +13,7 @@
 // no-prefer-dynamic
 // ignore-cloudabi no processes
 // ignore-emscripten no processes
+// ignore-macos
 
 extern crate exit_success_if_unwind;
 
index 3a3b86aec02a010e2f7125458d65a42c5b856515..4692ad3ca2f1d942362934c71e8176e042181306 100644 (file)
@@ -12,6 +12,7 @@
 // no-prefer-dynamic
 // ignore-cloudabi no processes
 // ignore-emscripten no processes
+// ignore-macos
 
 use std::process::Command;
 use std::env;
index 71e35e41fc04668f2f0f18c837b1cc8dd26bc11e..9f5407e4526a52b29499873faf616cd31ef83b17 100644 (file)
 
 // compile-flags:-C panic=abort
 // no-prefer-dynamic
+// ignore-macos
 
 #![feature(panic_abort)]
 
 extern crate panic_abort;
 
-fn main() {
-}
+fn main() {}
index e3c2b448ce067b8f6dabd05c03a69c4e1feedb21..27b9eeccbeb14d130aba5282154a69b79ce62388 100644 (file)
@@ -14,7 +14,6 @@
 // ignore-bitrig
 // compile-flags: -C codegen_units=2
 
-#![feature(core)]
 #![feature(iter_arith)]
 
 mod a {
index c27b95e1f135d5e533c18d299af18041989ffac5..3313196a5eced2a8bb17bcf124adc5b11be4a2b4 100644 (file)
@@ -12,7 +12,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn sums_to(v: Vec<isize> , sum: isize) -> bool {
index 6e9769ea2b9282a8037ee21d99d6f102b30db4c6..bc869113fe90000e5be3114e827c9693ad823c74 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait get {
index 3b4b458bb0477508081a4d36cb0f1e157812ef81..61ef386442bb91da051a77faee29950aa3f1d59e 100644 (file)
@@ -13,7 +13,7 @@
 // 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(heap_api, allocator_api)]
+#![feature(allocator_api)]
 
 use std::alloc::{Global, Alloc, Layout, handle_alloc_error};
 use std::ptr::{self, NonNull};
index 83a82041af937d9590b3c0bb7766b8b4aae0273e..abebb670e65d2cd76c19c005840a95ca38223daf 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn foo(x: &usize) -> usize {
index 2a08940dab6edc82b8b7714137a5e91180484b8c..48b09b338511810c93d210db24630a26eb2ccde6 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn foo(x: &usize) -> usize {
index d048633519ae155c78d59bcdde9f4e32cc9e67ac..4a24e201b3538bc3c97b39d8dc82289fd156cf75 100644 (file)
@@ -11,8 +11,6 @@
 // A test where we (successfully) close over a reference into
 // an object.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait SomeTrait { fn get(&self) -> isize; }
index e9a3e16438f818feca218f9a7b5ee0542ad985e1..c8b39bbe74994bf0cd475248fbcc92ea686a7024 100644 (file)
@@ -11,8 +11,6 @@
 // Test lifetimes are linked properly when we create dependent region pointers.
 // Issue #3148.
 
-
-#![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 
index 86fcfb9e6dd89d1287395b070d6b1888cd3527e4..75c209a09207018e9556f481e1c444b82415e517 100644 (file)
@@ -11,8 +11,6 @@
 // Tests that you can use an early-bound lifetime parameter as
 // on of the generic parameters in a trait.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait Trait<'a> {
index 597333482fde35b9a19440eb02685444ebcfe40b..7cb719cccced81e7a5620c33e16e4c30592d252c 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn foo(x: &usize) -> &usize { x }
index c7a4accff85e12ad7853bb427bbf29bbbcd84ce2..f762b4f41ed40076e9a4f1506af339a814eb6ddb 100644 (file)
@@ -14,7 +14,6 @@
 
 #![allow(dead_assignment)]
 #![allow(unused_variables)]
-#![allow(unknown_features)]
 
 // Should pass region checking.
 fn ok(f: Box<FnMut(&usize)>) {
index a89f6f4a7b56b8a5f2dd6fc0267a02d3ac994842..a40ba8382fc2b3af300151dd766e0f4e5a8ffbf1 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn borrow<T>(x: &T) -> &T {x}
index 01f41637311459f89d7bd176d393c2ca6cd743e6..72208272df75ab8d9091b96047e0346a7fd8aa51 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Point {x: isize, y: isize}
index a2c07d27288d23f074ddd868ad48075f7f4f825e..2a20cd2b773c3acfa13a541af28068afd1828abc 100644 (file)
@@ -24,7 +24,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 3162ef54f39bcad6799c07ba4706b8de9589d067..3322fc36fd3a40655cb200bc52ab4060b0b4a0b2 100644 (file)
@@ -17,8 +17,6 @@
 // changes were caught. However, those uses in the compiler could
 // easily get changed or refactored away in the future.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Ctxt<'tcx> {
index dfa583415f7b64cab475b27d851fbc3b142bc72e..93384b81e4aa7687f8b71afc9df4e6fc7439113a 100644 (file)
@@ -11,8 +11,6 @@
 // aux-build:xcrate.rs
 // edition:2018
 
-#![feature(extern_absolute_paths)]
-
 use xcrate::Z;
 
 fn f() {
index 6317dc17652cd0b58ababe49baa858ae8190e3c9..cace83d6274615b8ef7a1083a9651f05f5d32aae 100644 (file)
@@ -15,8 +15,5 @@
 // edition:2018
 // compile-flags: --test
 
-#![feature(extern_absolute_paths)]
-
 #[test]
-fn test() {
-}
+fn test() {}
index 688b66a0a87744553a75916813929b52775b879c..fcd233c361b8398ab34fa6282105071c3b75c53f 100644 (file)
@@ -12,7 +12,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct Foo;
index 877988e60a9465800e0f8392e2711ba3042c08ca..905a23f22a6f8abc1bed08058e60c3df55b61d0d 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct X {
index a523340784c70bec746e5225627a29046394d84f..05295aa3309d4237b79d7da55d46e0e3ca83cd6e 100644 (file)
@@ -11,8 +11,6 @@
 // Ensure assigning an owned or managed variable to itself works. In particular,
 // that we do not glue_drop before we glue_take (#3290).
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::rc::Rc;
index 7dd1c3c597876b2b1cce90441ccbe5e9884e1c50..59332d6b65e8cd5a177cc92948ba7aad539b39cd 100644 (file)
@@ -11,8 +11,6 @@
 // pretty-expanded FIXME #23616
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::thread;
 use std::sync::mpsc::channel;
 
index fb5877b8a48987af81eadb78e6925ae37f231705..ecd0bfb1440764d5df1be7ff2ab9ce7b6feb5fa3 100644 (file)
@@ -10,7 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::thread;
index 8e1d96d366973d3f894effaddb1107625e8d837b..dfd7b947c57e5dab881d6fb950e54edb3452f4f1 100644 (file)
@@ -10,9 +10,6 @@
 
 // Test slicing sugar.
 
-
-#![feature(core)]
-
 extern crate core;
 use core::ops::{Index, IndexMut, Range, RangeTo, RangeFrom, RangeFull};
 
index d2283da8bdd8a2c64a71454275840a99468eaf5b..7b6f0a7c9abc80f011de192d4b5595ff02b632ce 100644 (file)
@@ -8,13 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-// this is for the wrapping_add call below.
-#![feature(core)]
-
-/*!
- * Tests the range assertion wraparound case when reading discriminants.
- */
+// Tests the range assertion wraparound case when reading discriminants.
 
 #[repr(u8)]
 #[derive(Copy, Clone)]
index 03884e8205bd27a866e5e8cf647c03f5364eb4b7..1ad04493528b4f913413dff08b5e45c85cc11911 100644 (file)
@@ -10,9 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![feature(static_mutex, static_rwlock, static_condvar)]
-#![feature(semaphore)]
-
 use std::sync;
 
 fn assert_both<T: Sync + Send>() {}
index e096fb3bbaef723a60aea7d1d43b5656cbe14de4..e9584e12b2e3ec9f818368abd014fdf06699b520 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 #![allow(warnings)]
-#![feature(drain, collections_bound, btree_range, vecmap)]
+#![feature(drain, collections_bound, btree_range)]
 
 use std::collections::BinaryHeap;
 use std::collections::{BTreeMap, BTreeSet};
index bb190543ecd6c70f17e63ba1b83790e465d290e6..55269a28666313cd1288f635abbefb1529b5a0c4 100644 (file)
@@ -13,7 +13,6 @@
 #![allow(warnings)]
 #![feature(iter_empty)]
 #![feature(iter_once)]
-#![feature(iter_unfold)]
 #![feature(str_escape)]
 
 use std::iter::{empty, once, repeat};
index 0ac232e2e12b3fab3ae14a53ff13b1f9e58c2b5d..01e6d4cf7dee43a8844243b828c5088111256b51 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::thread;
 use std::sync::mpsc::{channel, Sender};
 
index 9a43780f08f0100f66e87263a3f1d054b51816af..3295e68ac4e3a3f6925bf4f2ff2c5c38e523cd83 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::thread;
 
 pub fn main() { test00(); }
index 13b40f17292fbbe45f815ef0681a9d4789aa4cc0..a69bba82ff0cdca1225a982bbdc25ed6b56fe760 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::thread;
 use std::sync::mpsc::{channel, Sender};
 
index be846795962da9b3904c5fe5db1987163e0f7522..c7beeb53850efe1f277a182f480c204068a0432a 100644 (file)
@@ -11,8 +11,6 @@
 // pretty-expanded FIXME #23616
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::sync::mpsc::{channel, Sender};
 use std::thread;
 
index fdf02e65d8eb3910fc7ec5149cfa96ec21f573e8..23594cebf3183c66996ddccb9a317ef0a8738b7e 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::thread;
 
 pub fn main() { test00(); }
index 46c5d3a7ce32baaefb9719fcbc4b3af85059128a..b48299703769a5ddd6a5e1b35c1719cce86a6e54 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::sync::mpsc::{channel, Sender};
 use std::thread;
 
index e75a6cf0c87097f19e8f296c856110f117f650dc..a03ff8719bba8b86b325a083f9be9eb6ae93b01a 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::sync::mpsc::{channel, Sender};
 use std::thread;
 
index f2ff48ebd95a93ff12258e00884275fc50d9b7e6..fc5a891d1d667818405bf854d9cdc2a2d988bb83 100644 (file)
@@ -11,8 +11,6 @@
 // ignore-emscripten no threads support
 // pretty-expanded FIXME #23616
 
-#![feature(std_misc)]
-
 use std::sync::mpsc::{channel, Sender};
 use std::thread;
 
index fe00f1aba363bcabf1cbe6a1696a083c091c9388..ca6f5c164ed37456e18ac25ae3a4e15043215fe8 100644 (file)
@@ -11,8 +11,6 @@
 // ignore-emscripten no threads support
 // pretty-expanded FIXME #23616
 
-#![feature(std_misc)]
-
 // Issue #922
 
 // This test is specifically about spawning temporary closures.
index 78f29f46edf4a08b2bb4cd64c8d3b36129a7e612..8d2d3afc78777d82c53bcfbf52a8422c35d09bcc 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(std_misc)]
-
 // ignore-emscripten no threads support
 
 use std::thread;
index 7b2b9fde9ee4aebe45afb509b727b094b65ab67a..7ab267ea66c1d81fce71326667cca6ce1f2a7a3d 100644 (file)
@@ -10,7 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
 #![allow(dead_assignment)]
 
 use std::sync::mpsc::{channel, Sender};
index 75fd1826b585320aee31a1ac8b38126df4d915a4..1f0eebf1f715b061233aea30dc74ae385fcd99f2 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::thread;
 use std::sync::mpsc::{channel, Sender};
 
index 312a9f499250112a1ed39284a60bdf13cc321194..34ea43ca82799c4f78c1f9201d3e7855f0cfb650 100644 (file)
@@ -11,8 +11,6 @@
 // ignore-emscripten no threads support
 // pretty-expanded FIXME #23616
 
-#![feature(std_misc)]
-
 use std::thread;
 
 pub fn main() {
index 9b9081019e482cc86734816e25fee4c20e5a47b2..94b69a1c3e477298fd7e8a6b189c286f25750302 100644 (file)
@@ -10,8 +10,7 @@
 
 // ignore-emscripten no threads support
 
-#![allow(unknown_features)]
-#![feature(box_syntax, std_misc)]
+#![feature(box_syntax)]
 
 use std::thread;
 use std::sync::mpsc::channel;
index 8c5b84b2c82c3e58c873a24c5ce8f2af5a98263c..f193598975aaf9c5807d9dc7b6c33357e02824bb 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![feature(std_misc)]
-
 use std::thread;
 
 pub fn main() {
index c58442aa58f332b0d1a3b26473628d013e9991f6..7b57d66ef21fdff401cbe4f3e94648dc1986e011 100644 (file)
@@ -12,8 +12,8 @@
 // and shared between threads as long as all types fulfill Send.
 
 // ignore-emscripten no threads support
-#![allow(unknown_features)]
-#![feature(box_syntax, std_misc)]
+
+#![feature(box_syntax)]
 
 use std::sync::Arc;
 use std::sync::mpsc::channel;
index bb8ae8247fa99abe9d4b36e1d0cbabde496af10a..6f088e15b353a5554b82272856530c26aa519808 100644 (file)
@@ -10,8 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
 trait U {}
 trait T<X: U> { fn get(self) -> X; }
 
index 70515a088e2de597ba2589d16806f43c702671c2..9f5c7cf60360dd2fcf9ba2b3395a1a7b8265c241 100644 (file)
@@ -12,8 +12,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
 use std::cmp::PartialOrd;
 
 pub trait NumCast: Sized {
index 61d32bd6ffc1724c792b6dfc4426814f46cd3388..4b14ac2f76f6b5697b15a3babff1d9b996d742e2 100644 (file)
@@ -10,8 +10,6 @@
 
 // test for #8664
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::marker;
index 8d2faaf418b5430f3546744b2b247265ed186071..53457d85e016fd28ba81995270ad49ae205a6da5 100644 (file)
@@ -12,8 +12,6 @@
 // blanket impl for T:Copy coexists with an impl for Box<T>, because
 // Box does not impl Copy.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 trait Get {
index 2865b5d04e5be61d4bdaf6ca522d5dac1c7be7ea..2a6708dc99904508f7a92b605b78971faa08f2f2 100644 (file)
@@ -11,9 +11,6 @@
 // Test that type IDs correctly account for higher-rank lifetimes
 // Also acts as a regression test for an ICE (issue #19791)
 
-
-#![feature(core)]
-
 use std::any::{Any, TypeId};
 
 struct Struct<'a>(&'a ());
index 381f1b6825739859af992baaaba6834d54ba778d..1a3bdcca7a1e522878fe1ff9811d1195225fae4e 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn p_foo<T>(_pinned: T) { }
index 0ea7a1be432158c7313ab002e37b4cce70967094..d386f27d8c23b3a16b9f0a49c69ebea11d56f4c7 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 // Example from lkuper's intern talk, August 2012 -- now with static
index 69d22cf34f1b763dbd42e4440adfba013efef89d..8e8fd9bf648431c31b2a69894efb6ba32ad1285a 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 // Example from lkuper's intern talk, August 2012.
index bd09a311b70fb24d0fec3bc1669d0c3e87816311..b3cbd2c4eb37b6bc7612ab9a31739bde54a576f1 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 #[derive(Copy, Clone)]
index 069f26841d2cd7139f2569e434e5f8205de545bd..72d5a1dc0433ea5f081e1c581367b9278411afa8 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::ops::FnMut;
index 789d2237c543c544c9f92a0782749b0d61d25e90..f4453f1bb8ab3195459d34ed4df4dc55b44340f2 100644 (file)
@@ -10,8 +10,6 @@
 
 // Test that the call operator autoderefs when calling to an object type.
 
-#![allow(unknown_features)]
-
 use std::ops::FnMut;
 
 fn make_adder(x: isize) -> Box<FnMut(isize)->isize + 'static> {
index e73077154717048cc21f76db5c3ec05ef14c73ca..2fdb9e9b346c4023a36cb92c844aa17f697e73e1 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
-
 use std::ops::FnMut;
 
 fn make_adder(x: isize) -> Box<FnMut(isize)->isize + 'static> {
index 7910380abeef0db7c0204893a694239c960067e3..a4f953ceaf5c3ea3e4cb03dab496204e0ec76118 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct X {
index 3323b3c046b112098dfe25a0496693d1d29cc38f..1e36f5287a77d9ebb8fe8fef617b5ecf8b6afb6c 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 37aa1f0a64bc6db87faaba22478003eccf4193bc..1227c14ec02f33393ec48a8698de0adb29c6c1fa 100644 (file)
@@ -10,7 +10,6 @@
 
 
 #![allow(dead_assignment)]
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 249b734a691e01f8c0f6d78af594d6645332c8af..1abc8203305cfc356c78a02fddb00550cf8eda27 100644 (file)
@@ -8,11 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
-
 fn f<T>(t: T) -> T {
     let t1 = t;
     t1
index 8e97fdd4a6af92d0e605f06135bc3e42cf93181a..66b78d27c59f3e7f5dc85804acd5a6eb988bb2a5 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index a711dbb685f19d5987da44b265458e8fdc1c4898..4ad465abc48fe643cc20c178802af2fe454d9a11 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct J { j: isize }
index 1ef61008b3c2b056d88b3b07c45fbdf48678c222..b0abcfab78ef28294e753f12920f37091e6ca590 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 1bd44ecb7217a3782178eeeec673933158ff005f..e949215396c66874c1c761d474e207e16f74607b 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index ce5a2bed48de0e3bde72b17fe2a3f70c3f648107..94f523eb3960154ee2a4693ba3780fc388f0b62f 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 6d638bbf562c7cfcdbc7501d03428c276057886e..5ebabf0c29a52ed33ad136d117107e599f340886 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 9d749803ffb1661226df911c3fb9acc22271c9f8..71197b9d02fbd17c39c75e67d8735185a8b6efa7 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index a00de08998f4ef0cf2497ced5c2050b30022d92d..2501caddb46320c7e4e0bf565639f61f38094dcb 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index f4ff44ffff52c1bcdde05d978d1557af5d6c5a04..fc6421e2e0889580665ac0eb2aaf60b1f2735d0d 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 70b2617797daee9615d8ce07875ca31346c22dcb..8c008683ef347e718fc0e6d58a4f4d3aa0235327 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index b368cbee2f632e457b582811cb17f6362df03a69..70b4af1886fc19e4386e624891ec221c5b7c0b8c 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 
index 1910d51bd0bcbfe4bbffe7f9d60fd89713a1679d..bcfb65769da654afa8d46a1ef6ac8dd0d05fc49a 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index d101cbd31290c5ad0114440178f6e691a3c5cfc7..45cc530659f978f0eb8463246c88ac03545622b0 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn f(i: Box<isize>) {
index ebe89b275d4f7c01dc96d85f48276e335ba1e5c8..77c4fa29558e3304d04f129fdc233124beac3e6a 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn f(i: &mut Box<isize>) {
index 97006d2a01a2d381c3cccade5aec34375cc0e5f8..20a0008ef56ae7a0ff541e03e09395f322867a2d 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn f(i: Box<isize>) {
index d3be0cf01f1dd422dd1c35034ec7c4da57c1ed28..7d88176828e3be80ce6532f3cff848bb0fe650d8 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn f() -> Box<isize> {
index 0762b37ff8b89dd8f2873d6462af9dbcdd3838bf..517cdd0253564a33d724e087519c36989309e0a1 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 fn test1() {
index ece206caa02e51cf26e2549f0ccd418090d1b71e..a460aa6ec10259d0a68165fb2ff25c66b262fd09 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index bd965d41eea2c946708a79e660886fb9eb8e939b..a7edc9cc7104a76307eb20d6b5ee69ee338b8c1e 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index bd7a64952604cf90b9316d5518b50c0d674320ee..768614b1e3c921a7b1ba945ce969fa97c07acb57 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index f45b3285da76221f40829f13c0530313189bb7b7..80364114bce43183b38efe15a88064b91bf9acd8 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::cmp::PartialEq;
index 148ca4757ae927eccb8f1c5cb89e20f19a27c52f..0c17acb3d8984bedb38e8ddb19e407e6f7599f88 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index c2813771b7c34499cfb15d82461d5d6e7c6bb8b0..ba865abc3718a4f26e228e106238d6191d060378 100644 (file)
@@ -10,7 +10,6 @@
 
 
 #![allow(unused_variables)]
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 4b937625201c00250fd8379c966beb33362ec2a8..8c1178b9a7e0ece6cecbb3166447ca879abf8763 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index bed1d6e171a8bb81ffeaa3538218d7bda890f56b..e731ca818fe79a1b82074ad322d36bfc5662f895 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 8beec6a4198336b3d172e736af4a77203ec35f6c..480060103003ecddf6f2a3ff33b29a3e7da362a3 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 4d120e7caf36528568335a8abab5b1d8ef8a6075..d93df4e96f99c5811921caa920f458a3e0f5fe8b 100644 (file)
@@ -12,7 +12,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub trait EventLoop { fn foo(&self) {} }
index c314b70e536621611a52ccba72888f75418369fc..12e81a202e9f80729e6c3df060690c641eb8ce69 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 
index 648e9599a979e994dfbff2d9d86eea91ed96fe15..9f361d460e0ed934b02e7e05ed87575e74e48be9 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 enum bar { u(Box<isize>), w(isize), }
index 1312ea924b5998e4ad45dcc2f2d04345e36d57d1..8af160b1f56c00988538eb813f3abb26ce687ffd 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 
-#![allow(unknown_features)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 
index 72975c27eeaf52c794786eafd3aa7075b733971d..aa3fc8f5bb569a6e5af4466431be901dc614754f 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 struct X { x: isize }
index 2e864797db056203312aa962d59eaa9c70563953..7a0e585e8b0aec194723b43aeb8418d1f6afbb6f 100644 (file)
@@ -10,7 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::sync::mpsc::{channel, Sender};
index bc0f790b2b02d0b55af00a400083b2006e3a4ff2..7644da08e4afa7cf144dbbb3a5b0142f687ac5c7 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::sync::mpsc::channel;
index cfa076f1a07445712b2aec1de9ea998ceff795c1..6e6fe4e420b2524cdb9375fef91420ad8f009ed4 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::mem::swap;
index 50d8d3d27f27b35d12b8135edbf597a82c76dd83..90b99f98533dee439dc64c93d06f8f7af5d80a35 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 // Test sized-ness checking in substitution.
index b155620e5196ce4d58af4f6080137abe868ae497..e5a77d1cdbd9de0cffa3893252f630201283b5c6 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index e4b9d14fb4b30aab6d2b5c45e85f0e2204dc5257..9a0ea181d996df3646066a5507679396b8e78274 100644 (file)
@@ -15,7 +15,6 @@
 // pretty-expanded FIXME #23616
 
 #![allow(path_statements)]
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main()
index 320a11f64d8ac50a36091ae8ab28ed486f2941be..321e819881703211e768fcebb66d44397ca55c82 100644 (file)
@@ -10,7 +10,6 @@
 
 // ignore-emscripten no threads support
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 use std::thread;
index b54aed79665aaa210184383c6eb946726bbaf8a3..b2550e77a8a375e249aa58773874f6315505d308 100644 (file)
@@ -7,9 +7,6 @@
 // <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(core, str_char)]
 
 use std::str;
 
index af06fe381368be0db0e2e29db81061d0e61f4a47..948d68e0ccd7d7d84c402166413f4aa1c5ed8129 100644 (file)
@@ -13,9 +13,7 @@
 // us from approximating the lifetimes of `field1` and `field2` to a
 // common intersection.
 
-
 #![allow(dead_code)]
-#![feature(core)]
 
 struct List<'l> {
     field1: &'l i32,
index 89927b7b55b970a306db8c54e50058a862795cc5..caec6df5a4d81a56c5c16da8999f8a11786209e4 100644 (file)
@@ -10,9 +10,7 @@
 
 // Test that vec is now covariant in its argument type.
 
-
 #![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 aadbb922f676316c67afc3dca8064ae888e7319f..cf4222b405e80651dcd93763f16ad0c2bf9cc178 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() {
index 10f71b3e12c251d34779a61edf10eedbbbe4ca1e..09e70cf03cada5a057f9efa216b8f8ad6ab3067d 100644 (file)
@@ -10,7 +10,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unknown_features)]
 #![feature(box_syntax)]
 
 pub fn main() { let _quux: Box<Vec<usize>> = box Vec::new(); }
index f3bf5d9c6843fca5b00d4558959770ff67c61a86..bbdd65f7e5b2de33c645c62728b23b59c4d70904 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(std_misc)]
-
 pub type HANDLE = usize;
 pub type DWORD = u32;
 pub type SIZE_T = u32;
index 34a1331353dca96d1259937dd9d06caaf520ecc7..c346c7323d3dc1f3b400ebbabe166a4c661d7a1b 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 #![feature(optin_builtin_traits)]
-#![feature(core)]
 
 pub mod bar {
     use std::marker;
index 9fed67ee583d2f2a062d4c7b22fe504624182731..000ed709a8aaeac1d392d60d14e2c59a7999ded5 100644 (file)
@@ -10,8 +10,6 @@
 
 // Just check if we don't get an ICE for the _S type.
 
-#![feature(const_size_of)]
-
 use std::cell::Cell;
 use std::mem;
 
diff --git a/src/test/rustdoc/issue-51236.rs b/src/test/rustdoc/issue-51236.rs
new file mode 100644 (file)
index 0000000..541a1c5
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright 2018 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::marker::PhantomData;
+
+pub mod traits {
+    pub trait Owned<'a> {
+        type Reader;
+    }
+}
+
+// @has issue_51236/struct.Owned.html
+// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' "impl<T> Send for \
+// Owned<T> where <T as Owned<'static>>::Reader: Send"
+pub struct Owned<T> where T: for<'a> ::traits::Owned<'a> {
+    marker: PhantomData<<T as ::traits::Owned<'static>>::Reader>,
+}
diff --git a/src/test/rustdoc/synthetic_auto/static-region.rs b/src/test/rustdoc/synthetic_auto/static-region.rs
new file mode 100644 (file)
index 0000000..96e8b8e
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright 2018 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.
+
+pub trait OwnedTrait<'a> {
+    type Reader;
+}
+
+// @has static_region/struct.Owned.html
+// @has - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]//*/code' "impl<T> Send for \
+// Owned<T> where <T as OwnedTrait<'static>>::Reader: Send"
+pub struct Owned<T> where T: OwnedTrait<'static> {
+    marker: <T as OwnedTrait<'static>>::Reader,
+}
index db0c19e96f8211a2996bb6df3e21b8e21b52e0db..679cb7728680ddbf26eefe2887c77cd9f7191a09 100644 (file)
@@ -10,7 +10,7 @@
 
 // force-host
 // no-prefer-dynamic
-#![feature(proc_macro)]
+
 #![crate_type = "proc-macro"]
 
 extern crate proc_macro;
index 89ac11b309d751bc13d46f10996895ff8abe75da..6484725814a10b75581b8fa23a92e263dc695954 100644 (file)
@@ -10,7 +10,7 @@
 
 // force-host
 // no-prefer-dynamic
-#![feature(proc_macro)]
+
 #![crate_type = "proc-macro"]
 
 extern crate proc_macro;
index ecf0a56edf7661d30162915e469b4fdf9d732948..fc59a622bfab039898c83e4e901195cfc38e102e 100644 (file)
@@ -10,7 +10,6 @@
 
 // no-prefer-dynamic
 
-#![feature(proc_macro)]
 #![crate_type = "proc-macro"]
 
 extern crate proc_macro;
index 3200e8fb2b1625b8245353317c09b29a877852e3..6879848d269b0cb7d3e68e84102cb6e5b53fe716 100644 (file)
@@ -10,7 +10,7 @@
 
 // aux-build:lifetimes.rs
 
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
 
 extern crate lifetimes;
 
index 632dba42ad00f21f037a19bb259322f3795ac7de..1ed8ef520273593334d11e649e1ed765876f1440 100644 (file)
@@ -11,7 +11,6 @@
 // run-pass
 // no-prefer-dynamic
 
-#![feature(proc_macro)]
 #![crate_type = "proc-macro"]
 
 extern crate proc_macro;
index ee0077c3ed3ff189f7f6ffd0bddcb89aef4a9bd5..b0cccd8728bd1f3427d3acb7105237a025ed9ac6 100644 (file)
@@ -12,7 +12,7 @@
 
 // aux-build:generate-mod.rs
 
-#![feature(use_extern_macros, proc_macro_gen, proc_macro_path_invoc)]
+#![feature(proc_macro_gen, proc_macro_path_invoc)]
 
 extern crate generate_mod;
 
index c06f98ed5ff4653c5dee14d9b708eddb0e2a4c62..8b940a0f40585a835334f28916eebd6d3526247d 100644 (file)
@@ -11,7 +11,6 @@
 // no-prefer-dynamic
 
 #![crate_type = "proc-macro"]
-#![feature(proc_macro)]
 
 extern crate proc_macro;
 
index c480bcb5df982d7a12fdb88131bb4b2773595cd1..5fd87362db23b2cf8ac39e99dbc996b387abcf6d 100644 (file)
@@ -1,35 +1,35 @@
 error: `#[proc_macro]` attribute does not take any arguments
-  --> $DIR/invalid-attributes.rs:20:1
+  --> $DIR/invalid-attributes.rs:19:1
    |
 LL | #[proc_macro = "test"] //~ ERROR: does not take any arguments
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 error: `#[proc_macro]` attribute does not take any arguments
-  --> $DIR/invalid-attributes.rs:23:1
+  --> $DIR/invalid-attributes.rs:22:1
    |
 LL | #[proc_macro()] //~ ERROR: does not take any arguments
    | ^^^^^^^^^^^^^^^
 
 error: `#[proc_macro]` attribute does not take any arguments
-  --> $DIR/invalid-attributes.rs:26:1
+  --> $DIR/invalid-attributes.rs:25:1
    |
 LL | #[proc_macro(x)] //~ ERROR: does not take any arguments
    | ^^^^^^^^^^^^^^^^
 
 error: `#[proc_macro_attribute]` attribute does not take any arguments
-  --> $DIR/invalid-attributes.rs:29:1
+  --> $DIR/invalid-attributes.rs:28:1
    |
 LL | #[proc_macro_attribute = "test"] //~ ERROR: does not take any arguments
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `#[proc_macro_attribute]` attribute does not take any arguments
-  --> $DIR/invalid-attributes.rs:32:1
+  --> $DIR/invalid-attributes.rs:31:1
    |
 LL | #[proc_macro_attribute()] //~ ERROR: does not take any arguments
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `#[proc_macro_attribute]` attribute does not take any arguments
-  --> $DIR/invalid-attributes.rs:35:1
+  --> $DIR/invalid-attributes.rs:34:1
    |
 LL | #[proc_macro_attribute(x)] //~ ERROR: does not take any arguments
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
index 21d625ae09d8b7f1af5a0b9ef1ab2a181611f458..e7bb05de88c8a3f2f6f2f2538407851cec955400 100644 (file)
@@ -10,7 +10,7 @@
 
 // no-prefer-dynamic
 
-#![feature(proc_macro, decl_macro)]
+#![feature(decl_macro)]
 #![crate_type = "proc-macro"]
 
 extern crate proc_macro;
index 288c63b4c77811694125779873eee3d4e68c0b7f..2440488578814e89ce24021bf135fb85bd96afe7 100644 (file)
@@ -10,7 +10,6 @@
 
 // no-prefer-dynamic
 
-#![feature(proc_macro)]
 #![crate_type = "proc-macro"]
 
 extern crate proc_macro;
index 8c14f644d7a642b810c75f46de38d01e20f667b7..23222a2b85145dfa3d482e6c6142a1667bfdaece 100644 (file)
@@ -1,5 +1,5 @@
 error: functions tagged with `#[proc_macro]` must currently reside in the root of the crate
-  --> $DIR/non-root.rs:21:5
+  --> $DIR/non-root.rs:20:5
    |
 LL |     pub fn foo(arg: TokenStream) -> TokenStream { arg }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
index ee5f3b33a0648c739473f33c12a4aac83985a6cd..f6b0e90da001440838c59f06db17b8f5fa8bbc15 100644 (file)
@@ -11,7 +11,7 @@
 // aux-build:three-equals.rs
 // ignore-stage1
 
-#![feature(use_extern_macros, proc_macro_non_items)]
+#![feature(proc_macro_non_items)]
 
 extern crate three_equals;
 
index df9b263534f605804276b984876b9bea5f0be208..1940151357c8f82a478b434f6943ce8e0394623f 100644 (file)
@@ -13,7 +13,7 @@
 // aux-build:attr_proc_macro.rs
 // aux-build:bang_proc_macro.rs
 
-#![feature(use_extern_macros)]
+#![feature(custom_attribute)]
 
 #[macro_use]
 extern crate derive_foo;
@@ -37,12 +37,10 @@ macro_rules! attr_proc_mac {
 //~^ ERROR cannot find
 struct Foo;
 
-#[attr_proc_macra]
-//~^ ERROR cannot find
+#[attr_proc_macra] // OK, interpreted as a custom attribute
 struct Bar;
 
-#[FooWithLongNan]
-//~^ ERROR cannot find
+#[FooWithLongNan]  // OK, interpreted as a custom attribute
 struct Asdf;
 
 #[derive(Dlone)]
index caa7966461487211532de3f7e9d41194b2c283bf..278409c688ab9dcfa581b523f3578aa17ed13062 100644 (file)
@@ -4,59 +4,47 @@ error: cannot find derive macro `FooWithLongNan` in this scope
 LL | #[derive(FooWithLongNan)]
    |          ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
 
-error: cannot find attribute macro `attr_proc_macra` in this scope
-  --> $DIR/resolve-error.rs:40:3
-   |
-LL | #[attr_proc_macra]
-   |   ^^^^^^^^^^^^^^^ help: try: `attr_proc_macro`
-
-error: cannot find attribute macro `FooWithLongNan` in this scope
-  --> $DIR/resolve-error.rs:44:3
-   |
-LL | #[FooWithLongNan]
-   |   ^^^^^^^^^^^^^^
-
 error: cannot find derive macro `Dlone` in this scope
-  --> $DIR/resolve-error.rs:48:10
+  --> $DIR/resolve-error.rs:46:10
    |
 LL | #[derive(Dlone)]
    |          ^^^^^ help: try: `Clone`
 
 error: cannot find derive macro `Dlona` in this scope
-  --> $DIR/resolve-error.rs:52:10
+  --> $DIR/resolve-error.rs:50:10
    |
 LL | #[derive(Dlona)]
    |          ^^^^^ help: try: `Clona`
 
 error: cannot find derive macro `attr_proc_macra` in this scope
-  --> $DIR/resolve-error.rs:56:10
+  --> $DIR/resolve-error.rs:54:10
    |
 LL | #[derive(attr_proc_macra)]
    |          ^^^^^^^^^^^^^^^
 
 error: cannot find macro `FooWithLongNama!` in this scope
-  --> $DIR/resolve-error.rs:61:5
+  --> $DIR/resolve-error.rs:59:5
    |
 LL |     FooWithLongNama!();
    |     ^^^^^^^^^^^^^^^ help: you could try the macro: `FooWithLongNam`
 
 error: cannot find macro `attr_proc_macra!` in this scope
-  --> $DIR/resolve-error.rs:64:5
+  --> $DIR/resolve-error.rs:62:5
    |
 LL |     attr_proc_macra!();
    |     ^^^^^^^^^^^^^^^ help: you could try the macro: `attr_proc_mac`
 
 error: cannot find macro `Dlona!` in this scope
-  --> $DIR/resolve-error.rs:67:5
+  --> $DIR/resolve-error.rs:65:5
    |
 LL |     Dlona!();
    |     ^^^^^
 
 error: cannot find macro `bang_proc_macrp!` in this scope
-  --> $DIR/resolve-error.rs:70:5
+  --> $DIR/resolve-error.rs:68:5
    |
 LL |     bang_proc_macrp!();
    |     ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro`
 
-error: aborting due to 10 previous errors
+error: aborting due to 8 previous errors
 
diff --git a/src/test/ui/E0705.rs b/src/test/ui/E0705.rs
new file mode 100644 (file)
index 0000000..a0ce95e
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright 2018 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.
+
+// compile-pass
+
+#![feature(rust_2018_preview)]
+#![feature(raw_identifiers)]
+//~^ WARN the feature `raw_identifiers` is included in the Rust 2018 edition
+
+fn main() {
+    let foo = 0;
+    let bar = r#foo;
+}
diff --git a/src/test/ui/E0705.stderr b/src/test/ui/E0705.stderr
new file mode 100644 (file)
index 0000000..ebb8dd4
--- /dev/null
@@ -0,0 +1,6 @@
+warning[E0705]: the feature `raw_identifiers` is included in the Rust 2018 edition
+  --> $DIR/E0705.rs:14:12
+   |
+LL | #![feature(raw_identifiers)]
+   |            ^^^^^^^^^^^^^^^
+
index d42014766ec6862a6e86ae1e974c53579ce7461e..85ef15858fe912a02e3ae906f6a9ea4c6708d482 100644 (file)
@@ -10,7 +10,6 @@
 
 // edition:2018
 
-#![feature(raw_identifiers)]
 #![allow(async_idents)]
 
 #[macro_export]
index 0553b4a49b7aed9fc08ea927a9ea56fd6e041426..6ba66f3e45fece9f5e7e0eec334526d6ac6278fe 100644 (file)
 #![crate_name="lint_output_format"]
 #![crate_type = "lib"]
 #![feature(staged_api)]
-#![unstable(feature = "test_feature", issue = "0")]
+#![unstable(feature = "unstable_test_feature", issue = "0")]
 
-#[stable(feature = "test_feature", since = "1.0.0")]
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
 #[rustc_deprecated(since = "1.0.0", reason = "text")]
 pub fn foo() -> usize {
     20
 }
 
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub fn bar() -> usize {
     40
 }
 
-#[unstable(feature = "test_feature", issue = "0")]
+#[unstable(feature = "unstable_test_feature", issue = "0")]
 pub fn baz() -> usize {
     30
 }
index 62f7986f1c3bd729b67c8f50677d01395f20914e..0d4c76abb10e7a92641f518ce7a9eb10f9531f3f 100644 (file)
@@ -14,7 +14,6 @@
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
 
 macro_rules! three {
     () => { 3 }
diff --git a/src/test/ui/borrowck/issue-45983.ast.stderr b/src/test/ui/borrowck/issue-45983.ast.stderr
new file mode 100644 (file)
index 0000000..db7cedf
--- /dev/null
@@ -0,0 +1,12 @@
+error: borrowed data cannot be stored outside of its closure
+  --> $DIR/issue-45983.rs:36:27
+   |
+LL |     let x = None;
+   |         - borrowed data cannot be stored into here...
+LL |     give_any(|y| x = Some(y));
+   |              ---          ^ cannot be stored outside of its closure
+   |              |
+   |              ...because it cannot outlive this closure
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/borrowck/issue-45983.migrate.stderr b/src/test/ui/borrowck/issue-45983.migrate.stderr
new file mode 100644 (file)
index 0000000..db7cedf
--- /dev/null
@@ -0,0 +1,12 @@
+error: borrowed data cannot be stored outside of its closure
+  --> $DIR/issue-45983.rs:36:27
+   |
+LL |     let x = None;
+   |         - borrowed data cannot be stored into here...
+LL |     give_any(|y| x = Some(y));
+   |              ---          ^ cannot be stored outside of its closure
+   |              |
+   |              ...because it cannot outlive this closure
+
+error: aborting due to previous error
+
index 64086cb07917d81a7141e3984271c47d78f890c9..9d62c7dba75ff068efcec146fdd0109b5ed1a1a6 100644 (file)
@@ -1,11 +1,11 @@
 warning: not reporting region error due to nll
-  --> $DIR/issue-45983.rs:17:27
+  --> $DIR/issue-45983.rs:36:27
    |
 LL |     give_any(|y| x = Some(y));
    |                           ^
 
 error: borrowed data escapes outside of closure
-  --> $DIR/issue-45983.rs:17:18
+  --> $DIR/issue-45983.rs:36:18
    |
 LL |     let x = None;
    |         - `x` is declared here, outside of the closure body
@@ -15,7 +15,7 @@ LL |     give_any(|y| x = Some(y));
    |               `y` is a reference that is only valid in the closure body
 
 error[E0594]: cannot assign to `x`, as it is not declared as mutable
-  --> $DIR/issue-45983.rs:17:18
+  --> $DIR/issue-45983.rs:36:18
    |
 LL |     let x = None;
    |         - help: consider changing this to be mutable: `mut x`
index a6e5067195f47faad38ee2afe936ffedae4ff572..bcbe0d1ffc0008fbea2369e31ef73cd95b5f1bd5 100644 (file)
@@ -8,6 +8,25 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// As documented in Issue #45983, this test is evaluating the quality
+// of our diagnostics on erroneous code using higher-ranked closures.
+//
+// However, as documented on Issue #53026, this test also became a
+// prime example of our need to test the NLL migration mode
+// *separately* from the existing test suites that focus solely on
+// AST-borrwock and NLL.
+
+// revisions: ast migrate nll
+
+// Since we are testing nll (and migration) explicitly as a separate
+// revisions, dont worry about the --compare-mode=nll on this test.
+
+// ignore-compare-mode-nll
+
+//[ast]compile-flags: -Z borrowck=ast
+//[migrate]compile-flags: -Z borrowck=migrate -Z two-phase-borrows
+//[nll]compile-flags: -Z borrowck=mir -Z two-phase-borrows
+
 fn give_any<F: for<'r> FnOnce(&'r ())>(f: F) {
     f(&());
 }
@@ -15,5 +34,9 @@ fn give_any<F: for<'r> FnOnce(&'r ())>(f: F) {
 fn main() {
     let x = None;
     give_any(|y| x = Some(y));
-    //~^ ERROR borrowed data cannot be stored outside of its closure
+    //[ast]~^ ERROR borrowed data cannot be stored outside of its closure
+    //[migrate]~^^ ERROR borrowed data cannot be stored outside of its closure
+    //[nll]~^^^ WARN not reporting region error due to nll
+    //[nll]~| ERROR borrowed data escapes outside of closure
+    //[nll]~| ERROR cannot assign to `x`, as it is not declared as mutable
 }
diff --git a/src/test/ui/borrowck/issue-45983.stderr b/src/test/ui/borrowck/issue-45983.stderr
deleted file mode 100644 (file)
index 7625b9e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-error: borrowed data cannot be stored outside of its closure
-  --> $DIR/issue-45983.rs:17:27
-   |
-LL |     let x = None;
-   |         - borrowed data cannot be stored into here...
-LL |     give_any(|y| x = Some(y));
-   |              ---          ^ cannot be stored outside of its closure
-   |              |
-   |              ...because it cannot outlive this closure
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/borrowck/issue-52713-bug.rs b/src/test/ui/borrowck/issue-52713-bug.rs
new file mode 100644 (file)
index 0000000..4ecba64
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+// Regression test for a bug in #52713: this was an optimization for
+// computing liveness that wound up accidentally causing the program
+// below to be accepted.
+
+#![feature(nll)]
+
+fn foo<'a>(x: &'a mut u32) -> u32 {
+    let mut x = 22;
+    let y = &x;
+    if false {
+        return x;
+    }
+
+    x += 1; //~ ERROR
+    println!("{}", y);
+    return 0;
+}
+
+fn main() { }
diff --git a/src/test/ui/borrowck/issue-52713-bug.stderr b/src/test/ui/borrowck/issue-52713-bug.stderr
new file mode 100644 (file)
index 0000000..7d9b574
--- /dev/null
@@ -0,0 +1,14 @@
+error[E0506]: cannot assign to `x` because it is borrowed
+  --> $DIR/issue-52713-bug.rs:24:5
+   |
+LL |     let y = &x;
+   |             -- borrow of `x` occurs here
+...
+LL |     x += 1; //~ ERROR
+   |     ^^^^^^ assignment to borrowed `x` occurs here
+LL |     println!("{}", y);
+   |                    - borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0506`.
index 52f1547bce6f86f33b7bcd359e41186aef326d06..95acdab3e80012e3c7c94d179e2667901c7fc3b2 100644 (file)
@@ -1,24 +1,30 @@
 error[E0597]: borrowed value does not live long enough
   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:15:21
    |
-LL |     let ref mut x = 1234543; //~ ERROR
-   |                     ^^^^^^^ temporary value does not live long enough
-LL |     x
-LL | }
-   | - temporary value only lives until here
-   |
-   = note: borrowed value must be valid for the static lifetime...
+LL |   fn gimme_static_mut_let() -> &'static mut u32 {
+   |  _______________________________________________-
+LL | |     let ref mut x = 1234543; //~ ERROR
+   | |                     ^^^^^^^ temporary value does not live long enough
+LL | |     x
+LL | | }
+   | | -
+   | | |
+   | |_temporary value only lives until here
+   |   borrow later used here
 
 error[E0597]: borrowed value does not live long enough
   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:20:25
    |
-LL |     let (ref mut x, ) = (1234543, ); //~ ERROR
-   |                         ^^^^^^^^^^^ temporary value does not live long enough
-LL |     x
-LL | }
-   | - temporary value only lives until here
-   |
-   = note: borrowed value must be valid for the static lifetime...
+LL |   fn gimme_static_mut_let_nested() -> &'static mut u32 {
+   |  ______________________________________________________-
+LL | |     let (ref mut x, ) = (1234543, ); //~ ERROR
+   | |                         ^^^^^^^^^^^ temporary value does not live long enough
+LL | |     x
+LL | | }
+   | | -
+   | | |
+   | |_temporary value only lives until here
+   |   borrow later used here
 
 error[E0597]: borrowed value does not live long enough
   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:25:11
index d0cdeb2178f15bf9a692908f844c4725d3f4339b..1c801f2a79039e58007d992620e695ed39c4f612 100644 (file)
@@ -7,20 +7,16 @@ LL |     format!(); //~ ERROR requires at least a format string argument
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
 error: expected token: `,`
-  --> $DIR/bad-format-args.rs:13:5
+  --> $DIR/bad-format-args.rs:13:16
    |
 LL |     format!("" 1); //~ ERROR expected token: `,`
-   |     ^^^^^^^^^^^^^^
-   |
-   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+   |                ^
 
 error: expected token: `,`
-  --> $DIR/bad-format-args.rs:14:5
+  --> $DIR/bad-format-args.rs:14:19
    |
 LL |     format!("", 1 1); //~ ERROR expected token: `,`
-   |     ^^^^^^^^^^^^^^^^^
-   |
-   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+   |                   ^
 
 error: aborting due to 3 previous errors
 
index fa15f3e87c6947a4083579f9fe5d27afacf227d3..3d0477feb2060a2ffa024ba83940691878d53245 100644 (file)
@@ -11,6 +11,7 @@
 // Check that you can't dereference raw pointers in constants.
 
 fn main() {
-    static C: u64 = unsafe {*(0xdeadbeef as *const u64)}; //~ ERROR E0396
+    static C: u64 = unsafe {*(0xdeadbeef as *const u64)};
+    //~^ ERROR dereferencing raw pointers in statics is unstable
     println!("{}", C);
 }
index 61db58104d2d2ad64ac9a71c0ea94ef714d4eefe..94a383bcf16209420b534ca032a548482e679ed8 100644 (file)
@@ -1,9 +1,11 @@
-error[E0396]: raw pointers cannot be dereferenced in statics
+error[E0658]: dereferencing raw pointers in statics is unstable (see issue #51911)
   --> $DIR/const-deref-ptr.rs:14:29
    |
-LL |     static C: u64 = unsafe {*(0xdeadbeef as *const u64)}; //~ ERROR E0396
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer in constant
+LL |     static C: u64 = unsafe {*(0xdeadbeef as *const u64)};
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0396`.
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/const-eval/const_raw_ptr_ops.rs b/src/test/ui/const-eval/const_raw_ptr_ops.rs
new file mode 100644 (file)
index 0000000..2aff6a7
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright 2018 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(const_raw_ptr_to_usize_cast, const_compare_raw_pointers, const_raw_ptr_deref)]
+
+fn main() {}
+
+// unconst and bad, will thus error in miri
+const X: bool = &1 as *const i32 == &2 as *const i32; //~ ERROR cannot be used
+// unconst and fine
+const X2: bool = 42 as *const i32 == 43 as *const i32;
+// unconst and fine
+const Y: usize = 42usize as *const i32 as usize + 1;
+// unconst and bad, will thus error in miri
+const Y2: usize = &1 as *const i32 as usize + 1; //~ ERROR cannot be used
+// unconst and fine
+const Z: i32 = unsafe { *(&1 as *const i32) };
+// unconst and bad, will thus error in miri
+const Z2: i32 = unsafe { *(42 as *const i32) }; //~ ERROR cannot be used
+const Z3: i32 = unsafe { *(44 as *const i32) }; //~ ERROR cannot be used
diff --git a/src/test/ui/const-eval/const_raw_ptr_ops.stderr b/src/test/ui/const-eval/const_raw_ptr_ops.stderr
new file mode 100644 (file)
index 0000000..a9442be
--- /dev/null
@@ -0,0 +1,36 @@
+error: this constant cannot be used
+  --> $DIR/const_raw_ptr_ops.rs:16:1
+   |
+LL | const X: bool = &1 as *const i32 == &2 as *const i32; //~ ERROR cannot be used
+   | ^^^^^^^^^^^^^^^^------------------------------------^
+   |                 |
+   |                 "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
+   |
+   = note: #[deny(const_err)] on by default
+
+error: this constant cannot be used
+  --> $DIR/const_raw_ptr_ops.rs:22:1
+   |
+LL | const Y2: usize = &1 as *const i32 as usize + 1; //~ ERROR cannot be used
+   | ^^^^^^^^^^^^^^^^^^-----------------------------^
+   |                   |
+   |                   "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
+
+error: this constant cannot be used
+  --> $DIR/const_raw_ptr_ops.rs:26:1
+   |
+LL | const Z2: i32 = unsafe { *(42 as *const i32) }; //~ ERROR cannot be used
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------^^^
+   |                          |
+   |                          tried to access memory with alignment 2, but alignment 4 is required
+
+error: this constant cannot be used
+  --> $DIR/const_raw_ptr_ops.rs:27:1
+   |
+LL | const Z3: i32 = unsafe { *(44 as *const i32) }; //~ ERROR cannot be used
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^-------------------^^^
+   |                          |
+   |                          a memory access tried to interpret some bytes as a pointer
+
+error: aborting due to 4 previous errors
+
index e661444a7b47d4dce72f711a75351ae2aab5bd35..8dd1476d25a77d080ac2385e50532b2c911c4411 100644 (file)
@@ -11,6 +11,8 @@
 // compile-pass
 // run-pass
 
+#![feature(const_fn_union)]
+
 union Transmute<T: Copy, U: Copy> {
     t: T,
     u: U,
diff --git a/src/test/ui/const-eval/feature-gate-const_fn_union.rs b/src/test/ui/const-eval/feature-gate-const_fn_union.rs
new file mode 100644 (file)
index 0000000..113046b
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright 2018 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(const_fn)]
+
+fn main() {}
+
+union Foo {
+    u: u32,
+    i: i32,
+}
+
+const unsafe fn foo(u: u32) -> i32 {
+    Foo { u }.i //~ ERROR unions in const fn are unstable
+}
diff --git a/src/test/ui/const-eval/feature-gate-const_fn_union.stderr b/src/test/ui/const-eval/feature-gate-const_fn_union.stderr
new file mode 100644 (file)
index 0000000..1e28f14
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0658]: unions in const fn are unstable (see issue #51909)
+  --> $DIR/feature-gate-const_fn_union.rs:21:5
+   |
+LL |     Foo { u }.i //~ ERROR unions in const fn are unstable
+   |     ^^^^^^^^^^^
+   |
+   = help: add #![feature(const_fn_union)] to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/const-eval/issue-53157.rs b/src/test/ui/const-eval/issue-53157.rs
new file mode 100644 (file)
index 0000000..9008477
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright 2018 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.
+
+// compile-pass
+
+macro_rules! m {
+    () => {{
+        fn f(_: impl Sized) {}
+        f
+    }}
+}
+
+fn main() {
+    fn f() -> impl Sized {};
+    m!()(f());
+}
index 19b3dcc318154321cacc57ae1afe79e6f201c8f1..81fcd23fb786da02e579e1e3e30669941b98021b 100644 (file)
@@ -13,7 +13,7 @@ fn main() {
     // that pointer comparison is disallowed, not that parts of a pointer are accessed as raw
     // bytes.
     let _: [u8; 0] = [4; { //~ ERROR could not evaluate repeat length
-        match &1 as *const i32 as usize { //~ ERROR raw pointers cannot be cast to integers
+        match &1 as *const i32 as usize { //~ ERROR casting pointers to integers in constants
             0 => 42, //~ ERROR constant contains unimplemented expression type
             //~^ NOTE "pointer arithmetic or comparison" needs an rfc before being allowed
             n => n,
index 726ada9b428aa5d8c082c0fe03d5610969ec1ada..26577948faefa90a881dc331bd2de49984b1870b 100644 (file)
@@ -1,8 +1,10 @@
-error[E0018]: raw pointers cannot be cast to integers in constants
+error[E0658]: casting pointers to integers in constants is unstable (see issue #51910)
   --> $DIR/match-test-ptr-null.rs:16:15
    |
-LL |         match &1 as *const i32 as usize { //~ ERROR raw pointers cannot be cast to integers
+LL |         match &1 as *const i32 as usize { //~ ERROR casting pointers to integers in constants
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable
 
 error[E0019]: constant contains unimplemented expression type
   --> $DIR/match-test-ptr-null.rs:17:13
@@ -15,7 +17,7 @@ error[E0080]: could not evaluate repeat length
    |
 LL |       let _: [u8; 0] = [4; { //~ ERROR could not evaluate repeat length
    |  __________________________^
-LL | |         match &1 as *const i32 as usize { //~ ERROR raw pointers cannot be cast to integers
+LL | |         match &1 as *const i32 as usize { //~ ERROR casting pointers to integers in constants
 LL | |             0 => 42, //~ ERROR constant contains unimplemented expression type
    | |             - "pointer arithmetic or comparison" needs an rfc before being allowed inside constants
 LL | |             //~^ NOTE "pointer arithmetic or comparison" needs an rfc before being allowed
@@ -26,5 +28,5 @@ LL | |     }];
 
 error: aborting due to 3 previous errors
 
-Some errors occurred: E0018, E0019, E0080.
-For more information about an error, try `rustc --explain E0018`.
+Some errors occurred: E0019, E0080, E0658.
+For more information about an error, try `rustc --explain E0019`.
index f0f35ce614e613d4d83373d78df9df5e829d25c7..19db07dd330ae895a09c4d002735981c04c6dbd2 100644 (file)
@@ -10,7 +10,7 @@
 
 // compile-pass
 
-#![feature(const_fn)]
+#![feature(const_fn, const_fn_union)]
 
 #![deny(const_err)]
 
diff --git a/src/test/ui/const-eval/promoted_raw_ptr_ops.rs b/src/test/ui/const-eval/promoted_raw_ptr_ops.rs
new file mode 100644 (file)
index 0000000..3b437f6
--- /dev/null
@@ -0,0 +1,18 @@
+// Copyright 2018 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(const_raw_ptr_to_usize_cast, const_compare_raw_pointers, const_raw_ptr_deref)]
+
+fn main() {
+    let x: &'static bool = &(42 as *const i32 == 43 as *const i32);
+    //~^ ERROR does not live long enough
+    let y: &'static usize = &(&1 as *const i32 as usize + 1); //~ ERROR does not live long enough
+    let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough
+}
diff --git a/src/test/ui/const-eval/promoted_raw_ptr_ops.stderr b/src/test/ui/const-eval/promoted_raw_ptr_ops.stderr
new file mode 100644 (file)
index 0000000..90c73c0
--- /dev/null
@@ -0,0 +1,35 @@
+error[E0597]: borrowed value does not live long enough
+  --> $DIR/promoted_raw_ptr_ops.rs:14:29
+   |
+LL |     let x: &'static bool = &(42 as *const i32 == 43 as *const i32);
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
+...
+LL | }
+   | - temporary value only lives until here
+   |
+   = note: borrowed value must be valid for the static lifetime...
+
+error[E0597]: borrowed value does not live long enough
+  --> $DIR/promoted_raw_ptr_ops.rs:16:30
+   |
+LL |     let y: &'static usize = &(&1 as *const i32 as usize + 1); //~ ERROR does not live long enough
+   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
+LL |     let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough
+LL | }
+   | - temporary value only lives until here
+   |
+   = note: borrowed value must be valid for the static lifetime...
+
+error[E0597]: borrowed value does not live long enough
+  --> $DIR/promoted_raw_ptr_ops.rs:17:28
+   |
+LL |     let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough
+   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
+LL | }
+   | - temporary value only lives until here
+   |
+   = note: borrowed value must be valid for the static lifetime...
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0597`.
index 77d5222cb9c74275c1505a1adcefcf9cce6b1545..1758ac72b633b73c720b3c10f0fbfa7f7f8614c0 100644 (file)
@@ -10,6 +10,8 @@
 
 //compile-pass
 
+#![feature(const_fn_union)]
+
 fn main() {}
 
 static FOO: u32 = 42;
index 8ad7f11f0cee8ebe2978cf09362aa58925ef906b..cb942f465e40f3c6f4d9e0ce9349118d084ee432 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(const_fn_union)]
+
 fn main() {
     let n: Int = 40;
     match n {
index 64ea57702d7063b595624f28f0d1c3636cec080e..e82a16c066fdb7d7a1629323bef2d090358de39e 100644 (file)
@@ -1,5 +1,5 @@
 error[E0030]: lower range bound must be less than or equal to upper
-  --> $DIR/ref_to_int_match.rs:15:9
+  --> $DIR/ref_to_int_match.rs:17:9
    |
 LL |         10..=BAR => {}, //~ ERROR lower range bound must be less than or equal to upper
    |         ^^ lower bound larger than upper bound
diff --git a/src/test/ui/custom-attribute-multisegment.rs b/src/test/ui/custom-attribute-multisegment.rs
new file mode 100644 (file)
index 0000000..ad8e0e7
--- /dev/null
@@ -0,0 +1,18 @@
+// Copyright 2018 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.
+
+// Unresolved multi-segment attributes are not treated as custom.
+
+#![feature(custom_attribute, proc_macro_path_invoc)]
+
+mod existent {}
+
+#[existent::nonexistent] //~ ERROR failed to resolve. Could not find `nonexistent` in `existent`
+fn main() {}
diff --git a/src/test/ui/custom-attribute-multisegment.stderr b/src/test/ui/custom-attribute-multisegment.stderr
new file mode 100644 (file)
index 0000000..ff72d1c
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0433]: failed to resolve. Could not find `nonexistent` in `existent`
+  --> $DIR/custom-attribute-multisegment.rs:17:13
+   |
+LL | #[existent::nonexistent] //~ ERROR failed to resolve. Could not find `nonexistent` in `existent`
+   |             ^^^^^^^^^^^ Could not find `nonexistent` in `existent`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0433`.
index be22d8b9b01057f7ff10d81895b95ebde84028b0..911dcd855aad6c2fb21e68161e24fc2368558f55 100644 (file)
@@ -12,7 +12,6 @@
 // aux-build:edition-kw-macro-2015.rs
 // compile-pass
 
-#![feature(raw_identifiers)]
 #![allow(async_idents)]
 
 #[macro_use]
index 713da57f7e2c7f58f50832862ab67a9b37a16eba..02b061f8cbcdba8954b5b393257edd2bf0604bd5 100644 (file)
@@ -11,8 +11,6 @@
 // edition:2018
 // aux-build:edition-kw-macro-2015.rs
 
-#![feature(raw_identifiers)]
-
 #[macro_use]
 extern crate edition_kw_macro_2015;
 
index ceab5ea730ea88ee41ec45245fad64da2b84ecdb..02e7d5b7cd01cc530acf271dc580df69078a0c46 100644 (file)
@@ -1,23 +1,23 @@
 error: expected identifier, found reserved keyword `async`
-  --> $DIR/edition-keywords-2018-2015-parsing.rs:20:13
+  --> $DIR/edition-keywords-2018-2015-parsing.rs:18:13
    |
 LL |     let mut async = 1; //~ ERROR expected identifier, found reserved keyword `async`
    |             ^^^^^ expected identifier, found reserved keyword
 
 error: expected identifier, found reserved keyword `async`
-  --> $DIR/edition-keywords-2018-2015-parsing.rs:30:13
+  --> $DIR/edition-keywords-2018-2015-parsing.rs:28:13
    |
 LL |     module::async(); //~ ERROR expected identifier, found reserved keyword `async`
    |             ^^^^^ expected identifier, found reserved keyword
 
 error: no rules expected the token `r#async`
-  --> $DIR/edition-keywords-2018-2015-parsing.rs:24:31
+  --> $DIR/edition-keywords-2018-2015-parsing.rs:22:31
    |
 LL |     r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`
    |                               ^^^^^^^
 
 error: no rules expected the token `async`
-  --> $DIR/edition-keywords-2018-2015-parsing.rs:25:35
+  --> $DIR/edition-keywords-2018-2015-parsing.rs:23:35
    |
 LL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`
    |                                   ^^^^^
index a1ae1b5d0046a24183e9b4917ddcf6b05248e6d6..81bef913ac6ca8c427715c897d7d9ec51c1e8208 100644 (file)
@@ -11,8 +11,6 @@
 // edition:2018
 // aux-build:edition-kw-macro-2018.rs
 
-#![feature(raw_identifiers)]
-
 #[macro_use]
 extern crate edition_kw_macro_2018;
 
index 91d0b2d30b5f99d9e34ba5bd26eba28ac4048ad4..c6e0927a3a4359fee26649e36ea5ff1e64bf4e61 100644 (file)
@@ -1,5 +1,5 @@
 error: expected identifier, found reserved keyword `async`
-  --> $DIR/edition-keywords-2018-2018-expansion.rs:20:5
+  --> $DIR/edition-keywords-2018-2018-expansion.rs:18:5
    |
 LL |     produces_async! {} //~ ERROR expected identifier, found reserved keyword `async`
    |     ^^^^^^^^^^^^^^^^^^ expected identifier, found reserved keyword
index 263ec95caa7d6a3d31b5d4ddcd201e644ea644ab..565c2f2dc742bfa408de42fc43b37e4e07f591b4 100644 (file)
@@ -11,8 +11,6 @@
 // edition:2018
 // aux-build:edition-kw-macro-2018.rs
 
-#![feature(raw_identifiers)]
-
 #[macro_use]
 extern crate edition_kw_macro_2018;
 
index e48aac0a2bba9397512535d3ebce84ead33506e2..435e395c2910e39919a5c93dbc27d244b53a55ff 100644 (file)
@@ -1,23 +1,23 @@
 error: expected identifier, found reserved keyword `async`
-  --> $DIR/edition-keywords-2018-2018-parsing.rs:20:13
+  --> $DIR/edition-keywords-2018-2018-parsing.rs:18:13
    |
 LL |     let mut async = 1; //~ ERROR expected identifier, found reserved keyword `async`
    |             ^^^^^ expected identifier, found reserved keyword
 
 error: expected identifier, found reserved keyword `async`
-  --> $DIR/edition-keywords-2018-2018-parsing.rs:30:13
+  --> $DIR/edition-keywords-2018-2018-parsing.rs:28:13
    |
 LL |     module::async(); //~ ERROR expected identifier, found reserved keyword `async`
    |             ^^^^^ expected identifier, found reserved keyword
 
 error: no rules expected the token `r#async`
-  --> $DIR/edition-keywords-2018-2018-parsing.rs:24:31
+  --> $DIR/edition-keywords-2018-2018-parsing.rs:22:31
    |
 LL |     r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`
    |                               ^^^^^^^
 
 error: no rules expected the token `async`
-  --> $DIR/edition-keywords-2018-2018-parsing.rs:25:35
+  --> $DIR/edition-keywords-2018-2018-parsing.rs:23:35
    |
 LL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`
    |                                   ^^^^^
index 00008ea6b6f376a08a4460e2a8e1b2d10befb2e7..617050732b7de48295e3ea180747b5a146e00072 100644 (file)
@@ -8,9 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// gate-test-const_compare_raw_pointers
+
 static FOO: i32 = 42;
 static BAR: i32 = 42;
 
-static BAZ: bool = { (&FOO as *const i32) == (&BAR as *const i32) }; //~ ERROR E0395
+static BAZ: bool = { (&FOO as *const i32) == (&BAR as *const i32) }; //~ ERROR issue #53020
 fn main() {
 }
index ee90df798706a92c64e7943f72d1db57c5cd11fd..0fb9a9e854ddb9d5b09882c8ecd4207f4360d703 100644 (file)
@@ -1,9 +1,11 @@
-error[E0395]: raw pointers cannot be compared in statics
-  --> $DIR/E0395.rs:14:22
+error[E0658]: comparing raw pointers inside static (see issue #53020)
+  --> $DIR/E0395.rs:16:22
    |
-LL | static BAZ: bool = { (&FOO as *const i32) == (&BAR as *const i32) }; //~ ERROR E0395
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comparing raw pointers in static
+LL | static BAZ: bool = { (&FOO as *const i32) == (&BAR as *const i32) }; //~ ERROR issue #53020
+   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: add #![feature(const_compare_raw_pointers)] to the crate attributes to enable
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0395`.
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/error-codes/E0396-fixed.rs b/src/test/ui/error-codes/E0396-fixed.rs
new file mode 100644 (file)
index 0000000..08d20e7
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2016 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(const_raw_ptr_deref)]
+
+const REG_ADDR: *const u8 = 0x5f3759df as *const u8;
+
+const VALUE: u8 = unsafe { *REG_ADDR };
+//~^ ERROR this constant cannot be used
+
+fn main() {
+}
diff --git a/src/test/ui/error-codes/E0396-fixed.stderr b/src/test/ui/error-codes/E0396-fixed.stderr
new file mode 100644 (file)
index 0000000..7d3c98c
--- /dev/null
@@ -0,0 +1,12 @@
+error: this constant cannot be used
+  --> $DIR/E0396-fixed.rs:15:1
+   |
+LL | const VALUE: u8 = unsafe { *REG_ADDR };
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^---------^^^
+   |                            |
+   |                            a memory access tried to interpret some bytes as a pointer
+   |
+   = note: #[deny(const_err)] on by default
+
+error: aborting due to previous error
+
index 7f34acdfb90075f32480553b877b6573c223ab06..1ee8a74a465479e87e05f6cfb749360a844bf5f3 100644 (file)
@@ -8,9 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// gate-test-const_raw_ptr_deref
+
 const REG_ADDR: *const u8 = 0x5f3759df as *const u8;
 
-const VALUE: u8 = unsafe { *REG_ADDR }; //~ ERROR E0396
+const VALUE: u8 = unsafe { *REG_ADDR };
+//~^ ERROR dereferencing raw pointers in constants is unstable
 
 fn main() {
 }
index 87dfd50dc97357b5294bc6dcccaf4f2bbdd84e9d..a2a2e7243588fc56038a166f7dcb2ad97b9f8623 100644 (file)
@@ -1,9 +1,11 @@
-error[E0396]: raw pointers cannot be dereferenced in constants
-  --> $DIR/E0396.rs:13:28
+error[E0658]: dereferencing raw pointers in constants is unstable (see issue #51911)
+  --> $DIR/E0396.rs:15:28
    |
-LL | const VALUE: u8 = unsafe { *REG_ADDR }; //~ ERROR E0396
-   |                            ^^^^^^^^^ dereference of raw pointer in constant
+LL | const VALUE: u8 = unsafe { *REG_ADDR };
+   |                            ^^^^^^^^^
+   |
+   = help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0396`.
+For more information about this error, try `rustc --explain E0658`.
index 0ac295c54bccbb34ae8206916228d87fbd2e51f0..3f9104373d6efb1e0fc69c458838fdda9743c3c6 100644 (file)
@@ -8,11 +8,10 @@ error: unsatisfied lifetime constraints
   --> $DIR/E0621-does-not-trigger-for-closures.rs:25:26
    |
 LL |     invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
-   |                ----------^^^^^-----------------
-   |                |   |     |
-   |                |   |     requires that `'1` must outlive `'2`
-   |                |   has type `&'1 i32`
-   |                lifetime `'2` appears in return type
+   |                    --    ^^^^^ requires that `'1` must outlive `'2`
+   |                    ||
+   |                    |return type of closure is &'2 i32
+   |                    has type `&'1 i32`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.rs b/src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.rs
new file mode 100644 (file)
index 0000000..b7e07e1
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright 2017 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.
+
+#![allow(warnings)]
+
+// Make sure this related feature didn't accidentally enable this
+#![feature(in_band_lifetimes)]
+
+trait MyTrait<'a> { }
+
+impl MyTrait<'a> for &u32 { }
+//~^ ERROR missing lifetime specifier
+
+struct MyStruct;
+trait MarkerTrait {}
+
+impl MarkerTrait for &'_ MyStruct { }
+//~^ ERROR missing lifetime specifier
+
+fn main() {}
diff --git a/src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.stderr b/src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.stderr
new file mode 100644 (file)
index 0000000..9487d11
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0106]: missing lifetime specifier
+  --> $DIR/feature-gate-impl_header_lifetime_elision-with-in_band.rs:18:22
+   |
+LL | impl MyTrait<'a> for &u32 { }
+   |                      ^ expected lifetime parameter
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/feature-gate-impl_header_lifetime_elision-with-in_band.rs:24:23
+   |
+LL | impl MarkerTrait for &'_ MyStruct { }
+   |                       ^^ expected lifetime parameter
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/feature-gate-impl_header_lifetime_elision.rs b/src/test/ui/feature-gate-impl_header_lifetime_elision.rs
new file mode 100644 (file)
index 0000000..3eb2ac1
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2017 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.
+
+#![allow(warnings)]
+
+trait MyTrait<'a> { }
+
+impl<'a> MyTrait<'a> for &u32 { }
+//~^ ERROR missing lifetime specifier
+
+impl<'a> MyTrait<'_> for &'a f32 { }
+//~^ ERROR missing lifetime specifier
+
+fn main() {}
diff --git a/src/test/ui/feature-gate-impl_header_lifetime_elision.stderr b/src/test/ui/feature-gate-impl_header_lifetime_elision.stderr
new file mode 100644 (file)
index 0000000..2c8a7dd
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0106]: missing lifetime specifier
+  --> $DIR/feature-gate-impl_header_lifetime_elision.rs:15:26
+   |
+LL | impl<'a> MyTrait<'a> for &u32 { }
+   |                          ^ expected lifetime parameter
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/feature-gate-impl_header_lifetime_elision.rs:18:18
+   |
+LL | impl<'a> MyTrait<'_> for &'a f32 { }
+   |                  ^^ expected lifetime parameter
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/feature-gate-in_band_lifetimes-impl.rs b/src/test/ui/feature-gate-in_band_lifetimes-impl.rs
deleted file mode 100644 (file)
index 3eb2ac1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2017 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.
-
-#![allow(warnings)]
-
-trait MyTrait<'a> { }
-
-impl<'a> MyTrait<'a> for &u32 { }
-//~^ ERROR missing lifetime specifier
-
-impl<'a> MyTrait<'_> for &'a f32 { }
-//~^ ERROR missing lifetime specifier
-
-fn main() {}
diff --git a/src/test/ui/feature-gate-in_band_lifetimes-impl.stderr b/src/test/ui/feature-gate-in_band_lifetimes-impl.stderr
deleted file mode 100644 (file)
index 95bf81f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0106]: missing lifetime specifier
-  --> $DIR/feature-gate-in_band_lifetimes-impl.rs:15:26
-   |
-LL | impl<'a> MyTrait<'a> for &u32 { }
-   |                          ^ expected lifetime parameter
-
-error[E0106]: missing lifetime specifier
-  --> $DIR/feature-gate-in_band_lifetimes-impl.rs:18:18
-   |
-LL | impl<'a> MyTrait<'_> for &'a f32 { }
-   |                  ^^ expected lifetime parameter
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0106`.
index ae1f81c2f5721fd54742b3036ebd2b7d0dcb8b60..23b30711cf3c0540ca5761918683d7f4ac21da67 100644 (file)
@@ -10,6 +10,9 @@
 
 #![allow(warnings)]
 
+// Make sure this related feature didn't accidentally enable this
+#![feature(impl_header_lifetime_elision)]
+
 fn foo(x: &'x u8) -> &'x u8 { x }
 //~^ ERROR use of undeclared lifetime name
 //~^^ ERROR use of undeclared lifetime name
index cc0855306e162e97d984ca8807d8cebbd90b6aeb..5fe143959d2c5470e41e239b7fd4f4eb127c2739 100644 (file)
 error[E0261]: use of undeclared lifetime name `'x`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:13:12
+  --> $DIR/feature-gate-in_band_lifetimes.rs:16:12
    |
 LL | fn foo(x: &'x u8) -> &'x u8 { x }
    |            ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'x`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:13:23
+  --> $DIR/feature-gate-in_band_lifetimes.rs:16:23
    |
 LL | fn foo(x: &'x u8) -> &'x u8 { x }
    |                       ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:25:12
+  --> $DIR/feature-gate-in_band_lifetimes.rs:28:12
    |
 LL | impl<'a> X<'b> {
    |            ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:27:27
+  --> $DIR/feature-gate-in_band_lifetimes.rs:30:27
    |
 LL |     fn inner_2(&self) -> &'b u8 {
    |                           ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:33:8
+  --> $DIR/feature-gate-in_band_lifetimes.rs:36:8
    |
 LL | impl X<'b> {
    |        ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:35:27
+  --> $DIR/feature-gate-in_band_lifetimes.rs:38:27
    |
 LL |     fn inner_3(&self) -> &'b u8 {
    |                           ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'a`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:43:9
+  --> $DIR/feature-gate-in_band_lifetimes.rs:46:9
    |
 LL | impl Y<&'a u8> {
    |         ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'a`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:45:25
+  --> $DIR/feature-gate-in_band_lifetimes.rs:48:25
    |
 LL |     fn inner(&self) -> &'a u8 {
    |                         ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:53:27
+  --> $DIR/feature-gate-in_band_lifetimes.rs:56:27
    |
 LL |     fn any_lifetime() -> &'b u8;
    |                           ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:55:27
+  --> $DIR/feature-gate-in_band_lifetimes.rs:58:27
    |
 LL |     fn borrowed_lifetime(&'b self) -> &'b u8;
    |                           ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:55:40
+  --> $DIR/feature-gate-in_band_lifetimes.rs:58:40
    |
 LL |     fn borrowed_lifetime(&'b self) -> &'b u8;
    |                                        ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'a`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:60:14
+  --> $DIR/feature-gate-in_band_lifetimes.rs:63:14
    |
 LL | impl MyTrait<'a> for Y<&'a u8> {
    |              ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'a`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:60:25
+  --> $DIR/feature-gate-in_band_lifetimes.rs:63:25
    |
 LL | impl MyTrait<'a> for Y<&'a u8> {
    |                         ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'a`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:63:31
+  --> $DIR/feature-gate-in_band_lifetimes.rs:66:31
    |
 LL |     fn my_lifetime(&self) -> &'a u8 { self.0 }
    |                               ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:65:27
+  --> $DIR/feature-gate-in_band_lifetimes.rs:68:27
    |
 LL |     fn any_lifetime() -> &'b u8 { &0 }
    |                           ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:67:27
+  --> $DIR/feature-gate-in_band_lifetimes.rs:70:27
    |
 LL |     fn borrowed_lifetime(&'b self) -> &'b u8 { &*self.0 }
    |                           ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/feature-gate-in_band_lifetimes.rs:67:40
+  --> $DIR/feature-gate-in_band_lifetimes.rs:70:40
    |
 LL |     fn borrowed_lifetime(&'b self) -> &'b u8 { &*self.0 }
    |                                        ^^ undeclared lifetime
index 5271f75b6328cd895de19e060f2abaaff2815838..77080e3c348f99390781f48e54d0925a895311df 100644 (file)
@@ -27,9 +27,9 @@ macro_rules! emits_nothing(
 #[link(name = "rust_test_helpers", kind = "static")]
 extern {
     returns_isize!(rust_get_test_int);
-    //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+    //~^ ERROR macro invocations in `extern {}` blocks are experimental
     takes_u32_returns_u32!(rust_dbg_extern_identity_u32);
-    //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+    //~^ ERROR macro invocations in `extern {}` blocks are experimental
     emits_nothing!();
-    //~^ ERROR macro invocations in `extern {}` blocks are experimental.
+    //~^ ERROR macro invocations in `extern {}` blocks are experimental
 }
index 5d7e01fbbb752d895d42b4468c9abfffaa5cefb5..23b63078dbf8e7c0126e210b042b40dad5a7d949 100644 (file)
@@ -1,4 +1,4 @@
-error[E0658]: macro and proc-macro invocations in `extern {}` blocks are experimental. (see issue #49476)
+error[E0658]: macro invocations in `extern {}` blocks are experimental (see issue #49476)
   --> $DIR/feature-gate-macros_in_extern.rs:29:5
    |
 LL |     returns_isize!(rust_get_test_int);
@@ -6,7 +6,7 @@ LL |     returns_isize!(rust_get_test_int);
    |
    = help: add #![feature(macros_in_extern)] to the crate attributes to enable
 
-error[E0658]: macro and proc-macro invocations in `extern {}` blocks are experimental. (see issue #49476)
+error[E0658]: macro invocations in `extern {}` blocks are experimental (see issue #49476)
   --> $DIR/feature-gate-macros_in_extern.rs:31:5
    |
 LL |     takes_u32_returns_u32!(rust_dbg_extern_identity_u32);
@@ -14,7 +14,7 @@ LL |     takes_u32_returns_u32!(rust_dbg_extern_identity_u32);
    |
    = help: add #![feature(macros_in_extern)] to the crate attributes to enable
 
-error[E0658]: macro and proc-macro invocations in `extern {}` blocks are experimental. (see issue #49476)
+error[E0658]: macro invocations in `extern {}` blocks are experimental (see issue #49476)
   --> $DIR/feature-gate-macros_in_extern.rs:33:5
    |
 LL |     emits_nothing!();
index c8f9cd943cdaaf9ab61d41e2b71cc1faefbef3e0..681842e30e006c8ea1415a112a59d7c2465c3e0f 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -C no-prepopulate-passes
+// compile-flags: -C no-prepopulate-passes -Cpasses=name-anon-globals
 
 #![crate_type = "lib"]
 
diff --git a/src/test/ui/feature-gate/duplicate-features.rs b/src/test/ui/feature-gate/duplicate-features.rs
new file mode 100644 (file)
index 0000000..163a287
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2018 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.
+
+#![allow(stable_features)]
+
+#![feature(rust1)]
+#![feature(rust1)] //~ ERROR the feature `rust1` has already been declared
+
+#![feature(if_let)]
+#![feature(if_let)] //~ ERROR the feature `if_let` has already been declared
+
+fn main() {}
diff --git a/src/test/ui/feature-gate/duplicate-features.stderr b/src/test/ui/feature-gate/duplicate-features.stderr
new file mode 100644 (file)
index 0000000..d55297b
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0636]: the feature `if_let` has already been declared
+  --> $DIR/duplicate-features.rs:17:12
+   |
+LL | #![feature(if_let)] //~ ERROR the feature `if_let` has already been declared
+   |            ^^^^^^
+
+error[E0636]: the feature `rust1` has already been declared
+  --> $DIR/duplicate-features.rs:14:12
+   |
+LL | #![feature(rust1)] //~ ERROR the feature `rust1` has already been declared
+   |            ^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0636`.
index db50b9514430c581908a99c5ef87b074bec89abe..dd235cb9c3aa99aca11448d031af4be7e1cd09f6 100644 (file)
@@ -43,6 +43,7 @@
 #![feature(rustc_attrs)] // For `rustc_error`; see note below.
 #![warn(unused_attributes, unknown_lints)]
 #![allow(dead_code)]
+#![allow(stable_features)]
 
 // UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES
 
 // For #![crate_id], see issue #43142. (I cannot bear to enshrine current behavior in a test)
 
 // FIXME(#44232) we should warn that this isn't used.
-#![feature                    ( x0600)]
+#![feature                    ( rust1)]
 
 // For #![no_start], see issue #43144. (I cannot bear to enshrine current behavior in a test)
 
index 2dbe9831014666f81eb9eb0ca9331b136e523a8e..fd38fb6f9764196d3fce28abd8c451c55edbf24e 100644 (file)
@@ -1,5 +1,5 @@
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:49:33
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:50:33
    |
 LL | #![warn                        (x5400)] //~ WARN unknown lint: `x5400`
    |                                 ^^^^^
@@ -11,175 +11,175 @@ LL | #![warn(unused_attributes, unknown_lints)]
    |                            ^^^^^^^^^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:50:33
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:51:33
    |
 LL | #![allow                       (x5300)] //~ WARN unknown lint: `x5300`
    |                                 ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:51:33
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:52:33
    |
 LL | #![forbid                      (x5200)] //~ WARN unknown lint: `x5200`
    |                                 ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:52:33
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:53:33
    |
 LL | #![deny                        (x5100)] //~ WARN unknown lint: `x5100`
    |                                 ^^^^^
 
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:114:8
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:115:8
    |
 LL | #[warn(x5400)]
    |        ^^^^^
 
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:117:25
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:118:25
    |
 LL |     mod inner { #![warn(x5400)] }
    |                         ^^^^^
 
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:120:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:121:12
    |
 LL |     #[warn(x5400)] fn f() { }
    |            ^^^^^
 
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:123:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:124:12
    |
 LL |     #[warn(x5400)] struct S;
    |            ^^^^^
 
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:126:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:127:12
    |
 LL |     #[warn(x5400)] type T = S;
    |            ^^^^^
 
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:129:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:130:12
    |
 LL |     #[warn(x5400)] impl S { }
    |            ^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:133:9
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:134:9
    |
 LL | #[allow(x5300)]
    |         ^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:136:26
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:137:26
    |
 LL |     mod inner { #![allow(x5300)] }
    |                          ^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:139:13
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:140:13
    |
 LL |     #[allow(x5300)] fn f() { }
    |             ^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:142:13
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:143:13
    |
 LL |     #[allow(x5300)] struct S;
    |             ^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:145:13
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:146:13
    |
 LL |     #[allow(x5300)] type T = S;
    |             ^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:148:13
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:149:13
    |
 LL |     #[allow(x5300)] impl S { }
    |             ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:152:10
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:153:10
    |
 LL | #[forbid(x5200)]
    |          ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:155:27
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:156:27
    |
 LL |     mod inner { #![forbid(x5200)] }
    |                           ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:158:14
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:159:14
    |
 LL |     #[forbid(x5200)] fn f() { }
    |              ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:161:14
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:162:14
    |
 LL |     #[forbid(x5200)] struct S;
    |              ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:164:14
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:165:14
    |
 LL |     #[forbid(x5200)] type T = S;
    |              ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:167:14
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:168:14
    |
 LL |     #[forbid(x5200)] impl S { }
    |              ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:171:8
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:172:8
    |
 LL | #[deny(x5100)]
    |        ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:174:25
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:175:25
    |
 LL |     mod inner { #![deny(x5100)] }
    |                         ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:177:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:178:12
    |
 LL |     #[deny(x5100)] fn f() { }
    |            ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:180:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:181:12
    |
 LL |     #[deny(x5100)] struct S;
    |            ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:183:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:184:12
    |
 LL |     #[deny(x5100)] type T = S;
    |            ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:186:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:187:12
    |
 LL |     #[deny(x5100)] impl S { }
    |            ^^^^^
 
 warning: macro_escape is a deprecated synonym for macro_use
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:500:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:501:1
    |
 LL | #[macro_escape]
    | ^^^^^^^^^^^^^^^
 
 warning: macro_escape is a deprecated synonym for macro_use
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:503:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:504:17
    |
 LL |     mod inner { #![macro_escape] }
    |                 ^^^^^^^^^^^^^^^^
@@ -187,7 +187,7 @@ LL |     mod inner { #![macro_escape] }
    = help: consider an outer attribute, #[macro_use] mod ...
 
 warning: `repr` attribute isn't configurable with a literal
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:316:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:317:17
    |
 LL |     mod inner { #![repr="3900"] }
    |                 ^^^^^^^^^^^^^^^ needs a hint
@@ -197,7 +197,7 @@ LL |     mod inner { #![repr="3900"] }
    = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html>
 
 warning: `repr` attribute isn't configurable with a literal
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:320:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:321:5
    |
 LL |     #[repr = "3900"] fn f() { }
    |     ^^^^^^^^^^^^^^^^ needs a hint
@@ -206,7 +206,7 @@ LL |     #[repr = "3900"] fn f() { }
    = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html>
 
 warning: `repr` attribute isn't configurable with a literal
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:326:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:327:5
    |
 LL |     #[repr = "3900"] type T = S;
    |     ^^^^^^^^^^^^^^^^ needs a hint
@@ -215,7 +215,7 @@ LL |     #[repr = "3900"] type T = S;
    = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html>
 
 warning: `repr` attribute isn't configurable with a literal
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:330:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:331:5
    |
 LL |     #[repr = "3900"] impl S { }
    |     ^^^^^^^^^^^^^^^^ needs a hint
@@ -224,7 +224,7 @@ LL |     #[repr = "3900"] impl S { }
    = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html>
 
 warning: `repr` attribute isn't configurable with a literal
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:312:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:313:1
    |
 LL | #[repr = "3900"]
    | ^^^^^^^^^^^^^^^^ needs a hint
@@ -233,7 +233,7 @@ LL | #[repr = "3900"]
    = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html>
 
 warning: `repr` attribute isn't configurable with a literal
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:62:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:63:1
    |
 LL | #![repr                       = "3900"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ needs a hint
@@ -242,7 +242,7 @@ LL | #![repr                       = "3900"]
    = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html>
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:194:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:195:5
    |
 LL |     #[macro_use] fn f() { }
    |     ^^^^^^^^^^^^
@@ -254,277 +254,277 @@ LL | #![warn(unused_attributes, unknown_lints)]
    |         ^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:197:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:198:5
    |
 LL |     #[macro_use] struct S;
    |     ^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:200:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:201:5
    |
 LL |     #[macro_use] type T = S;
    |     ^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:203:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:204:5
    |
 LL |     #[macro_use] impl S { }
    |     ^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:210:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:211:17
    |
 LL |     mod inner { #![macro_export="4800"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:213:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:214:5
    |
 LL |     #[macro_export = "4800"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:216:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:217:5
    |
 LL |     #[macro_export = "4800"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:219:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:220:5
    |
 LL |     #[macro_export = "4800"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:222:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:223:5
    |
 LL |     #[macro_export = "4800"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:207:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:208:1
    |
 LL | #[macro_export = "4800"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:229:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:230:17
    |
 LL |     mod inner { #![plugin_registrar="4700"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:234:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:235:5
    |
 LL |     #[plugin_registrar = "4700"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:237:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:238:5
    |
 LL |     #[plugin_registrar = "4700"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:240:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:5
    |
 LL |     #[plugin_registrar = "4700"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:226:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:227:1
    |
 LL | #[plugin_registrar = "4700"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:247:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:248:17
    |
 LL |     mod inner { #![main="4300"] }
    |                 ^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:252:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:253:5
    |
 LL |     #[main = "4400"] struct S;
    |     ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:255:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:256:5
    |
 LL |     #[main = "4400"] type T = S;
    |     ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:258:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:259:5
    |
 LL |     #[main = "4400"] impl S { }
    |     ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:244:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:245:1
    |
 LL | #[main = "4400"]
    | ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:265:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:266:17
    |
 LL |     mod inner { #![start="4300"] }
    |                 ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:270:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:271:5
    |
 LL |     #[start = "4300"] struct S;
    |     ^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:273:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:274:5
    |
 LL |     #[start = "4300"] type T = S;
    |     ^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:276:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:277:5
    |
 LL |     #[start = "4300"] impl S { }
    |     ^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:262:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:263:1
    |
 LL | #[start = "4300"]
    | ^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:316:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:317:17
    |
 LL |     mod inner { #![repr="3900"] }
    |                 ^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:320:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:321:5
    |
 LL |     #[repr = "3900"] fn f() { }
    |     ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:326:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:327:5
    |
 LL |     #[repr = "3900"] type T = S;
    |     ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:330:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:331:5
    |
 LL |     #[repr = "3900"] impl S { }
    |     ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:312:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:313:1
    |
 LL | #[repr = "3900"]
    | ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:339:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:340:5
    |
 LL |     #[path = "3800"] fn f() { }
    |     ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:342:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:343:5
    |
 LL |     #[path = "3800"]  struct S;
    |     ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:345:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:346:5
    |
 LL |     #[path = "3800"] type T = S;
    |     ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:348:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:349:5
    |
 LL |     #[path = "3800"] impl S { }
    |     ^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:355:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:356:17
    |
 LL |     mod inner { #![abi="3700"] }
    |                 ^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:358:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:359:5
    |
 LL |     #[abi = "3700"] fn f() { }
    |     ^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:362:5
    |
 LL |     #[abi = "3700"] struct S;
    |     ^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:364:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:365:5
    |
 LL |     #[abi = "3700"] type T = S;
    |     ^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:368:5
    |
 LL |     #[abi = "3700"] impl S { }
    |     ^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:352:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:353:1
    |
 LL | #[abi = "3700"]
    | ^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:374:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:375:17
    |
 LL |     mod inner { #![automatically_derived="3600"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:377:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:378:5
    |
 LL |     #[automatically_derived = "3600"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:381:5
    |
 LL |     #[automatically_derived = "3600"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:383:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:384:5
    |
 LL |     #[automatically_derived = "3600"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:386:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:387:5
    |
 LL |     #[automatically_derived = "3600"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:371:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:372:1
    |
 LL | #[automatically_derived = "3600"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: function is marked #[no_mangle], but not exported
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:394:27
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:395:27
    |
 LL |     #[no_mangle = "3500"] fn f() { }
    |                           -^^^^^^^^^
@@ -534,787 +534,787 @@ LL |     #[no_mangle = "3500"] fn f() { }
    = note: #[warn(private_no_mangle_fns)] on by default
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:407:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:408:17
    |
 LL |     mod inner { #![no_link="3400"] }
    |                 ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:410:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:5
    |
 LL |     #[no_link = "3400"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:413:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:5
    |
 LL |     #[no_link = "3400"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:416:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:417:5
    |
 LL |     #[no_link = "3400"]type T = S;
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:419:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:420:5
    |
 LL |     #[no_link = "3400"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:404:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:405:1
    |
 LL | #[no_link = "3400"]
    | ^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:427:17
    |
 LL |     mod inner { #![should_panic="3200"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:429:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:430:5
    |
 LL |     #[should_panic = "3200"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:433:5
    |
 LL |     #[should_panic = "3200"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:435:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:436:5
    |
 LL |     #[should_panic = "3200"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:438:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:439:5
    |
 LL |     #[should_panic = "3200"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:423:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:424:1
    |
 LL | #[should_panic = "3200"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:445:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:446:17
    |
 LL |     mod inner { #![ignore="3100"] }
    |                 ^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:448:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:449:5
    |
 LL |     #[ignore = "3100"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:451:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:452:5
    |
 LL |     #[ignore = "3100"] struct S;
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:454:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:455:5
    |
 LL |     #[ignore = "3100"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:5
    |
 LL |     #[ignore = "3100"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:442:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:443:1
    |
 LL | #[ignore = "3100"]
    | ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:464:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:17
    |
 LL |     mod inner { #![no_implicit_prelude="3000"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:467:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:468:5
    |
 LL |     #[no_implicit_prelude = "3000"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:471:5
    |
 LL |     #[no_implicit_prelude = "3000"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:474:5
    |
 LL |     #[no_implicit_prelude = "3000"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:477:5
    |
 LL |     #[no_implicit_prelude = "3000"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:461:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:1
    |
 LL | #[no_implicit_prelude = "3000"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:483:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:484:17
    |
 LL |     mod inner { #![reexport_test_harness_main="2900"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:486:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:487:5
    |
 LL |     #[reexport_test_harness_main = "2900"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:489:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:490:5
    |
 LL |     #[reexport_test_harness_main = "2900"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:492:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:493:5
    |
 LL |     #[reexport_test_harness_main = "2900"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:495:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:496:5
    |
 LL |     #[reexport_test_harness_main = "2900"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:480:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:481:1
    |
 LL | #[reexport_test_harness_main = "2900"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:506:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:507:5
    |
 LL |     #[macro_escape] fn f() { }
    |     ^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:509:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:510:5
    |
 LL |     #[macro_escape] struct S;
    |     ^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:513:5
    |
 LL |     #[macro_escape] type T = S;
    |     ^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:515:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:516:5
    |
 LL |     #[macro_escape] impl S { }
    |     ^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:523:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:524:17
    |
 LL |     mod inner { #![no_std="2600"] }
    |                 ^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:523:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:524:17
    |
 LL |     mod inner { #![no_std="2600"] }
    |                 ^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:527:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:528:5
    |
 LL |     #[no_std = "2600"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:527:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:528:5
    |
 LL |     #[no_std = "2600"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:531:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:532:5
    |
 LL |     #[no_std = "2600"] struct S;
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:531:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:532:5
    |
 LL |     #[no_std = "2600"] struct S;
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:535:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:536:5
    |
 LL |     #[no_std = "2600"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:535:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:536:5
    |
 LL |     #[no_std = "2600"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:539:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:540:5
    |
 LL |     #[no_std = "2600"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:539:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:540:5
    |
 LL |     #[no_std = "2600"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:519:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:520:1
    |
 LL | #[no_std = "2600"]
    | ^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:519:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:520:1
    |
 LL | #[no_std = "2600"]
    | ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:678:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:17
    |
 LL |     mod inner { #![crate_name="0900"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:678:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:17
    |
 LL |     mod inner { #![crate_name="0900"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:682:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683:5
    |
 LL |     #[crate_name = "0900"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:682:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683:5
    |
 LL |     #[crate_name = "0900"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:686:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:5
    |
 LL |     #[crate_name = "0900"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:686:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:5
    |
 LL |     #[crate_name = "0900"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:690:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5
    |
 LL |     #[crate_name = "0900"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:690:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5
    |
 LL |     #[crate_name = "0900"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:694:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5
    |
 LL |     #[crate_name = "0900"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:694:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5
    |
 LL |     #[crate_name = "0900"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:674:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:1
    |
 LL | #[crate_name = "0900"]
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:674:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:1
    |
 LL | #[crate_name = "0900"]
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:17
    |
 LL |     mod inner { #![crate_type="0800"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:704:17
    |
 LL |     mod inner { #![crate_type="0800"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:5
    |
 LL |     #[crate_type = "0800"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:5
    |
 LL |     #[crate_type = "0800"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:711:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:5
    |
 LL |     #[crate_type = "0800"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:711:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:5
    |
 LL |     #[crate_type = "0800"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:715:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:5
    |
 LL |     #[crate_type = "0800"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:715:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:5
    |
 LL |     #[crate_type = "0800"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:719:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5
    |
 LL |     #[crate_type = "0800"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:719:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5
    |
 LL |     #[crate_type = "0800"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:1
    |
 LL | #[crate_type = "0800"]
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:1
    |
 LL | #[crate_type = "0800"]
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:17
    |
 LL |     mod inner { #![feature(x0600)] }
    |                 ^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:17
    |
 LL |     mod inner { #![feature(x0600)] }
    |                 ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:732:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5
    |
 LL |     #[feature(x0600)] fn f() { }
    |     ^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:732:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:5
    |
 LL |     #[feature(x0600)] fn f() { }
    |     ^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:736:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:5
    |
 LL |     #[feature(x0600)] struct S;
    |     ^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:736:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:5
    |
 LL |     #[feature(x0600)] struct S;
    |     ^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:740:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:741:5
    |
 LL |     #[feature(x0600)] type T = S;
    |     ^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:740:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:741:5
    |
 LL |     #[feature(x0600)] type T = S;
    |     ^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:5
    |
 LL |     #[feature(x0600)] impl S { }
    |     ^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:5
    |
 LL |     #[feature(x0600)] impl S { }
    |     ^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:1
    |
 LL | #[feature(x0600)]
    | ^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:1
    |
 LL | #[feature(x0600)]
    | ^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:754:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:17
    |
 LL |     mod inner { #![no_main="0400"] }
    |                 ^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:754:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:17
    |
 LL |     mod inner { #![no_main="0400"] }
    |                 ^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:758:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5
    |
 LL |     #[no_main = "0400"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:758:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5
    |
 LL |     #[no_main = "0400"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:762:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:5
    |
 LL |     #[no_main = "0400"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:762:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:5
    |
 LL |     #[no_main = "0400"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:766:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:767:5
    |
 LL |     #[no_main = "0400"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:766:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:767:5
    |
 LL |     #[no_main = "0400"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:770:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:771:5
    |
 LL |     #[no_main = "0400"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:770:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:771:5
    |
 LL |     #[no_main = "0400"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:1
    |
 LL | #[no_main = "0400"]
    | ^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:1
    |
 LL | #[no_main = "0400"]
    | ^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:17
    |
 LL |     mod inner { #![recursion_limit="0200"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:17
    |
 LL |     mod inner { #![recursion_limit="0200"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:796:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:797:5
    |
 LL |     #[recursion_limit="0200"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:796:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:797:5
    |
 LL |     #[recursion_limit="0200"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:800:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:5
    |
 LL |     #[recursion_limit="0200"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:800:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:5
    |
 LL |     #[recursion_limit="0200"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:804:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805:5
    |
 LL |     #[recursion_limit="0200"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:804:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805:5
    |
 LL |     #[recursion_limit="0200"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:808:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:809:5
    |
 LL |     #[recursion_limit="0200"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:808:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:809:5
    |
 LL |     #[recursion_limit="0200"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:1
    |
 LL | #[recursion_limit="0200"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:1
    |
 LL | #[recursion_limit="0200"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:817:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:17
    |
 LL |     mod inner { #![type_length_limit="0100"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:817:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:818:17
    |
 LL |     mod inner { #![type_length_limit="0100"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:821:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:822:5
    |
 LL |     #[type_length_limit="0100"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:821:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:822:5
    |
 LL |     #[type_length_limit="0100"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:825:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:5
    |
 LL |     #[type_length_limit="0100"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:825:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:5
    |
 LL |     #[type_length_limit="0100"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:829:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830:5
    |
 LL |     #[type_length_limit="0100"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:829:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830:5
    |
 LL |     #[type_length_limit="0100"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:833:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:834:5
    |
 LL |     #[type_length_limit="0100"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:833:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:834:5
    |
 LL |     #[type_length_limit="0100"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:813:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:1
    |
 LL | #[type_length_limit="0100"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:813:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:814:1
    |
 LL | #[type_length_limit="0100"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:54:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:1
    |
 LL | #![macro_export               = "4800"] //~ WARN unused attribute
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:56:1
    |
 LL | #![plugin_registrar           = "4700"] //~ WARN unused attribute
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:58:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1
    |
 LL | #![main                      = "x4400"] //~ WARN unused attribute
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1
    |
 LL | #![start                     = "x4300"] //~ WARN unused attribute
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:62:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:63:1
    |
 LL | #![repr                       = "3900"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:65:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:66:1
    |
 LL | #![path                       = "3800"] //~ WARN unused attribute
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:66:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:67:1
    |
 LL | #![abi                        = "3700"] //~ WARN unused attribute
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:67:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:68:1
    |
 LL | #![automatically_derived      = "3600"] //~ WARN unused attribute
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:69:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:70:1
    |
 LL | #![no_link                    = "3400"] //~ WARN unused attribute
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:71:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:72:1
    |
 LL | #![should_panic               = "3200"] //~ WARN unused attribute
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:72:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:73:1
    |
 LL | #![ignore                     = "3100"] //~ WARN unused attribute
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:78:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:79:1
    |
 LL | #![proc_macro_derive          = "2500"] //~ WARN unused attribute
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: compilation successful
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:844:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:845:1
    |
 LL | / fn main() { //~ ERROR compilation successful
 LL | |     println!("Hello World");
diff --git a/src/test/ui/feature-gate/stability-attribute-consistency.rs b/src/test/ui/feature-gate/stability-attribute-consistency.rs
new file mode 100644 (file)
index 0000000..94bc57d
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright 2018 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.
+
+#![stable(feature = "stable_test_feature", since = "1.0.0")]
+
+#![feature(staged_api)]
+
+#[stable(feature = "foo", since = "1.0.0")]
+fn foo_stable_1_0_0() {}
+
+#[stable(feature = "foo", since = "1.29.0")]
+//~^ ERROR feature `foo` is declared stable since 1.29.0
+fn foo_stable_1_29_0() {}
+
+#[unstable(feature = "foo", issue = "0")]
+//~^ ERROR feature `foo` is declared unstable
+fn foo_unstable() {}
+
+fn main() {}
diff --git a/src/test/ui/feature-gate/stability-attribute-consistency.stderr b/src/test/ui/feature-gate/stability-attribute-consistency.stderr
new file mode 100644 (file)
index 0000000..1b2fdd6
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0711]: feature `foo` is declared stable since 1.29.0, but was previously declared stable since 1.0.0
+  --> $DIR/stability-attribute-consistency.rs:18:1
+   |
+LL | #[stable(feature = "foo", since = "1.29.0")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0711]: feature `foo` is declared unstable, but was previously declared stable
+  --> $DIR/stability-attribute-consistency.rs:22:1
+   |
+LL | #[unstable(feature = "foo", issue = "0")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0711`.
diff --git a/src/test/ui/feature-gate/unknown-feature.rs b/src/test/ui/feature-gate/unknown-feature.rs
new file mode 100644 (file)
index 0000000..da1b257
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright 2018 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(unknown_rust_feature)] //~ ERROR unknown feature
+
+fn main() {}
diff --git a/src/test/ui/feature-gate/unknown-feature.stderr b/src/test/ui/feature-gate/unknown-feature.stderr
new file mode 100644 (file)
index 0000000..f44aaee
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0635]: unknown feature `unknown_rust_feature`
+  --> $DIR/unknown-feature.rs:11:12
+   |
+LL | #![feature(unknown_rust_feature)] //~ ERROR unknown feature
+   |            ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0635`.
diff --git a/src/test/ui/impl-header-lifetime-elision/assoc-type.rs b/src/test/ui/impl-header-lifetime-elision/assoc-type.rs
new file mode 100644 (file)
index 0000000..15cf077
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright 2018 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 do not yet support elision in associated types, even
+// when there is just one name we could take from the impl header.
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait {
+    type Output;
+}
+
+impl MyTrait for &i32 {
+    type Output = &i32;
+    //~^ ERROR missing lifetime specifier
+}
+
+impl MyTrait for &u32 {
+    type Output = &'_ i32;
+    //~^ ERROR missing lifetime specifier
+}
+
+// This is what you have to do:
+impl<'a> MyTrait for &'a f32 {
+    type Output = &'a f32;
+}
+
+fn main() { }
diff --git a/src/test/ui/impl-header-lifetime-elision/assoc-type.stderr b/src/test/ui/impl-header-lifetime-elision/assoc-type.stderr
new file mode 100644 (file)
index 0000000..59b2cfd
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0106]: missing lifetime specifier
+  --> $DIR/assoc-type.rs:23:19
+   |
+LL |     type Output = &i32;
+   |                   ^ expected lifetime parameter
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/assoc-type.rs:28:20
+   |
+LL |     type Output = &'_ i32;
+   |                    ^^ expected lifetime parameter
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.nll.stderr
new file mode 100644 (file)
index 0000000..f5d98e0
--- /dev/null
@@ -0,0 +1,16 @@
+warning: not reporting region error due to nll
+  --> $DIR/dyn-trait.rs:32:16
+   |
+LL |     static_val(x); //~ ERROR cannot infer
+   |                ^
+
+error: borrowed data escapes outside of function
+  --> $DIR/dyn-trait.rs:32:5
+   |
+LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
+   |                              - `x` is a reference that is only valid in the function body
+LL |     static_val(x); //~ ERROR cannot infer
+   |     ^^^^^^^^^^^^^ `x` escapes the function body here
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs b/src/test/ui/impl-header-lifetime-elision/dyn-trait.rs
new file mode 100644 (file)
index 0000000..661bfa8
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright 2018 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 `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
+// 'b> MyTrait<'a> for &'b i32`.
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+use std::fmt::Debug;
+
+// Equivalent to `Box<dyn Debug + 'static>`:
+trait StaticTrait { }
+impl StaticTrait for Box<dyn Debug> { }
+
+// Equivalent to `Box<dyn Debug + 'static>`:
+trait NotStaticTrait { }
+impl NotStaticTrait for Box<dyn Debug + '_> { }
+
+fn static_val<T: StaticTrait>(_: T) {
+}
+
+fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
+    static_val(x); //~ ERROR cannot infer
+}
+
+fn not_static_val<T: NotStaticTrait>(_: T) {
+}
+
+fn with_dyn_debug_not_static<'a>(x: Box<dyn Debug + 'a>) {
+    not_static_val(x); // OK
+}
+
+fn main() {
+}
diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr
new file mode 100644 (file)
index 0000000..3e54ebe
--- /dev/null
@@ -0,0 +1,22 @@
+error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
+  --> $DIR/dyn-trait.rs:32:16
+   |
+LL |     static_val(x); //~ ERROR cannot infer
+   |                ^
+   |
+note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 31:26...
+  --> $DIR/dyn-trait.rs:31:26
+   |
+LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
+   |                          ^^
+   = note: ...so that the expression is assignable:
+           expected std::boxed::Box<dyn std::fmt::Debug>
+              found std::boxed::Box<(dyn std::fmt::Debug + 'a)>
+   = note: but, the lifetime must be valid for the static lifetime...
+   = note: ...so that the types are compatible:
+           expected StaticTrait
+              found StaticTrait
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/impl-header-lifetime-elision/path-elided.rs b/src/test/ui/impl-header-lifetime-elision/path-elided.rs
new file mode 100644 (file)
index 0000000..f88c899
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright 2018 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.
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait { }
+
+struct Foo<'a> { x: &'a u32 }
+
+impl MyTrait for Foo {
+    //~^ ERROR missing lifetime specifier
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-header-lifetime-elision/path-elided.stderr b/src/test/ui/impl-header-lifetime-elision/path-elided.stderr
new file mode 100644 (file)
index 0000000..6c1d724
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0106]: missing lifetime specifier
+  --> $DIR/path-elided.rs:18:18
+   |
+LL | impl MyTrait for Foo {
+   |                  ^^^ expected lifetime parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/impl-header-lifetime-elision/path-underscore.rs b/src/test/ui/impl-header-lifetime-elision/path-underscore.rs
new file mode 100644 (file)
index 0000000..38118f0
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright 2018 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 `impl MyTrait for Foo<'_>` works.
+
+// run-pass
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait { }
+
+struct Foo<'a> { x: &'a u32 }
+
+impl MyTrait for Foo<'_> {
+}
+
+fn impls_my_trait<T: MyTrait>() { }
+
+fn impls_my_trait_val<T: MyTrait>(_: T) {
+    impls_my_trait::<T>();
+}
+
+fn random_where_clause()
+where for<'a> Foo<'a>: MyTrait { }
+
+fn main() {
+    let x = 22;
+    let f = Foo { x: &x };
+
+    // This type is `Foo<'x>` for a local lifetime `'x`; so the impl
+    // must apply to any lifetime to apply to this.
+    impls_my_trait_val(f);
+
+    impls_my_trait::<Foo<'static>>();
+
+    random_where_clause();
+}
diff --git a/src/test/ui/impl-header-lifetime-elision/ref-underscore.rs b/src/test/ui/impl-header-lifetime-elision/ref-underscore.rs
new file mode 100644 (file)
index 0000000..96a56aa
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright 2018 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 `impl MyTrait for &i32` works and is equivalent to any lifetime.
+
+// run-pass
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait { }
+
+impl MyTrait for &i32 {
+}
+
+fn impls_my_trait<T: MyTrait>() { }
+
+fn impls_my_trait_val<T: MyTrait>(_: T) {
+    impls_my_trait::<T>();
+}
+
+fn random_where_clause()
+where for<'a> &'a i32: MyTrait { }
+
+fn main() {
+    let x = 22;
+    let f = &x;
+
+    impls_my_trait_val(f);
+
+    impls_my_trait::<&'static i32>();
+
+    random_where_clause();
+}
diff --git a/src/test/ui/impl-header-lifetime-elision/trait-elided.rs b/src/test/ui/impl-header-lifetime-elision/trait-elided.rs
new file mode 100644 (file)
index 0000000..afdf220
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright 2018 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.
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait<'a> { }
+
+impl MyTrait for u32 {
+    //~^ ERROR missing lifetime specifier
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-header-lifetime-elision/trait-elided.stderr b/src/test/ui/impl-header-lifetime-elision/trait-elided.stderr
new file mode 100644 (file)
index 0000000..fe3ded8
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0106]: missing lifetime specifier
+  --> $DIR/trait-elided.rs:16:6
+   |
+LL | impl MyTrait for u32 {
+   |      ^^^^^^^ expected lifetime parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/impl-header-lifetime-elision/trait-underscore.rs b/src/test/ui/impl-header-lifetime-elision/trait-underscore.rs
new file mode 100644 (file)
index 0000000..98242ff
--- /dev/null
@@ -0,0 +1,47 @@
+// Copyright 2018 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 `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
+// 'b> MyTrait<'a> for &'b i32`.
+//
+// run-pass
+
+#![allow(warnings)]
+
+#![feature(impl_header_lifetime_elision)]
+
+trait MyTrait<'a> { }
+
+// This is equivalent to `MyTrait<'a> for &'b i32`, which is proven by
+// the code below.
+impl MyTrait<'_> for &i32 {
+}
+
+// When called, T will be `&'x i32` for some `'x`, so since we can
+// prove that `&'x i32: for<'a> MyTrait<'a>, then we know that the
+// lifetime parameter above is disconnected.
+fn impls_my_trait<T: for<'a> MyTrait<'a>>() { }
+
+fn impls_my_trait_val<T: for<'a> MyTrait<'a>>(_: T) {
+    impls_my_trait::<T>();
+}
+
+fn random_where_clause()
+where for<'a, 'b> &'a i32: MyTrait<'b> { }
+
+fn main() {
+    let x = 22;
+    let f = &x;
+    impls_my_trait_val(f);
+
+    impls_my_trait::<&'static i32>();
+
+    random_where_clause();
+}
index 5d6a11913849a70175aa3a6da954d956ecd73ed4..ed5907800e9de7367618d1f9d158e7c459aca6d4 100644 (file)
@@ -10,7 +10,7 @@
 
 // aux-build:two_macros.rs
 
-#![feature(item_like_imports, use_extern_macros)]
+#![feature(use_extern_macros)]
 
 extern crate two_macros; // two identity macros `m` and `n`
 
diff --git a/src/test/ui/in-band-lifetimes/impl/assoc-type.rs b/src/test/ui/in-band-lifetimes/impl/assoc-type.rs
deleted file mode 100644 (file)
index ab35331..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2018 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 do not yet support elision in associated types, even
-// when there is just one name we could take from the impl header.
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait {
-    type Output;
-}
-
-impl MyTrait for &i32 {
-    type Output = &i32;
-    //~^ ERROR missing lifetime specifier
-}
-
-impl MyTrait for &u32 {
-    type Output = &'_ i32;
-    //~^ ERROR missing lifetime specifier
-}
-
-// This is what you have to do:
-impl MyTrait for &'a f32 {
-    type Output = &'a f32;
-}
-
-fn main() { }
diff --git a/src/test/ui/in-band-lifetimes/impl/assoc-type.stderr b/src/test/ui/in-band-lifetimes/impl/assoc-type.stderr
deleted file mode 100644 (file)
index 59b2cfd..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0106]: missing lifetime specifier
-  --> $DIR/assoc-type.rs:23:19
-   |
-LL |     type Output = &i32;
-   |                   ^ expected lifetime parameter
-
-error[E0106]: missing lifetime specifier
-  --> $DIR/assoc-type.rs:28:20
-   |
-LL |     type Output = &'_ i32;
-   |                    ^^ expected lifetime parameter
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr b/src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr
deleted file mode 100644 (file)
index f5d98e0..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-warning: not reporting region error due to nll
-  --> $DIR/dyn-trait.rs:32:16
-   |
-LL |     static_val(x); //~ ERROR cannot infer
-   |                ^
-
-error: borrowed data escapes outside of function
-  --> $DIR/dyn-trait.rs:32:5
-   |
-LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
-   |                              - `x` is a reference that is only valid in the function body
-LL |     static_val(x); //~ ERROR cannot infer
-   |     ^^^^^^^^^^^^^ `x` escapes the function body here
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/in-band-lifetimes/impl/dyn-trait.rs b/src/test/ui/in-band-lifetimes/impl/dyn-trait.rs
deleted file mode 100644 (file)
index c27bbe7..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2018 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 `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
-// 'b> MyTrait<'a> for &'b i32`.
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-use std::fmt::Debug;
-
-// Equivalent to `Box<dyn Debug + 'static>`:
-trait StaticTrait { }
-impl StaticTrait for Box<dyn Debug> { }
-
-// Equivalent to `Box<dyn Debug + 'static>`:
-trait NotStaticTrait { }
-impl NotStaticTrait for Box<dyn Debug + '_> { }
-
-fn static_val<T: StaticTrait>(_: T) {
-}
-
-fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
-    static_val(x); //~ ERROR cannot infer
-}
-
-fn not_static_val<T: NotStaticTrait>(_: T) {
-}
-
-fn with_dyn_debug_not_static<'a>(x: Box<dyn Debug + 'a>) {
-    not_static_val(x); // OK
-}
-
-fn main() {
-}
diff --git a/src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr b/src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr
deleted file mode 100644 (file)
index 3e54ebe..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/dyn-trait.rs:32:16
-   |
-LL |     static_val(x); //~ ERROR cannot infer
-   |                ^
-   |
-note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 31:26...
-  --> $DIR/dyn-trait.rs:31:26
-   |
-LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
-   |                          ^^
-   = note: ...so that the expression is assignable:
-           expected std::boxed::Box<dyn std::fmt::Debug>
-              found std::boxed::Box<(dyn std::fmt::Debug + 'a)>
-   = note: but, the lifetime must be valid for the static lifetime...
-   = note: ...so that the types are compatible:
-           expected StaticTrait
-              found StaticTrait
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/in-band-lifetimes/impl/path-elided.rs b/src/test/ui/in-band-lifetimes/impl/path-elided.rs
deleted file mode 100644 (file)
index 8a758b1..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2018 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.
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait { }
-
-struct Foo<'a> { x: &'a u32 }
-
-impl MyTrait for Foo {
-    //~^ ERROR missing lifetime specifier
-}
-
-fn main() {}
diff --git a/src/test/ui/in-band-lifetimes/impl/path-elided.stderr b/src/test/ui/in-band-lifetimes/impl/path-elided.stderr
deleted file mode 100644 (file)
index 6c1d724..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0106]: missing lifetime specifier
-  --> $DIR/path-elided.rs:18:18
-   |
-LL | impl MyTrait for Foo {
-   |                  ^^^ expected lifetime parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/in-band-lifetimes/impl/path-underscore.rs b/src/test/ui/in-band-lifetimes/impl/path-underscore.rs
deleted file mode 100644 (file)
index 756991d..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2018 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 `impl MyTrait for Foo<'_>` works.
-
-// run-pass
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait { }
-
-struct Foo<'a> { x: &'a u32 }
-
-impl MyTrait for Foo<'_> {
-}
-
-fn impls_my_trait<T: MyTrait>() { }
-
-fn impls_my_trait_val<T: MyTrait>(_: T) {
-    impls_my_trait::<T>();
-}
-
-fn random_where_clause()
-where for<'a> Foo<'a>: MyTrait { }
-
-fn main() {
-    let x = 22;
-    let f = Foo { x: &x };
-
-    // This type is `Foo<'x>` for a local lifetime `'x`; so the impl
-    // must apply to any lifetime to apply to this.
-    impls_my_trait_val(f);
-
-    impls_my_trait::<Foo<'static>>();
-
-    random_where_clause();
-}
diff --git a/src/test/ui/in-band-lifetimes/impl/ref-underscore.rs b/src/test/ui/in-band-lifetimes/impl/ref-underscore.rs
deleted file mode 100644 (file)
index 99708af..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2018 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 `impl MyTrait for &i32` works and is equivalent to any lifetime.
-
-// run-pass
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait { }
-
-impl MyTrait for &i32 {
-}
-
-fn impls_my_trait<T: MyTrait>() { }
-
-fn impls_my_trait_val<T: MyTrait>(_: T) {
-    impls_my_trait::<T>();
-}
-
-fn random_where_clause()
-where for<'a> &'a i32: MyTrait { }
-
-fn main() {
-    let x = 22;
-    let f = &x;
-
-    impls_my_trait_val(f);
-
-    impls_my_trait::<&'static i32>();
-
-    random_where_clause();
-}
diff --git a/src/test/ui/in-band-lifetimes/impl/trait-elided.rs b/src/test/ui/in-band-lifetimes/impl/trait-elided.rs
deleted file mode 100644 (file)
index e0709ab..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2018 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.
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait<'a> { }
-
-impl MyTrait for u32 {
-    //~^ ERROR missing lifetime specifier
-}
-
-fn main() {}
diff --git a/src/test/ui/in-band-lifetimes/impl/trait-elided.stderr b/src/test/ui/in-band-lifetimes/impl/trait-elided.stderr
deleted file mode 100644 (file)
index fe3ded8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0106]: missing lifetime specifier
-  --> $DIR/trait-elided.rs:16:6
-   |
-LL | impl MyTrait for u32 {
-   |      ^^^^^^^ expected lifetime parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/in-band-lifetimes/impl/trait-underscore.rs b/src/test/ui/in-band-lifetimes/impl/trait-underscore.rs
deleted file mode 100644 (file)
index 971fd1f..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2018 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 `impl MyTrait<'_> for &i32` is equivalent to `impl<'a,
-// 'b> MyTrait<'a> for &'b i32`.
-//
-// run-pass
-
-#![allow(warnings)]
-
-#![feature(in_band_lifetimes)]
-
-trait MyTrait<'a> { }
-
-// This is equivalent to `MyTrait<'a> for &'b i32`, which is proven by
-// the code below.
-impl MyTrait<'_> for &i32 {
-}
-
-// When called, T will be `&'x i32` for some `'x`, so since we can
-// prove that `&'x i32: for<'a> MyTrait<'a>, then we know that the
-// lifetime parameter above is disconnected.
-fn impls_my_trait<T: for<'a> MyTrait<'a>>() { }
-
-fn impls_my_trait_val<T: for<'a> MyTrait<'a>>(_: T) {
-    impls_my_trait::<T>();
-}
-
-fn random_where_clause()
-where for<'a, 'b> &'a i32: MyTrait<'b> { }
-
-fn main() {
-    let x = 22;
-    let f = &x;
-    impls_my_trait_val(f);
-
-    impls_my_trait::<&'static i32>();
-
-    random_where_clause();
-}
index cd2ebc341ead136a8f265704f73999b99b8d0257..1470783c20671f9abf62c90a3747c118343dce79 100644 (file)
@@ -14,19 +14,19 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/mismatched.rs:14:42
    |
 LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
-   |                    -                     ^ lifetime `'a` required
-   |                    |
-   |                    consider changing the type of `y` to `&'a u32`
+   |                       ----               ^ lifetime `'a` required
+   |                       |
+   |                       help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/mismatched.rs:16:46
    |
 LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
-   |                        -------     -------   ^ ...but data from `y` is returned here
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
+   |             --          --                   ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
+   |             |           |
+   |             |           lifetime `'b` defined here
+   |             lifetime `'a` defined here
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0621, E0623.
-For more information about an error, try `rustc --explain E0621`.
+For more information about this error, try `rustc --explain E0621`.
index d2748b2da4b6aa18080035630196a374a17f279d..ed932a97ba465dcfdc6f3694fef3e86314fe85f7 100644 (file)
@@ -2,9 +2,9 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/mismatched.rs:14:42
    |
 LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
-   |                    -                     ^ lifetime `'a` required
-   |                    |
-   |                    consider changing the type of `y` to `&'a u32`
+   |                       ----               ^ lifetime `'a` required
+   |                       |
+   |                       help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
 
 error[E0623]: lifetime mismatch
   --> $DIR/mismatched.rs:16:46
index 886e3834d1dcaee2e30e5e00aec4cf7c0c1639e6..a01f3219dc5e4f9026da9c16faafc83d1e5968b8 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/mismatched_trait.rs:16:9
    |
 LL |     fn baz(&self, x: &'a u32, y: &u32) -> &'a u32 {
-   |                               - consider changing the type of `y` to `&'a u32`
+   |                                  ---- help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
 LL |         y //~ ERROR explicit lifetime required
    |         ^ lifetime `'a` required
 
index 71b46f6d4d60e3ffadfab2abc481aa3de30de3fd..745b82c20b4eb53a6c10e5c8e32e6880d80422e6 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/mismatched_trait.rs:16:9
    |
 LL |     fn baz(&self, x: &'a u32, y: &u32) -> &'a u32 {
-   |                               - consider changing the type of `y` to `&'a u32`
+   |                                  ---- help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
 LL |         y //~ ERROR explicit lifetime required
    |         ^ lifetime `'a` required
 
index c595b0fb2c2d8ea9d59f17f785153c7edd09190a..50525e03acf50cebfe0db56e82262cbdf6ddc9c9 100644 (file)
@@ -10,5 +10,5 @@
 
 fn main() {
     concat!(test!());
-    //~^ ERROR expected a macro, found non-macro attribute
+    //~^ ERROR expected a macro, found built-in attribute
 }
index 3d080bd46dcc967012c6a2a2a6b407519297f960..0c130943fd873e789d5d828bc21f1eb228f3791a 100644 (file)
@@ -1,4 +1,4 @@
-error: expected a macro, found non-macro attribute
+error: expected a macro, found built-in attribute
   --> $DIR/issue-11692-2.rs:12:13
    |
 LL |     concat!(test!());
index cef5f5ae475bdbbcb7e5442d2d20a9d3a7959b62..5e8319d26ad3ca42ba3277d07f7d35e619934535 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `cont`
   --> $DIR/issue-13058.rs:24:26
    |
 LL | fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
-   |                                                               ---- consider changing the type of `cont` to `&'r T`
+   |                                                                     -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T`
 LL | {
 LL |     let cont_iter = cont.iter();
    |                          ^^^^ lifetime `'r` required
index 440365cae3e1c1a59d6c53585127662989efad06..c95d540b25cdd0b50e2b7ecf60f955cb1a14501f 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `a`
   --> $DIR/issue-14285.rs:22:7
    |
 LL | fn foo<'a>(a: &Foo) -> B<'a> {
-   |            - consider changing the type of `a` to `&'a (dyn Foo + 'a)`
+   |               ---- help: add explicit lifetime `'a` to the type of `a`: `&'a (dyn Foo + 'a)`
 LL |     B(a)    //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621]
    |       ^ lifetime `'a` required
 
index b5ab7bdb9d1926fb60f1949ef2cae2b282c880cc..52163f81b7bf42c08c0d653c9198ebeabe4c1eac 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `a`
   --> $DIR/issue-14285.rs:22:5
    |
 LL | fn foo<'a>(a: &Foo) -> B<'a> {
-   |            - consider changing the type of `a` to `&'a (dyn Foo + 'a)`
+   |               ---- help: add explicit lifetime `'a` to the type of `a`: `&'a (dyn Foo + 'a)`
 LL |     B(a)    //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621]
    |     ^^^^ lifetime `'a` required
 
index 19fe83f8f6c86886ac2397f74bae4eccaaf499b2..4c8482630c50c46e428c205352038db77e3c71e9 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `lexer`
   --> $DIR/issue-15034.rs:27:25
    |
 LL |     pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
-   |                ----- consider changing the type of `lexer` to `&'a mut Lexer<'a>`
+   |                       ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>`
 LL |         Parser { lexer: lexer }
    |                         ^^^^^ lifetime `'a` required
 
index 3bbf4235a29377a61bae69dcbaece2d323d259a4..c87bec00d9527b9e3a20ef0dcc56a6745390f65b 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `lexer`
   --> $DIR/issue-15034.rs:27:25
    |
 LL |     pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
-   |                ----- consider changing the type of `lexer` to `&'a mut Lexer<'a>`
+   |                       ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>`
 LL |         Parser { lexer: lexer }
    |                         ^^^^^ lifetime `'a` required
 
index 902baaf579f7df653aead949a9e648f38289453a..1bd26faedaae3000e6ebfe89a50307f57ce9e0ea 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `value`
   --> $DIR/issue-16922.rs:14:5
    |
 LL | fn foo<T: Any>(value: &T) -> Box<Any> {
-   |                ----- consider changing the type of `value` to `&'static T`
+   |                       -- help: add explicit lifetime `'static` to the type of `value`: `&'static T`
 LL |     Box::new(value) as Box<Any>
    |     ^^^^^^^^^^^^^^^ lifetime `'static` required
 
index cf81d4b4d08b731b6cba33c7ef765a7760c4cdd4..e70869eb1838dbff13e8d542fb11ff041cd5804b 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `value`
   --> $DIR/issue-16922.rs:14:5
    |
 LL | fn foo<T: Any>(value: &T) -> Box<Any> {
-   |                ----- consider changing the type of `value` to `&'static T`
+   |                       -- help: add explicit lifetime `'static` to the type of `value`: `&'static T`
 LL |     Box::new(value) as Box<Any>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required
 
index 1208321b52943c7c2a554358919b7fbb9d95337d..8642396c380cc758155b5d663fbda91469d556d0 100644 (file)
 #![feature(staged_api)]
 #![deny(deprecated)]
 
-#![unstable(feature = "test_feature", issue = "0")]
+#![unstable(feature = "unstable_test_feature", issue = "0")]
 
 struct Foo;
 
 impl Foo {
-    #[unstable(feature = "test_feature", issue = "0")]
+    #[unstable(feature = "unstable_test_feature", issue = "0")]
     #[rustc_deprecated(since = "1.0.0", reason = "text")]
     fn foo(self) {}
 }
index f5b7a0c13b7287fb26616b3df28c39b89fe7ed13..354d389158d611093e189c6b607a2cd95ca77599 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 static X: usize = 0 as *const usize as usize;
-//~^ ERROR: raw pointers cannot be cast to integers in statics
+//~^ ERROR: casting pointers to integers in statics is unstable
 
 fn main() {
     assert_eq!(X, 0);
index 7a43813fa6d38783004bf102cd8d2e20b29dfc37..0303e4bddb56f2e71d8c7017c1a0b5f19ad42a2f 100644 (file)
@@ -1,9 +1,11 @@
-error[E0018]: raw pointers cannot be cast to integers in statics
+error[E0658]: casting pointers to integers in statics is unstable (see issue #51910)
   --> $DIR/issue-17458.rs:11:19
    |
 LL | static X: usize = 0 as *const usize as usize;
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0018`.
+For more information about this error, try `rustc --explain E0658`.
index efc1ba1635c952e413135b031a268625ea92c631..28dc6846f69e172bfcda1a4bfe19299458b2804f 100644 (file)
@@ -10,6 +10,6 @@
 
 fn main() {
     const X: u32 = 1;
-    const Y: usize = &X as *const u32 as usize; //~ ERROR E0018
+    const Y: usize = &X as *const u32 as usize; //~ ERROR is unstable
     println!("{}", Y);
 }
index 151deefb2b7c388e47808eedd6b444fa4dd309ff..0b94e778d377180dfd450fe9a0021045c058cba7 100644 (file)
@@ -1,9 +1,11 @@
-error[E0018]: raw pointers cannot be cast to integers in constants
+error[E0658]: casting pointers to integers in constants is unstable (see issue #51910)
   --> $DIR/issue-18294.rs:13:22
    |
-LL |     const Y: usize = &X as *const u32 as usize; //~ ERROR E0018
+LL |     const Y: usize = &X as *const u32 as usize; //~ ERROR is unstable
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0018`.
+For more information about this error, try `rustc --explain E0658`.
index 00e1279d58a0eb850233acdd9967d7b975e6cb31..6b9caba0218f3fbc79cefa6f5f1597ee6f244d8b 100644 (file)
@@ -11,6 +11,6 @@
 fn id<T>(t: T) -> T { t }
 fn main() {
     const A: bool = id::<u8> as *const () < id::<u16> as *const ();
-    //~^ ERROR raw pointers cannot be compared in constants [E0395]
+    //~^ ERROR comparing raw pointers inside constant
     println!("{}", A);
 }
index fed9e8efa848755cba9cc6e208b72ae82e9ff530..a5ab7cfa6d3c5b1a98910588bd88a185b3ff00f9 100644 (file)
@@ -1,9 +1,11 @@
-error[E0395]: raw pointers cannot be compared in constants
+error[E0658]: comparing raw pointers inside constant (see issue #53020)
   --> $DIR/issue-25826.rs:13:21
    |
 LL |     const A: bool = id::<u8> as *const () < id::<u16> as *const ();
-   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comparing raw pointers in static
+   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: add #![feature(const_compare_raw_pointers)] to the crate attributes to enable
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0395`.
+For more information about this error, try `rustc --explain E0658`.
index 4420f9dcae4056ad631d2eed4cdc500f0f14ab38..91010bd3209352662929f30dee3664fbaab0cb4a 100644 (file)
@@ -14,7 +14,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/issue-3154.rs:16:15
    |
 LL | fn thing<'a,Q>(x: &Q) -> thing<'a,Q> {
-   |                - consider changing the type of `x` to `&'a Q`
+   |                   -- help: add explicit lifetime `'a` to the type of `x`: `&'a Q`
 LL |     thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621]
    |               ^ lifetime `'a` required
 
index cc0cfd768c4fc345b3f010af6955838c8294b296..01299d74808628d2910bedb7e71dc40ebc7e162b 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/issue-3154.rs:16:5
    |
 LL | fn thing<'a,Q>(x: &Q) -> thing<'a,Q> {
-   |                - consider changing the type of `x` to `&'a Q`
+   |                   -- help: add explicit lifetime `'a` to the type of `x`: `&'a Q`
 LL |     thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621]
    |     ^^^^^^^^^^^^^ lifetime `'a` required
 
index 1d2b26603426f2b134c345cfe67abd109b1a1550..dcc9e0a8a65a54551e82073e5f44f7873ad3349f 100644 (file)
@@ -38,7 +38,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/issue-40288-2.rs:17:9
    |
 LL | fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
-   |                                                      - consider changing the type of `y` to `&'a T`
+   |                                                         -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
 ...
 LL |         slice[0] = y;
    |         ^^^^^^^^^^^^ lifetime `'a` required
@@ -47,7 +47,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/issue-40288-2.rs:32:9
    |
 LL | fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
-   |                                                       - consider changing the type of `y` to `&'a T`
+   |                                                          -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
 ...
 LL |         dst.head = y;
    |         ^^^^^^^^^^^^ lifetime `'a` required
index d2313ef89a7daa8279afbdbef893294b717317ed..fd0b4c01636d10b1c334ca50731d848870b02a69 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/issue-40288-2.rs:19:5
    |
 LL | fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
-   |                                                      - consider changing the type of `y` to `&'a T`
+   |                                                         -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
 ...
 LL |     out[0]
    |     ^^^^^^ lifetime `'a` required
@@ -11,7 +11,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/issue-40288-2.rs:34:5
    |
 LL | fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
-   |                                                       - consider changing the type of `y` to `&'a T`
+   |                                                          -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
 ...
 LL |     out.head
    |     ^^^^^^^^ lifetime `'a` required
index 312ec6e742e9164b4e276828cb51a247f2441a1f..6c77bcb275724e4326b05a24f46d6b3edacecd82 100644 (file)
@@ -1,17 +1,15 @@
 error: unsatisfied lifetime constraints
   --> $DIR/issue-40510-1.rs:18:9
    |
-LL |        || {
-   |   _____-
-   |  |_____|
-   | ||
-LL | ||         &mut x
-   | ||         ^^^^^^ return requires that `'1` must outlive `'2`
-LL | ||     };
-   | ||     -
-   | ||_____|
-   | |______lifetime `'1` represents the closure body
-   |        lifetime `'2` appears in return type
+LL |     || {
+   |     --
+   |     ||
+   |     |return type of closure is &'2 mut std::boxed::Box<()>
+   |     lifetime `'1` represents this closure's body
+LL |         &mut x
+   |         ^^^^^^ return requires that `'1` must outlive `'2`
+   |
+   = note: closure implements `FnMut`, so references to captured variables can't escape the closure
 
 error: aborting due to previous error
 
index eb44850e639abbf3d683bd1fde79402f3a51b942..8aeef86c2e86b08c2a78a7ef837ff85fc2b5ea17 100644 (file)
@@ -1,20 +1,17 @@
 error: unsatisfied lifetime constraints
   --> $DIR/issue-40510-3.rs:18:9
    |
-LL |         || {
-   |    _____-
-   |   |_____|
-   |  ||
-LL |  ||         || {
-   |  ||_________^
-LL | |||             x.push(())
-LL | |||         }
-   | |||_________^ requires that `'1` must outlive `'2`
-LL |  ||     };
-   |  ||     -
-   |  ||_____|
-   |  |______lifetime `'1` represents the closure body
-   |         lifetime `'2` appears in return type
+LL |       || {
+   |       --
+   |       ||
+   |       |return type of closure is [closure@$DIR/issue-40510-3.rs:18:9: 20:10 x:&'2 mut std::vec::Vec<()>]
+   |       lifetime `'1` represents this closure's body
+LL | /         || {
+LL | |             x.push(())
+LL | |         }
+   | |_________^ requires that `'1` must outlive `'2`
+   |
+   = note: closure implements `FnMut`, so references to captured variables can't escape the closure
 
 error: aborting due to previous error
 
index 31aeebd5a721ea5b658ae0e56110e76e4bf62169..c4f2b3eba7ddacea3fb282da466ee6f97daed9ca 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/issue-46983.rs:14:5
    |
 LL | fn foo(x: &u32) -> &'static u32 {
-   |        - consider changing the type of `x` to `&'static u32`
+   |           ---- help: add explicit lifetime `'static` to the type of `x`: `&'static u32`
 LL |     &*x
    |     ^^^ lifetime `'static` required
 
index 59345754e9f59284539b4eba2d035a803ea50807..fb4bed76a717f7c050cd80a983da89ed210fcc93 100644 (file)
@@ -1,20 +1,17 @@
 error: unsatisfied lifetime constraints
   --> $DIR/issue-49824.rs:22:9
    |
-LL |         || {
-   |    _____-
-   |   |_____|
-   |  ||
-LL |  ||         || {
-   |  ||_________^
-LL | |||             let _y = &mut x;
-LL | |||         }
-   | |||_________^ requires that `'1` must outlive `'2`
-LL |  ||     };
-   |  ||     -
-   |  ||_____|
-   |  |______lifetime `'1` represents the closure body
-   |         lifetime `'2` appears in return type
+LL |       || {
+   |       --
+   |       ||
+   |       |return type of closure is [closure@$DIR/issue-49824.rs:22:9: 24:10 x:&'2 mut i32]
+   |       lifetime `'1` represents this closure's body
+LL | /         || {
+LL | |             let _y = &mut x;
+LL | |         }
+   | |_________^ requires that `'1` must outlive `'2`
+   |
+   = note: closure implements `FnMut`, so references to captured variables can't escape the closure
 
 error: aborting due to previous error
 
index f3bee1a6315803976e0a87862dee623549297a38..02bed69f0d40e2e99accfb9677bbb7d6c92878d4 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    let _ = [0; (&0 as *const i32) as usize]; //~ ERROR raw pointers cannot be cast
+    let _ = [0; (&0 as *const i32) as usize]; //~ ERROR casting pointers to integers in constants
 }
index 888de82e379c8c7044c9e20a4771d91712e6089c..74270c2bef79849cb3e46c84d494e03399a00094 100644 (file)
@@ -1,9 +1,11 @@
-error[E0018]: raw pointers cannot be cast to integers in constants
+error[E0658]: casting pointers to integers in constants is unstable (see issue #51910)
   --> $DIR/issue-52023-array-size-pointer-cast.rs:12:17
    |
-LL |     let _ = [0; (&0 as *const i32) as usize]; //~ ERROR raw pointers cannot be cast
+LL |     let _ = [0; (&0 as *const i32) as usize]; //~ ERROR casting pointers to integers in constants
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0018`.
+For more information about this error, try `rustc --explain E0658`.
index d422a63bcad3957942af48d087fd65df878370ad..89313f898d5dd130dc53783b00a2146d65e16f7c 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/42701_one_named_and_one_anonymous.rs:16:5
    |
 LL |   fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
-   |                           - consider changing the type of `x` to `&'a i32`
+   |                              ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
 LL | /     if true {
 LL | |         let p: &i32 = &a.field;
 LL | |         &*p
index 87cb174891356e207a607246025a4d2afb83ecb8..b886450336d269091e3a04b7fcc912f51fb5eec4 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/42701_one_named_and_one_anonymous.rs:20:9
    |
 LL | fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
-   |                         - consider changing the type of `x` to `&'a i32`
+   |                            ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
 ...
 LL |         &*x //~ ERROR explicit lifetime
    |         ^^^ lifetime `'a` required
index e5b001def56f2cc5efa7ff0eac0faecbc94cf65a..3976cb304268798462eb83b3a2d538af86368dc6 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `other`
   --> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:18:15
    |
 LL |     fn bar(&self, other: Foo) -> Foo<'a> {
-   |                   ----- consider changing the type of `other` to `Foo<'a>`
+   |                          --- help: add explicit lifetime `'a` to the type of `other`: `Foo<'a>`
 LL |         match *self {
    |               ^^^^^ lifetime `'a` required
 
index 29163361e23f399ad1b74605131a0bacf8a8eb15..5847f755b3ca67b5a2cef8c6935fdb6a19342557 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `other`
   --> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:21:21
    |
 LL |     fn bar(&self, other: Foo) -> Foo<'a> {
-   |                   ----- consider changing the type of `other` to `Foo<'a>`
+   |                          --- help: add explicit lifetime `'a` to the type of `other`: `Foo<'a>`
 ...
 LL |                     other //~ ERROR explicit lifetime
    |                     ^^^^^ lifetime `'a` required
index e1dfeb0ac6adb555d9cf040928aad0c606a49323..00eff2fe3ae7f0e0cddf731a623e0e63e2ad6c7c 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:8
    |
 LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   |            - consider changing the type of `x` to `&'a i32`
+   |               ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |        ^^^^^ lifetime `'a` required
 
index e18156179a208b19104513a57e7e1319fe294a4c..a4e1fe5e183770f6d1d49b92b8b1ab40b5ff13ea 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:16
    |
 LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   |            - consider changing the type of `x` to `&'a i32`
+   |               ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |                ^ lifetime `'a` required
 
index 4d9517eca6032dfa5acd28382faae51a2620ba70..a3b46aa04a6ef88ed00ae573ebaac0533007cbce 100644 (file)
@@ -8,10 +8,9 @@ error[E0621]: explicit lifetime required in parameter type
   --> $DIR/ex1-return-one-existing-name-if-else-3.rs:11:16
    |
 LL | fn foo<'a>((x, y): (&'a i32, &i32)) -> &'a i32 {
-   |            ----^-
-   |            |   |
-   |            |   lifetime `'a` required
-   |            consider changing type to `(&'a i32, &'a i32)`
+   |                ^   --------------- help: add explicit lifetime `'a` to type: `(&'a i32, &'a i32)`
+   |                |
+   |                lifetime `'a` required
 
 error: aborting due to previous error
 
index f208fb57f5b703f6dc7398278a183caab5e588d7..a260c7bf7e957f97ba345cf64bbad902503639d2 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in parameter type
   --> $DIR/ex1-return-one-existing-name-if-else-3.rs:12:27
    |
 LL | fn foo<'a>((x, y): (&'a i32, &i32)) -> &'a i32 {
-   |            ------ consider changing type to `(&'a i32, &'a i32)`
+   |                    --------------- help: add explicit lifetime `'a` to type: `(&'a i32, &'a i32)`
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |                           ^ lifetime `'a` required
 
index e264b3428c95bd220bf3414ce480c3de5c0551ac..465b33be2d0b7be00d4c68914c1ba36b3f172bc8 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:14:7
    |
 LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   |            - consider changing the type of `x` to `&'a i32`
+   |               ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
 LL |    if x > y { x } else { y } //~ ERROR explicit lifetime
    |       ^^^^^ lifetime `'a` required
 
index 7604b9a9017ee67d9cdac2fe34178fe590917d05..8eac8761bd4e15ba874ca76124cd2f5cdefa3494 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:14:15
    |
 LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   |            - consider changing the type of `x` to `&'a i32`
+   |               ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
 LL |    if x > y { x } else { y } //~ ERROR explicit lifetime
    |               ^ lifetime `'a` required
 
index 6119f3c56053800959141dfe750c6616cc390df3..a62d7cc5a6fd1b8ae12b43361bb2a0186b476915 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:5
    |
 LL |   fn foo<'a>(&'a self, x: &i32) -> &i32 {
-   |                        - consider changing the type of `x` to `&'a i32`
+   |                           ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
 LL | 
 LL |     if true { &self.field } else { x } //~ ERROR explicit lifetime
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
index 83c6ff19867d318fa7d465ea650e1620bfc88364..0ae98aeb8438d180e088745e5a46b81651d43bd5 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:36
    |
 LL |   fn foo<'a>(&'a self, x: &i32) -> &i32 {
-   |                        - consider changing the type of `x` to `&'a i32`
+   |                           ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
 LL | 
 LL |     if true { &self.field } else { x } //~ ERROR explicit lifetime
    |                                    ^ lifetime `'a` required
index 71e9c34ac2b97b006a5f9ef420d83f1002bd2a21..b6bf646132e39e99daf54cfa4ea19cca78010b13 100644 (file)
@@ -4,17 +4,16 @@ warning: not reporting region error due to nll
 LL |         if x > y { x } else { y } //~ ERROR lifetime mismatch
    |                    ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:21:12
    |
 LL |     fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   |                   ----                 -------
-   |                   |
-   |                   this parameter and the return type are declared with different lifetimes...
+   |            --     - let's call the lifetime of this reference `'1`
+   |            |
+   |            lifetime `'a` defined here
 LL | 
 LL |         if x > y { x } else { y } //~ ERROR lifetime mismatch
-   |            ^^^^^ ...but data from `x` is returned here
+   |            ^^^^^ requires that `'1` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 5e49e4ec4a98b5c9e4f7c8e9299f4abb55e65d9f..93f8254f8251ebaa66239b465448dd8b35355ed1 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/ex1-return-one-existing-name-if-else.rs:12:8
    |
 LL | fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
-   |                        - consider changing the type of `y` to `&'a i32`
+   |                           ---- help: add explicit lifetime `'a` to the type of `y`: `&'a i32`
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |        ^^^^^ lifetime `'a` required
 
index 9893eee77e8c4842f778f194c16be27f1f77526b..b68b90e77dee5e97576e03e778d89db77e838c9b 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/ex1-return-one-existing-name-if-else.rs:12:27
    |
 LL | fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
-   |                        - consider changing the type of `y` to `&'a i32`
+   |                           ---- help: add explicit lifetime `'a` to the type of `y`: `&'a i32`
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |                           ^ lifetime `'a` required
 
index 6c16d6a608ec8a2853f2e758808d086a5d32a94b..93eac05e8d2c7697bb95b806edd2e49e1893be59 100644 (file)
@@ -4,17 +4,16 @@ warning: not reporting region error due to nll
 LL |     x //~ ERROR lifetime mismatch
    |     ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:18:5
    |
 LL |   fn foo<'a>(&self, x: &'a i32) -> &i32 {
-   |                        -------     ----
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
+   |          --  - let's call the lifetime of this reference `'1`
+   |          |
+   |          lifetime `'a` defined here
 LL | 
 LL |     x //~ ERROR lifetime mismatch
-   |     ^ ...but data from `x` is returned here
+   |     ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 6dc96ace4d0d31cafe9470196047fdf0f54c9893..c5b4fd1934b2883ff4927f5cdaca39bcc2001ca1 100644 (file)
@@ -4,17 +4,16 @@ warning: not reporting region error due to nll
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
    |                              ^^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:18:9
    |
 LL |     fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
-   |                -----                 -------
-   |                |
-   |                this parameter and the return type are declared with different lifetimes...
+   |            --  - let's call the lifetime of this reference `'1`
+   |            |
+   |            lifetime `'a` defined here
 LL | 
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `self` is returned here
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 087c9eb389b55bad57f2fc2e9893a80886fd8c69..a5fa83266a3db9d5eada3853bfdb7ea558cf201e 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex2a-push-one-existing-name-2.rs:16:5
    |
 LL | fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
-   |            - consider changing the type of `x` to `Ref<'a, i32>`
+   |               -------- help: add explicit lifetime `'a` to the type of `x`: `Ref<'a, i32>`
 LL |     y.push(x); //~ ERROR explicit lifetime
    |     ^^^^^^^^^ lifetime `'a` required
 
index 5c9b7666de6525d28188268e0f7b39965c5283e1..6f0a5179d6b0a28356bd796c03337077ca97a06b 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/ex2a-push-one-existing-name-2.rs:16:12
    |
 LL | fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
-   |            - consider changing the type of `x` to `Ref<'a, i32>`
+   |               -------- help: add explicit lifetime `'a` to the type of `x`: `Ref<'a, i32>`
 LL |     y.push(x); //~ ERROR explicit lifetime
    |            ^ lifetime `'a` required
 
index 4cfb76f85f2ac578a0a90e150ac2879f0131a4ce..a8286ba2952fcf3c7997ff4ce51a1a6a0a5ff76e 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/ex2a-push-one-existing-name-early-bound.rs:17:12
    |
 LL | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
-   |                                       - consider changing the type of `y` to `&'a T`
+   |                                          -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
 ...
 LL |     x.push(y); //~ ERROR explicit lifetime required
    |            ^ lifetime `'a` required
index 80192af221755b8ca2ca6f07aedc7741c4c9d6c9..294a9106619a0a1f70f1f72362b915549d423bd0 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/ex2a-push-one-existing-name.rs:16:5
    |
 LL | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
-   |                                       - consider changing the type of `y` to `Ref<'a, i32>`
+   |                                          -------- help: add explicit lifetime `'a` to the type of `y`: `Ref<'a, i32>`
 LL |     x.push(y); //~ ERROR explicit lifetime
    |     ^^^^^^^^^ lifetime `'a` required
 
index ede76bca2ba0a9dbcd7512b064ad300a6ae628a5..ebe465aa5815263734e41f3cf64140651d060871 100644 (file)
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/ex2a-push-one-existing-name.rs:16:12
    |
 LL | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
-   |                                       - consider changing the type of `y` to `Ref<'a, i32>`
+   |                                          -------- help: add explicit lifetime `'a` to the type of `y`: `Ref<'a, i32>`
 LL |     x.push(y); //~ ERROR explicit lifetime
    |            ^ lifetime `'a` required
 
index 4b4fdde940f7e26f1d226a7380407dd3fe1635a2..614034794bd6094873e682f5c4b83ad617efdb15 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex2b-push-no-existing-names.rs:16:5
    |
 LL | fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
-   |                    --------      -------- these two types are declared with different lifetimes...
+   |                    --------      -------- lifetime `'1` appears in this type
+   |                    |
+   |                    lifetime `'2` appears in this type
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index f55fd291249c6aa9921ee4e390b7676ce16a7b22..c34278b4d9fa1ac90d6c12f49fdf79b2169fb976 100644 (file)
@@ -4,15 +4,16 @@ warning: not reporting region error due to nll
 LL |     let z = Ref { data: y.data };
    |             ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex2c-push-inference-variable.rs:17:5
    |
 LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |                                   ------------      ------------ these two types are declared with different lifetimes...
+   |            --  -- lifetime `'c` defined here
+   |            |
+   |            lifetime `'b` defined here
 LL |     let z = Ref { data: y.data };
 LL |     x.push(z); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'c` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 85b5f3e890008554a9d802d335c61cf478ba8d44..3097d18e86c67feb855df2007a6b58f6aea1d7d8 100644 (file)
@@ -4,15 +4,16 @@ warning: not reporting region error due to nll
 LL |     let b = Ref { data: y.data };
    |             ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex2d-push-inference-variable-2.rs:18:5
    |
 LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |                                   ------------      ------------ these two types are declared with different lifetimes...
+   |            --  -- lifetime `'c` defined here
+   |            |
+   |            lifetime `'b` defined here
 ...
 LL |     a.push(b);
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'c` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 7e5182a5d30c940b2f2363d950dafec273167d92..ce0e9be300698ea2e52a0616256cb42e2516587c 100644 (file)
@@ -4,15 +4,16 @@ warning: not reporting region error due to nll
 LL |     let b = Ref { data: y.data };
    |             ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex2e-push-inference-variable-3.rs:18:5
    |
 LL | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-   |                                   ------------      ------------ these two types are declared with different lifetimes...
+   |            --  -- lifetime `'c` defined here
+   |            |
+   |            lifetime `'b` defined here
 ...
 LL |     Vec::push(a, b);
-   |     ^^^^^^^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^^^^^^^ argument requires that `'c` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 36317c4570b982fe73a104fc6fcfb02d2d1f15bd..c7f1a0ede3c1cf26b8c413a8ac0690430f62c9e0 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     *v = x; //~ ERROR lifetime mismatch
    |          ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-2.rs:12:5
    |
 LL | fn foo(&mut (ref mut v, w): &mut (&u8, &u8), x: &u8) {
-   |                                   ---           --- these two types are declared with different lifetimes...
+   |                                   -             - let's call the lifetime of this reference `'1`
+   |                                   |
+   |                                   let's call the lifetime of this reference `'2`
 LL |     *v = x; //~ ERROR lifetime mismatch
-   |     ^^^^^^ ...but data from `x` flows here
+   |     ^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index c43c4ce3a0c21fa5080eab79a0596133b418754c..09980e44c52d63b3ada0f2a6c59c004acbdff611 100644 (file)
@@ -10,22 +10,25 @@ warning: not reporting region error due to nll
 LL |     z.push((x,y)); //~ ERROR lifetime mismatch
    |               ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-3.rs:12:5
    |
 LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
-   |                     ---                 --- these two types are declared with different lifetimes...
+   |                     -                   - let's call the lifetime of this reference `'1`
+   |                     |
+   |                     let's call the lifetime of this reference `'2`
 LL |     z.push((x,y)); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^^^^^ ...but data flows into `z` here
+   |     ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-3.rs:12:5
    |
 LL | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
-   |                         ---                  --- these two types are declared with different lifetimes...
+   |                         -                    - let's call the lifetime of this reference `'1`
+   |                         |
+   |                         let's call the lifetime of this reference `'2`
 LL |     z.push((x,y)); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^^^^^ ...but data flows into `z` here
+   |     ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0623`.
index 191389b7706e1e8f93e18533d6157472af6249e1..2829fbcd32a1bbc13801a80c7af3cdcd53d3fee9 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.b = y.b; //~ ERROR lifetime mismatch
    |           ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-2.rs:16:5
    |
 LL | fn foo(mut x: Ref, y: Ref) {
-   |               ---     --- these two types are declared with different lifetimes...
+   |               ---     --- lifetime `'1` appears in this type
+   |               |
+   |               lifetime `'2` appears in this type
 LL |     x.b = y.b; //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 159367cc9d2a6f98cceebb48c97c3ab4ccf5c59c..8171ee758b066fc2590b1f1c428959a6c8232d08 100644 (file)
@@ -4,16 +4,16 @@ warning: not reporting region error due to nll
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
    |           ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-3.rs:16:5
    |
 LL | fn foo(mut x: Ref) {
    |               ---
    |               |
-   |               this type is declared with multiple lifetimes...
+   |               lifetime `'1` appears in this type
+   |               lifetime `'2` appears in this type
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data with one lifetime flows into the other here
+   |     ^^^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 3bbcbdd6681fd7aa1a5b09a9f5ada3b00f17ce77..99b64605baec1e1641c6a526a350baeee0857ac7 100644 (file)
@@ -4,16 +4,16 @@ warning: not reporting region error due to nll
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
    |           ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-4.rs:16:5
    |
 LL | fn foo(mut x: Ref) {
    |               ---
    |               |
-   |               this type is declared with multiple lifetimes...
+   |               lifetime `'1` appears in this type
+   |               lifetime `'2` appears in this type
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data with one lifetime flows into the other here
+   |     ^^^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 2a5729952e33d3e691dd50017c730bb4bb3a9997..aed0dcc1a67ea14ae48268c447dc09c80533c8f7 100644 (file)
@@ -4,15 +4,16 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs:18:5
    |
 LL | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>)
-   |                           -------      ------- these two types are declared with different lifetimes...
+   |        --  -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
 ...
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'b` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 6efc8d3da06776ad6cd66b96c24d1e98b6d1e066..7790d37d1c40dafc2cd76843919e6bc89e0c7d8d 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs-latebound-regions.rs:15:5
    |
 LL | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>) {
-   |                           -------      ------- these two types are declared with different lifetimes...
+   |        --  -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'b` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 0f555020822cb42f4559e21eedc3de6336237aee..c9542d31069799f69fb1b283af44ba246673be68 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-both-are-structs.rs:15:5
    |
 LL | fn foo(mut x: Vec<Ref>, y: Ref) {
-   |                   ---      --- these two types are declared with different lifetimes...
+   |                   ---      --- lifetime `'1` appears in this type
+   |                   |
+   |                   lifetime `'2` appears in this type
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 4400644e7fb65299d62adba5139f1cbb574021ad..459a93813a8cae1a53288821be9557d27640a539 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-latebound-regions.rs:12:5
    |
 LL | fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) {
-   |                           ------      ------ these two types are declared with different lifetimes...
+   |        -- -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'b` must outlive `'a`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 93f2837c0fc11ce2b838da0757d829d87805cd54..459796760e1b490cc3f076080a69d5fbeb0c9b03 100644 (file)
@@ -4,15 +4,15 @@ warning: not reporting region error due to nll
 LL |     y = x.b; //~ ERROR lifetime mismatch
    |         ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:14:5
    |
 LL | fn foo(mut x: Ref, y: &u32) {
-   |               ---     ----
+   |               ---     - let's call the lifetime of this reference `'2`
    |               |
-   |               these two types are declared with different lifetimes...
+   |               lifetime `'1` appears in this type
 LL |     y = x.b; //~ ERROR lifetime mismatch
-   |     ^^^^^^^ ...but data from `x` flows into `y` here
+   |     ^^^^^^^ requires that `'1` must outlive `'2`
 
 error[E0384]: cannot assign to immutable argument `y`
   --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:14:5
@@ -24,5 +24,4 @@ LL |     y = x.b; //~ ERROR lifetime mismatch
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0384, E0623.
-For more information about an error, try `rustc --explain E0384`.
+For more information about this error, try `rustc --explain E0384`.
index e7fb67f117f88c5138563673e3700b83caf208b8..5fc1755ed390ac083a09157882e436d57ca04bfe 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     y.b = x; //~ ERROR lifetime mismatch
    |           ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-one-is-struct-3.rs:14:5
    |
 LL | fn foo(mut y: Ref, x: &u32) {
-   |               ---     ---- these two types are declared with different lifetimes...
+   |               ---     - let's call the lifetime of this reference `'1`
+   |               |
+   |               lifetime `'2` appears in this type
 LL |     y.b = x; //~ ERROR lifetime mismatch
-   |     ^^^^^^^ ...but data from `x` flows into `y` here
+   |     ^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index af9e3a42664cf6e35e0b476969534bfdc797e3c0..835f95880a744b43d92e0ab8a36b93d612061169 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     y.b = x; //~ ERROR lifetime mismatch
    |           ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:14:5
    |
 LL | fn foo(mut y: Ref, x: &u32) {
-   |               ---     ---- these two types are declared with different lifetimes...
+   |               ---     - let's call the lifetime of this reference `'1`
+   |               |
+   |               lifetime `'2` appears in this type
 LL |     y.b = x; //~ ERROR lifetime mismatch
-   |     ^^^^^^^ ...but data from `x` flows into `y` here
+   |     ^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 5437beaab65117683f4f117089ce16ea00e6f491..7aed5fe626f060d04f19e241e08e6a7dc9b24124 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.b = y; //~ ERROR lifetime mismatch
    |           ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-one-is-struct.rs:17:5
    |
 LL | fn foo(mut x: Ref, y: &u32) {
-   |               ---     ---- these two types are declared with different lifetimes...
+   |               ---     - let's call the lifetime of this reference `'1`
+   |               |
+   |               lifetime `'2` appears in this type
 LL |     x.b = y; //~ ERROR lifetime mismatch
-   |     ^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 42e1d42a32ccd32fe78817243a9610943aebe750..22581d9b0751f1be945cc322cece57ebb5561b40 100644 (file)
@@ -4,16 +4,15 @@ warning: not reporting region error due to nll
 LL |     x //~ ERROR lifetime mismatch
    |     ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:17:5
    |
 LL |   fn foo<'a>(&self, x: &i32) -> &i32 {
-   |                        ----     ----
-   |                        |
-   |                        this parameter and the return type are declared with different lifetimes...
+   |              -         - let's call the lifetime of this reference `'1`
+   |              |
+   |              let's call the lifetime of this reference `'2`
 LL |     x //~ ERROR lifetime mismatch
-   |     ^ ...but data from `x` is returned here
+   |     ^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 26b0488cfdc61cf054b369c4baa21fe8e199b0fc..908526d439e8b389e6d43600fe9c3d5812c5cdfe 100644 (file)
@@ -4,16 +4,15 @@ warning: not reporting region error due to nll
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
    |                   ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-self-is-anon.rs:17:9
    |
 LL |     fn foo<'a>(&self, x: &Foo) -> &Foo {
-   |                          ----     ----
-   |                          |
-   |                          this parameter and the return type are declared with different lifetimes...
+   |                -         - let's call the lifetime of this reference `'1`
+   |                |
+   |                let's call the lifetime of this reference `'2`
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `x` is returned here
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index a0aa1e28d9bc03183b388e96df22287287417686..2829ec35000439fbdffb276fdcbb610b57bbd618 100644 (file)
@@ -4,23 +4,24 @@ warning: not reporting region error due to nll
 LL |   y.push(z); //~ ERROR lifetime mismatch
    |          ^
 
-error[E0623]: lifetime mismatch
+error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
   --> $DIR/ex3-both-anon-regions-using-fn-items.rs:11:3
    |
 LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
-   |                               ---      --- these two types are declared with different lifetimes...
+   |                        - help: consider changing this to be mutable: `mut y`
 LL |   y.push(z); //~ ERROR lifetime mismatch
-   |   ^^^^^^^^^ ...but data from `z` flows into `y` here
+   |   ^ cannot borrow as mutable
 
-error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-using-fn-items.rs:11:3
    |
 LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
-   |                        - help: consider changing this to be mutable: `mut y`
+   |                               -        - let's call the lifetime of this reference `'1`
+   |                               |
+   |                               let's call the lifetime of this reference `'2`
 LL |   y.push(z); //~ ERROR lifetime mismatch
-   |   ^ cannot borrow as mutable
+   |   ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0596, E0623.
-For more information about an error, try `rustc --explain E0596`.
+For more information about this error, try `rustc --explain E0596`.
index 5d4492701beb33209beab494a81da78dd657c043..44d68df4b5590ad2e0f916abb16727ece809ed27 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |         x.push(y); //~ ERROR lifetime mismatch
    |                ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-using-impl-items.rs:15:9
    |
 LL |     fn foo(x: &mut Vec<&u8>, y: &u8) {
-   |                        ---      --- these two types are declared with different lifetimes...
+   |                        -        - let's call the lifetime of this reference `'1`
+   |                        |
+   |                        let's call the lifetime of this reference `'2`
 LL |         x.push(y); //~ ERROR lifetime mismatch
-   |         ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |         ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 37b79cee72f75bec1baf25a23ad67c05cb4542c1..5d3c6f38ad808cb433765b56ca18de0cd4e10203 100644 (file)
@@ -4,23 +4,24 @@ warning: not reporting region error due to nll
 LL |   y.push(z); //~ ERROR lifetime mismatch
    |          ^
 
-error[E0623]: lifetime mismatch
+error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
   --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:3
    |
 LL | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
-   |                 ---  --- these two types are declared with different lifetimes...
+   |                              - help: consider changing this to be mutable: `mut y`
 LL |   y.push(z); //~ ERROR lifetime mismatch
-   |   ^^^^^^^^^ ...but data from `z` flows into `y` here
+   |   ^ cannot borrow as mutable
 
-error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:3
    |
 LL | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
-   |                              - help: consider changing this to be mutable: `mut y`
+   |                                     -        - let's call the lifetime of this reference `'1`
+   |                                     |
+   |                                     let's call the lifetime of this reference `'2`
 LL |   y.push(z); //~ ERROR lifetime mismatch
-   |   ^ cannot borrow as mutable
+   |   ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0596, E0623.
-For more information about an error, try `rustc --explain E0596`.
+For more information about this error, try `rustc --explain E0596`.
index c11d81a4c13daf9336e2cd9e861c7b4b9bc52eed..6460e5d687ff0f752ad514c258cc0c09e9483104 100644 (file)
@@ -4,14 +4,15 @@ warning: not reporting region error due to nll
 LL |     x.push(y); //~ ERROR lifetime mismatch
    |            ^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/ex3-both-anon-regions.rs:12:5
    |
 LL | fn foo(x: &mut Vec<&u8>, y: &u8) {
-   |                    ---      --- these two types are declared with different lifetimes...
+   |                    -        - let's call the lifetime of this reference `'1`
+   |                    |
+   |                    let's call the lifetime of this reference `'2`
 LL |     x.push(y); //~ ERROR lifetime mismatch
-   |     ^^^^^^^^^ ...but data from `y` flows into `x` here
+   |     ^^^^^^^^^ argument requires that `'1` must outlive `'2`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 7f22dc8739e76a6a42b47382d5eb282e95103ff5..b8b1a675c5f6dbef301f694c8c6d52f2b46a2938 100644 (file)
@@ -88,6 +88,13 @@ pub fn zero_size_phantom_toplevel()
     pub fn good15(p: TransparentLifetime);
     pub fn good16(p: TransparentUnit<ZeroSize>);
     pub fn good17(p: TransparentCustomZst);
+    #[allow(improper_ctypes)]
+    pub fn good18(_: &String);
+}
+
+#[allow(improper_ctypes)]
+extern {
+    pub fn good19(_: &String);
 }
 
 #[cfg(not(target_arch = "wasm32"))]
index 5cd0084901fe37c0ce3204057a6a7892c87a4e40..e87ddde7413d2a45fb81c0c1868eace7ea320a47 100644 (file)
 
 // aux-build:lint_output_format.rs
 
-// FIXME(#44232) we should warn that this isn't used.
-#![feature(foo)]
-
-#![feature(test_feature)]
+#![feature(unstable_test_feature)]
 #![feature(rustc_attrs)]
 
 extern crate lint_output_format;
index d484061ef9661d6590030eef376f1ead540432c3..8c6247688e80cc5ff1b1bcdf4cc78810d8e956d1 100644 (file)
@@ -1,5 +1,5 @@
 warning: use of deprecated item 'lint_output_format::foo': text
-  --> $DIR/lint-output-format-2.rs:20:26
+  --> $DIR/lint-output-format-2.rs:17:26
    |
 LL | use lint_output_format::{foo, bar};
    |                          ^^^
@@ -7,13 +7,13 @@ LL | use lint_output_format::{foo, bar};
    = note: #[warn(deprecated)] on by default
 
 warning: use of deprecated item 'lint_output_format::foo': text
-  --> $DIR/lint-output-format-2.rs:25:14
+  --> $DIR/lint-output-format-2.rs:22:14
    |
 LL |     let _x = foo();
    |              ^^^
 
 error: compilation successful
-  --> $DIR/lint-output-format-2.rs:24:1
+  --> $DIR/lint-output-format-2.rs:21:1
    |
 LL | / fn main() { //~ ERROR: compilation successful
 LL | |     let _x = foo();
index 4cf90019d40eba7c569c72dacd0bf0bd64e7c163..bdbc7bd660fcdaf0f9cdbbfd8adfd0f91834733f 100644 (file)
@@ -10,9 +10,9 @@
 
 #![feature(use_extern_macros)]
 
-#[derive(inline)] //~ ERROR expected a macro, found non-macro attribute
+#[derive(inline)] //~ ERROR expected a macro, found built-in attribute
 struct S;
 
 fn main() {
-    inline!(); //~ ERROR expected a macro, found non-macro attribute
+    inline!(); //~ ERROR expected a macro, found built-in attribute
 }
index bd1015b7ee10efc5d15c0617fd5466c4eecc9168..396bba2408f32231b07f5630100810ff18167b63 100644 (file)
@@ -1,13 +1,13 @@
-error: expected a macro, found non-macro attribute
+error: expected a macro, found built-in attribute
   --> $DIR/macro-path-prelude-fail-3.rs:13:10
    |
-LL | #[derive(inline)] //~ ERROR expected a macro, found non-macro attribute
+LL | #[derive(inline)] //~ ERROR expected a macro, found built-in attribute
    |          ^^^^^^
 
-error: expected a macro, found non-macro attribute
+error: expected a macro, found built-in attribute
   --> $DIR/macro-path-prelude-fail-3.rs:17:5
    |
-LL |     inline!(); //~ ERROR expected a macro, found non-macro attribute
+LL |     inline!(); //~ ERROR expected a macro, found built-in attribute
    |     ^^^^^^
 
 error: aborting due to 2 previous errors
diff --git a/src/test/ui/macros/missing-comma.rs b/src/test/ui/macros/missing-comma.rs
new file mode 100644 (file)
index 0000000..ac82171
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright 2018 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.
+
+macro_rules! foo {
+    ($a:ident, $b:ident) => ()
+}
+
+fn main() {
+    println!("{}" a);
+    //~^ ERROR expected token: `,`
+    foo!(a b);
+    //~^ ERROR no rules expected the token `b`
+}
diff --git a/src/test/ui/macros/missing-comma.stderr b/src/test/ui/macros/missing-comma.stderr
new file mode 100644 (file)
index 0000000..3467032
--- /dev/null
@@ -0,0 +1,16 @@
+error: expected token: `,`
+  --> $DIR/missing-comma.rs:16:19
+   |
+LL |     println!("{}" a);
+   |                   ^
+
+error: no rules expected the token `b`
+  --> $DIR/missing-comma.rs:18:12
+   |
+LL |     foo!(a b);
+   |           -^
+   |           |
+   |           help: missing comma here
+
+error: aborting due to 2 previous errors
+
index da8ce55162f37e706ce35dbfb4cf9f4386449389..d79be8b83c61fa6156980341eaeae4f106d41f4a 100644 (file)
@@ -51,7 +51,7 @@ fn demand_y<'x, 'y>(_cell_x: &Cell<&'x u32>, _cell_y: &Cell<&'y u32>, _y: &'y u3
 #[rustc_regions]
 fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-        //~^ ERROR lifetime mismatch
+        //~^ ERROR unsatisfied lifetime constraints
 
         // Only works if 'x: 'y:
         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
index 2704a325314664e89ac45e2b6356458fb546b3fc..fe67ca0293e06bed86d4dd0d5931afba43c0e948 100644 (file)
@@ -9,7 +9,7 @@ note: External requirements
    |
 LL |       establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
    |  _______________________________________________^
-LL | |         //~^ ERROR lifetime mismatch
+LL | |         //~^ ERROR unsatisfied lifetime constraints
 LL | |
 LL | |         // Only works if 'x: 'y:
 LL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
@@ -23,27 +23,12 @@ LL | |     });
    = note: number of external vids: 5
    = note: where '_#1r: '_#2r
 
-error[E0623]: lifetime mismatch
-  --> $DIR/propagate-approximated-ref.rs:53:5
-   |
-LL |   fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
-   |                                  -------                -------
-   |                                  |
-   |                                  these two types are declared with different lifetimes...
-LL | /     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | |         //~^ ERROR lifetime mismatch
-LL | |
-LL | |         // Only works if 'x: 'y:
-LL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
-LL | |     });
-   | |______^ ...but data from `cell_a` flows into `cell_b` here
-
 note: No external requirements
   --> $DIR/propagate-approximated-ref.rs:52:1
    |
 LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
 LL | |     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | |         //~^ ERROR lifetime mismatch
+LL | |         //~^ ERROR unsatisfied lifetime constraints
 LL | |
 ...  |
 LL | |     });
@@ -52,6 +37,20 @@ LL | | }
    |
    = note: defining type: DefId(0/0:6 ~ propagate_approximated_ref[317d]::supply[0]) with substs []
 
+error: unsatisfied lifetime constraints
+  --> $DIR/propagate-approximated-ref.rs:53:5
+   |
+LL |   fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+   |             --  -- lifetime `'b` defined here
+   |             |
+   |             lifetime `'a` defined here
+LL | /     establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
+LL | |         //~^ ERROR unsatisfied lifetime constraints
+LL | |
+LL | |         // Only works if 'x: 'y:
+LL | |         demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
+LL | |     });
+   | |______^ argument requires that `'a` must outlive `'b`
+
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 0449dc1d1a75c2846134f95c52c21993c79f43c1..bf24557398d161d3e696c945249e45503f094f8c 100644 (file)
@@ -44,7 +44,7 @@ fn demand_y<'x, 'y>(_outlives1: Cell<&&'x u32>, _outlives2: Cell<&'y &u32>, _y:
 #[rustc_regions]
 fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-        //~^ ERROR lifetime mismatch
+        //~^ ERROR unsatisfied lifetime constraints
 
         // Only works if 'x: 'y:
         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
index 3cd9e9dd5b008f19322475a1ed6ddc342dc6ea10..ed1fc6e1a712fe5bcef02c58e7d5657be2c098a3 100644 (file)
@@ -9,7 +9,7 @@ note: External requirements
    |
 LL |       establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
    |  _____________________________________________^
-LL | |         //~^ ERROR lifetime mismatch
+LL | |         //~^ ERROR unsatisfied lifetime constraints
 LL | |
 LL | |         // Only works if 'x: 'y:
 LL | |         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
@@ -23,27 +23,12 @@ LL | |     });
    = note: number of external vids: 5
    = note: where '_#1r: '_#2r
 
-error[E0623]: lifetime mismatch
-  --> $DIR/propagate-approximated-val.rs:46:5
-   |
-LL |   fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
-   |                                -------                -------
-   |                                |
-   |                                these two types are declared with different lifetimes...
-LL | /     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-LL | |         //~^ ERROR lifetime mismatch
-LL | |
-LL | |         // Only works if 'x: 'y:
-LL | |         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
-LL | |     });
-   | |______^ ...but data from `cell_a` flows into `cell_b` here
-
 note: No external requirements
   --> $DIR/propagate-approximated-val.rs:45:1
    |
 LL | / fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
 LL | |     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-LL | |         //~^ ERROR lifetime mismatch
+LL | |         //~^ ERROR unsatisfied lifetime constraints
 LL | |
 ...  |
 LL | |     });
@@ -52,6 +37,20 @@ LL | | }
    |
    = note: defining type: DefId(0/0:6 ~ propagate_approximated_val[317d]::test[0]) with substs []
 
+error: unsatisfied lifetime constraints
+  --> $DIR/propagate-approximated-val.rs:46:5
+   |
+LL |   fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+   |           --  -- lifetime `'b` defined here
+   |           |
+   |           lifetime `'a` defined here
+LL | /     establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
+LL | |         //~^ ERROR unsatisfied lifetime constraints
+LL | |
+LL | |         // Only works if 'x: 'y:
+LL | |         demand_y(outlives1, outlives2, x.get()) //~ WARNING not reporting region error due to nll
+LL | |     });
+   | |______^ argument requires that `'a` must outlive `'b`
+
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index a823e62d3b843f76b5184a2eeb305dfd46664a7a..a019a7224c630da316deac9de44ab2b7cd8321f8 100644 (file)
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/region-lbr-anon-does-not-outlive-static.rs:19:5
    |
 LL | fn foo(x: &u32) -> &'static u32 {
-   |        - consider changing the type of `x` to `&ReStatic u32`
+   |           ---- help: add explicit lifetime `ReStatic` to the type of `x`: `&ReStatic u32`
 LL |     &*x
    |     ^^^ lifetime `ReStatic` required
 
index 8598668bef50ea59002d5466e6d895976a97d7bc..a883e7b1994737ce4a97dacfd16506ebfd2df73c 100644 (file)
@@ -18,7 +18,7 @@
 fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
     &*x
         //~^ WARN not reporting region error due to nll
-        //~| ERROR lifetime mismatch
+        //~| ERROR unsatisfied lifetime constraints
 }
 
 fn main() { }
index 415aefdeee947a97b91f71c667aa57cc82a78f64..cf3f4df19ae52581d465bd2cab9f7e69d95b8967 100644 (file)
@@ -4,16 +4,15 @@ warning: not reporting region error due to nll
 LL |     &*x
    |     ^^^
 
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/region-lbr1-does-not-outlive-ebr2.rs:19:5
    |
 LL | fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
-   |                   -------                 -------
-   |                   |
-   |                   this parameter and the return type are declared with different lifetimes...
+   |        --  -- lifetime `'b` defined here
+   |        |
+   |        lifetime `'a` defined here
 LL |     &*x
-   |     ^^^ ...but data from `x` is returned here
+   |     ^^^ requires that `'a` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
index 580dce3c0fe632691f65bc1d8d35d1e153275397..b955a51e38d73433184f516491839ff030d7074c 100644 (file)
@@ -63,18 +63,9 @@ LL |         match map.get() {
 LL |             Some(v) => {
 LL |                 map.set(String::new()); // Both AST and MIR error here
    |                 ^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
-   |
-note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 41:1...
-  --> $DIR/get_default.rs:41:1
-   |
-LL | / fn err(map: &mut Map) -> &String {
-LL | |     loop {
-LL | |         match map.get() {
-LL | |             Some(v) => {
-...  |
-LL | |     }
-LL | | }
-   | |_^
+...
+LL |                 return v;
+   |                        - borrow later used here
 
 error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
   --> $DIR/get_default.rs:51:17
index 2f8eab907c7bb5185353420d28460e9ac2cd38e6..75194bf55bc9f1a3b9864d3648790578ea782852 100644 (file)
@@ -63,18 +63,9 @@ LL |         match map.get() {
 LL |             Some(v) => {
 LL |                 map.set(String::new()); // Both AST and MIR error here
    |                 ^^^ mutable borrow occurs here
-   |
-note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 41:1...
-  --> $DIR/get_default.rs:41:1
-   |
-LL | / fn err(map: &mut Map) -> &String {
-LL | |     loop {
-LL | |         match map.get() {
-LL | |             Some(v) => {
-...  |
-LL | |     }
-LL | | }
-   | |_^
+...
+LL |                 return v;
+   |                        - borrow later used here
 
 error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
   --> $DIR/get_default.rs:51:17
index 3cb20cc975f4d11c63f2d535d94068a12c5ebb91..6fc4812998681249f4c6ce02581361c0f772ddf4 100644 (file)
@@ -13,7 +13,7 @@ error[E0621]: explicit lifetime required in the type of `s`
   --> $DIR/guarantor-issue-46974.rs:25:5
    |
 LL | fn bar(s: &Box<(i32,)>) -> &'static i32 {
-   |        - consider changing the type of `s` to `&'static std::boxed::Box<(i32,)>`
+   |           ------------ help: add explicit lifetime `'static` to the type of `s`: `&'static std::boxed::Box<(i32,)>`
 LL |     // FIXME(#46983): error message should be better
 LL |     &s.0 //~ ERROR explicit lifetime required in the type of `s` [E0621]
    |     ^^^^ lifetime `'static` required
index 7bdac345e9047a881e2c7555d0067b4131bfa34e..84d0730025a5c93a8a6d8b36bbafd36905be1e57 100644 (file)
@@ -2,11 +2,12 @@ error: unsatisfied lifetime constraints
   --> $DIR/issue-48238.rs:21:13
    |
 LL |     move || use_val(&orig); //~ ERROR
-   |     --------^^^^^^^^^^^^^^
-   |     |       |
-   |     |       argument requires that `'1` must outlive `'2`
-   |     lifetime `'1` represents the closure body
-   |     lifetime `'2` appears in return type
+   |     ------- ^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
+   |     |     |
+   |     |     return type of closure is &'2 u8
+   |     lifetime `'1` represents this closure's body
+   |
+   = note: closure implements `Fn`, so references to captured variables can't escape the closure
 
 error: aborting due to previous error
 
index 1c509c5d224618584db790d1705eef70904731b9..e484c249d84a59446baf51615ba2e2bcfd408b17 100644 (file)
@@ -40,7 +40,7 @@ fn produce3<'a, 'b: 'a>(data: &'a mut Vec<&'a u32>, value: &'b u32) -> impl Bazi
 }
 
 fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
-    let x = move || { //~ ERROR lifetime mismatch
+    let x = move || { //~ ERROR unsatisfied lifetime constraints
         let value: &'a u32 = value;
         data.push(value);
     };
index 4a7c10c3f1af860af15f34e791d1da6d60da8f2e..b21539361e66f8a2dbd021c46a471c0bbf85ec41 100644 (file)
@@ -1,11 +1,12 @@
-error[E0623]: lifetime mismatch
+error: unsatisfied lifetime constraints
   --> $DIR/issue-52113.rs:43:9
    |
 LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
-   |                                  --------------------         ------- these two types are declared with different lifetimes...
-LL |     let x = move || { //~ ERROR lifetime mismatch
-   |         ^ ...but data from `value` flows into `data` here
+   |                --  -- lifetime `'b` defined here
+   |                |
+   |                lifetime `'a` defined here
+LL |     let x = move || { //~ ERROR unsatisfied lifetime constraints
+   |         ^ requires that `'a` must outlive `'b`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0623`.
diff --git a/src/test/ui/nll/issue-53119.rs b/src/test/ui/nll/issue-53119.rs
new file mode 100644 (file)
index 0000000..bbef4cf
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright 2018 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.
+
+// compile-pass
+
+#![feature(nll)]
+
+use std::ops::Deref;
+
+pub struct TypeFieldIterator<'a, T: 'a> {
+    _t: &'a T,
+}
+
+pub struct Type<Id, T> {
+    _types: Vec<(Id, T)>,
+}
+
+impl<'a, Id: 'a, T> Iterator for TypeFieldIterator<'a, T>
+where T: Deref<Target = Type<Id, T>> {
+    type Item = &'a (Id, T);
+
+    fn next(&mut self) -> Option<&'a (Id, T)> {
+        || self.next();
+        None
+    }
+}
+
+fn main() { }
index f441085f242edddc102c2078ba1fd1691134b523..f40e38c63f5ac28634c488df2b68d67a60134e13 100644 (file)
@@ -1,13 +1,16 @@
 error[E0597]: borrowed value does not live long enough
   --> $DIR/return-ref-mut-issue-46557.rs:17:21
    |
-LL |     let ref mut x = 1234543; //~ ERROR borrowed value does not live long enough [E0597]
-   |                     ^^^^^^^ temporary value does not live long enough
-LL |     x
-LL | }
-   | - temporary value only lives until here
-   |
-   = note: borrowed value must be valid for the static lifetime...
+LL |   fn gimme_static_mut() -> &'static mut u32 {
+   |  ___________________________________________-
+LL | |     let ref mut x = 1234543; //~ ERROR borrowed value does not live long enough [E0597]
+   | |                     ^^^^^^^ temporary value does not live long enough
+LL | |     x
+LL | | }
+   | | -
+   | | |
+   | |_temporary value only lives until here
+   |   borrow later used here
 
 error: aborting due to previous error
 
index f836960a28cf372d4b492945dd41ab6fcdb1deb7..a4f0e53386f9f045016f90b53116a723782ef935 100644 (file)
@@ -7,10 +7,12 @@ LL |     x
 error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/impl-trait-captures.rs:21:5
    |
-LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
-   |               - consider changing the type of `x` to `&ReEarlyBound(0, 'a) T`
 LL |     x
    |     ^ lifetime `ReEarlyBound(0, 'a)` required
+help: add explicit lifetime `ReEarlyBound(0, 'a)` to the type of `x`
+   |
+LL | fn foo<'a, T>(x: &ReEarlyBound(0, 'a) T) -> impl Foo<'a> {
+   |                  ^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to previous error
 
index 160dda05b1ed69522c433e7e8ee825503cee5934..2d97e160f49144a40080c8050082c284858d9c06 100644 (file)
@@ -11,9 +11,5 @@
 // If macro modularization (`use_extern_macros`) is not enabled,
 // then tool attributes are treated as custom attributes.
 
-// compile-pass
-
-#![feature(custom_attribute)]
-
-#[rustfmt::bar]
+#[rustfmt::bar] //~ ERROR attribute `rustfmt::bar` is currently unknown to the compiler
 fn main() {}
diff --git a/src/test/ui/tool-attributes-disabled-2.stderr b/src/test/ui/tool-attributes-disabled-2.stderr
new file mode 100644 (file)
index 0000000..b327773
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0658]: The attribute `rustfmt::bar` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
+  --> $DIR/tool-attributes-disabled-2.rs:14:1
+   |
+LL | #[rustfmt::bar] //~ ERROR attribute `rustfmt::bar` is currently unknown to the compiler
+   | ^^^^^^^^^^^^^^^
+   |
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
index b3355352423799aa1caabe5968d40f7e1a1157b4..7a6b9ae9943bc99c818d3d8cdf095c939e3e5981 100644 (file)
@@ -8,15 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(tool_attributes)]
+#![feature(tool_attributes, custom_attribute)]
 
 type A = rustfmt; //~ ERROR expected type, found tool module `rustfmt`
-type B = rustfmt::skip; //~ ERROR expected type, found non-macro attribute `rustfmt::skip`
+type B = rustfmt::skip; //~ ERROR expected type, found tool attribute `rustfmt::skip`
 
 #[derive(rustfmt)] //~ ERROR cannot find derive macro `rustfmt` in this scope
 struct S;
 
-#[rustfmt] //~ ERROR cannot find attribute macro `rustfmt` in this scope
+#[rustfmt] // OK, interpreted as a custom attribute
 fn check() {}
 
 #[rustfmt::skip] // OK
@@ -24,5 +24,5 @@ fn main() {
     rustfmt; //~ ERROR expected value, found tool module `rustfmt`
     rustfmt!(); //~ ERROR cannot find macro `rustfmt!` in this scope
 
-    rustfmt::skip; //~ ERROR expected value, found non-macro attribute `rustfmt::skip`
+    rustfmt::skip; //~ ERROR expected value, found tool attribute `rustfmt::skip`
 }
index b9e61121406eddc2a83996f8939e27b0da24d3db..60188aebce77cff6fb2cb84299b2d0ee6f8a6407 100644 (file)
@@ -4,12 +4,6 @@ error: cannot find derive macro `rustfmt` in this scope
 LL | #[derive(rustfmt)] //~ ERROR cannot find derive macro `rustfmt` in this scope
    |          ^^^^^^^
 
-error: cannot find attribute macro `rustfmt` in this scope
-  --> $DIR/tool-attributes-misplaced-1.rs:19:3
-   |
-LL | #[rustfmt] //~ ERROR cannot find attribute macro `rustfmt` in this scope
-   |   ^^^^^^^
-
 error: cannot find macro `rustfmt!` in this scope
   --> $DIR/tool-attributes-misplaced-1.rs:25:5
    |
@@ -22,10 +16,10 @@ error[E0573]: expected type, found tool module `rustfmt`
 LL | type A = rustfmt; //~ ERROR expected type, found tool module `rustfmt`
    |          ^^^^^^^ not a type
 
-error[E0573]: expected type, found non-macro attribute `rustfmt::skip`
+error[E0573]: expected type, found tool attribute `rustfmt::skip`
   --> $DIR/tool-attributes-misplaced-1.rs:14:10
    |
-LL | type B = rustfmt::skip; //~ ERROR expected type, found non-macro attribute `rustfmt::skip`
+LL | type B = rustfmt::skip; //~ ERROR expected type, found tool attribute `rustfmt::skip`
    |          ^^^^^^^^^^^^^ not a type
 
 error[E0423]: expected value, found tool module `rustfmt`
@@ -34,13 +28,13 @@ error[E0423]: expected value, found tool module `rustfmt`
 LL |     rustfmt; //~ ERROR expected value, found tool module `rustfmt`
    |     ^^^^^^^ not a value
 
-error[E0423]: expected value, found non-macro attribute `rustfmt::skip`
+error[E0423]: expected value, found tool attribute `rustfmt::skip`
   --> $DIR/tool-attributes-misplaced-1.rs:27:5
    |
-LL |     rustfmt::skip; //~ ERROR expected value, found non-macro attribute `rustfmt::skip`
+LL |     rustfmt::skip; //~ ERROR expected value, found tool attribute `rustfmt::skip`
    |     ^^^^^^^^^^^^^ not a value
 
-error: aborting due to 7 previous errors
+error: aborting due to 6 previous errors
 
 Some errors occurred: E0423, E0573.
 For more information about an error, try `rustc --explain E0423`.
index 3bb0e3dc34382b2b4bb0decfebfbd00a123b810c..102edf2813b213eaac89ebb7648eb95ab1849830 100644 (file)
@@ -10,9 +10,9 @@
 
 #![feature(tool_attributes)]
 
-#[derive(rustfmt::skip)] //~ ERROR expected a macro, found non-macro attribute
+#[derive(rustfmt::skip)] //~ ERROR expected a macro, found tool attribute
 struct S;
 
 fn main() {
-    rustfmt::skip!(); //~ ERROR expected a macro, found non-macro attribute
+    rustfmt::skip!(); //~ ERROR expected a macro, found tool attribute
 }
index 66452267e947b8448d3dea8510a6eb3e0cf73968..5b968cd6b8ecdd31268d54377f12001160a9a8c2 100644 (file)
@@ -1,13 +1,13 @@
-error: expected a macro, found non-macro attribute
+error: expected a macro, found tool attribute
   --> $DIR/tool-attributes-misplaced-2.rs:13:10
    |
-LL | #[derive(rustfmt::skip)] //~ ERROR expected a macro, found non-macro attribute
+LL | #[derive(rustfmt::skip)] //~ ERROR expected a macro, found tool attribute
    |          ^^^^^^^^^^^^^
 
-error: expected a macro, found non-macro attribute
+error: expected a macro, found tool attribute
   --> $DIR/tool-attributes-misplaced-2.rs:17:5
    |
-LL |     rustfmt::skip!(); //~ ERROR expected a macro, found non-macro attribute
+LL |     rustfmt::skip!(); //~ ERROR expected a macro, found tool attribute
    |     ^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index 3ae76e1a82a5c9906bf2fa42edf1194bf60bd600..c640acec05e80bf6674ec9b9ad2287df88a32b8f 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // compile-pass
+#![feature(const_fn_union)]
 
 union U {
     a: usize,
index 7e5e4c1e7e80ed689a49101569dde2c19753dc8d..99a087bea59c8f808b5485c6113edf9ce774e94a 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 7e5e4c1e7e80ed689a49101569dde2c19753dc8d
+Subproject commit 99a087bea59c8f808b5485c6113edf9ce774e94a
index 2bfc1ece09590687d7df1001a544b861cbccad22..c1d3df79222c5ad2d457a4d8a7afb0105b8ec9dc 100644 (file)
@@ -10,7 +10,6 @@
 
 #![crate_name = "compiletest"]
 #![feature(test)]
-#![feature(slice_rotate)]
 #![deny(warnings)]
 
 extern crate diff;
index 6d72813199d24838636389c7025ce95c427692f7..c51e3ff2f07f84f26f57fcb51808b1ec7cbe45a6 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 6d72813199d24838636389c7025ce95c427692f7
+Subproject commit c51e3ff2f07f84f26f57fcb51808b1ec7cbe45a6
index da17b689595ddc863b02eb1ba6831c87cefc1e21..5c9a2b6c13d3b6f8d3f9c02b130bb4b54fd489fb 160000 (submodule)
@@ -1 +1 @@
-Subproject commit da17b689595ddc863b02eb1ba6831c87cefc1e21
+Subproject commit 5c9a2b6c13d3b6f8d3f9c02b130bb4b54fd489fb
index c41377824fe3a0825e1c899183e24b7e3af48e4c..42f4e46085ebe17249c091d63dd7f0f085e9bad2 100644 (file)
@@ -10,7 +10,7 @@
 
 //! Check license of third-party deps by inspecting src/vendor
 
-use std::collections::{BTreeSet, HashSet};
+use std::collections::{BTreeSet, HashSet, HashMap};
 use std::fs::File;
 use std::io::Read;
 use std::path::Path;
@@ -242,6 +242,8 @@ pub fn check_whitelist(path: &Path, cargo: &Path, bad: &mut bool) {
         }
         *bad = true;
     }
+
+    check_crate_duplicate(&resolve, bad);
 }
 
 fn check_license(path: &Path) -> bool {
@@ -344,3 +346,30 @@ fn check_crate_whitelist<'a, 'b>(
 
     unapproved
 }
+
+fn check_crate_duplicate(resolve: &Resolve, bad: &mut bool) {
+    const FORBIDDEN_TO_HAVE_DUPLICATES: &[&str] = &[
+        // These two crates take quite a long time to build, let's not let two
+        // versions of them accidentally sneak into our dependency graph to
+        // ensure we keep our CI times under control
+        // "cargo", // FIXME(#53005)
+        // "rustc-ap-syntax", // FIXME(#53006)
+    ];
+    let mut name_to_id = HashMap::new();
+    for node in resolve.nodes.iter() {
+        name_to_id.entry(node.id.split_whitespace().next().unwrap())
+            .or_insert(Vec::new())
+            .push(&node.id);
+    }
+
+    for name in FORBIDDEN_TO_HAVE_DUPLICATES {
+        if name_to_id[name].len() <= 1 {
+            continue
+        }
+        println!("crate `{}` is duplicated in `Cargo.lock`", name);
+        for id in name_to_id[name].iter() {
+            println!("  * {}", id);
+        }
+        *bad = true;
+    }
+}
index f68ba0b095bd0b72d253efc6de6680fb41cb9996..1dc36221bd2898d4cbe3aea991e6464c7a1c9778 100644 (file)
@@ -50,34 +50,6 @@ pub struct Feature {
     pub tracking_issue: Option<u32>,
 }
 
-impl Feature {
-    fn check_match(&self, other: &Feature)-> Result<(), Vec<&'static str>> {
-        let mut mismatches = Vec::new();
-        if self.level != other.level {
-            mismatches.push("stability level");
-        }
-        if self.level == Status::Stable || other.level == Status::Stable {
-            // As long as a feature is unstable, the since field tracks
-            // when the given part of the feature has been implemented.
-            // Mismatches are tolerable as features evolve and functionality
-            // gets added.
-            // Once a feature is stable, the since field tracks the first version
-            // it was part of the stable distribution, and mismatches are disallowed.
-            if self.since != other.since {
-                mismatches.push("since");
-            }
-        }
-        if self.tracking_issue != other.tracking_issue {
-            mismatches.push("tracking issue");
-        }
-        if mismatches.is_empty() {
-            Ok(())
-        } else {
-            Err(mismatches)
-        }
-    }
-}
-
 pub type Features = HashMap<String, Feature>;
 
 pub fn check(path: &Path, bad: &mut bool, quiet: bool) {
@@ -310,13 +282,12 @@ fn get_and_check_lib_features(base_src_path: &Path,
                 Ok((name, f)) => {
                     let mut check_features = |f: &Feature, list: &Features, display: &str| {
                         if let Some(ref s) = list.get(name) {
-                            if let Err(m) = (&f).check_match(s) {
+                            if f.tracking_issue != s.tracking_issue {
                                 tidy_error!(bad,
-                                            "{}:{}: mismatches to {} in: {:?}",
+                                            "{}:{}: mismatches the `issue` in {}",
                                             file.display(),
                                             line,
-                                            display,
-                                            &m);
+                                            display);
                             }
                         }
                     };