]> git.lizzy.rs Git - rust.git/commitdiff
Merge cfail and ui tests into ui tests
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Mon, 20 Nov 2017 12:13:27 +0000 (13:13 +0100)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Fri, 24 Nov 2017 10:32:35 +0000 (11:32 +0100)
670 files changed:
src/librustc/session/mod.rs
src/test/compile-fail/issue-31221.rs
src/test/compile-fail/lint-output-format-2.rs
src/test/compile-fail/lint-unconditional-recursion.rs
src/test/ui-fulldeps/custom-derive/issue-36935.rs
src/test/ui-fulldeps/custom-derive/issue-36935.stderr
src/test/ui-fulldeps/issue-44953/issue-44953.rs
src/test/ui-fulldeps/issue-44953/issue-44953.stderr
src/test/ui-fulldeps/proc-macro/three-equals.rs
src/test/ui-fulldeps/proc-macro/three-equals.stderr
src/test/ui-fulldeps/resolve-error.rs
src/test/ui-fulldeps/resolve-error.stderr
src/test/ui/anonymous-higher-ranked-lifetime.rs
src/test/ui/anonymous-higher-ranked-lifetime.stderr
src/test/ui/block-result/issue-11714.rs
src/test/ui/block-result/issue-11714.stderr
src/test/ui/block-result/issue-3563.rs
src/test/ui/block-result/unexpected-return-on-unit.rs
src/test/ui/block-result/unexpected-return-on-unit.stderr
src/test/ui/borrowck/borrowck-closures-two-mut.rs
src/test/ui/borrowck/borrowck-closures-two-mut.stderr
src/test/ui/borrowck/borrowck-in-static.rs
src/test/ui/borrowck/borrowck-in-static.stderr
src/test/ui/borrowck/borrowck-reinit.rs
src/test/ui/borrowck/borrowck-reinit.stderr
src/test/ui/borrowck/mut-borrow-in-loop.rs
src/test/ui/borrowck/mut-borrow-in-loop.stderr
src/test/ui/borrowck/mut-borrow-outside-loop.rs
src/test/ui/borrowck/mut-borrow-outside-loop.stderr
src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.rs
src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr
src/test/ui/cast-to-unsized-trait-object-suggestion.rs
src/test/ui/cast-to-unsized-trait-object-suggestion.stderr
src/test/ui/check_match/issue-35609.rs
src/test/ui/check_match/issue-35609.stderr
src/test/ui/closure_context/issue-26046-fn-mut.rs
src/test/ui/closure_context/issue-26046-fn-mut.stderr
src/test/ui/closure_context/issue-26046-fn-once.rs
src/test/ui/closure_context/issue-26046-fn-once.stderr
src/test/ui/closure_context/issue-42065.rs
src/test/ui/closure_context/issue-42065.stderr
src/test/ui/codemap_tests/coherence-overlapping-inherent-impl-trait.rs
src/test/ui/codemap_tests/coherence-overlapping-inherent-impl-trait.stderr
src/test/ui/codemap_tests/empty_span.rs
src/test/ui/codemap_tests/empty_span.stderr
src/test/ui/codemap_tests/huge_multispan_highlight.rs
src/test/ui/codemap_tests/huge_multispan_highlight.stderr
src/test/ui/codemap_tests/issue-11715.rs
src/test/ui/codemap_tests/issue-11715.stderr
src/test/ui/codemap_tests/one_line.rs
src/test/ui/codemap_tests/one_line.stderr
src/test/ui/codemap_tests/overlapping_inherent_impls.rs
src/test/ui/codemap_tests/overlapping_inherent_impls.stderr
src/test/ui/codemap_tests/overlapping_spans.rs
src/test/ui/codemap_tests/overlapping_spans.stderr
src/test/ui/codemap_tests/tab.rs
src/test/ui/codemap_tests/tab.stderr
src/test/ui/codemap_tests/tab_2.rs
src/test/ui/codemap_tests/tab_2.stderr
src/test/ui/codemap_tests/tab_3.rs
src/test/ui/codemap_tests/tab_3.stderr
src/test/ui/codemap_tests/two_files.rs
src/test/ui/codemap_tests/two_files.stderr
src/test/ui/codemap_tests/unicode.rs
src/test/ui/codemap_tests/unicode.stderr
src/test/ui/codemap_tests/unicode_2.rs
src/test/ui/codemap_tests/unicode_2.stderr
src/test/ui/coercion-missing-tail-expected-type.rs
src/test/ui/coercion-missing-tail-expected-type.stderr
src/test/ui/command-line-diagnostics.rs [new file with mode: 0644]
src/test/ui/command-line-diagnostics.stderr [new file with mode: 0644]
src/test/ui/compare-method/region-extra.rs
src/test/ui/compare-method/region-extra.stderr
src/test/ui/compare-method/region-unrelated.rs
src/test/ui/const-eval/issue-43197.rs
src/test/ui/const-eval/issue-43197.stderr
src/test/ui/const-expr-addr-operator.rs
src/test/ui/const-expr-addr-operator.stderr
src/test/ui/cross-crate-macro-backtrace/main.rs
src/test/ui/cross-crate-macro-backtrace/main.stderr
src/test/ui/deref-suggestion.rs
src/test/ui/deref-suggestion.stderr
src/test/ui/did_you_mean/E0178.rs
src/test/ui/did_you_mean/E0178.stderr
src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.rs
src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs
src/test/ui/did_you_mean/issue-31424.rs
src/test/ui/did_you_mean/issue-31424.stderr
src/test/ui/did_you_mean/issue-34126.rs
src/test/ui/did_you_mean/issue-34126.stderr
src/test/ui/did_you_mean/issue-34337.rs
src/test/ui/did_you_mean/issue-34337.stderr
src/test/ui/did_you_mean/issue-35937.rs
src/test/ui/did_you_mean/issue-35937.stderr
src/test/ui/did_you_mean/issue-36798.rs
src/test/ui/did_you_mean/issue-36798.stderr
src/test/ui/did_you_mean/issue-36798_unknown_field.rs
src/test/ui/did_you_mean/issue-36798_unknown_field.stderr
src/test/ui/did_you_mean/issue-37139.rs
src/test/ui/did_you_mean/issue-37139.stderr
src/test/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs
src/test/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.stderr
src/test/ui/did_you_mean/issue-38147-1.rs
src/test/ui/did_you_mean/issue-38147-1.stderr
src/test/ui/did_you_mean/issue-38147-2.rs
src/test/ui/did_you_mean/issue-38147-2.stderr
src/test/ui/did_you_mean/issue-38147-3.rs
src/test/ui/did_you_mean/issue-38147-3.stderr
src/test/ui/did_you_mean/issue-38147-4.rs
src/test/ui/did_you_mean/issue-38147-4.stderr
src/test/ui/did_you_mean/issue-39544.rs
src/test/ui/did_you_mean/issue-39544.stderr
src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.rs
src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr
src/test/ui/did_you_mean/issue-40006.rs
src/test/ui/did_you_mean/issue-40006.stderr
src/test/ui/did_you_mean/issue-40396.rs
src/test/ui/did_you_mean/issue-40396.stderr
src/test/ui/did_you_mean/issue-40823.rs
src/test/ui/did_you_mean/issue-40823.stderr
src/test/ui/did_you_mean/issue-41679.rs
src/test/ui/did_you_mean/issue-41679.stderr
src/test/ui/did_you_mean/issue-42599_available_fields_note.rs
src/test/ui/did_you_mean/issue-42599_available_fields_note.stderr
src/test/ui/did_you_mean/issue-42764.rs
src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.rs
src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr
src/test/ui/did_you_mean/recursion_limit.rs
src/test/ui/did_you_mean/recursion_limit.stderr
src/test/ui/did_you_mean/recursion_limit_deref.rs
src/test/ui/did_you_mean/recursion_limit_deref.stderr
src/test/ui/did_you_mean/recursion_limit_macro.rs
src/test/ui/did_you_mean/recursion_limit_macro.stderr
src/test/ui/did_you_mean/trait-object-reference-without-parens-suggestion.rs
src/test/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr
src/test/ui/dropck/dropck-eyepatch-extern-crate.rs
src/test/ui/dropck/dropck-eyepatch-extern-crate.stderr
src/test/ui/dropck/dropck-eyepatch-reorder.rs
src/test/ui/dropck/dropck-eyepatch-reorder.stderr
src/test/ui/dropck/dropck-eyepatch.rs
src/test/ui/dropck/dropck-eyepatch.stderr
src/test/ui/e0119/complex-impl.rs
src/test/ui/e0119/complex-impl.stderr
src/test/ui/e0119/conflict-with-std.rs
src/test/ui/e0119/conflict-with-std.stderr
src/test/ui/e0119/issue-23563.rs
src/test/ui/e0119/issue-23563.stderr
src/test/ui/e0119/issue-27403.rs
src/test/ui/e0119/issue-27403.stderr
src/test/ui/e0119/issue-28981.rs
src/test/ui/e0119/issue-28981.stderr
src/test/ui/e0119/so-37347311.rs
src/test/ui/e0119/so-37347311.stderr
src/test/ui/fmt/send-sync.rs
src/test/ui/fmt/send-sync.stderr
src/test/ui/generator/ref-escapes-but-not-over-yield.rs
src/test/ui/generator/ref-escapes-but-not-over-yield.stderr
src/test/ui/generator/yield-while-local-borrowed.rs
src/test/ui/impl-trait/equality.rs
src/test/ui/impl-trait/issue-21659-show-relevant-trait-impls-3.rs
src/test/ui/impl-trait/method-suggestion-no-duplication.rs
src/test/ui/impl-trait/no-method-suggested-traits.rs
src/test/ui/impl-trait/no-method-suggested-traits.stderr
src/test/ui/impl-trait/trait_type.rs
src/test/ui/impl-trait/trait_type.stderr
src/test/ui/impl-trait/universal-mismatched-type.rs
src/test/ui/impl-trait/universal-mismatched-type.stderr
src/test/ui/impl-trait/universal-two-impl-traits.rs
src/test/ui/impl-trait/universal-two-impl-traits.stderr
src/test/ui/impl-trait/universal_wrong_bounds.rs
src/test/ui/impl-trait/universal_wrong_bounds.stderr
src/test/ui/in-band-lifetimes/E0687.rs
src/test/ui/in-band-lifetimes/E0687.stderr
src/test/ui/in-band-lifetimes/E0687_where.rs
src/test/ui/in-band-lifetimes/E0687_where.stderr
src/test/ui/in-band-lifetimes/E0688.rs
src/test/ui/in-band-lifetimes/E0688.stderr
src/test/ui/in-band-lifetimes/mismatched.rs
src/test/ui/in-band-lifetimes/mismatched.stderr
src/test/ui/in-band-lifetimes/mismatched_trait.rs
src/test/ui/in-band-lifetimes/mismatched_trait.stderr
src/test/ui/in-band-lifetimes/mismatched_trait_impl.rs
src/test/ui/in-band-lifetimes/mismatched_trait_impl.stderr
src/test/ui/in-band-lifetimes/mut_while_borrow.rs
src/test/ui/in-band-lifetimes/mut_while_borrow.stderr
src/test/ui/in-band-lifetimes/no_in_band_in_struct.rs
src/test/ui/in-band-lifetimes/no_in_band_in_struct.stderr
src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.rs
src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.stderr
src/test/ui/in-band-lifetimes/shadow.rs
src/test/ui/in-band-lifetimes/shadow.stderr
src/test/ui/interior-mutability/interior-mutability.rs
src/test/ui/interior-mutability/interior-mutability.stderr
src/test/ui/issue-13483.rs
src/test/ui/issue-13483.stderr
src/test/ui/issue-22644.rs
src/test/ui/issue-22644.stderr
src/test/ui/issue-33525.rs
src/test/ui/issue-33525.stderr
src/test/ui/issue-33941.rs
src/test/ui/issue-33941.stderr
src/test/ui/issue-35241.rs
src/test/ui/issue-35241.stderr
src/test/ui/issue-35675.rs
src/test/ui/issue-35675.stderr
src/test/ui/issue-35976.rs
src/test/ui/issue-36400.rs
src/test/ui/issue-36400.stderr
src/test/ui/issue-37311-type-length-limit/issue-37311.rs
src/test/ui/issue-37311-type-length-limit/issue-37311.stderr
src/test/ui/issue-40402-ref-hints/issue-40402-1.rs
src/test/ui/issue-40402-ref-hints/issue-40402-1.stderr
src/test/ui/issue-40402-ref-hints/issue-40402-2.rs
src/test/ui/issue-40402-ref-hints/issue-40402-2.stderr
src/test/ui/issue-40782.rs
src/test/ui/issue-40782.stderr
src/test/ui/issue-42106.rs
src/test/ui/issue-42106.stderr
src/test/ui/issue-42954.rs
src/test/ui/issue-42954.stderr
src/test/ui/issue-44023.rs
src/test/ui/issue-44023.stderr
src/test/ui/issue-44078.rs
src/test/ui/issue-44078.stderr
src/test/ui/issue-44406.rs
src/test/ui/issue-44406.stderr
src/test/ui/issue-45107-unnecessary-unsafe-in-closure.rs
src/test/ui/issue-45107-unnecessary-unsafe-in-closure.stderr
src/test/ui/issue-45296.rs
src/test/ui/issue-45296.stderr
src/test/ui/issue-45730.rs
src/test/ui/issue-45730.stderr
src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.rs
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.rs
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.rs
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.rs
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.rs
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.rs
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.rs
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.rs
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.rs
src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr
src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs
src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr
src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.rs
src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.stderr
src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.rs
src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr
src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs
src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr
src/test/ui/lifetime-errors/ex2a-push-one-existing-name.rs
src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr
src/test/ui/lifetime-errors/ex2b-push-no-existing-names.rs
src/test/ui/lifetime-errors/ex2b-push-no-existing-names.stderr
src/test/ui/lifetime-errors/ex2c-push-inference-variable.rs
src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr
src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.rs
src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.stderr
src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.rs
src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-2.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-3.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr
src/test/ui/lifetime-errors/ex3-both-anon-regions.rs
src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr
src/test/ui/lifetimes/borrowck-let-suggestion.rs
src/test/ui/lifetimes/borrowck-let-suggestion.stderr
src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.rs
src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr
src/test/ui/lint/command-line-lint-group-deny.rs
src/test/ui/lint/command-line-lint-group-deny.stderr
src/test/ui/lint/command-line-lint-group-forbid.rs
src/test/ui/lint/command-line-lint-group-forbid.stderr
src/test/ui/lint/lint-group-style.rs
src/test/ui/lint/lint-group-style.stderr
src/test/ui/lint/outer-forbid.rs
src/test/ui/lint/outer-forbid.stderr
src/test/ui/lint/suggestions.rs
src/test/ui/lint/suggestions.stderr
src/test/ui/loop-break-value-no-repeat.rs
src/test/ui/loop-break-value-no-repeat.stderr
src/test/ui/lub-glb/old-lub-glb-hr.rs
src/test/ui/lub-glb/old-lub-glb-hr.stderr
src/test/ui/lub-glb/old-lub-glb-object.rs
src/test/ui/lub-glb/old-lub-glb-object.stderr
src/test/ui/macro_backtrace/main.rs
src/test/ui/macro_backtrace/main.stderr
src/test/ui/macros/bad_hello.rs
src/test/ui/macros/bad_hello.stderr
src/test/ui/macros/format-foreign.rs
src/test/ui/macros/format-foreign.stderr
src/test/ui/macros/format-unused-lables.rs
src/test/ui/macros/format-unused-lables.stderr
src/test/ui/macros/macro-backtrace-invalid-internals.rs
src/test/ui/macros/macro-backtrace-invalid-internals.stderr
src/test/ui/macros/macro-backtrace-nested.rs
src/test/ui/macros/macro-backtrace-nested.stderr
src/test/ui/macros/macro-backtrace-println.rs
src/test/ui/macros/macro-backtrace-println.stderr
src/test/ui/macros/macro-name-typo.rs
src/test/ui/macros/macro-name-typo.stderr
src/test/ui/macros/macro_path_as_generic_bound.rs
src/test/ui/macros/macro_path_as_generic_bound.stderr
src/test/ui/macros/macro_undefined.rs
src/test/ui/macros/macro_undefined.stderr
src/test/ui/macros/trace_faulty_macros.rs
src/test/ui/macros/trace_faulty_macros.stderr
src/test/ui/method-call-err-msg.rs
src/test/ui/method-call-err-msg.stderr
src/test/ui/mismatched_types/E0053.rs
src/test/ui/mismatched_types/E0053.stderr
src/test/ui/mismatched_types/E0409.rs
src/test/ui/mismatched_types/E0631.rs
src/test/ui/mismatched_types/E0631.stderr
src/test/ui/mismatched_types/abridged.rs
src/test/ui/mismatched_types/abridged.stderr
src/test/ui/mismatched_types/binops.rs
src/test/ui/mismatched_types/binops.stderr
src/test/ui/mismatched_types/cast-rfc0401.rs
src/test/ui/mismatched_types/cast-rfc0401.stderr
src/test/ui/mismatched_types/closure-arg-count.rs
src/test/ui/mismatched_types/closure-arg-count.stderr
src/test/ui/mismatched_types/closure-arg-type-mismatch.rs
src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
src/test/ui/mismatched_types/closure-mismatch.rs
src/test/ui/mismatched_types/closure-mismatch.stderr
src/test/ui/mismatched_types/const-fn-in-trait.rs
src/test/ui/mismatched_types/const-fn-in-trait.stderr
src/test/ui/mismatched_types/fn-variance-1.rs
src/test/ui/mismatched_types/fn-variance-1.stderr
src/test/ui/mismatched_types/issue-19109.rs
src/test/ui/mismatched_types/issue-26480.rs
src/test/ui/mismatched_types/issue-26480.stderr
src/test/ui/mismatched_types/issue-35030.rs
src/test/ui/mismatched_types/issue-35030.stderr
src/test/ui/mismatched_types/issue-36053-2.rs
src/test/ui/mismatched_types/issue-38371.rs
src/test/ui/mismatched_types/issue-38371.stderr
src/test/ui/mismatched_types/main.rs
src/test/ui/mismatched_types/main.stderr
src/test/ui/mismatched_types/overloaded-calls-bad.rs
src/test/ui/mismatched_types/overloaded-calls-bad.stderr
src/test/ui/mismatched_types/trait-bounds-cant-coerce.rs
src/test/ui/mismatched_types/trait-impl-fn-incompatibility.rs
src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr
src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs
src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr
src/test/ui/missing-items/issue-40221.rs
src/test/ui/missing-items/issue-40221.stderr
src/test/ui/missing-items/m2.rs
src/test/ui/missing-items/m2.stderr
src/test/ui/missing-items/missing-type-parameter.rs
src/test/ui/missing-items/missing-type-parameter.stderr
src/test/ui/mut-ref.rs
src/test/ui/mut-ref.stderr
src/test/ui/nll/get_default.rs
src/test/ui/nll/get_default.stderr
src/test/ui/nll/named-region-basic.rs
src/test/ui/nll/named-region-basic.stderr
src/test/ui/on-unimplemented/bad-annotation.rs
src/test/ui/on-unimplemented/bad-annotation.stderr
src/test/ui/pub/pub-restricted-error-fn.rs
src/test/ui/pub/pub-restricted-error-fn.stderr
src/test/ui/pub/pub-restricted-error.rs
src/test/ui/pub/pub-restricted-error.stderr
src/test/ui/pub/pub-restricted-non-path.rs
src/test/ui/pub/pub-restricted-non-path.stderr
src/test/ui/pub/pub-restricted.rs
src/test/ui/pub/pub-restricted.stderr
src/test/ui/reachable/expr_add.rs
src/test/ui/reachable/expr_add.stderr
src/test/ui/reachable/expr_array.rs
src/test/ui/reachable/expr_array.stderr
src/test/ui/reachable/expr_assign.rs
src/test/ui/reachable/expr_assign.stderr
src/test/ui/reachable/expr_block.rs
src/test/ui/reachable/expr_block.stderr
src/test/ui/reachable/expr_box.rs
src/test/ui/reachable/expr_box.stderr
src/test/ui/reachable/expr_call.rs
src/test/ui/reachable/expr_call.stderr
src/test/ui/reachable/expr_cast.rs
src/test/ui/reachable/expr_cast.stderr
src/test/ui/reachable/expr_match.rs
src/test/ui/reachable/expr_match.stderr
src/test/ui/reachable/expr_method.rs
src/test/ui/reachable/expr_method.stderr
src/test/ui/reachable/expr_repeat.rs
src/test/ui/reachable/expr_repeat.stderr
src/test/ui/reachable/expr_return.rs
src/test/ui/reachable/expr_return.stderr
src/test/ui/reachable/expr_struct.rs
src/test/ui/reachable/expr_struct.stderr
src/test/ui/reachable/expr_tup.rs
src/test/ui/reachable/expr_tup.stderr
src/test/ui/reachable/expr_type.rs
src/test/ui/reachable/expr_type.stderr
src/test/ui/reachable/expr_unary.rs
src/test/ui/reachable/expr_unary.stderr
src/test/ui/resolve/enums-are-namespaced-xc.rs
src/test/ui/resolve/enums-are-namespaced-xc.stderr
src/test/ui/resolve/issue-14254.rs
src/test/ui/resolve/issue-14254.stderr
src/test/ui/resolve/issue-16058.rs
src/test/ui/resolve/issue-17518.rs
src/test/ui/resolve/issue-17518.stderr
src/test/ui/resolve/issue-21221-1.rs
src/test/ui/resolve/issue-21221-1.stderr
src/test/ui/resolve/issue-21221-2.rs
src/test/ui/resolve/issue-21221-2.stderr
src/test/ui/resolve/issue-21221-3.rs
src/test/ui/resolve/issue-21221-3.stderr
src/test/ui/resolve/issue-21221-4.rs
src/test/ui/resolve/issue-21221-4.stderr
src/test/ui/resolve/issue-23305.rs
src/test/ui/resolve/issue-2356.rs
src/test/ui/resolve/issue-2356.stderr
src/test/ui/resolve/issue-24968.rs
src/test/ui/resolve/issue-39226.rs
src/test/ui/resolve/issue-5035.rs
src/test/ui/resolve/issue-5035.stderr
src/test/ui/resolve/levenshtein.rs
src/test/ui/resolve/levenshtein.stderr
src/test/ui/resolve/privacy-struct-ctor.rs
src/test/ui/resolve/privacy-struct-ctor.stderr
src/test/ui/resolve/resolve-assoc-suggestions.rs
src/test/ui/resolve/resolve-assoc-suggestions.stderr
src/test/ui/resolve/resolve-speculative-adjustment.rs
src/test/ui/resolve/resolve-speculative-adjustment.stderr
src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs
src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr
src/test/ui/resolve/token-error-correct-2.rs
src/test/ui/resolve/token-error-correct-3.rs
src/test/ui/resolve/token-error-correct-3.stderr
src/test/ui/resolve/token-error-correct.rs
src/test/ui/resolve/token-error-correct.stderr
src/test/ui/resolve/tuple-struct-alias.rs
src/test/ui/resolve/tuple-struct-alias.stderr
src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.rs
src/test/ui/resolve/unresolved_static_type_field.rs
src/test/ui/resolve/use_suggestion_placement.rs
src/test/ui/resolve/use_suggestion_placement.stderr
src/test/ui/rfc-2005-default-binding-mode/const.rs
src/test/ui/rfc-2005-default-binding-mode/const.stderr
src/test/ui/rfc-2005-default-binding-mode/enum.rs
src/test/ui/rfc-2005-default-binding-mode/enum.stderr
src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs
src/test/ui/rfc-2005-default-binding-mode/explicit-mut.stderr
src/test/ui/rfc-2005-default-binding-mode/for.rs
src/test/ui/rfc-2005-default-binding-mode/issue-44912-or.rs
src/test/ui/rfc-2005-default-binding-mode/lit.rs
src/test/ui/rfc-2005-default-binding-mode/lit.stderr
src/test/ui/rfc-2005-default-binding-mode/no-double-error.rs
src/test/ui/rfc-2005-default-binding-mode/no-double-error.stderr
src/test/ui/rfc-2005-default-binding-mode/slice.rs
src/test/ui/rfc-2005-default-binding-mode/slice.stderr
src/test/ui/rfc-2005-default-binding-mode/suggestion.rs
src/test/ui/rfc-2005-default-binding-mode/suggestion.stderr
src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.rs
src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.stderr
src/test/ui/similar-tokens.rs
src/test/ui/similar-tokens.stderr
src/test/ui/span/E0072.rs
src/test/ui/span/E0072.stderr
src/test/ui/span/E0204.rs
src/test/ui/span/E0204.stderr
src/test/ui/span/E0493.rs
src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs
src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr
src/test/ui/span/borrowck-let-suggestion-suffixes.rs
src/test/ui/span/borrowck-ref-into-rvalue.rs
src/test/ui/span/borrowck-ref-into-rvalue.stderr
src/test/ui/span/coerce-suggestions.rs
src/test/ui/span/coerce-suggestions.stderr
src/test/ui/span/destructor-restrictions.rs
src/test/ui/span/destructor-restrictions.stderr
src/test/ui/span/gated-features-attr-spans.rs
src/test/ui/span/gated-features-attr-spans.stderr
src/test/ui/span/impl-wrong-item-for-trait.rs
src/test/ui/span/impl-wrong-item-for-trait.stderr
src/test/ui/span/issue-11925.rs
src/test/ui/span/issue-11925.stderr
src/test/ui/span/issue-15480.rs
src/test/ui/span/issue-15480.stderr
src/test/ui/span/issue-23338-locals-die-before-temps-of-body.rs
src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr
src/test/ui/span/issue-24690.rs
src/test/ui/span/issue-24690.stderr
src/test/ui/span/issue-27522.rs
src/test/ui/span/issue-27522.stderr
src/test/ui/span/issue-34264.rs
src/test/ui/span/issue-34264.stderr
src/test/ui/span/issue-35987.rs
src/test/ui/span/issue-36530.rs
src/test/ui/span/issue-36530.stderr
src/test/ui/span/issue-37767.rs
src/test/ui/span/issue-37767.stderr
src/test/ui/span/issue-39018.rs
src/test/ui/span/issue-39018.stderr
src/test/ui/span/issue-39698.rs
src/test/ui/span/issue-40157.rs
src/test/ui/span/issue-43927-non-ADT-derive.rs
src/test/ui/span/issue-7575.rs
src/test/ui/span/issue-7575.stderr
src/test/ui/span/macro-span-replacement.rs
src/test/ui/span/macro-span-replacement.stderr
src/test/ui/span/macro-ty-params.rs
src/test/ui/span/macro-ty-params.stderr
src/test/ui/span/missing-unit-argument.rs
src/test/ui/span/missing-unit-argument.stderr
src/test/ui/span/move-closure.rs
src/test/ui/span/move-closure.stderr
src/test/ui/span/multiline-span-E0072.rs
src/test/ui/span/multiline-span-E0072.stderr
src/test/ui/span/multiline-span-simple.rs
src/test/ui/span/multiline-span-simple.stderr
src/test/ui/span/multispan-import-lint.rs
src/test/ui/span/mut-arg-hint.rs
src/test/ui/span/mut-arg-hint.stderr
src/test/ui/span/mut-ptr-cant-outlive-ref.rs
src/test/ui/span/mut-ptr-cant-outlive-ref.stderr
src/test/ui/span/non-existing-module-import.rs
src/test/ui/span/non-existing-module-import.stderr
src/test/ui/span/pub-struct-field.rs
src/test/ui/span/pub-struct-field.stderr
src/test/ui/span/range-2.rs
src/test/ui/span/range-2.stderr
src/test/ui/span/recursive-type-field.rs
src/test/ui/span/recursive-type-field.stderr
src/test/ui/span/regionck-unboxed-closure-lifetimes.rs
src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr
src/test/ui/span/regions-close-over-borrowed-ref-in-obj.rs
src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr
src/test/ui/span/regions-close-over-type-parameter-2.rs
src/test/ui/span/regions-close-over-type-parameter-2.stderr
src/test/ui/span/regions-escape-loop-via-variable.rs
src/test/ui/span/regions-escape-loop-via-variable.stderr
src/test/ui/span/regions-escape-loop-via-vec.rs
src/test/ui/span/regions-escape-loop-via-vec.stderr
src/test/ui/span/regions-infer-borrow-scope-within-loop.rs
src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr
src/test/ui/span/send-is-not-static-ensures-scoping.rs
src/test/ui/span/send-is-not-static-ensures-scoping.stderr
src/test/ui/span/send-is-not-static-std-sync-2.rs
src/test/ui/span/send-is-not-static-std-sync-2.stderr
src/test/ui/span/send-is-not-static-std-sync.rs
src/test/ui/span/send-is-not-static-std-sync.stderr
src/test/ui/span/slice-borrow.rs
src/test/ui/span/slice-borrow.stderr
src/test/ui/span/suggestion-non-ascii.rs
src/test/ui/span/suggestion-non-ascii.stderr
src/test/ui/span/type-binding.rs
src/test/ui/span/typo-suggestion.rs
src/test/ui/span/typo-suggestion.stderr
src/test/ui/span/unused-warning-point-at-signature.rs
src/test/ui/span/unused-warning-point-at-signature.stderr
src/test/ui/span/visibility-ty-params.rs
src/test/ui/span/visibility-ty-params.stderr
src/test/ui/span/wf-method-late-bound-regions.rs
src/test/ui/span/wf-method-late-bound-regions.stderr
src/test/ui/static-lifetime.rs
src/test/ui/static-lifetime.stderr
src/test/ui/str-lit-type-mismatch.rs
src/test/ui/str-lit-type-mismatch.stderr
src/test/ui/struct-field-init-syntax.rs
src/test/ui/suggestions/closure-immutable-outer-variable.rs
src/test/ui/suggestions/closure-immutable-outer-variable.stderr
src/test/ui/suggestions/confuse-field-and-method/issue-18343.rs
src/test/ui/suggestions/confuse-field-and-method/issue-18343.stderr
src/test/ui/suggestions/confuse-field-and-method/issue-2392.rs
src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr
src/test/ui/suggestions/confuse-field-and-method/issue-32128.rs
src/test/ui/suggestions/confuse-field-and-method/issue-32128.stderr
src/test/ui/suggestions/confuse-field-and-method/issue-33784.rs
src/test/ui/suggestions/confuse-field-and-method/private-field.rs
src/test/ui/suggestions/confuse-field-and-method/private-field.stderr
src/test/ui/suggestions/extern-crate-rename.rs
src/test/ui/suggestions/extern-crate-rename.stderr
src/test/ui/suggestions/issue-32354-suggest-import-rename.rs
src/test/ui/suggestions/issue-32354-suggest-import-rename.stderr
src/test/ui/suggestions/issue-43420-no-over-suggest.rs
src/test/ui/suggestions/issue-43420-no-over-suggest.stderr
src/test/ui/suggestions/suggest-labels.rs
src/test/ui/suggestions/suggest-labels.stderr
src/test/ui/suggestions/suggest-methods.rs
src/test/ui/suggestions/suggest-methods.stderr
src/test/ui/suggestions/try-on-option.rs
src/test/ui/suggestions/try-on-option.stderr
src/test/ui/suggestions/try-operator-on-main.rs
src/test/ui/suggestions/try-operator-on-main.stderr
src/test/ui/suggestions/tuple-float-index.rs
src/test/ui/suggestions/tuple-float-index.stderr
src/test/ui/suggestions/type-ascription-instead-of-initializer.rs
src/test/ui/suggestions/type-ascription-instead-of-initializer.stderr
src/test/ui/suggestions/type-ascription-instead-of-statement-end.rs
src/test/ui/suggestions/type-ascription-instead-of-statement-end.stderr
src/test/ui/suggestions/type-ascription-with-fn-call.rs
src/test/ui/suggestions/type-ascription-with-fn-call.stderr
src/test/ui/token/bounds-obj-parens.rs
src/test/ui/token/issue-10636-2.rs
src/test/ui/token/issue-41155.rs
src/test/ui/token/issue-41155.stderr
src/test/ui/token/macro-incomplete-parse.rs
src/test/ui/token/trailing-plus-in-bounds.rs
src/test/ui/trait-method-private.rs
src/test/ui/trait-method-private.stderr
src/test/ui/transmute/transmute-from-fn-item-types-error.rs
src/test/ui/transmute/transmute-type-parameters.rs
src/test/ui/type-check/assignment-in-if.rs
src/test/ui/type-check/cannot_infer_local_or_array.rs
src/test/ui/type-check/cannot_infer_local_or_array.stderr
src/test/ui/type-check/issue-22897.rs
src/test/ui/type-check/issue-22897.stderr
src/test/ui/type-check/issue-40294.rs
src/test/ui/type-check/issue-40294.stderr
src/test/ui/type-check/issue-41314.rs
src/test/ui/type-check/issue-41314.stderr
src/test/ui/type-check/unknown_type_for_closure.rs
src/test/ui/type-check/unknown_type_for_closure.stderr
src/test/ui/unboxed-closure-no-cyclic-sig.rs
src/test/ui/unboxed-closure-no-cyclic-sig.stderr
src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.rs
src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.stderr
src/test/ui/union-fields.rs
src/test/ui/union-fields.stderr
src/test/ui/union-sized-field.rs
src/test/ui/union-sized-field.stderr
src/tools/compiletest/src/runtest.rs
src/tools/miri

index b2f4acb21a8cfa16d893cc8bde89cbdbb35c9515..642153c08f651e1f7541e951fcf0dd6f8336e3d4 100644 (file)
@@ -359,7 +359,11 @@ fn diag_once<'a, 'b>(&'a self,
                          diag_builder: &'b mut DiagnosticBuilder<'a>,
                          method: DiagnosticBuilderMethod,
                          lint: &'static lint::Lint, message: &str, span: Option<Span>) {
-        let mut do_method = || {
+
+        let lint_id = DiagnosticMessageId::LintId(lint::LintId::of(lint));
+        let id_span_message = (lint_id, span, message.to_owned());
+        let fresh = self.one_time_diagnostics.borrow_mut().insert(id_span_message);
+        if fresh {
             match method {
                 DiagnosticBuilderMethod::Note => {
                     diag_builder.note(message);
@@ -368,13 +372,6 @@ fn diag_once<'a, 'b>(&'a self,
                     diag_builder.span_note(span.expect("span_note expects a span"), message);
                 }
             }
-        };
-
-        let lint_id = DiagnosticMessageId::LintId(lint::LintId::of(lint));
-        let id_span_message = (lint_id, span, message.to_owned());
-        let fresh = self.one_time_diagnostics.borrow_mut().insert(id_span_message);
-        if fresh {
-            do_method()
         }
     }
 
index e2b80215caf61894fec84d8235657379ae02f297..8701ca0178fc98e7a1c499c46b15a977121eaeb4 100644 (file)
@@ -13,8 +13,6 @@
 #![allow(non_snake_case)]
 #![deny(unreachable_patterns)]
 //~^ NOTE lint level defined here
-//~^^ NOTE lint level defined here
-//~^^^ NOTE lint level defined here
 
 #[derive(Clone, Copy)]
 enum Enum {
index 8dc46558cb0d5ee6f427f9d895ab72309a204628..29d7c6caec468fca53d322857bcc68957021c7f6 100644 (file)
@@ -25,6 +25,5 @@
 fn main() { //~ ERROR: compilation successful
     let _x = foo();
     //~^ WARNING use of deprecated item 'lint_output_format::foo': text
-    //~| NOTE #[warn(deprecated)] on by default
     let _y = bar();
 }
index 94e189aa47f6fba9e95293080efb906a7474ae32..bee5a2c45be6d4177a482f11aba8676f29da224c 100644 (file)
 
 #![deny(unconditional_recursion)]
 //~^ NOTE lint level defined here
-//~| NOTE lint level defined here
-//~| NOTE lint level defined here
-//~| NOTE lint level defined here
-//~| NOTE lint level defined here
-//~| NOTE lint level defined here
-//~| NOTE lint level defined here
-//~| NOTE lint level defined here
-//~| NOTE lint level defined here
-//~| NOTE lint level defined here
-//~| NOTE lint level defined here
-//~| NOTE lint level defined here
-//~| NOTE lint level defined here
-//~| NOTE lint level defined here
+
 #![allow(dead_code)]
 fn foo() { //~ ERROR function cannot return without recurring
     foo(); //~ NOTE recursive call site
index 2231c3c242285e68c30ca4b59521ffbdd99f437e..4fd87632067331ac95e8cb1600b4940fc296e0da 100644 (file)
@@ -15,7 +15,7 @@
 
 #[macro_use] extern crate plugin;
 
-#[derive(Foo, Bar)]
+#[derive(Foo, Bar)] //~ ERROR proc-macro derive panicked
 struct Baz {
     a: i32,
     b: i32,
index 46cc7a42b04299a1ffca2ba1a10c2e37d0e4dac1..55848c6553cca74c78dd1047e07ba1f7b65929fc 100644 (file)
@@ -1,7 +1,7 @@
 error: proc-macro derive panicked
   --> $DIR/issue-36935.rs:18:15
    |
-18 | #[derive(Foo, Bar)]
+18 | #[derive(Foo, Bar)] //~ ERROR proc-macro derive panicked
    |               ^^^
    |
    = help: message: lolnope
index 256305bf17df88ebf3d23c976ddea66c708252ef..de798e2cf0baa9e81550019ac335b778cedd9a16 100644 (file)
@@ -13,7 +13,7 @@
 #![feature(proc_macro)]
 #![allow(unused_macros)]
 
-#[macro_use] extern crate log;
+#[macro_use] extern crate log; //~ ERROR use of unstable library feature
 
 pub fn main() {
     info!("This is a log message.");
index ce17ea7916122f5756e970ad40dfdac8a2554bc5..4493ec14024c0407269ead1512a1c51d53125e14 100644 (file)
@@ -1,7 +1,7 @@
 error: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead? (see issue #27812)
   --> $DIR/issue-44953.rs:16:14
    |
-16 | #[macro_use] extern crate log;
+16 | #[macro_use] extern crate log; //~ ERROR use of unstable library feature
    |              ^^^^^^^^^^^^^^^^^
    |
    = help: add #![feature(rustc_private)] to the crate attributes to enable
index 016e05c51f5079abf9614a496e269cc7190b038d..ef2d160529068b76899f850a7d5083961adda5f3 100644 (file)
@@ -22,17 +22,17 @@ fn main() {
     three_equals!(===);
 
     // Need exactly three equals.
-    three_equals!(==);
+    three_equals!(==); //~ ERROR found 2 equal signs, need exactly 3
 
     // Need exactly three equals.
-    three_equals!(=====);
+    three_equals!(=====); //~ ERROR expected EOF
 
     // Only equals accepted.
-    three_equals!(abc);
+    three_equals!(abc); //~ ERROR expected `=`
 
     // Only equals accepted.
-    three_equals!(!!);
+    three_equals!(!!); //~ ERROR expected `=`
 
     // Only three characters expected.
-    three_equals!(===a);
+    three_equals!(===a); //~ ERROR expected EOF
 }
index 1afe0be28000987ad5c1b6dcc15810f461579aa4..0ffaf16107872f37652ef8435e01c05ab54a7958 100644 (file)
@@ -1,7 +1,7 @@
 error: found 2 equal signs, need exactly 3
   --> $DIR/three-equals.rs:25:5
    |
-25 |     three_equals!(==);
+25 |     three_equals!(==); //~ ERROR found 2 equal signs, need exactly 3
    |     ^^^^^^^^^^^^^^^^^^
    |
    = help: input must be: `===`
@@ -9,38 +9,38 @@ error: found 2 equal signs, need exactly 3
 error: expected EOF, found `=`.
   --> $DIR/three-equals.rs:28:21
    |
-28 |     three_equals!(=====);
+28 |     three_equals!(=====); //~ ERROR expected EOF
    |                     ^^
    |
 note: last good input was here
   --> $DIR/three-equals.rs:28:21
    |
-28 |     three_equals!(=====);
+28 |     three_equals!(=====); //~ ERROR expected EOF
    |                     ^^
    = help: input must be: `===`
 
 error: expected `=`, found `abc`.
   --> $DIR/three-equals.rs:31:19
    |
-31 |     three_equals!(abc);
+31 |     three_equals!(abc); //~ ERROR expected `=`
    |                   ^^^
 
 error: expected `=`, found `!`.
   --> $DIR/three-equals.rs:34:19
    |
-34 |     three_equals!(!!);
+34 |     three_equals!(!!); //~ ERROR expected `=`
    |                   ^
 
 error: expected EOF, found `a`.
   --> $DIR/three-equals.rs:37:22
    |
-37 |     three_equals!(===a);
+37 |     three_equals!(===a); //~ ERROR expected EOF
    |                      ^
    |
 note: last good input was here
   --> $DIR/three-equals.rs:37:21
    |
-37 |     three_equals!(===a);
+37 |     three_equals!(===a); //~ ERROR expected EOF
    |                     ^
    = help: input must be: `===`
 
index dfaa1d7a32e5779ece83982958a052d5475a4c9c..ae94a7f13e23e9ab2bad13b21a409c3542ccd6db 100644 (file)
@@ -35,29 +35,39 @@ macro_rules! attr_proc_mac {
 }
 
 #[derive(FooWithLongNan)]
+//~^ ERROR cannot find
 struct Foo;
 
 #[attr_proc_macra]
+//~^ ERROR cannot find
 struct Bar;
 
 #[FooWithLongNan]
+//~^ ERROR cannot find
 struct Asdf;
 
 #[derive(Dlone)]
+//~^ ERROR cannot find
 struct A;
 
 #[derive(Dlona)]
+//~^ ERROR cannot find
 struct B;
 
 #[derive(attr_proc_macra)]
+//~^ ERROR cannot find
 struct C;
 
 fn main() {
     FooWithLongNama!();
+    //~^ ERROR cannot find
 
     attr_proc_macra!();
+    //~^ ERROR cannot find
 
     Dlona!();
+    //~^ ERROR cannot find
 
     bang_proc_macrp!();
+    //~^ ERROR cannot find
 }
index 754f6bc4f1c1c0ef7c3c0eb46ec30c663fcf763f..be7ebae70adf525795515163320a9ceefa358634 100644 (file)
@@ -5,57 +5,57 @@ error: cannot find derive macro `FooWithLongNan` in this scope
    |          ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
 
 error: cannot find attribute macro `attr_proc_macra` in this scope
-  --> $DIR/resolve-error.rs:40:3
+  --> $DIR/resolve-error.rs:41:3
    |
-40 | #[attr_proc_macra]
+41 | #[attr_proc_macra]
    |   ^^^^^^^^^^^^^^^ help: try: `attr_proc_macro`
 
 error: cannot find attribute macro `FooWithLongNan` in this scope
-  --> $DIR/resolve-error.rs:43:3
+  --> $DIR/resolve-error.rs:45:3
    |
-43 | #[FooWithLongNan]
+45 | #[FooWithLongNan]
    |   ^^^^^^^^^^^^^^
 
 error: cannot find derive macro `Dlone` in this scope
-  --> $DIR/resolve-error.rs:46:10
+  --> $DIR/resolve-error.rs:49:10
    |
-46 | #[derive(Dlone)]
+49 | #[derive(Dlone)]
    |          ^^^^^ help: try: `Clone`
 
 error: cannot find derive macro `Dlona` in this scope
-  --> $DIR/resolve-error.rs:49:10
+  --> $DIR/resolve-error.rs:53:10
    |
-49 | #[derive(Dlona)]
+53 | #[derive(Dlona)]
    |          ^^^^^ help: try: `Clona`
 
 error: cannot find derive macro `attr_proc_macra` in this scope
-  --> $DIR/resolve-error.rs:52:10
+  --> $DIR/resolve-error.rs:57:10
    |
-52 | #[derive(attr_proc_macra)]
+57 | #[derive(attr_proc_macra)]
    |          ^^^^^^^^^^^^^^^
 
 error: cannot find macro `FooWithLongNama!` in this scope
-  --> $DIR/resolve-error.rs:56:5
+  --> $DIR/resolve-error.rs:62:5
    |
-56 |     FooWithLongNama!();
+62 |     FooWithLongNama!();
    |     ^^^^^^^^^^^^^^^ help: you could try the macro: `FooWithLongNam!`
 
 error: cannot find macro `attr_proc_macra!` in this scope
-  --> $DIR/resolve-error.rs:58:5
+  --> $DIR/resolve-error.rs:65:5
    |
-58 |     attr_proc_macra!();
+65 |     attr_proc_macra!();
    |     ^^^^^^^^^^^^^^^ help: you could try the macro: `attr_proc_mac!`
 
 error: cannot find macro `Dlona!` in this scope
-  --> $DIR/resolve-error.rs:60:5
+  --> $DIR/resolve-error.rs:68:5
    |
-60 |     Dlona!();
+68 |     Dlona!();
    |     ^^^^^
 
 error: cannot find macro `bang_proc_macrp!` in this scope
-  --> $DIR/resolve-error.rs:62:5
+  --> $DIR/resolve-error.rs:71:5
    |
-62 |     bang_proc_macrp!();
+71 |     bang_proc_macrp!();
    |     ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro!`
 
 error: aborting due to 10 previous errors
index f2d04c16d99e146682c315858c4578b6cb96aa77..295e3d1a73521ad50198b650f80d7f584b26f459 100644 (file)
@@ -9,17 +9,17 @@
 // except according to those terms.
 
 fn main() {
-    f1(|_: (), _: ()| {});
-    f2(|_: (), _: ()| {});
-    f3(|_: (), _: ()| {});
-    f4(|_: (), _: ()| {});
-    f5(|_: (), _: ()| {});
-    g1(|_: (), _: ()| {});
-    g2(|_: (), _: ()| {});
-    g3(|_: (), _: ()| {});
-    g4(|_: (), _: ()| {});
-    h1(|_: (), _: (), _: (), _: ()| {});
-    h2(|_: (), _: (), _: (), _: ()| {});
+    f1(|_: (), _: ()| {}); //~ ERROR type mismatch
+    f2(|_: (), _: ()| {}); //~ ERROR type mismatch
+    f3(|_: (), _: ()| {}); //~ ERROR type mismatch
+    f4(|_: (), _: ()| {}); //~ ERROR type mismatch
+    f5(|_: (), _: ()| {}); //~ ERROR type mismatch
+    g1(|_: (), _: ()| {}); //~ ERROR type mismatch
+    g2(|_: (), _: ()| {}); //~ ERROR type mismatch
+    g3(|_: (), _: ()| {}); //~ ERROR type mismatch
+    g4(|_: (), _: ()| {}); //~ ERROR type mismatch
+    h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
+    h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
 }
 
 // Basic
index f962b7722036b6c1a82b093fd88a7ac3dcd9432e..6f684f13e6f6691959f648052cb0b8ca51939111 100644 (file)
@@ -1,7 +1,7 @@
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
    |
-12 |     f1(|_: (), _: ()| {});
+12 |     f1(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ----------------- found signature of `fn((), ()) -> _`
    |     |
    |     expected signature of `for<'r, 's> fn(&'r (), &'s ()) -> _`
@@ -11,7 +11,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:13:5
    |
-13 |     f2(|_: (), _: ()| {});
+13 |     f2(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ----------------- found signature of `fn((), ()) -> _`
    |     |
    |     expected signature of `for<'a, 'r> fn(&'a (), &'r ()) -> _`
@@ -21,7 +21,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:14:5
    |
-14 |     f3(|_: (), _: ()| {});
+14 |     f3(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ----------------- found signature of `fn((), ()) -> _`
    |     |
    |     expected signature of `for<'r> fn(&(), &'r ()) -> _`
@@ -31,7 +31,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:15:5
    |
-15 |     f4(|_: (), _: ()| {});
+15 |     f4(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ----------------- found signature of `fn((), ()) -> _`
    |     |
    |     expected signature of `for<'s, 'r> fn(&'s (), &'r ()) -> _`
@@ -41,7 +41,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:16:5
    |
-16 |     f5(|_: (), _: ()| {});
+16 |     f5(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ----------------- found signature of `fn((), ()) -> _`
    |     |
    |     expected signature of `for<'r> fn(&'r (), &'r ()) -> _`
@@ -51,7 +51,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:17:5
    |
-17 |     g1(|_: (), _: ()| {});
+17 |     g1(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ----------------- found signature of `fn((), ()) -> _`
    |     |
    |     expected signature of `for<'r> fn(&'r (), std::boxed::Box<for<'s> std::ops::Fn(&'s ()) + 'static>) -> _`
@@ -61,7 +61,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:18:5
    |
-18 |     g2(|_: (), _: ()| {});
+18 |     g2(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ----------------- found signature of `fn((), ()) -> _`
    |     |
    |     expected signature of `for<'r> fn(&'r (), for<'s> fn(&'s ())) -> _`
@@ -71,7 +71,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:19:5
    |
-19 |     g3(|_: (), _: ()| {});
+19 |     g3(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ----------------- found signature of `fn((), ()) -> _`
    |     |
    |     expected signature of `for<'s> fn(&'s (), std::boxed::Box<for<'r> std::ops::Fn(&'r ()) + 'static>) -> _`
@@ -81,7 +81,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:20:5
    |
-20 |     g4(|_: (), _: ()| {});
+20 |     g4(|_: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ----------------- found signature of `fn((), ()) -> _`
    |     |
    |     expected signature of `for<'s> fn(&'s (), for<'r> fn(&'r ())) -> _`
@@ -91,7 +91,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:21:5
    |
-21 |     h1(|_: (), _: (), _: (), _: ()| {});
+21 |     h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ------------------------------- found signature of `fn((), (), (), ()) -> _`
    |     |
    |     expected signature of `for<'r, 's> fn(&'r (), std::boxed::Box<for<'t0> std::ops::Fn(&'t0 ()) + 'static>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _`
@@ -101,7 +101,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/anonymous-higher-ranked-lifetime.rs:22:5
    |
-22 |     h2(|_: (), _: (), _: (), _: ()| {});
+22 |     h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch
    |     ^^ ------------------------------- found signature of `fn((), (), (), ()) -> _`
    |     |
    |     expected signature of `for<'r, 't0> fn(&'r (), std::boxed::Box<for<'s> std::ops::Fn(&'s ()) + 'static>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _`
index 192f78e41cb43cdf23d71c231f4661fc63ac3870..255eb771694cc53138ab65411e8f774dd52ca3a1 100644 (file)
@@ -11,7 +11,7 @@
 fn blah() -> i32 { //~ ERROR mismatched types
     1
 
-    ; //~ HELP consider removing this semicolon:
+    ; //~ HELP consider removing this semicolon
 }
 
 fn main() { }
index 376834beab0dacfc4a6b9661dbd862c1d02a3caf..4daf40e6172f62df4dd71e18fe5cbaff401cde34 100644 (file)
@@ -5,7 +5,7 @@ error[E0308]: mismatched types
    |  __________________^
 12 | |     1
 13 | |
-14 | |     ; //~ HELP consider removing this semicolon:
+14 | |     ; //~ HELP consider removing this semicolon
    | |     - help: consider removing this semicolon
 15 | | }
    | |_^ expected i32, found ()
index 7928c04b9df87b5f3130ea6158933a6a010ada15..31a363a6b863d523b0c8c379af42221627c5acf9 100644 (file)
@@ -12,7 +12,6 @@ trait A {
     fn a(&self) {
         || self.b()
         //~^ ERROR no method named `b` found for type `&Self` in the current scope
-        //~| ERROR mismatched types
     }
 }
 fn main() {}
index 291b7a16f141b8215b34efadbc4a9d6adda44474..3cf76365c77b1079da97ac643413c20618a58309 100644 (file)
@@ -16,7 +16,7 @@ fn foo() -> usize {
 }
 
 fn bar() {
-    foo()
+    foo() //~ ERROR mismatched types
 }
 
 fn main() {
index f0528838152469b5986a5814f29c89a6bd55c157..3881bb4625801c5bb2930052380886ac45f464d8 100644 (file)
@@ -1,14 +1,14 @@
 error[E0308]: mismatched types
   --> $DIR/unexpected-return-on-unit.rs:19:5
    |
-19 |     foo()
+19 |     foo() //~ ERROR mismatched types
    |     ^^^^^ expected (), found usize
    |
    = note: expected type `()`
               found type `usize`
 help: try adding a semicolon
    |
-19 |     foo();
+19 |     foo(); //~ ERROR mismatched types
    |          ^
 help: try adding a return type
    |
index 182b3d75442421f2aa8caf32a463d0181079aec7..6d7a84ebc93a47496517933af57ab37e98d0b995 100644 (file)
@@ -22,6 +22,7 @@ fn a() {
     let mut x = 3;
     let c1 = to_fn_mut(|| x = 4);
     let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
+    //~| ERROR cannot borrow `x` as mutable more than once
 }
 
 fn set(x: &mut isize) {
@@ -32,12 +33,14 @@ fn b() {
     let mut x = 3;
     let c1 = to_fn_mut(|| set(&mut x));
     let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
+    //~| ERROR cannot borrow `x` as mutable more than once
 }
 
 fn c() {
     let mut x = 3;
     let c1 = to_fn_mut(|| x = 5);
     let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
+    //~| ERROR cannot borrow `x` as mutable more than once
 }
 
 fn d() {
@@ -45,6 +48,7 @@ fn d() {
     let c1 = to_fn_mut(|| x = 5);
     let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
     //~^ ERROR cannot borrow `x` as mutable more than once
+    //~| ERROR cannot borrow `x` as mutable more than once
 }
 
 fn g() {
@@ -56,6 +60,7 @@ struct Foo {
     let c1 = to_fn_mut(|| set(&mut *x.f));
     let c2 = to_fn_mut(|| set(&mut *x.f));
     //~^ ERROR cannot borrow `x` as mutable more than once
+    //~| ERROR cannot borrow `x` as mutable more than once
 }
 
 fn main() {
index fc8a7f2ab606002b477b67da0f4c4413c6f7a7b2..0ec744f4a0781c9df10bc93d50bed2bf5982ec2f 100644 (file)
@@ -9,65 +9,68 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
    |                        ^^ - borrow occurs due to use of `x` in closure
    |                        |
    |                        second mutable borrow occurs here
-25 | }
+25 |     //~| ERROR cannot borrow `x` as mutable more than once
+26 | }
    | - first borrow ends here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
-  --> $DIR/borrowck-closures-two-mut.rs:34:24
+  --> $DIR/borrowck-closures-two-mut.rs:35:24
    |
-33 |     let c1 = to_fn_mut(|| set(&mut x));
+34 |     let c1 = to_fn_mut(|| set(&mut x));
    |                        --          - previous borrow occurs due to use of `x` in closure
    |                        |
    |                        first mutable borrow occurs here
-34 |     let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
+35 |     let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
    |                        ^^          - borrow occurs due to use of `x` in closure
    |                        |
    |                        second mutable borrow occurs here
-35 | }
+36 |     //~| ERROR cannot borrow `x` as mutable more than once
+37 | }
    | - first borrow ends here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
-  --> $DIR/borrowck-closures-two-mut.rs:40:24
+  --> $DIR/borrowck-closures-two-mut.rs:42:24
    |
-39 |     let c1 = to_fn_mut(|| x = 5);
+41 |     let c1 = to_fn_mut(|| x = 5);
    |                        -- - previous borrow occurs due to use of `x` in closure
    |                        |
    |                        first mutable borrow occurs here
-40 |     let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
+42 |     let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
    |                        ^^          - borrow occurs due to use of `x` in closure
    |                        |
    |                        second mutable borrow occurs here
-41 | }
+43 |     //~| ERROR cannot borrow `x` as mutable more than once
+44 | }
    | - first borrow ends here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
-  --> $DIR/borrowck-closures-two-mut.rs:46:24
+  --> $DIR/borrowck-closures-two-mut.rs:49:24
    |
-45 |     let c1 = to_fn_mut(|| x = 5);
+48 |     let c1 = to_fn_mut(|| x = 5);
    |                        -- - previous borrow occurs due to use of `x` in closure
    |                        |
    |                        first mutable borrow occurs here
-46 |     let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
+49 |     let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
    |                        ^^                                  - borrow occurs due to use of `x` in closure
    |                        |
    |                        second mutable borrow occurs here
-47 |     //~^ ERROR cannot borrow `x` as mutable more than once
-48 | }
+...
+52 | }
    | - first borrow ends here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
-  --> $DIR/borrowck-closures-two-mut.rs:57:24
+  --> $DIR/borrowck-closures-two-mut.rs:61:24
    |
-56 |     let c1 = to_fn_mut(|| set(&mut *x.f));
+60 |     let c1 = to_fn_mut(|| set(&mut *x.f));
    |                        --           - previous borrow occurs due to use of `x` in closure
    |                        |
    |                        first mutable borrow occurs here
-57 |     let c2 = to_fn_mut(|| set(&mut *x.f));
+61 |     let c2 = to_fn_mut(|| set(&mut *x.f));
    |                        ^^           - borrow occurs due to use of `x` in closure
    |                        |
    |                        second mutable borrow occurs here
-58 |     //~^ ERROR cannot borrow `x` as mutable more than once
-59 | }
+...
+64 | }
    | - first borrow ends here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
@@ -81,65 +84,68 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
    |                        ^^ - borrow occurs due to use of `x` in closure
    |                        |
    |                        second mutable borrow occurs here
-25 | }
+25 |     //~| ERROR cannot borrow `x` as mutable more than once
+26 | }
    | - first borrow ends here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
-  --> $DIR/borrowck-closures-two-mut.rs:34:24
+  --> $DIR/borrowck-closures-two-mut.rs:35:24
    |
-33 |     let c1 = to_fn_mut(|| set(&mut x));
+34 |     let c1 = to_fn_mut(|| set(&mut x));
    |                        --          - previous borrow occurs due to use of `x` in closure
    |                        |
    |                        first mutable borrow occurs here
-34 |     let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
+35 |     let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
    |                        ^^          - borrow occurs due to use of `x` in closure
    |                        |
    |                        second mutable borrow occurs here
-35 | }
+36 |     //~| ERROR cannot borrow `x` as mutable more than once
+37 | }
    | - first borrow ends here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
-  --> $DIR/borrowck-closures-two-mut.rs:40:24
+  --> $DIR/borrowck-closures-two-mut.rs:42:24
    |
-39 |     let c1 = to_fn_mut(|| x = 5);
+41 |     let c1 = to_fn_mut(|| x = 5);
    |                        -- - previous borrow occurs due to use of `x` in closure
    |                        |
    |                        first mutable borrow occurs here
-40 |     let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
+42 |     let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
    |                        ^^          - borrow occurs due to use of `x` in closure
    |                        |
    |                        second mutable borrow occurs here
-41 | }
+43 |     //~| ERROR cannot borrow `x` as mutable more than once
+44 | }
    | - first borrow ends here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
-  --> $DIR/borrowck-closures-two-mut.rs:46:24
+  --> $DIR/borrowck-closures-two-mut.rs:49:24
    |
-45 |     let c1 = to_fn_mut(|| x = 5);
+48 |     let c1 = to_fn_mut(|| x = 5);
    |                        -- - previous borrow occurs due to use of `x` in closure
    |                        |
    |                        first mutable borrow occurs here
-46 |     let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
+49 |     let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
    |                        ^^                                  - borrow occurs due to use of `x` in closure
    |                        |
    |                        second mutable borrow occurs here
-47 |     //~^ ERROR cannot borrow `x` as mutable more than once
-48 | }
+...
+52 | }
    | - first borrow ends here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
-  --> $DIR/borrowck-closures-two-mut.rs:57:24
+  --> $DIR/borrowck-closures-two-mut.rs:61:24
    |
-56 |     let c1 = to_fn_mut(|| set(&mut *x.f));
+60 |     let c1 = to_fn_mut(|| set(&mut *x.f));
    |                        --           - previous borrow occurs due to use of `x` in closure
    |                        |
    |                        first mutable borrow occurs here
-57 |     let c2 = to_fn_mut(|| set(&mut *x.f));
+61 |     let c2 = to_fn_mut(|| set(&mut *x.f));
    |                        ^^           - borrow occurs due to use of `x` in closure
    |                        |
    |                        second mutable borrow occurs here
-58 |     //~^ ERROR cannot borrow `x` as mutable more than once
-59 | }
+...
+64 | }
    | - first borrow ends here
 
 error: aborting due to 10 previous errors
index 9244c12347d952280cf449b80b14ce821fb49ef8..b30234811acb279a6b63f1223438a770b1c9ece4 100644 (file)
@@ -11,8 +11,9 @@
 // check that borrowck looks inside consts/statics
 
 static FN : &'static (Fn() -> (Box<Fn()->Box<i32>>) + Sync) = &|| {
-    let x = Box::new(0); //~ NOTE moved
+    let x = Box::new(0); //~ NOTE captured outer variable
     Box::new(|| x) //~ ERROR cannot move out of captured outer variable
+    //~^ NOTE cannot move out of captured outer variable
 };
 
 fn main() {
index 6083a82b1b6de29eb926114b8b6a37a58b31884c..92ca36e117e602325343dd2e6a0d267b952107d2 100644 (file)
@@ -1,7 +1,7 @@
 error[E0507]: cannot move out of captured outer variable in an `Fn` closure
   --> $DIR/borrowck-in-static.rs:15:17
    |
-14 |     let x = Box::new(0); //~ NOTE moved
+14 |     let x = Box::new(0); //~ NOTE captured outer variable
    |         - captured outer variable
 15 |     Box::new(|| x) //~ ERROR cannot move out of captured outer variable
    |                 ^ cannot move out of captured outer variable in an `Fn` closure
index 5547cb3ae523f7bc085d0ec977d47c45f0e21db6..e72eb7f03a67945065c6cb9389282de425063f43 100644 (file)
@@ -15,5 +15,6 @@ fn main() {
     let _u = x; // error shouldn't note this move
     x = Box::new(1);
     drop(x);
-    let _ = (1,x);
+    let _ = (1,x); //~ ERROR use of moved value: `x` (Ast)
+    //~^ ERROR use of moved value: `x` (Mir)
 }
index 767d65c1e60fb07a7d01f00c14bc1f188b3553fe..12511030579a241f9d42103f5c44195d281cd590 100644 (file)
@@ -3,7 +3,7 @@ error[E0382]: use of moved value: `x` (Ast)
    |
 17 |     drop(x);
    |          - value moved here
-18 |     let _ = (1,x);
+18 |     let _ = (1,x); //~ ERROR use of moved value: `x` (Ast)
    |                ^ value used here after move
    |
    = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
@@ -13,7 +13,7 @@ error[E0382]: use of moved value: `x` (Mir)
    |
 17 |     drop(x);
    |          - value moved here
-18 |     let _ = (1,x);
+18 |     let _ = (1,x); //~ ERROR use of moved value: `x` (Ast)
    |                ^ value use here after move
 
 error: aborting due to 2 previous errors
index addda42775399e7ea286af1ec121dccec1f189fa..31b50d8e531c0f16234cc7a717d4563868e01826 100644 (file)
@@ -17,20 +17,20 @@ struct FuncWrapper<'a, T : 'a> {
 impl<'a, T : 'a> FuncWrapper<'a, T> {
     fn in_loop(self, arg : &'a mut T) {
         loop {
-            (self.func)(arg)
+            (self.func)(arg) //~ ERROR cannot borrow
         }
     }
 
     fn in_while(self, arg : &'a mut T) {
         while true {
-            (self.func)(arg)
+            (self.func)(arg) //~ ERROR cannot borrow
         }
     }
 
     fn in_for(self, arg : &'a mut T) {
         let v : Vec<()> = vec![];
         for _ in v.iter() {
-            (self.func)(arg)
+            (self.func)(arg) //~ ERROR cannot borrow
         }
     }
 }
index a34d524d28f2e08d0dc5cff8377575ae55cf4ac9..2b614561d8268ffc98cd6a231869907970cbd806 100644 (file)
@@ -1,7 +1,7 @@
 error[E0499]: cannot borrow `*arg` as mutable more than once at a time
   --> $DIR/mut-borrow-in-loop.rs:20:25
    |
-20 |             (self.func)(arg)
+20 |             (self.func)(arg) //~ ERROR cannot borrow
    |                         ^^^ mutable borrow starts here in previous iteration of loop
 21 |         }
 22 |     }
@@ -10,7 +10,7 @@ error[E0499]: cannot borrow `*arg` as mutable more than once at a time
 error[E0499]: cannot borrow `*arg` as mutable more than once at a time
   --> $DIR/mut-borrow-in-loop.rs:26:25
    |
-26 |             (self.func)(arg)
+26 |             (self.func)(arg) //~ ERROR cannot borrow
    |                         ^^^ mutable borrow starts here in previous iteration of loop
 27 |         }
 28 |     }
@@ -19,7 +19,7 @@ error[E0499]: cannot borrow `*arg` as mutable more than once at a time
 error[E0499]: cannot borrow `*arg` as mutable more than once at a time
   --> $DIR/mut-borrow-in-loop.rs:33:25
    |
-33 |             (self.func)(arg)
+33 |             (self.func)(arg) //~ ERROR cannot borrow
    |                         ^^^ mutable borrow starts here in previous iteration of loop
 34 |         }
 35 |     }
index 97092b7f9d75934cccb87cdefd3519d457b669cd..a1ab41bab337d83b648cedf8f551198d79faa6d2 100644 (file)
@@ -14,13 +14,13 @@ fn main() {
     let mut void = ();
 
     let first = &mut void;
-    let second = &mut void;
+    let second = &mut void; //~ ERROR cannot borrow
 
     loop {
         let mut inner_void = ();
 
         let inner_first = &mut inner_void;
-        let inner_second = &mut inner_void;
+        let inner_second = &mut inner_void; //~ ERROR cannot borrow
     }
 }
 
index 02b32dc363ae744d0f05abf0a9ae0bcdf96095c6..716edd21982e98b5c86c9ded0ea430a37dced579 100644 (file)
@@ -3,7 +3,7 @@ error[E0499]: cannot borrow `void` as mutable more than once at a time
    |
 16 |     let first = &mut void;
    |                      ---- first mutable borrow occurs here
-17 |     let second = &mut void;
+17 |     let second = &mut void; //~ ERROR cannot borrow
    |                       ^^^^ second mutable borrow occurs here
 ...
 25 | }
@@ -14,7 +14,7 @@ error[E0499]: cannot borrow `inner_void` as mutable more than once at a time
    |
 22 |         let inner_first = &mut inner_void;
    |                                ---------- first mutable borrow occurs here
-23 |         let inner_second = &mut inner_void;
+23 |         let inner_second = &mut inner_void; //~ ERROR cannot borrow
    |                                 ^^^^^^^^^^ second mutable borrow occurs here
 24 |     }
    |     - first borrow ends here
index 9c89c26de006a4a49ccd27c484391cf46190c8b1..788d68caa524e471a69e854aed92b37290644137 100644 (file)
@@ -16,9 +16,10 @@ fn call<F>(f: F) where F : Fn() {
 }
 
 fn main() {
-    let y = vec![format!("World")];  //~ NOTE moved
+    let y = vec![format!("World")];  //~ NOTE captured outer variable
     call(|| {
         y.into_iter();
         //~^ ERROR cannot move out of captured outer variable in an `Fn` closure
+        //~| NOTE cannot move out of
     });
 }
index dbfcb2e0c2f95fbef0c71d52e7ed596c37c334eb..895ce1ba318030bf19421ecc3e849f6e35836d8e 100644 (file)
@@ -1,7 +1,7 @@
 error[E0507]: cannot move out of captured outer variable in an `Fn` closure
   --> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:21:9
    |
-19 |     let y = vec![format!("World")];  //~ NOTE moved
+19 |     let y = vec![format!("World")];  //~ NOTE captured outer variable
    |         - captured outer variable
 20 |     call(|| {
 21 |         y.into_iter();
index c79345479827537127380be2c0f0a22e8e24d9c3..010b5a1b1067e9cb41bc36422787ef7d655e944f 100644 (file)
@@ -9,6 +9,6 @@
 // except according to those terms.
 
 fn main() {
-    &1 as Send;
-    Box::new(1) as Send;
+    &1 as Send; //~ ERROR cast to unsized
+    Box::new(1) as Send; //~ ERROR cast to unsized
 }
index 4d4eb7b4ecfdbe680747d1b09c0e943807f6d0fc..55d41848b17a9a80f932278de793dd0dbfc1917f 100644 (file)
@@ -1,7 +1,7 @@
 error[E0620]: cast to unsized type: `&{integer}` as `std::marker::Send`
   --> $DIR/cast-to-unsized-trait-object-suggestion.rs:12:5
    |
-12 |     &1 as Send;
+12 |     &1 as Send; //~ ERROR cast to unsized
    |     ^^^^^^----
    |           |
    |           help: try casting to a reference instead: `&Send`
@@ -9,7 +9,7 @@ error[E0620]: cast to unsized type: `&{integer}` as `std::marker::Send`
 error[E0620]: cast to unsized type: `std::boxed::Box<{integer}>` as `std::marker::Send`
   --> $DIR/cast-to-unsized-trait-object-suggestion.rs:13:5
    |
-13 |     Box::new(1) as Send;
+13 |     Box::new(1) as Send; //~ ERROR cast to unsized
    |     ^^^^^^^^^^^^^^^----
    |                    |
    |                    help: try casting to a `Box` instead: `Box<Send>`
index 6497f69035dec96497fa8736964f1f8becd3966f..d52718b7bf41f1d6aadf9370c5d90d023d993ca5 100644 (file)
@@ -17,36 +17,36 @@ enum Enum {
 struct Sd { x: Enum, y: () }
 
 fn main() {
-    match (A, ()) {
+    match (A, ()) { //~ ERROR non-exhaustive
         (A, _) => {}
     }
 
-    match (A, A) {
+    match (A, A) { //~ ERROR non-exhaustive
         (_, A) => {}
     }
 
-    match ((A, ()), ()) {
+    match ((A, ()), ()) { //~ ERROR non-exhaustive
         ((A, ()), _) => {}
     }
 
-    match ((A, ()), A) {
+    match ((A, ()), A) { //~ ERROR non-exhaustive
         ((A, ()), _) => {}
     }
 
-    match ((A, ()), ()) {
+    match ((A, ()), ()) { //~ ERROR non-exhaustive
         ((A, _), _) => {}
     }
 
 
-    match S(A, ()) {
+    match S(A, ()) { //~ ERROR non-exhaustive
         S(A, _) => {}
     }
 
-    match (Sd { x: A, y: () }) {
+    match (Sd { x: A, y: () }) { //~ ERROR non-exhaustive
         Sd { x: A, y: _ } => {}
     }
 
-    match Some(A) {
+    match Some(A) { //~ ERROR non-exhaustive
         Some(A) => (),
         None => ()
     }
index 0aafe3f17b3d0f6310b30d10baedc9eb00d19cef..1fc1d05636e91ec3a6019d8fcf9eb9d7411aa96f 100644 (file)
@@ -1,49 +1,49 @@
 error[E0004]: non-exhaustive patterns: `(B, _)`, `(C, _)`, `(D, _)` and 2 more not covered
   --> $DIR/issue-35609.rs:20:11
    |
-20 |     match (A, ()) {
+20 |     match (A, ()) { //~ ERROR non-exhaustive
    |           ^^^^^^^ patterns `(B, _)`, `(C, _)`, `(D, _)` and 2 more not covered
 
 error[E0004]: non-exhaustive patterns: `(_, B)`, `(_, C)`, `(_, D)` and 2 more not covered
   --> $DIR/issue-35609.rs:24:11
    |
-24 |     match (A, A) {
+24 |     match (A, A) { //~ ERROR non-exhaustive
    |           ^^^^^^ patterns `(_, B)`, `(_, C)`, `(_, D)` and 2 more not covered
 
 error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
   --> $DIR/issue-35609.rs:28:11
    |
-28 |     match ((A, ()), ()) {
+28 |     match ((A, ()), ()) { //~ ERROR non-exhaustive
    |           ^^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
 
 error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
   --> $DIR/issue-35609.rs:32:11
    |
-32 |     match ((A, ()), A) {
+32 |     match ((A, ()), A) { //~ ERROR non-exhaustive
    |           ^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
 
 error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
   --> $DIR/issue-35609.rs:36:11
    |
-36 |     match ((A, ()), ()) {
+36 |     match ((A, ()), ()) { //~ ERROR non-exhaustive
    |           ^^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
 
 error[E0004]: non-exhaustive patterns: `S(B, _)`, `S(C, _)`, `S(D, _)` and 2 more not covered
   --> $DIR/issue-35609.rs:41:11
    |
-41 |     match S(A, ()) {
+41 |     match S(A, ()) { //~ ERROR non-exhaustive
    |           ^^^^^^^^ patterns `S(B, _)`, `S(C, _)`, `S(D, _)` and 2 more not covered
 
 error[E0004]: non-exhaustive patterns: `Sd { x: B, .. }`, `Sd { x: C, .. }`, `Sd { x: D, .. }` and 2 more not covered
   --> $DIR/issue-35609.rs:45:11
    |
-45 |     match (Sd { x: A, y: () }) {
+45 |     match (Sd { x: A, y: () }) { //~ ERROR non-exhaustive
    |           ^^^^^^^^^^^^^^^^^^^^ patterns `Sd { x: B, .. }`, `Sd { x: C, .. }`, `Sd { x: D, .. }` and 2 more not covered
 
 error[E0004]: non-exhaustive patterns: `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered
   --> $DIR/issue-35609.rs:49:11
    |
-49 |     match Some(A) {
+49 |     match Some(A) { //~ ERROR non-exhaustive
    |           ^^^^^^^ patterns `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered
 
 error: aborting due to 8 previous errors
index 5ed7ace5437d38bef8b9e55982620a3d23cc6543..3b179a475e794e71ebc4d23989ae5b12e57cffb4 100644 (file)
@@ -11,7 +11,7 @@
 fn foo() -> Box<Fn()> {
     let num = 5;
 
-    let closure = || {
+    let closure = || { //~ ERROR expected a closure that
         num += 1;
     };
 
index 42fc2909dfb5a2846a1cb942ae9679e05fa52ab5..82c83da4daec78ac7ff2220a113d2f3575bad740 100644 (file)
@@ -1,7 +1,7 @@
 error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut`
   --> $DIR/issue-26046-fn-mut.rs:14:19
    |
-14 |       let closure = || {
+14 |       let closure = || { //~ ERROR expected a closure that
    |  ___________________^
 15 | |         num += 1;
 16 | |     };
index de06de530c6c0012590c9ea071c580f6069fe946..cf15985ee83ea4bb6cc67db7e6be74632d532526 100644 (file)
@@ -11,7 +11,7 @@
 fn get_closure() -> Box<Fn() -> Vec<u8>> {
     let vec = vec![1u8, 2u8];
 
-    let closure = move || {
+    let closure = move || { //~ ERROR expected a closure
         vec
     };
 
index 7bfe72d3d6c9c8fbcac796e7638ba881507e2997..0bc84872dde5f38ba3a7c9542bf258150639468b 100644 (file)
@@ -1,7 +1,7 @@
 error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
   --> $DIR/issue-26046-fn-once.rs:14:19
    |
-14 |       let closure = move || {
+14 |       let closure = move || { //~ ERROR expected a closure
    |  ___________________^
 15 | |         vec
 16 | |     };
index 409964082f2b6582302fad782c72d9932e0936a6..276c6a941b299ad3319f74a8c52fa1dd3d981ff1 100644 (file)
@@ -14,12 +14,13 @@ fn main() {
     let dict: HashMap<i32, i32> = HashMap::new();
     let debug_dump_dict = || {
         for (key, value) in dict {
+            //~^ NOTE closure cannot be invoked more than once
             println!("{:?} - {:?}", key, value);
         }
     };
     debug_dump_dict();
+    //~^ NOTE: value moved here
     debug_dump_dict();
     //~^ ERROR use of moved value: `debug_dump_dict`
-    //~| NOTE closure cannot be invoked more than once because it moves the
-    //~| variable `dict` out of its environment
+    //~| NOTE value used here after move
 }
index c195940ade6fa931275e620ca43d705acba29257..b31322f6d168d6868295449693c80c0ccabbac4c 100644 (file)
@@ -1,9 +1,10 @@
 error[E0382]: use of moved value: `debug_dump_dict`
-  --> $DIR/issue-42065.rs:21:5
+  --> $DIR/issue-42065.rs:23:5
    |
-20 |     debug_dump_dict();
-   |     --------------- value moved here
 21 |     debug_dump_dict();
+   |     --------------- value moved here
+22 |     //~^ NOTE: value moved here
+23 |     debug_dump_dict();
    |     ^^^^^^^^^^^^^^^ value used here after move
    |
 note: closure cannot be invoked more than once because it moves the variable `dict` out of its environment
index a72ad0351e33baa323e44be565320ae08e6356ab..532d173011d7feb7249bfeebc7e8b0357f33862c 100644 (file)
@@ -11,6 +11,6 @@
 #![allow(dead_code)]
 
 trait C {}
-impl C { fn f() {} }
+impl C { fn f() {} } //~ ERROR duplicate
 impl C { fn f() {} }
 fn main() { }
index 7f1ab929c6fc2b32fcbd4e0a18cd4341d08da5e8..a7d52301476c9244013fa5c5d98d84c90aeec887 100644 (file)
@@ -1,7 +1,7 @@
 error[E0592]: duplicate definitions with name `f`
   --> $DIR/coherence-overlapping-inherent-impl-trait.rs:14:10
    |
-14 | impl C { fn f() {} }
+14 | impl C { fn f() {} } //~ ERROR duplicate
    |          ^^^^^^^^^ duplicate definitions for `f`
 15 | impl C { fn f() {} }
    |          --------- other definition for `f`
index 2cf3b66dd77c81ea4930c019da850a6885d914c5..8e0395e3c503317078c27676e9f114c9bb813a8c 100644 (file)
@@ -14,5 +14,5 @@ fn main() {
 
     impl !Sync for Foo {}
 
-    unsafe impl Send for &'static Foo { }
+    unsafe impl Send for &'static Foo { } //~ ERROR cross-crate traits with a default impl
 }
index b33dee6b4a472ed04086888a61d93accf8f11e91..3474803b00dd16ec0978e15f8cd8f9400356712b 100644 (file)
@@ -1,7 +1,7 @@
 error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `&'static main::Foo`
   --> $DIR/empty_span.rs:17:5
    |
-17 |     unsafe impl Send for &'static Foo { }
+17 |     unsafe impl Send for &'static Foo { } //~ ERROR cross-crate traits with a default impl
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to previous error
index 5a058d483915a5f8e28714b75f90f65508ce67ed..cf593eab85329c99d5d94c043c80bc8aecca1157 100644 (file)
@@ -97,5 +97,5 @@ fn main() {
 
 
 
-    let y = &mut x;
+    let y = &mut x; //~ ERROR cannot borrow
 }
index 914db98c7844648ddb36924874144a3d70263a61..bc333bde93c6bce6564a15115d02689e98d36c3b 100644 (file)
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable local variable `x` as mutable
 12  |     let x = "foo";
     |         - consider changing this to `mut x`
 ...
-100 |     let y = &mut x;
+100 |     let y = &mut x; //~ ERROR cannot borrow
     |                  ^ cannot borrow mutably
 
 error: aborting due to previous error
index ba1ce6abcd3d4804bdfd160a4a59dcf6b8952078..75581d3892719f6728e3ae5a36abdfa1d9512dc0 100644 (file)
@@ -97,5 +97,5 @@
 fn main() {
     let mut x = "foo";
     let y = &mut x;
-    let z = &mut x;
+    let z = &mut x; //~ ERROR cannot borrow
 }
index 4947cbedd200e45ec424e508881480505c313b57..bd8ffba00d44b65c1854a324d9b0879fa46be792 100644 (file)
@@ -3,7 +3,7 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time
     |
 99  |     let y = &mut x;
     |                  - first mutable borrow occurs here
-100 |     let z = &mut x;
+100 |     let z = &mut x; //~ ERROR cannot borrow
     |                  ^ second mutable borrow occurs here
 101 | }
     | - first borrow ends here
index e50091d56062258fda1fed1da5a8c725196fdcef..3fb35dd26acab5ab487d031bd218180d804050e2 100644 (file)
@@ -10,5 +10,5 @@
 
 fn main() {
     let mut v = vec![Some("foo"), Some("bar")];
-    v.push(v.pop().unwrap());
+    v.push(v.pop().unwrap()); //~ ERROR cannot borrow
 }
index a73575a8d57f1ae65783eec6492c758db02c3c5c..cfe3d527136a34728485ed475e50184927d5dc8c 100644 (file)
@@ -1,7 +1,7 @@
 error[E0499]: cannot borrow `v` as mutable more than once at a time
   --> $DIR/one_line.rs:13:12
    |
-13 |     v.push(v.pop().unwrap());
+13 |     v.push(v.pop().unwrap()); //~ ERROR cannot borrow
    |     -      ^               - first borrow ends here
    |     |      |
    |     |      second mutable borrow occurs here
index a626b63b31ba0586fc3ef57105780f3f57e569cd..18e77ddfd2c5b450e48af1c11bf98657c0214da4 100644 (file)
@@ -16,7 +16,7 @@
 struct Foo;
 
 impl Foo {
-    fn id() {}
+    fn id() {} //~ ERROR duplicate definitions
 }
 
 impl Foo {
@@ -26,7 +26,7 @@ fn id() {}
 struct Bar<T>(T);
 
 impl<T> Bar<T> {
-    fn bar(&self) {}
+    fn bar(&self) {} //~ ERROR duplicate definitions
 }
 
 impl Bar<u32> {
@@ -36,7 +36,7 @@ fn bar(&self) {}
 struct Baz<T>(T);
 
 impl<T: Copy> Baz<T> {
-    fn baz(&self) {}
+    fn baz(&self) {} //~ ERROR duplicate definitions
 }
 
 impl<T> Baz<Vec<T>> {
index eaf42cde22f762c44a64688bbadbce5f3302c97e..0ccdd207651760b5f32c0d776d8be2bdaf0031d0 100644 (file)
@@ -1,7 +1,7 @@
 error[E0592]: duplicate definitions with name `id`
   --> $DIR/overlapping_inherent_impls.rs:19:5
    |
-19 |     fn id() {}
+19 |     fn id() {} //~ ERROR duplicate definitions
    |     ^^^^^^^^^^ duplicate definitions for `id`
 ...
 23 |     fn id() {}
@@ -10,7 +10,7 @@ error[E0592]: duplicate definitions with name `id`
 error[E0592]: duplicate definitions with name `bar`
   --> $DIR/overlapping_inherent_impls.rs:29:5
    |
-29 |     fn bar(&self) {}
+29 |     fn bar(&self) {} //~ ERROR duplicate definitions
    |     ^^^^^^^^^^^^^^^^ duplicate definitions for `bar`
 ...
 33 |     fn bar(&self) {}
@@ -19,7 +19,7 @@ error[E0592]: duplicate definitions with name `bar`
 error[E0592]: duplicate definitions with name `baz`
   --> $DIR/overlapping_inherent_impls.rs:39:5
    |
-39 |     fn baz(&self) {}
+39 |     fn baz(&self) {} //~ ERROR duplicate definitions
    |     ^^^^^^^^^^^^^^^^ duplicate definitions for `baz`
 ...
 43 |     fn baz(&self) {}
index 7c1f0db16dd0920e87da2e7a18cbfe10d97decbb..467e90bd5a51b178986f1b95e1641f45d057a286 100644 (file)
@@ -18,6 +18,6 @@ impl Drop for S {
 
 fn main() {
     match (S {f:"foo".to_string()}) {
-        S {f:_s} => {}
+        S {f:_s} => {} //~ ERROR cannot move out
     }
 }
index d32b18d670308c4379da0ed8060db3694a1f1bdd..dc801b20dfb9d7acf4e9b18ae728310dff248223 100644 (file)
@@ -1,7 +1,7 @@
 error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
   --> $DIR/overlapping_spans.rs:21:9
    |
-21 |         S {f:_s} => {}
+21 |         S {f:_s} => {} //~ ERROR cannot move out
    |         ^^^^^--^
    |         |    |
    |         |    hint: to prevent move, use `ref _s` or `ref mut _s`
index 146ad2283c2fc31e36bb2e0db7a14db3addc2d15..b8dedb0daf5f0485a9a65c8f975a3f586a9c4196 100644 (file)
@@ -11,9 +11,9 @@
 // ignore-tidy-tab
 
 fn main() {
-       bar;
+       bar; //~ ERROR cannot find value `bar`
 }
 
 fn foo() {
-       "bar                    boo"
+       "bar                    boo" //~ ERROR mismatched types
 }
index b3fa9b128c5eb5d9f5398974a9bd4b68be519160..41ab60f017f611ce0a57211878c2c06249735fb0 100644 (file)
@@ -1,7 +1,7 @@
 error[E0425]: cannot find value `bar` in this scope
   --> $DIR/tab.rs:14:2
    |
-14 |  bar;
+14 |  bar; //~ ERROR cannot find value `bar`
    |  ^^^ not found in this scope
 
 error[E0308]: mismatched types
@@ -9,7 +9,7 @@ error[E0308]: mismatched types
    |
 17 | fn foo() {
    |          - help: try adding a return type: `-> &'static str `
-18 |  "bar   boo"
+18 |  "bar   boo" //~ ERROR mismatched types
    |  ^^^^^^^^^^^ expected (), found reference
    |
    = note: expected type `()`
index d26d7974d85adb5e3bd9cc04192cde23f1dc7e9b..b759a4abcae2147a5e51d85d6ba517716a0c9d93 100644 (file)
@@ -11,5 +11,5 @@
 // ignore-tidy-tab
 
 fn main() {
-                               """;
+                               """; //~ ERROR unterminated double quote
 }
index a2b3ca7e4d4fdf25574d277f1f5bd5911e9b3e0d..7f6b55e7eb8eacdb6b4c304e92d18d761779c3a3 100644 (file)
@@ -1,7 +1,7 @@
 error: unterminated double quote string
   --> $DIR/tab_2.rs:14:7
    |
-14 |       """;
+14 |       """; //~ ERROR unterminated double quote
    |  _______^
 15 | | }
    | |__^
index 9b3513d5116f28bc7687e1fabdb90305de69d925..ea235ed71a9e6d063d63d402358d65484513341f 100644 (file)
@@ -14,6 +14,6 @@ fn main() {
        let some_vec = vec!["hi"];
        some_vec.into_iter();
        {
-               println!("{:?}", some_vec);
+               println!("{:?}", some_vec); //~ ERROR use of moved
        }
 }
index f19f5f20d23ec8c534e6d115a7c4b78a14307b54..278e590a36d13a9766ba2a03ae10c8bcb5fea80b 100644 (file)
@@ -4,7 +4,7 @@ error[E0382]: use of moved value: `some_vec`
 15 |  some_vec.into_iter();
    |  -------- value moved here
 16 |  {
-17 |   println!("{:?}", some_vec);
+17 |   println!("{:?}", some_vec); //~ ERROR use of moved
    |                    ^^^^^^^^ value used here after move
    |
    = note: move occurs because `some_vec` has type `std::vec::Vec<&str>`, which does not implement the `Copy` trait
index fe5eba93b233115860e6ecb7a65d7104bd44f46d..4c99ee67598bc16c194005a421537b2093e8482e 100644 (file)
@@ -12,6 +12,6 @@
 
 struct Baz { }
 
-impl Bar for Baz { }
+impl Bar for Baz { } //~ ERROR expected trait, found type alias
 
 fn main() { }
index 9db43dde1ac7e1be6558212afea633f966011b71..c0cfeef194da6ba89e818489999bf24619bc60fa 100644 (file)
@@ -1,7 +1,7 @@
 error[E0404]: expected trait, found type alias `Bar`
   --> $DIR/two_files.rs:15:6
    |
-15 | impl Bar for Baz { }
+15 | impl Bar for Baz { } //~ ERROR expected trait, found type alias
    |      ^^^ type aliases cannot be used for traits
 
 error: cannot continue compilation due to previous error
index b206722d4f36887c6f94f937b2a5256e1bf27851..ac22906a62330da551c014967265651e44f3de46 100644 (file)
@@ -8,6 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern "路濫狼á́́" fn foo() {}
+extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI
 
 fn main() { }
index 02a9d7ee0ef4f6dd12708fb21c95fbfdb2bd2c7e..4f3c79410df9c0fecea99331c8e4ffc94eab7d82 100644 (file)
@@ -1,7 +1,7 @@
 error: invalid ABI: expected one of [cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted], found `路濫狼á́́`
   --> $DIR/unicode.rs:11:8
    |
-11 | extern "路濫狼á́́" fn foo() {}
+11 | extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI
    |        ^^^^^^^^^
 
 error: aborting due to previous error
index cc3eae90f90a1abfb75d641d35ed07be12aa8e7c..c01b0b286afcaf37a4202ec4925fe06d29236d38 100644 (file)
@@ -11,7 +11,7 @@
 #![feature(non_ascii_idents)]
 
 fn main() {
-    let _ = ("a̐éö̲", 0u7);
-    let _ = ("아あ", 1i42);
-    let _ = a̐é;
+    let _ = ("a̐éö̲", 0u7); //~ ERROR invalid width
+    let _ = ("아あ", 1i42); //~ ERROR invalid width
+    let _ = a̐é; //~ ERROR cannot find
 }
index 6cfa66730a2042fe22d255d26b474128967b5471..9ffd08ca06f830dba02fc68cabbf8df14294d187 100644 (file)
@@ -1,7 +1,7 @@
 error: invalid width `7` for integer literal
   --> $DIR/unicode_2.rs:14:25
    |
-14 |     let _ = ("a̐éö̲", 0u7);
+14 |     let _ = ("a̐éö̲", 0u7); //~ ERROR invalid width
    |                     ^^^
    |
    = help: valid widths are 8, 16, 32, 64 and 128
@@ -9,7 +9,7 @@ error: invalid width `7` for integer literal
 error: invalid width `42` for integer literal
   --> $DIR/unicode_2.rs:15:20
    |
-15 |     let _ = ("아あ", 1i42);
+15 |     let _ = ("아あ", 1i42); //~ ERROR invalid width
    |                      ^^^^
    |
    = help: valid widths are 8, 16, 32, 64 and 128
@@ -17,7 +17,7 @@ error: invalid width `42` for integer literal
 error[E0425]: cannot find value `a̐é` in this scope
   --> $DIR/unicode_2.rs:16:13
    |
-16 |     let _ = a̐é;
+16 |     let _ = a̐é; //~ ERROR cannot find
    |             ^^ not found in this scope
 
 error: aborting due to 3 previous errors
index 15ce79a054f26c2a33a91275309daac3f3437952..b235a0f21360cb5d58bf25e52b600227a620a459 100644 (file)
 
 // #41425 -- error message "mismatched types" has wrong types
 
-fn plus_one(x: i32) -> i32 {
+fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
     x + 1;
 }
 
-fn foo() -> Result<u8, u64> {
+fn foo() -> Result<u8, u64> { //~ ERROR mismatched types
     Ok(1);
 }
 
index 0de0a25e68e24c0d0e63672fc5ed271e6533b7c8..93f57216ca063b05bf1b934cf430329380791f43 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/coercion-missing-tail-expected-type.rs:13:28
    |
-13 |   fn plus_one(x: i32) -> i32 {
+13 |   fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
    |  ____________________________^
 14 | |     x + 1;
    | |          - help: consider removing this semicolon
@@ -14,7 +14,7 @@ error[E0308]: mismatched types
 error[E0308]: mismatched types
   --> $DIR/coercion-missing-tail-expected-type.rs:17:29
    |
-17 |   fn foo() -> Result<u8, u64> {
+17 |   fn foo() -> Result<u8, u64> { //~ ERROR mismatched types
    |  _____________________________^
 18 | |     Ok(1);
    | |          - help: consider removing this semicolon
diff --git a/src/test/ui/command-line-diagnostics.rs b/src/test/ui/command-line-diagnostics.rs
new file mode 100644 (file)
index 0000000..ac631c2
--- /dev/null
@@ -0,0 +1,17 @@
+// 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.
+
+// This test checks the output format without the intermediate json representation
+// compile-flags: --error-format=human
+
+pub fn main() {
+    let x = 42;
+    x = 43;
+}
diff --git a/src/test/ui/command-line-diagnostics.stderr b/src/test/ui/command-line-diagnostics.stderr
new file mode 100644 (file)
index 0000000..48ca459
--- /dev/null
@@ -0,0 +1,10 @@
+error[E0384]: cannot assign twice to immutable variable `x`
+  --> $DIR/command-line-diagnostics.rs:16:5
+   |
+15 |     let x = 42;
+   |         - first assignment to `x`
+16 |     x = 43;
+   |     ^^^^^^ cannot assign twice to immutable variable
+
+error: aborting due to previous error
+
index e359f08096885c0034666d0620c0592e9b2b3889..9befa1ba60eed8fd3f62ffa522874b51718157dd 100644 (file)
@@ -16,7 +16,7 @@ trait Master<'a, 'b> {
 }
 
 impl<'a, 'b> Master<'a, 'b> for () {
-    fn foo() where 'a: 'b { }
+    fn foo() where 'a: 'b { } //~ ERROR impl has stricter
 }
 
 fn main() {
index bc42b505818b88f7864f5d5399416c13e389eed4..d46376b4a42b71afa8471dca4edab8f26da21dfd 100644 (file)
@@ -4,7 +4,7 @@ error[E0276]: impl has stricter requirements than trait
 15 |     fn foo();
    |     --------- definition of `foo` from trait
 ...
-19 |     fn foo() where 'a: 'b { }
+19 |     fn foo() where 'a: 'b { } //~ ERROR impl has stricter
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b`
 
 error: aborting due to previous error
index 719e15fdb61fe0f68cb9c618d94ad1e577d21005..31ab6cb7fc42c30c17a69aa27e7684d77e4fc83b 100644 (file)
@@ -17,7 +17,7 @@ trait Master<'a, T: ?Sized, U> {
 // `U: 'a` does not imply `V: 'a`
 impl<'a, U, V> Master<'a, U, V> for () {
     fn foo() where V: 'a { }
-    //~^ ERROR parameter type `V` may not live long enough
+    //~^ ERROR impl has stricter requirements than trait
 }
 
 fn main() {
index 1d4ded6e7123a8dfb1e4465ee23d43518b0dcc8f..85ab2a00521645ded9cc456184b2bfbc30cc4def 100644 (file)
@@ -15,7 +15,9 @@ const fn foo(x: u32) -> u32 {
 }
 
 fn main() {
-    const X: u32 = 0-1;
-    const Y: u32 = foo(0-1);
+    const X: u32 = 0-1; //~ ERROR constant evaluation error
+    //~^ WARN constant evaluation error
+    const Y: u32 = foo(0-1); //~ ERROR constant evaluation error
+    //~^ WARN constant evaluation error
     println!("{} {}", X, Y);
 }
index 58dedcfd9b10317e82ab16bee93589a2b27a4d07..82baab620ffab3167ed509263fc3f737db8ec4da 100644 (file)
@@ -1,27 +1,27 @@
 warning: constant evaluation error: attempt to subtract with overflow
   --> $DIR/issue-43197.rs:18:20
    |
-18 |     const X: u32 = 0-1;
+18 |     const X: u32 = 0-1; //~ ERROR constant evaluation error
    |                    ^^^
    |
    = note: #[warn(const_err)] on by default
 
 warning: constant evaluation error: attempt to subtract with overflow
-  --> $DIR/issue-43197.rs:19:20
+  --> $DIR/issue-43197.rs:20:20
    |
-19 |     const Y: u32 = foo(0-1);
+20 |     const Y: u32 = foo(0-1); //~ ERROR constant evaluation error
    |                    ^^^^^^^^
 
 error[E0080]: constant evaluation error
   --> $DIR/issue-43197.rs:18:20
    |
-18 |     const X: u32 = 0-1;
+18 |     const X: u32 = 0-1; //~ ERROR constant evaluation error
    |                    ^^^ attempt to subtract with overflow
 
 error[E0080]: constant evaluation error
-  --> $DIR/issue-43197.rs:19:24
+  --> $DIR/issue-43197.rs:20:24
    |
-19 |     const Y: u32 = foo(0-1);
+20 |     const Y: u32 = foo(0-1); //~ ERROR constant evaluation error
    |                        ^^^ attempt to subtract with overflow
 
 error: aborting due to 2 previous errors
index 282b0d4e45b7098ae5b3d26d42c6ecb25c747bd4..24d4457f01d70439637a2bf74e08a7e61cfabd15 100644 (file)
@@ -12,9 +12,9 @@
 
 pub fn main() {
     // Constant of generic type (int)
-    const X: &'static u32 = &22;
+    const X: &'static u32 = &22; //~ ERROR constant evaluation error
     assert_eq!(0, match &22 {
         X => 0,
         _ => 1,
     });
-}
\ No newline at end of file
+}
index 5bda81451d0e248ae04d9634288212f9d3afff95..f6587c703bd7ff560165d451c3340658da874c14 100644 (file)
@@ -1,7 +1,7 @@
 error[E0080]: constant evaluation error
   --> $DIR/const-expr-addr-operator.rs:15:29
    |
-15 |     const X: &'static u32 = &22;
+15 |     const X: &'static u32 = &22; //~ ERROR constant evaluation error
    |                             ^^^ unimplemented constant expression: address operator
    |
 note: for pattern here
index f8bb84abcd41928be74faf7c63177c3caa95f34c..85640087a9d48a8ee75efd8daedf155cda41c9c2 100644 (file)
@@ -8,10 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// error-pattern: in format string
+
 // aux-build:extern_macro_crate.rs
 #[macro_use(myprintln, myprint)]
 extern crate extern_macro_crate;
 
 fn main() {
-    myprintln!("{}"); //~ ERROR in this macro
+    myprintln!("{}");
 }
index 7d5055deb895aa5630cb3d45abee0d43f4124ed3..3644c0468d6ef895085990fe63e351cb914e5dfe 100644 (file)
@@ -1,7 +1,7 @@
 error: 1 positional argument in format string, but no arguments were given
-  --> $DIR/main.rs:16:5
+  --> $DIR/main.rs:18:5
    |
-16 |     myprintln!("{}"); //~ ERROR in this macro
+18 |     myprintln!("{}");
    |     ^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in a macro outside of the current crate (run with -Z external-macro-backtrace for more info)
index 16d8226bfece10922eadab7144763c791b90f459..04ba4ab905eb1fb8980f046cbae83a7d9ce26c05 100644 (file)
@@ -9,26 +9,26 @@
 // except according to those terms.
 
 macro_rules! borrow {
-    ($x:expr) => { &$x }
+    ($x:expr) => { &$x } //~ ERROR mismatched types
 }
 
 fn foo(_: String) {}
 
 fn foo2(s: &String) {
-    foo(s);
+    foo(s); //~ ERROR mismatched types
 }
 
 fn foo3(_: u32) {}
 fn foo4(u: &u32) {
-    foo3(u);
+    foo3(u); //~ ERROR mismatched types
 }
 
 fn main() {
     let s = String::new();
     let r_s = &s;
     foo2(r_s);
-    foo(&"aaa".to_owned());
-    foo(&mut "aaa".to_owned());
+    foo(&"aaa".to_owned()); //~ ERROR mismatched types
+    foo(&mut "aaa".to_owned()); //~ ERROR mismatched types
     foo3(borrow!(0));
     foo4(&0);
 }
index 3ed3297e05ed95a5976c1795ce3deccb9fe9e987..6c418cf4bfbed63ba8a353ecb257bf7fece2a662 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:18:9
    |
-18 |     foo(s);
+18 |     foo(s); //~ ERROR mismatched types
    |         ^ expected struct `std::string::String`, found reference
    |
    = note: expected type `std::string::String`
@@ -16,7 +16,7 @@ error[E0308]: mismatched types
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:23:10
    |
-23 |     foo3(u);
+23 |     foo3(u); //~ ERROR mismatched types
    |          ^ expected u32, found &u32
    |
    = note: expected type `u32`
@@ -26,7 +26,7 @@ error[E0308]: mismatched types
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:30:9
    |
-30 |     foo(&"aaa".to_owned());
+30 |     foo(&"aaa".to_owned()); //~ ERROR mismatched types
    |         ^^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found reference
    |
    = note: expected type `std::string::String`
@@ -36,7 +36,7 @@ error[E0308]: mismatched types
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:31:9
    |
-31 |     foo(&mut "aaa".to_owned());
+31 |     foo(&mut "aaa".to_owned()); //~ ERROR mismatched types
    |         ^^^^^^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found mutable reference
    |
    = note: expected type `std::string::String`
@@ -46,7 +46,7 @@ error[E0308]: mismatched types
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:12:20
    |
-12 |     ($x:expr) => { &$x }
+12 |     ($x:expr) => { &$x } //~ ERROR mismatched types
    |                    ^^^ expected u32, found &{integer}
 ...
 32 |     foo3(borrow!(0));
index 8fb6c9815cef8ef905bea149061b3985da5c23c4..21cdb38fdb11886c5da8188cf421fb8ea6c9c519 100644 (file)
 trait Foo {}
 
 struct Bar<'a> {
-    w: &'a Foo + Copy,
-    x: &'a Foo + 'a,
-    y: &'a mut Foo + 'a,
-    z: fn() -> Foo + 'a,
+    w: &'a Foo + Copy, //~ ERROR expected a path
+    x: &'a Foo + 'a, //~ ERROR expected a path
+    y: &'a mut Foo + 'a, //~ ERROR expected a path
+    z: fn() -> Foo + 'a, //~ ERROR expected a path
 }
 
 fn main() {
index 15e7131cfd3be41a75621b24e212971643909267..4fe8849feef11c42170395dcacd8ec4ce95174ee 100644 (file)
@@ -1,25 +1,25 @@
 error[E0178]: expected a path on the left-hand side of `+`, not `&'a Foo`
   --> $DIR/E0178.rs:14:8
    |
-14 |     w: &'a Foo + Copy,
+14 |     w: &'a Foo + Copy, //~ ERROR expected a path
    |        ^^^^^^^^^^^^^^ help: try adding parentheses: `&'a (Foo + Copy)`
 
 error[E0178]: expected a path on the left-hand side of `+`, not `&'a Foo`
   --> $DIR/E0178.rs:15:8
    |
-15 |     x: &'a Foo + 'a,
+15 |     x: &'a Foo + 'a, //~ ERROR expected a path
    |        ^^^^^^^^^^^^ help: try adding parentheses: `&'a (Foo + 'a)`
 
 error[E0178]: expected a path on the left-hand side of `+`, not `&'a mut Foo`
   --> $DIR/E0178.rs:16:8
    |
-16 |     y: &'a mut Foo + 'a,
+16 |     y: &'a mut Foo + 'a, //~ ERROR expected a path
    |        ^^^^^^^^^^^^^^^^ help: try adding parentheses: `&'a mut (Foo + 'a)`
 
 error[E0178]: expected a path on the left-hand side of `+`, not `fn() -> Foo`
   --> $DIR/E0178.rs:17:8
    |
-17 |     z: fn() -> Foo + 'a,
+17 |     z: fn() -> Foo + 'a, //~ ERROR expected a path
    |        ^^^^^^^^^^^^^^^^ perhaps you forgot parentheses?
 
 error: aborting due to 4 previous errors
index 99035209e14bc48aa4482f681a2ddf3d5f27796b..076b61b179061eccfef56136070b0bc63170f8ce 100644 (file)
@@ -33,7 +33,4 @@ fn main() {
 
     f1.foo(1usize);
     //~^ error: the trait bound `Bar: Foo<usize>` is not satisfied
-    //~| help: the following implementations were found:
-    //~| help:   <Bar as Foo<i32>>
-    //~| help:   <Bar as Foo<u8>>
 }
index 2009c32c854365a6bb91973f8f101d9d2b97e5e4..6beff6ba2a100b0dc0086c47088e70b4d6e83568 100644 (file)
@@ -37,10 +37,4 @@ fn main() {
 
     f1.foo(1usize);
     //~^ error: the trait bound `Bar: Foo<usize>` is not satisfied
-    //~| help: the following implementations were found:
-    //~| help:   <Bar as Foo<i8>>
-    //~| help:   <Bar as Foo<i16>>
-    //~| help:   <Bar as Foo<i32>>
-    //~| help:   <Bar as Foo<u8>>
-    //~| help: and 2 others
 }
index 374d06bb71d279e5e56067886f5c056d21ce04a0..1b31e064337e25bd27ed968a63d964830860ea84 100644 (file)
 
 impl Struct {
     fn foo(&mut self) {
-        (&mut self).bar();
+        (&mut self).bar(); //~ ERROR cannot borrow
     }
 
     // In this case we could keep the suggestion, but to distinguish the
     // two cases is pretty hard. It's an obscure case anyway.
     fn bar(self: &mut Self) {
-        (&mut self).bar();
+        (&mut self).bar(); //~ ERROR cannot borrow
     }
 }
 
index 47dc7c975724a117e2fa62fdb80e7e2a43d16479..cd96d28ac98cb90d9a72cc3a2532277db708ef7a 100644 (file)
@@ -1,7 +1,7 @@
 error[E0596]: cannot borrow immutable argument `self` as mutable
   --> $DIR/issue-31424.rs:17:15
    |
-17 |         (&mut self).bar();
+17 |         (&mut self).bar(); //~ ERROR cannot borrow
    |               ^^^^
    |               |
    |               cannot reborrow mutably
@@ -12,7 +12,7 @@ error[E0596]: cannot borrow immutable argument `self` as mutable
    |
 22 |     fn bar(self: &mut Self) {
    |            --------------- consider changing this to `mut self: &mut Self`
-23 |         (&mut self).bar();
+23 |         (&mut self).bar(); //~ ERROR cannot borrow
    |               ^^^^ cannot borrow mutably
 
 error: aborting due to 2 previous errors
index 9523e6bbf383b8f49007d1fb3efad3a53784bfd1..9dfb38abd049fc5dbbe589c86de38d25e309dafd 100644 (file)
@@ -13,7 +13,7 @@ struct Z { }
 impl Z {
     fn run(&self, z: &mut Z) { }
     fn start(&mut self) {
-        self.run(&mut self);
+        self.run(&mut self); //~ ERROR cannot borrow
     }
 }
 
index d9ef0c45410418c057b6a83a37996ffb3930a653..a4921046c783331d6c72474228b1b8f3e7fdbbb0 100644 (file)
@@ -1,7 +1,7 @@
 error[E0596]: cannot borrow immutable argument `self` as mutable
   --> $DIR/issue-34126.rs:16:23
    |
-16 |         self.run(&mut self);
+16 |         self.run(&mut self); //~ ERROR cannot borrow
    |                       ^^^^
    |                       |
    |                       cannot reborrow mutably
index 42853a5d83db029e7795184e290fb954fe220a7e..a426c0f48ccec3c08e71c847a30a140234fed861 100644 (file)
@@ -13,5 +13,5 @@ fn get(key: &mut String) { }
 fn main() {
     let mut v: Vec<String> = Vec::new();
     let ref mut key = v[0];
-    get(&mut key);
+    get(&mut key); //~ ERROR cannot borrow
 }
index 20478165c7ea0309c6917bd4048a2d3ad7518693..a53d3d7277aa3dae4afa01efe8e15e64b3244525 100644 (file)
@@ -1,7 +1,7 @@
 error[E0596]: cannot borrow immutable local variable `key` as mutable
   --> $DIR/issue-34337.rs:16:14
    |
-16 |     get(&mut key);
+16 |     get(&mut key); //~ ERROR cannot borrow
    |              ^^^
    |              |
    |              cannot reborrow mutably
index 9ec8728fd32c17ff6c5e826ebbb3354f48b9f50b..867b47cf99e1eea70f2d23c2b1132e6b1a488ac3 100644 (file)
@@ -14,7 +14,7 @@ struct Foo {
 
 fn main() {
     let f = Foo { v: Vec::new() };
-    f.v.push("cat".to_string());
+    f.v.push("cat".to_string()); //~ ERROR cannot borrow
 }
 
 
@@ -23,9 +23,9 @@ struct S {
 }
 fn foo() {
     let s = S { x: 42 };
-    s.x += 1;
+    s.x += 1; //~ ERROR cannot assign
 }
 
 fn bar(s: S) {
-    s.x += 1;
+    s.x += 1; //~ ERROR cannot assign
 }
index 1cd1fb76aa33050d14e11f130b6d4460981b1f44..ec44755cb7c95a7663a5b984d6c11b21b520788e 100644 (file)
@@ -3,7 +3,7 @@ error[E0596]: cannot borrow immutable field `f.v` as mutable
    |
 16 |     let f = Foo { v: Vec::new() };
    |         - consider changing this to `mut f`
-17 |     f.v.push("cat".to_string());
+17 |     f.v.push("cat".to_string()); //~ ERROR cannot borrow
    |     ^^^ cannot mutably borrow immutable field
 
 error[E0594]: cannot assign to immutable field `s.x`
@@ -11,7 +11,7 @@ error[E0594]: cannot assign to immutable field `s.x`
    |
 25 |     let s = S { x: 42 };
    |         - consider changing this to `mut s`
-26 |     s.x += 1;
+26 |     s.x += 1; //~ ERROR cannot assign
    |     ^^^^^^^^ cannot mutably borrow immutable field
 
 error[E0594]: cannot assign to immutable field `s.x`
@@ -19,7 +19,7 @@ error[E0594]: cannot assign to immutable field `s.x`
    |
 29 | fn bar(s: S) {
    |        - consider changing this to `mut s`
-30 |     s.x += 1;
+30 |     s.x += 1; //~ ERROR cannot assign
    |     ^^^^^^^^ cannot mutably borrow immutable field
 
 error: aborting due to 3 previous errors
index cd0d0951abf8a7dad94a6d87c430363b0664945f..6e641ff025ce3f3ad24baa997e1db8375c375d88 100644 (file)
@@ -14,5 +14,5 @@ struct Foo {
 
 fn main() {
     let f = Foo { bar: 22 };
-    f.baz;
+    f.baz; //~ ERROR no field
 }
index 72fd09c0357198df46d352a05a4df52c0dc7af63..73319d567bd763465d4734ac5d08d4f90f51924a 100644 (file)
@@ -1,7 +1,7 @@
 error[E0609]: no field `baz` on type `Foo`
   --> $DIR/issue-36798.rs:17:7
    |
-17 |     f.baz;
+17 |     f.baz; //~ ERROR no field
    |       ^^^ did you mean `bar`?
 
 error: aborting due to previous error
index 2970a325a6af823eef177c6aaef02401cad40ecc..ec54a8d2b4390e8cd24450d50b9cf4761f1524fb 100644 (file)
@@ -14,5 +14,5 @@ struct Foo {
 
 fn main() {
     let f = Foo { bar: 22 };
-    f.zz;
+    f.zz; //~ ERROR no field
 }
index 20bb7d4c91de3ac7e8843e8bab643ddd47208072..f17672b234fc66653112951917e4193fa82be14f 100644 (file)
@@ -1,7 +1,7 @@
 error[E0609]: no field `zz` on type `Foo`
   --> $DIR/issue-36798_unknown_field.rs:17:7
    |
-17 |     f.zz;
+17 |     f.zz; //~ ERROR no field
    |       ^^ unknown field
    |
    = note: available fields are: `bar`
index 65181768053c0799c70f68653b4c86699c0c5f50..8a1a7ce0c320b33ad9b96eb99bd2ef50825c5632 100644 (file)
@@ -19,7 +19,7 @@ fn main() {
     let mut x = TestEnum::Item(10);
     match x {
         TestEnum::Item(ref mut x) => {
-            test(&mut x);
+            test(&mut x); //~ ERROR cannot borrow immutable
         }
     }
 }
index 9fc364f861275a6b977d8376a12eba1c01cf9bc0..65de724616d109dc7da296479ccadc8b08a14c2e 100644 (file)
@@ -1,7 +1,7 @@
 error[E0596]: cannot borrow immutable local variable `x` as mutable
   --> $DIR/issue-37139.rs:22:23
    |
-22 |             test(&mut x);
+22 |             test(&mut x); //~ ERROR cannot borrow immutable
    |                       ^
    |                       |
    |                       cannot reborrow mutably
index 1938d33e5303020d2fd975f917e2bb67350847ac..c9c1c5d141d6a9b6184d4032007a276363af7f90 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use Foo;
+use Foo; //~ ERROR unresolved
 
-use Foo1;
+use Foo1; //~ ERROR unresolved
 
 fn main() {}
index 325f55e686c622e12ec5772512392b0a1e70f460..c58958c7f5e3fbc5706670af091f2d989e1b6fbb 100644 (file)
@@ -1,13 +1,13 @@
 error[E0432]: unresolved import `Foo`
   --> $DIR/issue-38054-do-not-show-unresolved-names.rs:11:5
    |
-11 | use Foo;
+11 | use Foo; //~ ERROR unresolved
    |     ^^^ no `Foo` in the root
 
 error[E0432]: unresolved import `Foo1`
   --> $DIR/issue-38054-do-not-show-unresolved-names.rs:13:5
    |
-13 | use Foo1;
+13 | use Foo1; //~ ERROR unresolved
    |     ^^^^ no `Foo1` in the root
 
 error: aborting due to 2 previous errors
index 136921dd0a5694838942d8db7f255bc3b92cbabe..a7ce7406566b3ad5bc4c301a35f3ef0804824c48 100644 (file)
@@ -24,7 +24,7 @@ struct Foo<'a> {
 
 impl<'a> Foo<'a> {
     fn f(&self) {
-        self.s.push('x');
+        self.s.push('x'); //~ ERROR cannot borrow data mutably
     }
 }
 
index e9f2b1dad806d52429b48060b5a1136315856584..6a262b3102638bc1d89c2037800be2213ec91b05 100644 (file)
@@ -3,7 +3,7 @@ error[E0389]: cannot borrow data mutably in a `&` reference
    |
 26 |     fn f(&self) {
    |          ----- use `&mut self` here to make mutable
-27 |         self.s.push('x');
+27 |         self.s.push('x'); //~ ERROR cannot borrow data mutably
    |         ^^^^^^ assignment into an immutable reference
 
 error: aborting due to previous error
index a5d533edf75ecdc61ca80bfadf27eeaf9dedd57f..cc6be98bcf8a70005b578e7b679a6133ecffd2fb 100644 (file)
@@ -14,7 +14,7 @@ struct Bar<'a> {
 
 impl<'a> Bar<'a> {
     fn f(&mut self) {
-        self.s.push('x');
+        self.s.push('x'); //~ ERROR cannot borrow immutable borrowed
     }
 }
 
index e81bc722fa0989d6c76e7914b28f31f17b54d476..b09ecf9057c0b1c85439e8428c7e2fc4313ca35f 100644 (file)
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable borrowed content `*self.s` as mutable
 12 |     s: &'a String
    |        ---------- use `&'a mut String` here to make mutable
 ...
-17 |         self.s.push('x');
+17 |         self.s.push('x'); //~ ERROR cannot borrow immutable borrowed
    |         ^^^^^^ cannot borrow as mutable
 
 error: aborting due to previous error
index 5e8f2d3eaefaab67f3e7e65da458141a083d1b5a..42b29100517223ccac48bc8426d69b0c8de0c0bc 100644 (file)
@@ -14,7 +14,7 @@ struct Qux<'a> {
 
 impl<'a> Qux<'a> {
     fn f(&self) {
-        self.s.push('x');
+        self.s.push('x'); //~ ERROR cannot borrow immutable borrowed
     }
 }
 
index 749795f4d8fbd60320583f4c88af28e496dc96ed..ca721f133a44b0edc17fed9b8d225ea6b4f1fefa 100644 (file)
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable borrowed content `*self.s` as mutable
 12 |     s: &'a String
    |        ---------- use `&'a mut String` here to make mutable
 ...
-17 |         self.s.push('x');
+17 |         self.s.push('x'); //~ ERROR cannot borrow immutable borrowed
    |         ^^^^^^ cannot borrow as mutable
 
 error: aborting due to previous error
index 4eb20ceeed48e50a1b32f8204dafe21e97279bc8..49a8f2b6ff69125a86edfeb79e30071591cb2111 100644 (file)
@@ -13,7 +13,7 @@ struct Foo<'a> {
 }
 
 fn f(x: usize, f: &Foo) {
-    f.s.push('x');
+    f.s.push('x'); //~ ERROR cannot borrow data mutably
 }
 
 fn main() {}
index 9a8853f4fbbdb15dfe2bfa8330db4c5b4d4e8344..33bf2e1160c9016a91b3dfce50c446bd3fe93580 100644 (file)
@@ -3,7 +3,7 @@ error[E0389]: cannot borrow data mutably in a `&` reference
    |
 15 | fn f(x: usize, f: &Foo) {
    |                   ---- use `&mut Foo` here to make mutable
-16 |     f.s.push('x');
+16 |     f.s.push('x'); //~ ERROR cannot borrow data mutably
    |     ^^^ assignment into an immutable reference
 
 error: aborting due to previous error
index d7c8935560623118722a329e82234d7b59a97332..7cd7768078a0c5be92fd4f8ade36fae1145a38aa 100644 (file)
@@ -18,42 +18,42 @@ pub struct Z {
 
 fn main() {
     let z = Z { x: X::Y };
-    let _ = &mut z.x;
+    let _ = &mut z.x; //~ ERROR cannot borrow
 }
 
 impl Z {
     fn foo<'z>(&'z self) {
-        let _ = &mut self.x;
+        let _ = &mut self.x; //~ ERROR cannot borrow
     }
 
     fn foo1(&self, other: &Z) {
-        let _ = &mut self.x;
-        let _ = &mut other.x;
+        let _ = &mut self.x; //~ ERROR cannot borrow
+        let _ = &mut other.x; //~ ERROR cannot borrow
     }
 
     fn foo2<'a>(&'a self, other: &Z) {
-        let _ = &mut self.x;
-        let _ = &mut other.x;
+        let _ = &mut self.x; //~ ERROR cannot borrow
+        let _ = &mut other.x; //~ ERROR cannot borrow
     }
 
     fn foo3<'a>(self: &'a Self, other: &Z) {
-        let _ = &mut self.x;
-        let _ = &mut other.x;
+        let _ = &mut self.x; //~ ERROR cannot borrow
+        let _ = &mut other.x; //~ ERROR cannot borrow
     }
 
     fn foo4(other: &Z) {
-        let _ = &mut other.x;
+        let _ = &mut other.x; //~ ERROR cannot borrow
     }
 
 }
 
 pub fn with_arg(z: Z, w: &Z) {
-    let _ = &mut z.x;
-    let _ = &mut w.x;
+    let _ = &mut z.x; //~ ERROR cannot borrow
+    let _ = &mut w.x; //~ ERROR cannot borrow
 }
 
 pub fn with_tuple() {
     let mut y = 0;
     let x = (&y,);
-    *x.0 = 1;
+    *x.0 = 1; //~ ERROR cannot assign to immutable borrowed content
 }
index 28aaab97bdad1c8712c0f397885ca59b40926c7a..1fcb05374f681a919b041e0775dc33750b068f6c 100644 (file)
@@ -3,7 +3,7 @@ error[E0596]: cannot borrow immutable field `z.x` as mutable
    |
 20 |     let z = Z { x: X::Y };
    |         - consider changing this to `mut z`
-21 |     let _ = &mut z.x;
+21 |     let _ = &mut z.x; //~ ERROR cannot borrow
    |                  ^^^ cannot mutably borrow immutable field
 
 error[E0596]: cannot borrow immutable field `self.x` as mutable
@@ -11,7 +11,7 @@ error[E0596]: cannot borrow immutable field `self.x` as mutable
    |
 25 |     fn foo<'z>(&'z self) {
    |                -------- use `&'z mut self` here to make mutable
-26 |         let _ = &mut self.x;
+26 |         let _ = &mut self.x; //~ ERROR cannot borrow
    |                      ^^^^^^ cannot mutably borrow immutable field
 
 error[E0596]: cannot borrow immutable field `self.x` as mutable
@@ -19,7 +19,7 @@ error[E0596]: cannot borrow immutable field `self.x` as mutable
    |
 29 |     fn foo1(&self, other: &Z) {
    |             ----- use `&mut self` here to make mutable
-30 |         let _ = &mut self.x;
+30 |         let _ = &mut self.x; //~ ERROR cannot borrow
    |                      ^^^^^^ cannot mutably borrow immutable field
 
 error[E0596]: cannot borrow immutable field `other.x` as mutable
@@ -27,8 +27,8 @@ error[E0596]: cannot borrow immutable field `other.x` as mutable
    |
 29 |     fn foo1(&self, other: &Z) {
    |                           -- use `&mut Z` here to make mutable
-30 |         let _ = &mut self.x;
-31 |         let _ = &mut other.x;
+30 |         let _ = &mut self.x; //~ ERROR cannot borrow
+31 |         let _ = &mut other.x; //~ ERROR cannot borrow
    |                      ^^^^^^^ cannot mutably borrow immutable field
 
 error[E0596]: cannot borrow immutable field `self.x` as mutable
@@ -36,7 +36,7 @@ error[E0596]: cannot borrow immutable field `self.x` as mutable
    |
 34 |     fn foo2<'a>(&'a self, other: &Z) {
    |                 -------- use `&'a mut self` here to make mutable
-35 |         let _ = &mut self.x;
+35 |         let _ = &mut self.x; //~ ERROR cannot borrow
    |                      ^^^^^^ cannot mutably borrow immutable field
 
 error[E0596]: cannot borrow immutable field `other.x` as mutable
@@ -44,8 +44,8 @@ error[E0596]: cannot borrow immutable field `other.x` as mutable
    |
 34 |     fn foo2<'a>(&'a self, other: &Z) {
    |                                  -- use `&mut Z` here to make mutable
-35 |         let _ = &mut self.x;
-36 |         let _ = &mut other.x;
+35 |         let _ = &mut self.x; //~ ERROR cannot borrow
+36 |         let _ = &mut other.x; //~ ERROR cannot borrow
    |                      ^^^^^^^ cannot mutably borrow immutable field
 
 error[E0596]: cannot borrow immutable field `self.x` as mutable
@@ -53,7 +53,7 @@ error[E0596]: cannot borrow immutable field `self.x` as mutable
    |
 39 |     fn foo3<'a>(self: &'a Self, other: &Z) {
    |                       -------- use `&'a mut Self` here to make mutable
-40 |         let _ = &mut self.x;
+40 |         let _ = &mut self.x; //~ ERROR cannot borrow
    |                      ^^^^^^ cannot mutably borrow immutable field
 
 error[E0596]: cannot borrow immutable field `other.x` as mutable
@@ -61,8 +61,8 @@ error[E0596]: cannot borrow immutable field `other.x` as mutable
    |
 39 |     fn foo3<'a>(self: &'a Self, other: &Z) {
    |                                        -- use `&mut Z` here to make mutable
-40 |         let _ = &mut self.x;
-41 |         let _ = &mut other.x;
+40 |         let _ = &mut self.x; //~ ERROR cannot borrow
+41 |         let _ = &mut other.x; //~ ERROR cannot borrow
    |                      ^^^^^^^ cannot mutably borrow immutable field
 
 error[E0596]: cannot borrow immutable field `other.x` as mutable
@@ -70,7 +70,7 @@ error[E0596]: cannot borrow immutable field `other.x` as mutable
    |
 44 |     fn foo4(other: &Z) {
    |                    -- use `&mut Z` here to make mutable
-45 |         let _ = &mut other.x;
+45 |         let _ = &mut other.x; //~ ERROR cannot borrow
    |                      ^^^^^^^ cannot mutably borrow immutable field
 
 error[E0596]: cannot borrow immutable field `z.x` as mutable
@@ -78,7 +78,7 @@ error[E0596]: cannot borrow immutable field `z.x` as mutable
    |
 50 | pub fn with_arg(z: Z, w: &Z) {
    |                 - consider changing this to `mut z`
-51 |     let _ = &mut z.x;
+51 |     let _ = &mut z.x; //~ ERROR cannot borrow
    |                  ^^^ cannot mutably borrow immutable field
 
 error[E0596]: cannot borrow immutable field `w.x` as mutable
@@ -86,14 +86,14 @@ error[E0596]: cannot borrow immutable field `w.x` as mutable
    |
 50 | pub fn with_arg(z: Z, w: &Z) {
    |                          -- use `&mut Z` here to make mutable
-51 |     let _ = &mut z.x;
-52 |     let _ = &mut w.x;
+51 |     let _ = &mut z.x; //~ ERROR cannot borrow
+52 |     let _ = &mut w.x; //~ ERROR cannot borrow
    |                  ^^^ cannot mutably borrow immutable field
 
 error[E0594]: cannot assign to immutable borrowed content `*x.0`
   --> $DIR/issue-39544.rs:58:5
    |
-58 |     *x.0 = 1;
+58 |     *x.0 = 1; //~ ERROR cannot assign to immutable borrowed content
    |     ^^^^^^^^ cannot borrow as mutable
 
 error: aborting due to 12 previous errors
index 68b1f79c89bbe3bdcd3a7a2bc2d08910153bbafc..660aedc3596edcd77d88e120fa1be26f4437321e 100644 (file)
@@ -31,7 +31,7 @@ impl Foo<bool> for bool {}
 impl Foo<i8> for bool {}
 
 fn main() {
-    Foo::<i32>::bar(&1i8);
-    Foo::<i32>::bar(&1u8);
-    Foo::<i32>::bar(&true);
+    Foo::<i32>::bar(&1i8); //~ ERROR is not satisfied
+    Foo::<i32>::bar(&1u8); //~ ERROR is not satisfied
+    Foo::<i32>::bar(&true); //~ ERROR is not satisfied
 }
index 4ea4adfcfe0fc68260f9dc047f487db7cc6eea17..d5c4add34b526392761133bf7ec1f9fcaa879669 100644 (file)
@@ -1,7 +1,7 @@
 error[E0277]: the trait bound `i8: Foo<i32>` is not satisfied
   --> $DIR/issue-39802-show-5-trait-impls.rs:34:5
    |
-34 |     Foo::<i32>::bar(&1i8);
+34 |     Foo::<i32>::bar(&1i8); //~ ERROR is not satisfied
    |     ^^^^^^^^^^^^^^^ the trait `Foo<i32>` is not implemented for `i8`
    |
    = help: the following implementations were found:
@@ -15,7 +15,7 @@ error[E0277]: the trait bound `i8: Foo<i32>` is not satisfied
 error[E0277]: the trait bound `u8: Foo<i32>` is not satisfied
   --> $DIR/issue-39802-show-5-trait-impls.rs:35:5
    |
-35 |     Foo::<i32>::bar(&1u8);
+35 |     Foo::<i32>::bar(&1u8); //~ ERROR is not satisfied
    |     ^^^^^^^^^^^^^^^ the trait `Foo<i32>` is not implemented for `u8`
    |
    = help: the following implementations were found:
@@ -28,7 +28,7 @@ error[E0277]: the trait bound `u8: Foo<i32>` is not satisfied
 error[E0277]: the trait bound `bool: Foo<i32>` is not satisfied
   --> $DIR/issue-39802-show-5-trait-impls.rs:36:5
    |
-36 |     Foo::<i32>::bar(&true);
+36 |     Foo::<i32>::bar(&true); //~ ERROR is not satisfied
    |     ^^^^^^^^^^^^^^^ the trait `Foo<i32>` is not implemented for `bool`
    |
    = help: the following implementations were found:
index d68c25faa8a847699043b5f7c48fcf77f3fe84fa..62316b96db03fc0820d3309b32a91d50d18f729c 100644 (file)
@@ -8,22 +8,24 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-impl X {
+impl X { //~ ERROR cannot be made into an object
+//~^ ERROR missing
     Y
 }
 
 struct S;
 
-trait X {
+trait X { //~ ERROR missing
     X() {}
-    fn xxx() { ### }
-    L = M;
-    Z = { 2 + 3 };
-    ::Y ();
+    fn xxx() { ### } //~ ERROR missing
+    //~^ ERROR expected
+    L = M; //~ ERROR missing
+    Z = { 2 + 3 }; //~ ERROR expected one of
+    ::Y (); //~ ERROR expected one of
 }
 
 impl S {
-    pub hello_method(&self) {
+    pub hello_method(&self) { //~ ERROR missing
         println!("Hello");
     }
 }
index 3b7f32cf8904a33a90898124898c3477e49b3010..8fadb4ff6b682452f22991317f17f68b471310f4 100644 (file)
@@ -1,65 +1,67 @@
 error: missing `fn`, `type`, or `const` for impl-item declaration
   --> $DIR/issue-40006.rs:11:9
    |
-11 |   impl X {
+11 |   impl X { //~ ERROR cannot be made into an object
    |  _________^
-12 | |     Y
+12 | | //~^ ERROR missing
+13 | |     Y
    | |____^ missing `fn`, `type`, or `const`
 
 error: missing `fn`, `type`, or `const` for trait-item declaration
-  --> $DIR/issue-40006.rs:17:10
+  --> $DIR/issue-40006.rs:18:10
    |
-17 |   trait X {
+18 |   trait X { //~ ERROR missing
    |  __________^
-18 | |     X() {}
+19 | |     X() {}
    | |____^ missing `fn`, `type`, or `const`
 
 error: expected `[`, found `#`
-  --> $DIR/issue-40006.rs:19:17
+  --> $DIR/issue-40006.rs:20:17
    |
-19 |     fn xxx() { ### }
+20 |     fn xxx() { ### } //~ ERROR missing
    |                 ^
 
 error: missing `fn`, `type`, or `const` for trait-item declaration
-  --> $DIR/issue-40006.rs:19:21
+  --> $DIR/issue-40006.rs:20:21
    |
-19 |       fn xxx() { ### }
+20 |       fn xxx() { ### } //~ ERROR missing
    |  _____________________^
-20 | |     L = M;
+21 | |     //~^ ERROR expected
+22 | |     L = M; //~ ERROR missing
    | |____^ missing `fn`, `type`, or `const`
 
 error: missing `fn`, `type`, or `const` for trait-item declaration
-  --> $DIR/issue-40006.rs:20:11
+  --> $DIR/issue-40006.rs:22:11
    |
-20 |       L = M;
+22 |       L = M; //~ ERROR missing
    |  ___________^
-21 | |     Z = { 2 + 3 };
+23 | |     Z = { 2 + 3 }; //~ ERROR expected one of
    | |____^ missing `fn`, `type`, or `const`
 
 error: expected one of `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `;`
-  --> $DIR/issue-40006.rs:21:18
+  --> $DIR/issue-40006.rs:23:18
    |
-21 |     Z = { 2 + 3 };
+23 |     Z = { 2 + 3 }; //~ ERROR expected one of
    |                  ^ expected one of `const`, `extern`, `fn`, `type`, `unsafe`, or `}` here
 
 error: expected one of `!` or `::`, found `(`
-  --> $DIR/issue-40006.rs:22:9
+  --> $DIR/issue-40006.rs:24:9
    |
-22 |     ::Y ();
+24 |     ::Y (); //~ ERROR expected one of
    |        -^ unexpected token
    |        |
    |        expected one of `!` or `::` here
 
 error: missing `fn`, `type`, or `const` for impl-item declaration
-  --> $DIR/issue-40006.rs:26:8
+  --> $DIR/issue-40006.rs:28:8
    |
-26 |     pub hello_method(&self) {
+28 |     pub hello_method(&self) { //~ ERROR missing
    |        ^ missing `fn`, `type`, or `const`
 
 error[E0038]: the trait `X` cannot be made into an object
   --> $DIR/issue-40006.rs:11:6
    |
-11 | impl X {
+11 | impl X { //~ ERROR cannot be made into an object
    |      ^ the trait `X` cannot be made into an object
    |
    = note: method `xxx` has no receiver
index 1eae180976ad3689b7eacf7aab6679df5652c20f..eb62dc54084949d3a2043237d79033351480e1e7 100644 (file)
@@ -9,15 +9,16 @@
 // except according to those terms.
 
 fn foo() {
-    println!("{:?}", (0..13).collect<Vec<i32>>());
+    println!("{:?}", (0..13).collect<Vec<i32>>()); //~ ERROR chained comparison
 }
 
 fn bar() {
-    println!("{:?}", Vec<i32>::new());
+    println!("{:?}", Vec<i32>::new()); //~ ERROR chained comparison
 }
 
 fn qux() {
-    println!("{:?}", (0..13).collect<Vec<i32>());
+    println!("{:?}", (0..13).collect<Vec<i32>()); //~ ERROR chained comparison
+    //~^ ERROR chained comparison
 }
 
 fn main() {}
index 11279f5c6129ff2237503d61ffd987ce7d240af8..8f4118b3ff05a5835862bd0fe3b543125e49b398 100644 (file)
@@ -1,7 +1,7 @@
 error: chained comparison operators require parentheses
   --> $DIR/issue-40396.rs:12:37
    |
-12 |     println!("{:?}", (0..13).collect<Vec<i32>>());
+12 |     println!("{:?}", (0..13).collect<Vec<i32>>()); //~ ERROR chained comparison
    |                                     ^^^^^^^^
    |
    = help: use `::<...>` instead of `<...>` if you meant to specify type arguments
@@ -10,7 +10,7 @@ error: chained comparison operators require parentheses
 error: chained comparison operators require parentheses
   --> $DIR/issue-40396.rs:16:25
    |
-16 |     println!("{:?}", Vec<i32>::new());
+16 |     println!("{:?}", Vec<i32>::new()); //~ ERROR chained comparison
    |                         ^^^^^^^
    |
    = help: use `::<...>` instead of `<...>` if you meant to specify type arguments
@@ -19,7 +19,7 @@ error: chained comparison operators require parentheses
 error: chained comparison operators require parentheses
   --> $DIR/issue-40396.rs:20:37
    |
-20 |     println!("{:?}", (0..13).collect<Vec<i32>());
+20 |     println!("{:?}", (0..13).collect<Vec<i32>()); //~ ERROR chained comparison
    |                                     ^^^^^^^^
    |
    = help: use `::<...>` instead of `<...>` if you meant to specify type arguments
@@ -28,7 +28,7 @@ error: chained comparison operators require parentheses
 error: chained comparison operators require parentheses
   --> $DIR/issue-40396.rs:20:41
    |
-20 |     println!("{:?}", (0..13).collect<Vec<i32>());
+20 |     println!("{:?}", (0..13).collect<Vec<i32>()); //~ ERROR chained comparison
    |                                         ^^^^^^
    |
    = help: use `::<...>` instead of `<...>` if you meant to specify type arguments
index f4ae3257279823d57d71a391832d48188ec0e4cd..3b48cef19021b4ce91b19870e6d780ab9d2053f1 100644 (file)
@@ -10,5 +10,5 @@
 
 fn main() {
     let mut buf = &[1, 2, 3, 4];
-    buf.iter_mut();
+    buf.iter_mut(); //~ ERROR cannot borrow immutable borrowed content
 }
index 7daab09c09e37737b790e644fa243dafbe5b4a11..0b71fc1d306a2675e72d5cf123b4df1e5b4d39f4 100644 (file)
@@ -1,7 +1,7 @@
 error[E0596]: cannot borrow immutable borrowed content `*buf` as mutable
   --> $DIR/issue-40823.rs:13:5
    |
-13 |     buf.iter_mut();
+13 |     buf.iter_mut(); //~ ERROR cannot borrow immutable borrowed content
    |     ^^^ cannot borrow as mutable
 
 error: aborting due to previous error
index 5091b9efc34226bc796b3b8bacb60fd2f1079f2f..98c909e212fddb4fc57d7ebff9f0877d4b497b47 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    let x = ~1;
+    let x = ~1; //~ ERROR can not be used as a unary operator
 }
index 2abbbf65ba9b507254cef20ec002e58cf760aea5..f1ccb3e6e141c125c3a427a910eb47fbf8c29c38 100644 (file)
@@ -1,7 +1,7 @@
 error: `~` can not be used as a unary operator
   --> $DIR/issue-41679.rs:12:13
    |
-12 |     let x = ~1;
+12 |     let x = ~1; //~ ERROR can not be used as a unary operator
    |             ^ did you mean `!`?
    |
    = help: use `!` instead of `~` if you meant to perform bitwise negation
index 7fe9950801227f1d1509cbcfe976418f92c6808c..ad5bedcefc2dd103a9db02c7e3d536c2717d2180 100644 (file)
@@ -24,10 +24,12 @@ pub struct Demo {
     impl Demo {
         fn new_with_secret_two() -> Self {
             Self { secret_integer: 2, inocently_mispellable: () }
+            //~^ ERROR no field
         }
 
         fn new_with_secret_three() -> Self {
             Self { secret_integer: 3, egregiously_nonexistent_field: () }
+            //~^ ERROR no field
         }
     }
 
@@ -38,6 +40,8 @@ fn main() {
 
     let demo = Demo::default();
     let innocent_field_misaccess = demo.inocently_mispellable;
+    //~^ ERROR no field
     // note shouldn't suggest private fields
     let egregious_field_misaccess = demo.egregiously_nonexistent_field;
+    //~^ ERROR no field
 }
index e2bb7fbd9a895b1ee34b56c2275edd0dc554419a..d5dcef638471e20737271e4f61341094f9dde7dd 100644 (file)
@@ -5,23 +5,23 @@ error[E0560]: struct `submodule::Demo` has no field named `inocently_mispellable
    |                                       ^^^^^^^^^^^^^^^^^^^^^^ field does not exist - did you mean `innocently_misspellable`?
 
 error[E0560]: struct `submodule::Demo` has no field named `egregiously_nonexistent_field`
-  --> $DIR/issue-42599_available_fields_note.rs:30:39
+  --> $DIR/issue-42599_available_fields_note.rs:31:39
    |
-30 |             Self { secret_integer: 3, egregiously_nonexistent_field: () }
+31 |             Self { secret_integer: 3, egregiously_nonexistent_field: () }
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `submodule::Demo` does not have this field
    |
    = note: available fields are: `favorite_integer`, `secret_integer`, `innocently_misspellable`, `another_field`, `yet_another_field` ... and 2 others
 
 error[E0609]: no field `inocently_mispellable` on type `submodule::Demo`
-  --> $DIR/issue-42599_available_fields_note.rs:40:41
+  --> $DIR/issue-42599_available_fields_note.rs:42:41
    |
-40 |     let innocent_field_misaccess = demo.inocently_mispellable;
+42 |     let innocent_field_misaccess = demo.inocently_mispellable;
    |                                         ^^^^^^^^^^^^^^^^^^^^^ did you mean `innocently_misspellable`?
 
 error[E0609]: no field `egregiously_nonexistent_field` on type `submodule::Demo`
-  --> $DIR/issue-42599_available_fields_note.rs:42:42
+  --> $DIR/issue-42599_available_fields_note.rs:45:42
    |
-42 |     let egregious_field_misaccess = demo.egregiously_nonexistent_field;
+45 |     let egregious_field_misaccess = demo.egregiously_nonexistent_field;
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown field
    |
    = note: available fields are: `favorite_integer`, `innocently_misspellable`
index ecaeb7b1161f7fc332a4a61011033a260606b3c4..ff4bb428d5f5f73794d55b3bd6444b8bd551bea1 100644 (file)
@@ -19,4 +19,5 @@ fn this_function_expects_a_double_option<T>(d: DoubleOption<T>) {}
 fn main() {
     let n: usize = 42;
     this_function_expects_a_double_option(n);
+    //~^ ERROR mismatched types
 }
index 923b0984d063bb480fd376f50c827579e28f3fdd..7b877523e35cc37d73170ece35c8d27c956a10e7 100644 (file)
 enum Example { Ex(String), NotEx }
 
 fn result_test() {
-    let x = Option(1);
+    let x = Option(1); //~ ERROR expected function, found enum
 
-    if let Option(_) = x {
+    if let Option(_) = x { //~ ERROR expected tuple struct/variant, found enum
         println!("It is OK.");
     }
 
     let y = Example::Ex(String::from("test"));
 
-    if let Example(_) = y {
+    if let Example(_) = y { //~ ERROR expected tuple struct/variant, found enum
         println!("It is OK.");
     }
 }
index 8371413c5a2525c0d4f94e872da6cd826efb5d92..5390e541fb7140bcf1b446cd96db556503e2a60c 100644 (file)
@@ -1,7 +1,7 @@
 error[E0423]: expected function, found enum `Option`
   --> $DIR/issue-43871-enum-instead-of-variant.rs:14:13
    |
-14 |     let x = Option(1);
+14 |     let x = Option(1); //~ ERROR expected function, found enum
    |             ^^^^^^
    |
    = note: did you mean to use one of the following variants?
@@ -11,7 +11,7 @@ error[E0423]: expected function, found enum `Option`
 error[E0532]: expected tuple struct/variant, found enum `Option`
   --> $DIR/issue-43871-enum-instead-of-variant.rs:16:12
    |
-16 |     if let Option(_) = x {
+16 |     if let Option(_) = x { //~ ERROR expected tuple struct/variant, found enum
    |            ^^^^^^
    |
    = note: did you mean to use one of the following variants?
@@ -21,7 +21,7 @@ error[E0532]: expected tuple struct/variant, found enum `Option`
 error[E0532]: expected tuple struct/variant, found enum `Example`
   --> $DIR/issue-43871-enum-instead-of-variant.rs:22:12
    |
-22 |     if let Example(_) = y {
+22 |     if let Example(_) = y { //~ ERROR expected tuple struct/variant, found enum
    |            ^^^^^^^
    |
    = note: did you mean to use one of the following variants?
index becb81b1fff7ef8ca03b599e3e5de83eb425b436..2d27f167a03a49042040157eddb58e59c5d2b3c4 100644 (file)
@@ -41,5 +41,5 @@ enum N { N(usize) }
 fn is_send<T:Send>() { }
 
 fn main() {
-    is_send::<A>();
+    is_send::<A>(); //~ ERROR overflow evaluating the requirement
 }
index d157c5de6c7f57f98fd213b5da51db9a6015e9be..7fac604ba49d735955ab7f85fca125e6cf1eaf78 100644 (file)
@@ -1,7 +1,7 @@
 error[E0275]: overflow evaluating the requirement `K: std::marker::Send`
   --> $DIR/recursion_limit.rs:44:5
    |
-44 |     is_send::<A>();
+44 |     is_send::<A>(); //~ ERROR overflow evaluating the requirement
    |     ^^^^^^^^^^^^
    |
    = help: consider adding a `#![recursion_limit="20"]` attribute to your crate
index ebc56c94adf84395105e7c2317f18e635b79dff2..3e261ec636c0801f3b6ff90fa37aef80d5af84d3 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+//~^^^^^^^^^^ ERROR reached the recursion limit
+
 // Test that the recursion limit can be changed and that the compiler
 // suggests a fix. In this case, we have a long chain of Deref impls
 // which will cause an overflow during the autoderef loop.
@@ -57,6 +59,7 @@ fn new() -> Bottom {
 
 fn main() {
     let t = Top::new();
-    let x: &Bottom = &t;
+    let x: &Bottom = &t; //~ ERROR mismatched types
+    //~^ error recursion limit
 }
 
index 57b28d037362239f237591faf6eb9dd7d7aa6456..951b0b10580609649035ba3ef29c5ae2b07fec9d 100644 (file)
@@ -1,7 +1,7 @@
 error[E0055]: reached the recursion limit while auto-dereferencing I
-  --> $DIR/recursion_limit_deref.rs:60:22
+  --> $DIR/recursion_limit_deref.rs:62:22
    |
-60 |     let x: &Bottom = &t;
+62 |     let x: &Bottom = &t; //~ ERROR mismatched types
    |                      ^^ deref recursion limit reached
    |
    = help: consider adding a `#[recursion_limit="20"]` attribute to your crate
@@ -11,9 +11,9 @@ error[E0055]: reached the recursion limit while auto-dereferencing I
   = help: consider adding a `#[recursion_limit="20"]` attribute to your crate
 
 error[E0308]: mismatched types
-  --> $DIR/recursion_limit_deref.rs:60:22
+  --> $DIR/recursion_limit_deref.rs:62:22
    |
-60 |     let x: &Bottom = &t;
+62 |     let x: &Bottom = &t; //~ ERROR mismatched types
    |                      ^^ expected struct `Bottom`, found struct `Top`
    |
    = note: expected type `&Bottom`
index 9fb82b730c9b3ecda28976786cac4bfa0bba9fc6..16d07f369907b5a4eeb267a38ff64c9745fa32cd 100644 (file)
@@ -17,7 +17,7 @@
 
 macro_rules! recurse {
     () => { };
-    ($t:tt $($tail:tt)*) => { recurse!($($tail)*) };
+    ($t:tt $($tail:tt)*) => { recurse!($($tail)*) }; //~ ERROR recursion limit
 }
 
 fn main() {
index 19aac1f77e7c1888891c7971992b8055a1d1b825..24e223c797b21edbc0b59768dad333f26c4bd674 100644 (file)
@@ -1,7 +1,7 @@
 error: recursion limit reached while expanding the macro `recurse`
   --> $DIR/recursion_limit_macro.rs:20:31
    |
-20 |     ($t:tt $($tail:tt)*) => { recurse!($($tail)*) };
+20 |     ($t:tt $($tail:tt)*) => { recurse!($($tail)*) }; //~ ERROR recursion limit
    |                               ^^^^^^^^^^^^^^^^^^^
 ...
 24 |     recurse!(0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9);
index 11757abae9c9793f12251b2a004c3e35dc6bc8b5..76bc971e115f7744c8c8709e962c201157d8ae62 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 fn main() {
-    let _: &Copy + 'static;
-    let _: &'static Copy + 'static;
+    let _: &Copy + 'static; //~ ERROR expected a path
+    //~^ ERROR cannot be made into an object
+    let _: &'static Copy + 'static; //~ ERROR expected a path
 }
index 498255cb9ea374cc905dab9cc6369144b4725e70..325a19eee140b6b12065e548d2d9c5a6abea6c28 100644 (file)
@@ -1,19 +1,19 @@
 error[E0178]: expected a path on the left-hand side of `+`, not `&Copy`
   --> $DIR/trait-object-reference-without-parens-suggestion.rs:12:12
    |
-12 |     let _: &Copy + 'static;
+12 |     let _: &Copy + 'static; //~ ERROR expected a path
    |            ^^^^^^^^^^^^^^^ help: try adding parentheses: `&(Copy + 'static)`
 
 error[E0178]: expected a path on the left-hand side of `+`, not `&'static Copy`
-  --> $DIR/trait-object-reference-without-parens-suggestion.rs:13:12
+  --> $DIR/trait-object-reference-without-parens-suggestion.rs:14:12
    |
-13 |     let _: &'static Copy + 'static;
+14 |     let _: &'static Copy + 'static; //~ ERROR expected a path
    |            ^^^^^^^^^^^^^^^^^^^^^^^ help: try adding parentheses: `&'static (Copy + 'static)`
 
 error[E0038]: the trait `std::marker::Copy` cannot be made into an object
   --> $DIR/trait-object-reference-without-parens-suggestion.rs:12:12
    |
-12 |     let _: &Copy + 'static;
+12 |     let _: &Copy + 'static; //~ ERROR expected a path
    |            ^^^^^ the trait `std::marker::Copy` cannot be made into an object
    |
    = note: the trait cannot require that `Self : Sized`
index 5e200dbdbfa0195a23874498eb97cdb017495b1a..f76c2251f8c707fd35fc34cbac534b066101bd59 100644 (file)
@@ -36,20 +36,23 @@ fn main() {
     dt = Dt("dt", &c_long);
     dr = Dr("dr", &c_long);
     // Error: destructor order imprecisely modelled
-    dt = Dt("dt", &c); //~ ERROR `c` does not live long enough
-    dr = Dr("dr", &c); //~ ERROR `c` does not live long enough
+    dt = Dt("dt", &c);
+    dr = Dr("dr", &c);
 
     // No error: Drop impl asserts .1 (A and &'a _) are not accessed
     pt = Pt("pt", &c, &c_long);
     pr = Pr("pr", &c, &c_long);
 
     // Error: Drop impl's assertion does not apply to `B` nor `&'b _`
-    pt = Pt("pt", &c_long, &c); //~ ERROR `c` does not live long enough
-    pr = Pr("pr", &c_long, &c); //~ ERROR `c` does not live long enough
+    pt = Pt("pt", &c_long, &c);
+    pr = Pr("pr", &c_long, &c);
 
     // No error: St and Sr have no destructor.
     st = St("st", &c);
     sr = Sr("sr", &c);
 
     println!("{:?}", (dt.0, dr.0, pt.0, pr.0, st.0, sr.0));
-}
+}//~ ERROR `c` does not live long enough
+//~^ ERROR `c` does not live long enough
+//~| ERROR `c` does not live long enough
+//~| ERROR `c` does not live long enough
index 62ce3209c919d6271d615816541aa5631794432e..43d5294c93a05e2901248b3f2c04a4f8dad8039c 100644 (file)
@@ -1,10 +1,10 @@
 error[E0597]: `c` does not live long enough
   --> $DIR/dropck-eyepatch-extern-crate.rs:55:1
    |
-39 |     dt = Dt("dt", &c); //~ ERROR `c` does not live long enough
+39 |     dt = Dt("dt", &c);
    |                    - borrow occurs here
 ...
-55 | }
+55 | }//~ ERROR `c` does not live long enough
    | ^ `c` dropped here while still borrowed
    |
    = note: values in a scope are dropped in the opposite order they are created
@@ -12,10 +12,10 @@ error[E0597]: `c` does not live long enough
 error[E0597]: `c` does not live long enough
   --> $DIR/dropck-eyepatch-extern-crate.rs:55:1
    |
-40 |     dr = Dr("dr", &c); //~ ERROR `c` does not live long enough
+40 |     dr = Dr("dr", &c);
    |                    - borrow occurs here
 ...
-55 | }
+55 | }//~ ERROR `c` does not live long enough
    | ^ `c` dropped here while still borrowed
    |
    = note: values in a scope are dropped in the opposite order they are created
@@ -23,10 +23,10 @@ error[E0597]: `c` does not live long enough
 error[E0597]: `c` does not live long enough
   --> $DIR/dropck-eyepatch-extern-crate.rs:55:1
    |
-47 |     pt = Pt("pt", &c_long, &c); //~ ERROR `c` does not live long enough
+47 |     pt = Pt("pt", &c_long, &c);
    |                             - borrow occurs here
 ...
-55 | }
+55 | }//~ ERROR `c` does not live long enough
    | ^ `c` dropped here while still borrowed
    |
    = note: values in a scope are dropped in the opposite order they are created
@@ -34,10 +34,10 @@ error[E0597]: `c` does not live long enough
 error[E0597]: `c` does not live long enough
   --> $DIR/dropck-eyepatch-extern-crate.rs:55:1
    |
-48 |     pr = Pr("pr", &c_long, &c); //~ ERROR `c` does not live long enough
+48 |     pr = Pr("pr", &c_long, &c);
    |                             - borrow occurs here
 ...
-55 | }
+55 | }//~ ERROR `c` does not live long enough
    | ^ `c` dropped here while still borrowed
    |
    = note: values in a scope are dropped in the opposite order they are created
index 68b0ff3b5f096f76672d3f57e439a56732f73cbc..95ee45a6117c761593113bfb16cbd5cf4d226805 100644 (file)
@@ -54,16 +54,16 @@ fn main() {
     dt = Dt("dt", &c_long);
     dr = Dr("dr", &c_long);
     // Error: destructor order imprecisely modelled
-    dt = Dt("dt", &c); //~ ERROR `c` does not live long enough
-    dr = Dr("dr", &c); //~ ERROR `c` does not live long enough
+    dt = Dt("dt", &c);
+    dr = Dr("dr", &c);
 
     // No error: Drop impl asserts .1 (A and &'a _) are not accessed
     pt = Pt("pt", &c, &c_long);
     pr = Pr("pr", &c, &c_long);
 
     // Error: Drop impl's assertion does not apply to `B` nor `&'b _`
-    pt = Pt("pt", &c_long, &c); //~ ERROR `c` does not live long enough
-    pr = Pr("pr", &c_long, &c); //~ ERROR `c` does not live long enough
+    pt = Pt("pt", &c_long, &c);
+    pr = Pr("pr", &c_long, &c);
 
     // No error: St and Sr have no destructor.
     st = St("st", &c);
@@ -71,3 +71,7 @@ fn main() {
 
     println!("{:?}", (dt.0, dr.0, pt.0, pr.0, st.0, sr.0));
 }
+//~^ ERROR `c` does not live long enough
+//~| ERROR `c` does not live long enough
+//~| ERROR `c` does not live long enough
+//~| ERROR `c` does not live long enough
index d94808bbcb6d0eafd6c8f7c3916fd20246a93462..1ca456c7ba38b5578152ee7afbb057d0a1430fff 100644 (file)
@@ -1,7 +1,7 @@
 error[E0597]: `c` does not live long enough
   --> $DIR/dropck-eyepatch-reorder.rs:73:1
    |
-57 |     dt = Dt("dt", &c); //~ ERROR `c` does not live long enough
+57 |     dt = Dt("dt", &c);
    |                    - borrow occurs here
 ...
 73 | }
@@ -12,7 +12,7 @@ error[E0597]: `c` does not live long enough
 error[E0597]: `c` does not live long enough
   --> $DIR/dropck-eyepatch-reorder.rs:73:1
    |
-58 |     dr = Dr("dr", &c); //~ ERROR `c` does not live long enough
+58 |     dr = Dr("dr", &c);
    |                    - borrow occurs here
 ...
 73 | }
@@ -23,7 +23,7 @@ error[E0597]: `c` does not live long enough
 error[E0597]: `c` does not live long enough
   --> $DIR/dropck-eyepatch-reorder.rs:73:1
    |
-65 |     pt = Pt("pt", &c_long, &c); //~ ERROR `c` does not live long enough
+65 |     pt = Pt("pt", &c_long, &c);
    |                             - borrow occurs here
 ...
 73 | }
@@ -34,7 +34,7 @@ error[E0597]: `c` does not live long enough
 error[E0597]: `c` does not live long enough
   --> $DIR/dropck-eyepatch-reorder.rs:73:1
    |
-66 |     pr = Pr("pr", &c_long, &c); //~ ERROR `c` does not live long enough
+66 |     pr = Pr("pr", &c_long, &c);
    |                             - borrow occurs here
 ...
 73 | }
index e442fade1973025d25f2d82ce9085e5b41dcf978..de94954e9218b3b7d82733e9b3201b205e08aa30 100644 (file)
@@ -77,16 +77,16 @@ fn main() {
     dt = Dt("dt", &c_long);
     dr = Dr("dr", &c_long);
     // Error: destructor order imprecisely modelled
-    dt = Dt("dt", &c); //~ ERROR `c` does not live long enough
-    dr = Dr("dr", &c); //~ ERROR `c` does not live long enough
+    dt = Dt("dt", &c);
+    dr = Dr("dr", &c);
 
     // No error: Drop impl asserts .1 (A and &'a _) are not accessed
     pt = Pt("pt", &c, &c_long);
     pr = Pr("pr", &c, &c_long);
 
     // Error: Drop impl's assertion does not apply to `B` nor `&'b _`
-    pt = Pt("pt", &c_long, &c); //~ ERROR `c` does not live long enough
-    pr = Pr("pr", &c_long, &c); //~ ERROR `c` does not live long enough
+    pt = Pt("pt", &c_long, &c);
+    pr = Pr("pr", &c_long, &c);
 
     // No error: St and Sr have no destructor.
     st = St("st", &c);
@@ -94,3 +94,7 @@ fn main() {
 
     println!("{:?}", (dt.0, dr.0, pt.0, pr.0, st.0, sr.0));
 }
+//~^ ERROR `c` does not live long enough
+//~| ERROR `c` does not live long enough
+//~| ERROR `c` does not live long enough
+//~| ERROR `c` does not live long enough
index 811eee0e85f15cb56515fc02ddc6d337cb2a053b..d41ff3741197652fb8049e52328e80b1c9b71e5b 100644 (file)
@@ -1,7 +1,7 @@
 error[E0597]: `c` does not live long enough
   --> $DIR/dropck-eyepatch.rs:96:1
    |
-80 |     dt = Dt("dt", &c); //~ ERROR `c` does not live long enough
+80 |     dt = Dt("dt", &c);
    |                    - borrow occurs here
 ...
 96 | }
@@ -12,7 +12,7 @@ error[E0597]: `c` does not live long enough
 error[E0597]: `c` does not live long enough
   --> $DIR/dropck-eyepatch.rs:96:1
    |
-81 |     dr = Dr("dr", &c); //~ ERROR `c` does not live long enough
+81 |     dr = Dr("dr", &c);
    |                    - borrow occurs here
 ...
 96 | }
@@ -23,7 +23,7 @@ error[E0597]: `c` does not live long enough
 error[E0597]: `c` does not live long enough
   --> $DIR/dropck-eyepatch.rs:96:1
    |
-88 |     pt = Pt("pt", &c_long, &c); //~ ERROR `c` does not live long enough
+88 |     pt = Pt("pt", &c_long, &c);
    |                             - borrow occurs here
 ...
 96 | }
@@ -34,7 +34,7 @@ error[E0597]: `c` does not live long enough
 error[E0597]: `c` does not live long enough
   --> $DIR/dropck-eyepatch.rs:96:1
    |
-89 |     pr = Pr("pr", &c_long, &c); //~ ERROR `c` does not live long enough
+89 |     pr = Pr("pr", &c_long, &c);
    |                             - borrow occurs here
 ...
 96 | }
index f0d2630b9d0ced0f7dfabeab5a680238313aa2b5..b8b30a2841421ab972a7e6900f91c37fb3dd5ee9 100644 (file)
@@ -16,6 +16,7 @@
 
 struct Q;
 
-impl<R> External for (Q, R) {}
+impl<R> External for (Q, R) {} //~ ERROR must be used
+//~^ ERROR conflicting implementations of trait
 
-fn main() {}
\ No newline at end of file
+fn main() {}
index ff7c8a160a4a8d74b2e24de4bf2c1e6cfb7e60d7..e4f8020145c65d296d7b49d622fc59f0d601732e 100644 (file)
@@ -1,7 +1,7 @@
 error[E0119]: conflicting implementations of trait `complex_impl_support::External` for type `(Q, complex_impl_support::M<'_, '_, '_, std::boxed::Box<_>, _, _>)`:
   --> $DIR/complex-impl.rs:19:1
    |
-19 | impl<R> External for (Q, R) {}
+19 | impl<R> External for (Q, R) {} //~ ERROR must be used
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `complex_impl_support`:
@@ -11,7 +11,7 @@ error[E0119]: conflicting implementations of trait `complex_impl_support::Extern
 error[E0210]: type parameter `R` must be used as the type parameter for some local type (e.g. `MyStruct<T>`); only traits defined in the current crate can be implemented for a type parameter
   --> $DIR/complex-impl.rs:19:1
    |
-19 | impl<R> External for (Q, R) {}
+19 | impl<R> External for (Q, R) {} //~ ERROR must be used
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index ead62256a598e1ff20917b91dcc1e2a9ef8d1002..ed9033ad53d565f0314f1d714004c60226a7da02 100644 (file)
 use std::convert::{TryFrom, AsRef};
 
 struct Q;
-impl AsRef<Q> for Box<Q> {
+impl AsRef<Q> for Box<Q> { //~ ERROR conflicting implementations
     fn as_ref(&self) -> &Q {
         &**self
     }
 }
 
 struct S;
-impl From<S> for S {
+impl From<S> for S { //~ ERROR conflicting implementations
     fn from(s: S) -> S {
         s
     }
 }
 
 struct X;
-impl TryFrom<X> for X {
+impl TryFrom<X> for X { //~ ERROR conflicting implementations
     type Error = ();
     fn try_from(u: X) -> Result<X, ()> {
         Ok(u)
     }
 }
 
-fn main() {}
\ No newline at end of file
+fn main() {}
index f3e33291ef5bd36989792ecbff3a119747e442bd..21f2dd05b4d797b7ef28cbf73b0b49fd6de5b847 100644 (file)
@@ -1,7 +1,7 @@
 error[E0119]: conflicting implementations of trait `std::convert::AsRef<Q>` for type `std::boxed::Box<Q>`:
   --> $DIR/conflict-with-std.rs:17:1
    |
-17 | / impl AsRef<Q> for Box<Q> {
+17 | / impl AsRef<Q> for Box<Q> { //~ ERROR conflicting implementations
 18 | |     fn as_ref(&self) -> &Q {
 19 | |         &**self
 20 | |     }
@@ -15,7 +15,7 @@ error[E0119]: conflicting implementations of trait `std::convert::AsRef<Q>` for
 error[E0119]: conflicting implementations of trait `std::convert::From<S>` for type `S`:
   --> $DIR/conflict-with-std.rs:24:1
    |
-24 | / impl From<S> for S {
+24 | / impl From<S> for S { //~ ERROR conflicting implementations
 25 | |     fn from(s: S) -> S {
 26 | |         s
 27 | |     }
@@ -28,7 +28,7 @@ error[E0119]: conflicting implementations of trait `std::convert::From<S>` for t
 error[E0119]: conflicting implementations of trait `std::convert::TryFrom<X>` for type `X`:
   --> $DIR/conflict-with-std.rs:31:1
    |
-31 | / impl TryFrom<X> for X {
+31 | / impl TryFrom<X> for X { //~ ERROR conflicting implementations
 32 | |     type Error = ();
 33 | |     fn try_from(u: X) -> Result<X, ()> {
 34 | |         Ok(u)
index 67710af9369d14405b787f48b4bac998c5589cf0..c6d03a4cfc0a76fd98bc9cad01bfc41d321afa3f 100644 (file)
@@ -20,7 +20,7 @@
 
 struct LocalType<T>(Option<T>);
 
-impl<'a, T> LolFrom<&'a [T]> for LocalType<T> {
+impl<'a, T> LolFrom<&'a [T]> for LocalType<T> { //~ ERROR conflicting implementations of trait
     fn from(_: &'a [T]) -> LocalType<T> { LocalType(None) }
 }
 
@@ -36,4 +36,4 @@ fn convert_to(&self) -> LocalType<u8> {
     }
 }
 
-fn main() {}
\ No newline at end of file
+fn main() {}
index dcb76d71b3dc800d691ba1ee9179f70a7716af8d..9dddf193063fbbe8966a1dff62d6733d6dd0fcbb 100644 (file)
@@ -1,7 +1,7 @@
 error[E0119]: conflicting implementations of trait `a::LolFrom<&[_]>` for type `LocalType<_>`:
   --> $DIR/issue-23563.rs:23:1
    |
-23 | / impl<'a, T> LolFrom<&'a [T]> for LocalType<T> {
+23 | / impl<'a, T> LolFrom<&'a [T]> for LocalType<T> { //~ ERROR conflicting implementations of trait
 24 | |     fn from(_: &'a [T]) -> LocalType<T> { LocalType(None) }
 25 | | }
    | |_^
index c880921b65b1da38461f2c22d66a2d6779fc0832..98953153faf96fbca7034837d8a159018d99e21d 100644 (file)
@@ -12,10 +12,10 @@ pub struct GenX<S> {
     inner: S,
 }
 
-impl<S> Into<S> for GenX<S> {
+impl<S> Into<S> for GenX<S> { //~ ERROR conflicting implementations
     fn into(self) -> S {
         self.inner
     }
 }
 
-fn main() {}
\ No newline at end of file
+fn main() {}
index d03171fc10a89ba770bd9bf1fc01658feb29c55e..68d7235f6aaee63c90a97f6d50e222abe434905a 100644 (file)
@@ -1,7 +1,7 @@
 error[E0119]: conflicting implementations of trait `std::convert::Into<_>` for type `GenX<_>`:
   --> $DIR/issue-27403.rs:15:1
    |
-15 | / impl<S> Into<S> for GenX<S> {
+15 | / impl<S> Into<S> for GenX<S> { //~ ERROR conflicting implementations
 16 | |     fn into(self) -> S {
 17 | |         self.inner
 18 | |     }
index 06018286b319fdff9a94a74614c5cbc07b82fbc4..8a52464ff50a43cf3207dff1d4033848ec83d542 100644 (file)
@@ -12,6 +12,7 @@
 
 struct Foo;
 
-impl<Foo> Deref for Foo { }
+impl<Foo> Deref for Foo { } //~ ERROR must be used
+//~^ ERROR conflicting implementations
 
-fn main() {}
\ No newline at end of file
+fn main() {}
index c6c7c117a426e6f2571247c1349f7b764f5ba1c7..aac9f7ae964a4bbda5746023d4a19cc7984fe455 100644 (file)
@@ -1,7 +1,7 @@
 error[E0119]: conflicting implementations of trait `std::ops::Deref` for type `&_`:
   --> $DIR/issue-28981.rs:15:1
    |
-15 | impl<Foo> Deref for Foo { }
+15 | impl<Foo> Deref for Foo { } //~ ERROR must be used
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `core`:
@@ -11,7 +11,7 @@ error[E0119]: conflicting implementations of trait `std::ops::Deref` for type `&
 error[E0210]: type parameter `Foo` must be used as the type parameter for some local type (e.g. `MyStruct<T>`); only traits defined in the current crate can be implemented for a type parameter
   --> $DIR/issue-28981.rs:15:1
    |
-15 | impl<Foo> Deref for Foo { }
+15 | impl<Foo> Deref for Foo { } //~ ERROR must be used
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index 0d21120eac33364c83004c975ac5ca761d403fdb..933cdb3cd533d34f185cc09dedbf9ec70dab1b5f 100644 (file)
@@ -18,10 +18,10 @@ enum MyError<S: Storage> {
     StorageProblem(S::Error),
 }
 
-impl<S: Storage> From<S::Error> for MyError<S> {
+impl<S: Storage> From<S::Error> for MyError<S> { //~ ERROR conflicting implementations
     fn from(error: S::Error) -> MyError<S> {
         MyError::StorageProblem(error)
     }
 }
 
-fn main() {}
\ No newline at end of file
+fn main() {}
index 8a26597a1c2f8e8b94398e52539cb3c17d1dafdf..351c0e1bbb626bcf54768d63e19b86c529760721 100644 (file)
@@ -1,7 +1,7 @@
 error[E0119]: conflicting implementations of trait `std::convert::From<MyError<_>>` for type `MyError<_>`:
   --> $DIR/so-37347311.rs:21:1
    |
-21 | / impl<S: Storage> From<S::Error> for MyError<S> {
+21 | / impl<S: Storage> From<S::Error> for MyError<S> { //~ ERROR conflicting implementations
 22 | |     fn from(error: S::Error) -> MyError<S> {
 23 | |         MyError::StorageProblem(error)
 24 | |     }
index bb4f9dfffc754e26abf73b7a400eda238242ac59..3f13fd2e4913ab7385020320eb96245a7c8d46a1 100644 (file)
@@ -15,6 +15,6 @@ fn main() {
     // `Cell` is not `Sync`, so `&Cell` is neither `Sync` nor `Send`,
     // `std::fmt::Arguments` used to forget this...
     let c = std::cell::Cell::new(42);
-    send(format_args!("{:?}", c));
-    sync(format_args!("{:?}", c));
+    send(format_args!("{:?}", c)); //~ ERROR Sync` is not satisfied
+    sync(format_args!("{:?}", c)); //~ ERROR Sync` is not satisfied
 }
index 1ec53d220e963c0f436fb97e638285051ec0958a..9e0e563c35f6581c0e35b82307e86467cb2c3876 100644 (file)
@@ -1,7 +1,7 @@
 error[E0277]: the trait bound `*mut std::ops::Fn() + 'static: std::marker::Sync` is not satisfied in `[std::fmt::ArgumentV1<'_>]`
   --> $DIR/send-sync.rs:18:5
    |
-18 |     send(format_args!("{:?}", c));
+18 |     send(format_args!("{:?}", c)); //~ ERROR Sync` is not satisfied
    |     ^^^^ `*mut std::ops::Fn() + 'static` cannot be shared between threads safely
    |
    = help: within `[std::fmt::ArgumentV1<'_>]`, the trait `std::marker::Sync` is not implemented for `*mut std::ops::Fn() + 'static`
@@ -17,7 +17,7 @@ error[E0277]: the trait bound `*mut std::ops::Fn() + 'static: std::marker::Sync`
 error[E0277]: the trait bound `*mut std::ops::Fn() + 'static: std::marker::Sync` is not satisfied in `std::fmt::Arguments<'_>`
   --> $DIR/send-sync.rs:19:5
    |
-19 |     sync(format_args!("{:?}", c));
+19 |     sync(format_args!("{:?}", c)); //~ ERROR Sync` is not satisfied
    |     ^^^^ `*mut std::ops::Fn() + 'static` cannot be shared between threads safely
    |
    = help: within `std::fmt::Arguments<'_>`, the trait `std::marker::Sync` is not implemented for `*mut std::ops::Fn() + 'static`
index 87edbb22baae1661d998d2891d6ab9c6ebf2a725..299106bd552f2e37ae87354389ce745aeae718a7 100644 (file)
@@ -21,8 +21,8 @@ fn foo(x: &i32) {
     let mut b = move || {
         yield();
         let b = 5;
-        a = &b; //~ ERROR
-    };
+        a = &b;
+    }; //~ ERROR
 }
 
 fn main() { }
index e30d28c2db83bcc7d40b346edb73084fb952a663..7310e54925ff89b435acc6c48a8f291c145c9568 100644 (file)
@@ -1,9 +1,9 @@
 error[E0597]: `b` does not live long enough
   --> $DIR/ref-escapes-but-not-over-yield.rs:25:5
    |
-24 |         a = &b; //~ ERROR
+24 |         a = &b;
    |              - borrow occurs here
-25 |     };
+25 |     }; //~ ERROR
    |     ^ `b` dropped here while still borrowed
 26 | }
    | - borrowed value needs to live until here
index d21c86e88681e156a293fcffbcbdb00db9b119a2..504f3e8739f240d4b7a23caa86633fec6fc9bc8c 100644 (file)
@@ -19,7 +19,7 @@ fn borrow_local_inline() {
     // (This error occurs because the region shows up in the type of
     // `b` and gets extended by region inference.)
     let mut b = move || {
-        let a = &3; //~ ERROR
+        let a = &3;
         yield();
         println!("{}", a);
     };
index 96db53ad2e46e593fbc7d19b16c5e8cc1fd88803..36df4f0eb4d46f7cc25792807680fa6c622dd3cc 100644 (file)
@@ -32,7 +32,7 @@ fn sum_to(n: u32) -> impl Foo {
         0
     } else {
         n + sum_to(n - 1)
-        //~^ ERROR no implementation for `u32 + impl Foo`
+        //~^ ERROR the trait bound `u32: std::ops::Add<impl Foo>` is not satisfied
     }
 }
 
index 0bb944edb9d84899848885a493a2d6a822a39982..9120cdab598617103057221b84495c6ecaff3e62 100644 (file)
@@ -30,5 +30,4 @@ fn main() {
     f1.foo(1usize);
     //~^ error: method named `foo` found for type `Bar` in the current scope
     //~| help: items from traits can only be used if the trait is implemented and in scope
-    //~| help: candidate #1: `Foo`
 }
index 390b8f07b2fbd97436e3ea304c5adb5ede0c4f21..15ddadf4c513d8c41201dee8a4453719ee2cfd0d 100644 (file)
@@ -18,8 +18,5 @@ fn foo<F>(f: F) where F: FnMut(Foo) {}
 fn main() {
     foo(|s| s.is_empty());
     //~^ ERROR no method named `is_empty` found
-    //~^^ HELP #1: `std::iter::ExactSizeIterator`
-    //~^^^ HELP #2: `core::slice::SliceExt`
-    //~^^^^ HELP #3: `core::str::StrExt`
-    //~^^^^^ HELP items from traits can only be used if the trait is implemented and in scope; the following traits define an item `is_empty`, perhaps you need to implement one of them:
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
 }
index 15891b00028dc9324a7d94477ff3332f934dcd0d..d9866772bdd37edf3555071691c7478611167dfc 100644 (file)
 // aux-build:no_method_suggested_traits.rs
 extern crate no_method_suggested_traits;
 
-struct Foo;
+struct Foo; //~ HELP perhaps add a `use` for it
+//~^ HELP perhaps add a `use` for it
+//~| HELP perhaps add a `use` for it
+//~| HELP perhaps add a `use` for it
+//~| HELP perhaps add a `use` for one of them
+//~| HELP perhaps add a `use` for one of them
 enum Bar { X }
 
 mod foo {
@@ -31,95 +36,65 @@ fn main() {
 
 
     1u32.method();
-    //~^ HELP following traits are implemented but not in scope, perhaps add a `use` for one of them
-    //~| ERROR no method named
-    //~| HELP `use foo::Bar;`
-    //~| HELP `use no_method_suggested_traits::foo::PubPub;`
+    //~^ ERROR no method named
+    //~|items from traits can only be used if the trait is in scope
     std::rc::Rc::new(&mut Box::new(&1u32)).method();
-    //~^ HELP following traits are implemented but not in scope, perhaps add a `use` for one of them
-    //~| ERROR no method named
-    //~| HELP `use foo::Bar;`
-    //~| HELP `use no_method_suggested_traits::foo::PubPub;`
+    //~^items from traits can only be used if the trait is in scope
+    //~| ERROR no method named `method` found for type
 
     'a'.method();
     //~^ ERROR no method named
-    //~| HELP the following trait is implemented but not in scope, perhaps add a `use` for it:
-    //~| HELP `use foo::Bar;`
+    //~| HELP items from traits can only be used if the trait is in scope
     std::rc::Rc::new(&mut Box::new(&'a')).method();
     //~^ ERROR no method named
-    //~| HELP the following trait is implemented but not in scope, perhaps add a `use` for it:
-    //~| HELP `use foo::Bar;`
+    //~| HELP items from traits can only be used if the trait is in scope
 
     1i32.method();
     //~^ ERROR no method named
-    //~| HELP the following trait is implemented but not in scope, perhaps add a `use` for it:
-    //~| HELP `use no_method_suggested_traits::foo::PubPub;`
+    //~| HELP items from traits can only be used if the trait is in scope
     std::rc::Rc::new(&mut Box::new(&1i32)).method();
     //~^ ERROR no method named
-    //~| HELP the following trait is implemented but not in scope, perhaps add a `use` for it:
-    //~| HELP `use no_method_suggested_traits::foo::PubPub;`
+    //~| HELP items from traits can only be used if the trait is in scope
 
     Foo.method();
     //~^ ERROR no method named
-    //~| HELP following traits define an item `method`, perhaps you need to implement one of them
-    //~| HELP `foo::Bar`
-    //~| HELP `no_method_suggested_traits::foo::PubPub`
-    //~| HELP `no_method_suggested_traits::Reexported`
-    //~| HELP `no_method_suggested_traits::bar::PubPriv`
-    //~| HELP `no_method_suggested_traits::qux::PrivPub`
-    //~| HELP `no_method_suggested_traits::quz::PrivPriv`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     std::rc::Rc::new(&mut Box::new(&Foo)).method();
     //~^ ERROR no method named
-    //~| HELP following traits define an item `method`, perhaps you need to implement one of them
-    //~| HELP `foo::Bar`
-    //~| HELP `no_method_suggested_traits::foo::PubPub`
-    //~| HELP `no_method_suggested_traits::Reexported`
-    //~| HELP `no_method_suggested_traits::bar::PubPriv`
-    //~| HELP `no_method_suggested_traits::qux::PrivPub`
-    //~| HELP `no_method_suggested_traits::quz::PrivPriv`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
 
     1u64.method2();
     //~^ ERROR no method named
-    //~| HELP the following trait defines an item `method2`, perhaps you need to implement it
-    //~| HELP `foo::Bar`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     std::rc::Rc::new(&mut Box::new(&1u64)).method2();
     //~^ ERROR no method named
-    //~| HELP the following trait defines an item `method2`, perhaps you need to implement it
-    //~| HELP `foo::Bar`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
 
     no_method_suggested_traits::Foo.method2();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method2`, perhaps you need to implement it
-    //~| HELP `foo::Bar`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method2`, perhaps you need to implement it
-    //~| HELP `foo::Bar`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     no_method_suggested_traits::Bar::X.method2();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method2`, perhaps you need to implement it
-    //~| HELP `foo::Bar`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method2`, perhaps you need to implement it
-    //~| HELP `foo::Bar`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
 
     Foo.method3();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method3`, perhaps you need to implement it
-    //~| HELP `no_method_suggested_traits::foo::PubPub`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     std::rc::Rc::new(&mut Box::new(&Foo)).method3();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method3`, perhaps you need to implement it
-    //~| HELP `no_method_suggested_traits::foo::PubPub`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     Bar::X.method3();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method3`, perhaps you need to implement it
-    //~| HELP `no_method_suggested_traits::foo::PubPub`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
     std::rc::Rc::new(&mut Box::new(&Bar::X)).method3();
     //~^ ERROR no method named
-    //~| HELP following trait defines an item `method3`, perhaps you need to implement it
-    //~| HELP `no_method_suggested_traits::foo::PubPub`
+    //~| HELP items from traits can only be used if the trait is implemented and in scope
 
     // should have no help:
     1_usize.method3(); //~ ERROR no method named
index ce9a6fa4e053e7eb60778e16780bf18249d496e6..2d519c11b948ef9a3400affeb881a8ff7224dbcb 100644 (file)
@@ -1,7 +1,7 @@
 error[E0599]: no method named `method` found for type `u32` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:33:10
+  --> $DIR/no-method-suggested-traits.rs:38:10
    |
-33 |     1u32.method();
+38 |     1u32.method();
    |          ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
@@ -17,9 +17,9 @@ help: the following traits are implemented but not in scope, perhaps add a `use`
    |
 
 error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&u32>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:38:44
+  --> $DIR/no-method-suggested-traits.rs:41:44
    |
-38 |     std::rc::Rc::new(&mut Box::new(&1u32)).method();
+41 |     std::rc::Rc::new(&mut Box::new(&1u32)).method();
    |                                            ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
@@ -35,9 +35,9 @@ help: the following traits are implemented but not in scope, perhaps add a `use`
    |
 
 error[E0599]: no method named `method` found for type `char` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:44:9
+  --> $DIR/no-method-suggested-traits.rs:45:9
    |
-44 |     'a'.method();
+45 |     'a'.method();
    |         ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
@@ -59,9 +59,9 @@ help: the following trait is implemented but not in scope, perhaps add a `use` f
    |
 
 error[E0599]: no method named `method` found for type `i32` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:53:10
+  --> $DIR/no-method-suggested-traits.rs:52:10
    |
-53 |     1i32.method();
+52 |     1i32.method();
    |          ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
@@ -71,9 +71,9 @@ help: the following trait is implemented but not in scope, perhaps add a `use` f
    |
 
 error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&i32>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:57:44
+  --> $DIR/no-method-suggested-traits.rs:55:44
    |
-57 |     std::rc::Rc::new(&mut Box::new(&1i32)).method();
+55 |     std::rc::Rc::new(&mut Box::new(&1i32)).method();
    |                                            ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
@@ -83,12 +83,12 @@ help: the following trait is implemented but not in scope, perhaps add a `use` f
    |
 
 error[E0599]: no method named `method` found for type `Foo` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:62:9
+  --> $DIR/no-method-suggested-traits.rs:59:9
    |
-14 | struct Foo;
+14 | struct Foo; //~ HELP perhaps add a `use` for it
    | ----------- method `method` not found for this
 ...
-62 |     Foo.method();
+59 |     Foo.method();
    |         ^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -101,9 +101,9 @@ error[E0599]: no method named `method` found for type `Foo` in the current scope
            candidate #6: `no_method_suggested_traits::Reexported`
 
 error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&Foo>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:71:43
+  --> $DIR/no-method-suggested-traits.rs:62:43
    |
-71 |     std::rc::Rc::new(&mut Box::new(&Foo)).method();
+62 |     std::rc::Rc::new(&mut Box::new(&Foo)).method();
    |                                           ^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -116,9 +116,9 @@ error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::box
            candidate #6: `no_method_suggested_traits::Reexported`
 
 error[E0599]: no method named `method2` found for type `u64` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:81:10
+  --> $DIR/no-method-suggested-traits.rs:66:10
    |
-81 |     1u64.method2();
+66 |     1u64.method2();
    |          ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -126,9 +126,9 @@ error[E0599]: no method named `method2` found for type `u64` in the current scop
            candidate #1: `foo::Bar`
 
 error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::boxed::Box<&u64>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:85:44
+  --> $DIR/no-method-suggested-traits.rs:69:44
    |
-85 |     std::rc::Rc::new(&mut Box::new(&1u64)).method2();
+69 |     std::rc::Rc::new(&mut Box::new(&1u64)).method2();
    |                                            ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -136,9 +136,9 @@ error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::bo
            candidate #1: `foo::Bar`
 
 error[E0599]: no method named `method2` found for type `no_method_suggested_traits::Foo` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:90:37
+  --> $DIR/no-method-suggested-traits.rs:73:37
    |
-90 |     no_method_suggested_traits::Foo.method2();
+73 |     no_method_suggested_traits::Foo.method2();
    |                                     ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -146,9 +146,9 @@ error[E0599]: no method named `method2` found for type `no_method_suggested_trai
            candidate #1: `foo::Bar`
 
 error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:94:71
+  --> $DIR/no-method-suggested-traits.rs:76:71
    |
-94 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
+76 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
    |                                                                       ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -156,9 +156,9 @@ error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::bo
            candidate #1: `foo::Bar`
 
 error[E0599]: no method named `method2` found for type `no_method_suggested_traits::Bar` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:98:40
+  --> $DIR/no-method-suggested-traits.rs:79:40
    |
-98 |     no_method_suggested_traits::Bar::X.method2();
+79 |     no_method_suggested_traits::Bar::X.method2();
    |                                        ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
@@ -166,95 +166,95 @@ error[E0599]: no method named `method2` found for type `no_method_suggested_trai
            candidate #1: `foo::Bar`
 
 error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:102:74
-    |
-102 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
-    |                                                                          ^^^^^^^
-    |
-    = help: items from traits can only be used if the trait is implemented and in scope
-    = note: the following trait defines an item `method2`, perhaps you need to implement it:
-            candidate #1: `foo::Bar`
+  --> $DIR/no-method-suggested-traits.rs:82:74
+   |
+82 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
+   |                                                                          ^^^^^^^
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `method2`, perhaps you need to implement it:
+           candidate #1: `foo::Bar`
 
 error[E0599]: no method named `method3` found for type `Foo` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:107:9
-    |
-14  | struct Foo;
-    | ----------- method `method3` not found for this
+  --> $DIR/no-method-suggested-traits.rs:86:9
+   |
+14 | struct Foo; //~ HELP perhaps add a `use` for it
+   | ----------- method `method3` not found for this
 ...
-107 |     Foo.method3();
-    |         ^^^^^^^
-    |
-    = help: items from traits can only be used if the trait is implemented and in scope
-    = note: the following trait defines an item `method3`, perhaps you need to implement it:
-            candidate #1: `no_method_suggested_traits::foo::PubPub`
+86 |     Foo.method3();
+   |         ^^^^^^^
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `method3`, perhaps you need to implement it:
+           candidate #1: `no_method_suggested_traits::foo::PubPub`
 
 error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&Foo>>` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:111:43
-    |
-111 |     std::rc::Rc::new(&mut Box::new(&Foo)).method3();
-    |                                           ^^^^^^^
-    |
-    = help: items from traits can only be used if the trait is implemented and in scope
-    = note: the following trait defines an item `method3`, perhaps you need to implement it:
-            candidate #1: `no_method_suggested_traits::foo::PubPub`
+  --> $DIR/no-method-suggested-traits.rs:89:43
+   |
+89 |     std::rc::Rc::new(&mut Box::new(&Foo)).method3();
+   |                                           ^^^^^^^
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `method3`, perhaps you need to implement it:
+           candidate #1: `no_method_suggested_traits::foo::PubPub`
 
 error[E0599]: no method named `method3` found for type `Bar` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:115:12
-    |
-15  | enum Bar { X }
-    | -------- method `method3` not found for this
+  --> $DIR/no-method-suggested-traits.rs:92:12
+   |
+20 | enum Bar { X }
+   | -------- method `method3` not found for this
 ...
-115 |     Bar::X.method3();
-    |            ^^^^^^^
-    |
-    = help: items from traits can only be used if the trait is implemented and in scope
-    = note: the following trait defines an item `method3`, perhaps you need to implement it:
-            candidate #1: `no_method_suggested_traits::foo::PubPub`
+92 |     Bar::X.method3();
+   |            ^^^^^^^
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `method3`, perhaps you need to implement it:
+           candidate #1: `no_method_suggested_traits::foo::PubPub`
 
 error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&Bar>>` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:119:46
-    |
-119 |     std::rc::Rc::new(&mut Box::new(&Bar::X)).method3();
-    |                                              ^^^^^^^
-    |
-    = help: items from traits can only be used if the trait is implemented and in scope
-    = note: the following trait defines an item `method3`, perhaps you need to implement it:
-            candidate #1: `no_method_suggested_traits::foo::PubPub`
+  --> $DIR/no-method-suggested-traits.rs:95:46
+   |
+95 |     std::rc::Rc::new(&mut Box::new(&Bar::X)).method3();
+   |                                              ^^^^^^^
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `method3`, perhaps you need to implement it:
+           candidate #1: `no_method_suggested_traits::foo::PubPub`
 
 error[E0599]: no method named `method3` found for type `usize` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:125:13
+   --> $DIR/no-method-suggested-traits.rs:100:13
     |
-125 |     1_usize.method3(); //~ ERROR no method named
+100 |     1_usize.method3(); //~ ERROR no method named
     |             ^^^^^^^
 
 error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&usize>>` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:126:47
+   --> $DIR/no-method-suggested-traits.rs:101:47
     |
-126 |     std::rc::Rc::new(&mut Box::new(&1_usize)).method3(); //~ ERROR no method named
+101 |     std::rc::Rc::new(&mut Box::new(&1_usize)).method3(); //~ ERROR no method named
     |                                               ^^^^^^^
 
 error[E0599]: no method named `method3` found for type `no_method_suggested_traits::Foo` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:127:37
+   --> $DIR/no-method-suggested-traits.rs:102:37
     |
-127 |     no_method_suggested_traits::Foo.method3();  //~ ERROR no method named
+102 |     no_method_suggested_traits::Foo.method3();  //~ ERROR no method named
     |                                     ^^^^^^^
 
 error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:128:71
+   --> $DIR/no-method-suggested-traits.rs:103:71
     |
-128 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3();
+103 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3();
     |                                                                       ^^^^^^^
 
 error[E0599]: no method named `method3` found for type `no_method_suggested_traits::Bar` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:130:40
+   --> $DIR/no-method-suggested-traits.rs:105:40
     |
-130 |     no_method_suggested_traits::Bar::X.method3();  //~ ERROR no method named
+105 |     no_method_suggested_traits::Bar::X.method3();  //~ ERROR no method named
     |                                        ^^^^^^^
 
 error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` in the current scope
-   --> $DIR/no-method-suggested-traits.rs:131:74
+   --> $DIR/no-method-suggested-traits.rs:106:74
     |
-131 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3();
+106 |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3();
     |                                                                          ^^^^^^^
 
 error: aborting due to 24 previous errors
index 3507dcfbe172a5b261fec805fc25a5c689ccc886..7eefa5c600617f2f9e5f2ceee38c42feadcf74fb 100644 (file)
 
 impl std::fmt::Display for MyType {
    fn fmt(&self, x: &str) -> () { }
+   //~^ ERROR method `fmt` has an incompatible type
 }
 
 impl std::fmt::Display for MyType2 {
    fn fmt(&self) -> () { }
+   //~^ ERROR method `fmt` has 1 parameter
 }
 
 impl std::fmt::Display for MyType3 {
    fn fmt() -> () { }
+   //~^ ERROR method `fmt` has a `&self` declaration in the trait
 }
 
 impl std::fmt::Display for MyType4 {}
+//~^ ERROR not all trait items
 
 fn main() {}
index 9216c6e290775163b731ee3c03d9fa68ffd820a6..42e1dcdb1c42ab0400b7341a11718300c69d96e8 100644 (file)
@@ -8,25 +8,25 @@ error[E0053]: method `fmt` has an incompatible type for trait
               found type `fn(&MyType, &str)`
 
 error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2
-  --> $DIR/trait_type.rs:21:11
+  --> $DIR/trait_type.rs:22:11
    |
-21 |    fn fmt(&self) -> () { }
+22 |    fn fmt(&self) -> () { }
    |           ^^^^^ expected 2 parameters, found 1
    |
    = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
 
 error[E0186]: method `fmt` has a `&self` declaration in the trait, but not in the impl
-  --> $DIR/trait_type.rs:25:4
+  --> $DIR/trait_type.rs:27:4
    |
-25 |    fn fmt() -> () { }
+27 |    fn fmt() -> () { }
    |    ^^^^^^^^^^^^^^^^^^ expected `&self` in impl
    |
    = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
 
 error[E0046]: not all trait items implemented, missing: `fmt`
-  --> $DIR/trait_type.rs:28:1
+  --> $DIR/trait_type.rs:31:1
    |
-28 | impl std::fmt::Display for MyType4 {}
+31 | impl std::fmt::Display for MyType4 {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
    |
    = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
index af7adc4c657d9f2478f6b64360959a8522e5e568..00fc22ff0d853b2c867f9a27f8ed5cf2eb4300d7 100644 (file)
@@ -13,7 +13,7 @@
 use std::fmt::Debug;
 
 fn foo(x: impl Debug) -> String {
-    x
+    x //~ ERROR mismatched types
 }
 
 fn main() { }
index 2be245844976804dc7e4d2e18e395a6e1475c9e2..b4dd6c8446c599e03804c4983e725ccae7f2d9f0 100644 (file)
@@ -3,7 +3,7 @@ error[E0308]: mismatched types
    |
 15 | fn foo(x: impl Debug) -> String {
    |                          ------ expected `std::string::String` because of return type
-16 |     x
+16 |     x //~ ERROR mismatched types
    |     ^ expected struct `std::string::String`, found type parameter
    |
    = note: expected type `std::string::String`
index f8855a7975550eae8dbcecbb78f73f3c746e64f4..9a4847b56062a5b78c4f10a84050ef22985285ed 100644 (file)
@@ -14,7 +14,7 @@
 
 fn foo(x: impl Debug, y: impl Debug) -> String {
     let mut a = x;
-    a = y;
+    a = y; //~ ERROR mismatched
     format!("{:?}", a)
 }
 
index c663d38ca8a484d98782380d672f1a818d0badd8..9903e26bbbd0b0267a4f2b6e88302eacfe7f467f 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/universal-two-impl-traits.rs:17:9
    |
-17 |     a = y;
+17 |     a = y; //~ ERROR mismatched
    |         ^ expected type parameter, found a different type parameter
    |
    = note: expected type `impl Debug` (type parameter)
index fd35d04b25861f700c826e135e4fcf48a123b25e..36d9f615c5f57d5f55d7e810995b87f6db480759 100644 (file)
 fn foo(f: impl Display + Clone) -> String {
     wants_debug(f);
     wants_display(f);
-    wants_clone(f);
+    wants_clone(f); //~ ERROR cannot find
 }
 
-fn wants_debug(g: impl Debug) { }
-fn wants_display(g: impl Debug) { }
+fn wants_debug(g: impl Debug) { } //~ ERROR cannot find
+fn wants_display(g: impl Debug) { } //~ ERROR cannot find
 fn wants_cone(g: impl Clone) { }
 
 fn main() {
index 600064c71dcc6a7fcf1d39135bceaef5af24a523..b457e025c29ff96238497ab78ff950d91657d25e 100644 (file)
@@ -1,13 +1,13 @@
 error[E0425]: cannot find function `wants_clone` in this scope
   --> $DIR/universal_wrong_bounds.rs:18:5
    |
-18 |     wants_clone(f);
+18 |     wants_clone(f); //~ ERROR cannot find
    |     ^^^^^^^^^^^ did you mean `wants_cone`?
 
 error[E0405]: cannot find trait `Debug` in this scope
   --> $DIR/universal_wrong_bounds.rs:21:24
    |
-21 | fn wants_debug(g: impl Debug) { }
+21 | fn wants_debug(g: impl Debug) { } //~ ERROR cannot find
    |                        ^^^^^ not found in this scope
 help: possible candidate is found in another module, you can import it into scope
    |
@@ -17,7 +17,7 @@ help: possible candidate is found in another module, you can import it into scop
 error[E0405]: cannot find trait `Debug` in this scope
   --> $DIR/universal_wrong_bounds.rs:22:26
    |
-22 | fn wants_display(g: impl Debug) { }
+22 | fn wants_display(g: impl Debug) { } //~ ERROR cannot find
    |                          ^^^^^ not found in this scope
 help: possible candidate is found in another module, you can import it into scope
    |
index 57b355cbb6a3174338945684624af331522f8a60..4eddebb15e120b173e5cab69692205e8941a7e47 100644 (file)
 #![allow(warnings)]
 #![feature(in_band_lifetimes)]
 
-fn foo(x: fn(&'a u32)) {}
+fn foo(x: fn(&'a u32)) {} //~ ERROR must be explicitly
 
-fn bar(x: &Fn(&'a u32)) {}
+fn bar(x: &Fn(&'a u32)) {} //~ ERROR must be explicitly
 
-fn baz(x: fn(&'a u32), y: &'a u32) {}
+fn baz(x: fn(&'a u32), y: &'a u32) {} //~ ERROR must be explicitly
 
 struct Foo<'a> { x: &'a u32 }
 
 impl Foo<'a> {
-    fn bar(&self, x: fn(&'a u32)) {}
+    fn bar(&self, x: fn(&'a u32)) {} //~ ERROR must be explicitly
 }
 
 fn main() {}
index 14b513fc52aa2ab21105ed05cb650f8c15aa6f23..42714f21685f9fa6c85b3a08e2f04c6e3a3e0992 100644 (file)
@@ -1,25 +1,25 @@
 error[E0687]: lifetimes used in `fn` or `Fn` syntax must be explicitly declared using `<...>` binders
   --> $DIR/E0687.rs:14:15
    |
-14 | fn foo(x: fn(&'a u32)) {}
+14 | fn foo(x: fn(&'a u32)) {} //~ ERROR must be explicitly
    |               ^^ in-band lifetime definition
 
 error[E0687]: lifetimes used in `fn` or `Fn` syntax must be explicitly declared using `<...>` binders
   --> $DIR/E0687.rs:16:16
    |
-16 | fn bar(x: &Fn(&'a u32)) {}
+16 | fn bar(x: &Fn(&'a u32)) {} //~ ERROR must be explicitly
    |                ^^ in-band lifetime definition
 
 error[E0687]: lifetimes used in `fn` or `Fn` syntax must be explicitly declared using `<...>` binders
   --> $DIR/E0687.rs:18:15
    |
-18 | fn baz(x: fn(&'a u32), y: &'a u32) {}
+18 | fn baz(x: fn(&'a u32), y: &'a u32) {} //~ ERROR must be explicitly
    |               ^^ in-band lifetime definition
 
 error[E0687]: lifetimes used in `fn` or `Fn` syntax must be explicitly declared using `<...>` binders
   --> $DIR/E0687.rs:23:26
    |
-23 |     fn bar(&self, x: fn(&'a u32)) {}
+23 |     fn bar(&self, x: fn(&'a u32)) {} //~ ERROR must be explicitly
    |                          ^^ in-band lifetime definition
 
 error: aborting due to 4 previous errors
index 6f04720dd4ace59694451f48c8628c65ef772988..ac67558772007105b4391b622805c7b250b4626a 100644 (file)
@@ -11,8 +11,8 @@
 #![allow(warnings)]
 #![feature(in_band_lifetimes, universal_impl_trait)]
 
-fn bar<F>(x: &F) where F: Fn(&'a u32) {}
+fn bar<F>(x: &F) where F: Fn(&'a u32) {} //~ ERROR must be explicitly
 
-fn baz(x: &impl Fn(&'a u32)) {}
+fn baz(x: &impl Fn(&'a u32)) {} //~ ERROR must be explicitly
 
 fn main() {}
index db50076fe7c01539857a2075f42e81f701e571be..a9913f6b644649727c6086d20595724372768de2 100644 (file)
@@ -1,13 +1,13 @@
 error[E0687]: lifetimes used in `fn` or `Fn` syntax must be explicitly declared using `<...>` binders
   --> $DIR/E0687_where.rs:14:31
    |
-14 | fn bar<F>(x: &F) where F: Fn(&'a u32) {}
+14 | fn bar<F>(x: &F) where F: Fn(&'a u32) {} //~ ERROR must be explicitly
    |                               ^^ in-band lifetime definition
 
 error[E0687]: lifetimes used in `fn` or `Fn` syntax must be explicitly declared using `<...>` binders
   --> $DIR/E0687_where.rs:16:21
    |
-16 | fn baz(x: &impl Fn(&'a u32)) {}
+16 | fn baz(x: &impl Fn(&'a u32)) {} //~ ERROR must be explicitly
    |                     ^^ in-band lifetime definition
 
 error: aborting due to 2 previous errors
index e6fe4e138e4746bf49b5f4cc752170cc517f2581..29b954e9a83602017e1092bccd57aa834ace0da0 100644 (file)
 #![allow(warnings)]
 #![feature(in_band_lifetimes)]
 
-fn foo<'a>(x: &'a u32, y: &'b u32) {}
+fn foo<'a>(x: &'a u32, y: &'b u32) {} //~ ERROR cannot mix
 
 struct Foo<'a> { x: &'a u32 }
 
 impl Foo<'a> {
-    fn bar<'b>(x: &'a u32, y: &'b u32, z: &'c u32) {}
+    fn bar<'b>(x: &'a u32, y: &'b u32, z: &'c u32) {} //~ ERROR cannot mix
 }
 
-impl<'b> Foo<'a> {
+impl<'b> Foo<'a> { //~ ERROR cannot mix
     fn baz() {}
 }
 
index 1289e7fd01039b3b8aecde94296012e194d1974c..c33b088f0faab802d0aeed831d1d44eff2b231bd 100644 (file)
@@ -1,7 +1,7 @@
 error[E0688]: cannot mix in-band and explicit lifetime definitions
   --> $DIR/E0688.rs:14:28
    |
-14 | fn foo<'a>(x: &'a u32, y: &'b u32) {}
+14 | fn foo<'a>(x: &'a u32, y: &'b u32) {} //~ ERROR cannot mix
    |        --                  ^^ in-band lifetime definition here
    |        |
    |        explicit lifetime definition here
@@ -9,7 +9,7 @@ error[E0688]: cannot mix in-band and explicit lifetime definitions
 error[E0688]: cannot mix in-band and explicit lifetime definitions
   --> $DIR/E0688.rs:19:44
    |
-19 |     fn bar<'b>(x: &'a u32, y: &'b u32, z: &'c u32) {}
+19 |     fn bar<'b>(x: &'a u32, y: &'b u32, z: &'c u32) {} //~ ERROR cannot mix
    |            --                              ^^ in-band lifetime definition here
    |            |
    |            explicit lifetime definition here
@@ -17,7 +17,7 @@ error[E0688]: cannot mix in-band and explicit lifetime definitions
 error[E0688]: cannot mix in-band and explicit lifetime definitions
   --> $DIR/E0688.rs:22:14
    |
-22 | impl<'b> Foo<'a> {
+22 | impl<'b> Foo<'a> { //~ ERROR cannot mix
    |      --      ^^ in-band lifetime definition here
    |      |
    |      explicit lifetime definition here
index 6b0a3fedfc5cc946897dc744eb49dbf8cb4ca5f8..80bc56c0f441c083f9da406c500013bc52b1751e 100644 (file)
@@ -11,8 +11,8 @@
 #![allow(warnings)]
 #![feature(in_band_lifetimes)]
 
-fn foo(x: &'a u32, y: &u32) -> &'a u32 { y }
+fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
 
-fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y }
+fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
 
 fn main() {}
index bbc25869f46c06045231719ba7104a6ebd8482dd..0c1231e01de6ebfbf8639f08fec6acad699ad000 100644 (file)
@@ -1,7 +1,7 @@
 error[E0621]: explicit lifetime required in the type of `y`
   --> $DIR/mismatched.rs:14:42
    |
-14 | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y }
+14 | 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`
@@ -9,7 +9,7 @@ error[E0621]: explicit lifetime required in the type of `y`
 error[E0623]: lifetime mismatch
   --> $DIR/mismatched.rs:16:46
    |
-16 | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y }
+16 | 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...
index 2e31677040425d217cb4b5c9c684270f4b12fb2b..bc175803ebda7dcb3e1eeb464d0221924b4fc7c1 100644 (file)
@@ -13,7 +13,7 @@
 
 trait Get {
     fn baz(&self, x: &'a u32, y: &u32) -> &'a u32 {
-        y
+        y //~ ERROR explicit lifetime required
     }
 }
 
index 315e881bf0738f47d46b25f5c87132ef019dfcad..58ff1694fb74c7914efb2e3435c3bec2e9841001 100644 (file)
@@ -3,7 +3,7 @@ error[E0621]: explicit lifetime required in the type of `y`
    |
 15 |     fn baz(&self, x: &'a u32, y: &u32) -> &'a u32 {
    |                               - consider changing the type of `y` to `&'a u32`
-16 |         y
+16 |         y //~ ERROR explicit lifetime required
    |         ^ lifetime `'a` required
 
 error: aborting due to previous error
index 1be32e5c51e717bf7f63c3520bfcf06c682f4af7..52641059b1fa85256513b19260950c46306099c0 100644 (file)
@@ -16,7 +16,7 @@ trait Get {
 }
 
 impl Get for i32 {
-    fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
+    fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { //~ ERROR cannot infer
         x
     }
 }
index d1f3ae450f8b0ab8af0dadc960f864b083e0d733..e96f7181a6daeb80aa2d6774227e74fb786f013d 100644 (file)
@@ -1,7 +1,7 @@
 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter 'a in generic type due to conflicting requirements
   --> $DIR/mismatched_trait_impl.rs:19:5
    |
-19 | /     fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
+19 | /     fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { //~ ERROR cannot infer
 20 | |         x
 21 | |     }
    | |_____^
@@ -9,28 +9,28 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter 'a in
 note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 19:5...
   --> $DIR/mismatched_trait_impl.rs:19:5
    |
-19 | /     fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
+19 | /     fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { //~ ERROR cannot infer
 20 | |         x
 21 | |     }
    | |_____^
 note: ...so that method type is compatible with trait (expected fn(&i32, &'a u32, &u32) -> &'a u32, found fn(&i32, &u32, &u32) -> &u32)
   --> $DIR/mismatched_trait_impl.rs:19:5
    |
-19 | /     fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
+19 | /     fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { //~ ERROR cannot infer
 20 | |         x
 21 | |     }
    | |_____^
 note: but, the lifetime must be valid for the lifetime 'a as defined on the method body at 19:5...
   --> $DIR/mismatched_trait_impl.rs:19:5
    |
-19 | /     fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
+19 | /     fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { //~ ERROR cannot infer
 20 | |         x
 21 | |     }
    | |_____^
 note: ...so that method type is compatible with trait (expected fn(&i32, &'a u32, &u32) -> &'a u32, found fn(&i32, &u32, &u32) -> &u32)
   --> $DIR/mismatched_trait_impl.rs:19:5
    |
-19 | /     fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
+19 | /     fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 { //~ ERROR cannot infer
 20 | |         x
 21 | |     }
    | |_____^
index fabf531968a4c031da4e979e75b6476e64c38a5e..08ce13d0bccd12f31c12958af791273a5702c0a0 100644 (file)
@@ -16,6 +16,6 @@ fn foo(x: &'a u32) -> &'a u32 { x }
 fn main() {
     let mut p = 3;
     let r = foo(&p);
-    p += 1;
+    p += 1; //~ ERROR cannot assign to `p` because it is borrowed
     println!("{}", r);
 }
index 4800e39269f0a5756b7e3f3305e3584beddfdd32..14f9098c6c2f693345e539de268d9394fb08f499 100644 (file)
@@ -3,7 +3,7 @@ error[E0506]: cannot assign to `p` because it is borrowed
    |
 18 |     let r = foo(&p);
    |                  - borrow of `p` occurs here
-19 |     p += 1;
+19 |     p += 1; //~ ERROR cannot assign to `p` because it is borrowed
    |     ^^^^^^ assignment to borrowed `p` occurs here
 
 error: aborting due to previous error
index b421e16092c2b48bdebc3824736fa8ed76a4074a..0d3e6ba644e632c7166038c795b923174a2df9f5 100644 (file)
 #![feature(in_band_lifetimes)]
 
 struct Foo {
-    x: &'test u32,
+    x: &'test u32, //~ ERROR undeclared lifetime
 }
 
 enum Bar {
-    Baz(&'test u32),
+    Baz(&'test u32), //~ ERROR undeclared lifetime
 }
 
 fn main() {}
index 7ffbfbd89b672531bf94a22e7248221828d5191a..a8df6dbca0a11a8df15fb662ced05e298c44ffcd 100644 (file)
@@ -1,13 +1,13 @@
 error[E0261]: use of undeclared lifetime name `'test`
   --> $DIR/no_in_band_in_struct.rs:15:9
    |
-15 |     x: &'test u32,
+15 |     x: &'test u32, //~ ERROR undeclared lifetime
    |         ^^^^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'test`
   --> $DIR/no_in_band_in_struct.rs:19:10
    |
-19 |     Baz(&'test u32),
+19 |     Baz(&'test u32), //~ ERROR undeclared lifetime
    |          ^^^^^ undeclared lifetime
 
 error: aborting due to 2 previous errors
index a7c9d4ece9569e3c584a7295e42494cde3f376d6..eaa082a35da59ffc89f764fd7a07ac22c6cc7b60 100644 (file)
 #![feature(in_band_lifetimes)]
 
 fn foo(x: &u32) {
-    let y: &'test u32 = x;
+    let y: &'test u32 = x; //~ ERROR use of undeclared lifetime
 }
 
 fn foo2(x: &u32) {}
 fn bar() {
-    let y: fn(&'test u32) = foo2;
+    let y: fn(&'test u32) = foo2; //~ ERROR use of undeclared lifetime
 }
 
 fn main() {}
index a0c2e8199694a045f752e8f61bb4ac60308eb4d6..e2340dbba23e19bf0dcfe8a66b00864d30237cf8 100644 (file)
@@ -1,13 +1,13 @@
 error[E0261]: use of undeclared lifetime name `'test`
   --> $DIR/no_introducing_in_band_in_locals.rs:15:13
    |
-15 |     let y: &'test u32 = x;
+15 |     let y: &'test u32 = x; //~ ERROR use of undeclared lifetime
    |             ^^^^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'test`
   --> $DIR/no_introducing_in_band_in_locals.rs:20:16
    |
-20 |     let y: fn(&'test u32) = foo2;
+20 |     let y: fn(&'test u32) = foo2; //~ ERROR use of undeclared lifetime
    |                ^^^^^ undeclared lifetime
 
 error: aborting due to 2 previous errors
index a9053d09f6c60499e94527d31acc86ec485117f5..b6438f01af5f351ca4135562873b6f66545329d4 100644 (file)
@@ -14,8 +14,8 @@
 struct Foo<T>(T);
 
 impl Foo<&'s u8> {
-    fn bar<'s>(&self, x: &'s u8) {}
-    fn baz(x: for<'s> fn(&'s u32)) {}
+    fn bar<'s>(&self, x: &'s u8) {} //~ ERROR shadows a lifetime name
+    fn baz(x: for<'s> fn(&'s u32)) {} //~ ERROR shadows a lifetime name
 }
 
 fn main() {}
index f05b76fbea4c564471a9e2778401de43e3de1985..49b82fa495a056389b5b38176f1b7061e1842484 100644 (file)
@@ -3,7 +3,7 @@ error[E0496]: lifetime name `'s` shadows a lifetime name that is already in scop
    |
 16 | impl Foo<&'s u8> {
    |           -- first declared here
-17 |     fn bar<'s>(&self, x: &'s u8) {}
+17 |     fn bar<'s>(&self, x: &'s u8) {} //~ ERROR shadows a lifetime name
    |            ^^ lifetime 's already in scope
 
 error[E0496]: lifetime name `'s` shadows a lifetime name that is already in scope
@@ -11,8 +11,8 @@ error[E0496]: lifetime name `'s` shadows a lifetime name that is already in scop
    |
 16 | impl Foo<&'s u8> {
    |           -- first declared here
-17 |     fn bar<'s>(&self, x: &'s u8) {}
-18 |     fn baz(x: for<'s> fn(&'s u32)) {}
+17 |     fn bar<'s>(&self, x: &'s u8) {} //~ ERROR shadows a lifetime name
+18 |     fn baz(x: for<'s> fn(&'s u32)) {} //~ ERROR shadows a lifetime name
    |                   ^^ lifetime 's already in scope
 
 error: aborting due to 2 previous errors
index 60d85d1b3b787c3144beba792858bc10c1f8f2b2..a772d1f90cc0b5050ad4f4bab5c6bb2cad20695f 100644 (file)
@@ -12,5 +12,5 @@
 use std::panic::catch_unwind;
 fn main() {
     let mut x = Cell::new(22);
-    catch_unwind(|| { x.set(23); });
+    catch_unwind(|| { x.set(23); }); //~ ERROR the trait bound
 }
index 76362f1f494a6bb8b96a0e230869f72d6d5e501d..f4beb44b82dc7408c6db36891f8467063e2bb68d 100644 (file)
@@ -1,7 +1,7 @@
 error[E0277]: the trait bound `std::cell::UnsafeCell<i32>: std::panic::RefUnwindSafe` is not satisfied in `std::cell::Cell<i32>`
   --> $DIR/interior-mutability.rs:15:5
    |
-15 |     catch_unwind(|| { x.set(23); });
+15 |     catch_unwind(|| { x.set(23); }); //~ ERROR the trait bound
    |     ^^^^^^^^^^^^ the type std::cell::UnsafeCell<i32> may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
    |
    = help: within `std::cell::Cell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<i32>`
index 863780439127642bce9520c075fe565469d6f555..c44465b221cdc79c9b845a63eb87d804e48e7252 100644 (file)
 
 fn main() {
     if true {
-    } else if {
+    } else if { //~ ERROR missing condition
     } else {
     }
 }
 
 fn foo() {
     if true {
-    } else if {
+    } else if { //~ ERROR missing condition
     }
     bar();
 }
index 3446969dfd21311b504756e2628f1297f96b345a..344e179695369eceb41dc63152848fd8d805e454 100644 (file)
@@ -1,13 +1,13 @@
 error: missing condition for `if` statemement
   --> $DIR/issue-13483.rs:13:14
    |
-13 |     } else if {
+13 |     } else if { //~ ERROR missing condition
    |              ^ expected if condition here
 
 error: missing condition for `if` statemement
   --> $DIR/issue-13483.rs:20:14
    |
-20 |     } else if {
+20 |     } else if { //~ ERROR missing condition
    |              ^ expected if condition here
 
 error: aborting due to 2 previous errors
index c8e0cd1763ffa14acd62c441eb3d56ac850f9524..f787e43dbdf5758688a781a1b980d980496641c0 100644 (file)
@@ -13,17 +13,19 @@ fn main() {
     let long_name : usize = 0;
 
     println!("{}", a as usize > long_name);
-    println!("{}", a as usize < long_name);
+    println!("{}", a as usize < long_name); //~ ERROR `<` is interpreted as a start of generic
     println!("{}{}", a as usize < long_name, long_name);
-    println!("{}", a as usize < 4);
+    //~^ ERROR `<` is interpreted as a start of generic
+    println!("{}", a as usize < 4); //~ ERROR `<` is interpreted as a start of generic
     println!("{}", a: usize > long_name);
     println!("{}{}", a: usize < long_name, long_name);
-    println!("{}", a: usize < 4);
+    //~^ ERROR `<` is interpreted as a start of generic
+    println!("{}", a: usize < 4); //~ ERROR `<` is interpreted as a start of generic
 
     println!("{}", a
                    as
                    usize
-                   <
+                   < //~ ERROR `<` is interpreted as a start of generic
                    4);
     println!("{}", a
 
@@ -32,10 +34,10 @@ fn main() {
 
 
                    usize
-                   <
+                   < //~ ERROR `<` is interpreted as a start of generic
                    5);
 
-    println!("{}", a as usize << long_name);
+    println!("{}", a as usize << long_name); //~ ERROR `<` is interpreted as a start of generic
 
-    println!("{}", a: &mut 4);
+    println!("{}", a: &mut 4); //~ ERROR expected type, found `4`
 }
index 5777c24ae88899118615a165c6ad797de2180682..91107fbe35610acd72887fc8e64b92f0f5b7ebef 100644 (file)
@@ -1,7 +1,7 @@
 error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
   --> $DIR/issue-22644.rs:16:31
    |
-16 |     println!("{}", a as usize < long_name);
+16 |     println!("{}", a as usize < long_name); //~ ERROR `<` is interpreted as a start of generic
    |                    ---------- ^ --------- interpreted as generic arguments
    |                    |          |
    |                    |          not interpreted as comparison
@@ -17,75 +17,75 @@ error: `<` is interpreted as a start of generic arguments for `usize`, not a com
    |                      help: try comparing the casted value: `(a as usize)`
 
 error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
-  --> $DIR/issue-22644.rs:18:31
+  --> $DIR/issue-22644.rs:19:31
    |
-18 |     println!("{}", a as usize < 4);
+19 |     println!("{}", a as usize < 4); //~ ERROR `<` is interpreted as a start of generic
    |                    ---------- ^ - interpreted as generic arguments
    |                    |          |
    |                    |          not interpreted as comparison
    |                    help: try comparing the casted value: `(a as usize)`
 
 error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
-  --> $DIR/issue-22644.rs:20:31
+  --> $DIR/issue-22644.rs:21:31
    |
-20 |     println!("{}{}", a: usize < long_name, long_name);
+21 |     println!("{}{}", a: usize < long_name, long_name);
    |                      -------- ^ -------------------- interpreted as generic arguments
    |                      |        |
    |                      |        not interpreted as comparison
    |                      help: try comparing the casted value: `(a: usize)`
 
 error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
-  --> $DIR/issue-22644.rs:21:29
+  --> $DIR/issue-22644.rs:23:29
    |
-21 |     println!("{}", a: usize < 4);
+23 |     println!("{}", a: usize < 4); //~ ERROR `<` is interpreted as a start of generic
    |                    -------- ^ - interpreted as generic arguments
    |                    |        |
    |                    |        not interpreted as comparison
    |                    help: try comparing the casted value: `(a: usize)`
 
 error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
-  --> $DIR/issue-22644.rs:26:20
+  --> $DIR/issue-22644.rs:28:20
    |
-26 |                    <
+28 |                    < //~ ERROR `<` is interpreted as a start of generic
    |                    ^ not interpreted as comparison
-27 |                    4);
+29 |                    4);
    |                    - interpreted as generic arguments
 help: try comparing the casted value
    |
-23 |     println!("{}", (a
-24 |                    as
-25 |                    usize)
+25 |     println!("{}", (a
+26 |                    as
+27 |                    usize)
    |
 
 error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
-  --> $DIR/issue-22644.rs:35:20
+  --> $DIR/issue-22644.rs:37:20
    |
-35 |                    <
+37 |                    < //~ ERROR `<` is interpreted as a start of generic
    |                    ^ not interpreted as comparison
-36 |                    5);
+38 |                    5);
    |                    - interpreted as generic arguments
 help: try comparing the casted value
    |
-28 |     println!("{}", (a
-29 | 
-30 | 
-31 |                    as
+30 |     println!("{}", (a
+31 | 
 32 | 
-33 | 
+33 |                    as
+34 | 
+35 | 
  ...
 
 error: `<` is interpreted as a start of generic arguments for `usize`, not a shift
-  --> $DIR/issue-22644.rs:38:31
+  --> $DIR/issue-22644.rs:40:31
    |
-38 |     println!("{}", a as usize << long_name);
+40 |     println!("{}", a as usize << long_name); //~ ERROR `<` is interpreted as a start of generic
    |                    ---------- ^^ --------- interpreted as generic arguments
    |                    |          |
    |                    |          not interpreted as shift
    |                    help: try shifting the casted value: `(a as usize)`
 
 error: expected type, found `4`
-  --> $DIR/issue-22644.rs:40:28
+  --> $DIR/issue-22644.rs:42:28
    |
-40 |     println!("{}", a: &mut 4);
+42 |     println!("{}", a: &mut 4); //~ ERROR expected type, found `4`
    |                            ^ expecting a type here because of type ascription
 
index 0e777fe8a94542f2f3e44c006d6f8c395ab2bf47..0589618a82faf45b6568e748b671a377b81169b1 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn main() {
-    a;
-    "".lorem;
-    "".ipsum;
+    a; //~ ERROR cannot find value `a`
+    "".lorem; //~ ERROR no field
+    "".ipsum; //~ ERROR no field
 }
index 5de2d98f86a9dbce8c72b8b1c3f15a104afdda7b..4909340fa4c352e40c0e79e15d761c3329ff9da7 100644 (file)
@@ -1,19 +1,19 @@
 error[E0425]: cannot find value `a` in this scope
   --> $DIR/issue-33525.rs:12:5
    |
-12 |     a;
+12 |     a; //~ ERROR cannot find value `a`
    |     ^ not found in this scope
 
 error[E0609]: no field `lorem` on type `&'static str`
   --> $DIR/issue-33525.rs:13:8
    |
-13 |     "".lorem;
+13 |     "".lorem; //~ ERROR no field
    |        ^^^^^
 
 error[E0609]: no field `ipsum` on type `&'static str`
   --> $DIR/issue-33525.rs:14:8
    |
-14 |     "".ipsum;
+14 |     "".ipsum; //~ ERROR no field
    |        ^^^^^
 
 error: aborting due to 3 previous errors
index eb111d33b99c2a204fe168a81cabbac475422b68..21c169c663828f5381bad4da60270480252b9d7b 100644 (file)
@@ -11,5 +11,6 @@
 use std::collections::HashMap;
 
 fn main() {
-    for _ in HashMap::new().iter().cloned() {}
+    for _ in HashMap::new().iter().cloned() {} //~ ERROR type mismatch
+    //~^ ERROR type mismatch
 }
index 5a8d1fab3f6590867794bc9cdbd0a31dfc7ffd2d..953e6fe77d716c26e97575a31fe318c1af7d7091 100644 (file)
@@ -1,7 +1,7 @@
 error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as std::iter::Iterator>::Item == &_`
   --> $DIR/issue-33941.rs:14:36
    |
-14 |     for _ in HashMap::new().iter().cloned() {}
+14 |     for _ in HashMap::new().iter().cloned() {} //~ ERROR type mismatch
    |                                    ^^^^^^ expected tuple, found reference
    |
    = note: expected type `(&_, &_)`
@@ -10,7 +10,7 @@ error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _,
 error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as std::iter::Iterator>::Item == &_`
   --> $DIR/issue-33941.rs:14:5
    |
-14 |     for _ in HashMap::new().iter().cloned() {}
+14 |     for _ in HashMap::new().iter().cloned() {} //~ ERROR type mismatch
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found reference
    |
    = note: expected type `(&_, &_)`
index 7ec3974854b3373d403233c6d731534f4c730f6f..4616f25bdfb868a59a8bba8f1120fc01c2981052 100644 (file)
@@ -10,6 +10,6 @@
 
 struct Foo(u32);
 
-fn test() -> Foo { Foo }
+fn test() -> Foo { Foo } //~ ERROR mismatched types
 
 fn main() {}
index bb1bba152bbd358d48f8fb6e9d4b423c4359f176..25cef7388977d2aff5bc839ed442ac34f106a3d7 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/issue-35241.rs:13:20
    |
-13 | fn test() -> Foo { Foo }
+13 | fn test() -> Foo { Foo } //~ ERROR mismatched types
    |              ---   ^^^
    |              |     |
    |              |     expected struct `Foo`, found fn item
index 001c1f2eddca1e3ccbeabaf58450b6296547847c..ee9d1324cdbb7e3b88208111122a5f4761dce46e 100644 (file)
 enum Fruit { //~ HELP possible candidate is found in another module, you can import it into scope
     //~^ HELP possible candidate is found in another module, you can import it into scope
     Apple(i64),
-    //~^ HELP there is an enum variant `Fruit::Apple`, did you mean to use `Fruit`?
-    //~| HELP there is an enum variant `Fruit::Apple`, did you mean to use `Fruit`?
     Orange(i64),
 }
 
 fn should_return_fruit() -> Apple {
     //~^ ERROR cannot find type `Apple` in this scope
     //~| NOTE not found in this scope
+    //~| HELP you can try using the variant's enum
     Apple(5)
     //~^ ERROR cannot find function `Apple` in this scope
     //~| NOTE not found in this scope
@@ -28,6 +27,7 @@ fn should_return_fruit() -> Apple {
 fn should_return_fruit_too() -> Fruit::Apple {
     //~^ ERROR expected type, found variant `Fruit::Apple`
     //~| NOTE not a type
+    //~| HELP you can try using the variant's enum
     Apple(5)
     //~^ ERROR cannot find function `Apple` in this scope
     //~| NOTE not found in this scope
@@ -44,6 +44,7 @@ fn foo() -> Ok {
 fn bar() -> Variant3 {
     //~^ ERROR cannot find type `Variant3` in this scope
     //~| NOTE not found in this scope
+    //~| HELP you can try using the variant's enum
 }
 
 fn qux() -> Some {
@@ -61,7 +62,6 @@ enum Enum {
         Variant1,
         Variant2(),
         Variant3(usize),
-        //~^ HELP there is an enum variant `x::Enum::Variant3`, did you mean to use `x::Enum`?
         Variant4 {},
     }
 }
index e125d74e28ffae7d9e9a5625b5506acde523253b..550e094dc51bb5f44b7e7f1ef9b339c1a91c9c27 100644 (file)
@@ -1,16 +1,16 @@
 error[E0412]: cannot find type `Apple` in this scope
-  --> $DIR/issue-35675.rs:20:29
+  --> $DIR/issue-35675.rs:18:29
    |
-20 | fn should_return_fruit() -> Apple {
+18 | fn should_return_fruit() -> Apple {
    |                             ^^^^^
    |                             |
    |                             not found in this scope
    |                             help: you can try using the variant's enum: `Fruit`
 
 error[E0425]: cannot find function `Apple` in this scope
-  --> $DIR/issue-35675.rs:23:5
+  --> $DIR/issue-35675.rs:22:5
    |
-23 |     Apple(5)
+22 |     Apple(5)
    |     ^^^^^ not found in this scope
 help: possible candidate is found in another module, you can import it into scope
    |
@@ -18,9 +18,9 @@ help: possible candidate is found in another module, you can import it into scop
    |
 
 error[E0573]: expected type, found variant `Fruit::Apple`
-  --> $DIR/issue-35675.rs:28:33
+  --> $DIR/issue-35675.rs:27:33
    |
-28 | fn should_return_fruit_too() -> Fruit::Apple {
+27 | fn should_return_fruit_too() -> Fruit::Apple {
    |                                 ^^^^^^^^^^^^
    |                                 |
    |                                 not a type
@@ -55,9 +55,9 @@ error[E0412]: cannot find type `Variant3` in this scope
    |             help: you can try using the variant's enum: `x::Enum`
 
 error[E0573]: expected type, found variant `Some`
-  --> $DIR/issue-35675.rs:49:13
+  --> $DIR/issue-35675.rs:50:13
    |
-49 | fn qux() -> Some {
+50 | fn qux() -> Some {
    |             ^^^^ not a type
    |
    = help: there is an enum variant `std::prelude::v1::Option::Some`, try using `std::prelude::v1::Option`?
index 169d7b55916706e45a43af982a9e64cca5785abd..d45b0c5a0416c279fcb2dc72cc87ca4b148c706b 100644 (file)
@@ -23,7 +23,6 @@ fn wait(&self) { }
 fn bar(arg: Box<private::Future>) {
     arg.wait();
     //~^ ERROR the `wait` method cannot be invoked on a trait object
-    //~| another candidate was found in the following trait, perhaps add a `use` for it:
 }
 
 fn main() {
index c0aec5b4296be0d8f8e666692f8e7b4c52ee15ff..fa4361e42aa5b908ca9e903d6ff2a15bde7116a7 100644 (file)
@@ -12,5 +12,5 @@ fn f(x: &mut u32) {}
 
 fn main() {
     let x = Box::new(3);
-    f(&mut *x);
+    f(&mut *x); //~ ERROR cannot borrow immutable
 }
index 69e9c455f357df3be2be13abc4b6e7776fa79674..84e6855e23b461214983423135080a405cc31f0b 100644 (file)
@@ -3,7 +3,7 @@ error[E0596]: cannot borrow immutable `Box` content `*x` as mutable
    |
 14 |     let x = Box::new(3);
    |         - consider changing this to `mut x`
-15 |     f(&mut *x);
+15 |     f(&mut *x); //~ ERROR cannot borrow immutable
    |            ^^ cannot borrow as mutable
 
 error: aborting due to previous error
index add96461f1bfedd014bfd66f2c90cf06611c513f..1e05bdb0c608660c4952bb757debb741f42c29f4 100644 (file)
@@ -20,7 +20,7 @@ trait Foo {
 
 impl<T> Foo for T {
     #[allow(unconditional_recursion)]
-    fn recurse(&self) {
+    fn recurse(&self) { //~ ERROR reached the type-length limit
         (self, self).recurse();
     }
 }
index b51b683a1ac3a5de798a8e3feaea1d315159574d..fe173867da1096baa9bea5d233a9440e398d1990 100644 (file)
@@ -1,7 +1,7 @@
 error: reached the type-length limit while instantiating `<T as Foo><(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(), &()), &(&()...`
   --> $DIR/issue-37311.rs:23:5
    |
-23 | /     fn recurse(&self) {
+23 | /     fn recurse(&self) { //~ ERROR reached the type-length limit
 24 | |         (self, self).recurse();
 25 | |     }
    | |_____^
index 7efa3bd9d5b311980e104b5c90b9b9050c409c2c..f2de2030bd1964d3958959d5ffd9ccdadfb03440 100644 (file)
@@ -16,5 +16,5 @@ struct Foo {
 fn main() {
     let mut f = Foo { v: Vec::new() };
     f.v.push("hello".to_string());
-    let e = f.v[0];
+    let e = f.v[0]; //~ ERROR cannot move out of indexed content
 }
index 56d0a5351ce83ed53712282d984365f552c32064..173a60b0f0885e8f5ab55599c8b0a3d4a8218daf 100644 (file)
@@ -1,7 +1,7 @@
 error[E0507]: cannot move out of indexed content
   --> $DIR/issue-40402-1.rs:19:13
    |
-19 |     let e = f.v[0];
+19 |     let e = f.v[0]; //~ ERROR cannot move out of indexed content
    |             ^^^^^^
    |             |
    |             cannot move out of indexed content
index 76e038b696e8fe7122f9ffd6183da01c2bbbafbd..894923605c02474bb39e686e81619bf09c00957d 100644 (file)
@@ -12,5 +12,5 @@
 // are nested within a pattern
 fn main() {
     let x = vec![(String::new(), String::new())];
-    let (a, b) = x[0];
+    let (a, b) = x[0]; //~ ERROR cannot move out of indexed content
 }
index 0060b683bba43637789a732186b8de60b21e75f5..7b992e376dc749cfbbcb2225d05935997f1db5d9 100644 (file)
@@ -1,7 +1,7 @@
 error[E0507]: cannot move out of indexed content
   --> $DIR/issue-40402-2.rs:15:18
    |
-15 |     let (a, b) = x[0];
+15 |     let (a, b) = x[0]; //~ ERROR cannot move out of indexed content
    |          -  -    ^^^^ cannot move out of indexed content
    |          |  |
    |          |  ...and here (use `ref b` or `ref mut b`)
index 56ee225105f8922793c92443d0421733d2372e44..10dc177c7e95da3a6f5b881c7187bd4c529ce659 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn main() {
-    for i 0..2 {
+    for i 0..2 { //~ ERROR missing `in`
     }
 }
 
index 0d49eebbdbfc94b130a664d4401355b1d59118cc..543233e0cc6208edb7e15cc5d4b659d640b0d973 100644 (file)
@@ -1,7 +1,7 @@
 error: missing `in` in `for` loop
   --> $DIR/issue-40782.rs:12:10
    |
-12 |     for i 0..2 {
+12 |     for i 0..2 { //~ ERROR missing `in`
    |          ^ help: try adding `in` here
 
 error: aborting due to previous error
index f13f1dd114517083261392b6598d984712ee4553..f35eee186a2a5a4cb26a6a12793fcf71ce77e3a2 100644 (file)
@@ -10,7 +10,7 @@
 
 fn do_something<T>(collection: &mut Vec<T>) {
     let _a = &collection;
-    collection.swap(1, 2);
+    collection.swap(1, 2); //~ ERROR also borrowed as immutable
 }
 
 fn main() {}
index 481cdb5f5b2f65e8458d01c7e634f25f1f0654f2..0f96377c062a8323004e48f7f3d9049c3025a297 100644 (file)
@@ -3,7 +3,7 @@ error[E0502]: cannot borrow `*collection` as mutable because `collection` is als
    |
 12 |     let _a = &collection;
    |               ---------- immutable borrow occurs here
-13 |     collection.swap(1, 2);
+13 |     collection.swap(1, 2); //~ ERROR also borrowed as immutable
    |     ^^^^^^^^^^ mutable borrow occurs here
 14 | }
    | - immutable borrow ends here
index bdfdf44c0e28a977465acd7171650728068e2148..6fa2c69bf66968739fe85a4eaa25feae45bebbc3 100644 (file)
@@ -10,7 +10,7 @@
 
 macro_rules! is_plainly_printable {
     ($i: ident) => {
-        $i as u32 < 0
+        $i as u32 < 0 //~ `<` is interpreted as a start of generic arguments
     };
 }
 
index 7287c8f37eb063f34748fb1c97feeb1a2b2028d7..d0fc410c474a4c85f9817dd4311abe538b8ed43a 100644 (file)
@@ -1,7 +1,7 @@
 error: `<` is interpreted as a start of generic arguments for `u32`, not a comparison
   --> $DIR/issue-42954.rs:13:19
    |
-13 |         $i as u32 < 0
+13 |         $i as u32 < 0 //~ `<` is interpreted as a start of generic arguments
    |         --------- ^ - interpreted as generic arguments
    |         |         |
    |         |         not interpreted as comparison
index 295d480828930ba7bf47da9534538a65bdb3b06d..97b82dc58dcfcfe90b7adaf92eed3a09cc121e9e 100644 (file)
@@ -12,5 +12,5 @@
 
 pub fn main () {}
 
-fn საჭმელად_გემრიელი_სადილი ( ) -> isize {
+fn საჭმელად_გემრიელი_სადილი ( ) -> isize { //~ ERROR mismatched types
 }
index a17512ba4abc4824e0af7ccf9a4b7e1b63ecd90f..fc6363dc921a2e19b18987b7fe15714165892235 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/issue-44023.rs:15:42
    |
-15 |   fn საჭმელად_გემრიელი_სადილი ( ) -> isize {
+15 |   fn საჭმელად_გემრიელი_სადილი ( ) -> isize { //~ ERROR mismatched types
    |  __________________________________________^
 16 | | }
    | |_^ expected isize, found ()
index ef47214f2b393fb8d6c7ecd341847f67d7dbc4f4..356a7be0b419ea627578bea3f3dd9c300fefeba7 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    "😊"";
+    "😊""; //~ ERROR unterminated double quote
 }
index 2ed4578d5389ec7e143eade954ce687caa3758f4..49e461bd18d18993bc6390f968a21d9802d12a4d 100644 (file)
@@ -1,7 +1,7 @@
 error: unterminated double quote string
   --> $DIR/issue-44078.rs:12:8
    |
-12 |       "😊"";
+12 |       "😊""; //~ ERROR unterminated double quote
    |  _________^
 13 | | }
    | |__^
index abf572118fc68ce3fca4cab7d7d81bc8e89d70e8..8e99caff4efa2040789f398671ad7d5ec41f0780 100644 (file)
@@ -15,5 +15,6 @@ macro_rules! foo {
 }
 
 fn main() {
-    foo!(true);
+    foo!(true); //~ ERROR expected type, found keyword
+    //~^ ERROR expected identifier, found keyword
 }
index e7afbb574efd7d4705ec3859d407be566d5de9f7..2e71b001d7ac0402109da26aefb258a2ac89de20 100644 (file)
@@ -1,7 +1,7 @@
 error: expected identifier, found keyword `true`
   --> $DIR/issue-44406.rs:18:10
    |
-18 |     foo!(true);
+18 |     foo!(true); //~ ERROR expected type, found keyword
    |          ^^^^
 
 error: expected type, found keyword `true`
@@ -10,7 +10,7 @@ error: expected type, found keyword `true`
 13 |         bar(baz: $rest)
    |                - help: did you mean to use `;` here?
 ...
-18 |     foo!(true);
+18 |     foo!(true); //~ ERROR expected type, found keyword
    |          ^^^^ expecting a type here because of type ascription
 
 error: aborting due to 2 previous errors
index 833fc2802a3a5db9208f36cc80e39acc3d7f4418..2fce8d723d39c6f04f5157b8c2929cffbeed032c 100644 (file)
@@ -14,13 +14,13 @@ fn main() {
 
     unsafe {
         let f = |v: &mut Vec<_>| {
-            unsafe {
+            unsafe { //~ ERROR unnecessary `unsafe`
                 v.set_len(24);
-                |w: &mut Vec<u32>| { unsafe {
+                |w: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
                     w.set_len(32);
                 } };
             }
-            |x: &mut Vec<u32>| { unsafe {
+            |x: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
                 x.set_len(40);
             } };
         };
index be6b1e30a59da48015c8abdee5c22b2d47bdef32..abd875c48083d5f4964b889798f73355b958c977 100644 (file)
@@ -1,9 +1,9 @@
 error: unnecessary `unsafe` block
   --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:17:13
    |
-17 | /             unsafe {
+17 | /             unsafe { //~ ERROR unnecessary `unsafe`
 18 | |                 v.set_len(24);
-19 | |                 |w: &mut Vec<u32>| { unsafe {
+19 | |                 |w: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
 20 | |                     w.set_len(32);
 21 | |                 } };
 22 | |             }
@@ -19,7 +19,7 @@ note: because it's nested under this `unsafe` block
    |
 15 | /     unsafe {
 16 | |         let f = |v: &mut Vec<_>| {
-17 | |             unsafe {
+17 | |             unsafe { //~ ERROR unnecessary `unsafe`
 18 | |                 v.set_len(24);
 ...  |
 29 | |         f(&mut v);
@@ -29,7 +29,7 @@ note: because it's nested under this `unsafe` block
 error: unnecessary `unsafe` block
   --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:19:38
    |
-19 |                   |w: &mut Vec<u32>| { unsafe {
+19 |                   |w: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
    |  ______________________________________^
 20 | |                     w.set_len(32);
 21 | |                 } };
@@ -40,7 +40,7 @@ note: because it's nested under this `unsafe` block
    |
 15 | /     unsafe {
 16 | |         let f = |v: &mut Vec<_>| {
-17 | |             unsafe {
+17 | |             unsafe { //~ ERROR unnecessary `unsafe`
 18 | |                 v.set_len(24);
 ...  |
 29 | |         f(&mut v);
@@ -50,7 +50,7 @@ note: because it's nested under this `unsafe` block
 error: unnecessary `unsafe` block
   --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:23:34
    |
-23 |               |x: &mut Vec<u32>| { unsafe {
+23 |               |x: &mut Vec<u32>| { unsafe { //~ ERROR unnecessary `unsafe`
    |  __________________________________^
 24 | |                 x.set_len(40);
 25 | |             } };
@@ -61,7 +61,7 @@ note: because it's nested under this `unsafe` block
    |
 15 | /     unsafe {
 16 | |         let f = |v: &mut Vec<_>| {
-17 | |             unsafe {
+17 | |             unsafe { //~ ERROR unnecessary `unsafe`
 18 | |                 v.set_len(24);
 ...  |
 29 | |         f(&mut v);
index 7a2b4e56d69445bb81d440f5e45712f60081b380..965747cfa05ca17dcf932b999d8c4789bf8d91e3 100644 (file)
@@ -11,5 +11,5 @@
 fn main() {
     let unused = ();
 
-    #![allow(unused_variables)]
+    #![allow(unused_variables)] //~ ERROR not permitted in this context
 }
index 1a660e4c6784e22cc05f138990eca8966544e3fe..45a80750de71678e48f5052feb839578a0ae510f 100644 (file)
@@ -1,7 +1,7 @@
 error: an inner attribute is not permitted in this context
   --> $DIR/issue-45296.rs:14:7
    |
-14 |     #![allow(unused_variables)]
+14 |     #![allow(unused_variables)] //~ ERROR not permitted in this context
    |       ^
    |
    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
index f725d69ca65cd065f8d2bb0dd7973d91b7770c7c..d733c8e6de26fe0dc80a9e0bc868e91b26fb72d5 100644 (file)
 
 use std::fmt;
 fn main() {
-    let x: *const _ = 0 as _;
+    let x: *const _ = 0 as _; //~ ERROR cannot cast
 
-    let x: *const _ = 0 as *const _;
+    let x: *const _ = 0 as *const _; //~ ERROR cannot cast
     let y: Option<*const fmt::Debug> = Some(x) as _;
 
-    let x = 0 as *const i32 as *const _ as *mut _;
+    let x = 0 as *const i32 as *const _ as *mut _; //~ ERROR cannot cast
 }
index c4f2e856b7b57990b0f8cfdbb11a736fe82eba9b..94d39239117add7754d7b5826ae4c48c16572edd 100644 (file)
@@ -1,7 +1,7 @@
 error[E0641]: cannot cast to a pointer of an unknown kind
   --> $DIR/issue-45730.rs:13:23
    |
-13 |     let x: *const _ = 0 as _;
+13 |     let x: *const _ = 0 as _; //~ ERROR cannot cast
    |                       ^^^^^-
    |                            |
    |                            help: consider giving more type information
@@ -11,7 +11,7 @@ error[E0641]: cannot cast to a pointer of an unknown kind
 error[E0641]: cannot cast to a pointer of an unknown kind
   --> $DIR/issue-45730.rs:15:23
    |
-15 |     let x: *const _ = 0 as *const _;
+15 |     let x: *const _ = 0 as *const _; //~ ERROR cannot cast
    |                       ^^^^^--------
    |                            |
    |                            help: consider giving more type information
@@ -21,7 +21,7 @@ error[E0641]: cannot cast to a pointer of an unknown kind
 error[E0641]: cannot cast to a pointer of an unknown kind
   --> $DIR/issue-45730.rs:18:13
    |
-18 |     let x = 0 as *const i32 as *const _ as *mut _;
+18 |     let x = 0 as *const i32 as *const _ as *mut _; //~ ERROR cannot cast
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------
    |                                            |
    |                                            help: consider giving more type information
index 04112c303bd935f2cbef5744adc628ac2bbd4207..5ded42e7c972cacf4d68d331786b73f984a775cf 100644 (file)
@@ -17,7 +17,7 @@ fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
         let p: &i32 = &a.field;
         &*p
     } else {
-        &*x
+        &*x //~ ERROR explicit lifetime
     }
 }
 
index 613c903853ae5a1fbc2dc3cb833838435f88e094..9bfa72c2f36ceb7f8a5df90ca4ea30eb1abacd30 100644 (file)
@@ -4,7 +4,7 @@ error[E0621]: explicit lifetime required in the type of `x`
 15 | fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
    |                         - consider changing the type of `x` to `&'a i32`
 ...
-20 |         &*x
+20 |         &*x //~ ERROR explicit lifetime
    |         ^^^ lifetime `'a` required
 
 error: aborting due to previous error
index 55752f753ef126b94a3ac76effb62973f90dc766..1705767834fb2f3ff06960cb05cd685e3b564f0e 100644 (file)
@@ -18,7 +18,7 @@ fn bar(&self, other: Foo) -> Foo<'a> {
         match *self {
             Foo::Bar(s) => {
                 if s == "test" {
-                    other
+                    other //~ ERROR explicit lifetime
                 } else {
                     self.clone()
                 }
index d1660a620b6c74c22c6c75ef4ddca2bf935fa819..4c5e37b8f10fbaa41340b53e261952ccd4e1ccc8 100644 (file)
@@ -4,7 +4,7 @@ error[E0621]: explicit lifetime required in the type of `other`
 17 |     fn bar(&self, other: Foo) -> Foo<'a> {
    |                   ----- consider changing the type of `other` to `Foo<'a>`
 ...
-21 |                     other
+21 |                     other //~ ERROR explicit lifetime
    |                     ^^^^^ lifetime `'a` required
 
 error: aborting due to previous error
index a1716c4e797922d00a34bfa3b59499a7e185137f..964f2f1c003ecc013ed5f629a7df18a0db543b05 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-    if x > y { x } else { y }
+    if x > y { x } else { y } //~ ERROR explicit lifetime
 }
 
 fn main() { }
index 83716b7791d83cac3a6f0046efbbb35909641234..457e347faaa4dfdfd6b5711a0a7e38730c674349 100644 (file)
@@ -3,7 +3,7 @@ error[E0621]: explicit lifetime required in the type of `x`
    |
 11 | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
    |            - consider changing the type of `x` to `&'a i32`
-12 |     if x > y { x } else { y }
+12 |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |                ^ lifetime `'a` required
 
 error: aborting due to previous error
index 7bd32d8761705d073c4859cd8922350227a26dc4..96d5c5bb16100eecf0e5d70e45dd76f21f0c6f41 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn foo<'a>((x, y): (&'a i32, &i32)) -> &'a i32 {
-    if x > y { x } else { y }
+    if x > y { x } else { y } //~ ERROR explicit lifetime
 }
 
 fn main () { }
index 6d5e94a5e78adc8ead80a8c8aaaf3b4200f2df74..8c3592379ef12a482f570b3c307c8467245bf450 100644 (file)
@@ -3,7 +3,7 @@ error[E0621]: explicit lifetime required in parameter type
    |
 11 | fn foo<'a>((x, y): (&'a i32, &i32)) -> &'a i32 {
    |            ------ consider changing type to `(&'a i32, &'a i32)`
-12 |     if x > y { x } else { y }
+12 |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |                           ^ lifetime `'a` required
 
 error: aborting due to previous error
index 8849f7084b3cde174c71cd38664f968048849e1d..5cf52fe79f0145924f77e81b46cfbcaa32d44bee 100644 (file)
@@ -11,7 +11,7 @@
 trait Foo {
 
 fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
-   if x > y { x } else { y }
+   if x > y { x } else { y } //~ ERROR explicit lifetime
    }
 }
 
index 4288fdf89a41732a973360a903f0d7f8e7a498a0..d5d1d16a4245f367bd183b02bbdb1f48d4454571 100644 (file)
@@ -3,7 +3,7 @@ error[E0621]: explicit lifetime required in the type of `x`
    |
 13 | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
    |            - consider changing the type of `x` to `&'a i32`
-14 |    if x > y { x } else { y }
+14 |    if x > y { x } else { y } //~ ERROR explicit lifetime
    |               ^ lifetime `'a` required
 
 error: aborting due to previous error
index 362290ff3fa7d9cd5f7e52229e3648ca0939d67c..3727ddf91298e466049d1d26b09c59c24578c54a 100644 (file)
@@ -15,7 +15,7 @@ struct Foo {
 impl Foo {
   fn foo<'a>(&'a self, x: &i32) -> &i32 {
 
-    if true { &self.field } else { x }
+    if true { &self.field } else { x } //~ ERROR explicit lifetime
 
   }
 
index 95076bfbdc7dae548671a589ad9336a8d2bc5b7f..23b9c0cf2506f9312a99293f9ef5a032bbb94a68 100644 (file)
@@ -4,7 +4,7 @@ error[E0621]: explicit lifetime required in the type of `x`
 16 |   fn foo<'a>(&'a self, x: &i32) -> &i32 {
    |                        - consider changing the type of `x` to `&'a i32`
 17 | 
-18 |     if true { &self.field } else { x }
+18 |     if true { &self.field } else { x } //~ ERROR explicit lifetime
    |                                    ^ lifetime `'a` required
 
 error: aborting due to previous error
index 36d956a39966f53a88721bcf2014ac0ec9dcb76c..cec73d79ec21b7b65b5257272b791bf05e5e8867 100644 (file)
@@ -18,7 +18,7 @@ impl Foo for () {
 
     fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
 
-        if x > y { x } else { y }
+        if x > y { x } else { y } //~ ERROR lifetime mismatch
 
     }
 
index cb9a1edf1ddf9a8551e12f42c5599ead69bd0190..f418e1c01f2ae5b28f41791edef9d3693217c9aa 100644 (file)
@@ -6,7 +6,7 @@ error[E0623]: lifetime mismatch
    |                   |
    |                   this parameter and the return type are declared with different lifetimes...
 20 | 
-21 |         if x > y { x } else { y }
+21 |         if x > y { x } else { y } //~ ERROR lifetime mismatch
    |                    ^ ...but data from `x` is returned here
 
 error: aborting due to previous error
index 30239f4c0946c0234f36ab67551a0dd6195ca11e..5ee2663317e96a2603d9743bc92619dcd51dccdd 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
-    if x > y { x } else { y }
+    if x > y { x } else { y } //~ ERROR explicit lifetime
 }
 
 fn main() { }
index 5d1336c7c3a22deaf77bdbf80122f716059e98bb..b28f102cd5ac1624879e69c2dd2383d4e7f58fea 100644 (file)
@@ -3,7 +3,7 @@ error[E0621]: explicit lifetime required in the type of `y`
    |
 11 | fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
    |                        - consider changing the type of `y` to `&'a i32`
-12 |     if x > y { x } else { y }
+12 |     if x > y { x } else { y } //~ ERROR explicit lifetime
    |                           ^ lifetime `'a` required
 
 error: aborting due to previous error
index 96b733be9b4eb5c4adf22a89f4cf6846ad561f04..4d57c61ba9e2e5574290ae4cf448565c04ddbba4 100644 (file)
@@ -15,7 +15,7 @@ struct Foo {
 impl Foo {
   fn foo<'a>(&self, x: &'a i32) -> &i32 {
 
-    x
+    x //~ ERROR lifetime mismatch
 
   }
 
index 8af6acc62c43649c58a468104180409f50135ec7..d26cb6be709b1fcf3179d572cb558c3c08db79d0 100644 (file)
@@ -6,7 +6,7 @@ error[E0623]: lifetime mismatch
    |                        |
    |                        this parameter and the return type are declared with different lifetimes...
 17 | 
-18 |     x
+18 |     x //~ ERROR lifetime mismatch
    |     ^ ...but data from `x` is returned here
 
 error: aborting due to previous error
index a8ce60c47b6f528ed26e096339080a584af5f600..a6ccf4a53d1558efd83a42f2f24dfbf1939b594c 100644 (file)
@@ -15,7 +15,7 @@ struct Foo {
 impl Foo {
     fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
 
-        if true { x } else { self }
+        if true { x } else { self } //~ ERROR lifetime mismatch
 
     }
 }
index c09de0c33af7a455fbdfd31bbf21db1261072043..0430e4c2715075e1b3585e4bc1078baa6a37c2b1 100644 (file)
@@ -6,7 +6,7 @@ error[E0623]: lifetime mismatch
    |                |
    |                this parameter and the return type are declared with different lifetimes...
 17 | 
-18 |         if true { x } else { self }
+18 |         if true { x } else { self } //~ ERROR lifetime mismatch
    |                              ^^^^ ...but data from `self` is returned here
 
 error: aborting due to previous error
index 098950e13b3154f8832fd1240afde3319587b08d..7f5b23728fd31c3e5f3ded518b6038cb18f1761f 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn foo(x: &i32, y: &i32) -> &i32 {
+fn foo(x: &i32, y: &i32) -> &i32 { //~ ERROR missing lifetime
     if x > y { x } else { y }
 }
 
index fccc44caac81a5f7e25b11cdb0ca893266387bd7..7cd5ca65981b7c88a76603afa9b93878a1bdc50c 100644 (file)
@@ -1,7 +1,7 @@
 error[E0106]: missing lifetime specifier
   --> $DIR/ex1b-return-no-names-if-else.rs:11:29
    |
-11 | fn foo(x: &i32, y: &i32) -> &i32 {
+11 | fn foo(x: &i32, y: &i32) -> &i32 { //~ ERROR missing lifetime
    |                             ^ expected lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y`
index dd34e1aa6d9d227e7377d4d58dd850eeeeea87c9..f35a7555d708bc56606f9c7ad2d2fce4738ea361 100644 (file)
@@ -13,7 +13,7 @@ struct Ref<'a, T: 'a> {
 }
 
 fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
-    y.push(x);
+    y.push(x); //~ ERROR explicit lifetime
 }
 
 fn main() { }
index 8dba0c33f201a381e7a741f2fcb7d51467085956..7abc093512b46e2955b01dc19e5ec2775f996786 100644 (file)
@@ -3,7 +3,7 @@ error[E0621]: explicit lifetime required in the type of `x`
    |
 15 | fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
    |            - consider changing the type of `x` to `Ref<'a, i32>`
-16 |     y.push(x);
+16 |     y.push(x); //~ ERROR explicit lifetime
    |            ^ lifetime `'a` required
 
 error: aborting due to previous error
index 5d1820082093e544845749f91189054aa6be429f..18a720f345d7f39511e8020129141efa9fb31358 100644 (file)
@@ -14,7 +14,7 @@ fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
     where i32: Foo<'a>,
           u32: Foo<'b>
 {
-    x.push(y);
+    x.push(y); //~ ERROR explicit lifetime required
 }
 fn main() {
 let x = baz;
index 980f14a51d9b1aa3e2d0c4011a7ba96dd81362a0..ca522596fbff8d7e328743110330902e444e7fdf 100644 (file)
@@ -4,7 +4,7 @@ error[E0621]: explicit lifetime required in the type of `y`
 13 | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
    |                                       - consider changing the type of `y` to `&'a T`
 ...
-17 |     x.push(y);
+17 |     x.push(y); //~ ERROR explicit lifetime required
    |            ^ lifetime `'a` required
 
 error: aborting due to previous error
index 71a1c865e09957e447621d70e0ac45e1717abe1f..1834395bd3b822623fa33e2ea62172c21a0d903e 100644 (file)
@@ -13,7 +13,7 @@ struct Ref<'a, T: 'a> {
 }
 
 fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
-    x.push(y);
+    x.push(y); //~ ERROR explicit lifetime
 }
 
 fn main() { }
index e529d6ffe46b47ac79973b7089aa7f75e6fb373b..5d8f2c1decb2cad43a01e810a95054841cb6775e 100644 (file)
@@ -3,7 +3,7 @@ error[E0621]: explicit lifetime required in the type of `y`
    |
 15 | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
    |                                       - consider changing the type of `y` to `Ref<'a, i32>`
-16 |     x.push(y);
+16 |     x.push(y); //~ ERROR explicit lifetime
    |            ^ lifetime `'a` required
 
 error: aborting due to previous error
index 09038d8ce9027ce0708f2f314c58bd5e637d61e8..6cf626adf82e369db06b6893240fd666cf0c6581 100644 (file)
@@ -13,7 +13,7 @@ struct Ref<'a, T: 'a> {
 }
 
 fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
-    x.push(y);
+    x.push(y); //~ ERROR lifetime mismatch
 }
 
 fn main() { }
index 1ee0099799760d392a7bc037b3cd74c447678d36..69ff29db3570a4250aa4706f833d2936f8dddac0 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 15 | fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
    |                    --------      -------- these two types are declared with different lifetimes...
-16 |     x.push(y);
+16 |     x.push(y); //~ ERROR lifetime mismatch
    |            ^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error
index cb083f778deeb7e2e8d0e493988a60342a3efdd5..36bd1c32286e1553e646767d09d6b5b24a1e9676 100644 (file)
@@ -14,7 +14,7 @@ struct Ref<'a, T: 'a> {
 
 fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
     let z = Ref { data: y.data };
-    x.push(z);
+    x.push(z); //~ ERROR lifetime mismatch
 }
 
 fn main() { }
index 495af8ae208f640acc74d4a986432503449a515f..dacb0708b05804a3e0ddc597ae7440bca0bcf0d1 100644 (file)
@@ -4,7 +4,7 @@ error[E0623]: lifetime mismatch
 15 | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
    |                                   ------------      ------------ these two types are declared with different lifetimes...
 16 |     let z = Ref { data: y.data };
-17 |     x.push(z);
+17 |     x.push(z); //~ ERROR lifetime mismatch
    |            ^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error
index bcb7583beefcf5f28d45b2c0add7323f2fe56cb0..96316819e937f60f6f01beefd423bd397019b131 100644 (file)
@@ -13,7 +13,7 @@ struct Ref<'a, T: 'a> {
 }
 
 fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-    let a: &mut Vec<Ref<i32>> = x;
+    let a: &mut Vec<Ref<i32>> = x; //~ ERROR lifetime mismatch
     let b = Ref { data: y.data };
     a.push(b);
 }
index 1f250a888472c55f43c03fcd82c8e56d8b789728..e30355891ee78f6f6436aa681ed3ce5b707aa163 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 15 | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
    |                                   ------------      ------------ these two types are declared with different lifetimes...
-16 |     let a: &mut Vec<Ref<i32>> = x;
+16 |     let a: &mut Vec<Ref<i32>> = x; //~ ERROR lifetime mismatch
    |                                 ^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error
index 2d05adb7ecd370b660bb8b13765cf071ba0e04c5..9352ebc77f5b2b0e033d7174513f6bd31e5ca931 100644 (file)
@@ -13,7 +13,7 @@ struct Ref<'a, T: 'a> {
 }
 
 fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
-    let a: &mut Vec<Ref<i32>> = x;
+    let a: &mut Vec<Ref<i32>> = x; //~ ERROR lifetime mismatch
     let b = Ref { data: y.data };
     Vec::push(a, b);
 }
index 343c35b871edea38764ecdaa671978a50a32935c..841555c1fcb38c098911c6633ded9839796a73ce 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 15 | fn foo<'a, 'b, 'c>(x: &'a mut Vec<Ref<'b, i32>>, y: Ref<'c, i32>) {
    |                                   ------------      ------------ these two types are declared with different lifetimes...
-16 |     let a: &mut Vec<Ref<i32>> = x;
+16 |     let a: &mut Vec<Ref<i32>> = x; //~ ERROR lifetime mismatch
    |                                 ^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error
index 905eae18d1807998f3a4661b609bc7cd757a3138..5d490824d02f934af47ee8d5492c3730ce39fabc 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn foo((v, w): (&u8, &u8), x: &u8) {
-    v = x;
+    v = x; //~ ERROR lifetime mismatch
 }
 
 fn main() { }
index 74a40c87c2fb1841b7a64acaa36cf7cb2c95b746..5e1a4593ae459919062b35bddfa74104cc2d8d45 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 11 | fn foo((v, w): (&u8, &u8), x: &u8) {
    |                 ---           --- these two types are declared with different lifetimes...
-12 |     v = x;
+12 |     v = x; //~ ERROR lifetime mismatch
    |         ^ ...but data from `x` flows here
 
 error: aborting due to previous error
index 51271243bdfdcc2399ca1d0f6b251cb7c0f1e540..fe6b40c05a603172f33c527ec103058c2815aee1 100644 (file)
@@ -9,7 +9,8 @@
 // except according to those terms.
 
 fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
-    z.push((x,y));
+    z.push((x,y)); //~ ERROR lifetime mismatch
+    //~^ ERROR lifetime mismatch
 }
 
 fn main() { }
index 898866c75f2140fccba2edc7a040a13816eec910..b5b90c077d064453bac9dfcfca426e313161e54a 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 11 | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
    |                     ---                 --- these two types are declared with different lifetimes...
-12 |     z.push((x,y));
+12 |     z.push((x,y)); //~ ERROR lifetime mismatch
    |             ^ ...but data flows into `z` here
 
 error[E0623]: lifetime mismatch
@@ -11,7 +11,7 @@ error[E0623]: lifetime mismatch
    |
 11 | fn foo(z: &mut Vec<(&u8,&u8)>, (x, y): (&u8, &u8)) {
    |                         ---                  --- these two types are declared with different lifetimes...
-12 |     z.push((x,y));
+12 |     z.push((x,y)); //~ ERROR lifetime mismatch
    |               ^ ...but data flows into `z` here
 
 error: aborting due to 2 previous errors
index 2fbf31aead5edea147c45a99fbcfc85ed250e521..f16120ddc22a02a226cddcb0e56bb2ea6bee6784 100644 (file)
@@ -13,7 +13,7 @@ struct Ref<'a, 'b> {
 }
 
 fn foo(mut x: Ref, y: Ref) {
-    x.b = y.b;
+    x.b = y.b; //~ ERROR lifetime mismatch
 }
 
 fn main() {}
index 26f31defc9eb1ff8eeabccd3553357509b870c69..e7317e63ab4727d849190339723d8382d8302dc1 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 15 | fn foo(mut x: Ref, y: Ref) {
    |               ---     --- these two types are declared with different lifetimes...
-16 |     x.b = y.b;
+16 |     x.b = y.b; //~ ERROR lifetime mismatch
    |           ^^^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error
index 120a7ca74aeeed81d5c28af32933d5d562e52935..78e6dc2d3e75fe6e86955944bf950c5cc7088208 100644 (file)
@@ -13,7 +13,7 @@ struct Ref<'a, 'b> {
 }
 
 fn foo(mut x: Ref) {
-    x.a = x.b;
+    x.a = x.b; //~ ERROR lifetime mismatch
 }
 
-fn main() {}
\ No newline at end of file
+fn main() {}
index 73460277de44cb9294eab94d883a1298fd2a9f8c..71eef13a67db75945c341db018fa9e94b89145b5 100644 (file)
@@ -5,7 +5,7 @@ error[E0623]: lifetime mismatch
    |               ---
    |               |
    |               this type is declared with multiple lifetimes...
-16 |     x.a = x.b;
+16 |     x.a = x.b; //~ ERROR lifetime mismatch
    |           ^^^ ...but data with one lifetime flows into the other here
 
 error: aborting due to previous error
index 606e611865fc772746230d09cd4104c9dfef6913..78e6dc2d3e75fe6e86955944bf950c5cc7088208 100644 (file)
@@ -13,7 +13,7 @@ struct Ref<'a, 'b> {
 }
 
 fn foo(mut x: Ref) {
-    x.a = x.b;
+    x.a = x.b; //~ ERROR lifetime mismatch
 }
 
 fn main() {}
index fb524ae62c57ae9e4c19361f6e734ca9cb1a571f..61b59b8f121c1ef077c1c51cf3bffc5a9ddeb115 100644 (file)
@@ -5,7 +5,7 @@ error[E0623]: lifetime mismatch
    |               ---
    |               |
    |               this type is declared with multiple lifetimes...
-16 |     x.a = x.b;
+16 |     x.a = x.b; //~ ERROR lifetime mismatch
    |           ^^^ ...but data with one lifetime flows into the other here
 
 error: aborting due to previous error
index 0fef709ae53637b43c0e9e0c82bf1b2f852c2bf0..ffec0e8d5bbb604dca2e2394179b8a3b9b772c48 100644 (file)
@@ -15,7 +15,7 @@ fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>)
     where &'a (): Sized,
           &'b u32: Sized
 {
-    x.push(y);
+    x.push(y); //~ ERROR lifetime mismatch
 }
 
 fn main() {}
index 59bf5d17222b7e189a10f794b502fb20291b9040..0b1b01d86b8ea4481a74185de44f1e723b402503 100644 (file)
@@ -4,7 +4,7 @@ error[E0623]: lifetime mismatch
 14 | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>)
    |                           -------      ------- these two types are declared with different lifetimes...
 ...
-18 |     x.push(y);
+18 |     x.push(y); //~ ERROR lifetime mismatch
    |            ^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error
index a91d0b55dc7abea69c25bb8f7b1730b9eb6ebe23..16d18f309516c1fcb5833077159df8288f8a6af6 100644 (file)
@@ -12,7 +12,7 @@ struct Ref<'a> {
 }
 
 fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>) {
-    x.push(y);
+    x.push(y); //~ ERROR lifetime mismatch
 }
 
 fn main() {}
index 878351210681bef588a9b80a960433e2878087fe..36885b7e076e4ee661c82c8ca25437c63e474b7b 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 14 | fn foo<'a, 'b>(mut x: Vec<Ref<'a>>, y: Ref<'b>) {
    |                           -------      ------- these two types are declared with different lifetimes...
-15 |     x.push(y);
+15 |     x.push(y); //~ ERROR lifetime mismatch
    |            ^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error
index 67ba8ee532ad0fc75148102766eaa157c40f7012..3b90b3474a140ad3fdf8da910cd75aa4c3f64935 100644 (file)
@@ -12,7 +12,7 @@ struct Ref<'a> {
 }
 
 fn foo(mut x: Vec<Ref>, y: Ref) {
-    x.push(y);
+    x.push(y); //~ ERROR lifetime mismatch
 }
 
 fn main() {}
index 6ad795400b334e040cb0d5c5e4e22e6959170ca2..961b8e310fe1640b4d0bc293f0bfac4c8321e474 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 14 | fn foo(mut x: Vec<Ref>, y: Ref) {
    |                   ---      --- these two types are declared with different lifetimes...
-15 |     x.push(y);
+15 |     x.push(y); //~ ERROR lifetime mismatch
    |            ^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error
index 5abfc983f883a321cca763d12176c789e8433d45..966b4f0b6c3291eddec7f8bb0a9547508e8cf5d7 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) {
-    x.push(y);
+    x.push(y); //~ ERROR lifetime mismatch
 }
 
-fn main() { }
\ No newline at end of file
+fn main() { }
index be628f226d3ddae6f316e76fc060b35bb847e634..b70d26a99d7328b19bfb7a2d652d6b6c50e2a4da 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 11 | fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) {
    |                           ------      ------ these two types are declared with different lifetimes...
-12 |     x.push(y);
+12 |     x.push(y); //~ ERROR lifetime mismatch
    |            ^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error
index a8b1f53fc98d67f7469c6d722bdbe2ca45bc92a0..055c3f804685a02d56db22989e5dc929dc478304 100644 (file)
@@ -11,7 +11,7 @@
 struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 }
 
 fn foo(mut x: Ref, y: &u32) {
-    y = x.b;
+    y = x.b; //~ ERROR lifetime mismatch
 }
 
 fn main() { }
index 31c7ebf6504cc0bd9ebf76960aa3c11ec62421e4..7a5037130636906dc17ebee59c89da9634be0cfd 100644 (file)
@@ -5,7 +5,7 @@ error[E0623]: lifetime mismatch
    |               ---     ----
    |               |
    |               these two types are declared with different lifetimes...
-14 |     y = x.b;
+14 |     y = x.b; //~ ERROR lifetime mismatch
    |         ^^^ ...but data from `x` flows into `y` here
 
 error: aborting due to previous error
index 4933dbb7e7a7a2c3ec95ffb312fa34dcd9875ee4..474da4a7d1613d2b93a4dd1cec4870fab98d9e72 100644 (file)
@@ -11,7 +11,7 @@
 struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 }
 
 fn foo(mut y: Ref, x: &u32) {
-    y.b = x;
+    y.b = x; //~ ERROR lifetime mismatch
 }
 
 fn main() { }
index d54b526aef97fc760866238c87078b8286db6f9f..66155bec0bb9a8933ea0e107017abc71597a4507 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 13 | fn foo(mut y: Ref, x: &u32) {
    |               ---     ---- these two types are declared with different lifetimes...
-14 |     y.b = x;
+14 |     y.b = x; //~ ERROR lifetime mismatch
    |           ^ ...but data from `x` flows into `y` here
 
 error: aborting due to previous error
index 4933dbb7e7a7a2c3ec95ffb312fa34dcd9875ee4..474da4a7d1613d2b93a4dd1cec4870fab98d9e72 100644 (file)
@@ -11,7 +11,7 @@
 struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 }
 
 fn foo(mut y: Ref, x: &u32) {
-    y.b = x;
+    y.b = x; //~ ERROR lifetime mismatch
 }
 
 fn main() { }
index 40f026bcb1b588e67d3aebf5e1b3be560b787e54..d47cffbc6222fb4de47cfb6852612fa84a8b5193 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 13 | fn foo(mut y: Ref, x: &u32) {
    |               ---     ---- these two types are declared with different lifetimes...
-14 |     y.b = x;
+14 |     y.b = x; //~ ERROR lifetime mismatch
    |           ^ ...but data from `x` flows into `y` here
 
 error: aborting due to previous error
index e1594b1a277cdea01b4f1899eb8a4abe5455fda0..1ffaec7ba00d3cb79d889dc03670ed5428d7e488 100644 (file)
@@ -14,7 +14,7 @@ struct Ref<'a, 'b> {
 }
 
 fn foo(mut x: Ref, y: &u32) {
-    x.b = y;
+    x.b = y; //~ ERROR lifetime mismatch
 }
 
 fn main() {}
index bb7b9ea68436c6f75168fb1c9edecbd846ea0af2..43c85e43e77388dac0fd608c1db0c33bb6a60fe7 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 16 | fn foo(mut x: Ref, y: &u32) {
    |               ---     ---- these two types are declared with different lifetimes...
-17 |     x.b = y;
+17 |     x.b = y; //~ ERROR lifetime mismatch
    |           ^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error
index 0dc257ac0921ef8b12fa5d557fbd4708a04d4ca3..97af35980105d1a9b6fd66b0db393139090d303c 100644 (file)
@@ -14,7 +14,7 @@ struct Foo {
 
 impl Foo {
   fn foo<'a>(&self, x: &i32) -> &i32 {
-    x
+    x //~ ERROR lifetime mismatch
   }
 }
 
index 1409b2161330b6615fca9bcbbbfd4afaf676c345..73927f0c1d31f159f015f223e47c198d17759e94 100644 (file)
@@ -5,7 +5,7 @@ error[E0623]: lifetime mismatch
    |                        ----     ----
    |                        |
    |                        this parameter and the return type are declared with different lifetimes...
-17 |     x
+17 |     x //~ ERROR lifetime mismatch
    |     ^ ...but data from `x` is returned here
 
 error: aborting due to previous error
index 0940ce15d1e7679d13fcc9c71c031e2b1f4c4c48..e6f4f0966ca62975499391d1caa56c96528a8647 100644 (file)
@@ -14,7 +14,7 @@ struct Foo {
 
 impl Foo {
     fn foo<'a>(&self, x: &Foo) -> &Foo {
-        if true { x } else { self }
+        if true { x } else { self } //~ ERROR lifetime mismatch
     }
 }
 
index cae45023e26b209526446f9350ac79d5a5ea2579..edb7ce2d6e9f7919ed0346543068b1d74b125f8c 100644 (file)
@@ -5,7 +5,7 @@ error[E0623]: lifetime mismatch
    |                          ----     ----
    |                          |
    |                          this parameter and the return type are declared with different lifetimes...
-17 |         if true { x } else { self }
+17 |         if true { x } else { self } //~ ERROR lifetime mismatch
    |                   ^ ...but data from `x` is returned here
 
 error: aborting due to previous error
index 9220c34489fab9e781e050bc7d372445bdf4d211..db53acf5afcebbf51a099fb02cbf6812becaf5e8 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
-  y.push(z);
+  y.push(z); //~ ERROR lifetime mismatch
 }
 
 fn main() { }
index adfc4dc0c276e8c1018a5a822cd812033324d923..065b669e6929b456cdc4646762547f5117859569 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 10 | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
    |                               ---      --- these two types are declared with different lifetimes...
-11 |   y.push(z);
+11 |   y.push(z); //~ ERROR lifetime mismatch
    |          ^ ...but data from `z` flows into `y` here
 
 error: aborting due to previous error
index 3a7ba415c0ded363e73827879d3bc36882fa34cb..b3ef06f18989747b2d5b395682620123c2efc887 100644 (file)
@@ -12,7 +12,7 @@ trait Foo {
 }
 impl Foo for () {
     fn foo(x: &mut Vec<&u8>, y: &u8) {
-        x.push(y);
+        x.push(y); //~ ERROR lifetime mismatch
     }
 }
 fn main() {}
index 9591df8e8aad249277330641674ee3891653b147..20badfccd8e1407be8893aa4c00e312dce6b9e8a 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 14 |     fn foo(x: &mut Vec<&u8>, y: &u8) {
    |                        ---      --- these two types are declared with different lifetimes...
-15 |         x.push(y);
+15 |         x.push(y); //~ ERROR lifetime mismatch
    |                ^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error
index 78a6ad54eae4f417c11505b5253feaf255fe3713..ebde6a3b53ff664e1620dd9aeef037bd70f285e3 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
-  y.push(z);
+  y.push(z); //~ ERROR lifetime mismatch
 }
 
 fn main() { }
index ce766b2e406a2cdf7b3c8f44599c8557ce8236c1..b8a4d9ed24ec919e871d380997c489b36c06f44d 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 10 | fn foo(x:Box<Fn(&u8, &u8)> , y: Vec<&u8>, z: &u8) {
    |                 ---  --- these two types are declared with different lifetimes...
-11 |   y.push(z);
+11 |   y.push(z); //~ ERROR lifetime mismatch
    |          ^ ...but data from `z` flows into `y` here
 
 error: aborting due to previous error
index be48d07b94e06098e811eb97395cef030c37f159..f88eca494eb5a75378a633d3660a9bd34850fdf3 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn foo(x: &mut Vec<&u8>, y: &u8) {
-    x.push(y);
+    x.push(y); //~ ERROR lifetime mismatch
 }
 
 fn main() { }
index d3291063859cac81ee35beaa3f6048d878864ac7..2a30172c43a18eacbd9bc66ea726395dd02fdee4 100644 (file)
@@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch
    |
 11 | fn foo(x: &mut Vec<&u8>, y: &u8) {
    |                    ---      --- these two types are declared with different lifetimes...
-12 |     x.push(y);
+12 |     x.push(y); //~ ERROR lifetime mismatch
    |            ^ ...but data from `y` flows into `x` here
 
 error: aborting due to previous error
index 1c904648f9e7b9827edb922dc8b7ce0b9663c4d4..7bf0ed34cbfd24c3dad91630fc7b2b70589f3bc5 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn f() {
-    let x = vec![1].iter();
+    let x = vec![1].iter(); //~ ERROR does not live long enough
 }
 
 fn main() {
index ea8aafadc8e79fb9a289367ec0e08a6ced4a1b5e..f61595e869d756b275a62feb3116a7dfaa52f210 100644 (file)
@@ -1,7 +1,7 @@
 error[E0597]: borrowed value does not live long enough
   --> $DIR/borrowck-let-suggestion.rs:12:27
    |
-12 |     let x = vec![1].iter();
+12 |     let x = vec![1].iter(); //~ ERROR does not live long enough
    |             -------       ^ temporary value dropped here while still borrowed
    |             |
    |             temporary value created here
index 242520cdb32c73e027fda9d03bc01451bfbb242b..58c33af0ddd27796d7f5fba82fdf0209d8aa1683 100644 (file)
@@ -16,6 +16,7 @@ trait ListItem<'a> {
 
 struct List<'a, T: ListItem<'a>> {
     slice: &'a [T]
+    //~^ ERROR may not live long enough
 }
 
 impl<'a, T: ListItem<'a>> Collection for List<'a, T> {
@@ -26,19 +27,24 @@ fn len(&self) -> usize {
 
 struct Foo<T> {
     foo: &'static T
+    //~^ ERROR may not live long enough
 }
 
 trait X<K>: Sized {
     fn foo<'a, L: X<&'a Nested<K>>>();
+    //~^ ERROR may not live long enough
     // check that we give a sane error for `Self`
     fn bar<'a, L: X<&'a Nested<Self>>>();
+    //~^ ERROR may not live long enough
 }
 
 struct Nested<K>(K);
 impl<K> Nested<K> {
     fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
+        //~^ ERROR may not live long enough
     }
     fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
+        //~^ ERROR may not live long enough
     }
 }
 
index 42e4f28260ea2bf202ec85aacf55fd2a17fc806b..342c6ab8f1624be2ad8c2edea578b236061ca0f6 100644 (file)
@@ -13,77 +13,81 @@ note: ...so that the reference type `&'a [T]` does not outlive the data it point
    |     ^^^^^^^^^^^^^^
 
 error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5
+  --> $DIR/lifetime-doesnt-live-long-enough.rs:29:5
    |
-27 | struct Foo<T> {
+28 | struct Foo<T> {
    |            - help: consider adding an explicit lifetime bound `T: 'static`...
-28 |     foo: &'static T
+29 |     foo: &'static T
    |     ^^^^^^^^^^^^^^^
    |
 note: ...so that the reference type `&'static T` does not outlive the data it points at
-  --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5
+  --> $DIR/lifetime-doesnt-live-long-enough.rs:29:5
    |
-28 |     foo: &'static T
+29 |     foo: &'static T
    |     ^^^^^^^^^^^^^^^
 
 error[E0309]: the parameter type `K` may not live long enough
-  --> $DIR/lifetime-doesnt-live-long-enough.rs:32:5
+  --> $DIR/lifetime-doesnt-live-long-enough.rs:34:5
    |
-31 | trait X<K>: Sized {
+33 | trait X<K>: Sized {
    |         - help: consider adding an explicit lifetime bound `K: 'a`...
-32 |     fn foo<'a, L: X<&'a Nested<K>>>();
+34 |     fn foo<'a, L: X<&'a Nested<K>>>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
-  --> $DIR/lifetime-doesnt-live-long-enough.rs:32:5
+  --> $DIR/lifetime-doesnt-live-long-enough.rs:34:5
    |
-32 |     fn foo<'a, L: X<&'a Nested<K>>>();
+34 |     fn foo<'a, L: X<&'a Nested<K>>>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0309]: the parameter type `Self` may not live long enough
-  --> $DIR/lifetime-doesnt-live-long-enough.rs:34:5
+  --> $DIR/lifetime-doesnt-live-long-enough.rs:37:5
    |
-34 |     fn bar<'a, L: X<&'a Nested<Self>>>();
+37 |     fn bar<'a, L: X<&'a Nested<Self>>>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider adding an explicit lifetime bound `Self: 'a`...
 note: ...so that the reference type `&'a Nested<Self>` does not outlive the data it points at
-  --> $DIR/lifetime-doesnt-live-long-enough.rs:34:5
+  --> $DIR/lifetime-doesnt-live-long-enough.rs:37:5
    |
-34 |     fn bar<'a, L: X<&'a Nested<Self>>>();
+37 |     fn bar<'a, L: X<&'a Nested<Self>>>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0309]: the parameter type `K` may not live long enough
-  --> $DIR/lifetime-doesnt-live-long-enough.rs:39:5
+  --> $DIR/lifetime-doesnt-live-long-enough.rs:43:5
    |
-38 |   impl<K> Nested<K> {
+42 |   impl<K> Nested<K> {
    |        - help: consider adding an explicit lifetime bound `K: 'a`...
-39 | /     fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
-40 | |     }
+43 | /     fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
+44 | |         //~^ ERROR may not live long enough
+45 | |     }
    | |_____^
    |
 note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
-  --> $DIR/lifetime-doesnt-live-long-enough.rs:39:5
+  --> $DIR/lifetime-doesnt-live-long-enough.rs:43:5
    |
-39 | /     fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
-40 | |     }
+43 | /     fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
+44 | |         //~^ ERROR may not live long enough
+45 | |     }
    | |_____^
 
 error[E0309]: the parameter type `M` may not live long enough
-  --> $DIR/lifetime-doesnt-live-long-enough.rs:41:5
+  --> $DIR/lifetime-doesnt-live-long-enough.rs:46:5
    |
-41 |       fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
+46 |       fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
    |       ^                                                -- help: consider adding an explicit lifetime bound `M: 'a`...
    |  _____|
    | |
-42 | |     }
+47 | |         //~^ ERROR may not live long enough
+48 | |     }
    | |_____^
    |
 note: ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
-  --> $DIR/lifetime-doesnt-live-long-enough.rs:41:5
+  --> $DIR/lifetime-doesnt-live-long-enough.rs:46:5
    |
-41 | /     fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
-42 | |     }
+46 | /     fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
+47 | |         //~^ ERROR may not live long enough
+48 | |     }
    | |_____^
 
 error: aborting due to 6 previous errors
index 1248601c1e44a37863ed1e0796716682ca35e219..6ffc9b5aa17015fe872daa4c0a1856215fbc301e 100644 (file)
@@ -11,5 +11,5 @@
 // compile-flags: -D bad-style
 
 fn main() {
-    let _InappropriateCamelCasing = true;
+    let _InappropriateCamelCasing = true; //~ ERROR should have a snake
 }
index 23fac66cc6c98f60ba85966bc8c10f565bd4ee3e..a6182de0a75873e9a09e7a4de18f71654a7e88f8 100644 (file)
@@ -1,7 +1,7 @@
 error: variable `_InappropriateCamelCasing` should have a snake case name such as `_inappropriate_camel_casing`
   --> $DIR/command-line-lint-group-deny.rs:14:9
    |
-14 |     let _InappropriateCamelCasing = true;
+14 |     let _InappropriateCamelCasing = true; //~ ERROR should have a snake
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D non-snake-case` implied by `-D bad-style`
index ae16db44864c98f85c3ea55440bb2fe32877de85..eb4645a4fc8dda3b52f03c61b99ed8e88782f622 100644 (file)
@@ -11,5 +11,5 @@
 // compile-flags: -F bad-style
 
 fn main() {
-    let _InappropriateCamelCasing = true;
+    let _InappropriateCamelCasing = true; //~ ERROR should have a snake
 }
index 0babd7f6fe47a06dbaccf37ad6790a8b15d2bb45..7ae6734c8a39760cb0f15cb464a9627f8e175f4d 100644 (file)
@@ -1,7 +1,7 @@
 error: variable `_InappropriateCamelCasing` should have a snake case name such as `_inappropriate_camel_casing`
   --> $DIR/command-line-lint-group-forbid.rs:14:9
    |
-14 |     let _InappropriateCamelCasing = true;
+14 |     let _InappropriateCamelCasing = true; //~ ERROR should have a snake
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-F non-snake-case` implied by `-F bad-style`
index 2bd760e417a89993974d12b0ed5dd7c74801df37..9f33f57f48a281aad0297646f125f26480aa68ae 100644 (file)
@@ -11,7 +11,7 @@
 #![deny(bad_style)]
 #![allow(dead_code)]
 
-fn CamelCase() {}
+fn CamelCase() {} //~ ERROR should have a snake
 
 #[allow(bad_style)]
 mod test {
@@ -19,17 +19,17 @@ fn CamelCase() {}
 
     #[forbid(bad_style)]
     mod bad {
-        fn CamelCase() {}
+        fn CamelCase() {} //~ ERROR should have a snake
 
-        static bad: isize = 1;
+        static bad: isize = 1; //~ ERROR should have an upper
     }
 
     mod warn {
         #![warn(bad_style)]
 
-        fn CamelCase() {}
+        fn CamelCase() {} //~ WARN should have a snake
 
-        struct snake_case;
+        struct snake_case; //~ WARN should have a camel
     }
 }
 
index 862e94b873a0c1faeb3f4775a52d8675d884e631..3dfe2cee991a0932d1da2032fdbdbf827aca4ff0 100644 (file)
@@ -1,7 +1,7 @@
 error: function `CamelCase` should have a snake case name such as `camel_case`
   --> $DIR/lint-group-style.rs:14:1
    |
-14 | fn CamelCase() {}
+14 | fn CamelCase() {} //~ ERROR should have a snake
    | ^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -14,7 +14,7 @@ note: lint level defined here
 error: function `CamelCase` should have a snake case name such as `camel_case`
   --> $DIR/lint-group-style.rs:22:9
    |
-22 |         fn CamelCase() {}
+22 |         fn CamelCase() {} //~ ERROR should have a snake
    |         ^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -27,7 +27,7 @@ note: lint level defined here
 error: static variable `bad` should have an upper case name such as `BAD`
   --> $DIR/lint-group-style.rs:24:9
    |
-24 |         static bad: isize = 1;
+24 |         static bad: isize = 1; //~ ERROR should have an upper
    |         ^^^^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -40,7 +40,7 @@ note: lint level defined here
 warning: function `CamelCase` should have a snake case name such as `camel_case`
   --> $DIR/lint-group-style.rs:30:9
    |
-30 |         fn CamelCase() {}
+30 |         fn CamelCase() {} //~ WARN should have a snake
    |         ^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -53,7 +53,7 @@ note: lint level defined here
 warning: type `snake_case` should have a camel case name such as `SnakeCase`
   --> $DIR/lint-group-style.rs:32:9
    |
-32 |         struct snake_case;
+32 |         struct snake_case; //~ WARN should have a camel
    |         ^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
index a79dacbc1c959c4388a8a597436f7f20fed30980..d72f307b46124f00bbebc1e0644e0b30155cbc81 100644 (file)
 
 #![forbid(unused, non_snake_case)]
 
-#[allow(unused_variables)]
+#[allow(unused_variables)] //~ ERROR overruled
 fn foo() {}
 
-#[allow(unused)]
+#[allow(unused)] //~ ERROR overruled
 fn bar() {}
 
-#[allow(bad_style)]
+#[allow(bad_style)] //~ ERROR overruled
 fn main() {
     println!("hello forbidden world")
 }
index 67a1f4f88adc64767addf31df7bcc2501c40674f..0bc4e4dcf5fd671bb81e2aeb1bdc5d52dc8522dd 100644 (file)
@@ -4,7 +4,7 @@ error[E0453]: allow(unused_variables) overruled by outer forbid(unused)
 17 | #![forbid(unused, non_snake_case)]
    |           ------ `forbid` level set here
 18 | 
-19 | #[allow(unused_variables)]
+19 | #[allow(unused_variables)] //~ ERROR overruled
    |         ^^^^^^^^^^^^^^^^ overruled by previous forbid
 
 error[E0453]: allow(unused) overruled by outer forbid(unused)
@@ -13,7 +13,7 @@ error[E0453]: allow(unused) overruled by outer forbid(unused)
 17 | #![forbid(unused, non_snake_case)]
    |           ------ `forbid` level set here
 ...
-22 | #[allow(unused)]
+22 | #[allow(unused)] //~ ERROR overruled
    |         ^^^^^^ overruled by previous forbid
 
 error[E0453]: allow(bad_style) overruled by outer forbid(non_snake_case)
@@ -22,7 +22,7 @@ error[E0453]: allow(bad_style) overruled by outer forbid(non_snake_case)
 17 | #![forbid(unused, non_snake_case)]
    |                   -------------- `forbid` level set here
 ...
-25 | #[allow(bad_style)]
+25 | #[allow(bad_style)] //~ ERROR overruled
    |         ^^^^^^^^^ overruled by previous forbid
 
 error: aborting due to 3 previous errors
index bf2b5769bf83047b01133ba5183e4c1e6957393e..3789b6dfc8b3a35994dbf31a4aca08900cb34cd1 100644 (file)
 #![feature(no_debug)]
 
 #[no_mangle] static SHENZHOU: usize = 1; // should suggest `pub`
+//~^ WARN static is marked #[no_mangle]
 #[no_mangle] const DISCOVERY: usize = 1; // should suggest `pub static` rather than `const`
+//~^ ERROR const items should never be #[no_mangle]
 
 #[no_mangle] // should suggest removal (generics can't be no-mangle)
 pub fn defiant<T>(_t: T) {}
+//~^ WARN functions generic over types must be mangled
 
 #[no_mangle]
 fn rio_grande() {} // should suggest `pub`
+//~^ WARN function is marked
 
 struct Equinox {
     warp_factor: f32,
 }
 
 #[no_debug] // should suggest removal of deprecated attribute
+//~^ WARN deprecated
 fn main() {
     while true { // should suggest `loop`
+    //~^ WARN denote infinite loops
         let mut a = (1); // should suggest no `mut`, no parens
+        //~^ WARN does not need to be mutable
+        //~| WARN unnecessary parentheses
         let d = Equinox { warp_factor: 9.975 };
         match d {
             Equinox { warp_factor: warp_factor } => {} // should suggest shorthand
+            //~^ WARN this pattern is redundant
         }
         println!("{}", a);
     }
index a00146668362a2c3d3a7ab4d3f57386aa472a44b..7b84cc1f4b4909d24e61c4140589275220323e55 100644 (file)
@@ -1,7 +1,7 @@
 warning: unnecessary parentheses around assigned value
-  --> $DIR/suggestions.rs:30:21
+  --> $DIR/suggestions.rs:36:21
    |
-30 |         let mut a = (1); // should suggest no `mut`, no parens
+36 |         let mut a = (1); // should suggest no `mut`, no parens
    |                     ^^^ help: remove these parentheses
    |
 note: lint level defined here
@@ -11,17 +11,17 @@ note: lint level defined here
    |                     ^^^^^^^^^^^^^
 
 warning: use of deprecated attribute `no_debug`: the `#[no_debug]` attribute was an experimental feature that has been deprecated due to lack of demand. See https://github.com/rust-lang/rust/issues/29721
-  --> $DIR/suggestions.rs:27:1
+  --> $DIR/suggestions.rs:31:1
    |
-27 | #[no_debug] // should suggest removal of deprecated attribute
+31 | #[no_debug] // should suggest removal of deprecated attribute
    | ^^^^^^^^^^^ help: remove this attribute
    |
    = note: #[warn(deprecated)] on by default
 
 warning: variable does not need to be mutable
-  --> $DIR/suggestions.rs:30:13
+  --> $DIR/suggestions.rs:36:13
    |
-30 |         let mut a = (1); // should suggest no `mut`, no parens
+36 |         let mut a = (1); // should suggest no `mut`, no parens
    |             ---^^
    |             |
    |             help: remove this `mut`
@@ -43,9 +43,9 @@ warning: static is marked #[no_mangle], but not exported
    = note: #[warn(private_no_mangle_statics)] on by default
 
 error: const items should never be #[no_mangle]
-  --> $DIR/suggestions.rs:15:14
+  --> $DIR/suggestions.rs:16:14
    |
-15 | #[no_mangle] const DISCOVERY: usize = 1; // should suggest `pub static` rather than `const`
+16 | #[no_mangle] const DISCOVERY: usize = 1; // should suggest `pub static` rather than `const`
    |              -----^^^^^^^^^^^^^^^^^^^^^^
    |              |
    |              help: try a static value: `pub static`
@@ -53,19 +53,19 @@ error: const items should never be #[no_mangle]
    = note: #[deny(no_mangle_const_items)] on by default
 
 warning: functions generic over types must be mangled
-  --> $DIR/suggestions.rs:18:1
+  --> $DIR/suggestions.rs:20:1
    |
-17 | #[no_mangle] // should suggest removal (generics can't be no-mangle)
+19 | #[no_mangle] // should suggest removal (generics can't be no-mangle)
    | ------------ help: remove this attribute
-18 | pub fn defiant<T>(_t: T) {}
+20 | pub fn defiant<T>(_t: T) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: #[warn(no_mangle_generic_items)] on by default
 
 warning: function is marked #[no_mangle], but not exported
-  --> $DIR/suggestions.rs:21:1
+  --> $DIR/suggestions.rs:24:1
    |
-21 | fn rio_grande() {} // should suggest `pub`
+24 | fn rio_grande() {} // should suggest `pub`
    | -^^^^^^^^^^^^^^^^^
    | |
    | help: try making it public: `pub `
@@ -73,27 +73,27 @@ warning: function is marked #[no_mangle], but not exported
    = note: #[warn(private_no_mangle_fns)] on by default
 
 warning: denote infinite loops with `loop { ... }`
-  --> $DIR/suggestions.rs:29:5
+  --> $DIR/suggestions.rs:34:5
    |
-29 |       while true { // should suggest `loop`
+34 |       while true { // should suggest `loop`
    |       ^---------
    |       |
    |  _____help: use `loop`
    | |
-30 | |         let mut a = (1); // should suggest no `mut`, no parens
-31 | |         let d = Equinox { warp_factor: 9.975 };
-32 | |         match d {
+35 | |     //~^ WARN denote infinite loops
+36 | |         let mut a = (1); // should suggest no `mut`, no parens
+37 | |         //~^ WARN does not need to be mutable
 ...  |
-35 | |         println!("{}", a);
-36 | |     }
+44 | |         println!("{}", a);
+45 | |     }
    | |_____^
    |
    = note: #[warn(while_true)] on by default
 
 warning: the `warp_factor:` in this pattern is redundant
-  --> $DIR/suggestions.rs:33:23
+  --> $DIR/suggestions.rs:41:23
    |
-33 |             Equinox { warp_factor: warp_factor } => {} // should suggest shorthand
+41 |             Equinox { warp_factor: warp_factor } => {} // should suggest shorthand
    |                       ------------^^^^^^^^^^^^
    |                       |
    |                       help: remove this
index b52d540fd75119dc5d24c87f7ca06f9888f5a4ab..f24840eca54416002f45cea24243e1f46ff68bb1 100644 (file)
@@ -19,6 +19,6 @@
 
 fn main() {
     for _ in &[1,2,3] {
-        break 22
+        break 22 //~ ERROR `break` with value from a `for` loop
     }
 }
index c154ea6f8c2d68e76a7ff04e24ad6b2a5b2b5017..296b3b191e319e93ec0ddbf5c8ee7219401fcdee 100644 (file)
@@ -1,7 +1,7 @@
 error[E0571]: `break` with value from a `for` loop
   --> $DIR/loop-break-value-no-repeat.rs:22:9
    |
-22 |         break 22
+22 |         break 22 //~ ERROR `break` with value from a `for` loop
    |         ^^^^^^^^ can only break with a value inside `loop`
 
 error: aborting due to previous error
index 85c90bb375fc7a57a25a2b6cf686aba76a7eeb73..7526b2f946c12a8dadb19b10db97621d9884f1ed 100644 (file)
@@ -15,7 +15,7 @@ fn foo(
     x: fn(&u8, &u8),
     y: for<'a> fn(&'a u8, &'a u8),
 ) {
-    let z = match 22 {
+    let z = match 22 { //~ ERROR incompatible types
         0 => x,
         _ => y,
     };
index 4a310a5e6b29685b3f0230bf43fb1e41f4754e49..72d9787b93aed1046aa9c06ca493618f6fe992ad 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: match arms have incompatible types
   --> $DIR/old-lub-glb-hr.rs:18:13
    |
-18 |       let z = match 22 {
+18 |       let z = match 22 { //~ ERROR incompatible types
    |  _____________^
 19 | |         0 => x,
 20 | |         _ => y,
index 7cf89b68be197534198de2d574a515e32bfb8f5d..63dcfa3fc1e91274c55304905071132b903e2ca9 100644 (file)
@@ -17,7 +17,7 @@ fn foo(
     x: &for<'a, 'b> Foo<&'a u8, &'b u8>,
     y: &for<'a> Foo<&'a u8, &'a u8>,
 ) {
-    let z = match 22 {
+    let z = match 22 { //~ ERROR incompatible types
         0 => x,
         _ => y,
     };
index a1077f40bf561082d8936d7cb29aef27a0f142cb..852f74b4e7542b7230a3e97f4fee39867d4108ae 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: match arms have incompatible types
   --> $DIR/old-lub-glb-object.rs:20:13
    |
-20 |       let z = match 22 {
+20 |       let z = match 22 { //~ ERROR incompatible types
    |  _____________^
 21 | |         0 => x,
 22 | |         _ => y,
index 488aeddbf549b1fba0712c63e73f1a56fbcb5ea9..ec9218e3ec001a30f3c488a296dfb9eecafbcfb8 100644 (file)
@@ -16,7 +16,8 @@
 
 // a local macro
 macro_rules! pong {
-    () => { syntax error };
+    () => { syntax error }; //~ ERROR expected one of
+    //~^ ERROR expected one of
 }
 
 fn main() {
index 37f3d450215727eebcd793a9d713d80f7ecc5e1a..e8434a79f4490e1775b60cd9e59216fe9ea82f7f 100644 (file)
@@ -1,20 +1,20 @@
 error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error`
   --> $DIR/main.rs:19:20
    |
-19 |     () => { syntax error };
+19 |     () => { syntax error }; //~ ERROR expected one of
    |                   -^^^^^ unexpected token
    |                   |
    |                   expected one of 8 possible tokens here
-$DIR/main.rs:23:5: 23:13 note: in this expansion of pong! (defined in $DIR/main.rs)
+$DIR/main.rs:24:5: 24:13 note: in this expansion of pong! (defined in $DIR/main.rs)
 
 error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error`
   --> $DIR/main.rs:19:20
    |
-19 |     () => { syntax error };
+19 |     () => { syntax error }; //~ ERROR expected one of
    |                   -^^^^^ unexpected token
    |                   |
    |                   expected one of 8 possible tokens here
-$DIR/main.rs:24:5: 24:13 note: in this expansion of ping! (defined in <ping macros>)
+$DIR/main.rs:25:5: 25:13 note: in this expansion of ping! (defined in <ping macros>)
 <ping macros>:1:11: 1:24 note: in this expansion of pong! (defined in $DIR/main.rs)
 
 error: aborting due to 2 previous errors
index a18771deacee7c16775986eb67276da7e545562a..174dcc9b6cd3f543b5688c9b27a2fd63109e667d 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    println!(3 + 4);
+    println!(3 + 4); //~ ERROR expected a literal
 }
index bffb33f468fc886c7c10433111713bb242add472..825aa64e40f525d0f2b5fa343ee2e957cd438190 100644 (file)
@@ -1,7 +1,7 @@
 error: expected a literal
   --> $DIR/bad_hello.rs:12:14
    |
-12 |     println!(3 + 4);
+12 |     println!(3 + 4); //~ ERROR expected a literal
    |              ^^^^^
 
 error: aborting due to previous error
index cca45ca9ecdd9fe6a4f62005995269e93f0d116b..91ca8f5ff76025f7c171fae31c629617a1ea1284 100644 (file)
 
 fn main() {
     println!("%.*3$s %s!\n", "Hello,", "World", 4);
-    println!("%1$*2$.*3$f", 123.456);
+    println!("%1$*2$.*3$f", 123.456); //~ ERROR never used
 
     // This should *not* produce hints, on the basis that there's equally as
     // many "correct" format specifiers.  It's *probably* just an actual typo.
-    println!("{} %f", "one", 2.0);
+    println!("{} %f", "one", 2.0); //~ ERROR never used
 
-    println!("Hi there, $NAME.", NAME="Tim");
+    println!("Hi there, $NAME.", NAME="Tim"); //~ ERROR never used
 }
index cb27bb2281d263a17e41ef3edc9434f519355467..95f348b8b8b006a5a16854df4e8fbda42575d78c 100644 (file)
@@ -16,7 +16,7 @@ error: multiple unused formatting arguments
 error: argument never used
   --> $DIR/format-foreign.rs:13:29
    |
-13 |     println!("%1$*2$.*3$f", 123.456);
+13 |     println!("%1$*2$.*3$f", 123.456); //~ ERROR never used
    |                             ^^^^^^^
    |
    = help: `%1$*2$.*3$f` should be written as `{0:1$.2$}`
@@ -25,13 +25,13 @@ error: argument never used
 error: argument never used
   --> $DIR/format-foreign.rs:17:30
    |
-17 |     println!("{} %f", "one", 2.0);
+17 |     println!("{} %f", "one", 2.0); //~ ERROR never used
    |                              ^^^
 
 error: named argument never used
   --> $DIR/format-foreign.rs:19:39
    |
-19 |     println!("Hi there, $NAME.", NAME="Tim");
+19 |     println!("Hi there, $NAME.", NAME="Tim"); //~ ERROR never used
    |                                       ^^^^^
    |
    = help: `$NAME` should be written as `{NAME}`
index f1e349ea9f43163b475770cf16482e7adbef1efe..7a32d932ba3863d822eec6dc5323d7201d89fd8a 100644 (file)
@@ -17,7 +17,7 @@ fn main() {
         789
     );
 
-    println!("Some stuff", UNUSED="args");
+    println!("Some stuff", UNUSED="args"); //~ ERROR named argument never used
 
     println!("Some more $STUFF",
         "woo!",
index 0205e9a9bfca3263e77dacd14676a6ede6edc1a2..01d3577a7c92d7b8863e2a16818dd28d112875c8 100644 (file)
@@ -28,7 +28,7 @@ error: multiple unused formatting arguments
 error: named argument never used
   --> $DIR/format-unused-lables.rs:20:35
    |
-20 |     println!("Some stuff", UNUSED="args");
+20 |     println!("Some stuff", UNUSED="args"); //~ ERROR named argument never used
    |                                   ^^^^^^
 
 error: multiple unused formatting arguments
index 546e06b6c79f3888b0d2219f1d3fca976ad902f9..037f0d839e2b689aab689bcb8fb2598ceefb5bf4 100644 (file)
 
 macro_rules! fake_method_stmt {
      () => {
-          1.fake()
+          1.fake() //~ ERROR no method
      }
 }
 
 macro_rules! fake_field_stmt {
      () => {
-          1.fake
+          1.fake //~ ERROR doesn't have fields
      }
 }
 
 macro_rules! fake_anon_field_stmt {
      () => {
-          (1).0
+          (1).0 //~ ERROR no field
      }
 }
 
 macro_rules! fake_method_expr {
      () => {
-          1.fake()
+          1.fake() //~ ERROR no method
      }
 }
 
 macro_rules! fake_field_expr {
      () => {
-          1.fake
+          1.fake //~ ERROR doesn't have fields
      }
 }
 
 macro_rules! fake_anon_field_expr {
      () => {
-          (1).0
+          (1).0 //~ ERROR no field
      }
 }
 
index c80c0fce35806c47c93709ea05fb1f836390213b..42144f63c371021e6d869629c337599f65073eda 100644 (file)
@@ -1,7 +1,7 @@
 error[E0599]: no method named `fake` found for type `{integer}` in the current scope
   --> $DIR/macro-backtrace-invalid-internals.rs:15:13
    |
-15 |           1.fake()
+15 |           1.fake() //~ ERROR no method
    |             ^^^^
 ...
 50 |     fake_method_stmt!();
@@ -10,7 +10,7 @@ error[E0599]: no method named `fake` found for type `{integer}` in the current s
 error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
   --> $DIR/macro-backtrace-invalid-internals.rs:21:13
    |
-21 |           1.fake
+21 |           1.fake //~ ERROR doesn't have fields
    |             ^^^^
 ...
 51 |     fake_field_stmt!();
@@ -19,7 +19,7 @@ error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
 error[E0609]: no field `0` on type `{integer}`
   --> $DIR/macro-backtrace-invalid-internals.rs:27:11
    |
-27 |           (1).0
+27 |           (1).0 //~ ERROR no field
    |           ^^^^^
 ...
 52 |     fake_anon_field_stmt!();
@@ -28,7 +28,7 @@ error[E0609]: no field `0` on type `{integer}`
 error[E0599]: no method named `fake` found for type `{integer}` in the current scope
   --> $DIR/macro-backtrace-invalid-internals.rs:33:13
    |
-33 |           1.fake()
+33 |           1.fake() //~ ERROR no method
    |             ^^^^
 ...
 54 |     let _ = fake_method_expr!();
@@ -37,7 +37,7 @@ error[E0599]: no method named `fake` found for type `{integer}` in the current s
 error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
   --> $DIR/macro-backtrace-invalid-internals.rs:39:13
    |
-39 |           1.fake
+39 |           1.fake //~ ERROR doesn't have fields
    |             ^^^^
 ...
 55 |     let _ = fake_field_expr!();
@@ -46,7 +46,7 @@ error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
 error[E0609]: no field `0` on type `{integer}`
   --> $DIR/macro-backtrace-invalid-internals.rs:45:11
    |
-45 |           (1).0
+45 |           (1).0 //~ ERROR no field
    |           ^^^^^
 ...
 56 |     let _ = fake_anon_field_expr!();
index d8bf6222c1c2c6fd174ac637e94c02afe127bc0e..d261633c60c8649137c9de7ffc19c87ce10d1471 100644 (file)
@@ -12,7 +12,8 @@
 // we replace the span of the expanded expression with that of the call site.
 
 macro_rules! nested_expr {
-    () => (fake)
+    () => (fake) //~ ERROR cannot find
+    //~^ ERROR cannot find
 }
 
 macro_rules! call_nested_expr {
index 8b69d112d4d42b8390db27b5a03056557656aa02..ee4a38312e289497ab4e5cdbdab1d0f23d0f2137 100644 (file)
@@ -1,19 +1,19 @@
 error[E0425]: cannot find value `fake` in this scope
   --> $DIR/macro-backtrace-nested.rs:15:12
    |
-15 |     () => (fake)
+15 |     () => (fake) //~ ERROR cannot find
    |            ^^^^ not found in this scope
 ...
-27 |     1 + call_nested_expr!();
+28 |     1 + call_nested_expr!();
    |         ------------------- in this macro invocation
 
 error[E0425]: cannot find value `fake` in this scope
   --> $DIR/macro-backtrace-nested.rs:15:12
    |
-15 |     () => (fake)
+15 |     () => (fake) //~ ERROR cannot find
    |            ^^^^ not found in this scope
 ...
-28 |     call_nested_expr_sum!();
+29 |     call_nested_expr_sum!();
    |     ------------------------ in this macro invocation
 
 error: aborting due to 2 previous errors
index baf276919a5e8f130b0c4fb2914ce28d689a8728..6f035bc9d2355f235d703863b025f832d4ab4575 100644 (file)
@@ -21,7 +21,7 @@ macro_rules! myprint {
 }
 
 macro_rules! myprintln {
-    ($fmt:expr) => (myprint!(concat!($fmt, "\n")));
+    ($fmt:expr) => (myprint!(concat!($fmt, "\n"))); //~ ERROR no arguments were given
 }
 
 fn main() {
index 3e782294484e795570a7d284e9c876bd0a849b2b..c587654d880a0a2e481355652aa8441f116eaf9a 100644 (file)
@@ -1,7 +1,7 @@
 error: 1 positional argument in format string, but no arguments were given
   --> $DIR/macro-backtrace-println.rs:24:30
    |
-24 |     ($fmt:expr) => (myprint!(concat!($fmt, "/n")));
+24 |     ($fmt:expr) => (myprint!(concat!($fmt, "/n"))); //~ ERROR no arguments were given
    |                              ^^^^^^^^^^^^^^^^^^^
 ...
 28 |     myprintln!("{}");
index ec8d27f9138f7dcfccf8c580cc7d85f93a0f45f3..7fadbf2a90bba714f7bd70bccbca12cc484b5267 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    printlx!("oh noes!");
+    printlx!("oh noes!"); //~ ERROR cannot find
 }
index 7c83250fe8ada41bbadbd2877fa0a056d178f0bb..84851749c70743def79d7fb781c1187338aa07c2 100644 (file)
@@ -1,7 +1,7 @@
 error: cannot find macro `printlx!` in this scope
   --> $DIR/macro-name-typo.rs:12:5
    |
-12 |     printlx!("oh noes!");
+12 |     printlx!("oh noes!"); //~ ERROR cannot find
    |     ^^^^^^^ help: you could try the macro: `println!`
 
 error: aborting due to previous error
index 781ea30ed8bc33750aed3d829bdde1f696ac200b..85cf597489da92fc57011606730001fffce82e95 100644 (file)
@@ -14,6 +14,6 @@ macro_rules! foo(($t:path) => {
     impl<T: $t> Foo for T {}
 });
 
-foo!(m::m2::A);
+foo!(m::m2::A); //~ ERROR failed to resolve
 
 fn main() {}
index 5c3bb66d83a87728a273db0d2b72d91435b2eed7..d59bcaa316e5d3ca0447e54e75f32dea1d34f215 100644 (file)
@@ -1,7 +1,7 @@
 error[E0433]: failed to resolve. Use of undeclared type or module `m`
   --> $DIR/macro_path_as_generic_bound.rs:17:6
    |
-17 | foo!(m::m2::A);
+17 | foo!(m::m2::A); //~ ERROR failed to resolve
    |      ^ Use of undeclared type or module `m`
 
 error: cannot continue compilation due to previous error
index db93ba5e2c41dd3f2e3a304c1837230b885622a1..c0acbc979ad1f8c49fdb828608dec6b56b6f1b30 100644 (file)
@@ -18,6 +18,6 @@ macro_rules! kl {
 }
 
 fn main() {
-    k!();
-    kl!();
+    k!(); //~ ERROR cannot find
+    kl!(); //~ ERROR cannot find
 }
index 5c33ae99734e827ada9d56ac7e18a173ae597812..6cfb05e786703d232faad158d4c52817d48b8d4a 100644 (file)
@@ -1,7 +1,7 @@
 error: cannot find macro `kl!` in this scope
   --> $DIR/macro_undefined.rs:22:5
    |
-22 |     kl!();
+22 |     kl!(); //~ ERROR cannot find
    |     ^^
    |
    = help: have you added the `#[macro_use]` on the module/import?
@@ -9,7 +9,7 @@ error: cannot find macro `kl!` in this scope
 error: cannot find macro `k!` in this scope
   --> $DIR/macro_undefined.rs:21:5
    |
-21 |     k!();
+21 |     k!(); //~ ERROR cannot find
    |     ^ help: you could try the macro: `kl!`
 
 error: aborting due to 2 previous errors
index eb7292b0a652bd3b28d2e361e8cf5b3750ae11ec..ced1a7f68fb53ff31c031ff1c484fa3581d911f9 100644 (file)
@@ -14,7 +14,7 @@
 
 macro_rules! my_faulty_macro {
     () => {
-        my_faulty_macro!(bcd);
+        my_faulty_macro!(bcd); //~ ERROR no rules
     };
 }
 
@@ -29,7 +29,7 @@ macro_rules! pat_macro {
 
 macro_rules! my_recursive_macro {
     () => {
-        my_recursive_macro!();
+        my_recursive_macro!(); //~ ERROR recursion limit
     };
 }
 
index f4aeb8332f0b0643af61e8e8edf321e2159555a6..b0e4a56a3d1d6bccfa42d67088d6610316d83f2e 100644 (file)
@@ -1,7 +1,7 @@
 error: no rules expected the token `bcd`
   --> $DIR/trace_faulty_macros.rs:17:26
    |
-17 |         my_faulty_macro!(bcd);
+17 |         my_faulty_macro!(bcd); //~ ERROR no rules
    |                          ^^^
 ...
 43 |     my_faulty_macro!();
@@ -20,7 +20,7 @@ note: trace_macro
 error: recursion limit reached while expanding the macro `my_recursive_macro`
   --> $DIR/trace_faulty_macros.rs:32:9
    |
-32 |         my_recursive_macro!();
+32 |         my_recursive_macro!(); //~ ERROR recursion limit
    |         ^^^^^^^^^^^^^^^^^^^^^^
 ...
 44 |     my_recursive_macro!();
index 14fa74d1f32e55b33b22a3632194aca8d40ed982..37806e43a9d1ca362a0a7fb3f212d725cb47dd51 100644 (file)
@@ -10,7 +10,7 @@
 
 // Test that parameter cardinality or missing method error gets span exactly.
 
-pub struct Foo;
+pub struct Foo; //~ NOTE not found for this
 impl Foo {
     fn zero(self) -> Foo { self }
     //~^ NOTE defined here
index 1d4558cad6717ed8be652093edc02b9e0ee9e089..472879261ef01212e9a3fd931fc00776a8a21a92 100644 (file)
@@ -28,7 +28,7 @@ error[E0061]: this function takes 2 parameters but 1 parameter was supplied
 error[E0599]: no method named `take` found for type `Foo` in the current scope
   --> $DIR/method-call-err-msg.rs:34:7
    |
-13 | pub struct Foo;
+13 | pub struct Foo; //~ NOTE not found for this
    | --------------- method `take` not found for this
 ...
 34 |      .take()    //~ ERROR no method named `take` found for type `Foo` in the current scope
index 933462e553e3b6db5afd3120201397d5d5307c9c..f82f3fb0fa4f7f0b8edbabc37bb1ff7314a9744d 100644 (file)
@@ -19,11 +19,11 @@ impl Foo for Bar {
     fn foo(x: i16) { }
     //~^ ERROR method `foo` has an incompatible type for trait
     //~| NOTE expected u16
+    //~| NOTE expected type `fn(u16)`
     fn bar(&mut self) { }
     //~^ ERROR method `bar` has an incompatible type for trait
     //~| NOTE types differ in mutability
     //~| NOTE expected type `fn(&Bar)`
-    //~| NOTE found type `fn(&mut Bar)`
 }
 
 fn main() {
index d9871b8970c5cf22b1cd32b70b5b34bbc8f4c32d..b80363e3d3e1a51effe36fe40210b0a5d93a6cfd 100644 (file)
@@ -11,12 +11,12 @@ error[E0053]: method `foo` has an incompatible type for trait
               found type `fn(i16)`
 
 error[E0053]: method `bar` has an incompatible type for trait
-  --> $DIR/E0053.rs:22:12
+  --> $DIR/E0053.rs:23:12
    |
 13 |     fn bar(&self); //~ NOTE type in trait
    |            ----- type in trait
 ...
-22 |     fn bar(&mut self) { }
+23 |     fn bar(&mut self) { }
    |            ^^^^^^^^^ types differ in mutability
    |
    = note: expected type `fn(&Bar)`
index e89cc9ea5cbf26b19a7df4503d1a9f318ced1980..17bbc3f24336f1eb9acaaffe3986793aceb0309f 100644 (file)
@@ -18,7 +18,6 @@ fn main() {
                                   //~| ERROR E0308
                                   //~| NOTE expected &{integer}, found integral variable
                                   //~| NOTE expected type `&{integer}`
-                                  //~| NOTE    found type `{integer}`
         _ => ()
     }
 }
index e28f15ab0b62e4466e123f034168567b61c9acaa..7e5490b37c43e9f754ec9535b99b363082ba688e 100644 (file)
@@ -14,8 +14,8 @@ fn foo<F: Fn(usize)>(_: F) {}
 fn bar<F: Fn<usize>>(_: F) {}
 fn main() {
     fn f(_: u64) {}
-    foo(|_: isize| {});
-    bar(|_: isize| {});
-    foo(f);
-    bar(f);
+    foo(|_: isize| {}); //~ ERROR type mismatch
+    bar(|_: isize| {}); //~ ERROR type mismatch
+    foo(f); //~ ERROR type mismatch
+    bar(f); //~ ERROR type mismatch
 }
index 235e7a100633d6e91b02f2d0207961fa531891bb..33a68a29ddca3b9db24095d5adf959f93b483c83 100644 (file)
@@ -1,7 +1,7 @@
 error[E0631]: type mismatch in closure arguments
   --> $DIR/E0631.rs:17:5
    |
-17 |     foo(|_: isize| {});
+17 |     foo(|_: isize| {}); //~ ERROR type mismatch
    |     ^^^ ------------- found signature of `fn(isize) -> _`
    |     |
    |     expected signature of `fn(usize) -> _`
@@ -11,7 +11,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/E0631.rs:18:5
    |
-18 |     bar(|_: isize| {});
+18 |     bar(|_: isize| {}); //~ ERROR type mismatch
    |     ^^^ ------------- found signature of `fn(isize) -> _`
    |     |
    |     expected signature of `fn(usize) -> _`
@@ -21,7 +21,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in function arguments
   --> $DIR/E0631.rs:19:5
    |
-19 |     foo(f);
+19 |     foo(f); //~ ERROR type mismatch
    |     ^^^
    |     |
    |     expected signature of `fn(usize) -> _`
@@ -32,7 +32,7 @@ error[E0631]: type mismatch in function arguments
 error[E0631]: type mismatch in function arguments
   --> $DIR/E0631.rs:20:5
    |
-20 |     bar(f);
+20 |     bar(f); //~ ERROR type mismatch
    |     ^^^
    |     |
    |     expected signature of `fn(usize) -> _`
index 03f889224bedcd4771c667b67b583ae4256e09f6..f496df58f734eb931f4a2924b71bea1d9bc819e6 100644 (file)
@@ -23,19 +23,19 @@ struct X<T1, T2> {
 }
 
 fn a() -> Foo {
-    Some(Foo { bar: 1 })
+    Some(Foo { bar: 1 }) //~ ERROR mismatched types
 }
 
 fn a2() -> Foo {
-    Ok(Foo { bar: 1})
+    Ok(Foo { bar: 1}) //~ ERROR mismatched types
 }
 
 fn b() -> Option<Foo> {
-    Foo { bar: 1 }
+    Foo { bar: 1 } //~ ERROR mismatched types
 }
 
 fn c() -> Result<Foo, Bar> {
-    Foo { bar: 1 }
+    Foo { bar: 1 } //~ ERROR mismatched types
 }
 
 fn d() -> X<X<String, String>, String> {
@@ -46,7 +46,7 @@ fn d() -> X<X<String, String>, String> {
         },
         y: 3,
     };
-    x
+    x //~ ERROR mismatched types
 }
 
 fn e() -> X<X<String, String>, String> {
@@ -57,7 +57,7 @@ fn e() -> X<X<String, String>, String> {
         },
         y: "".to_string(),
     };
-    x
+    x //~ ERROR mismatched types
 }
 
 fn main() {}
index 8c63d7d6f91c5267666d4f9a8d979e2132cd4cf4..2e1e5afad32c10dd5499be87e7a14f43c89a54ff 100644 (file)
@@ -3,7 +3,7 @@ error[E0308]: mismatched types
    |
 25 | fn a() -> Foo {
    |           --- expected `Foo` because of return type
-26 |     Some(Foo { bar: 1 })
+26 |     Some(Foo { bar: 1 }) //~ ERROR mismatched types
    |     ^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `std::option::Option`
    |
    = note: expected type `Foo`
@@ -14,7 +14,7 @@ error[E0308]: mismatched types
    |
 29 | fn a2() -> Foo {
    |            --- expected `Foo` because of return type
-30 |     Ok(Foo { bar: 1})
+30 |     Ok(Foo { bar: 1}) //~ ERROR mismatched types
    |     ^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `std::result::Result`
    |
    = note: expected type `Foo`
@@ -25,7 +25,7 @@ error[E0308]: mismatched types
    |
 33 | fn b() -> Option<Foo> {
    |           ----------- expected `std::option::Option<Foo>` because of return type
-34 |     Foo { bar: 1 }
+34 |     Foo { bar: 1 } //~ ERROR mismatched types
    |     ^^^^^^^^^^^^^^ expected enum `std::option::Option`, found struct `Foo`
    |
    = note: expected type `std::option::Option<Foo>`
@@ -36,7 +36,7 @@ error[E0308]: mismatched types
    |
 37 | fn c() -> Result<Foo, Bar> {
    |           ---------------- expected `std::result::Result<Foo, Bar>` because of return type
-38 |     Foo { bar: 1 }
+38 |     Foo { bar: 1 } //~ ERROR mismatched types
    |     ^^^^^^^^^^^^^^ expected enum `std::result::Result`, found struct `Foo`
    |
    = note: expected type `std::result::Result<Foo, Bar>`
@@ -48,7 +48,7 @@ error[E0308]: mismatched types
 41 | fn d() -> X<X<String, String>, String> {
    |           ---------------------------- expected `X<X<std::string::String, std::string::String>, std::string::String>` because of return type
 ...
-49 |     x
+49 |     x //~ ERROR mismatched types
    |     ^ expected struct `std::string::String`, found integral variable
    |
    = note: expected type `X<X<_, std::string::String>, std::string::String>`
@@ -60,7 +60,7 @@ error[E0308]: mismatched types
 52 | fn e() -> X<X<String, String>, String> {
    |           ---------------------------- expected `X<X<std::string::String, std::string::String>, std::string::String>` because of return type
 ...
-60 |     x
+60 |     x //~ ERROR mismatched types
    |     ^ expected struct `std::string::String`, found integral variable
    |
    = note: expected type `X<X<_, std::string::String>, _>`
index 98449e596641e36cad7934ffb087d4096aa33fde..e45616cd67a811419117cc16d6152700e250f66f 100644 (file)
@@ -9,10 +9,10 @@
 // except according to those terms.
 
 fn main() {
-    1 + Some(1);
-    2 as usize - Some(1);
-    3 * ();
-    4 / "";
-    5 < String::new();
-    6 == Ok(1);
+    1 + Some(1); //~ ERROR is not satisfied
+    2 as usize - Some(1); //~ ERROR is not satisfied
+    3 * (); //~ ERROR is not satisfied
+    4 / ""; //~ ERROR is not satisfied
+    5 < String::new(); //~ ERROR is not satisfied
+    6 == Ok(1); //~ ERROR is not satisfied
 }
index 6d1a39e0d93c04554f7ccec483b0fa05226deeb4..8541ad52e017759327d01e0292245baad00d2485 100644 (file)
@@ -1,7 +1,7 @@
 error[E0277]: the trait bound `{integer}: std::ops::Add<std::option::Option<{integer}>>` is not satisfied
   --> $DIR/binops.rs:12:7
    |
-12 |     1 + Some(1);
+12 |     1 + Some(1); //~ ERROR is not satisfied
    |       ^ no implementation for `{integer} + std::option::Option<{integer}>`
    |
    = help: the trait `std::ops::Add<std::option::Option<{integer}>>` is not implemented for `{integer}`
@@ -9,7 +9,7 @@ error[E0277]: the trait bound `{integer}: std::ops::Add<std::option::Option<{int
 error[E0277]: the trait bound `usize: std::ops::Sub<std::option::Option<{integer}>>` is not satisfied
   --> $DIR/binops.rs:13:16
    |
-13 |     2 as usize - Some(1);
+13 |     2 as usize - Some(1); //~ ERROR is not satisfied
    |                ^ no implementation for `usize - std::option::Option<{integer}>`
    |
    = help: the trait `std::ops::Sub<std::option::Option<{integer}>>` is not implemented for `usize`
@@ -17,7 +17,7 @@ error[E0277]: the trait bound `usize: std::ops::Sub<std::option::Option<{integer
 error[E0277]: the trait bound `{integer}: std::ops::Mul<()>` is not satisfied
   --> $DIR/binops.rs:14:7
    |
-14 |     3 * ();
+14 |     3 * (); //~ ERROR is not satisfied
    |       ^ no implementation for `{integer} * ()`
    |
    = help: the trait `std::ops::Mul<()>` is not implemented for `{integer}`
@@ -25,7 +25,7 @@ error[E0277]: the trait bound `{integer}: std::ops::Mul<()>` is not satisfied
 error[E0277]: the trait bound `{integer}: std::ops::Div<&str>` is not satisfied
   --> $DIR/binops.rs:15:7
    |
-15 |     4 / "";
+15 |     4 / ""; //~ ERROR is not satisfied
    |       ^ no implementation for `{integer} / &str`
    |
    = help: the trait `std::ops::Div<&str>` is not implemented for `{integer}`
@@ -33,7 +33,7 @@ error[E0277]: the trait bound `{integer}: std::ops::Div<&str>` is not satisfied
 error[E0277]: the trait bound `{integer}: std::cmp::PartialOrd<std::string::String>` is not satisfied
   --> $DIR/binops.rs:16:7
    |
-16 |     5 < String::new();
+16 |     5 < String::new(); //~ ERROR is not satisfied
    |       ^ can't compare `{integer}` with `std::string::String`
    |
    = help: the trait `std::cmp::PartialOrd<std::string::String>` is not implemented for `{integer}`
@@ -41,7 +41,7 @@ error[E0277]: the trait bound `{integer}: std::cmp::PartialOrd<std::string::Stri
 error[E0277]: the trait bound `{integer}: std::cmp::PartialEq<std::result::Result<{integer}, _>>` is not satisfied
   --> $DIR/binops.rs:17:7
    |
-17 |     6 == Ok(1);
+17 |     6 == Ok(1); //~ ERROR is not satisfied
    |       ^^ can't compare `{integer}` with `std::result::Result<{integer}, _>`
    |
    = help: the trait `std::cmp::PartialEq<std::result::Result<{integer}, _>>` is not implemented for `{integer}`
index f72be0d7054dbc4311a1f0d98b280ef99a202dfe..15388b3a7647f9625e894f76069a61ce6ca8deb0 100644 (file)
 
 fn illegal_cast<U:?Sized,V:?Sized>(u: *const U) -> *const V
 {
-    u as *const V
+    u as *const V //~ ERROR is invalid
 }
 
 fn illegal_cast_2<U:?Sized>(u: *const U) -> *const str
 {
-    u as *const str
+    u as *const str //~ ERROR is invalid
 }
 
 trait Foo { fn foo(&self) {} }
@@ -36,47 +36,47 @@ fn main()
     let fat_sv : *const [i8] = unsafe { &*(0 as *const [i8; 1])};
     let foo: &Foo = &f;
 
-    let _ = v as &u8;
-    let _ = v as E;
-    let _ = v as fn();
-    let _ = v as (u32,);
-    let _ = Some(&v) as *const u8;
+    let _ = v as &u8; //~ ERROR non-primitive cast
+    let _ = v as E; //~ ERROR non-primitive cast
+    let _ = v as fn(); //~ ERROR non-primitive cast
+    let _ = v as (u32,); //~ ERROR non-primitive cast
+    let _ = Some(&v) as *const u8; //~ ERROR non-primitive cast
 
-    let _ = v as f32;
-    let _ = main as f64;
-    let _ = &v as usize;
-    let _ = f as *const u8;
-    let _ = 3_i32 as bool;
-    let _ = E::A as bool;
-    let _ = 0x61u32 as char;
+    let _ = v as f32; //~ ERROR is invalid
+    let _ = main as f64; //~ ERROR is invalid
+    let _ = &v as usize; //~ ERROR is invalid
+    let _ = f as *const u8; //~ ERROR is invalid
+    let _ = 3_i32 as bool; //~ ERROR cannot cast
+    let _ = E::A as bool; //~ ERROR cannot cast
+    let _ = 0x61u32 as char; //~ ERROR can be cast as
 
-    let _ = false as f32;
-    let _ = E::A as f32;
-    let _ = 'a' as f32;
+    let _ = false as f32; //~ ERROR is invalid
+    let _ = E::A as f32; //~ ERROR is invalid
+    let _ = 'a' as f32; //~ ERROR is invalid
 
-    let _ = false as *const u8;
-    let _ = E::A as *const u8;
-    let _ = 'a' as *const u8;
+    let _ = false as *const u8; //~ ERROR is invalid
+    let _ = E::A as *const u8; //~ ERROR is invalid
+    let _ = 'a' as *const u8; //~ ERROR is invalid
 
-    let _ = 42usize as *const [u8];
-    let _ = v as *const [u8];
-    let _ = fat_v as *const Foo;
-    let _ = foo as *const str;
-    let _ = foo as *mut str;
-    let _ = main as *mut str;
-    let _ = &f as *mut f32;
-    let _ = &f as *const f64;
-    let _ = fat_sv as usize;
+    let _ = 42usize as *const [u8]; //~ ERROR is invalid
+    let _ = v as *const [u8]; //~ ERROR cannot cast
+    let _ = fat_v as *const Foo; //~ ERROR is not satisfied
+    let _ = foo as *const str; //~ ERROR is invalid
+    let _ = foo as *mut str; //~ ERROR is invalid
+    let _ = main as *mut str; //~ ERROR is invalid
+    let _ = &f as *mut f32; //~ ERROR is invalid
+    let _ = &f as *const f64; //~ ERROR is invalid
+    let _ = fat_sv as usize; //~ ERROR is invalid
 
     let a : *const str = "hello";
-    let _ = a as *const Foo;
+    let _ = a as *const Foo; //~ ERROR is not satisfied
 
     // check no error cascade
-    let _ = main.f as *const u32;
+    let _ = main.f as *const u32; //~ ERROR no field
 
     let cf: *const Foo = &0;
-    let _ = cf as *const [u16];
-    let _ = cf as *const Bar;
+    let _ = cf as *const [u16]; //~ ERROR is invalid
+    let _ = cf as *const Bar; //~ ERROR is invalid
 
-    vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>();
+    vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>(); //~ ERROR is invalid
 }
index fb363c388b6e659fc2d04cfeb29b25254760d544..fa4f590362123d702ef34ee011c8601c2b46b95b 100644 (file)
@@ -1,7 +1,7 @@
 error[E0606]: casting `*const U` as `*const V` is invalid
   --> $DIR/cast-rfc0401.rs:13:5
    |
-13 |     u as *const V
+13 |     u as *const V //~ ERROR is invalid
    |     ^^^^^^^^^^^^^
    |
    = note: vtable kinds may not match
@@ -9,7 +9,7 @@ error[E0606]: casting `*const U` as `*const V` is invalid
 error[E0606]: casting `*const U` as `*const str` is invalid
   --> $DIR/cast-rfc0401.rs:18:5
    |
-18 |     u as *const str
+18 |     u as *const str //~ ERROR is invalid
    |     ^^^^^^^^^^^^^^^
    |
    = note: vtable kinds may not match
@@ -17,13 +17,13 @@ error[E0606]: casting `*const U` as `*const str` is invalid
 error[E0609]: no field `f` on type `fn() {main}`
   --> $DIR/cast-rfc0401.rs:75:18
    |
-75 |     let _ = main.f as *const u32;
+75 |     let _ = main.f as *const u32; //~ ERROR no field
    |                  ^
 
 error[E0605]: non-primitive cast: `*const u8` as `&u8`
   --> $DIR/cast-rfc0401.rs:39:13
    |
-39 |     let _ = v as &u8;
+39 |     let _ = v as &u8; //~ ERROR non-primitive cast
    |             ^^^^^^^^
    |
    = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
@@ -31,7 +31,7 @@ error[E0605]: non-primitive cast: `*const u8` as `&u8`
 error[E0605]: non-primitive cast: `*const u8` as `E`
   --> $DIR/cast-rfc0401.rs:40:13
    |
-40 |     let _ = v as E;
+40 |     let _ = v as E; //~ ERROR non-primitive cast
    |             ^^^^^^
    |
    = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
@@ -39,7 +39,7 @@ error[E0605]: non-primitive cast: `*const u8` as `E`
 error[E0605]: non-primitive cast: `*const u8` as `fn()`
   --> $DIR/cast-rfc0401.rs:41:13
    |
-41 |     let _ = v as fn();
+41 |     let _ = v as fn(); //~ ERROR non-primitive cast
    |             ^^^^^^^^^
    |
    = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
@@ -47,7 +47,7 @@ error[E0605]: non-primitive cast: `*const u8` as `fn()`
 error[E0605]: non-primitive cast: `*const u8` as `(u32,)`
   --> $DIR/cast-rfc0401.rs:42:13
    |
-42 |     let _ = v as (u32,);
+42 |     let _ = v as (u32,); //~ ERROR non-primitive cast
    |             ^^^^^^^^^^^
    |
    = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
@@ -55,7 +55,7 @@ error[E0605]: non-primitive cast: `*const u8` as `(u32,)`
 error[E0605]: non-primitive cast: `std::option::Option<&*const u8>` as `*const u8`
   --> $DIR/cast-rfc0401.rs:43:13
    |
-43 |     let _ = Some(&v) as *const u8;
+43 |     let _ = Some(&v) as *const u8; //~ ERROR non-primitive cast
    |             ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
@@ -63,19 +63,19 @@ error[E0605]: non-primitive cast: `std::option::Option<&*const u8>` as `*const u
 error[E0606]: casting `*const u8` as `f32` is invalid
   --> $DIR/cast-rfc0401.rs:45:13
    |
-45 |     let _ = v as f32;
+45 |     let _ = v as f32; //~ ERROR is invalid
    |             ^^^^^^^^
 
 error[E0606]: casting `fn() {main}` as `f64` is invalid
   --> $DIR/cast-rfc0401.rs:46:13
    |
-46 |     let _ = main as f64;
+46 |     let _ = main as f64; //~ ERROR is invalid
    |             ^^^^^^^^^^^
 
 error[E0606]: casting `&*const u8` as `usize` is invalid
   --> $DIR/cast-rfc0401.rs:47:13
    |
-47 |     let _ = &v as usize;
+47 |     let _ = &v as usize; //~ ERROR is invalid
    |             ^^^^^^^^^^^
    |
    = help: cast through a raw pointer first
@@ -83,13 +83,13 @@ error[E0606]: casting `&*const u8` as `usize` is invalid
 error[E0606]: casting `f32` as `*const u8` is invalid
   --> $DIR/cast-rfc0401.rs:48:13
    |
-48 |     let _ = f as *const u8;
+48 |     let _ = f as *const u8; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^
 
 error[E0054]: cannot cast as `bool`
   --> $DIR/cast-rfc0401.rs:49:13
    |
-49 |     let _ = 3_i32 as bool;
+49 |     let _ = 3_i32 as bool; //~ ERROR cannot cast
    |             ^^^^^^^^^^^^^ unsupported cast
    |
    = help: compare with zero instead
@@ -97,7 +97,7 @@ error[E0054]: cannot cast as `bool`
 error[E0054]: cannot cast as `bool`
   --> $DIR/cast-rfc0401.rs:50:13
    |
-50 |     let _ = E::A as bool;
+50 |     let _ = E::A as bool; //~ ERROR cannot cast
    |             ^^^^^^^^^^^^ unsupported cast
    |
    = help: compare with zero instead
@@ -105,13 +105,13 @@ error[E0054]: cannot cast as `bool`
 error[E0604]: only `u8` can be cast as `char`, not `u32`
   --> $DIR/cast-rfc0401.rs:51:13
    |
-51 |     let _ = 0x61u32 as char;
+51 |     let _ = 0x61u32 as char; //~ ERROR can be cast as
    |             ^^^^^^^^^^^^^^^
 
 error[E0606]: casting `bool` as `f32` is invalid
   --> $DIR/cast-rfc0401.rs:53:13
    |
-53 |     let _ = false as f32;
+53 |     let _ = false as f32; //~ ERROR is invalid
    |             ^^^^^^^^^^^^
    |
    = help: cast through an integer first
@@ -119,7 +119,7 @@ error[E0606]: casting `bool` as `f32` is invalid
 error[E0606]: casting `E` as `f32` is invalid
   --> $DIR/cast-rfc0401.rs:54:13
    |
-54 |     let _ = E::A as f32;
+54 |     let _ = E::A as f32; //~ ERROR is invalid
    |             ^^^^^^^^^^^
    |
    = help: cast through an integer first
@@ -127,7 +127,7 @@ error[E0606]: casting `E` as `f32` is invalid
 error[E0606]: casting `char` as `f32` is invalid
   --> $DIR/cast-rfc0401.rs:55:13
    |
-55 |     let _ = 'a' as f32;
+55 |     let _ = 'a' as f32; //~ ERROR is invalid
    |             ^^^^^^^^^^
    |
    = help: cast through an integer first
@@ -135,67 +135,67 @@ error[E0606]: casting `char` as `f32` is invalid
 error[E0606]: casting `bool` as `*const u8` is invalid
   --> $DIR/cast-rfc0401.rs:57:13
    |
-57 |     let _ = false as *const u8;
+57 |     let _ = false as *const u8; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^^^^^
 
 error[E0606]: casting `E` as `*const u8` is invalid
   --> $DIR/cast-rfc0401.rs:58:13
    |
-58 |     let _ = E::A as *const u8;
+58 |     let _ = E::A as *const u8; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^^^^
 
 error[E0606]: casting `char` as `*const u8` is invalid
   --> $DIR/cast-rfc0401.rs:59:13
    |
-59 |     let _ = 'a' as *const u8;
+59 |     let _ = 'a' as *const u8; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^^^
 
 error[E0606]: casting `usize` as `*const [u8]` is invalid
   --> $DIR/cast-rfc0401.rs:61:13
    |
-61 |     let _ = 42usize as *const [u8];
+61 |     let _ = 42usize as *const [u8]; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0607]: cannot cast thin pointer `*const u8` to fat pointer `*const [u8]`
   --> $DIR/cast-rfc0401.rs:62:13
    |
-62 |     let _ = v as *const [u8];
+62 |     let _ = v as *const [u8]; //~ ERROR cannot cast
    |             ^^^^^^^^^^^^^^^^
 
 error[E0606]: casting `&Foo` as `*const str` is invalid
   --> $DIR/cast-rfc0401.rs:64:13
    |
-64 |     let _ = foo as *const str;
+64 |     let _ = foo as *const str; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^^^^
 
 error[E0606]: casting `&Foo` as `*mut str` is invalid
   --> $DIR/cast-rfc0401.rs:65:13
    |
-65 |     let _ = foo as *mut str;
+65 |     let _ = foo as *mut str; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^^
 
 error[E0606]: casting `fn() {main}` as `*mut str` is invalid
   --> $DIR/cast-rfc0401.rs:66:13
    |
-66 |     let _ = main as *mut str;
+66 |     let _ = main as *mut str; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^^^
 
 error[E0606]: casting `&f32` as `*mut f32` is invalid
   --> $DIR/cast-rfc0401.rs:67:13
    |
-67 |     let _ = &f as *mut f32;
+67 |     let _ = &f as *mut f32; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^
 
 error[E0606]: casting `&f32` as `*const f64` is invalid
   --> $DIR/cast-rfc0401.rs:68:13
    |
-68 |     let _ = &f as *const f64;
+68 |     let _ = &f as *const f64; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^^^
 
 error[E0606]: casting `*const [i8]` as `usize` is invalid
   --> $DIR/cast-rfc0401.rs:69:13
    |
-69 |     let _ = fat_sv as usize;
+69 |     let _ = fat_sv as usize; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^^
    |
    = help: cast through a thin pointer first
@@ -203,7 +203,7 @@ error[E0606]: casting `*const [i8]` as `usize` is invalid
 error[E0606]: casting `*const Foo` as `*const [u16]` is invalid
   --> $DIR/cast-rfc0401.rs:78:13
    |
-78 |     let _ = cf as *const [u16];
+78 |     let _ = cf as *const [u16]; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^^^^^
    |
    = note: vtable kinds may not match
@@ -211,7 +211,7 @@ error[E0606]: casting `*const Foo` as `*const [u16]` is invalid
 error[E0606]: casting `*const Foo` as `*const Bar` is invalid
   --> $DIR/cast-rfc0401.rs:79:13
    |
-79 |     let _ = cf as *const Bar;
+79 |     let _ = cf as *const Bar; //~ ERROR is invalid
    |             ^^^^^^^^^^^^^^^^
    |
    = note: vtable kinds may not match
@@ -219,7 +219,7 @@ error[E0606]: casting `*const Foo` as `*const Bar` is invalid
 error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied
   --> $DIR/cast-rfc0401.rs:63:13
    |
-63 |     let _ = fat_v as *const Foo;
+63 |     let _ = fat_v as *const Foo; //~ ERROR is not satisfied
    |             ^^^^^ `[u8]` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `[u8]`
@@ -228,7 +228,7 @@ error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied
 error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
   --> $DIR/cast-rfc0401.rs:72:13
    |
-72 |     let _ = a as *const Foo;
+72 |     let _ = a as *const Foo; //~ ERROR is not satisfied
    |             ^ `str` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `str`
@@ -237,13 +237,13 @@ error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied
 error[E0606]: casting `&{float}` as `f32` is invalid
   --> $DIR/cast-rfc0401.rs:81:30
    |
-81 |     vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>();
+81 |     vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>(); //~ ERROR is invalid
    |                              ^^^^^^^^ cannot cast `&{float}` as `f32`
    |
 help: did you mean `*s`?
   --> $DIR/cast-rfc0401.rs:81:30
    |
-81 |     vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>();
+81 |     vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>(); //~ ERROR is invalid
    |                              ^
 
 error: aborting due to 34 previous errors
index 5d2d1d2b04c50c2c033470036afcc657249b0897..dcdf3070d68a1f849eda1a2dab384c9e9636413f 100644 (file)
 fn f<F: Fn<usize>>(_: F) {}
 fn main() {
     [1, 2, 3].sort_by(|| panic!());
+    //~^ ERROR closure is expected to take
     [1, 2, 3].sort_by(|tuple| panic!());
+    //~^ ERROR closure is expected to take
     [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
+    //~^ ERROR closure is expected to take
     f(|| panic!());
+    //~^ ERROR closure is expected to take
 
     let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
+    //~^ ERROR closure is expected to take
     let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
+    //~^ ERROR closure is expected to take
     let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
+    //~^ ERROR closure is expected to take
 }
index 9de5e8fea0194e15b836a09593635e3eefdb2066..2d792373cd7e78016438f2726b913c53f07f06bd 100644 (file)
@@ -7,25 +7,25 @@ error[E0593]: closure is expected to take 2 arguments, but it takes 0 arguments
    |               expected closure that takes 2 arguments
 
 error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
-  --> $DIR/closure-arg-count.rs:16:15
+  --> $DIR/closure-arg-count.rs:17:15
    |
-16 |     [1, 2, 3].sort_by(|tuple| panic!());
+17 |     [1, 2, 3].sort_by(|tuple| panic!());
    |               ^^^^^^^ ------- takes 1 argument
    |               |
    |               expected closure that takes 2 arguments
 
 error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
-  --> $DIR/closure-arg-count.rs:17:15
+  --> $DIR/closure-arg-count.rs:19:15
    |
-17 |     [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
+19 |     [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
    |               ^^^^^^^ ----------------- takes 1 argument
    |               |
    |               expected closure that takes 2 arguments
 
 error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
-  --> $DIR/closure-arg-count.rs:18:5
+  --> $DIR/closure-arg-count.rs:21:5
    |
-18 |     f(|| panic!());
+21 |     f(|| panic!());
    |     ^ -- takes 0 arguments
    |     |
    |     expected closure that takes 1 argument
@@ -33,25 +33,25 @@ error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
    = note: required by `f`
 
 error[E0593]: closure is expected to take a single tuple as argument, but it takes 2 distinct arguments
-  --> $DIR/closure-arg-count.rs:20:53
+  --> $DIR/closure-arg-count.rs:24:53
    |
-20 |     let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
+24 |     let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
    |                                                     ^^^ ------ help: consider changing the closure to accept a tuple: `|(i, x)|`
    |                                                     |
    |                                                     expected closure that takes a single tuple as argument
 
 error[E0593]: closure is expected to take a single tuple as argument, but it takes 2 distinct arguments
-  --> $DIR/closure-arg-count.rs:21:53
+  --> $DIR/closure-arg-count.rs:26:53
    |
-21 |     let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
+26 |     let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
    |                                                     ^^^ ------------- help: consider changing the closure to accept a tuple: `|(i, x): (usize, _)|`
    |                                                     |
    |                                                     expected closure that takes a single tuple as argument
 
 error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
-  --> $DIR/closure-arg-count.rs:22:53
+  --> $DIR/closure-arg-count.rs:28:53
    |
-22 |     let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
+28 |     let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
    |                                                     ^^^ --------- takes 3 distinct arguments
    |                                                     |
    |                                                     expected closure that takes a single 2-tuple as argument
index aa9dba4c3f4178e4369c89ace874f8079db04e6a..566998c374e9e57dff8dd9b0d42327f7c1fc8e0d 100644 (file)
 
 fn main() {
     let a = [(1u32, 2u32)];
-    a.iter().map(|_: (u32, u32)| 45);
-    a.iter().map(|_: &(u16, u16)| 45);
-    a.iter().map(|_: (u16, u16)| 45);
+    a.iter().map(|_: (u32, u32)| 45); //~ ERROR type mismatch
+    a.iter().map(|_: &(u16, u16)| 45); //~ ERROR type mismatch
+    a.iter().map(|_: (u16, u16)| 45); //~ ERROR type mismatch
 }
 
 fn baz<F: Fn(*mut &u32)>(_: F) {}
 fn _test<'a>(f: fn(*mut &'a u32)) {
-    baz(f);
+    baz(f); //~ ERROR type mismatch
+     //~^ ERROR type mismatch
 }
index 866a024ab08b8472bf2bb715c81545ffec581d2c..77d3a332767378b34e32f4c81147a8036902040a 100644 (file)
@@ -1,7 +1,7 @@
 error[E0631]: type mismatch in closure arguments
   --> $DIR/closure-arg-type-mismatch.rs:13:14
    |
-13 |     a.iter().map(|_: (u32, u32)| 45);
+13 |     a.iter().map(|_: (u32, u32)| 45); //~ ERROR type mismatch
    |              ^^^ ------------------ found signature of `fn((u32, u32)) -> _`
    |              |
    |              expected signature of `fn(&(u32, u32)) -> _`
@@ -9,7 +9,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/closure-arg-type-mismatch.rs:14:14
    |
-14 |     a.iter().map(|_: &(u16, u16)| 45);
+14 |     a.iter().map(|_: &(u16, u16)| 45); //~ ERROR type mismatch
    |              ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _`
    |              |
    |              expected signature of `fn(&(u32, u32)) -> _`
@@ -17,7 +17,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in closure arguments
   --> $DIR/closure-arg-type-mismatch.rs:15:14
    |
-15 |     a.iter().map(|_: (u16, u16)| 45);
+15 |     a.iter().map(|_: (u16, u16)| 45); //~ ERROR type mismatch
    |              ^^^ ------------------ found signature of `fn((u16, u16)) -> _`
    |              |
    |              expected signature of `fn(&(u32, u32)) -> _`
@@ -25,7 +25,7 @@ error[E0631]: type mismatch in closure arguments
 error[E0631]: type mismatch in function arguments
   --> $DIR/closure-arg-type-mismatch.rs:20:5
    |
-20 |     baz(f);
+20 |     baz(f); //~ ERROR type mismatch
    |     ^^^
    |     |
    |     expected signature of `for<'r> fn(*mut &'r u32) -> _`
@@ -36,7 +36,7 @@ error[E0631]: type mismatch in function arguments
 error[E0271]: type mismatch resolving `for<'r> <fn(*mut &'a u32) as std::ops::FnOnce<(*mut &'r u32,)>>::Output == ()`
   --> $DIR/closure-arg-type-mismatch.rs:20:5
    |
-20 |     baz(f);
+20 |     baz(f); //~ ERROR type mismatch
    |     ^^^ expected bound lifetime parameter, found concrete lifetime
    |
    = note: required by `baz`
index 91298cb2bbd52a29f564f1c45f3313e9e1087599..5a74e8f933de0fef9a83a7b85517115690519c71 100644 (file)
@@ -15,5 +15,6 @@ impl<T: Fn(&())> Foo for T {}
 fn baz<T: Foo>(_: T) {}
 
 fn main() {
-    baz(|_| ());
+    baz(|_| ()); //~ ERROR type mismatch
+    //~^ ERROR type mismatch
 }
index a54fd118cc5ea955bb5332e3e4eb5f3fc45b09b4..99767ba1afaefafafda8476ab5b80b9e1f25d2ea 100644 (file)
@@ -1,7 +1,7 @@
 error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/closure-mismatch.rs:18:9: 18:15] as std::ops::FnOnce<(&'r (),)>>::Output == ()`
   --> $DIR/closure-mismatch.rs:18:5
    |
-18 |     baz(|_| ());
+18 |     baz(|_| ()); //~ ERROR type mismatch
    |     ^^^ expected bound lifetime parameter, found concrete lifetime
    |
    = note: required because of the requirements on the impl of `Foo` for `[closure@$DIR/closure-mismatch.rs:18:9: 18:15]`
@@ -10,7 +10,7 @@ error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/closure-mismatch.r
 error[E0631]: type mismatch in closure arguments
   --> $DIR/closure-mismatch.rs:18:5
    |
-18 |     baz(|_| ());
+18 |     baz(|_| ()); //~ ERROR type mismatch
    |     ^^^ ------ found signature of `fn(_) -> _`
    |     |
    |     expected signature of `for<'r> fn(&'r ()) -> _`
index 5e44030eab71acad7f13b17652fc5b50c82adcbf..e0d5c19f12558754f8d6270ff7d5aaaa202186dc 100644 (file)
 
 trait Foo {
     fn f() -> u32;
-    const fn g();
+    const fn g(); //~ ERROR cannot be declared const
 }
 
 impl Foo for u32 {
-    const fn f() -> u32 { 22 }
+    const fn f() -> u32 { 22 } //~ ERROR cannot be declared const
     fn g() {}
 }
 
index f7b7635e41aecfec70ad91f99b95fac6a0d944f2..4911db6b2eb43ed139fad6a755d226d81707c676 100644 (file)
@@ -1,13 +1,13 @@
 error[E0379]: trait fns cannot be declared const
   --> $DIR/const-fn-in-trait.rs:17:5
    |
-17 |     const fn g();
+17 |     const fn g(); //~ ERROR cannot be declared const
    |     ^^^^^ trait fns cannot be const
 
 error[E0379]: trait fns cannot be declared const
   --> $DIR/const-fn-in-trait.rs:21:5
    |
-21 |     const fn f() -> u32 { 22 }
+21 |     const fn f() -> u32 { 22 } //~ ERROR cannot be declared const
    |     ^^^^^ trait fns cannot be const
 
 error: aborting due to 2 previous errors
index 4bea8177b7c5e354e64815a68085787044985ace..e9e34abc092033f05ec942cfe7ad765b8b8e9f8c 100644 (file)
@@ -20,12 +20,14 @@ fn main() {
     apply(&3, takes_imm);
     apply(&3, takes_mut);
     //~^ ERROR type mismatch
-    //~| NOTE types differ in mutability
     //~| NOTE required by `apply`
+    //~| NOTE expected signature
+    //~| NOTE found signature
 
     apply(&mut 3, takes_mut);
     apply(&mut 3, takes_imm);
     //~^ ERROR type mismatch
-    //~| NOTE types differ in mutability
     //~| NOTE required by `apply`
+    //~| NOTE expected signature
+    //~| NOTE found signature
 }
index 09a90ef3d6be69aa6204cfe2ce7b244ba21120c9..e593298633af5e7edbd151379b30bebfbaf54582 100644 (file)
@@ -10,9 +10,9 @@ error[E0631]: type mismatch in function arguments
    = note: required by `apply`
 
 error[E0631]: type mismatch in function arguments
-  --> $DIR/fn-variance-1.rs:27:5
+  --> $DIR/fn-variance-1.rs:28:5
    |
-27 |     apply(&mut 3, takes_imm);
+28 |     apply(&mut 3, takes_imm);
    |     ^^^^^
    |     |
    |     expected signature of `fn(&mut {integer}) -> _`
index 580684e2e140bf3b49e5ec946dcfef0a680eac6e..59127c10cd1e6abc684dca892b9f55f61f17841a 100644 (file)
@@ -14,7 +14,6 @@ fn function(t: &mut Trait) {
     t as *mut Trait
  //~^ ERROR: mismatched types
  //~| NOTE: expected type `()`
- //~| NOTE:    found type `*mut Trait`
  //~| NOTE: expected (), found *-ptr
 }
 
index f842627e76fee1fbe5ceff7249204cf3d063e9f5..33c5e74fafa1f9886fd244ab40197e4217b6635f 100644 (file)
@@ -23,13 +23,13 @@ macro_rules! write {
         const stdout: i32 = 1;
         unsafe {
             write(stdout, $arr.as_ptr() as *const i8,
-                  $arr.len() * size_of($arr[0]));
+                  $arr.len() * size_of($arr[0])); //~ ERROR mismatched types
         }
     }}
 }
 
 macro_rules! cast {
-    ($x:expr) => ($x as ())
+    ($x:expr) => ($x as ()) //~ ERROR non-primitive cast
 }
 
 fn main() {
index fae831ffb868f63870802b19ff7ca2c05591d5e7..5d25cb2f93c158c83d65d382692e18efadeb2d24 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/issue-26480.rs:26:19
    |
-26 |                   $arr.len() * size_of($arr[0]));
+26 |                   $arr.len() * size_of($arr[0])); //~ ERROR mismatched types
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u64, found usize
 ...
 37 |     write!(hello);
@@ -10,7 +10,7 @@ error[E0308]: mismatched types
 error[E0605]: non-primitive cast: `{integer}` as `()`
   --> $DIR/issue-26480.rs:32:19
    |
-32 |     ($x:expr) => ($x as ())
+32 |     ($x:expr) => ($x as ()) //~ ERROR non-primitive cast
    |                   ^^^^^^^^
 ...
 38 |     cast!(2);
index 006074ead13bdb8666156f483756a1a673ed46ed..503b2e08c39bb8e27f11c0c4279666f0ec660ba0 100644 (file)
@@ -16,7 +16,7 @@ trait Parser<T> {
 
 impl<bool> Parser<bool> for bool {
     fn parse(text: &str) -> Option<bool> {
-        Some(true)
+        Some(true) //~ ERROR mismatched types
     }
 }
 
index 46d690c5f037b97ee2235cc51364c663ae642b4a..3ec5d1b7b40c1e3047e573f9967229403b272644 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/issue-35030.rs:19:14
    |
-19 |         Some(true)
+19 |         Some(true) //~ ERROR mismatched types
    |              ^^^^ expected type parameter, found bool
    |
    = note: expected type `bool` (type parameter)
index 7e489621e21027857fbacb0a562e16d3bf65f292..76885651c5b532fc63eb6a17ce43f94f232c4775 100644 (file)
 fn main() {
     once::<&str>("str").fuse().filter(|a: &str| true).count();
     //~^ ERROR no method named `count`
-    //~| ERROR E0281
-    //~| ERROR E0281
-    //~| NOTE expected &str, found str
-    //~| NOTE expected &str, found str
-    //~| NOTE implements
-    //~| NOTE implements
-    //~| NOTE requires
-    //~| NOTE requires
+    //~| ERROR type mismatch in closure arguments
     //~| NOTE the method `count` exists but the following trait bounds
+    //~| NOTE expected signature
+    //~| NOTE found signature
 }
index 6b49079c47210c039762fb10ffbfa5c9e2eba36a..b9b6b05996b665adb0995448164fbf80fa12ccb5 100644 (file)
@@ -13,7 +13,7 @@
 struct Foo {
 }
 
-fn foo(&foo: Foo) {
+fn foo(&foo: Foo) { //~ ERROR mismatched types
 }
 
 fn bar(foo: Foo) {
@@ -27,13 +27,13 @@ fn zar(&foo: &Foo) {
 
 // The somewhat unexpected help message in this case is courtesy of
 // match_default_bindings.
-fn agh(&&bar: &u32) {
+fn agh(&&bar: &u32) { //~ ERROR mismatched types
 }
 
-fn bgh(&&bar: u32) {
+fn bgh(&&bar: u32) { //~ ERROR mismatched types
 }
 
-fn ugh(&[bar]: &u32) {
+fn ugh(&[bar]: &u32) { //~ ERROR expected an array or slice
 }
 
 fn main() {}
index c80f075021ec8003063af6f6689d2fe147f5a03b..d34f05e054a67475b94991cf00f7e1aeefeadbcb 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/issue-38371.rs:16:8
    |
-16 | fn foo(&foo: Foo) {
+16 | fn foo(&foo: Foo) { //~ ERROR mismatched types
    |        ^^^^ expected struct `Foo`, found reference
    |
    = note: expected type `Foo`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
 error[E0308]: mismatched types
   --> $DIR/issue-38371.rs:30:9
    |
-30 | fn agh(&&bar: &u32) {
+30 | fn agh(&&bar: &u32) { //~ ERROR mismatched types
    |         ^^^^ expected u32, found reference
    |
    = note: expected type `u32`
@@ -21,7 +21,7 @@ error[E0308]: mismatched types
 error[E0308]: mismatched types
   --> $DIR/issue-38371.rs:33:8
    |
-33 | fn bgh(&&bar: u32) {
+33 | fn bgh(&&bar: u32) { //~ ERROR mismatched types
    |        ^^^^^ expected u32, found reference
    |
    = note: expected type `u32`
@@ -30,7 +30,7 @@ error[E0308]: mismatched types
 error[E0529]: expected an array or slice, found `u32`
   --> $DIR/issue-38371.rs:36:9
    |
-36 | fn ugh(&[bar]: &u32) {
+36 | fn ugh(&[bar]: &u32) { //~ ERROR expected an array or slice
    |         ^^^^^ pattern cannot match with input type `u32`
 
 error: aborting due to 4 previous errors
index f7f1c78c3ba0d47365091484147002d916989a60..7cf1de7cfee3f807c3be3fa6c6c4ed193c1a1add 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn main() {
-    let x: u32 = (
+    let x: u32 = ( //~ ERROR mismatched types
     );
 }
 
index c8941fbf950734c021621508ef1ef3129a95af14..41e4c5123980439eade797ba252fbe563fe92631 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/main.rs:12:18
    |
-12 |       let x: u32 = (
+12 |       let x: u32 = ( //~ ERROR mismatched types
    |  __________________^
 13 | |     );
    | |_____^ expected u32, found ()
index 3295e2bebd231714d39e55e47daa9c4097b88ea0..da1265dfeff7e60b1fd2cb0a57ba720bd5728aae 100644 (file)
@@ -38,7 +38,6 @@ fn main() {
     let ans = s("what");    //~ ERROR mismatched types
     //~^ NOTE expected isize, found reference
     //~| NOTE expected type
-    //~| NOTE found type
     let ans = s();
     //~^ ERROR this function takes 1 parameter but 0 parameters were supplied
     //~| NOTE expected 1 parameter
index cd05684f15d55d71c2157558b6380c8de90f615b..feec86342e5cde1b47310ce91f1eb67fc10f837f 100644 (file)
@@ -8,15 +8,15 @@ error[E0308]: mismatched types
               found type `&'static str`
 
 error[E0057]: this function takes 1 parameter but 0 parameters were supplied
-  --> $DIR/overloaded-calls-bad.rs:42:15
+  --> $DIR/overloaded-calls-bad.rs:41:15
    |
-42 |     let ans = s();
+41 |     let ans = s();
    |               ^^^ expected 1 parameter
 
 error[E0057]: this function takes 1 parameter but 2 parameters were supplied
-  --> $DIR/overloaded-calls-bad.rs:45:17
+  --> $DIR/overloaded-calls-bad.rs:44:17
    |
-45 |     let ans = s("burma", "shave");
+44 |     let ans = s("burma", "shave");
    |                 ^^^^^^^^^^^^^^^^ expected 1 parameter
 
 error: aborting due to 3 previous errors
index 9f832c7b6e500f52e87a900e82b0c47cebb5c6f3..115be1bf4de5542b7a0d9c0d2e8b225e931f2917 100644 (file)
@@ -22,8 +22,7 @@ fn c(x: Box<Foo+Sync+Send>) {
 
 fn d(x: Box<Foo>) {
     a(x); //~ ERROR mismatched types [E0308]
-          //~| NOTE expected type `Box<Foo + std::marker::Send + 'static>`
-          //~| NOTE found type `Box<Foo + 'static>`
+          //~| NOTE expected type `std::boxed::Box<Foo + std::marker::Send + 'static>`
           //~| NOTE expected trait `Foo + std::marker::Send`, found trait `Foo`
 }
 
index 099c8699e493bcc67c4f7b18d20f76ee1d9333cc..420b59a4df1af3a889b3af15fda80ba5c3b27e31 100644 (file)
@@ -18,8 +18,8 @@ trait Foo {
 struct Bar;
 
 impl Foo for Bar {
-    fn foo(x: i16) { }
-    fn bar(&mut self, bar: &Bar) { }
+    fn foo(x: i16) { } //~ ERROR incompatible type
+    fn bar(&mut self, bar: &Bar) { } //~ ERROR incompatible type
 }
 
 fn main() {
index 349432f64bbc20cf4af4839fe604639f2c6f7124..f3cf1d566153346b0f0a6322ecd20fa0c0c54e8e 100644 (file)
@@ -4,7 +4,7 @@ error[E0053]: method `foo` has an incompatible type for trait
 14 |     fn foo(x: u16);
    |               --- type in trait
 ...
-21 |     fn foo(x: i16) { }
+21 |     fn foo(x: i16) { } //~ ERROR incompatible type
    |               ^^^ expected u16, found i16
    |
    = note: expected type `fn(u16)`
@@ -16,7 +16,7 @@ error[E0053]: method `bar` has an incompatible type for trait
 15 |     fn bar(&mut self, bar: &mut Bar);
    |                            -------- type in trait
 ...
-22 |     fn bar(&mut self, bar: &Bar) { }
+22 |     fn bar(&mut self, bar: &Bar) { } //~ ERROR incompatible type
    |                            ^^^^ types differ in mutability
    |
    = note: expected type `fn(&mut Bar, &mut Bar)`
index 693a1585320eea02abde9b9202e27c09eb3f0307..814f2c4d187cd016b59728e9deabb25d8e8f787c 100644 (file)
@@ -20,15 +20,10 @@ fn call_it<F:FnMut(isize,isize)->isize>(y: isize, mut f: F) -> isize {
 
 pub fn main() {
     let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y });
-    //~^ NOTE implements
-    //~| NOTE implements
+    //~^ NOTE found signature of `fn(usize, isize)
     let z = call_it(3, f);
     //~^ ERROR type mismatch
-    //~| NOTE expected isize, found usize
-    //~| NOTE expected isize, found usize
-    //~| NOTE requires
-    //~| NOTE requires
-    //~| NOTE required by `call_it`
-    //~| NOTE required by `call_it`
+    //~| NOTE expected signature of `fn(isize, isize)
+    //~| required by `call_it`
     println!("{}", z);
 }
index 598836492801363d6324ff6776961ba75894ba88..1d25632c5e2c2361c9de9df85e4213887928923f 100644 (file)
@@ -1,10 +1,10 @@
 error[E0631]: type mismatch in closure arguments
-  --> $DIR/unboxed-closures-vtable-mismatch.rs:25:13
+  --> $DIR/unboxed-closures-vtable-mismatch.rs:24:13
    |
 22 |     let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y });
    |                       -------------------------------------------------- found signature of `fn(usize, isize) -> _`
-...
-25 |     let z = call_it(3, f);
+23 |     //~^ NOTE found signature of `fn(usize, isize)
+24 |     let z = call_it(3, f);
    |             ^^^^^^^ expected signature of `fn(isize, isize) -> _`
    |
    = note: required by `call_it`
index 9cf1c7d6de8a4a186971a56224a73affbf65f2e2..526fc3a8658a24809c087aa9cd5aef81f996da99 100644 (file)
@@ -18,7 +18,7 @@ enum PC {
 }
 
 fn test(proto: P) {
-    match proto {
+    match proto { //~ ERROR non-exhaustive patterns
         P::C(PC::Q) => (),
     }
 }
index fc90c8a2b20bebc39cc4029febe377213a1c61da..883c4329f4db6e3b37cb5e1faccbe96617b43412 100644 (file)
@@ -1,7 +1,7 @@
 error[E0004]: non-exhaustive patterns: `C(QA)` not covered
   --> $DIR/issue-40221.rs:21:11
    |
-21 |     match proto {
+21 |     match proto { //~ ERROR non-exhaustive patterns
    |           ^^^^^ pattern `C(QA)` not covered
 
 error: aborting due to previous error
index ffd7ff7f4323d989b72fe5339497a5bfa3960acd..9f1954526916f8f6b8f6bf7488c63a7981bb5041 100644 (file)
@@ -16,5 +16,5 @@
 struct X {
 }
 
-impl m1::X for X {
+impl m1::X for X { //~ ERROR not all trait items implemented
 }
index ce061bd167a88c322179b80c5bd11c82bb22b010..47164a5304abbaa4d245f39d5d604dd54daedc00 100644 (file)
@@ -3,7 +3,7 @@ error[E0601]: main function not found
 error[E0046]: not all trait items implemented, missing: `CONSTANT`, `Type`, `method`
   --> $DIR/m2.rs:19:1
    |
-19 | / impl m1::X for X {
+19 | / impl m1::X for X { //~ ERROR not all trait items implemented
 20 | | }
    | |_^ missing `CONSTANT`, `Type`, `method` in implementation
    |
index 79368587062e8b6fcecac948877846d5cb90a541..f2d5359fb167ba77a8b1db92c4f9b033de49c6b3 100644 (file)
@@ -11,5 +11,5 @@
 fn foo<X>() { }
 
 fn main() {
-    foo();
+    foo(); //~ ERROR type annotations needed
 }
index a16ae5538bf92d2038afae65670a6d6d909c7b1a..1cb9e5f56d3518d904cf86cebad0d786d009cf22 100644 (file)
@@ -1,7 +1,7 @@
 error[E0282]: type annotations needed
   --> $DIR/missing-type-parameter.rs:14:5
    |
-14 |     foo();
+14 |     foo(); //~ ERROR type annotations needed
    |     ^^^ cannot infer type for `X`
 
 error: aborting due to previous error
index f888369968852193a4c2c072d7fab88afc2a2d10..715c4adf2e69257561a2fa4cf635605d9187f98f 100644 (file)
@@ -11,6 +11,6 @@
 // compile-flags: -Z parse-only
 
 fn main() {
-    let mut ref x = 10;
+    let mut ref x = 10; //~ ERROR the order of `mut` and `ref` is incorrect
     let ref mut y = 11;
 }
index ce6a42f1e5ef120a47186c9f41f86fc7455c3976..aaab243e22f72aed03c2d4313603575ea865d1a5 100644 (file)
@@ -1,7 +1,7 @@
 error: the order of `mut` and `ref` is incorrect
   --> $DIR/mut-ref.rs:14:9
    |
-14 |     let mut ref x = 10;
+14 |     let mut ref x = 10; //~ ERROR the order of `mut` and `ref` is incorrect
    |         ^^^^^^^ help: try switching the order: `ref mut`
 
 error: aborting due to previous error
index 5605206221a117e5e54573b629898cfd6bf46d6c..e65159390db4f91037928bbd6978db40a0baf0c4 100644 (file)
@@ -31,6 +31,7 @@ fn ok(map: &mut Map) -> &String {
             }
             None => {
                 map.set(String::new()); // Just AST errors here
+                //~^ ERROR borrowed as immutable (Ast)
             }
         }
     }
@@ -41,10 +42,13 @@ fn err(map: &mut Map) -> &String {
         match map.get() {
             Some(v) => {
                 map.set(String::new()); // Both AST and MIR error here
+                //~^ ERROR borrowed as immutable (Mir)
+                //~| ERROR borrowed as immutable (Ast)
                 return v;
             }
             None => {
                 map.set(String::new()); // Just AST errors here
+                //~^ ERROR borrowed as immutable (Ast)
             }
         }
     }
index 8e1e9faef2f000b4de7b97e6b185451e9bee8ad0..fff2684af13997e10189077119cc206a35f1016f 100644 (file)
@@ -7,40 +7,40 @@ error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as imm
 33 |                 map.set(String::new()); // Just AST errors here
    |                 ^^^ mutable borrow occurs here
 ...
-37 | }
+38 | }
    | - immutable borrow ends here
 
 error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Ast)
-  --> $DIR/get_default.rs:43:17
+  --> $DIR/get_default.rs:44:17
    |
-41 |         match map.get() {
+42 |         match map.get() {
    |               --- immutable borrow occurs here
-42 |             Some(v) => {
-43 |                 map.set(String::new()); // Both AST and MIR error here
+43 |             Some(v) => {
+44 |                 map.set(String::new()); // Both AST and MIR error here
    |                 ^^^ mutable borrow occurs here
 ...
-51 | }
+55 | }
    | - immutable borrow ends here
 
 error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Ast)
-  --> $DIR/get_default.rs:47:17
+  --> $DIR/get_default.rs:50:17
    |
-41 |         match map.get() {
+42 |         match map.get() {
    |               --- immutable borrow occurs here
 ...
-47 |                 map.set(String::new()); // Just AST errors here
+50 |                 map.set(String::new()); // Just AST errors here
    |                 ^^^ mutable borrow occurs here
 ...
-51 | }
+55 | }
    | - immutable borrow ends here
 
 error[E0502]: cannot borrow `*map` as mutable because it is also borrowed as immutable (Mir)
-  --> $DIR/get_default.rs:43:17
+  --> $DIR/get_default.rs:44:17
    |
-41 |         match map.get() {
+42 |         match map.get() {
    |               --- immutable borrow occurs here
-42 |             Some(v) => {
-43 |                 map.set(String::new()); // Both AST and MIR error here
+43 |             Some(v) => {
+44 |                 map.set(String::new()); // Both AST and MIR error here
    |                 ^^^ mutable borrow occurs here
 
 error: aborting due to 4 previous errors
index 539c2017ea6c03ce91acb1c3fae9108064512fdb..001ce41c277938cee57179f55100c6e24d5e0f3f 100644 (file)
@@ -16,7 +16,9 @@
 // compile-flags:-Znll
 
 fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
-    &*x
+    &*x //~ ERROR free region `'a` does not outlive `'b`
+    //~^ ERROR `*x` does not live long enough
+    //~| WARN not reporting region error due to -Znll
 }
 
 fn main() { }
index 42b2aea01f0df3b5ea68985a74eb9d617648164d..9c1de6c366cc92afc94e8c4d68e9dbdbc8b9e1c7 100644 (file)
@@ -1,13 +1,13 @@
 warning: not reporting region error due to -Znll
   --> $DIR/named-region-basic.rs:19:5
    |
-19 |     &*x
+19 |     &*x //~ ERROR free region `'a` does not outlive `'b`
    |     ^^^
 
 error[E0597]: `*x` does not live long enough
   --> $DIR/named-region-basic.rs:19:6
    |
-19 |     &*x
+19 |     &*x //~ ERROR free region `'a` does not outlive `'b`
    |      ^^ does not live long enough
    |
    = note: borrowed value must be valid for the static lifetime...
@@ -15,14 +15,16 @@ note: ...but borrowed value is only valid for the lifetime 'a as defined on the
   --> $DIR/named-region-basic.rs:18:1
    |
 18 | / fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
-19 | |     &*x
-20 | | }
+19 | |     &*x //~ ERROR free region `'a` does not outlive `'b`
+20 | |     //~^ ERROR `*x` does not live long enough
+21 | |     //~| WARN not reporting region error due to -Znll
+22 | | }
    | |_^
 
 error: free region `'a` does not outlive `'b`
   --> $DIR/named-region-basic.rs:19:5
    |
-19 |     &*x
+19 |     &*x //~ ERROR free region `'a` does not outlive `'b`
    |     ^^^
 
 error: aborting due to 2 previous errors
index 54d3b3e087653f2ec63505526c71bd018c8c95fb..e7483dbd3b546ca1afe1c5a89dcc1c8c734925da 100644 (file)
@@ -23,7 +23,7 @@ trait MyFromIterator<A> {
     fn my_from_iter<T: Iterator<Item=A>>(iterator: T) -> Self;
 }
 
-#[rustc_on_unimplemented] //~ ERROR this attribute must have a value
+#[rustc_on_unimplemented] //~ ERROR `#[rustc_on_unimplemented]` requires a value
 trait BadAnnotation1
 {}
 
@@ -38,27 +38,34 @@ trait BadAnnotation3<A,B>
 {}
 
 #[rustc_on_unimplemented(lorem="")]
+//~^ this attribute must have a valid
 trait BadAnnotation4 {}
 
 #[rustc_on_unimplemented(lorem(ipsum(dolor)))]
+//~^ this attribute must have a valid
 trait BadAnnotation5 {}
 
 #[rustc_on_unimplemented(message="x", message="y")]
+//~^ this attribute must have a valid
 trait BadAnnotation6 {}
 
 #[rustc_on_unimplemented(message="x", on(desugared, message="y"))]
+//~^ this attribute must have a valid
 trait BadAnnotation7 {}
 
 #[rustc_on_unimplemented(on(), message="y")]
+//~^ empty `on`-clause
 trait BadAnnotation8 {}
 
 #[rustc_on_unimplemented(on="x", message="y")]
+//~^ this attribute must have a valid
 trait BadAnnotation9 {}
 
 #[rustc_on_unimplemented(on(x="y"), message="y")]
 trait BadAnnotation10 {}
 
 #[rustc_on_unimplemented(on(desugared, on(desugared, message="x")), message="y")]
+//~^ this attribute must have a valid
 trait BadAnnotation11 {}
 
 pub fn main() {
index 73834f4422d388e4be10d190944cb06a35f639bf..7126cc76eb72765479b01713f87e46e7cb8f7818 100644 (file)
@@ -1,7 +1,7 @@
 error[E0232]: `#[rustc_on_unimplemented]` requires a value
   --> $DIR/bad-annotation.rs:26:1
    |
-26 | #[rustc_on_unimplemented] //~ ERROR this attribute must have a value
+26 | #[rustc_on_unimplemented] //~ ERROR `#[rustc_on_unimplemented]` requires a value
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ value required here
    |
    = note: eg `#[rustc_on_unimplemented = "foo"]`
@@ -27,47 +27,47 @@ error[E0232]: this attribute must have a valid value
    = note: eg `#[rustc_on_unimplemented = "foo"]`
 
 error[E0232]: this attribute must have a valid value
-  --> $DIR/bad-annotation.rs:43:26
+  --> $DIR/bad-annotation.rs:44:26
    |
-43 | #[rustc_on_unimplemented(lorem(ipsum(dolor)))]
+44 | #[rustc_on_unimplemented(lorem(ipsum(dolor)))]
    |                          ^^^^^^^^^^^^^^^^^^^ expected value here
    |
    = note: eg `#[rustc_on_unimplemented = "foo"]`
 
 error[E0232]: this attribute must have a valid value
-  --> $DIR/bad-annotation.rs:46:39
+  --> $DIR/bad-annotation.rs:48:39
    |
-46 | #[rustc_on_unimplemented(message="x", message="y")]
+48 | #[rustc_on_unimplemented(message="x", message="y")]
    |                                       ^^^^^^^^^^^ expected value here
    |
    = note: eg `#[rustc_on_unimplemented = "foo"]`
 
 error[E0232]: this attribute must have a valid value
-  --> $DIR/bad-annotation.rs:49:39
+  --> $DIR/bad-annotation.rs:52:39
    |
-49 | #[rustc_on_unimplemented(message="x", on(desugared, message="y"))]
+52 | #[rustc_on_unimplemented(message="x", on(desugared, message="y"))]
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected value here
    |
    = note: eg `#[rustc_on_unimplemented = "foo"]`
 
 error[E0232]: empty `on`-clause in `#[rustc_on_unimplemented]`
-  --> $DIR/bad-annotation.rs:52:26
+  --> $DIR/bad-annotation.rs:56:26
    |
-52 | #[rustc_on_unimplemented(on(), message="y")]
+56 | #[rustc_on_unimplemented(on(), message="y")]
    |                          ^^^^ empty on-clause here
 
 error[E0232]: this attribute must have a valid value
-  --> $DIR/bad-annotation.rs:55:26
+  --> $DIR/bad-annotation.rs:60:26
    |
-55 | #[rustc_on_unimplemented(on="x", message="y")]
+60 | #[rustc_on_unimplemented(on="x", message="y")]
    |                          ^^^^^^ expected value here
    |
    = note: eg `#[rustc_on_unimplemented = "foo"]`
 
 error[E0232]: this attribute must have a valid value
-  --> $DIR/bad-annotation.rs:61:40
+  --> $DIR/bad-annotation.rs:67:40
    |
-61 | #[rustc_on_unimplemented(on(desugared, on(desugared, message="x")), message="y")]
+67 | #[rustc_on_unimplemented(on(desugared, on(desugared, message="x")), message="y")]
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected value here
    |
    = note: eg `#[rustc_on_unimplemented = "foo"]`
index 13514310371cc95f1e1ae4a4f1c024f62ee096cb..58f3d379ed99166035f339989270c70e1d863b81 100644 (file)
@@ -10,4 +10,4 @@
 
 #![feature(pub_restricted)]
 
-pub(crate) () fn foo() {}
+pub(crate) () fn foo() {} //~ unmatched visibility
index 470e8331247851848b2cecf66b5c87c66d1fd863..9cfc3968ab12548bc8a00450b3c6f6bdd002c412 100644 (file)
@@ -1,7 +1,7 @@
 error: unmatched visibility `pub`
   --> $DIR/pub-restricted-error-fn.rs:13:10
    |
-13 | pub(crate) () fn foo() {}
+13 | pub(crate) () fn foo() {} //~ unmatched visibility
    |          ^
 
 error: aborting due to previous error
index 99af031899ab6758b3c2d343d3fe6e08751bf70e..dfc927f2cb5c4f2f4b8a272cd3c95edd89156c04 100644 (file)
@@ -13,7 +13,7 @@
 struct Bar(pub(()));
 
 struct Foo {
-    pub(crate) () foo: usize,
+    pub(crate) () foo: usize, //~ ERROR expected identifier
 }
 
 
index b8b4c80778d968d05f5296d9a8acb2459e8974dd..cbf206e6aed5d0529d7930aa924534e0cc887d6a 100644 (file)
@@ -1,7 +1,7 @@
 error: expected identifier, found `(`
   --> $DIR/pub-restricted-error.rs:16:16
    |
-16 |     pub(crate) () foo: usize,
+16 |     pub(crate) () foo: usize, //~ ERROR expected identifier
    |                ^
 
 error: aborting due to previous error
index 3f74285717a7b6ff1046d737806667bfb6d2a14c..11428b778edfc21dbf159bc083f7ecf3c9098256 100644 (file)
@@ -10,6 +10,6 @@
 
 #![feature(pub_restricted)]
 
-pub (.) fn afn() {}
+pub (.) fn afn() {} //~ ERROR expected identifier
 
 fn main() {}
index ebfccc4d720451f0e168d5c606792cdb64c68d45..b76e87840c6dead09b9c0a537ce07d7755d523a8 100644 (file)
@@ -1,7 +1,7 @@
 error: expected identifier, found `.`
   --> $DIR/pub-restricted-non-path.rs:13:6
    |
-13 | pub (.) fn afn() {}
+13 | pub (.) fn afn() {} //~ ERROR expected identifier
    |      ^
 
 error: aborting due to previous error
index 934ad24c167796c076ace2e736be011e17949d1f..07184d935b437166430d523982c762c2d4667ce0 100644 (file)
@@ -12,8 +12,8 @@
 
 mod a {}
 
-pub (a) fn afn() {}
-pub (b) fn bfn() {}
+pub (a) fn afn() {} //~ incorrect visibility restriction
+pub (b) fn bfn() {} //~ incorrect visibility restriction
 pub fn privfn() {}
 mod x {
     mod y {
@@ -29,8 +29,8 @@ struct Foo {
         pub (super) s: usize,
         valid_private: usize,
         pub (in y) valid_in_x: usize,
-        pub (a) invalid: usize,
-        pub (in x) non_parent_invalid: usize,
+        pub (a) invalid: usize, //~ incorrect visibility restriction
+        pub (in x) non_parent_invalid: usize, //~ ERROR visibilities can only be restricted
     }
 }
 
@@ -38,4 +38,4 @@ fn main() {}
 
 // test multichar names
 mod xyz {}
-pub (xyz) fn xyz() {}
+pub (xyz) fn xyz() {} //~ incorrect visibility restriction
index ae283f1fb636a151fb913cc8134a623ffff96f9b..0bedcddc0b4cc37d4865361d4478485b5866a5fa 100644 (file)
@@ -1,7 +1,7 @@
 error: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:15:6
    |
-15 | pub (a) fn afn() {}
+15 | pub (a) fn afn() {} //~ incorrect visibility restriction
    |      ^ help: make this visible only to module `a` with `in`: `in a`
    |
    = help: some possible visibility restrictions are:
@@ -12,7 +12,7 @@ error: incorrect visibility restriction
 error: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:16:6
    |
-16 | pub (b) fn bfn() {}
+16 | pub (b) fn bfn() {} //~ incorrect visibility restriction
    |      ^ help: make this visible only to module `b` with `in`: `in b`
    |
    = help: some possible visibility restrictions are:
@@ -23,7 +23,7 @@ error: incorrect visibility restriction
 error: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:32:14
    |
-32 |         pub (a) invalid: usize,
+32 |         pub (a) invalid: usize, //~ incorrect visibility restriction
    |              ^ help: make this visible only to module `a` with `in`: `in a`
    |
    = help: some possible visibility restrictions are:
@@ -34,7 +34,7 @@ error: incorrect visibility restriction
 error: incorrect visibility restriction
   --> $DIR/pub-restricted.rs:41:6
    |
-41 | pub (xyz) fn xyz() {}
+41 | pub (xyz) fn xyz() {} //~ incorrect visibility restriction
    |      ^^^ help: make this visible only to module `xyz` with `in`: `in xyz`
    |
    = help: some possible visibility restrictions are:
@@ -45,7 +45,7 @@ error: incorrect visibility restriction
 error: visibilities can only be restricted to ancestor modules
   --> $DIR/pub-restricted.rs:33:17
    |
-33 |         pub (in x) non_parent_invalid: usize,
+33 |         pub (in x) non_parent_invalid: usize, //~ ERROR visibilities can only be restricted
    |                 ^
 
 error: aborting due to 5 previous errors
index 87d017adf68193e9e9339abf3a3d767dc341f98d..dd43c58de6df1d36621d32074e0b44e0b8251aac 100644 (file)
@@ -24,5 +24,5 @@ fn add(self, rhs: !) -> ! {
 }
 
 fn main() {
-    let x = Foo + return;
+    let x = Foo + return; //~ ERROR unreachable
 }
index 1a2cc252051bfb9dffc07e18fdf0b86b2ff0ed71..4ae286d2fff1124ef89385888571906c651e425f 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_add.rs:27:13
    |
-27 |     let x = Foo + return;
+27 |     let x = Foo + return; //~ ERROR unreachable
    |             ^^^^^^^^^^^^
    |
 note: lint level defined here
index 00e8be077254706cb716bef81543ed314e0bbe95..31229668796e8d65ee73ebefb93b0ce26610834a 100644 (file)
 
 fn a() {
     // the `22` is unreachable:
-    let x: [usize; 2] = [return, 22];
+    let x: [usize; 2] = [return, 22]; //~ ERROR unreachable
 }
 
 fn b() {
     // the `array is unreachable:
-    let x: [usize; 2] = [22, return];
+    let x: [usize; 2] = [22, return]; //~ ERROR unreachable
 }
 
 fn main() { }
index f8dbdb5f8bb66aa9c6097c5a6d18cb6944e80920..0f64d158503602991130ceb73a7a2c5827292763 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_array.rs:20:34
    |
-20 |     let x: [usize; 2] = [return, 22];
+20 |     let x: [usize; 2] = [return, 22]; //~ ERROR unreachable
    |                                  ^^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: unreachable expression
   --> $DIR/expr_array.rs:25:25
    |
-25 |     let x: [usize; 2] = [22, return];
+25 |     let x: [usize; 2] = [22, return]; //~ ERROR unreachable
    |                         ^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index 1b9357013d27038773fe2ba5280635c96b22017b..e6fb46a5bac0c90ad64c659ede967d4153b2db1c 100644 (file)
@@ -17,7 +17,7 @@
 fn foo() {
     // No error here.
     let x;
-    x = return;
+    x = return; //~ ERROR unreachable
 }
 
 fn bar() {
@@ -27,13 +27,13 @@ fn bar() {
         // Here we consider the `return` unreachable because
         // "evaluating" the `*p` has type `!`. This is somewhat
         // dubious, I suppose.
-        *p = return;
+        *p = return; //~ ERROR unreachable
     }
 }
 
 fn baz() {
     let mut i = 0;
-    *{return; &mut i} = 22;
+    *{return; &mut i} = 22; //~ ERROR unreachable
 }
 
 fn main() { }
index 807f6a1c1d5847eb383d2e1f6bcfcb24ee2f2ea2..42c00d5a8b7d874f58b194d37245e048a9fca744 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_assign.rs:20:5
    |
-20 |     x = return;
+20 |     x = return; //~ ERROR unreachable
    |     ^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,13 +13,13 @@ note: lint level defined here
 error: unreachable expression
   --> $DIR/expr_assign.rs:30:14
    |
-30 |         *p = return;
+30 |         *p = return; //~ ERROR unreachable
    |              ^^^^^^
 
 error: unreachable expression
   --> $DIR/expr_assign.rs:36:15
    |
-36 |     *{return; &mut i} = 22;
+36 |     *{return; &mut i} = 22; //~ ERROR unreachable
    |               ^^^^^^
 
 error: aborting due to 3 previous errors
index 093589b4dc83980b94e038ed3d92260440317f85..57b5d3cabce6130af76e27ce2a4038e554ee3cdb 100644 (file)
@@ -18,7 +18,7 @@ fn a() {
     // Here the tail expression is considered unreachable:
     let x = {
         return;
-        22
+        22 //~ ERROR unreachable
     };
 }
 
index 8a17d4e6278cc862d2a6c039dcf5a20ec8abd660..4c361dc885579fbdd8aaff4da0348fb1f5999052 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_block.rs:21:9
    |
-21 |         22
+21 |         22 //~ ERROR unreachable
    |         ^^
    |
 note: lint level defined here
index 6509b608335afc5b825f5f07a326ec9a6895e0ca..ab62cbdf8374736c2a5d44c39d04b12353b16379 100644 (file)
@@ -13,6 +13,6 @@
 #![deny(unreachable_code)]
 
 fn main() {
-    let x = box return;
+    let x = box return; //~ ERROR unreachable
     println!("hi");
 }
index 78ba231cef9fcf2121f0173688ab3710823c13fa..d8b5d9f8d76844e8ca12d3c8b6d552ba0892f09b 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_box.rs:16:13
    |
-16 |     let x = box return;
+16 |     let x = box return; //~ ERROR unreachable
    |             ^^^^^^^^^^
    |
 note: lint level defined here
index 8d9f303df7fdcb74f98048aae943d8a70b166929..86b95aad9c253db8580b54f4e829ab3a02a13cea 100644 (file)
@@ -20,12 +20,12 @@ fn bar(x: !) { }
 
 fn a() {
     // the `22` is unreachable:
-    foo(return, 22);
+    foo(return, 22); //~ ERROR unreachable
 }
 
 fn b() {
     // the call is unreachable:
-    bar(return);
+    bar(return); //~ ERROR unreachable
 }
 
 fn main() { }
index 5526827f59fc9965853df9bc66eb3674e29572ea..eaafe8dc5d593e3c3d2cf1670a67d711d720ed9f 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_call.rs:23:17
    |
-23 |     foo(return, 22);
+23 |     foo(return, 22); //~ ERROR unreachable
    |                 ^^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: unreachable expression
   --> $DIR/expr_call.rs:28:5
    |
-28 |     bar(return);
+28 |     bar(return); //~ ERROR unreachable
    |     ^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index 926ef864ebf21bb5058e921298035c14018fc57f..76b00c00ad985f0dc72d8fd0d3e5b0deb9dee333 100644 (file)
@@ -17,7 +17,7 @@
 
 fn a() {
     // the cast is unreachable:
-    let x = {return} as !;
+    let x = {return} as !; //~ ERROR unreachable
 }
 
 fn main() { }
index a22300dcc1398f37c6c0dbee1b349266864a90a1..d6fb37768c5415c4b73a14ec9d7348e6ebf38795 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_cast.rs:20:13
    |
-20 |     let x = {return} as !;
+20 |     let x = {return} as !; //~ ERROR unreachable
    |             ^^^^^^^^^^^^^
    |
 note: lint level defined here
index 23bdcc035b22773430eadd244a359d9fada4ff83..d2b96e51a9519fb1bc50705546bf7c832f731fc3 100644 (file)
@@ -17,7 +17,7 @@
 fn a() {
     // The match is considered unreachable here, because the `return`
     // diverges:
-    match {return} { }
+    match {return} { } //~ ERROR unreachable
 }
 
 fn b() {
index dcfefe109c383c6a807198da7acca931303e8a5b..4b44b38895c31aefe6950039412f31da27ad0f4a 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_match.rs:20:5
    |
-20 |     match {return} { }
+20 |     match {return} { } //~ ERROR unreachable
    |     ^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
index f1d979d7df79d3a19686eca87ac4e82585363951..8be71e464b2027a40dc44096e912fd2995a7eee0 100644 (file)
@@ -23,12 +23,12 @@ fn bar(&self, x: !) { }
 
 fn a() {
     // the `22` is unreachable:
-    Foo.foo(return, 22);
+    Foo.foo(return, 22); //~ ERROR unreachable
 }
 
 fn b() {
     // the call is unreachable:
-    Foo.bar(return);
+    Foo.bar(return); //~ ERROR unreachable
 }
 
 fn main() { }
index 177d4352a376ddb175125c1425e7e57891a8d659..db9d5c3d22c1a73b96ca0af04b7d5cc335791228 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_method.rs:26:21
    |
-26 |     Foo.foo(return, 22);
+26 |     Foo.foo(return, 22); //~ ERROR unreachable
    |                     ^^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: unreachable expression
   --> $DIR/expr_method.rs:31:5
    |
-31 |     Foo.bar(return);
+31 |     Foo.bar(return); //~ ERROR unreachable
    |     ^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index 6078d6d5bde461fcdc82abe0a983b60941615c18..47ee2ba62b829d6054d7da8e80601d663fb12f37 100644 (file)
@@ -17,7 +17,7 @@
 
 fn a() {
     // the repeat is unreachable:
-    let x: [usize; 2] = [return; 2];
+    let x: [usize; 2] = [return; 2]; //~ ERROR unreachable
 }
 
 fn main() { }
index 19afc5dd7b5ee192dc8307c046a6fabaa6d08100..54b29b616f3d725be5431072e5276df667c30dfc 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_repeat.rs:20:25
    |
-20 |     let x: [usize; 2] = [return; 2];
+20 |     let x: [usize; 2] = [return; 2]; //~ ERROR unreachable
    |                         ^^^^^^^^^^^
    |
 note: lint level defined here
index c640ca06630293615bccaef35ed2f0835a0d59bc..fac1116dc68972d4344e14d6f4e54ced315ca6fe 100644 (file)
@@ -18,7 +18,7 @@
 fn a() {
     // Here we issue that the "2nd-innermost" return is unreachable,
     // but we stop there.
-    let x = {return {return {return;}}};
+    let x = {return {return {return;}}}; //~ ERROR unreachable
 }
 
 fn main() { }
index 3eb70a4dd7c848ecc53b7b50d5ce47035c876da5..a96def6011eb8f6c385a8f37feab82a15979ecac 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_return.rs:21:22
    |
-21 |     let x = {return {return {return;}}};
+21 |     let x = {return {return {return;}}}; //~ ERROR unreachable
    |                      ^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
index 09e31819279f2f7cd48cead8fd7258cbad2121a7..b5acd395be620e4b02b8fed6ddfa01ba89453373 100644 (file)
@@ -22,22 +22,22 @@ struct Foo {
 
 fn a() {
     // struct expr is unreachable:
-    let x = Foo { a: 22, b: 33, ..return };
+    let x = Foo { a: 22, b: 33, ..return }; //~ ERROR unreachable
 }
 
 fn b() {
     // the `33` is unreachable:
-    let x = Foo { a: return, b: 33, ..return };
+    let x = Foo { a: return, b: 33, ..return }; //~ ERROR unreachable
 }
 
 fn c() {
     // the `..return` is unreachable:
-    let x = Foo { a: 22, b: return, ..return };
+    let x = Foo { a: 22, b: return, ..return }; //~ ERROR unreachable
 }
 
 fn d() {
     // the struct expr is unreachable:
-    let x = Foo { a: 22, b: return };
+    let x = Foo { a: 22, b: return }; //~ ERROR unreachable
 }
 
 fn main() { }
index 4b7ac6604132c165b255200be13f61c49b0ae77f..b2cb1ef19cf83e37c3d4dba2b68c1198de788a57 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_struct.rs:25:13
    |
-25 |     let x = Foo { a: 22, b: 33, ..return };
+25 |     let x = Foo { a: 22, b: 33, ..return }; //~ ERROR unreachable
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,19 +13,19 @@ note: lint level defined here
 error: unreachable expression
   --> $DIR/expr_struct.rs:30:33
    |
-30 |     let x = Foo { a: return, b: 33, ..return };
+30 |     let x = Foo { a: return, b: 33, ..return }; //~ ERROR unreachable
    |                                 ^^
 
 error: unreachable expression
   --> $DIR/expr_struct.rs:35:39
    |
-35 |     let x = Foo { a: 22, b: return, ..return };
+35 |     let x = Foo { a: 22, b: return, ..return }; //~ ERROR unreachable
    |                                       ^^^^^^
 
 error: unreachable expression
   --> $DIR/expr_struct.rs:40:13
    |
-40 |     let x = Foo { a: 22, b: return };
+40 |     let x = Foo { a: 22, b: return }; //~ ERROR unreachable
    |             ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 4 previous errors
index 7c75296de6c54c83daa862e37fc4849794a4b2bd..089020bf3853fcf5271f1e364529f81528b53e4e 100644 (file)
 
 fn a() {
     // the `2` is unreachable:
-    let x: (usize, usize) = (return, 2);
+    let x: (usize, usize) = (return, 2); //~ ERROR unreachable
 }
 
 fn b() {
     // the tuple is unreachable:
-    let x: (usize, usize) = (2, return);
+    let x: (usize, usize) = (2, return); //~ ERROR unreachable
 }
 
 fn main() { }
index 63f477fd0c373a9a8b37111b1657380e410b8733..af43162a98447a4724d748a428a050ea7cf42159 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_tup.rs:20:38
    |
-20 |     let x: (usize, usize) = (return, 2);
+20 |     let x: (usize, usize) = (return, 2); //~ ERROR unreachable
    |                                      ^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error: unreachable expression
   --> $DIR/expr_tup.rs:25:29
    |
-25 |     let x: (usize, usize) = (2, return);
+25 |     let x: (usize, usize) = (2, return); //~ ERROR unreachable
    |                             ^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index 2fa277c382e87131a95f27db402f5293c3e874b4..29c59d5304f921dbbf968818588e7cac9537c565 100644 (file)
@@ -17,7 +17,7 @@
 
 fn a() {
     // the cast is unreachable:
-    let x = {return}: !;
+    let x = {return}: !; //~ ERROR unreachable
 }
 
 fn main() { }
index 6ed79974ccb77c1aea43d4eddfbecc92102215fd..d6bcb4ec80f8b81d59fd2e759049e9779e91d1ff 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_type.rs:20:13
    |
-20 |     let x = {return}: !;
+20 |     let x = {return}: !; //~ ERROR unreachable
    |             ^^^^^^^^^^^
    |
 note: lint level defined here
index 57901fbaa7c44881ec6ad0bc6700a49b079f7cee..6cff3ff9644394bec18b65f6fd22a268d6e3e8cb 100644 (file)
@@ -15,7 +15,8 @@
 #![feature(never_type)]
 
 fn foo() {
-    let x: ! = ! { return; 22 };
+    let x: ! = ! { return; 22 }; //~ ERROR unreachable
+    //~^ ERROR cannot apply unary operator `!` to type `!`
 }
 
 fn main() { }
index 9f4562fe297180fac5c8f86ca0321a64ebec014c..f14824728a70c218783d0313a1fa3d8ada960dcb 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable expression
   --> $DIR/expr_unary.rs:18:28
    |
-18 |     let x: ! = ! { return; 22 };
+18 |     let x: ! = ! { return; 22 }; //~ ERROR unreachable
    |                            ^^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 error[E0600]: cannot apply unary operator `!` to type `!`
   --> $DIR/expr_unary.rs:18:16
    |
-18 |     let x: ! = ! { return; 22 };
+18 |     let x: ! = ! { return; 22 }; //~ ERROR unreachable
    |                ^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
index 4f55f33d7f8083d6659b7765fdbaebab78111b08..4059aa5527ed132ac2d75ea56fd44a3a86405930 100644 (file)
 
 fn main() {
     let _ = namespaced_enums::A;
-    //~^ ERROR unresolved value `namespaced_enums::A`
-    //~| HELP you can import it into scope: `use namespaced_enums::Foo::A;`
+    //~^ ERROR cannot find value `A`
     let _ = namespaced_enums::B(10);
-    //~^ ERROR unresolved function `namespaced_enums::B`
-    //~| HELP you can import it into scope: `use namespaced_enums::Foo::B;`
+    //~^ ERROR cannot find function `B`
     let _ = namespaced_enums::C { a: 10 };
-    //~^ ERROR unresolved struct, variant or union type `namespaced_enums::C`
-    //~| HELP you can import it into scope: `use namespaced_enums::Foo::C;`
+    //~^ ERROR cannot find struct, variant or union type `C`
 }
index 52d798a2ca5fb58ddce17689a3732e6a5162b4f1..5acc678df90e3b9e19729361f57b21bee0938a1f 100644 (file)
@@ -9,9 +9,9 @@ help: possible candidate is found in another module, you can import it into scop
    |
 
 error[E0425]: cannot find function `B` in module `namespaced_enums`
-  --> $DIR/enums-are-namespaced-xc.rs:18:31
+  --> $DIR/enums-are-namespaced-xc.rs:17:31
    |
-18 |     let _ = namespaced_enums::B(10);
+17 |     let _ = namespaced_enums::B(10);
    |                               ^ not found in `namespaced_enums`
 help: possible candidate is found in another module, you can import it into scope
    |
@@ -19,9 +19,9 @@ help: possible candidate is found in another module, you can import it into scop
    |
 
 error[E0422]: cannot find struct, variant or union type `C` in module `namespaced_enums`
-  --> $DIR/enums-are-namespaced-xc.rs:21:31
+  --> $DIR/enums-are-namespaced-xc.rs:19:31
    |
-21 |     let _ = namespaced_enums::C { a: 10 };
+19 |     let _ = namespaced_enums::C { a: 10 };
    |                               ^ not found in `namespaced_enums`
 help: possible candidate is found in another module, you can import it into scope
    |
index b1fc6c477207a0a79c38be8c4abb7272d8c7069f..38444f69628d1458777ada4138ea119dcbb92b21 100644 (file)
@@ -27,111 +27,92 @@ fn b(&self) {}
 impl Foo for *const BarTy {
     fn bar(&self) {
         baz();
-        //~^ ERROR unresolved function `baz`
-        //~| NOTE did you mean `self.baz(...)`?
+        //~^ ERROR cannot find function `baz`
         a;
-        //~^ ERROR unresolved value `a`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find value `a`
+        //~| NOTE not found in this scope
     }
 }
 
 impl<'a> Foo for &'a BarTy {
     fn bar(&self) {
         baz();
-        //~^ ERROR unresolved function `baz`
-        //~| NOTE did you mean `self.baz(...)`?
+        //~^ ERROR cannot find function `baz`
         x;
-        //~^ ERROR unresolved value `x`
-        //~| NOTE did you mean `self.x`?
+        //~^ ERROR cannot find value `x`
         y;
-        //~^ ERROR unresolved value `y`
-        //~| NOTE did you mean `self.y`?
+        //~^ ERROR cannot find value `y`
         a;
-        //~^ ERROR unresolved value `a`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find value `a`
+        //~| NOTE not found in this scope
         bah;
-        //~^ ERROR unresolved value `bah`
-        //~| NOTE did you mean `Self::bah`?
+        //~^ ERROR cannot find value `bah`
         b;
-        //~^ ERROR unresolved value `b`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find value `b`
+        //~| NOTE not found in this scope
     }
 }
 
 impl<'a> Foo for &'a mut BarTy {
     fn bar(&self) {
         baz();
-        //~^ ERROR unresolved function `baz`
-        //~| NOTE did you mean `self.baz(...)`?
+        //~^ ERROR cannot find function `baz`
         x;
-        //~^ ERROR unresolved value `x`
-        //~| NOTE did you mean `self.x`?
+        //~^ ERROR cannot find value `x`
         y;
-        //~^ ERROR unresolved value `y`
-        //~| NOTE did you mean `self.y`?
+        //~^ ERROR cannot find value `y`
         a;
-        //~^ ERROR unresolved value `a`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find value `a`
+        //~| NOTE not found in this scope
         bah;
-        //~^ ERROR unresolved value `bah`
-        //~| NOTE did you mean `Self::bah`?
+        //~^ ERROR cannot find value `bah`
         b;
-        //~^ ERROR unresolved value `b`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find value `b`
+        //~| NOTE not found in this scope
     }
 }
 
 impl Foo for Box<BarTy> {
     fn bar(&self) {
         baz();
-        //~^ ERROR unresolved function `baz`
-        //~| NOTE did you mean `self.baz(...)`?
+        //~^ ERROR cannot find function `baz`
         bah;
-        //~^ ERROR unresolved value `bah`
-        //~| NOTE did you mean `Self::bah`?
+        //~^ ERROR cannot find value `bah`
     }
 }
 
 impl Foo for *const isize {
     fn bar(&self) {
         baz();
-        //~^ ERROR unresolved function `baz`
-        //~| NOTE did you mean `self.baz(...)`?
+        //~^ ERROR cannot find function `baz`
         bah;
-        //~^ ERROR unresolved value `bah`
-        //~| NOTE did you mean `Self::bah`?
+        //~^ ERROR cannot find value `bah`
     }
 }
 
 impl<'a> Foo for &'a isize {
     fn bar(&self) {
         baz();
-        //~^ ERROR unresolved function `baz`
-        //~| NOTE did you mean `self.baz(...)`?
+        //~^ ERROR cannot find function `baz`
         bah;
-        //~^ ERROR unresolved value `bah`
-        //~| NOTE did you mean `Self::bah`?
+        //~^ ERROR cannot find value `bah`
     }
 }
 
 impl<'a> Foo for &'a mut isize {
     fn bar(&self) {
         baz();
-        //~^ ERROR unresolved function `baz`
-        //~| NOTE did you mean `self.baz(...)`?
+        //~^ ERROR cannot find function `baz`
         bah;
-        //~^ ERROR unresolved value `bah`
-        //~| NOTE did you mean `Self::bah`?
+        //~^ ERROR cannot find value `bah`
     }
 }
 
 impl Foo for Box<isize> {
     fn bar(&self) {
         baz();
-        //~^ ERROR unresolved function `baz`
-        //~| NOTE did you mean `self.baz(...)`?
+        //~^ ERROR cannot find function `baz`
         bah;
-        //~^ ERROR unresolved value `bah`
-        //~| NOTE did you mean `Self::bah`?
+        //~^ ERROR cannot find value `bah`
     }
 }
index 7aa0c2707b56fb1b9393901f10b0ee583b089d8c..a472fc861eb651ac4838f9b3a11f97f8dba871ec 100644 (file)
@@ -5,141 +5,141 @@ error[E0425]: cannot find function `baz` in this scope
    |         ^^^ help: try: `self.baz`
 
 error[E0425]: cannot find value `a` in this scope
-  --> $DIR/issue-14254.rs:32:9
+  --> $DIR/issue-14254.rs:31:9
    |
-32 |         a;
+31 |         a;
    |         ^ not found in this scope
 
 error[E0425]: cannot find function `baz` in this scope
-  --> $DIR/issue-14254.rs:40:9
+  --> $DIR/issue-14254.rs:39:9
    |
-40 |         baz();
+39 |         baz();
    |         ^^^ help: try: `self.baz`
 
 error[E0425]: cannot find value `x` in this scope
-  --> $DIR/issue-14254.rs:43:9
+  --> $DIR/issue-14254.rs:41:9
    |
-43 |         x;
+41 |         x;
    |         ^ help: try: `self.x`
 
 error[E0425]: cannot find value `y` in this scope
-  --> $DIR/issue-14254.rs:46:9
+  --> $DIR/issue-14254.rs:43:9
    |
-46 |         y;
+43 |         y;
    |         ^ help: try: `self.y`
 
 error[E0425]: cannot find value `a` in this scope
-  --> $DIR/issue-14254.rs:49:9
+  --> $DIR/issue-14254.rs:45:9
    |
-49 |         a;
+45 |         a;
    |         ^ not found in this scope
 
 error[E0425]: cannot find value `bah` in this scope
-  --> $DIR/issue-14254.rs:52:9
+  --> $DIR/issue-14254.rs:48:9
    |
-52 |         bah;
+48 |         bah;
    |         ^^^ help: try: `Self::bah`
 
 error[E0425]: cannot find value `b` in this scope
-  --> $DIR/issue-14254.rs:55:9
+  --> $DIR/issue-14254.rs:50:9
    |
-55 |         b;
+50 |         b;
    |         ^ not found in this scope
 
 error[E0425]: cannot find function `baz` in this scope
-  --> $DIR/issue-14254.rs:63:9
+  --> $DIR/issue-14254.rs:58:9
    |
-63 |         baz();
+58 |         baz();
    |         ^^^ help: try: `self.baz`
 
 error[E0425]: cannot find value `x` in this scope
-  --> $DIR/issue-14254.rs:66:9
+  --> $DIR/issue-14254.rs:60:9
    |
-66 |         x;
+60 |         x;
    |         ^ help: try: `self.x`
 
 error[E0425]: cannot find value `y` in this scope
-  --> $DIR/issue-14254.rs:69:9
+  --> $DIR/issue-14254.rs:62:9
    |
-69 |         y;
+62 |         y;
    |         ^ help: try: `self.y`
 
 error[E0425]: cannot find value `a` in this scope
-  --> $DIR/issue-14254.rs:72:9
+  --> $DIR/issue-14254.rs:64:9
    |
-72 |         a;
+64 |         a;
    |         ^ not found in this scope
 
 error[E0425]: cannot find value `bah` in this scope
-  --> $DIR/issue-14254.rs:75:9
+  --> $DIR/issue-14254.rs:67:9
    |
-75 |         bah;
+67 |         bah;
    |         ^^^ help: try: `Self::bah`
 
 error[E0425]: cannot find value `b` in this scope
-  --> $DIR/issue-14254.rs:78:9
+  --> $DIR/issue-14254.rs:69:9
    |
-78 |         b;
+69 |         b;
    |         ^ not found in this scope
 
 error[E0425]: cannot find function `baz` in this scope
-  --> $DIR/issue-14254.rs:86:9
+  --> $DIR/issue-14254.rs:77:9
    |
-86 |         baz();
+77 |         baz();
    |         ^^^ help: try: `self.baz`
 
 error[E0425]: cannot find value `bah` in this scope
-  --> $DIR/issue-14254.rs:89:9
+  --> $DIR/issue-14254.rs:79:9
    |
-89 |         bah;
+79 |         bah;
    |         ^^^ help: try: `Self::bah`
 
 error[E0425]: cannot find function `baz` in this scope
-  --> $DIR/issue-14254.rs:97:9
+  --> $DIR/issue-14254.rs:86:9
    |
-97 |         baz();
+86 |         baz();
    |         ^^^ help: try: `self.baz`
 
 error[E0425]: cannot find value `bah` in this scope
-   --> $DIR/issue-14254.rs:100:9
-    |
-100 |         bah;
-    |         ^^^ help: try: `Self::bah`
+  --> $DIR/issue-14254.rs:88:9
+   |
+88 |         bah;
+   |         ^^^ help: try: `Self::bah`
 
 error[E0425]: cannot find function `baz` in this scope
-   --> $DIR/issue-14254.rs:108:9
-    |
-108 |         baz();
-    |         ^^^ help: try: `self.baz`
+  --> $DIR/issue-14254.rs:95:9
+   |
+95 |         baz();
+   |         ^^^ help: try: `self.baz`
 
 error[E0425]: cannot find value `bah` in this scope
-   --> $DIR/issue-14254.rs:111:9
-    |
-111 |         bah;
-    |         ^^^ help: try: `Self::bah`
+  --> $DIR/issue-14254.rs:97:9
+   |
+97 |         bah;
+   |         ^^^ help: try: `Self::bah`
 
 error[E0425]: cannot find function `baz` in this scope
-   --> $DIR/issue-14254.rs:119:9
+   --> $DIR/issue-14254.rs:104:9
     |
-119 |         baz();
+104 |         baz();
     |         ^^^ help: try: `self.baz`
 
 error[E0425]: cannot find value `bah` in this scope
-   --> $DIR/issue-14254.rs:122:9
+   --> $DIR/issue-14254.rs:106:9
     |
-122 |         bah;
+106 |         bah;
     |         ^^^ help: try: `Self::bah`
 
 error[E0425]: cannot find function `baz` in this scope
-   --> $DIR/issue-14254.rs:130:9
+   --> $DIR/issue-14254.rs:113:9
     |
-130 |         baz();
+113 |         baz();
     |         ^^^ help: try: `self.baz`
 
 error[E0425]: cannot find value `bah` in this scope
-   --> $DIR/issue-14254.rs:133:9
+   --> $DIR/issue-14254.rs:115:9
     |
-133 |         bah;
+115 |         bah;
     |         ^^^ help: try: `Self::bah`
 
 error[E0601]: main function not found
index 1f777e53632dd93e59b5920a6985d68620484963..6d9df46eed416beffaa5c215cf3bb2c956e440d7 100644 (file)
@@ -18,10 +18,6 @@ impl GslResult {
     pub fn new() -> GslResult {
         Result {
 //~^ ERROR expected struct, variant or union type, found enum `Result`
-//~| HELP possible better candidates are found in other modules, you can import them into scope
-//~| HELP std::fmt::Result
-//~| HELP std::io::Result
-//~| HELP std::thread::Result
             val: 0f64,
             err: 0f64
         }
index 3ac9b379d189253e08b29c163c7a028c43d69e82..295880c94998857832089cb8c66cefa313d6a9e0 100644 (file)
@@ -9,10 +9,10 @@
 // except according to those terms.
 
 enum SomeEnum {
+//~^ HELP you can import it into scope
     E
 }
 
 fn main() {
-    E { name: "foobar" }; //~ ERROR unresolved struct, variant or union type `E`
-                          //~^ HELP you can import it into scope: `use SomeEnum::E;`
+    E { name: "foobar" }; //~ ERROR cannot find struct, variant or union type `E`
 }
index bdc4fb0d34970f48c84650756a8b988d00a13362..33f15267e4af41db31adacb9236fa0b71dad02b8 100644 (file)
@@ -1,7 +1,7 @@
 error[E0422]: cannot find struct, variant or union type `E` in this scope
-  --> $DIR/issue-17518.rs:16:5
+  --> $DIR/issue-17518.rs:17:5
    |
-16 |     E { name: "foobar" }; //~ ERROR unresolved struct, variant or union type `E`
+17 |     E { name: "foobar" }; //~ ERROR cannot find struct, variant or union type `E`
    |     ^ not found in this scope
 help: possible candidate is found in another module, you can import it into scope
    |
index b1266a5af358174a0262d58d173c7d7c9fbc38cb..d3c18d4c80a1c2199d3f815da815294bcb0da649 100644 (file)
@@ -51,11 +51,7 @@ struct Mul{
 //   help:   `std::ops::Mul`
 
 impl Mul for Foo {
-//~^ ERROR unresolved trait `Mul`
-//~| HELP possible candidates are found in other modules, you can import them into scope
-//~| HELP `mul1::Mul`
-//~| HELP `mul2::Mul`
-//~| HELP `std::ops::Mul`
+//~^ ERROR cannot find trait `Mul`
 }
 
 // BEFORE, we got:
@@ -70,24 +66,17 @@ impl Mul for Foo {
 //   help:   `mul4::Mul`
 //   help:   and 2 other candidates
 fn getMul() -> Mul {
-//~^ ERROR unresolved type `Mul`
-//~| HELP possible candidates are found in other modules, you can import them into scope
-//~| HELP `mul1::Mul`
-//~| HELP `mul2::Mul`
-//~| HELP `mul3::Mul`
-//~| HELP `mul4::Mul`
-//~| HELP and 2 other candidates
+//~^ ERROR cannot find type `Mul`
 }
 
 // Let's also test what happens if the trait doesn't exist:
 impl ThisTraitReallyDoesntExistInAnyModuleReally for Foo {
-//~^ ERROR unresolved trait `ThisTraitReallyDoesntExistInAnyModuleReally`
+//~^ ERROR cannot find trait `ThisTraitReallyDoesntExistInAnyModuleReally`
 }
 
 // Let's also test what happens if there's just one alternative:
 impl Div for Foo {
-//~^ ERROR unresolved trait `Div`
-//~| HELP `use std::ops::Div;`
+//~^ ERROR cannot find trait `Div`
 }
 
 fn main() {
index 6038c683e436b66a65b657d6c09c2b8281171a5c..88405fd841b069c6f3d65ac2b4051c2ce8033add 100644 (file)
@@ -13,9 +13,9 @@ help: possible candidates are found in other modules, you can import them into s
    |
 
 error[E0412]: cannot find type `Mul` in this scope
-  --> $DIR/issue-21221-1.rs:72:16
+  --> $DIR/issue-21221-1.rs:68:16
    |
-72 | fn getMul() -> Mul {
+68 | fn getMul() -> Mul {
    |                ^^^ not found in this scope
 help: possible candidates are found in other modules, you can import them into scope
    |
@@ -30,15 +30,15 @@ help: possible candidates are found in other modules, you can import them into s
 and 2 other candidates
 
 error[E0405]: cannot find trait `ThisTraitReallyDoesntExistInAnyModuleReally` in this scope
-  --> $DIR/issue-21221-1.rs:83:6
+  --> $DIR/issue-21221-1.rs:73:6
    |
-83 | impl ThisTraitReallyDoesntExistInAnyModuleReally for Foo {
+73 | impl ThisTraitReallyDoesntExistInAnyModuleReally for Foo {
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
 
 error[E0405]: cannot find trait `Div` in this scope
-  --> $DIR/issue-21221-1.rs:88:6
+  --> $DIR/issue-21221-1.rs:78:6
    |
-88 | impl Div for Foo {
+78 | impl Div for Foo {
    |      ^^^ not found in this scope
 help: possible candidate is found in another module, you can import it into scope
    |
index 15e859329c407db226c90440af6b49dfaa087bdf..c0ebc57efb5c220898ee5f6eaf93d338e2d8d140 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 pub mod foo {
+//~^ HELP you can import it into scope
     pub mod bar {
         // note: trait T is not public, but being in the current
         // crate, it's fine to show it, since the programmer can
@@ -26,5 +27,4 @@ pub mod baz {
 
 struct Foo;
 impl T for Foo { }
-//~^ ERROR unresolved trait `T`
-//~| HELP you can import it into scope: `use foo::bar::T;`
+//~^ ERROR cannot find trait `T`
index 0ae8052758dacf51de6833c6fdb01be65b0b222e..ffe57c5099d68f5a5c9a9a1eefc15f86a5e25ffa 100644 (file)
@@ -1,7 +1,7 @@
 error[E0405]: cannot find trait `T` in this scope
-  --> $DIR/issue-21221-2.rs:28:6
+  --> $DIR/issue-21221-2.rs:29:6
    |
-28 | impl T for Foo { }
+29 | impl T for Foo { }
    |      ^ not found in this scope
 help: possible candidate is found in another module, you can import it into scope
    |
index 5d62cb85914fd4cb12d505ca01ff69d3168f0edd..046066b198639b088993d144957886b14e1ece88 100644 (file)
@@ -16,6 +16,7 @@
 extern crate issue_21221_3;
 
 struct Foo;
+//~^ HELP possible candidate is found in another module
 
 // NOTE: This shows only traits accessible from the current
 // crate, thus the two private entities:
@@ -23,8 +24,7 @@
 //   `issue_21221_3::outer::public_module::OuterTrait`
 // are hidden from the view.
 impl OuterTrait for Foo {}
-//~^ ERROR unresolved trait `OuterTrait`
-//~| HELP you can import it into scope: `use issue_21221_3::outer::OuterTrait;`
+//~^ ERROR cannot find trait `OuterTrait`
 fn main() {
     println!("Hello, world!");
 }
index b26a8cdacb029038d6b648a4972b4d3a3a244d6f..f134b864414008a90fd39c6ac973913aab2f0bfe 100644 (file)
@@ -1,7 +1,7 @@
 error[E0405]: cannot find trait `OuterTrait` in this scope
-  --> $DIR/issue-21221-3.rs:25:6
+  --> $DIR/issue-21221-3.rs:26:6
    |
-25 | impl OuterTrait for Foo {}
+26 | impl OuterTrait for Foo {}
    |      ^^^^^^^^^^ not found in this scope
 help: possible candidate is found in another module, you can import it into scope
    |
index ff6698f8717bbe8348c4ed8bcb747bd49fa5b4eb..da8f2c6e778e5d2d4c10b1221156524e4db98fa0 100644 (file)
 extern crate issue_21221_4;
 
 struct Foo;
+//~^ HELP possible candidate is found in another module
 
 impl T for Foo {}
-//~^ ERROR unresolved trait `T`
-//~| HELP you can import it into scope: `use issue_21221_4::T;`
+//~^ ERROR cannot find trait `T`
 
 fn main() {
     println!("Hello, world!");
index 0a22d8e1fe1ad6f8db4e6782a4adee42b4198ff7..0f3830bc2581da07f4fb7b49859b9f04381610f9 100644 (file)
@@ -1,7 +1,7 @@
 error[E0405]: cannot find trait `T` in this scope
-  --> $DIR/issue-21221-4.rs:20:6
+  --> $DIR/issue-21221-4.rs:21:6
    |
-20 | impl T for Foo {}
+21 | impl T for Foo {}
    |      ^ not found in this scope
 help: possible candidate is found in another module, you can import it into scope
    |
index 19069f4916769b14b618e27b9e8e6f36af8be4e6..9f7b6ff5767c1ccf935f562c115722a475e99673 100644 (file)
@@ -13,10 +13,9 @@ pub trait ToNbt<T> {
 }
 
 impl ToNbt<Self> {}
-//~^ ERROR unresolved type `Self`
-//~| NOTE `Self` is only available in traits and impls
-//~| ERROR the trait `ToNbt` cannot be made into an object
-//~| NOTE the trait `ToNbt` cannot be made into an object
-//~| NOTE method `new` has no receiver
+//~^ ERROR unsupported cyclic reference
+//~| NOTE cyclic reference
+//~| NOTE the cycle begins when processing
+//~| NOTE ...which then again requires
 
 fn main() {}
index 6deb598b631f550e9c73d5b105d338e43d24cc6c..d0490ff981dca7bfd1d9c07f55f496dc66e6a5a9 100644 (file)
@@ -25,24 +25,22 @@ impl MaybeDog {
   fn bark() {
     // If this provides a suggestion, it's a bug as MaybeDog doesn't impl Groom
     shave();
-    //~^ ERROR unresolved function `shave`
-    //~| NOTE no resolution found
+    //~^ ERROR cannot find function `shave`
+    //~| NOTE not found in this scope
   }
 }
 
 impl Clone for cat {
   fn clone(&self) -> Self {
     clone();
-    //~^ ERROR unresolved function `clone`
-    //~| NOTE did you mean `self.clone(...)`?
+    //~^ ERROR cannot find function `clone`
     loop {}
   }
 }
 impl Default for cat {
   fn default() -> Self {
     default();
-    //~^ ERROR unresolved function `default`
-    //~| NOTE did you mean `Self::default`?
+    //~^ ERROR cannot find function `default`
     loop {}
   }
 }
@@ -50,16 +48,13 @@ fn default() -> Self {
 impl Groom for cat {
   fn shave(other: usize) {
     whiskers -= other;
-    //~^ ERROR unresolved value `whiskers`
-    //~| ERROR unresolved value `whiskers`
-    //~| NOTE did you mean `self.whiskers`?
+    //~^ ERROR cannot find value `whiskers`
     //~| NOTE `self` value is only available in methods with `self` parameter
     shave(4);
-    //~^ ERROR unresolved function `shave`
-    //~| NOTE did you mean `Self::shave`?
+    //~^ ERROR cannot find function `shave`
     purr();
-    //~^ ERROR unresolved function `purr`
-    //~| NOTE no resolution found
+    //~^ ERROR cannot find function `purr`
+    //~| NOTE not found in this scope
   }
 }
 
@@ -68,17 +63,17 @@ fn static_method() {}
 
     fn purr_louder() {
         static_method();
-        //~^ ERROR unresolved function `static_method`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find function `static_method`
+        //~| NOTE not found in this scope
         purr();
-        //~^ ERROR unresolved function `purr`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find function `purr`
+        //~| NOTE not found in this scope
         purr();
-        //~^ ERROR unresolved function `purr`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find function `purr`
+        //~| NOTE not found in this scope
         purr();
-        //~^ ERROR unresolved function `purr`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find function `purr`
+        //~| NOTE not found in this scope
     }
 }
 
@@ -93,28 +88,25 @@ fn meow() {
 
   fn purr(&self) {
     grow_older();
-    //~^ ERROR unresolved function `grow_older`
-    //~| NOTE no resolution found
+    //~^ ERROR cannot find function `grow_older`
+    //~| NOTE not found in this scope
     shave();
-    //~^ ERROR unresolved function `shave`
-    //~| NOTE no resolution found
+    //~^ ERROR cannot find function `shave`
+    //~| NOTE not found in this scope
   }
 
   fn burn_whiskers(&mut self) {
     whiskers = 0;
-    //~^ ERROR unresolved value `whiskers`
-    //~| NOTE did you mean `self.whiskers`?
+    //~^ ERROR cannot find value `whiskers`
   }
 
   pub fn grow_older(other:usize) {
     whiskers = 4;
-    //~^ ERROR unresolved value `whiskers`
-    //~| ERROR unresolved value `whiskers`
-    //~| NOTE did you mean `self.whiskers`?
+    //~^ ERROR cannot find value `whiskers`
     //~| NOTE `self` value is only available in methods with `self` parameter
     purr_louder();
-    //~^ ERROR unresolved function `purr_louder`
-    //~| NOTE no resolution found
+    //~^ ERROR cannot find function `purr_louder`
+    //~| NOTE not found in this scope
   }
 }
 
index ed0edd52587ec6906b5ae93b8fdcecb8c5613c72..e98d132b519a3b2d006f86ac82da6bdad0e14bbf 100644 (file)
@@ -11,99 +11,99 @@ error[E0425]: cannot find function `clone` in this scope
    |     ^^^^^ help: try: `self.clone`
 
 error[E0425]: cannot find function `default` in this scope
-  --> $DIR/issue-2356.rs:43:5
+  --> $DIR/issue-2356.rs:42:5
    |
-43 |     default();
+42 |     default();
    |     ^^^^^^^ help: try: `Self::default`
 
 error[E0425]: cannot find value `whiskers` in this scope
-  --> $DIR/issue-2356.rs:52:5
+  --> $DIR/issue-2356.rs:50:5
    |
-52 |     whiskers -= other;
+50 |     whiskers -= other;
    |     ^^^^^^^^
    |     |
    |     `self` value is only available in methods with `self` parameter
    |     help: try: `self.whiskers`
 
 error[E0425]: cannot find function `shave` in this scope
-  --> $DIR/issue-2356.rs:57:5
+  --> $DIR/issue-2356.rs:53:5
    |
-57 |     shave(4);
+53 |     shave(4);
    |     ^^^^^ help: try: `Self::shave`
 
 error[E0425]: cannot find function `purr` in this scope
-  --> $DIR/issue-2356.rs:60:5
+  --> $DIR/issue-2356.rs:55:5
    |
-60 |     purr();
+55 |     purr();
    |     ^^^^ not found in this scope
 
 error[E0425]: cannot find function `static_method` in this scope
-  --> $DIR/issue-2356.rs:70:9
+  --> $DIR/issue-2356.rs:65:9
    |
-70 |         static_method();
+65 |         static_method();
    |         ^^^^^^^^^^^^^ not found in this scope
 
 error[E0425]: cannot find function `purr` in this scope
-  --> $DIR/issue-2356.rs:73:9
+  --> $DIR/issue-2356.rs:68:9
    |
-73 |         purr();
+68 |         purr();
    |         ^^^^ not found in this scope
 
 error[E0425]: cannot find function `purr` in this scope
-  --> $DIR/issue-2356.rs:76:9
+  --> $DIR/issue-2356.rs:71:9
    |
-76 |         purr();
+71 |         purr();
    |         ^^^^ not found in this scope
 
 error[E0425]: cannot find function `purr` in this scope
-  --> $DIR/issue-2356.rs:79:9
+  --> $DIR/issue-2356.rs:74:9
    |
-79 |         purr();
+74 |         purr();
    |         ^^^^ not found in this scope
 
 error[E0424]: expected value, found module `self`
-  --> $DIR/issue-2356.rs:87:8
+  --> $DIR/issue-2356.rs:82:8
    |
-87 |     if self.whiskers > 3 {
+82 |     if self.whiskers > 3 {
    |        ^^^^ `self` value is only available in methods with `self` parameter
 
 error[E0425]: cannot find function `grow_older` in this scope
-  --> $DIR/issue-2356.rs:95:5
+  --> $DIR/issue-2356.rs:90:5
    |
-95 |     grow_older();
+90 |     grow_older();
    |     ^^^^^^^^^^ not found in this scope
 
 error[E0425]: cannot find function `shave` in this scope
-  --> $DIR/issue-2356.rs:98:5
+  --> $DIR/issue-2356.rs:93:5
    |
-98 |     shave();
+93 |     shave();
    |     ^^^^^ not found in this scope
 
 error[E0425]: cannot find value `whiskers` in this scope
-   --> $DIR/issue-2356.rs:104:5
-    |
-104 |     whiskers = 0;
-    |     ^^^^^^^^ help: try: `self.whiskers`
+  --> $DIR/issue-2356.rs:99:5
+   |
+99 |     whiskers = 0;
+   |     ^^^^^^^^ help: try: `self.whiskers`
 
 error[E0425]: cannot find value `whiskers` in this scope
-   --> $DIR/issue-2356.rs:110:5
+   --> $DIR/issue-2356.rs:104:5
     |
-110 |     whiskers = 4;
+104 |     whiskers = 4;
     |     ^^^^^^^^
     |     |
     |     `self` value is only available in methods with `self` parameter
     |     help: try: `self.whiskers`
 
 error[E0425]: cannot find function `purr_louder` in this scope
-   --> $DIR/issue-2356.rs:115:5
+   --> $DIR/issue-2356.rs:107:5
     |
-115 |     purr_louder();
+107 |     purr_louder();
     |     ^^^^^^^^^^^ not found in this scope
 
 error[E0424]: expected value, found module `self`
-   --> $DIR/issue-2356.rs:122:5
+   --> $DIR/issue-2356.rs:114:5
     |
-122 |     self += 1;
+114 |     self += 1;
     |     ^^^^ `self` value is only available in methods with `self` parameter
 
 error: aborting due to 17 previous errors
index 0d562cab6b8b1a7efa5645133fcd5f5cc4bf2df1..6065646401fcb53ceca6a1a1019cac013562da14 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn foo(_: Self) {
-//~^ ERROR unresolved type `Self`
+//~^ ERROR cannot find type `Self`
 //~| NOTE `Self` is only available in traits and impls
 }
 
index f290a74861d1825b9d622fb23b107f74c7c75af3..f58f7cc3869d2d61363f84372e7a64353d1667af 100644 (file)
@@ -18,7 +18,8 @@ fn main() {
 
     let s: Something = Something {
         handle: Handle
-        //~^ ERROR cannot find value `Handle` in this scope
-        //~| NOTE did you mean `handle`?
+        //~^ ERROR expected value, found struct `Handle`
+        //~| NOTE did you mean `Handle { /* fields */ }`?
+        //~| NOTE did you mean `handle`
     };
 }
index 6263e6f6db44fc816ea21f2b0ebb97b6ab33d533..06a753cca8585b7c29766c4cbed9e0604ad17bd5 100644 (file)
@@ -12,6 +12,7 @@ trait I {}
 type K = I;
 impl K for isize {} //~ ERROR expected trait, found type alias `K`
                     //~| NOTE type aliases cannot be used for traits
+                    //~| NOTE did you mean `I`
 
 use ImportError; //~ ERROR unresolved import `ImportError` [E0432]
                  //~^ no `ImportError` in the root
index 3c093e068c507eb9cbf708f0d2ceb8ad804cebbe..c9de39759b5ff63c9b53e5b1cf31045082d082cf 100644 (file)
@@ -1,7 +1,7 @@
 error[E0432]: unresolved import `ImportError`
-  --> $DIR/issue-5035.rs:16:5
+  --> $DIR/issue-5035.rs:17:5
    |
-16 | use ImportError; //~ ERROR unresolved import `ImportError` [E0432]
+17 | use ImportError; //~ ERROR unresolved import `ImportError` [E0432]
    |     ^^^^^^^^^^^ no `ImportError` in the root
 
 error[E0404]: expected trait, found type alias `K`
index 53b6372d8eb40774ab3e22a72b9a3831e3ae74ae..af27629385dcd9e0d62f44df31c7eb57ed68f3c1 100644 (file)
 fn foo_bar() {}
 
 fn foo(c: esize) {} // Misspelled primitive type name.
+//~^ ERROR cannot find
 
 enum Bar { }
 
 type A = Baz; // Misspelled type name.
+//~^ ERROR cannot find
 type B = Opiton<u8>; // Misspelled type name from the prelude.
+//~^ ERROR cannot find
 
 mod m {
     type A = Baz; // No suggestion here, Bar is not visible
+    //~^ ERROR cannot find
 
     pub struct First;
     pub struct Second;
@@ -28,6 +32,10 @@ mod m {
 
 fn main() {
     let v = [0u32; MAXITEM]; // Misspelled constant name.
+    //~^ ERROR cannot find
     foobar(); // Misspelled function name.
+    //~^ ERROR cannot find
     let b: m::first = m::second; // Misspelled item in module.
+    //~^ ERROR cannot find
+    //~| ERROR cannot find
 }
index 4dff2620319e4607dcee7cf5fe92c79bd922a8ab..68d46ccf6857d03d4ee731d958d0b60222d5e5f9 100644 (file)
@@ -5,45 +5,45 @@ error[E0412]: cannot find type `esize` in this scope
    |           ^^^^^ did you mean `isize`?
 
 error[E0412]: cannot find type `Baz` in this scope
-  --> $DIR/levenshtein.rs:19:10
+  --> $DIR/levenshtein.rs:20:10
    |
-19 | type A = Baz; // Misspelled type name.
+20 | type A = Baz; // Misspelled type name.
    |          ^^^ did you mean `Bar`?
 
 error[E0412]: cannot find type `Opiton` in this scope
-  --> $DIR/levenshtein.rs:20:10
+  --> $DIR/levenshtein.rs:22:10
    |
-20 | type B = Opiton<u8>; // Misspelled type name from the prelude.
+22 | type B = Opiton<u8>; // Misspelled type name from the prelude.
    |          ^^^^^^ did you mean `Option`?
 
 error[E0412]: cannot find type `Baz` in this scope
-  --> $DIR/levenshtein.rs:23:14
+  --> $DIR/levenshtein.rs:26:14
    |
-23 |     type A = Baz; // No suggestion here, Bar is not visible
+26 |     type A = Baz; // No suggestion here, Bar is not visible
    |              ^^^ not found in this scope
 
 error[E0425]: cannot find value `MAXITEM` in this scope
-  --> $DIR/levenshtein.rs:30:20
+  --> $DIR/levenshtein.rs:34:20
    |
-30 |     let v = [0u32; MAXITEM]; // Misspelled constant name.
+34 |     let v = [0u32; MAXITEM]; // Misspelled constant name.
    |                    ^^^^^^^ did you mean `MAX_ITEM`?
 
 error[E0425]: cannot find function `foobar` in this scope
-  --> $DIR/levenshtein.rs:31:5
+  --> $DIR/levenshtein.rs:36:5
    |
-31 |     foobar(); // Misspelled function name.
+36 |     foobar(); // Misspelled function name.
    |     ^^^^^^ did you mean `foo_bar`?
 
 error[E0412]: cannot find type `first` in module `m`
-  --> $DIR/levenshtein.rs:32:15
+  --> $DIR/levenshtein.rs:38:15
    |
-32 |     let b: m::first = m::second; // Misspelled item in module.
+38 |     let b: m::first = m::second; // Misspelled item in module.
    |               ^^^^^ did you mean `First`?
 
 error[E0425]: cannot find value `second` in module `m`
-  --> $DIR/levenshtein.rs:32:26
+  --> $DIR/levenshtein.rs:38:26
    |
-32 |     let b: m::first = m::second; // Misspelled item in module.
+38 |     let b: m::first = m::second; // Misspelled item in module.
    |                          ^^^^^^ did you mean `Second`?
 
 error: aborting due to 8 previous errors
index 87e7b4f42a1c027917fc41e3085b6b81b92c297c..fe3774af47ddb005ce0db2657c5884857731e2fc 100644 (file)
@@ -25,7 +25,9 @@ fn f() {
         n::Z; //~ ERROR tuple struct `Z` is private
         Z;
         //~^ ERROR expected value, found struct `Z`
-        //~| NOTE tuple struct constructors with private fields are invisible outside of their mod
+        //~| NOTE constructor is not visible here due to private fields
+        //~| NOTE did you mean `S`
+        //~| NOTE did you mean `Z { /* fields */ }`
     }
 }
 
@@ -36,11 +38,13 @@ fn main() {
     S;
     //~^ ERROR expected value, found struct `S`
     //~| NOTE constructor is not visible here due to private fields
+    //~| NOTE did you mean `S { /* fields */ }`
     m::n::Z; //~ ERROR tuple struct `Z` is private
 
     xcrate::m::S; //~ ERROR tuple struct `S` is private
     xcrate::S;
     //~^ ERROR expected value, found struct `xcrate::S`
+    //~| NOTE did you mean `xcrate::S { /* fields */ }`
     //~| NOTE constructor is not visible here due to private fields
     xcrate::m::n::Z; //~ ERROR tuple struct `Z` is private
 }
index cb459ae474506ded2850f75407bc69ff06fde009..81c52a1b7c37d7dd87cb4d3a6bb9aedd60bb6665 100644 (file)
@@ -13,29 +13,29 @@ help: possible better candidate is found in another module, you can import it in
    |
 
 error[E0423]: expected value, found struct `S`
-  --> $DIR/privacy-struct-ctor.rs:36:5
+  --> $DIR/privacy-struct-ctor.rs:38:5
    |
-36 |     S;
+38 |     S;
    |     ^
    |     |
    |     constructor is not visible here due to private fields
    |     did you mean `S { /* fields */ }`?
 help: possible better candidate is found in another module, you can import it into scope
    |
-32 | use m::S;
+34 | use m::S;
    |
 
 error[E0423]: expected value, found struct `xcrate::S`
-  --> $DIR/privacy-struct-ctor.rs:42:5
+  --> $DIR/privacy-struct-ctor.rs:45:5
    |
-42 |     xcrate::S;
+45 |     xcrate::S;
    |     ^^^^^^^^^
    |     |
    |     constructor is not visible here due to private fields
    |     did you mean `xcrate::S { /* fields */ }`?
 help: possible better candidate is found in another module, you can import it into scope
    |
-32 | use m::S;
+34 | use m::S;
    |
 
 error[E0603]: tuple struct `Z` is private
@@ -45,27 +45,27 @@ error[E0603]: tuple struct `Z` is private
    |         ^^^^
 
 error[E0603]: tuple struct `S` is private
-  --> $DIR/privacy-struct-ctor.rs:35:5
+  --> $DIR/privacy-struct-ctor.rs:37:5
    |
-35 |     m::S; //~ ERROR tuple struct `S` is private
+37 |     m::S; //~ ERROR tuple struct `S` is private
    |     ^^^^
 
 error[E0603]: tuple struct `Z` is private
-  --> $DIR/privacy-struct-ctor.rs:39:5
+  --> $DIR/privacy-struct-ctor.rs:42:5
    |
-39 |     m::n::Z; //~ ERROR tuple struct `Z` is private
+42 |     m::n::Z; //~ ERROR tuple struct `Z` is private
    |     ^^^^^^^
 
 error[E0603]: tuple struct `S` is private
-  --> $DIR/privacy-struct-ctor.rs:41:5
+  --> $DIR/privacy-struct-ctor.rs:44:5
    |
-41 |     xcrate::m::S; //~ ERROR tuple struct `S` is private
+44 |     xcrate::m::S; //~ ERROR tuple struct `S` is private
    |     ^^^^^^^^^^^^
 
 error[E0603]: tuple struct `Z` is private
-  --> $DIR/privacy-struct-ctor.rs:45:5
+  --> $DIR/privacy-struct-ctor.rs:49:5
    |
-45 |     xcrate::m::n::Z; //~ ERROR tuple struct `Z` is private
+49 |     xcrate::m::n::Z; //~ ERROR tuple struct `Z` is private
    |     ^^^^^^^^^^^^^^^
 
 error: aborting due to 8 previous errors
index 53e26ddafec37d8acf9e9310136be4054867a26c..62d2dc7a8faeb00910fe4050973cfbeed8a04e4a 100644 (file)
@@ -24,34 +24,31 @@ impl Tr for S {
 
     fn method(&self) {
         let _: field;
-        //~^ ERROR unresolved type `field`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find type `field`
+        //~| NOTE not found in this scope
         let field(..);
-        //~^ ERROR unresolved tuple struct/variant `field`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find tuple struct/variant `field`
+        //~| NOTE not found in this scope
         field;
-        //~^ ERROR unresolved value `field`
-        //~| NOTE did you mean `self.field`?
+        //~^ ERROR cannot find value `field`
 
         let _: Type;
-        //~^ ERROR unresolved type `Type`
-        //~| NOTE did you mean `Self::Type`?
+        //~^ ERROR cannot find type `Type`
         let Type(..);
-        //~^ ERROR unresolved tuple struct/variant `Type`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find tuple struct/variant `Type`
+        //~| NOTE not found in this scope
         Type;
-        //~^ ERROR unresolved value `Type`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find value `Type`
+        //~| NOTE not found in this scope
 
         let _: method;
-        //~^ ERROR unresolved type `method`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find type `method`
+        //~| NOTE not found in this scope
         let method(..);
-        //~^ ERROR unresolved tuple struct/variant `method`
-        //~| NOTE no resolution found
+        //~^ ERROR cannot find tuple struct/variant `method`
+        //~| NOTE not found in this scope
         method;
-        //~^ ERROR unresolved value `method`
-        //~| NOTE did you mean `self.method(...)`?
+        //~^ ERROR cannot find value `method`
     }
 }
 
index 77aa545e2ad6b4f1611c25725d2be61451dab2ee..4bb3947a0281145507c0dec61d5992951679ccab 100644 (file)
@@ -17,39 +17,39 @@ error[E0425]: cannot find value `field` in this scope
    |         ^^^^^ help: try: `self.field`
 
 error[E0412]: cannot find type `Type` in this scope
-  --> $DIR/resolve-assoc-suggestions.rs:36:16
+  --> $DIR/resolve-assoc-suggestions.rs:35:16
    |
-36 |         let _: Type;
+35 |         let _: Type;
    |                ^^^^ help: try: `Self::Type`
 
 error[E0531]: cannot find tuple struct/variant `Type` in this scope
-  --> $DIR/resolve-assoc-suggestions.rs:39:13
+  --> $DIR/resolve-assoc-suggestions.rs:37:13
    |
-39 |         let Type(..);
+37 |         let Type(..);
    |             ^^^^ not found in this scope
 
 error[E0425]: cannot find value `Type` in this scope
-  --> $DIR/resolve-assoc-suggestions.rs:42:9
+  --> $DIR/resolve-assoc-suggestions.rs:40:9
    |
-42 |         Type;
+40 |         Type;
    |         ^^^^ not found in this scope
 
 error[E0412]: cannot find type `method` in this scope
-  --> $DIR/resolve-assoc-suggestions.rs:46:16
+  --> $DIR/resolve-assoc-suggestions.rs:44:16
    |
-46 |         let _: method;
+44 |         let _: method;
    |                ^^^^^^ not found in this scope
 
 error[E0531]: cannot find tuple struct/variant `method` in this scope
-  --> $DIR/resolve-assoc-suggestions.rs:49:13
+  --> $DIR/resolve-assoc-suggestions.rs:47:13
    |
-49 |         let method(..);
+47 |         let method(..);
    |             ^^^^^^ not found in this scope
 
 error[E0425]: cannot find value `method` in this scope
-  --> $DIR/resolve-assoc-suggestions.rs:52:9
+  --> $DIR/resolve-assoc-suggestions.rs:50:9
    |
-52 |         method;
+50 |         method;
    |         ^^^^^^ help: try: `self.method`
 
 error: aborting due to 9 previous errors
index 95289e23f9e81a4b19b6b425c106a6248ff6d758..120237b662df8daf273aed1d3be4d0cd71aca5ec 100644 (file)
@@ -25,19 +25,17 @@ fn g() {
             // Speculative resolution of `Self` and `self` silently fails,
             // "did you mean" messages are not printed.
             field;
-            //~^ ERROR unresolved value `field`
-            //~| NOTE no resolution found
+            //~^ ERROR cannot find value `field`
+            //~| NOTE not found in this scope
             method();
-            //~^ ERROR unresolved function `method`
-            //~| NOTE no resolution found
+            //~^ ERROR cannot find function `method`
+            //~| NOTE not found in this scope
         }
 
         field;
-        //~^ ERROR unresolved value `field`
-        //~| NOTE did you mean `self.field`?
+        //~^ ERROR cannot find value `field`
         method();
-        //~^ ERROR unresolved function `method`
-        //~| NOTE did you mean `self.method(...)`?
+        //~^ ERROR cannot find function `method`
     }
 }
 
index 3e1b075679a50feedb8415b0bb4dd62a7f3356c0..2d74e427ea04e651f174354a6561a7c81d3d8ca7 100644 (file)
@@ -17,9 +17,9 @@ error[E0425]: cannot find value `field` in this scope
    |         ^^^^^ help: try: `self.field`
 
 error[E0425]: cannot find function `method` in this scope
-  --> $DIR/resolve-speculative-adjustment.rs:38:9
+  --> $DIR/resolve-speculative-adjustment.rs:37:9
    |
-38 |         method();
+37 |         method();
    |         ^^^^^^ help: try: `self.method`
 
 error: aborting due to 4 previous errors
index 789bdfb414db49b61a1c3dc51cdadbea17f31cbf..70d072a388b904f21d399d54b31104a5cc943ac2 100644 (file)
@@ -45,6 +45,7 @@ fn h4() -> i32 {
     a::b.J
     //~^ ERROR expected value, found module `a::b`
     //~| NOTE did you mean `a::b::J`?
+    //~| NOTE did you mean `I`
 }
 
 fn h5() {
@@ -54,23 +55,24 @@ fn h5() {
     let v = Vec::new();
     v.push(a::b);
     //~^ ERROR expected value, found module `a::b`
-    //~| NOTE not a value
+    //~| NOTE did you mean `I`
 }
 
 fn h6() -> i32 {
     a::b.f()
     //~^ ERROR expected value, found module `a::b`
     //~| NOTE did you mean `a::b::f(...)`?
+    //~| NOTE did you mean `I`
 }
 
 fn h7() {
     a::b
     //~^ ERROR expected value, found module `a::b`
-    //~| NOTE not a value
+    //~| NOTE did you mean `I`
 }
 
 fn h8() -> i32 {
     a::b()
     //~^ ERROR expected function, found module `a::b`
-    //~| NOTE not a function
+    //~| NOTE did you mean `I`
 }
index d1794d19f6a53a1537ca133d328a3c1bb2c644e3..fd5de16bdd1da9cd6a6d62134f823505802d6668 100644 (file)
@@ -32,42 +32,42 @@ error[E0423]: expected value, found module `a::b`
    |     did you mean `a::b::J`?
 
 error[E0423]: expected value, found module `a`
-  --> $DIR/suggest-path-instead-of-mod-dot-item.rs:51:5
+  --> $DIR/suggest-path-instead-of-mod-dot-item.rs:52:5
    |
-51 |     a.b.f();
+52 |     a.b.f();
    |     ^--
    |     |
    |     did you mean `a::b`?
 
 error[E0423]: expected value, found module `a::b`
-  --> $DIR/suggest-path-instead-of-mod-dot-item.rs:55:12
+  --> $DIR/suggest-path-instead-of-mod-dot-item.rs:56:12
    |
-55 |     v.push(a::b);
+56 |     v.push(a::b);
    |            ^^^-
    |               |
    |               did you mean `I`?
 
 error[E0423]: expected value, found module `a::b`
-  --> $DIR/suggest-path-instead-of-mod-dot-item.rs:61:5
+  --> $DIR/suggest-path-instead-of-mod-dot-item.rs:62:5
    |
-61 |     a::b.f()
+62 |     a::b.f()
    |     ^^^-----
    |     |  |
    |     |  did you mean `I`?
    |     did you mean `a::b::f(...)`?
 
 error[E0423]: expected value, found module `a::b`
-  --> $DIR/suggest-path-instead-of-mod-dot-item.rs:67:5
+  --> $DIR/suggest-path-instead-of-mod-dot-item.rs:69:5
    |
-67 |     a::b
+69 |     a::b
    |     ^^^-
    |        |
    |        did you mean `I`?
 
 error[E0423]: expected function, found module `a::b`
-  --> $DIR/suggest-path-instead-of-mod-dot-item.rs:73:5
+  --> $DIR/suggest-path-instead-of-mod-dot-item.rs:75:5
    |
-73 |     a::b()
+75 |     a::b()
    |     ^^^-
    |        |
    |        did you mean `I`?
index 6fa1260d18041820687c2234762f58dd7b18e897..121a565b2b1eb53ffa18dbdd841f90ff3aa359ff 100644 (file)
@@ -13,7 +13,7 @@
 fn main() {
     if foo {
     //~^ NOTE: unclosed delimiter
-    //~| ERROR: unresolved value `foo`
-    //~| NOTE: no resolution found
+    //~| ERROR: cannot find value `foo`
+    //~| NOTE: not found in this scope
     ) //~ ERROR: incorrect close delimiter: `)`
 }
index f72b7adf593a962c171f61809798f1709f5b9abd..746eee9ecd74e80b99d17d358b3c6ca619c8b58f 100644 (file)
@@ -18,16 +18,19 @@ pub mod raw {
     pub fn ensure_dir_exists<P: AsRef<Path>, F: FnOnce(&Path)>(path: P,
                                                                callback: F)
                                                                -> io::Result<bool> {
-        if !is_directory(path.as_ref()) { //~ ERROR: unresolved function `is_directory`
-                                          //~^ NOTE: no resolution found
+        if !is_directory(path.as_ref()) { //~ ERROR: cannot find function `is_directory`
+                                          //~^ NOTE: not found in this scope
             callback(path.as_ref();  //~ NOTE: unclosed delimiter
-                     //~^ ERROR: expected one of
+                     //~^ NOTE: expected one of
+                     //~| ERROR expected one of
             fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types
             //~^ expected (), found enum `std::result::Result`
             //~| expected type `()`
             //~| found type `std::result::Result<bool, std::io::Error>`
+            //~| expected one of
         } else { //~ ERROR: incorrect close delimiter: `}`
             //~^ ERROR: expected one of
+            //~| unexpected token
             Ok(false);
         }
 
index c8e19db3707e1071ec3a0283859e8e97267b2616..b500a349f6cf6dd3063aa758a5248d1194b74f19 100644 (file)
@@ -1,7 +1,7 @@
 error: incorrect close delimiter: `}`
-  --> $DIR/token-error-correct-3.rs:29:9
+  --> $DIR/token-error-correct-3.rs:31:9
    |
-29 |         } else { //~ ERROR: incorrect close delimiter: `}`
+31 |         } else { //~ ERROR: incorrect close delimiter: `}`
    |         ^
    |
 note: unclosed delimiter
@@ -17,24 +17,24 @@ error: expected one of `,`, `.`, `?`, or an operator, found `;`
    |                                   ^ expected one of `,`, `.`, `?`, or an operator here
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `)`
-  --> $DIR/token-error-correct-3.rs:29:9
+  --> $DIR/token-error-correct-3.rs:31:9
    |
-25 |             fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types
+26 |             fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types
    |                                                             - expected one of `.`, `;`, `?`, `}`, or an operator here
 ...
-29 |         } else { //~ ERROR: incorrect close delimiter: `}`
+31 |         } else { //~ ERROR: incorrect close delimiter: `}`
    |         ^ unexpected token
 
 error[E0425]: cannot find function `is_directory` in this scope
   --> $DIR/token-error-correct-3.rs:21:13
    |
-21 |         if !is_directory(path.as_ref()) { //~ ERROR: unresolved function `is_directory`
+21 |         if !is_directory(path.as_ref()) { //~ ERROR: cannot find function `is_directory`
    |             ^^^^^^^^^^^^ not found in this scope
 
 error[E0308]: mismatched types
-  --> $DIR/token-error-correct-3.rs:25:13
+  --> $DIR/token-error-correct-3.rs:26:13
    |
-25 |             fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types
+26 |             fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try adding a semicolon: `;`
    |             |
    |             expected (), found enum `std::result::Result`
index 5fd35e51336f3fd57b38b163ab00df2f37e6433e..0c7fe0df1c7062be40e2ae6d2964a353b3c600aa 100644 (file)
@@ -15,11 +15,6 @@ fn main() {
     //~^ NOTE: unclosed delimiter
     //~| NOTE: unclosed delimiter
     //~| ERROR: expected expression, found `;`
-    //~| ERROR: unresolved function `foo`
-    //~| NOTE: no resolution found
-    //~| ERROR: unresolved function `bar`
-    //~| NOTE: no resolution found
-    //~| ERROR: expected one of `)`, `,`, `.`, `<`, `?`
 }
 //~^ ERROR: incorrect close delimiter: `}`
 //~| ERROR: incorrect close delimiter: `}`
index 6bd63f4fbbb899b43a55139376f281a079d6529b..cad58b30df206fa7f4647c9c94d16ce207f175f3 100644 (file)
@@ -1,7 +1,7 @@
 error: incorrect close delimiter: `}`
-  --> $DIR/token-error-correct.rs:23:1
+  --> $DIR/token-error-correct.rs:18:1
    |
-23 | }
+18 | }
    | ^
    |
 note: unclosed delimiter
@@ -11,9 +11,9 @@ note: unclosed delimiter
    |            ^
 
 error: incorrect close delimiter: `}`
-  --> $DIR/token-error-correct.rs:23:1
+  --> $DIR/token-error-correct.rs:18:1
    |
-23 | }
+18 | }
    | ^
    |
 note: unclosed delimiter
@@ -29,9 +29,9 @@ error: expected expression, found `;`
    |             ^
 
 error: expected expression, found `)`
-  --> $DIR/token-error-correct.rs:23:1
+  --> $DIR/token-error-correct.rs:18:1
    |
-23 | }
+18 | }
    | ^
 
 error: aborting due to 4 previous errors
index c9c05202fea2bda526eabea96c1a5765c9a109b6..0dbca07b771d747837a20eb94bcd67a51ce09a58 100644 (file)
 
 impl S {
     fn f() {
-        let s = Self(0, 1);
+        let s = Self(0, 1); //~ ERROR expected function
         match s {
-            Self(..) => {}
+            Self(..) => {} //~ ERROR expected tuple struct/variant
         }
     }
 }
 
 fn main() {
-    let s = A(0, 1);
+    let s = A(0, 1); //~ ERROR expected function
     match s {
-        A(..) => {}
+        A(..) => {} //~ ERROR expected tuple struct/variant
     }
 }
index e2ef8f0e568fcf4f47ca1ed331d22eb9fa5b6dbe..aea9fc356bf2e5bcaf9a39348cb98f837d8de211 100644 (file)
@@ -1,19 +1,19 @@
 error[E0423]: expected function, found self type `Self`
   --> $DIR/tuple-struct-alias.rs:16:17
    |
-16 |         let s = Self(0, 1);
+16 |         let s = Self(0, 1); //~ ERROR expected function
    |                 ^^^^ did you mean `Self { /* fields */ }`?
 
 error[E0532]: expected tuple struct/variant, found self type `Self`
   --> $DIR/tuple-struct-alias.rs:18:13
    |
-18 |             Self(..) => {}
+18 |             Self(..) => {} //~ ERROR expected tuple struct/variant
    |             ^^^^ did you mean `Self { /* fields */ }`?
 
 error[E0423]: expected function, found type alias `A`
   --> $DIR/tuple-struct-alias.rs:24:13
    |
-24 |     let s = A(0, 1);
+24 |     let s = A(0, 1); //~ ERROR expected function
    |             ^
    |             |
    |             did you mean `S`?
@@ -22,7 +22,7 @@ error[E0423]: expected function, found type alias `A`
 error[E0532]: expected tuple struct/variant, found type alias `A`
   --> $DIR/tuple-struct-alias.rs:26:9
    |
-26 |         A(..) => {}
+26 |         A(..) => {} //~ ERROR expected tuple struct/variant
    |         ^
    |         |
    |         did you mean `S`?
index 57f6ddd2d3c6cfd094bbff3b6c828a7c807ffde5..ee4c40f2c8d4d95db3b73ff14b4b2c1117aaf311 100644 (file)
@@ -9,8 +9,8 @@
 // except according to those terms.
 
 fn f<F:Nonexist(isize) -> isize>(x: F) {}
-//~^ ERROR unresolved trait `Nonexist`
-//~| NOTE no resolution found
+//~^ ERROR cannot find trait `Nonexist`
+//~| NOTE not found in this scope
 
 type Typedef = isize;
 
index 19beabd88232edac294e3f06ffb5e7600d475caa..711e46b1248b7ca1ea127488b278c5d9c9363bd5 100644 (file)
@@ -17,9 +17,7 @@ struct Foo {
 impl Foo {
     fn bar() {
         f(cx);
-        //~^ ERROR unresolved value `cx`
-        //~| ERROR unresolved value `cx`
-        //~| NOTE did you mean `self.cx`?
+        //~^ ERROR cannot find value `cx` in this scope
         //~| NOTE `self` value is only available in methods with `self` parameter
     }
 }
index a43b8fc99df5f5e130edb5feeae8783d185c7afb..87f38df0442cf18e7d9482084fdc860cb14d13b9 100644 (file)
@@ -22,15 +22,15 @@ mod foo {
 
     // test whether the use suggestion isn't
     // placed into the expansion of `#[derive(Debug)]
-    type Bar = Path;
+    type Bar = Path; //~ ERROR cannot find
 }
 
 fn main() {
     y!();
-    let _ = A;
+    let _ = A; //~ ERROR cannot find
     foo();
 }
 
 fn foo() {
-    type Dict<K, V> = HashMap<K, V>;
+    type Dict<K, V> = HashMap<K, V>; //~ ERROR cannot find
 }
index 401825367dd9b9a901f208e73413e07edbb92c10..1cc2d06ab68433256d0f9bc8805a27331e36f405 100644 (file)
@@ -1,7 +1,7 @@
 error[E0412]: cannot find type `Path` in this scope
   --> $DIR/use_suggestion_placement.rs:25:16
    |
-25 |     type Bar = Path;
+25 |     type Bar = Path; //~ ERROR cannot find
    |                ^^^^ not found in this scope
 help: possible candidate is found in another module, you can import it into scope
    |
@@ -11,7 +11,7 @@ help: possible candidate is found in another module, you can import it into scop
 error[E0425]: cannot find value `A` in this scope
   --> $DIR/use_suggestion_placement.rs:30:13
    |
-30 |     let _ = A;
+30 |     let _ = A; //~ ERROR cannot find
    |             ^ not found in this scope
 help: possible candidate is found in another module, you can import it into scope
    |
@@ -21,7 +21,7 @@ help: possible candidate is found in another module, you can import it into scop
 error[E0412]: cannot find type `HashMap` in this scope
   --> $DIR/use_suggestion_placement.rs:35:23
    |
-35 |     type Dict<K, V> = HashMap<K, V>;
+35 |     type Dict<K, V> = HashMap<K, V>; //~ ERROR cannot find
    |                       ^^^^^^^ not found in this scope
 help: possible candidates are found in other modules, you can import them into scope
    |
index 31923343b6aa7f116ed25ea71afb839db6d07578..fca99f064a2738a1ce4231286640d3c3eb59d4ff 100644 (file)
@@ -23,7 +23,7 @@ fn main() {
     let f = Foo{bar:6};
 
     match &f {
-        FOO => {},
+        FOO => {}, //~ ERROR mismatched types
         _ => panic!(),
     }
 }
index 0dfd79f356545c2cc57849ad811bf1cd29394c61..afcbf76c1a44fdc94f128178ea602c6d6e539964 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/const.rs:26:9
    |
-26 |         FOO => {},
+26 |         FOO => {}, //~ ERROR mismatched types
    |         ^^^ expected &Foo, found struct `Foo`
    |
    = note: expected type `&Foo`
index 58902bf06b314a1c449c417324947a64354b3059..76ea64e248ef89e4fcf031ebf1e0781a32b5c5e7 100644 (file)
@@ -18,17 +18,17 @@ enum Wrapper {
 
 pub fn main() {
     let Wrap(x) = &Wrap(3);
-    *x += 1;
+    *x += 1; //~ ERROR cannot assign to immutable
 
 
     if let Some(x) = &Some(3) {
-        *x += 1;
+        *x += 1; //~ ERROR cannot assign to immutable
     } else {
         panic!();
     }
 
     while let Some(x) = &Some(3) {
-        *x += 1;
+        *x += 1; //~ ERROR cannot assign to immutable
         break;
     }
 }
index ad08ae83a49ef92612b9fdbce93c6b9d43b076a4..052ab5892d2542d7e20792f394551975592718e2 100644 (file)
@@ -3,7 +3,7 @@ error[E0594]: cannot assign to immutable borrowed content `*x`
    |
 20 |     let Wrap(x) = &Wrap(3);
    |              - consider changing this to `x`
-21 |     *x += 1;
+21 |     *x += 1; //~ ERROR cannot assign to immutable
    |     ^^^^^^^ cannot borrow as mutable
 
 error[E0594]: cannot assign to immutable borrowed content `*x`
@@ -11,7 +11,7 @@ error[E0594]: cannot assign to immutable borrowed content `*x`
    |
 24 |     if let Some(x) = &Some(3) {
    |                 - consider changing this to `x`
-25 |         *x += 1;
+25 |         *x += 1; //~ ERROR cannot assign to immutable
    |         ^^^^^^^ cannot borrow as mutable
 
 error[E0594]: cannot assign to immutable borrowed content `*x`
@@ -19,7 +19,7 @@ error[E0594]: cannot assign to immutable borrowed content `*x`
    |
 30 |     while let Some(x) = &Some(3) {
    |                    - consider changing this to `x`
-31 |         *x += 1;
+31 |         *x += 1; //~ ERROR cannot assign to immutable
    |         ^^^^^^^ cannot borrow as mutable
 
 error: aborting due to 3 previous errors
index b5287b7cccc76dc1a2dc33150d661b94b11e0234..2e43d9722a9008e6305bb1cbb87d4ac4a7ce62a6 100644 (file)
@@ -16,7 +16,7 @@
 fn main() {
     match &&Some(5i32) {
         Some(n) => {
-            *n += 1;
+            *n += 1; //~ ERROR cannot assign to immutable
             let _ = n;
         }
         None => {},
@@ -24,7 +24,7 @@ fn main() {
 
     match &mut &Some(5i32) {
         Some(n) => {
-            *n += 1;
+            *n += 1; //~ ERROR cannot assign to immutable
             let _ = n;
         }
         None => {},
@@ -32,7 +32,7 @@ fn main() {
 
     match &&mut Some(5i32) {
         Some(n) => {
-            *n += 1;
+            *n += 1; //~ ERROR cannot assign to immutable
             let _ = n;
         }
         None => {},
index 1dbd769373b9da591a596b6bce9231522d7cbc53..c1c59fe678525f8ca35d434110057286a3a1ecfe 100644 (file)
@@ -3,7 +3,7 @@ error[E0594]: cannot assign to immutable borrowed content `*n`
    |
 18 |         Some(n) => {
    |              - consider changing this to `n`
-19 |             *n += 1;
+19 |             *n += 1; //~ ERROR cannot assign to immutable
    |             ^^^^^^^ cannot borrow as mutable
 
 error[E0594]: cannot assign to immutable borrowed content `*n`
@@ -11,7 +11,7 @@ error[E0594]: cannot assign to immutable borrowed content `*n`
    |
 26 |         Some(n) => {
    |              - consider changing this to `n`
-27 |             *n += 1;
+27 |             *n += 1; //~ ERROR cannot assign to immutable
    |             ^^^^^^^ cannot borrow as mutable
 
 error[E0594]: cannot assign to immutable borrowed content `*n`
@@ -19,7 +19,7 @@ error[E0594]: cannot assign to immutable borrowed content `*n`
    |
 34 |         Some(n) => {
    |              - consider changing this to `n`
-35 |             *n += 1;
+35 |             *n += 1; //~ ERROR cannot assign to immutable
    |             ^^^^^^^ cannot borrow as mutable
 
 error: aborting due to 3 previous errors
index 35f8fbb9b71f7bc3b5a02baa831b3627c021abf3..e9004c13a0e273768a114b6406f22696d4bd74e0 100644 (file)
@@ -16,5 +16,6 @@ pub fn main() {
     let mut tups = vec![(Foo{}, Foo{})];
     // The below desugars to &(ref n, mut m).
     for (n, mut m) in &tups {
+        //~^ ERROR cannot bind by-move and by-ref in the same pattern
     }
 }
index 294d6b88596bf7980ddd7d31b2019e2d5c6fe9c8..9fbcf5d68b6ff62754d25c120119e2ac5521d7c0 100644 (file)
@@ -16,6 +16,7 @@ pub fn main() {
     let x = &Some((3, 3));
     let _: &i32 = match x {
         Some((x, 3)) | &Some((ref x, 5)) => x,
+        //~^ ERROR is bound in inconsistent ways
         _ => &5i32,
     };
 }
index 54cee39209ba3b96fdcea4acf2a53f8c10a8a378..783287fd458bc29cb397cf2f80ca97d52e7e2628 100644 (file)
@@ -16,7 +16,7 @@ fn with_str() {
     let s: &'static str = "abc";
 
     match &s {
-            "abc" => true,
+            "abc" => true, //~ ERROR mismatched types
             _ => panic!(),
     };
 }
@@ -25,7 +25,7 @@ fn with_bytes() {
     let s: &'static [u8] = b"abc";
 
     match &s {
-        b"abc" => true,
+        b"abc" => true, //~ ERROR mismatched types
         _ => panic!(),
     };
 }
index 811d3b8074f53b85a154950c97e9be252815e83a..f5ed7ee7181ddb6fcc7cf7f6c7421bb43f69947f 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/lit.rs:19:13
    |
-19 |             "abc" => true,
+19 |             "abc" => true, //~ ERROR mismatched types
    |             ^^^^^ expected &str, found str
    |
    = note: expected type `&&str`
@@ -10,7 +10,7 @@ error[E0308]: mismatched types
 error[E0308]: mismatched types
   --> $DIR/lit.rs:28:9
    |
-28 |         b"abc" => true,
+28 |         b"abc" => true, //~ ERROR mismatched types
    |         ^^^^^^ expected &[u8], found array of 3 elements
    |
    = note: expected type `&&[u8]`
index a0134c499bb0164871fa30acfcb0f62ffe0a44c0..0b2318d7621d666945cba1722170e1b7684591be 100644 (file)
@@ -15,7 +15,7 @@
 fn main() {
     let foo = 22;
     match foo {
-        u32::XXX => { }
+        u32::XXX => { } //~ ERROR no associated item named
         _ => { }
     }
 }
index 4a83b606dccd9758183af4d23f543fe49f859217..830422875886bbd4e6010ed9933be18b1ba13952 100644 (file)
@@ -1,7 +1,7 @@
 error[E0599]: no associated item named `XXX` found for type `u32` in the current scope
   --> $DIR/no-double-error.rs:18:9
    |
-18 |         u32::XXX => { }
+18 |         u32::XXX => { } //~ ERROR no associated item named
    |         ^^^^^^^^ associated item not found in `u32`
 
 error: aborting due to previous error
index fb87ed72abc3f7ed9250a0874a24c49e42822397..40aa957242cb81c0be2c31a94446c7a9e1a9f375 100644 (file)
@@ -14,7 +14,7 @@
 pub fn main() {
     let sl: &[u8] = b"foo";
 
-    match sl {
+    match sl { //~ ERROR non-exhaustive patterns
         [first, remainder..] => {},
     };
 }
index 90a2f75c07fb090eddc9da60cc7a885898173581..ec2225c9f92367aee9a0e47ff56414766f3e62d5 100644 (file)
@@ -1,7 +1,7 @@
 error[E0004]: non-exhaustive patterns: `&[]` not covered
   --> $DIR/slice.rs:17:11
    |
-17 |     match sl {
+17 |     match sl { //~ ERROR non-exhaustive patterns
    |           ^^ pattern `&[]` not covered
 
 error: aborting due to previous error
index 52ff817dff48833443af296f13793cdbda052a50..b9b974ff3c521aa6b36d48a33d96f98a1ea30585 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn main() {
-    if let Some(y) = &Some(22) {
+    if let Some(y) = &Some(22) { //~ ERROR non-reference pattern
       println!("{}", y);
     }
 }
index 0594f865f327e72e6fa677729d0418a7d52f7285..b10980d6bd6058b2af088930fca2a14a7178c91d 100644 (file)
@@ -1,7 +1,7 @@
 error: non-reference pattern used to match a reference (see issue #42640)
   --> $DIR/suggestion.rs:12:12
    |
-12 |     if let Some(y) = &Some(22) {
+12 |     if let Some(y) = &Some(22) { //~ ERROR non-reference pattern
    |            ^^^^^^^ help: consider using: `&Some(y)`
    |
    = help: add #![feature(match_default_bindings)] to the crate attributes to enable
index 3741ba4f3ae7a3a97dd02600f4935093d4ae3f31..b24b2d0fb24610245cf45fc32a200b3dcc639bf1 100644 (file)
@@ -56,21 +56,22 @@ fn need_to_use_this_value() -> bool {
 }
 
 fn main() {
-    need_to_use_this_value();
+    need_to_use_this_value(); //~ WARN unused return value
 
     let mut m = MyStruct { n: 2 };
     let n = MyStruct { n: 3 };
 
-    m.need_to_use_this_method_value();
+    m.need_to_use_this_method_value(); //~ WARN unused return value
     m.is_even(); // trait method!
+    //~^ WARN unused return value
 
     m.replace(3); // won't warn (annotation needs to be in trait definition)
 
     // comparison methods are `must_use`
-    2.eq(&3);
-    m.eq(&n);
+    2.eq(&3); //~ WARN unused return value
+    m.eq(&n); //~ WARN unused return value
 
     // lint includes comparison operators
-    2 == 3;
-    m == n;
+    2 == 3; //~ WARN unused comparison
+    m == n; //~ WARN unused comparison
 }
index fdd0a591bc78da13b4c6c6a94014e4756911ec2d..4778f2e6d1b23a5a58a17f2555a5e1322b1e5917 100644 (file)
@@ -1,7 +1,7 @@
 warning: unused return value of `need_to_use_this_value` which must be used: it's important
   --> $DIR/fn_must_use.rs:59:5
    |
-59 |     need_to_use_this_value();
+59 |     need_to_use_this_value(); //~ WARN unused return value
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: lint level defined here
@@ -13,7 +13,7 @@ note: lint level defined here
 warning: unused return value of `MyStruct::need_to_use_this_method_value` which must be used
   --> $DIR/fn_must_use.rs:64:5
    |
-64 |     m.need_to_use_this_method_value();
+64 |     m.need_to_use_this_method_value(); //~ WARN unused return value
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: unused return value of `EvenNature::is_even` which must be used: no side effects
@@ -23,26 +23,26 @@ warning: unused return value of `EvenNature::is_even` which must be used: no sid
    |     ^^^^^^^^^^^^
 
 warning: unused return value of `std::cmp::PartialEq::eq` which must be used
-  --> $DIR/fn_must_use.rs:70:5
+  --> $DIR/fn_must_use.rs:71:5
    |
-70 |     2.eq(&3);
+71 |     2.eq(&3); //~ WARN unused return value
    |     ^^^^^^^^^
 
 warning: unused return value of `std::cmp::PartialEq::eq` which must be used
-  --> $DIR/fn_must_use.rs:71:5
+  --> $DIR/fn_must_use.rs:72:5
    |
-71 |     m.eq(&n);
+72 |     m.eq(&n); //~ WARN unused return value
    |     ^^^^^^^^^
 
 warning: unused comparison which must be used
-  --> $DIR/fn_must_use.rs:74:5
+  --> $DIR/fn_must_use.rs:75:5
    |
-74 |     2 == 3;
+75 |     2 == 3; //~ WARN unused comparison
    |     ^^^^^^
 
 warning: unused comparison which must be used
-  --> $DIR/fn_must_use.rs:75:5
+  --> $DIR/fn_must_use.rs:76:5
    |
-75 |     m == n;
+76 |     m == n; //~ WARN unused comparison
    |     ^^^^^^
 
index 986382bc8ee8592a0e05eadbdef73fc17fd4b171..b16d584ed42461ffbf1609972a7284fc68296fb6 100644 (file)
@@ -14,6 +14,6 @@ mod x {
 }
 
 // `.` is similar to `,` so list parsing should continue to closing `}`
-use x::{A. B};
+use x::{A. B}; //~ ERROR expected one of `,` or `as`, found `.`
 
 fn main() {}
index cf0ed646db7084cbfcb59ccd5500768846a775de..1b9eb1d8ef547607c052c0d7ba8a3248a5c6c97a 100644 (file)
@@ -1,7 +1,7 @@
 error: expected one of `,` or `as`, found `.`
   --> $DIR/similar-tokens.rs:17:10
    |
-17 | use x::{A. B};
+17 | use x::{A. B}; //~ ERROR expected one of `,` or `as`, found `.`
    |          ^ expected one of `,` or `as` here
 
 error: aborting due to previous error
index 18ade4f1ab68ef424fdae04d554d0c1c3318192e..554dfc619d7b798919e51bd5a2cd2f8361b59ba2 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-struct ListNode {
+struct ListNode { //~ ERROR has infinite size
     head: u8,
     tail: Option<ListNode>,
 }
index 1f6dd6b1d165f52c9eb3f5e257ccce7dcafd4718..82b8579d5a12cdcb8099748c74ca8e7c7c6f6383 100644 (file)
@@ -1,7 +1,7 @@
 error[E0072]: recursive type `ListNode` has infinite size
   --> $DIR/E0072.rs:11:1
    |
-11 | struct ListNode {
+11 | struct ListNode { //~ ERROR has infinite size
    | ^^^^^^^^^^^^^^^ recursive type has infinite size
 12 |     head: u8,
 13 |     tail: Option<ListNode>,
index 9fb37607c7da7a1ac5cbbb5ea796e73a9ff7572c..0ad6b67330d1ac6afbe0a9405d9ddfba2cd3e31b 100644 (file)
@@ -12,9 +12,9 @@ struct Foo {
     foo: Vec<u32>,
 }
 
-impl Copy for Foo { }
+impl Copy for Foo { } //~ ERROR may not be implemented for this type
 
-#[derive(Copy)]
+#[derive(Copy)] //~ ERROR may not be implemented for this type
 struct Foo2<'a> {
     ty: &'a mut bool,
 }
@@ -24,9 +24,9 @@ enum EFoo {
     Baz,
 }
 
-impl Copy for EFoo { }
+impl Copy for EFoo { } //~ ERROR may not be implemented for this type
 
-#[derive(Copy)]
+#[derive(Copy)] //~ ERROR may not be implemented for this type
 enum EFoo2<'a> {
     Bar(&'a mut bool),
     Baz,
index 4fe6afaca8ec658a4eae9fdba79b35dc37cacb29..0d9617c4c73242ef85374c4a32605c279487a54d 100644 (file)
@@ -4,13 +4,13 @@ error[E0204]: the trait `Copy` may not be implemented for this type
 12 |     foo: Vec<u32>,
    |     ------------- this field does not implement `Copy`
 ...
-15 | impl Copy for Foo { }
+15 | impl Copy for Foo { } //~ ERROR may not be implemented for this type
    |      ^^^^
 
 error[E0204]: the trait `Copy` may not be implemented for this type
   --> $DIR/E0204.rs:17:10
    |
-17 | #[derive(Copy)]
+17 | #[derive(Copy)] //~ ERROR may not be implemented for this type
    |          ^^^^
 18 | struct Foo2<'a> {
 19 |     ty: &'a mut bool,
@@ -22,13 +22,13 @@ error[E0204]: the trait `Copy` may not be implemented for this type
 23 |     Bar { x: Vec<u32> },
    |           ----------- this field does not implement `Copy`
 ...
-27 | impl Copy for EFoo { }
+27 | impl Copy for EFoo { } //~ ERROR may not be implemented for this type
    |      ^^^^
 
 error[E0204]: the trait `Copy` may not be implemented for this type
   --> $DIR/E0204.rs:29:10
    |
-29 | #[derive(Copy)]
+29 | #[derive(Copy)] //~ ERROR may not be implemented for this type
    |          ^^^^
 30 | enum EFoo2<'a> {
 31 |     Bar(&'a mut bool),
index 7915564cafb0aabc20aec57803afcb942ee4e237..de81068e2683d620b288672562bd7e7a1067d430 100644 (file)
@@ -25,6 +25,7 @@ fn drop(&mut self) {}
 }
 
 const F : Foo = (Foo { a : 0 }, Foo { a : 1 }).1;
+//~^ destructors cannot be evaluated at compile-time
 
 fn main() {
 }
index 29fea052b06c2f0c447dde602dbf40d001f0a33c..1c45771ff8a3ce29705c387a31e958d0e5a7aa55 100644 (file)
@@ -24,6 +24,7 @@ fn call<F>(mut f: F) where F: FnMut(Fn) {
     //~| NOTE first mutable borrow occurs here
     //~| NOTE second mutable borrow occurs here
         f((Box::new(|| {})))
+        //~^ NOTE borrow occurs due to use of `f` in closure
     }));
     //~^ NOTE first borrow ends here
 }
@@ -66,7 +67,7 @@ fn test6() {
 fn test7() {
     fn foo<F>(_: F) where F: FnMut(Box<FnMut(isize)>, isize) {}
     let mut f = |g: Box<FnMut(isize)>, b: isize| {};
-    //~^ NOTE moved
+    //~^ NOTE captured outer variable
     f(Box::new(|a| {
     //~^ NOTE borrow of `f` occurs here
         foo(f);
index 6e7d0c17f1dfe58233e41a52ff7f62aa8be36903..0a1429d5509b0a97638870850d39905f4db323ee 100644 (file)
@@ -8,43 +8,44 @@ error[E0499]: cannot borrow `f` as mutable more than once at a time
 ...
 26 |         f((Box::new(|| {})))
    |         - borrow occurs due to use of `f` in closure
-27 |     }));
+27 |         //~^ NOTE borrow occurs due to use of `f` in closure
+28 |     }));
    |       - first borrow ends here
 
 error[E0596]: cannot borrow immutable borrowed content `*f` as mutable
-  --> $DIR/borrowck-call-is-borrow-issue-12224.rs:39:5
+  --> $DIR/borrowck-call-is-borrow-issue-12224.rs:40:5
    |
-37 | fn test2<F>(f: &F) where F: FnMut() {
+38 | fn test2<F>(f: &F) where F: FnMut() {
    |                -- use `&mut F` here to make mutable
-38 |     //~^ NOTE use `&mut F` here to make mutable
-39 |     (*f)();
+39 |     //~^ NOTE use `&mut F` here to make mutable
+40 |     (*f)();
    |     ^^^^ cannot borrow as mutable
 
 error[E0596]: cannot borrow immutable `Box` content `*f.f` as mutable
-  --> $DIR/borrowck-call-is-borrow-issue-12224.rs:50:5
+  --> $DIR/borrowck-call-is-borrow-issue-12224.rs:51:5
    |
-48 | fn test4(f: &Test) {
+49 | fn test4(f: &Test) {
    |             ----- use `&mut Test` here to make mutable
-49 |     //~^ NOTE use `&mut Test` here to make mutable
-50 |     f.f.call_mut(())
+50 |     //~^ NOTE use `&mut Test` here to make mutable
+51 |     f.f.call_mut(())
    |     ^^^ cannot borrow as mutable
 
 error[E0504]: cannot move `f` into closure because it is borrowed
-  --> $DIR/borrowck-call-is-borrow-issue-12224.rs:72:13
+  --> $DIR/borrowck-call-is-borrow-issue-12224.rs:73:13
    |
-70 |     f(Box::new(|a| {
+71 |     f(Box::new(|a| {
    |     - borrow of `f` occurs here
-71 |     //~^ NOTE borrow of `f` occurs here
-72 |         foo(f);
+72 |     //~^ NOTE borrow of `f` occurs here
+73 |         foo(f);
    |             ^ move into closure occurs here
 
 error[E0507]: cannot move out of captured outer variable in an `FnMut` closure
-  --> $DIR/borrowck-call-is-borrow-issue-12224.rs:72:13
+  --> $DIR/borrowck-call-is-borrow-issue-12224.rs:73:13
    |
-68 |     let mut f = |g: Box<FnMut(isize)>, b: isize| {};
+69 |     let mut f = |g: Box<FnMut(isize)>, b: isize| {};
    |         ----- captured outer variable
 ...
-72 |         foo(f);
+73 |         foo(f);
    |             ^ cannot move out of captured outer variable in an `FnMut` closure
 
 error: aborting due to 5 previous errors
index 9e316b989a4752284ae065a3b309ec056447afcc..b31ba324b0cda19ff8d2493d7c4eb211bf92452d 100644 (file)
@@ -26,7 +26,7 @@ fn f() {
     v3.push(&id('x'));           // statement 6
     //~^ ERROR borrowed value does not live long enough
     //~| NOTE temporary value created here
-    //~| NOTE temporary value only lives until here
+    //~| NOTE temporary value dropped here while still borrowed
     //~| NOTE consider using a `let` binding to increase its lifetime
 
     {
@@ -36,7 +36,7 @@ fn f() {
         v4.push(&id('y'));
         //~^ ERROR borrowed value does not live long enough
         //~| NOTE temporary value created here
-        //~| NOTE temporary value only lives until here
+        //~| NOTE temporary value dropped here while still borrowed
         //~| NOTE consider using a `let` binding to increase its lifetime
 
     }                       // (statement 7)
@@ -47,7 +47,7 @@ fn f() {
     v5.push(&id('z'));
     //~^ ERROR borrowed value does not live long enough
     //~| NOTE temporary value created here
-    //~| NOTE temporary value only lives until here
+    //~| NOTE temporary value dropped here while still borrowed
     //~| NOTE consider using a `let` binding to increase its lifetime
 
     v1.push(&old[0]);
index 726d4bcdf1d083a222c2680b15e8a1dc49f6fc00..a059232daca387cc60cbbcd0041ac3198b6f1bd2 100644 (file)
 fn main() {
     let msg;
     match Some("Hello".to_string()) {
-        Some(ref m) => { //~ ERROR borrowed value does not live long enough
+        Some(ref m) => {
             msg = m;
         },
         None => { panic!() }
-    }
+    } //~ ERROR borrowed value does not live long enough
     println!("{}", *msg);
 }
index ced1f762af4a40a7b9a0c4958465e4c7dbcdda07..91f9cddd5898563426c472d9c1cf93be96ddce1f 100644 (file)
@@ -1,10 +1,10 @@
 error[E0597]: borrowed value does not live long enough
   --> $DIR/borrowck-ref-into-rvalue.rs:18:5
    |
-14 |         Some(ref m) => { //~ ERROR borrowed value does not live long enough
+14 |         Some(ref m) => {
    |              ----- borrow occurs here
 ...
-18 |     }
+18 |     } //~ ERROR borrowed value does not live long enough
    |     ^ borrowed value dropped here while still borrowed
 19 |     println!("{}", *msg);
 20 | }
index 32d80069f0087eb23836c5858a6b76a598fb3a56..a1a250b0e9ad2339f3268e20fc3cf7e7ee035af0 100644 (file)
@@ -18,37 +18,26 @@ fn main() {
     //~^ ERROR E0308
     //~| NOTE expected usize, found struct `std::string::String`
     //~| NOTE expected type `usize`
-    //~| NOTE found type `std::string::String`
     //~| HELP here are some functions which might fulfill your needs:
     let x: &str = String::new();
     //~^ ERROR E0308
     //~| NOTE expected &str, found struct `std::string::String`
     //~| NOTE expected type `&str`
-    //~| NOTE found type `std::string::String`
     //~| HELP try with `&String::new()`
     let y = String::new();
     test(&y);
     //~^ ERROR E0308
     //~| NOTE types differ in mutability
     //~| NOTE expected type `&mut std::string::String`
-    //~| NOTE found type `&std::string::String`
     test2(&y);
     //~^ ERROR E0308
     //~| NOTE types differ in mutability
     //~| NOTE expected type `&mut i32`
-    //~| NOTE found type `&std::string::String`
     let f;
     f = box f;
     //~^ ERROR E0308
     //~| NOTE cyclic type of infinite size
-    //~| NOTE expected type `_`
-    //~| NOTE found type `Box<_>`
 
     let s = &mut String::new();
     s = format!("foo");
-    //~^ ERROR E0308
-    //~| NOTE expected mutable reference, found struct `std::string::String`
-    //~| NOTE expected type `&mut std::string::String`
-    //~| HELP try with `&mut format!("foo")`
-    //~| NOTE this error originates in a macro outside of the current crate
 }
index 5bd6ef806b5a5941ead0b7f58f6676ce2eb869b1..73169e86a1c74287028d788376a5e991371fd4f5 100644 (file)
@@ -11,9 +11,9 @@ error[E0308]: mismatched types
            - .len()
 
 error[E0308]: mismatched types
-  --> $DIR/coerce-suggestions.rs:23:19
+  --> $DIR/coerce-suggestions.rs:22:19
    |
-23 |     let x: &str = String::new();
+22 |     let x: &str = String::new();
    |                   ^^^^^^^^^^^^^ expected &str, found struct `std::string::String`
    |
    = note: expected type `&str`
@@ -21,33 +21,33 @@ error[E0308]: mismatched types
    = help: try with `&String::new()`
 
 error[E0308]: mismatched types
-  --> $DIR/coerce-suggestions.rs:30:10
+  --> $DIR/coerce-suggestions.rs:28:10
    |
-30 |     test(&y);
+28 |     test(&y);
    |          ^^ types differ in mutability
    |
    = note: expected type `&mut std::string::String`
               found type `&std::string::String`
 
 error[E0308]: mismatched types
-  --> $DIR/coerce-suggestions.rs:35:11
+  --> $DIR/coerce-suggestions.rs:32:11
    |
-35 |     test2(&y);
+32 |     test2(&y);
    |           ^^ types differ in mutability
    |
    = note: expected type `&mut i32`
               found type `&std::string::String`
 
 error[E0308]: mismatched types
-  --> $DIR/coerce-suggestions.rs:41:9
+  --> $DIR/coerce-suggestions.rs:37:9
    |
-41 |     f = box f;
+37 |     f = box f;
    |         ^^^^^ cyclic type of infinite size
 
 error[E0308]: mismatched types
-  --> $DIR/coerce-suggestions.rs:48:9
+  --> $DIR/coerce-suggestions.rs:42:9
    |
-48 |     s = format!("foo");
+42 |     s = format!("foo");
    |         ^^^^^^^^^^^^^^ expected mutable reference, found struct `std::string::String`
    |
    = note: expected type `&mut std::string::String`
index 22f615cafd71eec06ce67f396d45542e0e1eb466..7c80867856d3bb6befc2bb3d311ef97b2d26a3c3 100644 (file)
@@ -15,7 +15,7 @@
 fn main() {
     let b = {
         let a = Box::new(RefCell::new(4));
-        *a.borrow() + 1    //~ ERROR `*a` does not live long enough
-    };
+        *a.borrow() + 1
+    }; //~ ERROR `*a` does not live long enough
     println!("{}", b);
 }
index ee885454169cb1824ec83a5023b3850f52c80567..e6d24d7c135991e2e780187ba4f0b715323eb47c 100644 (file)
@@ -1,9 +1,9 @@
 error[E0597]: `*a` does not live long enough
   --> $DIR/destructor-restrictions.rs:19:5
    |
-18 |         *a.borrow() + 1    //~ ERROR `*a` does not live long enough
+18 |         *a.borrow() + 1
    |          - borrow occurs here
-19 |     };
+19 |     }; //~ ERROR `*a` does not live long enough
    |     ^- borrowed value needs to live until here
    |     |
    |     `*a` dropped here while still borrowed
index d5ccd2ea7ad3f6d2caf1c217169bed80affa1a7c..ace185d01694af483aff14fc8d690e7abbcd0423 100644 (file)
 
 #![feature(attr_literals)]
 
-#[repr(align(16))]
+#[repr(align(16))] //~ ERROR is experimental
 struct Gem {
     mohs_hardness: u8,
     poofed: bool,
     weapon: Weapon,
 }
 
-#[repr(simd)]
+#[repr(simd)] //~ ERROR are experimental
 struct Weapon {
     name: String,
     damage: u32
@@ -25,9 +25,10 @@ struct Weapon {
 
 impl Gem {
     #[must_use] fn summon_weapon(&self) -> Weapon { self.weapon }
+    //~^ WARN is experimental
 }
 
-#[must_use]
+#[must_use] //~ WARN is experimental
 fn bubble(gem: Gem) -> Result<Gem, ()> {
     if gem.poofed {
         Ok(gem)
index 66b2567f728a39e19f2fdadf8615dbde21f1ae4e..d067470942e33f7634248f0fd0a5065f6621af84 100644 (file)
@@ -1,7 +1,7 @@
 error: the struct `#[repr(align(u16))]` attribute is experimental (see issue #33626)
   --> $DIR/gated-features-attr-spans.rs:13:1
    |
-13 | #[repr(align(16))]
+13 | #[repr(align(16))] //~ ERROR is experimental
    | ^^^^^^^^^^^^^^^^^^
    |
    = help: add #![feature(repr_align)] to the crate attributes to enable
@@ -9,7 +9,7 @@ error: the struct `#[repr(align(u16))]` attribute is experimental (see issue #33
 error: SIMD types are experimental and possibly buggy (see issue #27731)
   --> $DIR/gated-features-attr-spans.rs:20:1
    |
-20 | #[repr(simd)]
+20 | #[repr(simd)] //~ ERROR are experimental
    | ^^^^^^^^^^^^^
    |
    = help: add #![feature(repr_simd)] to the crate attributes to enable
@@ -23,9 +23,9 @@ warning: `#[must_use]` on methods is experimental (see issue #43302)
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
 
 warning: `#[must_use]` on functions is experimental (see issue #43302)
-  --> $DIR/gated-features-attr-spans.rs:30:1
+  --> $DIR/gated-features-attr-spans.rs:31:1
    |
-30 | #[must_use]
+31 | #[must_use] //~ WARN is experimental
    | ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
index 091df1d5dc898852fa5fa115dc7e176439ad99b0..d4aafabed37915fa330f065e8ce02df8ce143807 100644 (file)
 
 trait Foo {
     fn bar(&self);
+    //~^ NOTE item in trait
+    //~| NOTE `bar` from trait
+    //~| NOTE item in trait
+    //~| NOTE `bar` from trait
     const MY_CONST: u32;
+    //~^ NOTE item in trait
+    //~| NOTE `MY_CONST` from trait
 }
 
 pub struct FooConstForMethod;
@@ -46,10 +52,15 @@ impl Foo for FooTypeForMethod {
     type bar = u64;
     //~^ ERROR E0325
     //~| NOTE does not match trait
+    //~| NOTE not a member
+    //~| ERROR E0437
     const MY_CONST: u32 = 1;
 }
 
 impl Debug for FooTypeForMethod {
 }
+//~^^ ERROR E0046
+//~| NOTE missing `fmt` in implementation
+//~| NOTE `fmt` from trait:
 
 fn main () {}
index 5812cab0d050a300d21bcb9ec0d4d87635267a8a..dfca435f2a0732b1b8afe4fbbcec364ab51af9e1 100644 (file)
@@ -1,86 +1,86 @@
 error[E0437]: type `bar` is not a member of trait `Foo`
-  --> $DIR/impl-wrong-item-for-trait.rs:46:5
+  --> $DIR/impl-wrong-item-for-trait.rs:52:5
    |
-46 |     type bar = u64;
+52 |     type bar = u64;
    |     ^^^^^^^^^^^^^^^ not a member of trait `Foo`
 
 error[E0323]: item `bar` is an associated const, which doesn't match its trait `Foo`
-  --> $DIR/impl-wrong-item-for-trait.rs:24:5
+  --> $DIR/impl-wrong-item-for-trait.rs:30:5
    |
 15 |     fn bar(&self);
    |     -------------- item in trait
 ...
-24 |     const bar: u64 = 1;
+30 |     const bar: u64 = 1;
    |     ^^^^^^^^^^^^^^^^^^^ does not match trait
 
 error[E0046]: not all trait items implemented, missing: `bar`
-  --> $DIR/impl-wrong-item-for-trait.rs:21:1
+  --> $DIR/impl-wrong-item-for-trait.rs:27:1
    |
 15 |       fn bar(&self);
    |       -------------- `bar` from trait
 ...
-21 | / impl Foo for FooConstForMethod {
-22 | |     //~^ ERROR E0046
-23 | |     //~| NOTE missing `bar` in implementation
-24 | |     const bar: u64 = 1;
+27 | / impl Foo for FooConstForMethod {
+28 | |     //~^ ERROR E0046
+29 | |     //~| NOTE missing `bar` in implementation
+30 | |     const bar: u64 = 1;
 ...  |
-27 | |     const MY_CONST: u32 = 1;
-28 | | }
+33 | |     const MY_CONST: u32 = 1;
+34 | | }
    | |_^ missing `bar` in implementation
 
 error[E0324]: item `MY_CONST` is an associated method, which doesn't match its trait `Foo`
-  --> $DIR/impl-wrong-item-for-trait.rs:36:5
+  --> $DIR/impl-wrong-item-for-trait.rs:42:5
    |
-16 |     const MY_CONST: u32;
+20 |     const MY_CONST: u32;
    |     -------------------- item in trait
 ...
-36 |     fn MY_CONST() {}
+42 |     fn MY_CONST() {}
    |     ^^^^^^^^^^^^^^^^ does not match trait
 
 error[E0046]: not all trait items implemented, missing: `MY_CONST`
-  --> $DIR/impl-wrong-item-for-trait.rs:32:1
+  --> $DIR/impl-wrong-item-for-trait.rs:38:1
    |
-16 |       const MY_CONST: u32;
+20 |       const MY_CONST: u32;
    |       -------------------- `MY_CONST` from trait
 ...
-32 | / impl Foo for FooMethodForConst {
-33 | |     //~^ ERROR E0046
-34 | |     //~| NOTE missing `MY_CONST` in implementation
-35 | |     fn bar(&self) {}
+38 | / impl Foo for FooMethodForConst {
+39 | |     //~^ ERROR E0046
+40 | |     //~| NOTE missing `MY_CONST` in implementation
+41 | |     fn bar(&self) {}
 ...  |
-38 | |     //~| NOTE does not match trait
-39 | | }
+44 | |     //~| NOTE does not match trait
+45 | | }
    | |_^ missing `MY_CONST` in implementation
 
 error[E0325]: item `bar` is an associated type, which doesn't match its trait `Foo`
-  --> $DIR/impl-wrong-item-for-trait.rs:46:5
+  --> $DIR/impl-wrong-item-for-trait.rs:52:5
    |
 15 |     fn bar(&self);
    |     -------------- item in trait
 ...
-46 |     type bar = u64;
+52 |     type bar = u64;
    |     ^^^^^^^^^^^^^^^ does not match trait
 
 error[E0046]: not all trait items implemented, missing: `bar`
-  --> $DIR/impl-wrong-item-for-trait.rs:43:1
+  --> $DIR/impl-wrong-item-for-trait.rs:49:1
    |
 15 |       fn bar(&self);
    |       -------------- `bar` from trait
 ...
-43 | / impl Foo for FooTypeForMethod {
-44 | |     //~^ ERROR E0046
-45 | |     //~| NOTE missing `bar` in implementation
-46 | |     type bar = u64;
+49 | / impl Foo for FooTypeForMethod {
+50 | |     //~^ ERROR E0046
+51 | |     //~| NOTE missing `bar` in implementation
+52 | |     type bar = u64;
 ...  |
-49 | |     const MY_CONST: u32 = 1;
-50 | | }
+57 | |     const MY_CONST: u32 = 1;
+58 | | }
    | |_^ missing `bar` in implementation
 
 error[E0046]: not all trait items implemented, missing: `fmt`
-  --> $DIR/impl-wrong-item-for-trait.rs:52:1
+  --> $DIR/impl-wrong-item-for-trait.rs:60:1
    |
-52 | / impl Debug for FooTypeForMethod {
-53 | | }
+60 | / impl Debug for FooTypeForMethod {
+61 | | }
    | |_^ missing `fmt` in implementation
    |
    = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
index 7bea8642cce1409193e89322cccebcf7df7bc6f4..fd5625f68923a5d95cddc65c000e15df3b1a807b 100644 (file)
@@ -15,7 +15,7 @@ fn to_fn_once<A,F:FnOnce<A>>(f: F) -> F { f }
 fn main() {
     let r = {
         let x: Box<_> = box 42;
-        let f = to_fn_once(move|| &x);
+        let f = to_fn_once(move|| &x); //~ ERROR does not live long enough
         f()
     };
 
index 6b2942bc7a8a78a1c1887f907d60d7639efe25c8..057ccc8d677e91c448c92557dab54a426cbe02fe 100644 (file)
@@ -1,7 +1,7 @@
 error[E0597]: `x` does not live long enough
   --> $DIR/issue-11925.rs:18:36
    |
-18 |         let f = to_fn_once(move|| &x);
+18 |         let f = to_fn_once(move|| &x); //~ ERROR does not live long enough
    |                                    ^
    |                                    |
    |                                    borrow occurs here
index 871e0af50bfc6cad967347b1c496a7732353ee45..90f3e1fd00a0832f168117beb6c32cba3e8ec652 100644 (file)
@@ -13,7 +13,7 @@ fn id<T>(x: T) -> T { x }
 fn main() {
     let v = vec![
         &id(3)
-    ];
+    ]; //~ ERROR borrowed value does not live long enough
 
     for &&x in &v {
         println!("{}", x + 3);
index 7f4ca19241cd2f0a53df527dd440c5c5e226f6ab..4d2e6f8374c1f8982cd07ace18674575a6a95250 100644 (file)
@@ -3,7 +3,7 @@ error[E0597]: borrowed value does not live long enough
    |
 15 |         &id(3)
    |          ----- temporary value created here
-16 |     ];
+16 |     ]; //~ ERROR borrowed value does not live long enough
    |      ^ temporary value dropped here while still borrowed
 ...
 21 | }
index a04edd99b8b6b881bd2707868cd9c65918087f12..583c569062170d07d17a2919a6dc679bd6d61791 100644 (file)
@@ -24,8 +24,8 @@ fn foo(x: RefCell<String>) -> String {
 fn foo2(x: RefCell<String>) -> String {
     let ret = {
         let y = x;
-        y.borrow().clone() //~ ERROR `y` does not live long enough
-    };
+        y.borrow().clone()
+    }; //~ ERROR `y` does not live long enough
     ret
 }
 
index 02c033153725c14e7f698a02946971cc03ae334f..090cf1d924bdbb00622407d6c30f6560e3423b06 100644 (file)
@@ -11,9 +11,9 @@ error[E0597]: `y` does not live long enough
 error[E0597]: `y` does not live long enough
   --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:28:5
    |
-27 |         y.borrow().clone() //~ ERROR `y` does not live long enough
+27 |         y.borrow().clone()
    |         - borrow occurs here
-28 |     };
+28 |     }; //~ ERROR `y` does not live long enough
    |     ^- borrowed value needs to live until here
    |     |
    |     `y` dropped here while still borrowed
index f59d2845108fbd93807eb638106ad5d603beac63..041ca6c426c1f40cfb20336456b10b69b0953565 100644 (file)
@@ -18,8 +18,9 @@
 #![warn(unused)]
 
 #[rustc_error]
-fn main() {
-    let theTwo = 2;
-    let theOtherTwo = 2;
+fn main() { //~ ERROR compilation successful
+    let theTwo = 2; //~ WARN should have a snake case name
+    let theOtherTwo = 2; //~ WARN should have a snake case name
+    //~^ WARN unused variable
     println!("{}", theTwo);
 }
index 718720ebf83839042e037999a41b6637c3368efe..7e19c7492ce0bdf032bb562882d39d9068a8d907 100644 (file)
@@ -1,7 +1,7 @@
 warning: unused variable: `theOtherTwo`
   --> $DIR/issue-24690.rs:23:9
    |
-23 |     let theOtherTwo = 2;
+23 |     let theOtherTwo = 2; //~ WARN should have a snake case name
    |         ^^^^^^^^^^^
    |
 note: lint level defined here
@@ -15,7 +15,7 @@ note: lint level defined here
 warning: variable `theTwo` should have a snake case name such as `the_two`
   --> $DIR/issue-24690.rs:22:9
    |
-22 |     let theTwo = 2;
+22 |     let theTwo = 2; //~ WARN should have a snake case name
    |         ^^^^^^
    |
    = note: #[warn(non_snake_case)] on by default
@@ -23,16 +23,17 @@ warning: variable `theTwo` should have a snake case name such as `the_two`
 warning: variable `theOtherTwo` should have a snake case name such as `the_other_two`
   --> $DIR/issue-24690.rs:23:9
    |
-23 |     let theOtherTwo = 2;
+23 |     let theOtherTwo = 2; //~ WARN should have a snake case name
    |         ^^^^^^^^^^^
 
 error: compilation successful
   --> $DIR/issue-24690.rs:21:1
    |
-21 | / fn main() {
-22 | |     let theTwo = 2;
-23 | |     let theOtherTwo = 2;
-24 | |     println!("{}", theTwo);
-25 | | }
+21 | / fn main() { //~ ERROR compilation successful
+22 | |     let theTwo = 2; //~ WARN should have a snake case name
+23 | |     let theOtherTwo = 2; //~ WARN should have a snake case name
+24 | |     //~^ WARN unused variable
+25 | |     println!("{}", theTwo);
+26 | | }
    | |_^
 
index 81fcb007eb491f936be27628d3062cdca4b28668..1e3eba4bf3631fabbfb47c80755a7bb25774bddb 100644 (file)
@@ -13,7 +13,7 @@
 struct SomeType {}
 
 trait Foo {
-    fn handler(self: &SomeType);
+    fn handler(self: &SomeType); //~ ERROR invalid `self` type
 }
 
 fn main() {}
index e12fb57f15dc9aa45d74746b009e6613a362fa2d..dc02ad73ee2bccf74b596ecfa5ca16081918313d 100644 (file)
@@ -1,7 +1,7 @@
 error[E0307]: invalid `self` type: &SomeType
   --> $DIR/issue-27522.rs:16:22
    |
-16 |     fn handler(self: &SomeType);
+16 |     fn handler(self: &SomeType); //~ ERROR invalid `self` type
    |                      ^^^^^^^^^
    |
    = note: type must be `Self` or a type that dereferences to it`
index 00482f50618db5b327fd47f60308c16cc997699f..8baa381fb2d730b54a39f92f62f1f818d689d2e0 100644 (file)
@@ -8,13 +8,14 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn foo(Option<i32>, String) {}
-fn bar(x, y: usize) {}
+fn foo(Option<i32>, String) {} //~ ERROR expected one of
+//~^ ERROR expected one of
+fn bar(x, y: usize) {} //~ ERROR expected one of
 
 fn main() {
     foo(Some(42), 2);
-    foo(Some(42), 2, "");
-    bar("", "");
+    foo(Some(42), 2, ""); //~ ERROR this function takes
+    bar("", ""); //~ ERROR mismatched types
     bar(1, 2);
-    bar(1, 2, 3);
+    bar(1, 2, 3); //~ ERROR this function takes
 }
index e25caacac8febed524fc3dbcf11b6a26fd65e0ea..6ab92cab83dc2b193103c1af0e5245e438a133d7 100644 (file)
@@ -1,34 +1,34 @@
 error: expected one of `:` or `@`, found `<`
   --> $DIR/issue-34264.rs:11:14
    |
-11 | fn foo(Option<i32>, String) {}
+11 | fn foo(Option<i32>, String) {} //~ ERROR expected one of
    |              ^ expected one of `:` or `@` here
 
 error: expected one of `:` or `@`, found `)`
   --> $DIR/issue-34264.rs:11:27
    |
-11 | fn foo(Option<i32>, String) {}
+11 | fn foo(Option<i32>, String) {} //~ ERROR expected one of
    |                           ^ expected one of `:` or `@` here
 
 error: expected one of `:` or `@`, found `,`
-  --> $DIR/issue-34264.rs:12:9
+  --> $DIR/issue-34264.rs:13:9
    |
-12 | fn bar(x, y: usize) {}
+13 | fn bar(x, y: usize) {} //~ ERROR expected one of
    |         ^ expected one of `:` or `@` here
 
 error[E0061]: this function takes 2 parameters but 3 parameters were supplied
-  --> $DIR/issue-34264.rs:16:9
+  --> $DIR/issue-34264.rs:17:9
    |
-11 | fn foo(Option<i32>, String) {}
+11 | fn foo(Option<i32>, String) {} //~ ERROR expected one of
    | ------------------------------ defined here
 ...
-16 |     foo(Some(42), 2, "");
+17 |     foo(Some(42), 2, ""); //~ ERROR this function takes
    |         ^^^^^^^^^^^^^^^ expected 2 parameters
 
 error[E0308]: mismatched types
-  --> $DIR/issue-34264.rs:17:13
+  --> $DIR/issue-34264.rs:18:13
    |
-17 |     bar("", "");
+18 |     bar("", ""); //~ ERROR mismatched types
    |             ^^ expected usize, found reference
    |
    = note: expected type `usize`
@@ -37,12 +37,12 @@ error[E0308]: mismatched types
            - .len()
 
 error[E0061]: this function takes 2 parameters but 3 parameters were supplied
-  --> $DIR/issue-34264.rs:19:9
+  --> $DIR/issue-34264.rs:20:9
    |
-12 | fn bar(x, y: usize) {}
+13 | fn bar(x, y: usize) {} //~ ERROR expected one of
    | ---------------------- defined here
 ...
-19 |     bar(1, 2, 3);
+20 |     bar(1, 2, 3); //~ ERROR this function takes
    |         ^^^^^^^ expected 2 parameters
 
 error: aborting due to 6 previous errors
index 8ff5f3b83986ce14dd90cfc16ec10ced146ac349..fa0410686c26c78a284a10438f9c4c0e5e303f57 100644 (file)
@@ -13,6 +13,7 @@
 use std::ops::Add;
 
 impl<T: Clone, Add> Add for Foo<T> {
+//~^ ERROR expected trait, found type parameter
     type Output = usize;
 
     fn add(self, rhs: Self) -> Self::Output {
index 893c2168c2e1631f6035671b1c79ad024552fd65..c6cdb8b6db7cfc32b9448978e48b6d26c8a1bcc1 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[foo]
+#[foo] //~ ERROR is currently unknown to the compiler
 mod foo {
-    #![foo]
+    #![foo] //~ ERROR is currently unknown to the compiler
 }
index dc6190c2e76b0f28afee368623308f022d13cb96..50908b2ca3970fd52fdc9c826fc5180673baa6ab 100644 (file)
@@ -1,7 +1,7 @@
 error: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
   --> $DIR/issue-36530.rs:11:1
    |
-11 | #[foo]
+11 | #[foo] //~ ERROR is currently unknown to the compiler
    | ^^^^^^
    |
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
@@ -9,7 +9,7 @@ error: The attribute `foo` is currently unknown to the compiler and may have mea
 error: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
   --> $DIR/issue-36530.rs:13:5
    |
-13 |     #![foo]
+13 |     #![foo] //~ ERROR is currently unknown to the compiler
    |     ^^^^^^^
    |
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
index 49ad40259d91f7ac42e0ce492c534eb5637d119c..2b0250d332df7c91059d2b192adfd0a2df23656e 100644 (file)
@@ -17,7 +17,7 @@ fn foo(&mut self) {}
 }
 
 fn bar<T: B>(a: &T) {
-    a.foo()
+    a.foo() //~ ERROR multiple applicable items
 }
 
 trait C {
@@ -29,7 +29,7 @@ fn foo(&self) {}
 }
 
 fn quz<T: D>(a: &T) {
-    a.foo()
+    a.foo() //~ ERROR multiple applicable items
 }
 
 trait E : Sized {
@@ -41,7 +41,7 @@ fn foo(self) {}
 }
 
 fn foo<T: F>(a: T) {
-    a.foo()
+    a.foo() //~ ERROR multiple applicable items
 }
 
 fn pass<T: C>(a: &T) {
index 7cf74eaab8db12c65c7ed2e1266edc152643919d..8babcc74ed5f33147a2153f7ff00208fb99a8b10 100644 (file)
@@ -1,7 +1,7 @@
 error[E0034]: multiple applicable items in scope
   --> $DIR/issue-37767.rs:20:7
    |
-20 |     a.foo()
+20 |     a.foo() //~ ERROR multiple applicable items
    |       ^^^ multiple `foo` found
    |
 note: candidate #1 is defined in the trait `A`
@@ -20,7 +20,7 @@ note: candidate #2 is defined in the trait `B`
 error[E0034]: multiple applicable items in scope
   --> $DIR/issue-37767.rs:32:7
    |
-32 |     a.foo()
+32 |     a.foo() //~ ERROR multiple applicable items
    |       ^^^ multiple `foo` found
    |
 note: candidate #1 is defined in the trait `C`
@@ -39,7 +39,7 @@ note: candidate #2 is defined in the trait `D`
 error[E0034]: multiple applicable items in scope
   --> $DIR/issue-37767.rs:44:7
    |
-44 |     a.foo()
+44 |     a.foo() //~ ERROR multiple applicable items
    |       ^^^ multiple `foo` found
    |
 note: candidate #1 is defined in the trait `E`
index 1cbc5ff1d2ab5e6cdcf96ff6fb9a30a0455da486..4c9d10ba46bc858db86fb79f815eeb0b421c7f32 100644 (file)
 
 pub fn main() {
     let x = "Hello " + "World!";
+    //~^ ERROR cannot be applied to type
 
     // Make sure that the span outputs a warning
     // for not having an implementation for std::ops::Add
     // that won't output for the above string concatenation
     let y = World::Hello + World::Goodbye;
+    //~^ ERROR cannot be applied to type
 }
 
 enum World {
index e865b5192a40758a7540e1537093b901b89b1add..db662a1df5972ad6b3d8eb01847b6ecd05b29c48 100644 (file)
@@ -9,9 +9,9 @@ help: `to_owned()` can be used to create an owned `String` from a string referen
    |             ^^^^^^^^^^^^^^^^^^^
 
 error[E0369]: binary operation `+` cannot be applied to type `World`
-  --> $DIR/issue-39018.rs:17:13
+  --> $DIR/issue-39018.rs:18:13
    |
-17 |     let y = World::Hello + World::Goodbye;
+18 |     let y = World::Hello + World::Goodbye;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: an implementation of `std::ops::Add` might be missing for `World`
index 17b3f1c5a885e4fe4d5a0a6dd9af10f06f9c6e6e..33071c468b8722aedc86d8e529dc1221e2377733 100644 (file)
@@ -18,5 +18,9 @@ enum T {
 fn main() {
     match T::T1(123, 456) {
         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
+        //~^ ERROR is not bound in all patterns
+        //~| ERROR is not bound in all patterns
+        //~| ERROR is not bound in all patterns
+        //~| ERROR is not bound in all patterns
     }
 }
index 8f3a7ae3417366fe34dad2e590d8e1f7fcbbe562..9e33ecde91ced7b5db7a8fec17b1158400db7d54 100644 (file)
@@ -10,4 +10,5 @@
 
 fn main () {
     {println!("{:?}", match { let foo = vec![1, 2]; foo.get(1) } { x => x });}
+     //~^ ERROR does not live long enough
 }
index cf2a4b8d037671a96fddcdf93a648ab467329cc3..782cce26a95782b8c50635e6303912ea02b30d93 100644 (file)
@@ -11,6 +11,7 @@
 #![allow(dead_code)]
 
 #![derive(Debug, PartialEq, Eq)] // should be an outer attribute!
+//~^ ERROR `derive` may only be applied to structs, enums and unions
 struct DerivedOn;
 
 fn main() {}
index b74036c4f5ce8de6ad12e527dd74b722d7dfc250..f7059e01261a6b3ca32f1f38d91d729cc2b8d4f3 100644 (file)
@@ -45,7 +45,7 @@ fn f9(i: usize) -> usize {
     }
 }
 
-struct Myisize(isize);
+struct Myisize(isize); //~ NOTE not found for this
 
 impl Myisize {
     fn fff(i: isize) -> isize { //~ NOTE candidate
@@ -74,18 +74,18 @@ fn no_param_bound(u: usize, m: Myisize) -> usize {
     u.f8(42) + u.f9(342) + m.fff(42)
             //~^ ERROR no method named `f9` found for type `usize` in the current scope
             //~| NOTE found the following associated functions; to be used as methods, functions must have a `self` parameter
-            //~| NOTE to use it here write `CtxtFn::f9(u, 342)` instead
+            //~| NOTE the following traits define an item
             //~| ERROR no method named `fff` found for type `Myisize` in the current scope
             //~| NOTE found the following associated functions; to be used as methods, functions must have a `self` parameter
-            //~| NOTE to use it here write `OtherTrait::f9(u, 342)` instead
-            //~| NOTE to use it here write `UnusedTrait::f9(u, 342)` instead
+
+
 }
 
 fn param_bound<T: ManyImplTrait>(t: T) -> bool {
     t.is_str()
     //~^ ERROR no method named `is_str` found for type `T` in the current scope
     //~| NOTE found the following associated functions; to be used as methods, functions must have a `self` parameter
-    //~| NOTE to use it here write `ManyImplTrait::is_str(t)` instead
+    //~| NOTE the following trait defines
 }
 
 fn main() {
index 9b248f49e08b8fe8fc171c2e01f4d2319f04dfbc..a1ed5db69c0db6989eeda98da4802d9d6129c2e0 100644 (file)
@@ -33,7 +33,7 @@ note: candidate #3 is defined in the trait `UnusedTrait`
 error[E0599]: no method named `fff` found for type `Myisize` in the current scope
   --> $DIR/issue-7575.rs:74:30
    |
-48 | struct Myisize(isize);
+48 | struct Myisize(isize); //~ NOTE not found for this
    | ---------------------- method `fff` not found for this
 ...
 74 |     u.f8(42) + u.f9(342) + m.fff(42)
index b7aae39c4692710c349a1b60586d84a60070fcdd..71f37f6555e47fa53d7e347189f96603a4d412b6 100644 (file)
@@ -12,7 +12,7 @@
 
 macro_rules! m {
     ($a:tt $b:tt) => {
-        $b $a;
+        $b $a; //~ WARN struct is never used
     }
 }
 
index af03aa6a369082662b86b4618923a3362f0c82b4..ed961896306983abab07966f90be31dd2e70df79 100644 (file)
@@ -1,7 +1,7 @@
 warning: struct is never used: `S`
   --> $DIR/macro-span-replacement.rs:15:9
    |
-15 |         $b $a;
+15 |         $b $a; //~ WARN struct is never used
    |         ^^^^^^
 ...
 20 |     m!(S struct);
index c2443b024ceb22899c214e0ab16cf376edd6aaf5..5d93b1266a4ae51a9ccae5635192947316af7c61 100644 (file)
@@ -15,7 +15,8 @@ macro_rules! m {
 }
 
 fn main() {
-    foo::<T>!();
-    foo::<>!();
-    m!(MyTrait<>);
+    foo::<T>!(); //~ ERROR generic arguments in macro path
+    foo::<>!(); //~ ERROR generic arguments in macro path
+    m!(MyTrait<>); //~ ERROR generic arguments in macro path
+    //~^ ERROR unexpected generic arguments in path
 }
index 017a449d96f463567796f6b11e3d1814ef67c642..e3e9334d9fbb70058a3c6cd7d10bd6411b5c0559 100644 (file)
@@ -1,25 +1,25 @@
 error: unexpected generic arguments in path
   --> $DIR/macro-ty-params.rs:20:8
    |
-20 |     m!(MyTrait<>);
+20 |     m!(MyTrait<>); //~ ERROR generic arguments in macro path
    |        ^^^^^^^^^
 
 error: generic arguments in macro path
   --> $DIR/macro-ty-params.rs:18:8
    |
-18 |     foo::<T>!();
+18 |     foo::<T>!(); //~ ERROR generic arguments in macro path
    |        ^^^^^
 
 error: generic arguments in macro path
   --> $DIR/macro-ty-params.rs:19:8
    |
-19 |     foo::<>!();
+19 |     foo::<>!(); //~ ERROR generic arguments in macro path
    |        ^^^^
 
 error: generic arguments in macro path
   --> $DIR/macro-ty-params.rs:20:15
    |
-20 |     m!(MyTrait<>);
+20 |     m!(MyTrait<>); //~ ERROR generic arguments in macro path
    |               ^^
 
 error: aborting due to 5 previous errors
index ba1a999121cc57cae44b3bbe61cac232284de43e..a586d33eaa7386b5fbcc4f94f9f6e5469fc7ca78 100644 (file)
@@ -18,10 +18,10 @@ fn generic<T>(self, _: T) { }
 }
 
 fn main() {
-    let _: Result<(), String> = Ok();
-    foo();
-    foo(());
-    bar();
-    S.baz();
-    S.generic::<()>();
+    let _: Result<(), String> = Ok(); //~ ERROR this function takes
+    foo(); //~ ERROR this function takes
+    foo(()); //~ ERROR this function takes
+    bar(); //~ ERROR this function takes
+    S.baz(); //~ ERROR this function takes
+    S.generic::<()>(); //~ ERROR this function takes
 }
index 672b0718a02d345eafbc33bb807b4ea51141c6f9..27f9972557b77e88232f456a21b46f71bedc3df1 100644 (file)
@@ -1,11 +1,11 @@
 error[E0061]: this function takes 1 parameter but 0 parameters were supplied
   --> $DIR/missing-unit-argument.rs:21:33
    |
-21 |     let _: Result<(), String> = Ok();
+21 |     let _: Result<(), String> = Ok(); //~ ERROR this function takes
    |                                 ^^^^
 help: expected the unit value `()`; create it with empty parentheses
    |
-21 |     let _: Result<(), String> = Ok(());
+21 |     let _: Result<(), String> = Ok(()); //~ ERROR this function takes
    |                                    ^^
 
 error[E0061]: this function takes 2 parameters but 0 parameters were supplied
@@ -14,7 +14,7 @@ error[E0061]: this function takes 2 parameters but 0 parameters were supplied
 11 | fn foo(():(), ():()) {}
    | ----------------------- defined here
 ...
-22 |     foo();
+22 |     foo(); //~ ERROR this function takes
    |     ^^^^^ expected 2 parameters
 
 error[E0061]: this function takes 2 parameters but 1 parameter was supplied
@@ -23,7 +23,7 @@ error[E0061]: this function takes 2 parameters but 1 parameter was supplied
 11 | fn foo(():(), ():()) {}
    | ----------------------- defined here
 ...
-23 |     foo(());
+23 |     foo(()); //~ ERROR this function takes
    |         ^^ expected 2 parameters
 
 error[E0061]: this function takes 1 parameter but 0 parameters were supplied
@@ -32,11 +32,11 @@ error[E0061]: this function takes 1 parameter but 0 parameters were supplied
 12 | fn bar(():()) {}
    | ---------------- defined here
 ...
-24 |     bar();
+24 |     bar(); //~ ERROR this function takes
    |     ^^^^^
 help: expected the unit value `()`; create it with empty parentheses
    |
-24 |     bar(());
+24 |     bar(()); //~ ERROR this function takes
    |         ^^
 
 error[E0061]: this function takes 1 parameter but 0 parameters were supplied
@@ -45,11 +45,11 @@ error[E0061]: this function takes 1 parameter but 0 parameters were supplied
 16 |     fn baz(self, (): ()) { }
    |     ------------------------ defined here
 ...
-25 |     S.baz();
+25 |     S.baz(); //~ ERROR this function takes
    |       ^^^
 help: expected the unit value `()`; create it with empty parentheses
    |
-25 |     S.baz(());
+25 |     S.baz(()); //~ ERROR this function takes
    |           ^^
 
 error[E0061]: this function takes 1 parameter but 0 parameters were supplied
@@ -58,11 +58,11 @@ error[E0061]: this function takes 1 parameter but 0 parameters were supplied
 17 |     fn generic<T>(self, _: T) { }
    |     ----------------------------- defined here
 ...
-26 |     S.generic::<()>();
+26 |     S.generic::<()>(); //~ ERROR this function takes
    |       ^^^^^^^
 help: expected the unit value `()`; create it with empty parentheses
    |
-26 |     S.generic::<()>(());
+26 |     S.generic::<()>(()); //~ ERROR this function takes
    |                     ^^
 
 error: aborting due to 6 previous errors
index e11ef0dddaa94bf761f9f9a7b57906733836d02d..87ce15292979a8af006fb4c7979e0a38aa06be02 100644 (file)
@@ -12,5 +12,5 @@
 // Make sure that the span of a closure marked `move` begins at the `move` keyword.
 
 fn main() {
-    let x: () = move || ();
+    let x: () = move || (); //~ ERROR mismatched types
 }
index 2294e6476d61fe2dd6c157884821603176b21af3..9135a26bbaf778111d4ae60a20289c2dd74b12b1 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/move-closure.rs:15:17
    |
-15 |     let x: () = move || ();
+15 |     let x: () = move || (); //~ ERROR mismatched types
    |                 ^^^^^^^^^^ expected (), found closure
    |
    = note: expected type `()`
index 323e7fb5a42c09bc893880b6bcb19a537fe2583c..2344d72f45c79e7cb68904ecf83071ffccbe9f66 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 // It should just use the entire body instead of pointing at the next two lines
-struct
+struct //~ ERROR has infinite size
 ListNode
 {
     head: u8,
index a06cbd04deb4fb4a32bc030387426608e8a913fd..124a53219a9dca34680fe8630bf319ed97890141 100644 (file)
@@ -1,7 +1,7 @@
 error[E0072]: recursive type `ListNode` has infinite size
   --> $DIR/multiline-span-E0072.rs:12:1
    |
-12 | / struct
+12 | / struct //~ ERROR has infinite size
 13 | | ListNode
 14 | | {
 15 | |     head: u8,
index 451492ba6930b9f8e88d6a725fe57bed262b66b4..f8e4cbcbf191f3a838bb5523b2f1cabe609d7d5f 100644 (file)
@@ -20,7 +20,7 @@ fn main() {
     let x = 1;
     let y = 2;
     let z = 3;
-    foo(1 as u32 +
+    foo(1 as u32 + //~ ERROR not satisfied
 
         bar(x,
 
index 3915f1b655cf5bad8dd3d1ba544a6a5fbf39629d..b068798630ed8602c0cde87f89a2d49e31d369ca 100644 (file)
@@ -1,7 +1,7 @@
 error[E0277]: the trait bound `u32: std::ops::Add<()>` is not satisfied
   --> $DIR/multiline-span-simple.rs:23:18
    |
-23 |     foo(1 as u32 +
+23 |     foo(1 as u32 + //~ ERROR not satisfied
    |                  ^ no implementation for `u32 + ()`
    |
    = help: the trait `std::ops::Add<()>` is not implemented for `u32`
index 66536b29c0298dfa9ae0de164a8cfb0d9948f6cf..c3582b0a0c5c644c0b810ae9e9bcf4c51a189792 100644 (file)
@@ -11,6 +11,7 @@
 #![warn(unused)]
 
 use std::cmp::{Eq, Ord, min, PartialEq, PartialOrd};
+//~^ WARN unused imports
 
 fn main() {
     let _ = min(1, 2);
index 296ee6ca10e0504e9a83f750210a1a0183e621c7..b22cadf3ef2b0e78d180a4b23541af19ae3d1f18 100644 (file)
 
 trait B {
     fn foo(mut a: &String) {
-        a.push_str("bar");
+        a.push_str("bar"); //~ ERROR cannot borrow immutable borrowed content
     }
 }
 
 pub fn foo<'a>(mut a: &'a String) {
-    a.push_str("foo");
+    a.push_str("foo"); //~ ERROR cannot borrow immutable borrowed content
 }
 
 struct A {}
 
 impl A {
     pub fn foo(mut a: &String) {
-        a.push_str("foo");
+        a.push_str("foo"); //~ ERROR cannot borrow immutable borrowed content
     }
 }
 
index f8584c6739078d624019f7ce3982296208371826..02c607ddc3775f3dd7238aee26cee2404fc3d679 100644 (file)
@@ -3,7 +3,7 @@ error[E0596]: cannot borrow immutable borrowed content `*a` as mutable
    |
 12 |     fn foo(mut a: &String) {
    |                   ------- use `&mut String` here to make mutable
-13 |         a.push_str("bar");
+13 |         a.push_str("bar"); //~ ERROR cannot borrow immutable borrowed content
    |         ^ cannot borrow as mutable
 
 error[E0596]: cannot borrow immutable borrowed content `*a` as mutable
@@ -11,7 +11,7 @@ error[E0596]: cannot borrow immutable borrowed content `*a` as mutable
    |
 17 | pub fn foo<'a>(mut a: &'a String) {
    |                       ---------- use `&'a mut String` here to make mutable
-18 |     a.push_str("foo");
+18 |     a.push_str("foo"); //~ ERROR cannot borrow immutable borrowed content
    |     ^ cannot borrow as mutable
 
 error[E0596]: cannot borrow immutable borrowed content `*a` as mutable
@@ -19,7 +19,7 @@ error[E0596]: cannot borrow immutable borrowed content `*a` as mutable
    |
 24 |     pub fn foo(mut a: &String) {
    |                       ------- use `&mut String` here to make mutable
-25 |         a.push_str("foo");
+25 |         a.push_str("foo"); //~ ERROR cannot borrow immutable borrowed content
    |         ^ cannot borrow as mutable
 
 error: aborting due to 3 previous errors
index 8e968d90a2f65750aeb87e9a8551653334cf630f..135b577d7f785dd1b8d00e0059bea07265f95c8f 100644 (file)
@@ -15,6 +15,6 @@ fn main() {
     let p;
     {
         let b = m.borrow();
-        p = &*b; //~ ERROR `b` does not live long enough
-    }
+        p = &*b;
+    } //~ ERROR `b` does not live long enough
 }
index 007a9fad83073ffe808f679460ec3b75d8e659d2..d9f5736061a357fb26e08cd3d2fd10fc31f55b13 100644 (file)
@@ -1,9 +1,9 @@
 error[E0597]: `b` does not live long enough
   --> $DIR/mut-ptr-cant-outlive-ref.rs:19:5
    |
-18 |         p = &*b; //~ ERROR `b` does not live long enough
+18 |         p = &*b;
    |               - borrow occurs here
-19 |     }
+19 |     } //~ ERROR `b` does not live long enough
    |     ^ `b` dropped here while still borrowed
 20 | }
    | - borrowed value needs to live until here
index 3d45a94d531c178c80f460052106fbb99aa0e41f..ad6409f014ad1202b81a3bb31d66238421c634d0 100644 (file)
@@ -8,6 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::bar::{foo1, foo2};
+use std::bar::{foo1, foo2}; //~ ERROR unresolved import
 
 fn main() {}
index 93339576f49043a3eff3ed62252e1f87fb65b566..74f5dac493772ef65af73db047268cf368b23892 100644 (file)
@@ -1,7 +1,7 @@
 error[E0432]: unresolved import `std::bar`
   --> $DIR/non-existing-module-import.rs:11:10
    |
-11 | use std::bar::{foo1, foo2};
+11 | use std::bar::{foo1, foo2}; //~ ERROR unresolved import
    |          ^^^ Could not find `bar` in `std`
 
 error: aborting due to previous error
index 54cb0b59c75c3450f3979d7cb5dbb27b2a1e0d3d..11af361e8a846272db9c348339494aebc619a6ff 100644 (file)
@@ -13,8 +13,8 @@
 
 struct Foo {
     bar: u8,
-    pub bar: u8,
-    pub(crate) bar: u8,
+    pub bar: u8, //~ ERROR is already declared
+    pub(crate) bar: u8, //~ ERROR is already declared
 }
 
 fn main() {}
index c66361c8546b839046fb47b9fcf2556eeba2c395..5b303758d2bacf25226fdbfc9230d5404c4bcecb 100644 (file)
@@ -3,7 +3,7 @@ error[E0124]: field `bar` is already declared
    |
 15 |     bar: u8,
    |     ------- `bar` first declared here
-16 |     pub bar: u8,
+16 |     pub bar: u8, //~ ERROR is already declared
    |     ^^^^^^^^^^^ field already declared
 
 error[E0124]: field `bar` is already declared
@@ -11,8 +11,8 @@ error[E0124]: field `bar` is already declared
    |
 15 |     bar: u8,
    |     ------- `bar` first declared here
-16 |     pub bar: u8,
-17 |     pub(crate) bar: u8,
+16 |     pub bar: u8, //~ ERROR is already declared
+17 |     pub(crate) bar: u8, //~ ERROR is already declared
    |     ^^^^^^^^^^^^^^^^^^ field already declared
 
 error: aborting due to 2 previous errors
index 94967693ecf912d65d9c9db1b00b83bf83202d4c..589f7182129d8fc2cbbfc3a12ac0478899d051d9 100644 (file)
@@ -15,7 +15,7 @@ pub fn main() {
         let a = 42;
         let b = 42;
         &a..&b
-        //~^ ERROR `a` does not live long enough
-        //~^^ ERROR `b` does not live long enough
     };
+    //~^ ERROR `a` does not live long enough
+    //~^^ ERROR `b` does not live long enough
 }
index 285ab4aee4bc473853c03acae85bbb3073e3581a..80d364cd8be4b5763bd2af57eaa8b86321b7a915 100644 (file)
@@ -1,22 +1,22 @@
 error[E0597]: `a` does not live long enough
-  --> $DIR/range-2.rs:20:5
+  --> $DIR/range-2.rs:18:5
    |
 17 |         &a..&b
    |          - borrow occurs here
-...
-20 |     };
+18 |     };
    |     ^ `a` dropped here while still borrowed
+...
 21 | }
    | - borrowed value needs to live until here
 
 error[E0597]: `b` does not live long enough
-  --> $DIR/range-2.rs:20:5
+  --> $DIR/range-2.rs:18:5
    |
 17 |         &a..&b
    |              - borrow occurs here
-...
-20 |     };
+18 |     };
    |     ^ `b` dropped here while still borrowed
+...
 21 | }
    | - borrowed value needs to live until here
 
index 6fef4d30f7a77cc21070848c97d0cd44ffb4450f..764b5392578b8cdb6bcff7bccfb485f3ea42ff92 100644 (file)
 
 use std::rc::Rc;
 
-struct Foo<'a> {
+struct Foo<'a> { //~ ERROR recursive type
     bar: Bar<'a>,
     b: Rc<Bar<'a>>,
 }
 
-struct Bar<'a> {
+struct Bar<'a> { //~ ERROR recursive type
     y: (Foo<'a>, Foo<'a>),
     z: Option<Bar<'a>>,
     a: &'a Foo<'a>,
index b4d0b5a6a25d03557028beec40e27409ccb2b19e..bd9f5f032ef37666e4743d72900067f9410265b6 100644 (file)
@@ -1,7 +1,7 @@
 error[E0072]: recursive type `Foo` has infinite size
   --> $DIR/recursive-type-field.rs:13:1
    |
-13 | struct Foo<'a> {
+13 | struct Foo<'a> { //~ ERROR recursive type
    | ^^^^^^^^^^^^^^ recursive type has infinite size
 14 |     bar: Bar<'a>,
    |     ------------ recursive without indirection
@@ -11,7 +11,7 @@ error[E0072]: recursive type `Foo` has infinite size
 error[E0072]: recursive type `Bar` has infinite size
   --> $DIR/recursive-type-field.rs:18:1
    |
-18 | struct Bar<'a> {
+18 | struct Bar<'a> { //~ ERROR recursive type
    | ^^^^^^^^^^^^^^ recursive type has infinite size
 19 |     y: (Foo<'a>, Foo<'a>),
    |     --------------------- recursive without indirection
index 8ec6036762f4886b74a90adfac129eb7ec35e533..74a6a2960c947a42be0c104fd8aee3b9593e6482 100644 (file)
@@ -14,7 +14,7 @@ fn main() {
     let mut f;
     {
         let c = 1;
-        let c_ref = &c; //~ ERROR `c` does not live long enough
+        let c_ref = &c;
         f = move |a: isize, b: isize| { a + b + *c_ref };
-    }
+    } //~ ERROR `c` does not live long enough
 }
index 29848412e4e7740bbcaac82448e6d4ef6a1c42dd..acd995c6bb86fefcead2599d9290d2abc91068a8 100644 (file)
@@ -1,10 +1,10 @@
 error[E0597]: `c` does not live long enough
   --> $DIR/regionck-unboxed-closure-lifetimes.rs:19:5
    |
-17 |         let c_ref = &c; //~ ERROR `c` does not live long enough
+17 |         let c_ref = &c;
    |                      - borrow occurs here
 18 |         f = move |a: isize, b: isize| { a + b + *c_ref };
-19 |     }
+19 |     } //~ ERROR `c` does not live long enough
    |     ^ `c` dropped here while still borrowed
 20 | }
    | - borrowed value needs to live until here
index 99b0d6ed2964c10eccc696fcde8e955226da5512..5449bbfdce3a3bec89c6f720fb1074119d9ed99e 100644 (file)
@@ -21,5 +21,5 @@ fn main() {
     {
         let ss: &isize = &id(1);
         blah = box ss as Box<Foo>;
-    }
+    } //~ ERROR does not live long enough
 }
index 6a3625441b49edbf0058462ddae91e4d48e69e1f..69bdde889166fc4769b3b01869023df0ad5472c8 100644 (file)
@@ -4,7 +4,7 @@ error[E0597]: borrowed value does not live long enough
 22 |         let ss: &isize = &id(1);
    |                           ----- temporary value created here
 23 |         blah = box ss as Box<Foo>;
-24 |     }
+24 |     } //~ ERROR does not live long enough
    |     ^ temporary value dropped here while still borrowed
 25 | }
    | - temporary value needs to live until here
index 053af49e0684b8b938d2d58a24d09f8b41dd2a38..cd838db92e1888e1134ea52dc8ed940a5986cab2 100644 (file)
@@ -30,7 +30,7 @@ fn main() {
 
     let _ = {
         let tmp0 = 3;
-        let tmp1 = &tmp0; //~ ERROR `tmp0` does not live long enough
+        let tmp1 = &tmp0;
         repeater3(tmp1)
-    };
+    }; //~ ERROR `tmp0` does not live long enough
 }
index a89127b1436c57a187a96d69eb051a28ed2b0f6b..a7f79f8b26528ce45c5733f84a2cff909a851a61 100644 (file)
@@ -1,10 +1,10 @@
 error[E0597]: `tmp0` does not live long enough
   --> $DIR/regions-close-over-type-parameter-2.rs:35:5
    |
-33 |         let tmp1 = &tmp0; //~ ERROR `tmp0` does not live long enough
+33 |         let tmp1 = &tmp0;
    |                     ---- borrow occurs here
 34 |         repeater3(tmp1)
-35 |     };
+35 |     }; //~ ERROR `tmp0` does not live long enough
    |     ^- borrowed value needs to live until here
    |     |
    |     `tmp0` dropped here while still borrowed
index f588655d1afa85af5b19e7fc1af8c8a46594d233..1dc1ae6071578f5159463f8f6ab6d5725207b4b5 100644 (file)
@@ -18,6 +18,6 @@ fn main() {
 
     loop {
         let x = 1 + *p;
-        p = &x; //~ ERROR `x` does not live long enough
-    }
+        p = &x;
+    } //~ ERROR `x` does not live long enough
 }
index cfdd1c8b1539d4205c2e77d11795aa53fc1767cd..554ffe91e6d1ff8db7852a533f5170daa54ba8c4 100644 (file)
@@ -1,9 +1,9 @@
 error[E0597]: `x` does not live long enough
   --> $DIR/regions-escape-loop-via-variable.rs:22:5
    |
-21 |         p = &x; //~ ERROR `x` does not live long enough
+21 |         p = &x;
    |              - borrow occurs here
-22 |     }
+22 |     } //~ ERROR `x` does not live long enough
    |     ^ `x` dropped here while still borrowed
 23 | }
    | - borrowed value needs to live until here
index 8982b5cd98de49a9ed40dfae2311c5785eef60d7..7c4834751d899e04589e27a501e78a37ee2dd1e9 100644 (file)
@@ -19,12 +19,11 @@ fn broken() {
         //~^ NOTE use of borrowed `x`
         let mut z = x; //~ ERROR cannot use `x` because it was mutably borrowed
         //~^ NOTE use of borrowed `x`
-        _y.push(&mut z); //~ ERROR `z` does not live long enough
-        //~^ NOTE does not live long enough
+        _y.push(&mut z); //~ NOTE borrow occurs here
         x += 1; //~ ERROR cannot assign
         //~^ NOTE assignment to borrowed `x` occurs here
-    }
-    //~^ NOTE borrowed value only lives until here
+    } //~ NOTE `z` dropped here while still borrowed
+    //~^ ERROR `z` does not live long enough
 }
 //~^ NOTE borrowed value needs to live until here
 
index b61df82e8a14f1db996497c321757825f3e2d140..a7224fcd4cc8c4422e7d813bc82769ff27a59df4 100644 (file)
@@ -1,13 +1,13 @@
 error[E0597]: `z` does not live long enough
-  --> $DIR/regions-escape-loop-via-vec.rs:26:5
+  --> $DIR/regions-escape-loop-via-vec.rs:25:5
    |
-22 |         _y.push(&mut z); //~ ERROR `z` does not live long enough
+22 |         _y.push(&mut z); //~ NOTE borrow occurs here
    |                      - borrow occurs here
 ...
-26 |     }
+25 |     } //~ NOTE `z` dropped here while still borrowed
    |     ^ `z` dropped here while still borrowed
-27 |     //~^ NOTE borrowed value only lives until here
-28 | }
+26 |     //~^ ERROR `z` does not live long enough
+27 | }
    | - borrowed value needs to live until here
 
 error[E0503]: cannot use `x` because it was mutably borrowed
@@ -29,12 +29,12 @@ error[E0503]: cannot use `x` because it was mutably borrowed
    |             ^^^^^ use of borrowed `x`
 
 error[E0506]: cannot assign to `x` because it is borrowed
-  --> $DIR/regions-escape-loop-via-vec.rs:24:9
+  --> $DIR/regions-escape-loop-via-vec.rs:23:9
    |
 14 |     let mut _y = vec![&mut x];
    |                            - borrow of `x` occurs here
 ...
-24 |         x += 1; //~ ERROR cannot assign
+23 |         x += 1; //~ ERROR cannot assign
    |         ^^^^^^ assignment to borrowed `x` occurs here
 
 error: aborting due to 4 previous errors
index a05658e9e581db90f01f45d2f4ffbd5c5baa5142..3bb069813a29f579605654fef94af8f100a86ece 100644 (file)
@@ -21,11 +21,11 @@ fn foo<C, M>(mut cond: C, mut make_box: M) where
 
         // Here we complain because the resulting region
         // of this borrow is the fn body as a whole.
-        y = borrow(&*x); //~ ERROR `*x` does not live long enough
+        y = borrow(&*x);
 
         assert_eq!(*x, *y);
         if cond() { break; }
-    }
+    } //~ ERROR `*x` does not live long enough
     assert!(*y != 0);
 }
 
index 0960f5e1b25669621049f73a197e6da9cc243b03..4a44a3a68137998bf711ba921eb9d5498b5bf8e1 100644 (file)
@@ -1,10 +1,10 @@
 error[E0597]: `*x` does not live long enough
   --> $DIR/regions-infer-borrow-scope-within-loop.rs:28:5
    |
-24 |         y = borrow(&*x); //~ ERROR `*x` does not live long enough
+24 |         y = borrow(&*x);
    |                     -- borrow occurs here
 ...
-28 |     }
+28 |     } //~ ERROR `*x` does not live long enough
    |     ^ `*x` dropped here while still borrowed
 29 |     assert!(*y != 0);
 30 | }
index 1b7718d2283a7bfd6a617c112f8a5d19bdd209a6..d294840bdfb33f0a3410653ebe1bd3f509bfcace 100644 (file)
@@ -23,13 +23,13 @@ fn join(self) {}
 fn main() {
     let bad = {
         let x = 1;
-        let y = &x; //~ ERROR `x` does not live long enough
+        let y = &x;
 
         scoped(|| {
             let _z = y;
             //~^ ERROR `y` does not live long enough
         })
-    };
+    }; //~ ERROR `x` does not live long enough
 
     bad.join();
 }
index 02fc9820495a983d05d813e3d8b61dfc33fad926..cc12b2c1ee2b2a8ac9289a26ce07c361af2c7255 100644 (file)
@@ -1,10 +1,10 @@
 error[E0597]: `x` does not live long enough
   --> $DIR/send-is-not-static-ensures-scoping.rs:32:5
    |
-26 |         let y = &x; //~ ERROR `x` does not live long enough
+26 |         let y = &x;
    |                  - borrow occurs here
 ...
-32 |     };
+32 |     }; //~ ERROR `x` does not live long enough
    |     ^ `x` dropped here while still borrowed
 ...
 35 | }
@@ -18,7 +18,7 @@ error[E0597]: `y` does not live long enough
 29 |             let _z = y;
    |                      ^ does not live long enough
 ...
-32 |     };
+32 |     }; //~ ERROR `x` does not live long enough
    |     - borrowed value only lives until here
 ...
 35 | }
index d9d3706586ba9e3c17615b0bc141140b8ed54043..762eeffaa6af4a6c711c3b94e79a621602989990 100644 (file)
@@ -18,8 +18,8 @@
 fn mutex() {
     let lock = {
         let x = 1;
-        Mutex::new(&x) //~ ERROR does not live long enough
-    };
+        Mutex::new(&x)
+    }; //~ ERROR does not live long enough
 
     let _dangling = *lock.lock().unwrap();
 }
@@ -27,8 +27,8 @@ fn mutex() {
 fn rwlock() {
     let lock = {
         let x = 1;
-        RwLock::new(&x) //~ ERROR does not live long enough
-    };
+        RwLock::new(&x)
+    }; //~ ERROR does not live long enough
     let _dangling = *lock.read().unwrap();
 }
 
@@ -36,9 +36,9 @@ fn channel() {
     let (_tx, rx) = {
         let x = 1;
         let (tx, rx) = mpsc::channel();
-        let _ = tx.send(&x); //~ ERROR does not live long enough
+        let _ = tx.send(&x);
         (tx, rx)
-    };
+    }; //~ ERROR does not live long enough
 
     let _dangling = rx.recv();
 }
index 318dab599f5a3f910846d4a826954a7b73337197..beee85c8b1d9ad602ea8a4f168f7fd26b3de3523 100644 (file)
@@ -1,9 +1,9 @@
 error[E0597]: `x` does not live long enough
   --> $DIR/send-is-not-static-std-sync-2.rs:22:5
    |
-21 |         Mutex::new(&x) //~ ERROR does not live long enough
+21 |         Mutex::new(&x)
    |                     - borrow occurs here
-22 |     };
+22 |     }; //~ ERROR does not live long enough
    |     ^ `x` dropped here while still borrowed
 ...
 25 | }
@@ -12,9 +12,9 @@ error[E0597]: `x` does not live long enough
 error[E0597]: `x` does not live long enough
   --> $DIR/send-is-not-static-std-sync-2.rs:31:5
    |
-30 |         RwLock::new(&x) //~ ERROR does not live long enough
+30 |         RwLock::new(&x)
    |                      - borrow occurs here
-31 |     };
+31 |     }; //~ ERROR does not live long enough
    |     ^ `x` dropped here while still borrowed
 32 |     let _dangling = *lock.read().unwrap();
 33 | }
@@ -23,10 +23,10 @@ error[E0597]: `x` does not live long enough
 error[E0597]: `x` does not live long enough
   --> $DIR/send-is-not-static-std-sync-2.rs:41:5
    |
-39 |         let _ = tx.send(&x); //~ ERROR does not live long enough
+39 |         let _ = tx.send(&x);
    |                          - borrow occurs here
 40 |         (tx, rx)
-41 |     };
+41 |     }; //~ ERROR does not live long enough
    |     ^ `x` dropped here while still borrowed
 ...
 44 | }
index 8ec2fe8a1ec897492a55a85a76e08a80609428e6..05cb962755801f1dd3ed82d742c05ec08747015f 100644 (file)
@@ -23,8 +23,8 @@ fn mutex() {
     drop(y); //~ ERROR cannot move out
     {
         let z = 2;
-        *lock.lock().unwrap() = &z; //~ ERROR does not live long enough
-    }
+        *lock.lock().unwrap() = &z;
+    } //~ ERROR does not live long enough
 }
 
 fn rwlock() {
@@ -35,8 +35,8 @@ fn rwlock() {
     drop(y); //~ ERROR cannot move out
     {
         let z = 2;
-        *lock.write().unwrap() = &z; //~ ERROR does not live long enough
-    }
+        *lock.write().unwrap() = &z;
+    } //~ ERROR does not live long enough
 }
 
 fn channel() {
@@ -49,8 +49,8 @@ fn channel() {
     drop(y); //~ ERROR cannot move out
     {
         let z = 2;
-        tx.send(&z).unwrap(); //~ ERROR does not live long enough
-    }
+        tx.send(&z).unwrap();
+    } //~ ERROR does not live long enough
 }
 
 fn main() {}
index 988ff228105de907bf2c7c77d7489a500d7c94eb..e078e4e14a5ca3b5d2b56d81899d1fad4a766f88 100644 (file)
@@ -1,9 +1,9 @@
 error[E0597]: `z` does not live long enough
   --> $DIR/send-is-not-static-std-sync.rs:27:5
    |
-26 |         *lock.lock().unwrap() = &z; //~ ERROR does not live long enough
+26 |         *lock.lock().unwrap() = &z;
    |                                  - borrow occurs here
-27 |     }
+27 |     } //~ ERROR does not live long enough
    |     ^ `z` dropped here while still borrowed
 28 | }
    | - borrowed value needs to live until here
@@ -19,9 +19,9 @@ error[E0505]: cannot move out of `y` because it is borrowed
 error[E0597]: `z` does not live long enough
   --> $DIR/send-is-not-static-std-sync.rs:39:5
    |
-38 |         *lock.write().unwrap() = &z; //~ ERROR does not live long enough
+38 |         *lock.write().unwrap() = &z;
    |                                   - borrow occurs here
-39 |     }
+39 |     } //~ ERROR does not live long enough
    |     ^ `z` dropped here while still borrowed
 40 | }
    | - borrowed value needs to live until here
@@ -37,9 +37,9 @@ error[E0505]: cannot move out of `y` because it is borrowed
 error[E0597]: `z` does not live long enough
   --> $DIR/send-is-not-static-std-sync.rs:53:5
    |
-52 |         tx.send(&z).unwrap(); //~ ERROR does not live long enough
+52 |         tx.send(&z).unwrap();
    |                  - borrow occurs here
-53 |     }
+53 |     } //~ ERROR does not live long enough
    |     ^ `z` dropped here while still borrowed
 54 | }
    | - borrowed value needs to live until here
index 1b022f23246628d56f27037501a2c37c6f5c0192..6bb98c34b7e6faafcd6d15810b3267c6e287f8f5 100644 (file)
@@ -15,5 +15,5 @@ fn main() {
     {
         let x: &[isize] = &vec![1, 2, 3, 4, 5];
         y = &x[1..];
-    }
+    } //~ ERROR does not live long enough
 }
index f9dbddd226f099adc456d6e2b147f6531cbafd34..d1e5cf62a028967278ab64492aaa88491cecc0b0 100644 (file)
@@ -4,7 +4,7 @@ error[E0597]: borrowed value does not live long enough
 16 |         let x: &[isize] = &vec![1, 2, 3, 4, 5];
    |                            ------------------- temporary value created here
 17 |         y = &x[1..];
-18 |     }
+18 |     } //~ ERROR does not live long enough
    |     ^ temporary value dropped here while still borrowed
 19 | }
    | - temporary value needs to live until here
index 67dbe1dc7b5668fbeb8d389e57a5d970d536891f..2d82bba33c5bdad2473a060501c98fddf4c1e16d 100644 (file)
@@ -11,6 +11,6 @@
 
 fn main() {
     let tup = (1,);
-    println!("☃{}", tup[0]);
+    println!("☃{}", tup[0]); //~ ERROR cannot index into a value of type
 }
 
index c67a8fe32b9ddd8faed450a7e570a13d1d4471ad..9ee8ccb01d0f114575633b4331762b197f204501 100644 (file)
@@ -1,7 +1,7 @@
 error[E0608]: cannot index into a value of type `({integer},)`
   --> $DIR/suggestion-non-ascii.rs:14:21
    |
-14 |     println!("☃{}", tup[0]);
+14 |     println!("☃{}", tup[0]); //~ ERROR cannot index into a value of type
    |                     ^^^^^^ help: to access tuple elements, use: `tup.0`
 
 error: aborting due to previous error
index 05285c732f41430436a2a406a3c3889d8f2d0d55..d8a2e332a030f74d2a23543c74ba1c3ff4c96961 100644 (file)
@@ -14,5 +14,6 @@
 use std::ops::Deref;
 
 fn homura<T: Deref<Trget = i32>>(_: T) {}
+//~^ ERROR not found
 
 fn main() {}
index 536bf16142b3072318773f2868c625003b1dc695..7aeaa44bec2823db6b58cd01a085bca332333004 100644 (file)
@@ -12,8 +12,8 @@ fn main() {
     let foo = 1;
 
     // `foo` shouldn't be suggested, it is too dissimilar from `bar`.
-    println!("Hello {}", bar);
+    println!("Hello {}", bar); //~ ERROR cannot find value
 
     // But this is close enough.
-    println!("Hello {}", fob);
+    println!("Hello {}", fob); //~ ERROR cannot find value
 }
index dca0a93f897baaa42de4d950161856983dd49876..2a084b1ae67ff5ae159aefd661a1abceb419a7bb 100644 (file)
@@ -1,13 +1,13 @@
 error[E0425]: cannot find value `bar` in this scope
   --> $DIR/typo-suggestion.rs:15:26
    |
-15 |     println!("Hello {}", bar);
+15 |     println!("Hello {}", bar); //~ ERROR cannot find value
    |                          ^^^ not found in this scope
 
 error[E0425]: cannot find value `fob` in this scope
   --> $DIR/typo-suggestion.rs:18:26
    |
-18 |     println!("Hello {}", fob);
+18 |     println!("Hello {}", fob); //~ ERROR cannot find value
    |                          ^^^ did you mean `foo`?
 
 error: aborting due to 2 previous errors
index eb659d08da0c9fa83d905490d7b7eceaacae4906..6a7071d49aed6d164c177fc13610a20d52f9c89a 100644 (file)
 
 #![warn(unused)]
 
-enum Enum {
+enum Enum { //~ WARN enum is never used
     A,
     B,
     C,
     D,
 }
 
-struct Struct {
+struct Struct { //~ WARN struct is never used
     a: usize,
     b: usize,
     c: usize,
     d: usize,
 }
 
-fn func() -> usize {
+fn func() -> usize { //~ WARN function is never used
     3
 }
 
-fn
+fn //~ WARN function is never used
 func_complete_span()
 -> usize
 {
index 8e658670e9c0c9b14af5706a97f638f7a18d3a68..ed36bd1780178f98f77f8a22927fd19d4e64522c 100644 (file)
@@ -1,7 +1,7 @@
 warning: enum is never used: `Enum`
   --> $DIR/unused-warning-point-at-signature.rs:15:1
    |
-15 | enum Enum {
+15 | enum Enum { //~ WARN enum is never used
    | ^^^^^^^^^
    |
 note: lint level defined here
@@ -14,19 +14,19 @@ note: lint level defined here
 warning: struct is never used: `Struct`
   --> $DIR/unused-warning-point-at-signature.rs:22:1
    |
-22 | struct Struct {
+22 | struct Struct { //~ WARN struct is never used
    | ^^^^^^^^^^^^^
 
 warning: function is never used: `func`
   --> $DIR/unused-warning-point-at-signature.rs:29:1
    |
-29 | fn func() -> usize {
+29 | fn func() -> usize { //~ WARN function is never used
    | ^^^^^^^^^^^^^^^^^^
 
 warning: function is never used: `func_complete_span`
   --> $DIR/unused-warning-point-at-signature.rs:33:1
    |
-33 | / fn
+33 | / fn //~ WARN function is never used
 34 | | func_complete_span()
 35 | | -> usize
 36 | | {
index 2a4a5edd04c0849d1c0a898ecc961cf85b8177ec..5df28971e99428cb71800e5aa040ccc8cbc85e42 100644 (file)
@@ -14,7 +14,6 @@ macro_rules! m {
 
 struct S<T>(T);
 m!{ S<u8> } //~ ERROR unexpected generic arguments in path
-//~^ ERROR expected module, found struct `S`
 
 mod m {
     m!{ m<> } //~ ERROR unexpected generic arguments in path
index 673b9a38e035f3cdf19ed59eba19ade5dc311401..8460f81af8335dca209cdbde833207741c2f51f9 100644 (file)
@@ -5,9 +5,9 @@ error: unexpected generic arguments in path
    |     ^^^^^
 
 error: unexpected generic arguments in path
-  --> $DIR/visibility-ty-params.rs:20:9
+  --> $DIR/visibility-ty-params.rs:19:9
    |
-20 |     m!{ m<> } //~ ERROR unexpected generic arguments in path
+19 |     m!{ m<> } //~ ERROR unexpected generic arguments in path
    |         ^^^
 
 error: aborting due to 2 previous errors
index b9d292fd1568552dcea5450360e00cbc213283c7..ce5ec63fbd10d09c3a8c332c53f98ca5563e15ad 100644 (file)
@@ -27,7 +27,7 @@ fn main() {
     let f2 = f;
     let dangling = {
         let pointer = Box::new(42);
-        f2.xmute(&pointer) //~ ERROR `pointer` does not live long enough
-    };
+        f2.xmute(&pointer)
+    }; //~ ERROR `pointer` does not live long enough
     println!("{}", dangling);
 }
index a37b5d17aac98f244dbea5484746a9ced3e4b3d6..a3fdc53b8e54f44d673d33aeb05d8c5dff51a261 100644 (file)
@@ -1,9 +1,9 @@
 error[E0597]: `pointer` does not live long enough
   --> $DIR/wf-method-late-bound-regions.rs:31:5
    |
-30 |         f2.xmute(&pointer) //~ ERROR `pointer` does not live long enough
+30 |         f2.xmute(&pointer)
    |                   ------- borrow occurs here
-31 |     };
+31 |     }; //~ ERROR `pointer` does not live long enough
    |     ^ `pointer` dropped here while still borrowed
 32 |     println!("{}", dangling);
 33 | }
index 7b1887b2d1a29b4bc4d41840e73df94abbc5621d..62abf11654edfa0c6c3184062cc92d130be29fa5 100644 (file)
@@ -10,7 +10,7 @@
 
 pub trait Arbitrary: Sized + 'static {}
 
-impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
+impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {} //~ ERROR lifetime bound
 
 fn main() {
-}
\ No newline at end of file
+}
index adeabd91302ce9e6925b1d95e4c5f800337f5cd9..a99dbf21e54e20e27c903da045de13d8de243094 100644 (file)
@@ -1,13 +1,13 @@
 error[E0478]: lifetime bound not satisfied
   --> $DIR/static-lifetime.rs:13:20
    |
-13 | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
+13 | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {} //~ ERROR lifetime bound
    |                    ^^^^^^^^^
    |
 note: lifetime parameter instantiated with the lifetime 'a as defined on the impl at 13:1
   --> $DIR/static-lifetime.rs:13:1
    |
-13 | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
+13 | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {} //~ ERROR lifetime bound
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: but lifetime parameter must outlive the static lifetime
 
index 0fd7d3a9d869e82757f7c0d6af98719219862cf8..4a062f78a327d416d3a7ca35872780cd417c1546 100644 (file)
@@ -10,7 +10,7 @@
 
 
 fn main() {
-    let x: &[u8] = "foo";
-    let y: &[u8; 4] = "baaa";
-    let z: &str = b"foo";
+    let x: &[u8] = "foo"; //~ ERROR mismatched types
+    let y: &[u8; 4] = "baaa"; //~ ERROR mismatched types
+    let z: &str = b"foo"; //~ ERROR mismatched types
 }
index 47418522df8ac611c92edc119db7fbcc3da7344f..bf7646d81eb1d7ee54c25c0d9b52c505fc858a43 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/str-lit-type-mismatch.rs:13:20
    |
-13 |     let x: &[u8] = "foo";
+13 |     let x: &[u8] = "foo"; //~ ERROR mismatched types
    |                    ^^^^^ expected slice, found str
    |
    = note: expected type `&[u8]`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
 error[E0308]: mismatched types
   --> $DIR/str-lit-type-mismatch.rs:14:23
    |
-14 |     let y: &[u8; 4] = "baaa";
+14 |     let y: &[u8; 4] = "baaa"; //~ ERROR mismatched types
    |                       ^^^^^^ expected array of 4 elements, found str
    |
    = note: expected type `&[u8; 4]`
@@ -21,7 +21,7 @@ error[E0308]: mismatched types
 error[E0308]: mismatched types
   --> $DIR/str-lit-type-mismatch.rs:15:19
    |
-15 |     let z: &str = b"foo";
+15 |     let z: &str = b"foo"; //~ ERROR mismatched types
    |                   ^^^^^^ expected str, found array of 3 elements
    |
    = note: expected type `&str`
index 8ea62fef9fad193bc7013e50b4febbff7841245f..f1e24495f844fd1d44e1a7c69b3bf05ff7835711 100644 (file)
@@ -16,12 +16,12 @@ fn main() {
     let foo = Foo {
         one: 111,
         ..Foo::default(),
-        //~^ ERROR cannot use a comma after struct expansion
+        //~^ ERROR cannot use a comma after the base struct
     };
 
     let foo = Foo {
         ..Foo::default(),
-        //~^ ERROR cannot use a comma after struct expansion
+        //~^ ERROR cannot use a comma after the base struct
         one: 111,
     };
 }
index fe8e2bc6c8ed10046f0f45891af5dec585c8e67f..1d14afd6a01acb6a893d4e23b1d72147f63407c0 100644 (file)
@@ -16,5 +16,5 @@ fn foo(mut f: Box<FnMut()>) {
 
 fn main() {
     let y = true;
-    foo(Box::new(move || y = false) as Box<_>);
+    foo(Box::new(move || y = false) as Box<_>); //~ ERROR cannot assign to captured outer variable
 }
index 19f1cd071714e57961f072993083e4deb6669be9..f272a3582c61986d637a990cf8c84b61636d80b3 100644 (file)
@@ -3,7 +3,7 @@ error[E0594]: cannot assign to captured outer variable in an `FnMut` closure
    |
 18 |     let y = true;
    |         - help: consider making `y` mutable: `mut y`
-19 |     foo(Box::new(move || y = false) as Box<_>);
+19 |     foo(Box::new(move || y = false) as Box<_>); //~ ERROR cannot assign to captured outer variable
    |                          ^^^^^^^^^
 
 error: aborting due to previous error
index fc3c58e5223a3921ff2c97034b06e1807dd150bd..6e0f9999ec1d2b5ac5fc93970508bafb29173af2 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-struct Obj<F> where F: FnMut() -> u32 {
+struct Obj<F> where F: FnMut() -> u32 { //~ NOTE not found for this
     closure: F,
 }
 
index bbe8fe7345aa021f59708808312c0a6c41157f8e..62dceceedf388a73b70425ec8d8e6b054d246520 100644 (file)
@@ -1,7 +1,7 @@
 error[E0599]: no method named `closure` found for type `Obj<[closure@$DIR/issue-18343.rs:16:28: 16:33]>` in the current scope
   --> $DIR/issue-18343.rs:17:7
    |
-11 | struct Obj<F> where F: FnMut() -> u32 {
+11 | struct Obj<F> where F: FnMut() -> u32 { //~ NOTE not found for this
    | ------------------------------------- method `closure` not found for this
 ...
 17 |     o.closure();
index f84f35ce84bf9e8f04446b7f07a7e0f03890af2f..cba0ecbf58ec6dda69e0c2c39f33977351dc8b8d 100644 (file)
@@ -13,6 +13,9 @@
 use std::boxed::FnBox;
 
 struct FuncContainer {
+//~^ NOTE not found for this
+//~| NOTE not found for this
+//~| NOTE not found for this
     f1: fn(data: u8),
     f2: extern "C" fn(data: u8),
     f3: unsafe fn(data: u8),
@@ -23,11 +26,19 @@ struct FuncContainerOuter {
 }
 
 struct Obj<F> where F: FnOnce() -> u32 {
+//~^ NOTE not found for this
+//~| NOTE not found for this
+//~| NOTE not found for this
+//~| NOTE not found for this
+//~| NOTE not found for this
+//~| NOTE not found for this
     closure: F,
     not_closure: usize,
 }
 
 struct BoxedObj {
+//~^ NOTE not found for this
+//~| NOTE not found for this
     boxed_closure: Box<FnBox() -> u32>,
 }
 
index a9211e1864e3b2df523d04f79b43a22af49bf3c0..b4086b1602701a5d75d26fbf1917592d7babe4d3 100644 (file)
-error[E0599]: no method named `closure` found for type `Obj<[closure@$DIR/issue-2392.rs:49:36: 49:41]>` in the current scope
-  --> $DIR/issue-2392.rs:50:15
+error[E0599]: no method named `closure` found for type `Obj<[closure@$DIR/issue-2392.rs:60:36: 60:41]>` in the current scope
+  --> $DIR/issue-2392.rs:61:15
    |
-25 | struct Obj<F> where F: FnOnce() -> u32 {
+28 | struct Obj<F> where F: FnOnce() -> u32 {
    | -------------------------------------- method `closure` not found for this
 ...
-50 |     o_closure.closure(); //~ ERROR no method named `closure` found
+61 |     o_closure.closure(); //~ ERROR no method named `closure` found
    |               ^^^^^^^ field, not a method
    |
    = help: use `(o_closure.closure)(...)` if you meant to call the function stored in the `closure` field
 
-error[E0599]: no method named `not_closure` found for type `Obj<[closure@$DIR/issue-2392.rs:49:36: 49:41]>` in the current scope
-  --> $DIR/issue-2392.rs:54:15
+error[E0599]: no method named `not_closure` found for type `Obj<[closure@$DIR/issue-2392.rs:60:36: 60:41]>` in the current scope
+  --> $DIR/issue-2392.rs:65:15
    |
-25 | struct Obj<F> where F: FnOnce() -> u32 {
+28 | struct Obj<F> where F: FnOnce() -> u32 {
    | -------------------------------------- method `not_closure` not found for this
 ...
-54 |     o_closure.not_closure();
+65 |     o_closure.not_closure();
    |               ^^^^^^^^^^^ field, not a method
    |
    = help: did you mean to write `o_closure.not_closure` instead of `o_closure.not_closure(...)`?
 
 error[E0599]: no method named `closure` found for type `Obj<fn() -> u32 {func}>` in the current scope
-  --> $DIR/issue-2392.rs:60:12
+  --> $DIR/issue-2392.rs:71:12
    |
-25 | struct Obj<F> where F: FnOnce() -> u32 {
+28 | struct Obj<F> where F: FnOnce() -> u32 {
    | -------------------------------------- method `closure` not found for this
 ...
-60 |     o_func.closure(); //~ ERROR no method named `closure` found
+71 |     o_func.closure(); //~ ERROR no method named `closure` found
    |            ^^^^^^^ field, not a method
    |
    = help: use `(o_func.closure)(...)` if you meant to call the function stored in the `closure` field
 
 error[E0599]: no method named `boxed_closure` found for type `BoxedObj` in the current scope
-  --> $DIR/issue-2392.rs:65:14
+  --> $DIR/issue-2392.rs:76:14
    |
-30 | struct BoxedObj {
+39 | struct BoxedObj {
    | --------------- method `boxed_closure` not found for this
 ...
-65 |     boxed_fn.boxed_closure();//~ ERROR no method named `boxed_closure` found
+76 |     boxed_fn.boxed_closure();//~ ERROR no method named `boxed_closure` found
    |              ^^^^^^^^^^^^^ field, not a method
    |
    = help: use `(boxed_fn.boxed_closure)(...)` if you meant to call the function stored in the `boxed_closure` field
 
 error[E0599]: no method named `boxed_closure` found for type `BoxedObj` in the current scope
-  --> $DIR/issue-2392.rs:70:19
+  --> $DIR/issue-2392.rs:81:19
    |
-30 | struct BoxedObj {
+39 | struct BoxedObj {
    | --------------- method `boxed_closure` not found for this
 ...
-70 |     boxed_closure.boxed_closure();//~ ERROR no method named `boxed_closure` found
+81 |     boxed_closure.boxed_closure();//~ ERROR no method named `boxed_closure` found
    |                   ^^^^^^^^^^^^^ field, not a method
    |
    = help: use `(boxed_closure.boxed_closure)(...)` if you meant to call the function stored in the `boxed_closure` field
 
 error[E0599]: no method named `closure` found for type `Obj<fn() -> u32 {func}>` in the current scope
-  --> $DIR/issue-2392.rs:77:12
+  --> $DIR/issue-2392.rs:88:12
    |
-25 | struct Obj<F> where F: FnOnce() -> u32 {
+28 | struct Obj<F> where F: FnOnce() -> u32 {
    | -------------------------------------- method `closure` not found for this
 ...
-77 |     w.wrap.closure();//~ ERROR no method named `closure` found
+88 |     w.wrap.closure();//~ ERROR no method named `closure` found
    |            ^^^^^^^ field, not a method
    |
    = help: use `(w.wrap.closure)(...)` if you meant to call the function stored in the `closure` field
 
 error[E0599]: no method named `not_closure` found for type `Obj<fn() -> u32 {func}>` in the current scope
-  --> $DIR/issue-2392.rs:81:12
+  --> $DIR/issue-2392.rs:92:12
    |
-25 | struct Obj<F> where F: FnOnce() -> u32 {
+28 | struct Obj<F> where F: FnOnce() -> u32 {
    | -------------------------------------- method `not_closure` not found for this
 ...
-81 |     w.wrap.not_closure();
+92 |     w.wrap.not_closure();
    |            ^^^^^^^^^^^ field, not a method
    |
    = help: did you mean to write `w.wrap.not_closure` instead of `w.wrap.not_closure(...)`?
 
 error[E0599]: no method named `closure` found for type `Obj<std::boxed::Box<std::boxed::FnBox<(), Output=u32> + 'static>>` in the current scope
-  --> $DIR/issue-2392.rs:86:24
+  --> $DIR/issue-2392.rs:97:24
    |
-25 | struct Obj<F> where F: FnOnce() -> u32 {
+28 | struct Obj<F> where F: FnOnce() -> u32 {
    | -------------------------------------- method `closure` not found for this
 ...
-86 |     check_expression().closure();//~ ERROR no method named `closure` found
+97 |     check_expression().closure();//~ ERROR no method named `closure` found
    |                        ^^^^^^^ field, not a method
    |
    = help: use `(check_expression().closure)(...)` if you meant to call the function stored in the `closure` field
 
 error[E0599]: no method named `f1` found for type `FuncContainer` in the current scope
-  --> $DIR/issue-2392.rs:94:31
-   |
-15 | struct FuncContainer {
-   | -------------------- method `f1` not found for this
+   --> $DIR/issue-2392.rs:105:31
+    |
+15  | struct FuncContainer {
+    | -------------------- method `f1` not found for this
 ...
-94 |             (*self.container).f1(1); //~ ERROR no method named `f1` found
-   |                               ^^ field, not a method
-   |
-   = help: use `((*self.container).f1)(...)` if you meant to call the function stored in the `f1` field
+105 |             (*self.container).f1(1); //~ ERROR no method named `f1` found
+    |                               ^^ field, not a method
+    |
+    = help: use `((*self.container).f1)(...)` if you meant to call the function stored in the `f1` field
 
 error[E0599]: no method named `f2` found for type `FuncContainer` in the current scope
-  --> $DIR/issue-2392.rs:97:31
-   |
-15 | struct FuncContainer {
-   | -------------------- method `f2` not found for this
+   --> $DIR/issue-2392.rs:108:31
+    |
+15  | struct FuncContainer {
+    | -------------------- method `f2` not found for this
 ...
-97 |             (*self.container).f2(1); //~ ERROR no method named `f2` found
-   |                               ^^ field, not a method
-   |
-   = help: use `((*self.container).f2)(...)` if you meant to call the function stored in the `f2` field
+108 |             (*self.container).f2(1); //~ ERROR no method named `f2` found
+    |                               ^^ field, not a method
+    |
+    = help: use `((*self.container).f2)(...)` if you meant to call the function stored in the `f2` field
 
 error[E0599]: no method named `f3` found for type `FuncContainer` in the current scope
-   --> $DIR/issue-2392.rs:100:31
+   --> $DIR/issue-2392.rs:111:31
     |
 15  | struct FuncContainer {
     | -------------------- method `f3` not found for this
 ...
-100 |             (*self.container).f3(1); //~ ERROR no method named `f3` found
+111 |             (*self.container).f3(1); //~ ERROR no method named `f3` found
     |                               ^^ field, not a method
     |
     = help: use `((*self.container).f3)(...)` if you meant to call the function stored in the `f3` field
index 2fd7dc246c206aa0dc45f653a5c52de95e95b8dc..32d5c7f5e8aef0e61c37e4e470b877c0f87d32b1 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-struct Example {
+struct Example { //~ NOTE not found for this
     example: Box<Fn(i32) -> i32>
 }
 
index d6a837a17ae1ce3182e493e5516b198b42cec366..813b6060db07212a9d72ffd8c493905a4f1948b9 100644 (file)
@@ -1,7 +1,7 @@
 error[E0599]: no method named `example` found for type `Example` in the current scope
   --> $DIR/issue-32128.rs:22:10
    |
-11 | struct Example {
+11 | struct Example { //~ NOTE not found for this
    | -------------- method `example` not found for this
 ...
 22 |     demo.example(1);
index 03c84fc57befee8ee745e39e22dc7c42af87fff1..8734985522191af4d431ef043e632a81f848931d 100644 (file)
@@ -36,14 +36,14 @@ fn main() {
     let p = &o;
     p.closure(); //~ ERROR no method named `closure` found
     //~^ HELP use `(p.closure)(...)` if you meant to call the function stored in the `closure` field
-    //~| NOTE `closure` is a field storing a function, not a method
+    //~| NOTE field, not a method
     let q = &p;
     q.fn_ptr(); //~ ERROR no method named `fn_ptr` found
     //~^ HELP use `(q.fn_ptr)(...)` if you meant to call the function stored in the `fn_ptr` field
-    //~| NOTE `fn_ptr` is a field storing a function, not a method
+    //~| NOTE field, not a method
     let r = D(C { c_fn_ptr: empty });
     let s = &r;
     s.c_fn_ptr(); //~ ERROR no method named `c_fn_ptr` found
     //~^ HELP use `(s.c_fn_ptr)(...)` if you meant to call the function stored in the `c_fn_ptr`
-    //~| NOTE `c_fn_ptr` is a field storing a function, not a method
+    //~| NOTE field, not a method
 }
index 94cf38fb32f2f79a73b4b4bec297f79532936c33..4cf939bbed6f514af49e0047b188f90b7668190d 100644 (file)
@@ -23,7 +23,7 @@ pub fn new(age: usize) -> Dog {
 
 fn main() {
     let dog = animal::Dog::new(3);
-    let dog_age = dog.dog_age();
+    let dog_age = dog.dog_age(); //~ ERROR no method
     //let dog_age = dog.dog_age;
     println!("{}", dog_age);
 }
index dd0081782f418f3e90d0921fe37b66323e8ce15b..caf78af6eb9f9f20231e7af0b25d5e3cde323dfd 100644 (file)
@@ -4,7 +4,7 @@ error[E0599]: no method named `dog_age` found for type `animal::Dog` in the curr
 12 |     pub struct Dog {
    |     -------------- method `dog_age` not found for this
 ...
-26 |     let dog_age = dog.dog_age();
+26 |     let dog_age = dog.dog_age(); //~ ERROR no method
    |                       ^^^^^^^ private field, not a method
 
 error: aborting due to previous error
index b3fa5871a82f5c38c8eb642a838bd5570d05bb9a..b58149fb0b8dce78b26cae1a44bbe380fcc87961 100644 (file)
@@ -13,6 +13,6 @@
 
 
 extern crate m1;
-extern crate m2 as m1;
+extern crate m2 as m1; //~ ERROR is defined multiple times
 
 fn main() {}
index c15e238e8b0a3c266f02fedd855ca7093d253bef..6268935b08ccaaace33382030342adffd6996094 100644 (file)
@@ -3,7 +3,7 @@ error[E0259]: the name `m1` is defined multiple times
    |
 15 | extern crate m1;
    | ---------------- previous import of the extern crate `m1` here
-16 | extern crate m2 as m1;
+16 | extern crate m2 as m1; //~ ERROR is defined multiple times
    | ^^^^^^^^^^^^^^^^^^^^^^
    | |
    | `m1` reimported here
index 51aba27498f881beb907f95cb2fc28738f6bd0ec..9d71ab1a788ebf4420c13ea1954fd8c3c68ba32c 100644 (file)
@@ -17,6 +17,6 @@ pub trait ConstructorExtension {}
 }
 
 use extension1::ConstructorExtension;
-use extension2::ConstructorExtension;
+use extension2::ConstructorExtension; //~ ERROR is defined multiple times
 
 fn main() {}
index 07985191284740d201fe47d6cc5d494de766cdc7..ae892db364ba775174c25ab00163a9d2be3a0ed5 100644 (file)
@@ -3,13 +3,13 @@ error[E0252]: the name `ConstructorExtension` is defined multiple times
    |
 19 | use extension1::ConstructorExtension;
    |     -------------------------------- previous import of the trait `ConstructorExtension` here
-20 | use extension2::ConstructorExtension;
+20 | use extension2::ConstructorExtension; //~ ERROR is defined multiple times
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ConstructorExtension` reimported here
    |
    = note: `ConstructorExtension` must be defined only once in the type namespace of this module
 help: You can use `as` to change the binding name of the import
    |
-20 | use extension2::ConstructorExtension as OtherConstructorExtension;
+20 | use extension2::ConstructorExtension as OtherConstructorExtension; //~ ERROR is defined multiple times
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to previous error
index d504b7cae28c4bb36d25e5c22a6bc19c849d9460..8c5bde45baed042ca8b599a71371b19531be6bc3 100644 (file)
@@ -15,5 +15,5 @@ fn foo(b: &[u16]) {}
 
 fn main() {
     let a: Vec<u8> = Vec::new();
-    foo(&a);
+    foo(&a); //~ ERROR mismatched types
 }
index bcad9ce56c65e8dc1f2c28d286dc3b01eb1dca22..c3f64fef50c66c8466f0495ada6a4daca2a2add1 100644 (file)
@@ -1,7 +1,7 @@
 error[E0308]: mismatched types
   --> $DIR/issue-43420-no-over-suggest.rs:18:9
    |
-18 |     foo(&a);
+18 |     foo(&a); //~ ERROR mismatched types
    |         ^^ expected slice, found struct `std::vec::Vec`
    |
    = note: expected type `&[u16]`
index 5bebce79eccbc2b3a1cd9961d8c851e6f134c232..8c97301f40b91c1a23221d70d53b753170ec531b 100644 (file)
 #[allow(unreachable_code)]
 fn main() {
     'foo: loop {
-        break 'fo;
+        break 'fo; //~ ERROR use of undeclared label
     }
 
     'bar: loop {
-        continue 'bor;
+        continue 'bor; //~ ERROR use of undeclared label
     }
 
     'longlabel: loop {
         'longlabel1: loop {
-            break 'longlable;
+            break 'longlable; //~ ERROR use of undeclared label
         }
     }
 }
index 23aa18a3655fb1ec90214b2a2ec5c75de524a9bc..c82b5decfd8390e52d3873a96704acfe17e95057 100644 (file)
@@ -1,19 +1,19 @@
 error[E0426]: use of undeclared label `'fo`
   --> $DIR/suggest-labels.rs:14:15
    |
-14 |         break 'fo;
+14 |         break 'fo; //~ ERROR use of undeclared label
    |               ^^^ did you mean `'foo`?
 
 error[E0426]: use of undeclared label `'bor`
   --> $DIR/suggest-labels.rs:18:18
    |
-18 |         continue 'bor;
+18 |         continue 'bor; //~ ERROR use of undeclared label
    |                  ^^^^ did you mean `'bar`?
 
 error[E0426]: use of undeclared label `'longlable`
   --> $DIR/suggest-labels.rs:23:19
    |
-23 |             break 'longlable;
+23 |             break 'longlable; //~ ERROR use of undeclared label
    |                   ^^^^^^^^^^ did you mean `'longlabel1`?
 
 error: aborting due to 3 previous errors
index b02881dc7eee03c98e9917c0a63d9d26cf54a20e..49027deecc198f9aaa35419013ddf0b4ac9292ae 100644 (file)
@@ -25,16 +25,16 @@ fn bag(&self) {}
 
 fn main() {
     let f = Foo;
-    f.bat(1.0);
+    f.bat(1.0); //~ ERROR no method named
 
     let s = "foo".to_string();
-    let _ = s.is_emtpy();
+    let _ = s.is_emtpy(); //~ ERROR no method named
 
     // Generates a warning for `count_zeros()`. `count_ones()` is also a close
     // match, but the former is closer.
-    let _ = 63u32.count_eos();
+    let _ = 63u32.count_eos(); //~ ERROR no method named
 
     // Does not generate a warning
-    let _ = 63u32.count_o();
+    let _ = 63u32.count_o(); //~ ERROR no method named
 
 }
index 30e3bbd9979766d6398dadacd306beadae4f957a..d3d8d302c70c45354ada84df019f2e0d0e13c978 100644 (file)
@@ -4,7 +4,7 @@ error[E0599]: no method named `bat` found for type `Foo` in the current scope
 11 | struct Foo;
    | ----------- method `bat` not found for this
 ...
-28 |     f.bat(1.0);
+28 |     f.bat(1.0); //~ ERROR no method named
    |       ^^^
    |
    = help: did you mean `bar`?
@@ -12,7 +12,7 @@ error[E0599]: no method named `bat` found for type `Foo` in the current scope
 error[E0599]: no method named `is_emtpy` found for type `std::string::String` in the current scope
   --> $DIR/suggest-methods.rs:31:15
    |
-31 |     let _ = s.is_emtpy();
+31 |     let _ = s.is_emtpy(); //~ ERROR no method named
    |               ^^^^^^^^
    |
    = help: did you mean `is_empty`?
@@ -20,7 +20,7 @@ error[E0599]: no method named `is_emtpy` found for type `std::string::String` in
 error[E0599]: no method named `count_eos` found for type `u32` in the current scope
   --> $DIR/suggest-methods.rs:35:19
    |
-35 |     let _ = 63u32.count_eos();
+35 |     let _ = 63u32.count_eos(); //~ ERROR no method named
    |                   ^^^^^^^^^
    |
    = help: did you mean `count_zeros`?
@@ -28,7 +28,7 @@ error[E0599]: no method named `count_eos` found for type `u32` in the current sc
 error[E0599]: no method named `count_o` found for type `u32` in the current scope
   --> $DIR/suggest-methods.rs:38:19
    |
-38 |     let _ = 63u32.count_o();
+38 |     let _ = 63u32.count_o(); //~ ERROR no method named
    |                   ^^^^^^^
 
 error: aborting due to 4 previous errors
index 4cd8cd81151cc623a532a4c770a542f135471027..65ca23402d27e4b655a46e72382e78b43edfd289 100644 (file)
@@ -14,12 +14,12 @@ fn main() {}
 
 fn foo() -> Result<u32, ()> {
     let x: Option<u32> = None;
-    x?;
+    x?; //~ the trait bound
     Ok(22)
 }
 
 fn bar() -> u32 {
     let x: Option<u32> = None;
-    x?;
+    x?; //~ the `?` operator
     22
 }
index 86d4510cad3c2a70fbb32e2d3597654962eac60b..b1be9ad3cf697bea9776dc30a5c94c75b4fd122a 100644 (file)
@@ -1,7 +1,7 @@
 error[E0277]: the trait bound `(): std::convert::From<std::option::NoneError>` is not satisfied
   --> $DIR/try-on-option.rs:17:5
    |
-17 |     x?;
+17 |     x?; //~ the trait bound
    |     ^^ the trait `std::convert::From<std::option::NoneError>` is not implemented for `()`
    |
    = note: required by `std::convert::From::from`
@@ -9,7 +9,7 @@ error[E0277]: the trait bound `(): std::convert::From<std::option::NoneError>` i
 error[E0277]: the `?` operator can only be used in a function that returns `Result` (or another type that implements `std::ops::Try`)
   --> $DIR/try-on-option.rs:23:5
    |
-23 |     x?;
+23 |     x?; //~ the `?` operator
    |     --
    |     |
    |     cannot use the `?` operator in a function that returns `u32`
index eadd12924df6603a6e12334fd2f08179922b9c94..e9d285941b7629f4c68ce136c0135e672b797847 100644 (file)
 
 fn main() {
     // error for a `Try` type on a non-`Try` fn
-    std::fs::File::open("foo")?;
+    std::fs::File::open("foo")?; //~ ERROR the `?` operator can only
 
     // a non-`Try` type on a non-`Try` fn
-    ()?;
+    ()?; //~ ERROR the `?` operator can only
 
     // an unrelated use of `Try`
-    try_trait_generic::<()>();
+    try_trait_generic::<()>(); //~ ERROR the trait bound
 }
 
 
 
 fn try_trait_generic<T: Try>() -> T {
     // and a non-`Try` object on a `Try` fn.
-    ()?;
+    ()?; //~ ERROR the `?` operator can only
 
     loop {}
 }
index e83bf2abc1504fd1bfd8dbe1891a45af7f8b9277..8b17e06065b5e53fc7060f6e0fa234e8312579a6 100644 (file)
@@ -1,7 +1,7 @@
 error[E0277]: the `?` operator can only be used in a function that returns `Result` (or another type that implements `std::ops::Try`)
   --> $DIR/try-operator-on-main.rs:17:5
    |
-17 |     std::fs::File::open("foo")?;
+17 |     std::fs::File::open("foo")?; //~ ERROR the `?` operator can only
    |     ---------------------------
    |     |
    |     cannot use the `?` operator in a function that returns `()`
@@ -13,7 +13,7 @@ error[E0277]: the `?` operator can only be used in a function that returns `Resu
 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
   --> $DIR/try-operator-on-main.rs:20:5
    |
-20 |     ()?;
+20 |     ()?; //~ ERROR the `?` operator can only
    |     ---
    |     |
    |     the `?` operator cannot be applied to type `()`
@@ -25,7 +25,7 @@ error[E0277]: the `?` operator can only be applied to values that implement `std
 error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
   --> $DIR/try-operator-on-main.rs:23:5
    |
-23 |     try_trait_generic::<()>();
+23 |     try_trait_generic::<()>(); //~ ERROR the trait bound
    |     ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `()`
    |
    = note: required by `try_trait_generic`
@@ -33,7 +33,7 @@ error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
   --> $DIR/try-operator-on-main.rs:30:5
    |
-30 |     ()?;
+30 |     ()?; //~ ERROR the `?` operator can only
    |     ---
    |     |
    |     the `?` operator cannot be applied to type `()`
index 8bfbd0e74db228a4739c570a0b607920820cb5df..0a188305a9228cb6bce149ba8b767302494e2133 100644 (file)
@@ -11,5 +11,5 @@
 // compile-flags: -Z parse-only
 
 fn main () {
-    (1, (2, 3)).1.1;
+    (1, (2, 3)).1.1; //~ ERROR unexpected token: `1.1`
 }
index 4b1be26c86b0e7c1c434286790f56083a4527cfd..7d133f11cbb600e5940d0cd28c15d65772c0a356 100644 (file)
@@ -1,7 +1,7 @@
 error: unexpected token: `1.1`
   --> $DIR/tuple-float-index.rs:14:17
    |
-14 |     (1, (2, 3)).1.1;
+14 |     (1, (2, 3)).1.1; //~ ERROR unexpected token: `1.1`
    |     ------------^^^
    |     |           |
    |     |           unexpected token
index bcd965f10fabb644651cc7c5c80ed8c8c3b54ebe..d80dad8fbd4c2bb66161f9e3dcfa55a658924dd3 100644 (file)
@@ -9,5 +9,6 @@
 // except according to those terms.
 
 fn main() {
-    let x: Vec::with_capacity(10, 20);
+    let x: Vec::with_capacity(10, 20);  //~ ERROR expected type, found `10`
+    //~^ ERROR this function takes 1 parameter
 }
index 647e3f84685f1dc2fbcdf80eefed8ad6b9532121..c3e8d7fcd61ac4b8e1ad3be9e7cad457ba223b9f 100644 (file)
@@ -1,7 +1,7 @@
 error: expected type, found `10`
   --> $DIR/type-ascription-instead-of-initializer.rs:12:31
    |
-12 |     let x: Vec::with_capacity(10, 20);
+12 |     let x: Vec::with_capacity(10, 20);  //~ ERROR expected type, found `10`
    |         --                    ^^
    |         ||
    |         |help: use `=` if you meant to assign
@@ -10,7 +10,7 @@ error: expected type, found `10`
 error[E0061]: this function takes 1 parameter but 2 parameters were supplied
   --> $DIR/type-ascription-instead-of-initializer.rs:12:31
    |
-12 |     let x: Vec::with_capacity(10, 20);
+12 |     let x: Vec::with_capacity(10, 20);  //~ ERROR expected type, found `10`
    |                               ^^^^^^ expected 1 parameter
 
 error: aborting due to 2 previous errors
index 93de55a39e954072dd71fe55537bfdc0a55860e3..01d773dd5e10392d8e1a2be52c301cfd39f2e244 100644 (file)
@@ -12,9 +12,9 @@
 
 fn main() {
     println!("test"):
-    0;
+    0; //~ ERROR expected type, found `0`
 }
 
 fn foo() {
-    println!("test"): 0;
+    println!("test"): 0; //~ ERROR expected type, found `0`
 }
index 550048c7b88f1a32028573f7ac556b41547b91fc..9d26d004674801ba20ab51f4dc5931a960c31dcb 100644 (file)
@@ -3,13 +3,13 @@ error: expected type, found `0`
    |
 14 |     println!("test"):
    |                     - help: did you mean to use `;` here?
-15 |     0;
+15 |     0; //~ ERROR expected type, found `0`
    |     ^ expecting a type here because of type ascription
 
 error: expected type, found `0`
   --> $DIR/type-ascription-instead-of-statement-end.rs:19:23
    |
-19 |     println!("test"): 0;
+19 |     println!("test"): 0; //~ ERROR expected type, found `0`
    |                       ^ expecting a type here because of type ascription
 
 error: aborting due to 2 previous errors
index 7c10bf98c8409b1052161f4b7d5db59629daebd0..b2c25c37e8e321aea3f4bc8a5d74fb0bb3df5a2a 100644 (file)
@@ -12,7 +12,7 @@
 
 fn main() {
     f()  :
-    f();
+    f(); //~ ERROR expected type, found function
 }
 
 fn f() {}
index 93c65c263dd12f0dbed3cef3a4d01b2bbac1e00f..d5e0b00f3dff0a3250ef3265138199e5f87a6705 100644 (file)
@@ -3,7 +3,7 @@ error[E0573]: expected type, found function `f`
    |
 14 |     f()  :
    |          - help: did you mean to use `;` here instead?
-15 |     f();
+15 |     f(); //~ ERROR expected type, found function
    |     ^^^
    |     |
    |     not a type
index 02c119cf727fe473b0518fd58847eb07909cee6e..9617df8fa21a9c1a3d1a9c5556d771d341baddda 100644 (file)
@@ -14,4 +14,3 @@
 
 FAIL
 //~^ ERROR
-//~| ERROR
index 93759123618fbac94701fea954325dc370335dc7..c22baee680a02b12d9d9e9e49ef2414bdd7f96d2 100644 (file)
@@ -15,6 +15,6 @@ pub fn trace_option(option: Option<isize>) {
     option.map(|some| 42; //~ NOTE: unclosed delimiter
                           //~^ ERROR: expected one of
                           //~| NOTE: expected one of
-                          //~| NOTE: unexpected token
+
 } //~ ERROR: incorrect close delimiter
 //~^ ERROR: expected expression, found `)`
index 0f473c9e0738818718432b9b65aa29203654b4ef..550a90fc6af263381f9de03bf293ef0e30255b4e 100644 (file)
@@ -8,6 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-impl S {
+impl S { //~ ERROR cannot find type
     pub
-}
+} //~ ERROR expected one of
index 50a38da9d8c18ecb4539611534e0f26d0c969c09..707784272ede8d0ea6f7e795577a2888afaae4c6 100644 (file)
@@ -3,13 +3,13 @@ error: expected one of `(`, `const`, `default`, `extern`, `fn`, `type`, or `unsa
    |
 12 |     pub
    |        - expected one of 7 possible tokens here
-13 | }
+13 | } //~ ERROR expected one of
    | ^ unexpected token
 
 error[E0412]: cannot find type `S` in this scope
   --> $DIR/issue-41155.rs:11:6
    |
-11 | impl S {
+11 | impl S { //~ ERROR cannot find type
    |      ^ not found in this scope
 
 error[E0601]: main function not found
index 08749373432f567761c01f2e208497baa93f86fd..fd2561ce4965319e5cafa73590d5d0dda54683b6 100644 (file)
@@ -21,7 +21,7 @@ fn bar() {}
 macro_rules! ignored_expr {
     () => ( 1,  //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
                 //~^ NOTE expected one of `.`, `;`, `?`, `}`, or an operator here
-                //~| NOTE unexpected token
+
             2 )
 }
 
index 2bb2c97790c124fd4427acd4d6f1b1ad5947fa79..72cae6abc2dbeb929ead5bac346d78df3a83b5d9 100644 (file)
@@ -18,4 +18,3 @@ fn main() {
 
 FAIL
 //~^ ERROR
-//~| ERROR
index 5c1bd668ac649a1227851a65ae36b960857be949..54cf6e6783eb76287abc8808f1fbd05d6bcdc697 100644 (file)
@@ -26,5 +26,5 @@ fn method(&self) {}
 
 fn main() {
     let foo = inner::Foo;
-    foo.method();
+    foo.method(); //~ ERROR is private
 }
index 549c84b9b032539e8449da59ec585af3ae740223..7406541a9da557f153a3ba33dabeec457cd2fc4a 100644 (file)
@@ -1,7 +1,7 @@
 error[E0624]: method `method` is private
   --> $DIR/trait-method-private.rs:29:9
    |
-29 |     foo.method();
+29 |     foo.method(); //~ ERROR is private
    |         ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
index d60c97f1d59a8c4a1013d4af456cc8879bc78b94..0a0214a24ff2d786ae8292c1b7471f3f5115216e 100644 (file)
 
 unsafe fn foo() -> (i8, *const (), Option<fn()>) {
     let i = mem::transmute(bar);
-    //~^ ERROR is zero-sized and can't be transmuted
-    //~^^ NOTE cast with `as` to a pointer instead
+    //~^ ERROR transmute called with types of different sizes
+
 
     let p = mem::transmute(foo);
-    //~^ ERROR is zero-sized and can't be transmuted
-    //~^^ NOTE cast with `as` to a pointer instead
+    //~^ ERROR can't transmute zero-sized type
+
 
     let of = mem::transmute(main);
-    //~^ ERROR is zero-sized and can't be transmuted
-    //~^^ NOTE cast with `as` to a pointer instead
+    //~^ ERROR can't transmute zero-sized type
+
 
     (i, p, of)
 }
@@ -30,15 +30,15 @@ unsafe fn bar() {
     // Error as usual if the resulting type is not pointer-sized.
     mem::transmute::<_, u8>(main);
     //~^ ERROR transmute called with types of different sizes
-    //~^^ NOTE transmuting between fn() {main} and u8
+
 
     mem::transmute::<_, *mut ()>(foo);
-    //~^ ERROR is zero-sized and can't be transmuted
-    //~^^ NOTE cast with `as` to a pointer instead
+    //~^ ERROR can't transmute zero-sized type
+
 
     mem::transmute::<_, fn()>(bar);
-    //~^ ERROR is zero-sized and can't be transmuted
-    //~^^ NOTE cast with `as` to a pointer instead
+    //~^ ERROR can't transmute zero-sized type
+
 
     // No error if a coercion would otherwise occur.
     mem::transmute::<fn(), usize>(main);
@@ -46,16 +46,16 @@ unsafe fn bar() {
 
 unsafe fn baz() {
     mem::transmute::<_, *mut ()>(Some(foo));
-    //~^ ERROR is zero-sized and can't be transmuted
-    //~^^ NOTE cast with `as` to a pointer instead
+    //~^ ERROR can't transmute zero-sized type
+
 
     mem::transmute::<_, fn()>(Some(bar));
-    //~^ ERROR is zero-sized and can't be transmuted
-    //~^^ NOTE cast with `as` to a pointer instead
+    //~^ ERROR can't transmute zero-sized type
+
 
     mem::transmute::<_, Option<fn()>>(Some(baz));
-    //~^ ERROR is zero-sized and can't be transmuted
-    //~^^ NOTE cast with `as` to a pointer instead
+    //~^ ERROR can't transmute zero-sized type
+
 
     // No error if a coercion would otherwise occur.
     mem::transmute::<Option<fn()>, usize>(Some(main));
index 117fc2cc5df2496931a5a7ab742958baaedde312..fe340295f74c7aa8a7c0a0d55f126cbd7fa5abf0 100644 (file)
 
 unsafe fn f<T>(x: T) {
     let _: i32 = transmute(x);
-//~^ ERROR differently sized types: T (size can vary) to i32
+//~^ ERROR transmute called with types of different sizes
 }
 
 unsafe fn g<T>(x: (T, i32)) {
     let _: i32 = transmute(x);
-//~^ ERROR differently sized types: (T, i32) (size can vary because of T) to i32
+//~^ ERROR transmute called with types of different sizes
 }
 
 unsafe fn h<T>(x: [T; 10]) {
     let _: i32 = transmute(x);
-//~^ ERROR differently sized types: [T; 10] (size can vary because of T) to i32
+//~^ ERROR transmute called with types of different sizes
 }
 
 struct Bad<T> {
@@ -38,7 +38,7 @@ struct Bad<T> {
 
 unsafe fn i<T>(x: Bad<T>) {
     let _: i32 = transmute(x);
-//~^ ERROR differently sized types: Bad<T> (size can vary because of T) to i32
+//~^ ERROR transmute called with types of different sizes
 }
 
 enum Worse<T> {
@@ -48,12 +48,12 @@ enum Worse<T> {
 
 unsafe fn j<T>(x: Worse<T>) {
     let _: i32 = transmute(x);
-//~^ ERROR differently sized types: Worse<T> (size can vary because of T) to i32
+//~^ ERROR transmute called with types of different sizes
 }
 
 unsafe fn k<T>(x: Option<T>) {
     let _: i32 = transmute(x);
-//~^ ERROR differently sized types: std::option::Option<T> (size can vary because of T) to i32
+//~^ ERROR transmute called with types of different sizes
 }
 
 fn main() {}
index 98dc55c666303fa65c03f565e7ff1214985a7931..e4422f0b99aa4f6cfd45960f9df3c43bb6e11da7 100644 (file)
@@ -24,25 +24,25 @@ fn main() {
     // `x { ... }` should not be interpreted as a struct literal here
     if x = x {
         //~^ ERROR mismatched types
-        //~| HELP did you mean to compare equality?
+        //~| HELP try comparing for equality
         println!("{}", x);
     }
     // Explicit parentheses on the left should match behavior of above
     if (x = x) {
         //~^ ERROR mismatched types
-        //~| HELP did you mean to compare equality?
+        //~| HELP try comparing for equality
         println!("{}", x);
     }
     // The struct literal interpretation is fine with explicit parentheses on the right
     if y = (Foo { foo: x }) {
         //~^ ERROR mismatched types
-        //~| HELP did you mean to compare equality?
+        //~| HELP try comparing for equality
         println!("{}", x);
     }
     // "invalid left-hand side expression" error is suppresed
     if 3 = x {
         //~^ ERROR mismatched types
-        //~| HELP did you mean to compare equality?
+        //~| HELP try comparing for equality
         println!("{}", x);
     }
     if (if true { x = 4 } else { x = 5 }) {
index 0b35a9c3dbebc49ef4e9828df49b64fff45cc685..3ec96144da544a3be6462775422a0a302979ba0f 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    let x = [];
+    let x = []; //~ ERROR type annotations needed
 }
index 8c52bb5a1d3a51d9401efe7d30800c019f4b8323..19369f5ca60fe2b8035ba759fc6a1d80b980a9a5 100644 (file)
@@ -1,7 +1,7 @@
 error[E0282]: type annotations needed
   --> $DIR/cannot_infer_local_or_array.rs:12:13
    |
-12 |     let x = [];
+12 |     let x = []; //~ ERROR type annotations needed
    |         -   ^^ cannot infer type for `_`
    |         |
    |         consider giving `x` a type
index 296dc81a89bcf94e041ff53749c443faccfc47a4..62eaa616d3199d1d0c3d5af4c917adf2c6c8362f 100644 (file)
@@ -11,5 +11,5 @@
 fn main() { }
 
 fn unconstrained_type() {
-    [];
+    []; //~ ERROR type annotations needed
 }
index 9568411885192a04f4002f0ca87a138159b22f1e..5ee350746bee86423c26118feab577c291a0c17d 100644 (file)
@@ -1,7 +1,7 @@
 error[E0282]: type annotations needed
   --> $DIR/issue-22897.rs:14:5
    |
-14 |     [];
+14 |     []; //~ ERROR type annotations needed
    |     ^^ cannot infer type for `[_; 0]`
 
 error: aborting due to previous error
index d30a425d1099b01d88489dc80eae1e650e027f4e..d2817062b27ff1002b4d58b8cf20e08c3bfd472d 100644 (file)
@@ -12,7 +12,7 @@ trait Foo: Sized {
     fn foo(self);
 }
 
-fn foo<'a,'b,T>(x: &'a T, y: &'b T)
+fn foo<'a,'b,T>(x: &'a T, y: &'b T) //~ ERROR type annotations required
     where &'a T : Foo,
           &'b T : Foo
 {
index bb3a371b26e0ceefba9b25e1aff1edc1f6cc28af..2ca97aa3ef0676c919ab7e0494f1e7cec3d338d8 100644 (file)
@@ -1,7 +1,7 @@
 error[E0283]: type annotations required: cannot resolve `&'a T: Foo`
   --> $DIR/issue-40294.rs:15:1
    |
-15 | / fn foo<'a,'b,T>(x: &'a T, y: &'b T)
+15 | / fn foo<'a,'b,T>(x: &'a T, y: &'b T) //~ ERROR type annotations required
 16 | |     where &'a T : Foo,
 17 | |           &'b T : Foo
 18 | | {
index 5127a8ce1748223be552a2a13649cd4871e6306f..7b4d2f05f5fd0fcac45cfebdecd42f76205f3a0f 100644 (file)
@@ -14,6 +14,7 @@ enum X {
 
 fn main() {
     match X::Y(0) {
-        X::Y { number } => {}
+        X::Y { number } => {} //~ ERROR does not have a field named `number`
+        //~^ ERROR pattern does not mention field `0`
     }
 }
index acae7a350877aa51b40039d1186a70bafb3a7a0a..569924da6f4463152e9782a18f8424ff15fcc91f 100644 (file)
@@ -1,13 +1,13 @@
 error[E0026]: variant `X::Y` does not have a field named `number`
   --> $DIR/issue-41314.rs:17:16
    |
-17 |         X::Y { number } => {}
+17 |         X::Y { number } => {} //~ ERROR does not have a field named `number`
    |                ^^^^^^ variant `X::Y` does not have field `number`
 
 error[E0027]: pattern does not mention field `0`
   --> $DIR/issue-41314.rs:17:9
    |
-17 |         X::Y { number } => {}
+17 |         X::Y { number } => {} //~ ERROR does not have a field named `number`
    |         ^^^^^^^^^^^^^^^ missing field `0`
    |
    = note: trying to match a tuple variant with a struct variant pattern
index f1d357df12c43deede0f7b665d00794d16cfa020..0c355976330fdd80a68babe3d60862c1b1ab7d04 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    let x = |_| {    };
+    let x = |_| {    }; //~ ERROR type annotations needed
 }
index afbd15ca486bd1e66566ee1269341879986d5e45..1d8c0ddc8b6017096ed2a358f56d48c196971f22 100644 (file)
@@ -1,7 +1,7 @@
 error[E0282]: type annotations needed
   --> $DIR/unknown_type_for_closure.rs:12:14
    |
-12 |     let x = |_| {    };
+12 |     let x = |_| {    }; //~ ERROR type annotations needed
    |              ^ consider giving this closure parameter a type
 
 error: aborting due to previous error
index 78d119ef329d0ae4ec1a198acba226a3550e5403..506bce0dbec214aaa678f11f1b4e7d95ba494699 100644 (file)
@@ -15,5 +15,5 @@
 fn g<F>(_: F) where F: FnOnce(Option<F>) {}
 
 fn main() {
-    g(|_| {  });
+    g(|_| {  }); //~ ERROR closure/generator type that references itself
 }
index a4279a2afac603ffe922d7a71aecfa16c71a3e40..75a87f70660d56164389026fd630309eec23138d 100644 (file)
@@ -1,7 +1,7 @@
 error[E0644]: closure/generator type that references itself
   --> $DIR/unboxed-closure-no-cyclic-sig.rs:18:7
    |
-18 |     g(|_| {  });
+18 |     g(|_| {  }); //~ ERROR closure/generator type that references itself
    |       ^^^^^^^^ cyclic type of infinite size
    |
    = note: closures cannot capture themselves or take themselves as argument;
index 14ef3b5f178ac47ac3e4cfe6a9e7217544aaae01..481346ad4b6ebc51a72b30300cb2ad7f13b845f4 100644 (file)
@@ -21,6 +21,6 @@ fn main() {
     // the closure implements `FnOnce`, not that it moves from inside
     // a `Fn` closure.)
     let y = (vec![1, 2, 3], 0);
-    let c = || drop(y.0);
+    let c = || drop(y.0); //~ ERROR expected a closure that implements the `Fn` trait
     foo(c);
 }
index d968c409396311938a5f0f245bcec3ab34433504..d3d9ce2b34a1c355fe4b9a6f81d42501ad842062 100644 (file)
@@ -1,7 +1,7 @@
 error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
   --> $DIR/unboxed-closures-infer-fn-once-move-from-projection.rs:24:13
    |
-24 |     let c = || drop(y.0);
+24 |     let c = || drop(y.0); //~ ERROR expected a closure that implements the `Fn` trait
    |             ^^^^^^^^^^^^
 25 |     foo(c);
    |     --- the requirement to implement `Fn` derives from here
@@ -9,7 +9,7 @@ error[E0525]: expected a closure that implements the `Fn` trait, but this closur
 note: closure is `FnOnce` because it moves the variable `y` out of its environment
   --> $DIR/unboxed-closures-infer-fn-once-move-from-projection.rs:24:21
    |
-24 |     let c = || drop(y.0);
+24 |     let c = || drop(y.0); //~ ERROR expected a closure that implements the `Fn` trait
    |                     ^
 
 error: aborting due to previous error
index 021f57e3eee0aa690218bdc4fa636a580e4a5d62..dc551bb899861e1c29bdfd813a920132594bf6c0 100644 (file)
 union U1 {
     a: u8, // should not be reported
     b: u8, // should not be reported
-    c: u8, // should be reported
+    c: u8, //~ ERROR field is never used
 }
 union U2 {
-    a: u8, // should be reported
+    a: u8, //~ ERROR field is never used
     b: u8, // should not be reported
     c: u8, // should not be reported
 }
-union NoDropLike { a: u8 } // should be reported as unused
+union NoDropLike { a: u8 } //~ ERROR field is never used
 
 union U {
     a: u8, // should not be reported
     b: u8, // should not be reported
-    c: u8, // should be reported
+    c: u8, //~ ERROR field is never used
 }
 type A = U;
 
index f3a2702d5aefa2266d5333e5069687b1578defe0..ffcd178ca548fd024fea6b7e170a2cbd19ceab94 100644 (file)
@@ -1,7 +1,7 @@
 error: field is never used: `c`
   --> $DIR/union-fields.rs:16:5
    |
-16 |     c: u8, // should be reported
+16 |     c: u8, //~ ERROR field is never used
    |     ^^^^^
    |
 note: lint level defined here
@@ -13,19 +13,19 @@ note: lint level defined here
 error: field is never used: `a`
   --> $DIR/union-fields.rs:19:5
    |
-19 |     a: u8, // should be reported
+19 |     a: u8, //~ ERROR field is never used
    |     ^^^^^
 
 error: field is never used: `a`
   --> $DIR/union-fields.rs:23:20
    |
-23 | union NoDropLike { a: u8 } // should be reported as unused
+23 | union NoDropLike { a: u8 } //~ ERROR field is never used
    |                    ^^^^^
 
 error: field is never used: `c`
   --> $DIR/union-fields.rs:28:5
    |
-28 |     c: u8, // should be reported
+28 |     c: u8, //~ ERROR field is never used
    |     ^^^^^
 
 error: aborting due to 4 previous errors
index eeca5ab740450494ae97b80515ddedbbb4096f30..8999f1e0930bed3898474fda10a779ebf4704321 100644 (file)
 #![feature(untagged_unions)]
 
 union Foo<T: ?Sized> {
-    value: T,
+    value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
 }
 
 struct Foo2<T: ?Sized> {
-    value: T,
+    value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
     t: u32,
 }
 
 enum Foo3<T: ?Sized> {
-    Value(T),
+    Value(T), //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
 }
 
 fn main() {}
index ea90d97c4c3d1f1d2f6150582a287d82d727a060..9586f9507391f8a91e71a73d27c819c6f7f20377 100644 (file)
@@ -1,7 +1,7 @@
 error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
   --> $DIR/union-sized-field.rs:14:5
    |
-14 |     value: T,
+14 |     value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
    |     ^^^^^^^^ `T` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `T`
@@ -11,7 +11,7 @@ error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
 error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
   --> $DIR/union-sized-field.rs:18:5
    |
-18 |     value: T,
+18 |     value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
    |     ^^^^^^^^ `T` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `T`
@@ -21,7 +21,7 @@ error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
 error[E0277]: the trait bound `T: std::marker::Sized` is not satisfied
   --> $DIR/union-sized-field.rs:23:11
    |
-23 |     Value(T),
+23 |     Value(T), //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied
    |           ^^ `T` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `T`
index bb7c3616f2aa503a766b9c157f289f8dee83ad28..7d20bb74c7aeb12b0878a79f95ace290570992ac 100644 (file)
@@ -2218,9 +2218,9 @@ fn run_ui_test(&self) {
         // if the user specified a format in the ui test
         // print the output to the stderr file, otherwise extract
         // the rendered error messages from json and print them
-        let explicit = self.props.compile_flags.iter().any(|s| s.starts_with("--error-format"));
+        let explicit = self.props.compile_flags.iter().any(|s| s.contains("--error-format"));
 
-        let mut proc_res = self.compile_test();
+        let proc_res = self.compile_test();
 
         let expected_stderr_path = self.expected_output_path("stderr");
         let expected_stderr = self.load_expected_output(&expected_stderr_path);
@@ -2229,7 +2229,7 @@ fn run_ui_test(&self) {
         let expected_stdout = self.load_expected_output(&expected_stdout_path);
 
         let normalized_stdout =
-            self.normalize_output(&proc_res.stdout, &self.props.normalize_stdout, explicit);
+            self.normalize_output(&proc_res.stdout, &self.props.normalize_stdout);
 
         let stderr = if explicit {
             proc_res.stderr.clone()
@@ -2238,15 +2238,12 @@ fn run_ui_test(&self) {
         };
 
         let normalized_stderr =
-            self.normalize_output(&stderr, &self.props.normalize_stderr, explicit);
+            self.normalize_output(&stderr, &self.props.normalize_stderr);
 
         let mut errors = 0;
         errors += self.compare_output("stdout", &normalized_stdout, &expected_stdout);
         errors += self.compare_output("stderr", &normalized_stderr, &expected_stderr);
 
-        // rewrite the output to the human readable one (shown in case of errors)
-        proc_res.stderr = normalized_stderr;
-
         if errors > 0 {
             println!("To update references, run this command from build directory:");
             let relative_path_to_file =
@@ -2260,6 +2257,8 @@ fn run_ui_test(&self) {
                                 &proc_res);
         }
 
+        let expected_errors = errors::load_errors(&self.testpaths.file, self.revision);
+
         if self.props.run_pass {
             let proc_res = self.exec_compiled_test();
 
@@ -2267,6 +2266,15 @@ fn run_ui_test(&self) {
                 self.fatal_proc_rec("test run failed!", &proc_res);
             }
         }
+        if !explicit {
+            if !expected_errors.is_empty() || !proc_res.status.success() {
+                // "// error-pattern" comments
+                self.check_expected_errors(expected_errors, &proc_res);
+            } else if !self.props.error_patterns.is_empty() || !proc_res.status.success() {
+                // "//~ERROR comments"
+                self.check_error_patterns(&proc_res.stderr, &proc_res);
+            }
+        }
     }
 
     fn run_mir_opt_test(&self) {
@@ -2440,13 +2448,13 @@ fn get_mir_dump_dir(&self) -> PathBuf {
         mir_dump_dir
     }
 
-    fn normalize_output(
-        &self,
-        output: &str,
-        custom_rules: &[(String, String)],
-        json: bool,
-    ) -> String {
+    fn normalize_output(&self, output: &str, custom_rules: &[(String, String)]) -> String {
         let parent_dir = self.testpaths.file.parent().unwrap();
+        let cflags = self.props.compile_flags.join(" ");
+        let json = cflags.contains("--error-format json") ||
+                   cflags.contains("--error-format pretty-json") ||
+                   cflags.contains("--error-format=json") ||
+                   cflags.contains("--error-format=pretty-json");
         let parent_dir_str = if json {
             parent_dir.display().to_string().replace("\\", "\\\\")
         } else {
index 80853e2f24a01db96fe9821e468dd2af75a4d2e5..6dbfe23c4d1af109c894ff9d7d5da97c025584e5 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 80853e2f24a01db96fe9821e468dd2af75a4d2e5
+Subproject commit 6dbfe23c4d1af109c894ff9d7d5da97c025584e5