From 8c1f9ef9a61f4a3473507bc2e4726a4caf50f072 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Mon, 20 Nov 2017 13:13:27 +0100 Subject: [PATCH] Merge cfail and ui tests into ui tests --- src/librustc/session/mod.rs | 13 +- src/test/compile-fail/issue-31221.rs | 2 - src/test/compile-fail/lint-output-format-2.rs | 1 - .../lint-unconditional-recursion.rs | 14 +- .../ui-fulldeps/custom-derive/issue-36935.rs | 2 +- .../custom-derive/issue-36935.stderr | 2 +- .../ui-fulldeps/issue-44953/issue-44953.rs | 2 +- .../issue-44953/issue-44953.stderr | 2 +- .../ui-fulldeps/proc-macro/three-equals.rs | 10 +- .../proc-macro/three-equals.stderr | 14 +- src/test/ui-fulldeps/resolve-error.rs | 10 ++ src/test/ui-fulldeps/resolve-error.stderr | 36 ++-- .../ui/anonymous-higher-ranked-lifetime.rs | 22 +-- .../anonymous-higher-ranked-lifetime.stderr | 22 +-- src/test/ui/block-result/issue-11714.rs | 2 +- src/test/ui/block-result/issue-11714.stderr | 2 +- src/test/ui/block-result/issue-3563.rs | 1 - .../block-result/unexpected-return-on-unit.rs | 2 +- .../unexpected-return-on-unit.stderr | 4 +- .../ui/borrowck/borrowck-closures-two-mut.rs | 5 + .../borrowck/borrowck-closures-two-mut.stderr | 82 +++++---- src/test/ui/borrowck/borrowck-in-static.rs | 3 +- .../ui/borrowck/borrowck-in-static.stderr | 2 +- src/test/ui/borrowck/borrowck-reinit.rs | 3 +- src/test/ui/borrowck/borrowck-reinit.stderr | 4 +- src/test/ui/borrowck/mut-borrow-in-loop.rs | 6 +- .../ui/borrowck/mut-borrow-in-loop.stderr | 6 +- .../ui/borrowck/mut-borrow-outside-loop.rs | 4 +- .../borrowck/mut-borrow-outside-loop.stderr | 4 +- ...es-move-upvar-from-non-once-ref-closure.rs | 3 +- ...ove-upvar-from-non-once-ref-closure.stderr | 2 +- ...cast-to-unsized-trait-object-suggestion.rs | 4 +- ...-to-unsized-trait-object-suggestion.stderr | 4 +- src/test/ui/check_match/issue-35609.rs | 16 +- src/test/ui/check_match/issue-35609.stderr | 16 +- .../ui/closure_context/issue-26046-fn-mut.rs | 2 +- .../closure_context/issue-26046-fn-mut.stderr | 2 +- .../ui/closure_context/issue-26046-fn-once.rs | 2 +- .../issue-26046-fn-once.stderr | 2 +- src/test/ui/closure_context/issue-42065.rs | 5 +- .../ui/closure_context/issue-42065.stderr | 7 +- ...herence-overlapping-inherent-impl-trait.rs | 2 +- ...nce-overlapping-inherent-impl-trait.stderr | 2 +- src/test/ui/codemap_tests/empty_span.rs | 2 +- src/test/ui/codemap_tests/empty_span.stderr | 2 +- .../codemap_tests/huge_multispan_highlight.rs | 2 +- .../huge_multispan_highlight.stderr | 2 +- src/test/ui/codemap_tests/issue-11715.rs | 2 +- src/test/ui/codemap_tests/issue-11715.stderr | 2 +- src/test/ui/codemap_tests/one_line.rs | 2 +- src/test/ui/codemap_tests/one_line.stderr | 2 +- .../overlapping_inherent_impls.rs | 6 +- .../overlapping_inherent_impls.stderr | 6 +- .../ui/codemap_tests/overlapping_spans.rs | 2 +- .../ui/codemap_tests/overlapping_spans.stderr | 2 +- src/test/ui/codemap_tests/tab.rs | 4 +- src/test/ui/codemap_tests/tab.stderr | 4 +- src/test/ui/codemap_tests/tab_2.rs | 2 +- src/test/ui/codemap_tests/tab_2.stderr | 2 +- src/test/ui/codemap_tests/tab_3.rs | 2 +- src/test/ui/codemap_tests/tab_3.stderr | 2 +- src/test/ui/codemap_tests/two_files.rs | 2 +- src/test/ui/codemap_tests/two_files.stderr | 2 +- src/test/ui/codemap_tests/unicode.rs | 2 +- src/test/ui/codemap_tests/unicode.stderr | 2 +- src/test/ui/codemap_tests/unicode_2.rs | 6 +- src/test/ui/codemap_tests/unicode_2.stderr | 6 +- .../ui/coercion-missing-tail-expected-type.rs | 4 +- ...coercion-missing-tail-expected-type.stderr | 4 +- src/test/ui/command-line-diagnostics.rs | 17 ++ src/test/ui/command-line-diagnostics.stderr | 10 ++ src/test/ui/compare-method/region-extra.rs | 2 +- .../ui/compare-method/region-extra.stderr | 2 +- .../ui/compare-method/region-unrelated.rs | 2 +- src/test/ui/const-eval/issue-43197.rs | 6 +- src/test/ui/const-eval/issue-43197.stderr | 12 +- src/test/ui/const-expr-addr-operator.rs | 4 +- src/test/ui/const-expr-addr-operator.stderr | 2 +- .../ui/cross-crate-macro-backtrace/main.rs | 4 +- .../cross-crate-macro-backtrace/main.stderr | 4 +- src/test/ui/deref-suggestion.rs | 10 +- src/test/ui/deref-suggestion.stderr | 10 +- src/test/ui/did_you_mean/E0178.rs | 8 +- src/test/ui/did_you_mean/E0178.stderr | 8 +- ...issue-21659-show-relevant-trait-impls-1.rs | 3 - ...issue-21659-show-relevant-trait-impls-2.rs | 6 - src/test/ui/did_you_mean/issue-31424.rs | 4 +- src/test/ui/did_you_mean/issue-31424.stderr | 4 +- src/test/ui/did_you_mean/issue-34126.rs | 2 +- src/test/ui/did_you_mean/issue-34126.stderr | 2 +- src/test/ui/did_you_mean/issue-34337.rs | 2 +- src/test/ui/did_you_mean/issue-34337.stderr | 2 +- src/test/ui/did_you_mean/issue-35937.rs | 6 +- src/test/ui/did_you_mean/issue-35937.stderr | 6 +- src/test/ui/did_you_mean/issue-36798.rs | 2 +- src/test/ui/did_you_mean/issue-36798.stderr | 2 +- .../did_you_mean/issue-36798_unknown_field.rs | 2 +- .../issue-36798_unknown_field.stderr | 2 +- src/test/ui/did_you_mean/issue-37139.rs | 2 +- src/test/ui/did_you_mean/issue-37139.stderr | 2 +- ...ssue-38054-do-not-show-unresolved-names.rs | 4 +- ...-38054-do-not-show-unresolved-names.stderr | 4 +- src/test/ui/did_you_mean/issue-38147-1.rs | 2 +- src/test/ui/did_you_mean/issue-38147-1.stderr | 2 +- src/test/ui/did_you_mean/issue-38147-2.rs | 2 +- src/test/ui/did_you_mean/issue-38147-2.stderr | 2 +- src/test/ui/did_you_mean/issue-38147-3.rs | 2 +- src/test/ui/did_you_mean/issue-38147-3.stderr | 2 +- src/test/ui/did_you_mean/issue-38147-4.rs | 2 +- src/test/ui/did_you_mean/issue-38147-4.stderr | 2 +- src/test/ui/did_you_mean/issue-39544.rs | 24 +-- src/test/ui/did_you_mean/issue-39544.stderr | 32 ++-- .../issue-39802-show-5-trait-impls.rs | 6 +- .../issue-39802-show-5-trait-impls.stderr | 6 +- src/test/ui/did_you_mean/issue-40006.rs | 16 +- src/test/ui/did_you_mean/issue-40006.stderr | 42 ++--- src/test/ui/did_you_mean/issue-40396.rs | 7 +- src/test/ui/did_you_mean/issue-40396.stderr | 8 +- src/test/ui/did_you_mean/issue-40823.rs | 2 +- src/test/ui/did_you_mean/issue-40823.stderr | 2 +- src/test/ui/did_you_mean/issue-41679.rs | 2 +- src/test/ui/did_you_mean/issue-41679.stderr | 2 +- .../issue-42599_available_fields_note.rs | 4 + .../issue-42599_available_fields_note.stderr | 12 +- src/test/ui/did_you_mean/issue-42764.rs | 1 + .../issue-43871-enum-instead-of-variant.rs | 6 +- ...issue-43871-enum-instead-of-variant.stderr | 6 +- src/test/ui/did_you_mean/recursion_limit.rs | 2 +- .../ui/did_you_mean/recursion_limit.stderr | 2 +- .../ui/did_you_mean/recursion_limit_deref.rs | 5 +- .../did_you_mean/recursion_limit_deref.stderr | 8 +- .../ui/did_you_mean/recursion_limit_macro.rs | 2 +- .../did_you_mean/recursion_limit_macro.stderr | 2 +- ...ect-reference-without-parens-suggestion.rs | 5 +- ...reference-without-parens-suggestion.stderr | 8 +- .../ui/dropck/dropck-eyepatch-extern-crate.rs | 13 +- .../dropck-eyepatch-extern-crate.stderr | 16 +- src/test/ui/dropck/dropck-eyepatch-reorder.rs | 12 +- .../ui/dropck/dropck-eyepatch-reorder.stderr | 8 +- src/test/ui/dropck/dropck-eyepatch.rs | 12 +- src/test/ui/dropck/dropck-eyepatch.stderr | 8 +- src/test/ui/e0119/complex-impl.rs | 5 +- src/test/ui/e0119/complex-impl.stderr | 4 +- src/test/ui/e0119/conflict-with-std.rs | 8 +- src/test/ui/e0119/conflict-with-std.stderr | 6 +- src/test/ui/e0119/issue-23563.rs | 4 +- src/test/ui/e0119/issue-23563.stderr | 2 +- src/test/ui/e0119/issue-27403.rs | 4 +- src/test/ui/e0119/issue-27403.stderr | 2 +- src/test/ui/e0119/issue-28981.rs | 5 +- src/test/ui/e0119/issue-28981.stderr | 4 +- src/test/ui/e0119/so-37347311.rs | 4 +- src/test/ui/e0119/so-37347311.stderr | 2 +- src/test/ui/fmt/send-sync.rs | 4 +- src/test/ui/fmt/send-sync.stderr | 4 +- .../ref-escapes-but-not-over-yield.rs | 4 +- .../ref-escapes-but-not-over-yield.stderr | 4 +- .../generator/yield-while-local-borrowed.rs | 2 +- src/test/ui/impl-trait/equality.rs | 2 +- ...issue-21659-show-relevant-trait-impls-3.rs | 1 - .../method-suggestion-no-duplication.rs | 5 +- .../impl-trait/no-method-suggested-traits.rs | 77 +++------ .../no-method-suggested-traits.stderr | 162 +++++++++--------- src/test/ui/impl-trait/trait_type.rs | 4 + src/test/ui/impl-trait/trait_type.stderr | 12 +- .../impl-trait/universal-mismatched-type.rs | 2 +- .../universal-mismatched-type.stderr | 2 +- .../impl-trait/universal-two-impl-traits.rs | 2 +- .../universal-two-impl-traits.stderr | 2 +- .../ui/impl-trait/universal_wrong_bounds.rs | 6 +- .../impl-trait/universal_wrong_bounds.stderr | 6 +- src/test/ui/in-band-lifetimes/E0687.rs | 8 +- src/test/ui/in-band-lifetimes/E0687.stderr | 8 +- src/test/ui/in-band-lifetimes/E0687_where.rs | 4 +- .../ui/in-band-lifetimes/E0687_where.stderr | 4 +- src/test/ui/in-band-lifetimes/E0688.rs | 6 +- src/test/ui/in-band-lifetimes/E0688.stderr | 6 +- src/test/ui/in-band-lifetimes/mismatched.rs | 4 +- .../ui/in-band-lifetimes/mismatched.stderr | 4 +- .../ui/in-band-lifetimes/mismatched_trait.rs | 2 +- .../in-band-lifetimes/mismatched_trait.stderr | 2 +- .../mismatched_trait_impl.rs | 2 +- .../mismatched_trait_impl.stderr | 10 +- .../ui/in-band-lifetimes/mut_while_borrow.rs | 2 +- .../in-band-lifetimes/mut_while_borrow.stderr | 2 +- .../in-band-lifetimes/no_in_band_in_struct.rs | 4 +- .../no_in_band_in_struct.stderr | 4 +- .../no_introducing_in_band_in_locals.rs | 4 +- .../no_introducing_in_band_in_locals.stderr | 4 +- src/test/ui/in-band-lifetimes/shadow.rs | 4 +- src/test/ui/in-band-lifetimes/shadow.stderr | 6 +- .../interior-mutability.rs | 2 +- .../interior-mutability.stderr | 2 +- src/test/ui/issue-13483.rs | 4 +- src/test/ui/issue-13483.stderr | 4 +- src/test/ui/issue-22644.rs | 16 +- src/test/ui/issue-22644.stderr | 50 +++--- src/test/ui/issue-33525.rs | 6 +- src/test/ui/issue-33525.stderr | 6 +- src/test/ui/issue-33941.rs | 3 +- src/test/ui/issue-33941.stderr | 4 +- src/test/ui/issue-35241.rs | 2 +- src/test/ui/issue-35241.stderr | 2 +- src/test/ui/issue-35675.rs | 6 +- src/test/ui/issue-35675.stderr | 16 +- src/test/ui/issue-35976.rs | 1 - src/test/ui/issue-36400.rs | 2 +- src/test/ui/issue-36400.stderr | 2 +- .../issue-37311.rs | 2 +- .../issue-37311.stderr | 2 +- .../ui/issue-40402-ref-hints/issue-40402-1.rs | 2 +- .../issue-40402-1.stderr | 2 +- .../ui/issue-40402-ref-hints/issue-40402-2.rs | 2 +- .../issue-40402-2.stderr | 2 +- src/test/ui/issue-40782.rs | 2 +- src/test/ui/issue-40782.stderr | 2 +- src/test/ui/issue-42106.rs | 2 +- src/test/ui/issue-42106.stderr | 2 +- src/test/ui/issue-42954.rs | 2 +- src/test/ui/issue-42954.stderr | 2 +- src/test/ui/issue-44023.rs | 2 +- src/test/ui/issue-44023.stderr | 2 +- src/test/ui/issue-44078.rs | 2 +- src/test/ui/issue-44078.stderr | 2 +- src/test/ui/issue-44406.rs | 3 +- src/test/ui/issue-44406.stderr | 4 +- ...sue-45107-unnecessary-unsafe-in-closure.rs | 6 +- ...45107-unnecessary-unsafe-in-closure.stderr | 14 +- src/test/ui/issue-45296.rs | 2 +- src/test/ui/issue-45296.stderr | 2 +- src/test/ui/issue-45730.rs | 6 +- src/test/ui/issue-45730.stderr | 6 +- .../42701_one_named_and_one_anonymous.rs | 2 +- .../42701_one_named_and_one_anonymous.stderr | 2 +- ...one-existing-name-early-bound-in-struct.rs | 2 +- ...existing-name-early-bound-in-struct.stderr | 2 +- .../ex1-return-one-existing-name-if-else-2.rs | 2 +- ...-return-one-existing-name-if-else-2.stderr | 2 +- .../ex1-return-one-existing-name-if-else-3.rs | 2 +- ...-return-one-existing-name-if-else-3.stderr | 2 +- ...-one-existing-name-if-else-using-impl-2.rs | 2 +- ...-existing-name-if-else-using-impl-2.stderr | 2 +- ...-one-existing-name-if-else-using-impl-3.rs | 2 +- ...-existing-name-if-else-using-impl-3.stderr | 2 +- ...rn-one-existing-name-if-else-using-impl.rs | 2 +- ...ne-existing-name-if-else-using-impl.stderr | 2 +- .../ex1-return-one-existing-name-if-else.rs | 2 +- ...x1-return-one-existing-name-if-else.stderr | 2 +- ...n-one-existing-name-return-type-is-anon.rs | 2 +- ...e-existing-name-return-type-is-anon.stderr | 2 +- ...1-return-one-existing-name-self-is-anon.rs | 2 +- ...turn-one-existing-name-self-is-anon.stderr | 2 +- .../ex1b-return-no-names-if-else.rs | 2 +- .../ex1b-return-no-names-if-else.stderr | 2 +- .../ex2a-push-one-existing-name-2.rs | 2 +- .../ex2a-push-one-existing-name-2.stderr | 2 +- ...ex2a-push-one-existing-name-early-bound.rs | 2 +- ...-push-one-existing-name-early-bound.stderr | 2 +- .../ex2a-push-one-existing-name.rs | 2 +- .../ex2a-push-one-existing-name.stderr | 2 +- .../ex2b-push-no-existing-names.rs | 2 +- .../ex2b-push-no-existing-names.stderr | 2 +- .../ex2c-push-inference-variable.rs | 2 +- .../ex2c-push-inference-variable.stderr | 2 +- .../ex2d-push-inference-variable-2.rs | 2 +- .../ex2d-push-inference-variable-2.stderr | 2 +- .../ex2e-push-inference-variable-3.rs | 2 +- .../ex2e-push-inference-variable-3.stderr | 2 +- .../ex3-both-anon-regions-2.rs | 2 +- .../ex3-both-anon-regions-2.stderr | 2 +- .../ex3-both-anon-regions-3.rs | 3 +- .../ex3-both-anon-regions-3.stderr | 4 +- ...x3-both-anon-regions-both-are-structs-2.rs | 2 +- ...oth-anon-regions-both-are-structs-2.stderr | 2 +- ...x3-both-anon-regions-both-are-structs-3.rs | 4 +- ...oth-anon-regions-both-are-structs-3.stderr | 2 +- ...x3-both-anon-regions-both-are-structs-4.rs | 2 +- ...oth-anon-regions-both-are-structs-4.stderr | 2 +- ...ons-both-are-structs-earlybound-regions.rs | 2 +- ...both-are-structs-earlybound-regions.stderr | 2 +- ...ions-both-are-structs-latebound-regions.rs | 2 +- ...-both-are-structs-latebound-regions.stderr | 2 +- .../ex3-both-anon-regions-both-are-structs.rs | 2 +- ...-both-anon-regions-both-are-structs.stderr | 2 +- ...ex3-both-anon-regions-latebound-regions.rs | 4 +- ...both-anon-regions-latebound-regions.stderr | 2 +- .../ex3-both-anon-regions-one-is-struct-2.rs | 2 +- ...3-both-anon-regions-one-is-struct-2.stderr | 2 +- .../ex3-both-anon-regions-one-is-struct-3.rs | 2 +- ...3-both-anon-regions-one-is-struct-3.stderr | 2 +- .../ex3-both-anon-regions-one-is-struct-4.rs | 2 +- ...3-both-anon-regions-one-is-struct-4.stderr | 2 +- .../ex3-both-anon-regions-one-is-struct.rs | 2 +- ...ex3-both-anon-regions-one-is-struct.stderr | 2 +- ...3-both-anon-regions-return-type-is-anon.rs | 2 +- ...th-anon-regions-return-type-is-anon.stderr | 2 +- .../ex3-both-anon-regions-self-is-anon.rs | 2 +- .../ex3-both-anon-regions-self-is-anon.stderr | 2 +- .../ex3-both-anon-regions-using-fn-items.rs | 2 +- ...x3-both-anon-regions-using-fn-items.stderr | 2 +- .../ex3-both-anon-regions-using-impl-items.rs | 2 +- ...-both-anon-regions-using-impl-items.stderr | 2 +- ...3-both-anon-regions-using-trait-objects.rs | 2 +- ...th-anon-regions-using-trait-objects.stderr | 2 +- .../lifetime-errors/ex3-both-anon-regions.rs | 2 +- .../ex3-both-anon-regions.stderr | 2 +- .../ui/lifetimes/borrowck-let-suggestion.rs | 2 +- .../lifetimes/borrowck-let-suggestion.stderr | 2 +- .../lifetime-doesnt-live-long-enough.rs | 6 + .../lifetime-doesnt-live-long-enough.stderr | 58 ++++--- .../ui/lint/command-line-lint-group-deny.rs | 2 +- .../lint/command-line-lint-group-deny.stderr | 2 +- .../ui/lint/command-line-lint-group-forbid.rs | 2 +- .../command-line-lint-group-forbid.stderr | 2 +- src/test/ui/lint/lint-group-style.rs | 10 +- src/test/ui/lint/lint-group-style.stderr | 10 +- src/test/ui/lint/outer-forbid.rs | 6 +- src/test/ui/lint/outer-forbid.stderr | 6 +- src/test/ui/lint/suggestions.rs | 9 + src/test/ui/lint/suggestions.stderr | 44 ++--- src/test/ui/loop-break-value-no-repeat.rs | 2 +- src/test/ui/loop-break-value-no-repeat.stderr | 2 +- src/test/ui/lub-glb/old-lub-glb-hr.rs | 2 +- src/test/ui/lub-glb/old-lub-glb-hr.stderr | 2 +- src/test/ui/lub-glb/old-lub-glb-object.rs | 2 +- src/test/ui/lub-glb/old-lub-glb-object.stderr | 2 +- src/test/ui/macro_backtrace/main.rs | 3 +- src/test/ui/macro_backtrace/main.stderr | 8 +- src/test/ui/macros/bad_hello.rs | 2 +- src/test/ui/macros/bad_hello.stderr | 2 +- src/test/ui/macros/format-foreign.rs | 6 +- src/test/ui/macros/format-foreign.stderr | 6 +- src/test/ui/macros/format-unused-lables.rs | 2 +- .../ui/macros/format-unused-lables.stderr | 2 +- .../macro-backtrace-invalid-internals.rs | 12 +- .../macro-backtrace-invalid-internals.stderr | 12 +- src/test/ui/macros/macro-backtrace-nested.rs | 3 +- .../ui/macros/macro-backtrace-nested.stderr | 8 +- src/test/ui/macros/macro-backtrace-println.rs | 2 +- .../ui/macros/macro-backtrace-println.stderr | 2 +- src/test/ui/macros/macro-name-typo.rs | 2 +- src/test/ui/macros/macro-name-typo.stderr | 2 +- .../ui/macros/macro_path_as_generic_bound.rs | 2 +- .../macros/macro_path_as_generic_bound.stderr | 2 +- src/test/ui/macros/macro_undefined.rs | 4 +- src/test/ui/macros/macro_undefined.stderr | 4 +- src/test/ui/macros/trace_faulty_macros.rs | 4 +- src/test/ui/macros/trace_faulty_macros.stderr | 4 +- src/test/ui/method-call-err-msg.rs | 2 +- src/test/ui/method-call-err-msg.stderr | 2 +- src/test/ui/mismatched_types/E0053.rs | 2 +- src/test/ui/mismatched_types/E0053.stderr | 4 +- src/test/ui/mismatched_types/E0409.rs | 1 - src/test/ui/mismatched_types/E0631.rs | 8 +- src/test/ui/mismatched_types/E0631.stderr | 8 +- src/test/ui/mismatched_types/abridged.rs | 12 +- src/test/ui/mismatched_types/abridged.stderr | 12 +- src/test/ui/mismatched_types/binops.rs | 12 +- src/test/ui/mismatched_types/binops.stderr | 12 +- src/test/ui/mismatched_types/cast-rfc0401.rs | 68 ++++---- .../ui/mismatched_types/cast-rfc0401.stderr | 70 ++++---- .../ui/mismatched_types/closure-arg-count.rs | 7 + .../mismatched_types/closure-arg-count.stderr | 24 +-- .../closure-arg-type-mismatch.rs | 9 +- .../closure-arg-type-mismatch.stderr | 10 +- .../ui/mismatched_types/closure-mismatch.rs | 3 +- .../mismatched_types/closure-mismatch.stderr | 4 +- .../ui/mismatched_types/const-fn-in-trait.rs | 4 +- .../mismatched_types/const-fn-in-trait.stderr | 4 +- src/test/ui/mismatched_types/fn-variance-1.rs | 6 +- .../ui/mismatched_types/fn-variance-1.stderr | 4 +- src/test/ui/mismatched_types/issue-19109.rs | 1 - src/test/ui/mismatched_types/issue-26480.rs | 4 +- .../ui/mismatched_types/issue-26480.stderr | 4 +- src/test/ui/mismatched_types/issue-35030.rs | 2 +- .../ui/mismatched_types/issue-35030.stderr | 2 +- src/test/ui/mismatched_types/issue-36053-2.rs | 11 +- src/test/ui/mismatched_types/issue-38371.rs | 8 +- .../ui/mismatched_types/issue-38371.stderr | 8 +- src/test/ui/mismatched_types/main.rs | 2 +- src/test/ui/mismatched_types/main.stderr | 2 +- .../mismatched_types/overloaded-calls-bad.rs | 1 - .../overloaded-calls-bad.stderr | 8 +- .../trait-bounds-cant-coerce.rs | 3 +- .../trait-impl-fn-incompatibility.rs | 4 +- .../trait-impl-fn-incompatibility.stderr | 4 +- .../unboxed-closures-vtable-mismatch.rs | 11 +- .../unboxed-closures-vtable-mismatch.stderr | 6 +- src/test/ui/missing-items/issue-40221.rs | 2 +- src/test/ui/missing-items/issue-40221.stderr | 2 +- src/test/ui/missing-items/m2.rs | 2 +- src/test/ui/missing-items/m2.stderr | 2 +- .../missing-items/missing-type-parameter.rs | 2 +- .../missing-type-parameter.stderr | 2 +- src/test/ui/mut-ref.rs | 2 +- src/test/ui/mut-ref.stderr | 2 +- src/test/ui/nll/get_default.rs | 4 + src/test/ui/nll/get_default.stderr | 28 +-- src/test/ui/nll/named-region-basic.rs | 4 +- src/test/ui/nll/named-region-basic.stderr | 12 +- .../ui/on-unimplemented/bad-annotation.rs | 9 +- .../ui/on-unimplemented/bad-annotation.stderr | 26 +-- src/test/ui/pub/pub-restricted-error-fn.rs | 2 +- .../ui/pub/pub-restricted-error-fn.stderr | 2 +- src/test/ui/pub/pub-restricted-error.rs | 2 +- src/test/ui/pub/pub-restricted-error.stderr | 2 +- src/test/ui/pub/pub-restricted-non-path.rs | 2 +- .../ui/pub/pub-restricted-non-path.stderr | 2 +- src/test/ui/pub/pub-restricted.rs | 10 +- src/test/ui/pub/pub-restricted.stderr | 10 +- src/test/ui/reachable/expr_add.rs | 2 +- src/test/ui/reachable/expr_add.stderr | 2 +- src/test/ui/reachable/expr_array.rs | 4 +- src/test/ui/reachable/expr_array.stderr | 4 +- src/test/ui/reachable/expr_assign.rs | 6 +- src/test/ui/reachable/expr_assign.stderr | 6 +- src/test/ui/reachable/expr_block.rs | 2 +- src/test/ui/reachable/expr_block.stderr | 2 +- src/test/ui/reachable/expr_box.rs | 2 +- src/test/ui/reachable/expr_box.stderr | 2 +- src/test/ui/reachable/expr_call.rs | 4 +- src/test/ui/reachable/expr_call.stderr | 4 +- src/test/ui/reachable/expr_cast.rs | 2 +- src/test/ui/reachable/expr_cast.stderr | 2 +- src/test/ui/reachable/expr_match.rs | 2 +- src/test/ui/reachable/expr_match.stderr | 2 +- src/test/ui/reachable/expr_method.rs | 4 +- src/test/ui/reachable/expr_method.stderr | 4 +- src/test/ui/reachable/expr_repeat.rs | 2 +- src/test/ui/reachable/expr_repeat.stderr | 2 +- src/test/ui/reachable/expr_return.rs | 2 +- src/test/ui/reachable/expr_return.stderr | 2 +- src/test/ui/reachable/expr_struct.rs | 8 +- src/test/ui/reachable/expr_struct.stderr | 8 +- src/test/ui/reachable/expr_tup.rs | 4 +- src/test/ui/reachable/expr_tup.stderr | 4 +- src/test/ui/reachable/expr_type.rs | 2 +- src/test/ui/reachable/expr_type.stderr | 2 +- src/test/ui/reachable/expr_unary.rs | 3 +- src/test/ui/reachable/expr_unary.stderr | 4 +- .../ui/resolve/enums-are-namespaced-xc.rs | 9 +- .../ui/resolve/enums-are-namespaced-xc.stderr | 8 +- src/test/ui/resolve/issue-14254.rs | 77 ++++----- src/test/ui/resolve/issue-14254.stderr | 104 +++++------ src/test/ui/resolve/issue-16058.rs | 4 - src/test/ui/resolve/issue-17518.rs | 4 +- src/test/ui/resolve/issue-17518.stderr | 4 +- src/test/ui/resolve/issue-21221-1.rs | 19 +- src/test/ui/resolve/issue-21221-1.stderr | 12 +- src/test/ui/resolve/issue-21221-2.rs | 4 +- src/test/ui/resolve/issue-21221-2.stderr | 4 +- src/test/ui/resolve/issue-21221-3.rs | 4 +- src/test/ui/resolve/issue-21221-3.stderr | 4 +- src/test/ui/resolve/issue-21221-4.rs | 4 +- src/test/ui/resolve/issue-21221-4.stderr | 4 +- src/test/ui/resolve/issue-23305.rs | 9 +- src/test/ui/resolve/issue-2356.rs | 56 +++--- src/test/ui/resolve/issue-2356.stderr | 64 +++---- src/test/ui/resolve/issue-24968.rs | 2 +- src/test/ui/resolve/issue-39226.rs | 5 +- src/test/ui/resolve/issue-5035.rs | 1 + src/test/ui/resolve/issue-5035.stderr | 4 +- src/test/ui/resolve/levenshtein.rs | 8 + src/test/ui/resolve/levenshtein.stderr | 28 +-- src/test/ui/resolve/privacy-struct-ctor.rs | 6 +- .../ui/resolve/privacy-struct-ctor.stderr | 28 +-- .../ui/resolve/resolve-assoc-suggestions.rs | 33 ++-- .../resolve/resolve-assoc-suggestions.stderr | 24 +-- .../resolve/resolve-speculative-adjustment.rs | 14 +- .../resolve-speculative-adjustment.stderr | 4 +- .../suggest-path-instead-of-mod-dot-item.rs | 8 +- ...uggest-path-instead-of-mod-dot-item.stderr | 20 +-- src/test/ui/resolve/token-error-correct-2.rs | 4 +- src/test/ui/resolve/token-error-correct-3.rs | 9 +- .../ui/resolve/token-error-correct-3.stderr | 16 +- src/test/ui/resolve/token-error-correct.rs | 5 - .../ui/resolve/token-error-correct.stderr | 12 +- src/test/ui/resolve/tuple-struct-alias.rs | 8 +- src/test/ui/resolve/tuple-struct-alias.stderr | 8 +- ...unboxed-closure-sugar-nonexistent-trait.rs | 4 +- .../resolve/unresolved_static_type_field.rs | 4 +- .../ui/resolve/use_suggestion_placement.rs | 6 +- .../resolve/use_suggestion_placement.stderr | 6 +- .../ui/rfc-2005-default-binding-mode/const.rs | 2 +- .../const.stderr | 2 +- .../ui/rfc-2005-default-binding-mode/enum.rs | 6 +- .../rfc-2005-default-binding-mode/enum.stderr | 6 +- .../explicit-mut.rs | 6 +- .../explicit-mut.stderr | 6 +- .../ui/rfc-2005-default-binding-mode/for.rs | 1 + .../issue-44912-or.rs | 1 + .../ui/rfc-2005-default-binding-mode/lit.rs | 4 +- .../rfc-2005-default-binding-mode/lit.stderr | 4 +- .../no-double-error.rs | 2 +- .../no-double-error.stderr | 2 +- .../ui/rfc-2005-default-binding-mode/slice.rs | 2 +- .../slice.stderr | 2 +- .../suggestion.rs | 2 +- .../suggestion.stderr | 2 +- .../fn_must_use.rs | 13 +- .../fn_must_use.stderr | 20 +-- src/test/ui/similar-tokens.rs | 2 +- src/test/ui/similar-tokens.stderr | 2 +- src/test/ui/span/E0072.rs | 2 +- src/test/ui/span/E0072.stderr | 2 +- src/test/ui/span/E0204.rs | 8 +- src/test/ui/span/E0204.stderr | 8 +- src/test/ui/span/E0493.rs | 1 + .../borrowck-call-is-borrow-issue-12224.rs | 3 +- ...borrowck-call-is-borrow-issue-12224.stderr | 33 ++-- .../span/borrowck-let-suggestion-suffixes.rs | 6 +- src/test/ui/span/borrowck-ref-into-rvalue.rs | 4 +- .../ui/span/borrowck-ref-into-rvalue.stderr | 4 +- src/test/ui/span/coerce-suggestions.rs | 11 -- src/test/ui/span/coerce-suggestions.stderr | 20 +-- src/test/ui/span/destructor-restrictions.rs | 4 +- .../ui/span/destructor-restrictions.stderr | 4 +- src/test/ui/span/gated-features-attr-spans.rs | 7 +- .../ui/span/gated-features-attr-spans.stderr | 8 +- src/test/ui/span/impl-wrong-item-for-trait.rs | 11 ++ .../ui/span/impl-wrong-item-for-trait.stderr | 68 ++++---- src/test/ui/span/issue-11925.rs | 2 +- src/test/ui/span/issue-11925.stderr | 2 +- src/test/ui/span/issue-15480.rs | 2 +- src/test/ui/span/issue-15480.stderr | 2 +- ...e-23338-locals-die-before-temps-of-body.rs | 4 +- ...338-locals-die-before-temps-of-body.stderr | 4 +- src/test/ui/span/issue-24690.rs | 7 +- src/test/ui/span/issue-24690.stderr | 17 +- src/test/ui/span/issue-27522.rs | 2 +- src/test/ui/span/issue-27522.stderr | 2 +- src/test/ui/span/issue-34264.rs | 11 +- src/test/ui/span/issue-34264.stderr | 24 +-- src/test/ui/span/issue-35987.rs | 1 + src/test/ui/span/issue-36530.rs | 4 +- src/test/ui/span/issue-36530.stderr | 4 +- src/test/ui/span/issue-37767.rs | 6 +- src/test/ui/span/issue-37767.stderr | 6 +- src/test/ui/span/issue-39018.rs | 2 + src/test/ui/span/issue-39018.stderr | 4 +- src/test/ui/span/issue-39698.rs | 4 + src/test/ui/span/issue-40157.rs | 1 + .../ui/span/issue-43927-non-ADT-derive.rs | 1 + src/test/ui/span/issue-7575.rs | 10 +- src/test/ui/span/issue-7575.stderr | 2 +- src/test/ui/span/macro-span-replacement.rs | 2 +- .../ui/span/macro-span-replacement.stderr | 2 +- src/test/ui/span/macro-ty-params.rs | 7 +- src/test/ui/span/macro-ty-params.stderr | 8 +- src/test/ui/span/missing-unit-argument.rs | 12 +- src/test/ui/span/missing-unit-argument.stderr | 20 +-- src/test/ui/span/move-closure.rs | 2 +- src/test/ui/span/move-closure.stderr | 2 +- src/test/ui/span/multiline-span-E0072.rs | 2 +- src/test/ui/span/multiline-span-E0072.stderr | 2 +- src/test/ui/span/multiline-span-simple.rs | 2 +- src/test/ui/span/multiline-span-simple.stderr | 2 +- src/test/ui/span/multispan-import-lint.rs | 1 + src/test/ui/span/mut-arg-hint.rs | 6 +- src/test/ui/span/mut-arg-hint.stderr | 6 +- src/test/ui/span/mut-ptr-cant-outlive-ref.rs | 4 +- .../ui/span/mut-ptr-cant-outlive-ref.stderr | 4 +- .../ui/span/non-existing-module-import.rs | 2 +- .../ui/span/non-existing-module-import.stderr | 2 +- src/test/ui/span/pub-struct-field.rs | 4 +- src/test/ui/span/pub-struct-field.stderr | 6 +- src/test/ui/span/range-2.rs | 4 +- src/test/ui/span/range-2.stderr | 12 +- src/test/ui/span/recursive-type-field.rs | 4 +- src/test/ui/span/recursive-type-field.stderr | 4 +- .../regionck-unboxed-closure-lifetimes.rs | 4 +- .../regionck-unboxed-closure-lifetimes.stderr | 4 +- .../regions-close-over-borrowed-ref-in-obj.rs | 2 +- ...ions-close-over-borrowed-ref-in-obj.stderr | 2 +- .../regions-close-over-type-parameter-2.rs | 4 +- ...regions-close-over-type-parameter-2.stderr | 4 +- .../span/regions-escape-loop-via-variable.rs | 4 +- .../regions-escape-loop-via-variable.stderr | 4 +- .../ui/span/regions-escape-loop-via-vec.rs | 7 +- .../span/regions-escape-loop-via-vec.stderr | 14 +- .../regions-infer-borrow-scope-within-loop.rs | 4 +- ...ions-infer-borrow-scope-within-loop.stderr | 4 +- .../send-is-not-static-ensures-scoping.rs | 4 +- .../send-is-not-static-ensures-scoping.stderr | 6 +- .../ui/span/send-is-not-static-std-sync-2.rs | 12 +- .../span/send-is-not-static-std-sync-2.stderr | 12 +- .../ui/span/send-is-not-static-std-sync.rs | 12 +- .../span/send-is-not-static-std-sync.stderr | 12 +- src/test/ui/span/slice-borrow.rs | 2 +- src/test/ui/span/slice-borrow.stderr | 2 +- src/test/ui/span/suggestion-non-ascii.rs | 2 +- src/test/ui/span/suggestion-non-ascii.stderr | 2 +- src/test/ui/span/type-binding.rs | 1 + src/test/ui/span/typo-suggestion.rs | 4 +- src/test/ui/span/typo-suggestion.stderr | 4 +- .../span/unused-warning-point-at-signature.rs | 8 +- .../unused-warning-point-at-signature.stderr | 8 +- src/test/ui/span/visibility-ty-params.rs | 1 - src/test/ui/span/visibility-ty-params.stderr | 4 +- .../ui/span/wf-method-late-bound-regions.rs | 4 +- .../span/wf-method-late-bound-regions.stderr | 4 +- src/test/ui/static-lifetime.rs | 4 +- src/test/ui/static-lifetime.stderr | 4 +- src/test/ui/str-lit-type-mismatch.rs | 6 +- src/test/ui/str-lit-type-mismatch.stderr | 6 +- src/test/ui/struct-field-init-syntax.rs | 4 +- .../closure-immutable-outer-variable.rs | 2 +- .../closure-immutable-outer-variable.stderr | 2 +- .../confuse-field-and-method/issue-18343.rs | 2 +- .../issue-18343.stderr | 2 +- .../confuse-field-and-method/issue-2392.rs | 11 ++ .../issue-2392.stderr | 88 +++++----- .../confuse-field-and-method/issue-32128.rs | 2 +- .../issue-32128.stderr | 2 +- .../confuse-field-and-method/issue-33784.rs | 6 +- .../confuse-field-and-method/private-field.rs | 2 +- .../private-field.stderr | 2 +- .../ui/suggestions/extern-crate-rename.rs | 2 +- .../ui/suggestions/extern-crate-rename.stderr | 2 +- .../issue-32354-suggest-import-rename.rs | 2 +- .../issue-32354-suggest-import-rename.stderr | 4 +- .../issue-43420-no-over-suggest.rs | 2 +- .../issue-43420-no-over-suggest.stderr | 2 +- src/test/ui/suggestions/suggest-labels.rs | 6 +- src/test/ui/suggestions/suggest-labels.stderr | 6 +- src/test/ui/suggestions/suggest-methods.rs | 8 +- .../ui/suggestions/suggest-methods.stderr | 8 +- src/test/ui/suggestions/try-on-option.rs | 4 +- src/test/ui/suggestions/try-on-option.stderr | 4 +- .../ui/suggestions/try-operator-on-main.rs | 8 +- .../suggestions/try-operator-on-main.stderr | 8 +- src/test/ui/suggestions/tuple-float-index.rs | 2 +- .../ui/suggestions/tuple-float-index.stderr | 2 +- .../type-ascription-instead-of-initializer.rs | 3 +- ...e-ascription-instead-of-initializer.stderr | 4 +- ...ype-ascription-instead-of-statement-end.rs | 4 +- ...ascription-instead-of-statement-end.stderr | 4 +- .../type-ascription-with-fn-call.rs | 2 +- .../type-ascription-with-fn-call.stderr | 2 +- src/test/ui/token/bounds-obj-parens.rs | 1 - src/test/ui/token/issue-10636-2.rs | 2 +- src/test/ui/token/issue-41155.rs | 4 +- src/test/ui/token/issue-41155.stderr | 4 +- src/test/ui/token/macro-incomplete-parse.rs | 2 +- src/test/ui/token/trailing-plus-in-bounds.rs | 1 - src/test/ui/trait-method-private.rs | 2 +- src/test/ui/trait-method-private.stderr | 2 +- .../transmute-from-fn-item-types-error.rs | 34 ++-- .../ui/transmute/transmute-type-parameters.rs | 12 +- src/test/ui/type-check/assignment-in-if.rs | 8 +- .../type-check/cannot_infer_local_or_array.rs | 2 +- .../cannot_infer_local_or_array.stderr | 2 +- src/test/ui/type-check/issue-22897.rs | 2 +- src/test/ui/type-check/issue-22897.stderr | 2 +- src/test/ui/type-check/issue-40294.rs | 2 +- src/test/ui/type-check/issue-40294.stderr | 2 +- src/test/ui/type-check/issue-41314.rs | 3 +- src/test/ui/type-check/issue-41314.stderr | 4 +- .../ui/type-check/unknown_type_for_closure.rs | 2 +- .../unknown_type_for_closure.stderr | 2 +- src/test/ui/unboxed-closure-no-cyclic-sig.rs | 2 +- .../ui/unboxed-closure-no-cyclic-sig.stderr | 2 +- ...ures-infer-fn-once-move-from-projection.rs | 2 +- ...-infer-fn-once-move-from-projection.stderr | 4 +- src/test/ui/union-fields.rs | 8 +- src/test/ui/union-fields.stderr | 8 +- src/test/ui/union-sized-field.rs | 6 +- src/test/ui/union-sized-field.stderr | 6 +- src/tools/compiletest/src/runtest.rs | 18 +- src/tools/miri | 2 +- 670 files changed, 2181 insertions(+), 2112 deletions(-) create mode 100644 src/test/ui/command-line-diagnostics.rs create mode 100644 src/test/ui/command-line-diagnostics.stderr diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index b2f4acb21a8cf..642153c08f651 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -359,7 +359,11 @@ impl Session { diag_builder: &'b mut DiagnosticBuilder<'a>, method: DiagnosticBuilderMethod, lint: &'static lint::Lint, message: &str, span: Option) { - 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 @@ impl Session { 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() } } diff --git a/src/test/compile-fail/issue-31221.rs b/src/test/compile-fail/issue-31221.rs index e2b80215caf61..8701ca0178fc9 100644 --- a/src/test/compile-fail/issue-31221.rs +++ b/src/test/compile-fail/issue-31221.rs @@ -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 { diff --git a/src/test/compile-fail/lint-output-format-2.rs b/src/test/compile-fail/lint-output-format-2.rs index 8dc46558cb0d5..29d7c6caec468 100644 --- a/src/test/compile-fail/lint-output-format-2.rs +++ b/src/test/compile-fail/lint-output-format-2.rs @@ -25,6 +25,5 @@ use lint_output_format::{foo, bar}; 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(); } diff --git a/src/test/compile-fail/lint-unconditional-recursion.rs b/src/test/compile-fail/lint-unconditional-recursion.rs index 94e189aa47f6f..bee5a2c45be6d 100644 --- a/src/test/compile-fail/lint-unconditional-recursion.rs +++ b/src/test/compile-fail/lint-unconditional-recursion.rs @@ -10,19 +10,7 @@ #![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 diff --git a/src/test/ui-fulldeps/custom-derive/issue-36935.rs b/src/test/ui-fulldeps/custom-derive/issue-36935.rs index 2231c3c242285..4fd8763206733 100644 --- a/src/test/ui-fulldeps/custom-derive/issue-36935.rs +++ b/src/test/ui-fulldeps/custom-derive/issue-36935.rs @@ -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, diff --git a/src/test/ui-fulldeps/custom-derive/issue-36935.stderr b/src/test/ui-fulldeps/custom-derive/issue-36935.stderr index 46cc7a42b0429..55848c6553cca 100644 --- a/src/test/ui-fulldeps/custom-derive/issue-36935.stderr +++ b/src/test/ui-fulldeps/custom-derive/issue-36935.stderr @@ -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 diff --git a/src/test/ui-fulldeps/issue-44953/issue-44953.rs b/src/test/ui-fulldeps/issue-44953/issue-44953.rs index 256305bf17df8..de798e2cf0baa 100644 --- a/src/test/ui-fulldeps/issue-44953/issue-44953.rs +++ b/src/test/ui-fulldeps/issue-44953/issue-44953.rs @@ -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."); diff --git a/src/test/ui-fulldeps/issue-44953/issue-44953.stderr b/src/test/ui-fulldeps/issue-44953/issue-44953.stderr index ce17ea7916122..4493ec14024c0 100644 --- a/src/test/ui-fulldeps/issue-44953/issue-44953.stderr +++ b/src/test/ui-fulldeps/issue-44953/issue-44953.stderr @@ -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 diff --git a/src/test/ui-fulldeps/proc-macro/three-equals.rs b/src/test/ui-fulldeps/proc-macro/three-equals.rs index 016e05c51f507..ef2d160529068 100644 --- a/src/test/ui-fulldeps/proc-macro/three-equals.rs +++ b/src/test/ui-fulldeps/proc-macro/three-equals.rs @@ -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 } diff --git a/src/test/ui-fulldeps/proc-macro/three-equals.stderr b/src/test/ui-fulldeps/proc-macro/three-equals.stderr index 1afe0be280009..0ffaf16107872 100644 --- a/src/test/ui-fulldeps/proc-macro/three-equals.stderr +++ b/src/test/ui-fulldeps/proc-macro/three-equals.stderr @@ -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: `===` diff --git a/src/test/ui-fulldeps/resolve-error.rs b/src/test/ui-fulldeps/resolve-error.rs index dfaa1d7a32e57..ae94a7f13e23e 100644 --- a/src/test/ui-fulldeps/resolve-error.rs +++ b/src/test/ui-fulldeps/resolve-error.rs @@ -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 } diff --git a/src/test/ui-fulldeps/resolve-error.stderr b/src/test/ui-fulldeps/resolve-error.stderr index 754f6bc4f1c1c..be7ebae70adf5 100644 --- a/src/test/ui-fulldeps/resolve-error.stderr +++ b/src/test/ui-fulldeps/resolve-error.stderr @@ -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 diff --git a/src/test/ui/anonymous-higher-ranked-lifetime.rs b/src/test/ui/anonymous-higher-ranked-lifetime.rs index f2d04c16d99e1..295e3d1a73521 100644 --- a/src/test/ui/anonymous-higher-ranked-lifetime.rs +++ b/src/test/ui/anonymous-higher-ranked-lifetime.rs @@ -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 diff --git a/src/test/ui/anonymous-higher-ranked-lifetime.stderr b/src/test/ui/anonymous-higher-ranked-lifetime.stderr index f962b7722036b..6f684f13e6f66 100644 --- a/src/test/ui/anonymous-higher-ranked-lifetime.stderr +++ b/src/test/ui/anonymous-higher-ranked-lifetime.stderr @@ -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 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 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 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 std::ops::Fn(&'s ()) + 'static>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _` diff --git a/src/test/ui/block-result/issue-11714.rs b/src/test/ui/block-result/issue-11714.rs index 192f78e41cb43..255eb771694cc 100644 --- a/src/test/ui/block-result/issue-11714.rs +++ b/src/test/ui/block-result/issue-11714.rs @@ -11,7 +11,7 @@ fn blah() -> i32 { //~ ERROR mismatched types 1 - ; //~ HELP consider removing this semicolon: + ; //~ HELP consider removing this semicolon } fn main() { } diff --git a/src/test/ui/block-result/issue-11714.stderr b/src/test/ui/block-result/issue-11714.stderr index 376834beab0da..4daf40e6172f6 100644 --- a/src/test/ui/block-result/issue-11714.stderr +++ b/src/test/ui/block-result/issue-11714.stderr @@ -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 () diff --git a/src/test/ui/block-result/issue-3563.rs b/src/test/ui/block-result/issue-3563.rs index 7928c04b9df87..31a363a6b863d 100644 --- a/src/test/ui/block-result/issue-3563.rs +++ b/src/test/ui/block-result/issue-3563.rs @@ -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() {} diff --git a/src/test/ui/block-result/unexpected-return-on-unit.rs b/src/test/ui/block-result/unexpected-return-on-unit.rs index 291b7a16f141b..3cf76365c77b1 100644 --- a/src/test/ui/block-result/unexpected-return-on-unit.rs +++ b/src/test/ui/block-result/unexpected-return-on-unit.rs @@ -16,7 +16,7 @@ fn foo() -> usize { } fn bar() { - foo() + foo() //~ ERROR mismatched types } fn main() { diff --git a/src/test/ui/block-result/unexpected-return-on-unit.stderr b/src/test/ui/block-result/unexpected-return-on-unit.stderr index f052883815246..3881bb4625801 100644 --- a/src/test/ui/block-result/unexpected-return-on-unit.stderr +++ b/src/test/ui/block-result/unexpected-return-on-unit.stderr @@ -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 | diff --git a/src/test/ui/borrowck/borrowck-closures-two-mut.rs b/src/test/ui/borrowck/borrowck-closures-two-mut.rs index 182b3d7544242..6d7a84ebc93a4 100644 --- a/src/test/ui/borrowck/borrowck-closures-two-mut.rs +++ b/src/test/ui/borrowck/borrowck-closures-two-mut.rs @@ -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 @@ fn g() { 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() { diff --git a/src/test/ui/borrowck/borrowck-closures-two-mut.stderr b/src/test/ui/borrowck/borrowck-closures-two-mut.stderr index fc8a7f2ab6060..0ec744f4a0781 100644 --- a/src/test/ui/borrowck/borrowck-closures-two-mut.stderr +++ b/src/test/ui/borrowck/borrowck-closures-two-mut.stderr @@ -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 diff --git a/src/test/ui/borrowck/borrowck-in-static.rs b/src/test/ui/borrowck/borrowck-in-static.rs index 9244c12347d95..b30234811acb2 100644 --- a/src/test/ui/borrowck/borrowck-in-static.rs +++ b/src/test/ui/borrowck/borrowck-in-static.rs @@ -11,8 +11,9 @@ // check that borrowck looks inside consts/statics static FN : &'static (Fn() -> (BoxBox>) + 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() { diff --git a/src/test/ui/borrowck/borrowck-in-static.stderr b/src/test/ui/borrowck/borrowck-in-static.stderr index 6083a82b1b6de..92ca36e117e60 100644 --- a/src/test/ui/borrowck/borrowck-in-static.stderr +++ b/src/test/ui/borrowck/borrowck-in-static.stderr @@ -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 diff --git a/src/test/ui/borrowck/borrowck-reinit.rs b/src/test/ui/borrowck/borrowck-reinit.rs index 5547cb3ae523f..e72eb7f03a679 100644 --- a/src/test/ui/borrowck/borrowck-reinit.rs +++ b/src/test/ui/borrowck/borrowck-reinit.rs @@ -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) } diff --git a/src/test/ui/borrowck/borrowck-reinit.stderr b/src/test/ui/borrowck/borrowck-reinit.stderr index 767d65c1e60fb..12511030579a2 100644 --- a/src/test/ui/borrowck/borrowck-reinit.stderr +++ b/src/test/ui/borrowck/borrowck-reinit.stderr @@ -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`, 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 diff --git a/src/test/ui/borrowck/mut-borrow-in-loop.rs b/src/test/ui/borrowck/mut-borrow-in-loop.rs index addda42775399..31b50d8e531c0 100644 --- a/src/test/ui/borrowck/mut-borrow-in-loop.rs +++ b/src/test/ui/borrowck/mut-borrow-in-loop.rs @@ -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 } } } diff --git a/src/test/ui/borrowck/mut-borrow-in-loop.stderr b/src/test/ui/borrowck/mut-borrow-in-loop.stderr index a34d524d28f2e..2b614561d8268 100644 --- a/src/test/ui/borrowck/mut-borrow-in-loop.stderr +++ b/src/test/ui/borrowck/mut-borrow-in-loop.stderr @@ -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 | } diff --git a/src/test/ui/borrowck/mut-borrow-outside-loop.rs b/src/test/ui/borrowck/mut-borrow-outside-loop.rs index 97092b7f9d759..a1ab41bab337d 100644 --- a/src/test/ui/borrowck/mut-borrow-outside-loop.rs +++ b/src/test/ui/borrowck/mut-borrow-outside-loop.rs @@ -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 } } diff --git a/src/test/ui/borrowck/mut-borrow-outside-loop.stderr b/src/test/ui/borrowck/mut-borrow-outside-loop.stderr index 02b32dc363ae7..716edd21982e9 100644 --- a/src/test/ui/borrowck/mut-borrow-outside-loop.stderr +++ b/src/test/ui/borrowck/mut-borrow-outside-loop.stderr @@ -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 diff --git a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.rs b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.rs index 9c89c26de006a..788d68caa524e 100644 --- a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.rs +++ b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.rs @@ -16,9 +16,10 @@ fn call(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 }); } diff --git a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr index dbfcb2e0c2f95..895ce1ba31803 100644 --- a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr +++ b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr @@ -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(); diff --git a/src/test/ui/cast-to-unsized-trait-object-suggestion.rs b/src/test/ui/cast-to-unsized-trait-object-suggestion.rs index c793454798275..010b5a1b1067e 100644 --- a/src/test/ui/cast-to-unsized-trait-object-suggestion.rs +++ b/src/test/ui/cast-to-unsized-trait-object-suggestion.rs @@ -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 } diff --git a/src/test/ui/cast-to-unsized-trait-object-suggestion.stderr b/src/test/ui/cast-to-unsized-trait-object-suggestion.stderr index 4d4eb7b4ecfdb..55d41848b17a9 100644 --- a/src/test/ui/cast-to-unsized-trait-object-suggestion.stderr +++ b/src/test/ui/cast-to-unsized-trait-object-suggestion.stderr @@ -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` diff --git a/src/test/ui/check_match/issue-35609.rs b/src/test/ui/check_match/issue-35609.rs index 6497f69035dec..d52718b7bf41f 100644 --- a/src/test/ui/check_match/issue-35609.rs +++ b/src/test/ui/check_match/issue-35609.rs @@ -17,36 +17,36 @@ struct S(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 => () } diff --git a/src/test/ui/check_match/issue-35609.stderr b/src/test/ui/check_match/issue-35609.stderr index 0aafe3f17b3d0..1fc1d05636e91 100644 --- a/src/test/ui/check_match/issue-35609.stderr +++ b/src/test/ui/check_match/issue-35609.stderr @@ -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 diff --git a/src/test/ui/closure_context/issue-26046-fn-mut.rs b/src/test/ui/closure_context/issue-26046-fn-mut.rs index 5ed7ace5437d3..3b179a475e794 100644 --- a/src/test/ui/closure_context/issue-26046-fn-mut.rs +++ b/src/test/ui/closure_context/issue-26046-fn-mut.rs @@ -11,7 +11,7 @@ fn foo() -> Box { let num = 5; - let closure = || { + let closure = || { //~ ERROR expected a closure that num += 1; }; diff --git a/src/test/ui/closure_context/issue-26046-fn-mut.stderr b/src/test/ui/closure_context/issue-26046-fn-mut.stderr index 42fc2909dfb5a..82c83da4daec7 100644 --- a/src/test/ui/closure_context/issue-26046-fn-mut.stderr +++ b/src/test/ui/closure_context/issue-26046-fn-mut.stderr @@ -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 | | }; diff --git a/src/test/ui/closure_context/issue-26046-fn-once.rs b/src/test/ui/closure_context/issue-26046-fn-once.rs index de06de530c6c0..cf15985ee83ea 100644 --- a/src/test/ui/closure_context/issue-26046-fn-once.rs +++ b/src/test/ui/closure_context/issue-26046-fn-once.rs @@ -11,7 +11,7 @@ fn get_closure() -> Box Vec> { let vec = vec![1u8, 2u8]; - let closure = move || { + let closure = move || { //~ ERROR expected a closure vec }; diff --git a/src/test/ui/closure_context/issue-26046-fn-once.stderr b/src/test/ui/closure_context/issue-26046-fn-once.stderr index 7bfe72d3d6c9c..0bc84872dde5f 100644 --- a/src/test/ui/closure_context/issue-26046-fn-once.stderr +++ b/src/test/ui/closure_context/issue-26046-fn-once.stderr @@ -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 | | }; diff --git a/src/test/ui/closure_context/issue-42065.rs b/src/test/ui/closure_context/issue-42065.rs index 409964082f2b6..276c6a941b299 100644 --- a/src/test/ui/closure_context/issue-42065.rs +++ b/src/test/ui/closure_context/issue-42065.rs @@ -14,12 +14,13 @@ fn main() { let dict: HashMap = 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 } diff --git a/src/test/ui/closure_context/issue-42065.stderr b/src/test/ui/closure_context/issue-42065.stderr index c195940ade6fa..b31322f6d168d 100644 --- a/src/test/ui/closure_context/issue-42065.stderr +++ b/src/test/ui/closure_context/issue-42065.stderr @@ -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 diff --git a/src/test/ui/codemap_tests/coherence-overlapping-inherent-impl-trait.rs b/src/test/ui/codemap_tests/coherence-overlapping-inherent-impl-trait.rs index a72ad0351e33b..532d173011d7f 100644 --- a/src/test/ui/codemap_tests/coherence-overlapping-inherent-impl-trait.rs +++ b/src/test/ui/codemap_tests/coherence-overlapping-inherent-impl-trait.rs @@ -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() { } diff --git a/src/test/ui/codemap_tests/coherence-overlapping-inherent-impl-trait.stderr b/src/test/ui/codemap_tests/coherence-overlapping-inherent-impl-trait.stderr index 7f1ab929c6fc2..a7d52301476c9 100644 --- a/src/test/ui/codemap_tests/coherence-overlapping-inherent-impl-trait.stderr +++ b/src/test/ui/codemap_tests/coherence-overlapping-inherent-impl-trait.stderr @@ -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` diff --git a/src/test/ui/codemap_tests/empty_span.rs b/src/test/ui/codemap_tests/empty_span.rs index 2cf3b66dd77c8..8e0395e3c5033 100644 --- a/src/test/ui/codemap_tests/empty_span.rs +++ b/src/test/ui/codemap_tests/empty_span.rs @@ -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 } diff --git a/src/test/ui/codemap_tests/empty_span.stderr b/src/test/ui/codemap_tests/empty_span.stderr index b33dee6b4a472..3474803b00dd1 100644 --- a/src/test/ui/codemap_tests/empty_span.stderr +++ b/src/test/ui/codemap_tests/empty_span.stderr @@ -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 diff --git a/src/test/ui/codemap_tests/huge_multispan_highlight.rs b/src/test/ui/codemap_tests/huge_multispan_highlight.rs index 5a058d483915a..cf593eab85329 100644 --- a/src/test/ui/codemap_tests/huge_multispan_highlight.rs +++ b/src/test/ui/codemap_tests/huge_multispan_highlight.rs @@ -97,5 +97,5 @@ fn main() { - let y = &mut x; + let y = &mut x; //~ ERROR cannot borrow } diff --git a/src/test/ui/codemap_tests/huge_multispan_highlight.stderr b/src/test/ui/codemap_tests/huge_multispan_highlight.stderr index 914db98c78446..bc333bde93c6b 100644 --- a/src/test/ui/codemap_tests/huge_multispan_highlight.stderr +++ b/src/test/ui/codemap_tests/huge_multispan_highlight.stderr @@ -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 diff --git a/src/test/ui/codemap_tests/issue-11715.rs b/src/test/ui/codemap_tests/issue-11715.rs index ba1ce6abcd3d4..75581d3892719 100644 --- a/src/test/ui/codemap_tests/issue-11715.rs +++ b/src/test/ui/codemap_tests/issue-11715.rs @@ -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 } diff --git a/src/test/ui/codemap_tests/issue-11715.stderr b/src/test/ui/codemap_tests/issue-11715.stderr index 4947cbedd200e..bd8ffba00d44b 100644 --- a/src/test/ui/codemap_tests/issue-11715.stderr +++ b/src/test/ui/codemap_tests/issue-11715.stderr @@ -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 diff --git a/src/test/ui/codemap_tests/one_line.rs b/src/test/ui/codemap_tests/one_line.rs index e50091d560622..3fb35dd26acab 100644 --- a/src/test/ui/codemap_tests/one_line.rs +++ b/src/test/ui/codemap_tests/one_line.rs @@ -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 } diff --git a/src/test/ui/codemap_tests/one_line.stderr b/src/test/ui/codemap_tests/one_line.stderr index a73575a8d57f1..cfe3d527136a3 100644 --- a/src/test/ui/codemap_tests/one_line.stderr +++ b/src/test/ui/codemap_tests/one_line.stderr @@ -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 diff --git a/src/test/ui/codemap_tests/overlapping_inherent_impls.rs b/src/test/ui/codemap_tests/overlapping_inherent_impls.rs index a626b63b31ba0..18e77ddfd2c5b 100644 --- a/src/test/ui/codemap_tests/overlapping_inherent_impls.rs +++ b/src/test/ui/codemap_tests/overlapping_inherent_impls.rs @@ -16,7 +16,7 @@ struct Foo; impl Foo { - fn id() {} + fn id() {} //~ ERROR duplicate definitions } impl Foo { @@ -26,7 +26,7 @@ impl Foo { struct Bar(T); impl Bar { - fn bar(&self) {} + fn bar(&self) {} //~ ERROR duplicate definitions } impl Bar { @@ -36,7 +36,7 @@ impl Bar { struct Baz(T); impl Baz { - fn baz(&self) {} + fn baz(&self) {} //~ ERROR duplicate definitions } impl Baz> { diff --git a/src/test/ui/codemap_tests/overlapping_inherent_impls.stderr b/src/test/ui/codemap_tests/overlapping_inherent_impls.stderr index eaf42cde22f76..0ccdd20765176 100644 --- a/src/test/ui/codemap_tests/overlapping_inherent_impls.stderr +++ b/src/test/ui/codemap_tests/overlapping_inherent_impls.stderr @@ -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) {} diff --git a/src/test/ui/codemap_tests/overlapping_spans.rs b/src/test/ui/codemap_tests/overlapping_spans.rs index 7c1f0db16dd09..467e90bd5a51b 100644 --- a/src/test/ui/codemap_tests/overlapping_spans.rs +++ b/src/test/ui/codemap_tests/overlapping_spans.rs @@ -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 } } diff --git a/src/test/ui/codemap_tests/overlapping_spans.stderr b/src/test/ui/codemap_tests/overlapping_spans.stderr index d32b18d670308..dc801b20dfb9d 100644 --- a/src/test/ui/codemap_tests/overlapping_spans.stderr +++ b/src/test/ui/codemap_tests/overlapping_spans.stderr @@ -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` diff --git a/src/test/ui/codemap_tests/tab.rs b/src/test/ui/codemap_tests/tab.rs index 146ad2283c2fc..b8dedb0daf5f0 100644 --- a/src/test/ui/codemap_tests/tab.rs +++ b/src/test/ui/codemap_tests/tab.rs @@ -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 } diff --git a/src/test/ui/codemap_tests/tab.stderr b/src/test/ui/codemap_tests/tab.stderr index b3fa9b128c5eb..41ab60f017f61 100644 --- a/src/test/ui/codemap_tests/tab.stderr +++ b/src/test/ui/codemap_tests/tab.stderr @@ -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 `()` diff --git a/src/test/ui/codemap_tests/tab_2.rs b/src/test/ui/codemap_tests/tab_2.rs index d26d7974d85ad..b759a4abcae21 100644 --- a/src/test/ui/codemap_tests/tab_2.rs +++ b/src/test/ui/codemap_tests/tab_2.rs @@ -11,5 +11,5 @@ // ignore-tidy-tab fn main() { - """; + """; //~ ERROR unterminated double quote } diff --git a/src/test/ui/codemap_tests/tab_2.stderr b/src/test/ui/codemap_tests/tab_2.stderr index a2b3ca7e4d4fd..7f6b55e7eb8ea 100644 --- a/src/test/ui/codemap_tests/tab_2.stderr +++ b/src/test/ui/codemap_tests/tab_2.stderr @@ -1,7 +1,7 @@ error: unterminated double quote string --> $DIR/tab_2.rs:14:7 | -14 | """; +14 | """; //~ ERROR unterminated double quote | _______^ 15 | | } | |__^ diff --git a/src/test/ui/codemap_tests/tab_3.rs b/src/test/ui/codemap_tests/tab_3.rs index 9b3513d5116f2..ea235ed71a9e6 100644 --- a/src/test/ui/codemap_tests/tab_3.rs +++ b/src/test/ui/codemap_tests/tab_3.rs @@ -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 } } diff --git a/src/test/ui/codemap_tests/tab_3.stderr b/src/test/ui/codemap_tests/tab_3.stderr index f19f5f20d23ec..278e590a36d13 100644 --- a/src/test/ui/codemap_tests/tab_3.stderr +++ b/src/test/ui/codemap_tests/tab_3.stderr @@ -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 diff --git a/src/test/ui/codemap_tests/two_files.rs b/src/test/ui/codemap_tests/two_files.rs index fe5eba93b2331..4c99ee67598bc 100644 --- a/src/test/ui/codemap_tests/two_files.rs +++ b/src/test/ui/codemap_tests/two_files.rs @@ -12,6 +12,6 @@ include!("two_files_data.rs"); struct Baz { } -impl Bar for Baz { } +impl Bar for Baz { } //~ ERROR expected trait, found type alias fn main() { } diff --git a/src/test/ui/codemap_tests/two_files.stderr b/src/test/ui/codemap_tests/two_files.stderr index 9db43dde1ac7e..c0cfeef194da6 100644 --- a/src/test/ui/codemap_tests/two_files.stderr +++ b/src/test/ui/codemap_tests/two_files.stderr @@ -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 diff --git a/src/test/ui/codemap_tests/unicode.rs b/src/test/ui/codemap_tests/unicode.rs index b206722d4f368..ac22906a62330 100644 --- a/src/test/ui/codemap_tests/unicode.rs +++ b/src/test/ui/codemap_tests/unicode.rs @@ -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() { } diff --git a/src/test/ui/codemap_tests/unicode.stderr b/src/test/ui/codemap_tests/unicode.stderr index 02a9d7ee0ef4f..4f3c79410df9c 100644 --- a/src/test/ui/codemap_tests/unicode.stderr +++ b/src/test/ui/codemap_tests/unicode.stderr @@ -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 diff --git a/src/test/ui/codemap_tests/unicode_2.rs b/src/test/ui/codemap_tests/unicode_2.rs index cc3eae90f90a1..c01b0b286afca 100644 --- a/src/test/ui/codemap_tests/unicode_2.rs +++ b/src/test/ui/codemap_tests/unicode_2.rs @@ -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 } diff --git a/src/test/ui/codemap_tests/unicode_2.stderr b/src/test/ui/codemap_tests/unicode_2.stderr index 6cfa66730a204..9ffd08ca06f83 100644 --- a/src/test/ui/codemap_tests/unicode_2.stderr +++ b/src/test/ui/codemap_tests/unicode_2.stderr @@ -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 diff --git a/src/test/ui/coercion-missing-tail-expected-type.rs b/src/test/ui/coercion-missing-tail-expected-type.rs index 15ce79a054f26..b235a0f21360c 100644 --- a/src/test/ui/coercion-missing-tail-expected-type.rs +++ b/src/test/ui/coercion-missing-tail-expected-type.rs @@ -10,11 +10,11 @@ // #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 { +fn foo() -> Result { //~ ERROR mismatched types Ok(1); } diff --git a/src/test/ui/coercion-missing-tail-expected-type.stderr b/src/test/ui/coercion-missing-tail-expected-type.stderr index 0de0a25e68e24..93f57216ca063 100644 --- a/src/test/ui/coercion-missing-tail-expected-type.stderr +++ b/src/test/ui/coercion-missing-tail-expected-type.stderr @@ -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 { +17 | fn foo() -> Result { //~ 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 index 0000000000000..ac631c2e45e59 --- /dev/null +++ b/src/test/ui/command-line-diagnostics.rs @@ -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 or the MIT license +// , 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 index 0000000000000..48ca45914c65d --- /dev/null +++ b/src/test/ui/command-line-diagnostics.stderr @@ -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 + diff --git a/src/test/ui/compare-method/region-extra.rs b/src/test/ui/compare-method/region-extra.rs index e359f08096885..9befa1ba60eed 100644 --- a/src/test/ui/compare-method/region-extra.rs +++ b/src/test/ui/compare-method/region-extra.rs @@ -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() { diff --git a/src/test/ui/compare-method/region-extra.stderr b/src/test/ui/compare-method/region-extra.stderr index bc42b505818b8..d46376b4a42b7 100644 --- a/src/test/ui/compare-method/region-extra.stderr +++ b/src/test/ui/compare-method/region-extra.stderr @@ -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 diff --git a/src/test/ui/compare-method/region-unrelated.rs b/src/test/ui/compare-method/region-unrelated.rs index 719e15fdb61fe..31ab6cb7fc42c 100644 --- a/src/test/ui/compare-method/region-unrelated.rs +++ b/src/test/ui/compare-method/region-unrelated.rs @@ -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() { diff --git a/src/test/ui/const-eval/issue-43197.rs b/src/test/ui/const-eval/issue-43197.rs index 1d4ded6e7123a..85ab2a0052164 100644 --- a/src/test/ui/const-eval/issue-43197.rs +++ b/src/test/ui/const-eval/issue-43197.rs @@ -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); } diff --git a/src/test/ui/const-eval/issue-43197.stderr b/src/test/ui/const-eval/issue-43197.stderr index 58dedcfd9b103..82baab620ffab 100644 --- a/src/test/ui/const-eval/issue-43197.stderr +++ b/src/test/ui/const-eval/issue-43197.stderr @@ -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 diff --git a/src/test/ui/const-expr-addr-operator.rs b/src/test/ui/const-expr-addr-operator.rs index 282b0d4e45b70..24d4457f01d70 100644 --- a/src/test/ui/const-expr-addr-operator.rs +++ b/src/test/ui/const-expr-addr-operator.rs @@ -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 +} diff --git a/src/test/ui/const-expr-addr-operator.stderr b/src/test/ui/const-expr-addr-operator.stderr index 5bda81451d0e2..f6587c703bd7f 100644 --- a/src/test/ui/const-expr-addr-operator.stderr +++ b/src/test/ui/const-expr-addr-operator.stderr @@ -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 diff --git a/src/test/ui/cross-crate-macro-backtrace/main.rs b/src/test/ui/cross-crate-macro-backtrace/main.rs index f8bb84abcd419..85640087a9d48 100644 --- a/src/test/ui/cross-crate-macro-backtrace/main.rs +++ b/src/test/ui/cross-crate-macro-backtrace/main.rs @@ -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!("{}"); } diff --git a/src/test/ui/cross-crate-macro-backtrace/main.stderr b/src/test/ui/cross-crate-macro-backtrace/main.stderr index 7d5055deb895a..3644c0468d6ef 100644 --- a/src/test/ui/cross-crate-macro-backtrace/main.stderr +++ b/src/test/ui/cross-crate-macro-backtrace/main.stderr @@ -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) diff --git a/src/test/ui/deref-suggestion.rs b/src/test/ui/deref-suggestion.rs index 16d8226bfece1..04ba4ab905eb1 100644 --- a/src/test/ui/deref-suggestion.rs +++ b/src/test/ui/deref-suggestion.rs @@ -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); } diff --git a/src/test/ui/deref-suggestion.stderr b/src/test/ui/deref-suggestion.stderr index 3ed3297e05ed9..6c418cf4bfbed 100644 --- a/src/test/ui/deref-suggestion.stderr +++ b/src/test/ui/deref-suggestion.stderr @@ -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)); diff --git a/src/test/ui/did_you_mean/E0178.rs b/src/test/ui/did_you_mean/E0178.rs index 8fb6c9815cef8..21cdb38fdb118 100644 --- a/src/test/ui/did_you_mean/E0178.rs +++ b/src/test/ui/did_you_mean/E0178.rs @@ -11,10 +11,10 @@ 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() { diff --git a/src/test/ui/did_you_mean/E0178.stderr b/src/test/ui/did_you_mean/E0178.stderr index 15e7131cfd3be..4fe8849feef11 100644 --- a/src/test/ui/did_you_mean/E0178.stderr +++ b/src/test/ui/did_you_mean/E0178.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.rs b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.rs index 99035209e14bc..076b61b179061 100644 --- a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.rs +++ b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.rs @@ -33,7 +33,4 @@ fn main() { f1.foo(1usize); //~^ error: the trait bound `Bar: Foo` is not satisfied - //~| help: the following implementations were found: - //~| help: > - //~| help: > } diff --git a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs index 2009c32c85436..6beff6ba2a100 100644 --- a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs +++ b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs @@ -37,10 +37,4 @@ fn main() { f1.foo(1usize); //~^ error: the trait bound `Bar: Foo` is not satisfied - //~| help: the following implementations were found: - //~| help: > - //~| help: > - //~| help: > - //~| help: > - //~| help: and 2 others } diff --git a/src/test/ui/did_you_mean/issue-31424.rs b/src/test/ui/did_you_mean/issue-31424.rs index 374d06bb71d27..1b31e064337e2 100644 --- a/src/test/ui/did_you_mean/issue-31424.rs +++ b/src/test/ui/did_you_mean/issue-31424.rs @@ -14,13 +14,13 @@ struct Struct; 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 } } diff --git a/src/test/ui/did_you_mean/issue-31424.stderr b/src/test/ui/did_you_mean/issue-31424.stderr index 47dc7c975724a..cd96d28ac98cb 100644 --- a/src/test/ui/did_you_mean/issue-31424.stderr +++ b/src/test/ui/did_you_mean/issue-31424.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-34126.rs b/src/test/ui/did_you_mean/issue-34126.rs index 9523e6bbf383b..9dfb38abd049f 100644 --- a/src/test/ui/did_you_mean/issue-34126.rs +++ b/src/test/ui/did_you_mean/issue-34126.rs @@ -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 } } diff --git a/src/test/ui/did_you_mean/issue-34126.stderr b/src/test/ui/did_you_mean/issue-34126.stderr index d9ef0c4541041..a4921046c7833 100644 --- a/src/test/ui/did_you_mean/issue-34126.stderr +++ b/src/test/ui/did_you_mean/issue-34126.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-34337.rs b/src/test/ui/did_you_mean/issue-34337.rs index 42853a5d83db0..a426c0f48ccec 100644 --- a/src/test/ui/did_you_mean/issue-34337.rs +++ b/src/test/ui/did_you_mean/issue-34337.rs @@ -13,5 +13,5 @@ fn get(key: &mut String) { } fn main() { let mut v: Vec = Vec::new(); let ref mut key = v[0]; - get(&mut key); + get(&mut key); //~ ERROR cannot borrow } diff --git a/src/test/ui/did_you_mean/issue-34337.stderr b/src/test/ui/did_you_mean/issue-34337.stderr index 20478165c7ea0..a53d3d7277aa3 100644 --- a/src/test/ui/did_you_mean/issue-34337.stderr +++ b/src/test/ui/did_you_mean/issue-34337.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-35937.rs b/src/test/ui/did_you_mean/issue-35937.rs index 9ec8728fd32c1..867b47cf99e1e 100644 --- a/src/test/ui/did_you_mean/issue-35937.rs +++ b/src/test/ui/did_you_mean/issue-35937.rs @@ -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 } diff --git a/src/test/ui/did_you_mean/issue-35937.stderr b/src/test/ui/did_you_mean/issue-35937.stderr index 1cd1fb76aa330..ec44755cb7c95 100644 --- a/src/test/ui/did_you_mean/issue-35937.stderr +++ b/src/test/ui/did_you_mean/issue-35937.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-36798.rs b/src/test/ui/did_you_mean/issue-36798.rs index cd0d0951abf8a..6e641ff025ce3 100644 --- a/src/test/ui/did_you_mean/issue-36798.rs +++ b/src/test/ui/did_you_mean/issue-36798.rs @@ -14,5 +14,5 @@ struct Foo { fn main() { let f = Foo { bar: 22 }; - f.baz; + f.baz; //~ ERROR no field } diff --git a/src/test/ui/did_you_mean/issue-36798.stderr b/src/test/ui/did_you_mean/issue-36798.stderr index 72fd09c035719..73319d567bd76 100644 --- a/src/test/ui/did_you_mean/issue-36798.stderr +++ b/src/test/ui/did_you_mean/issue-36798.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-36798_unknown_field.rs b/src/test/ui/did_you_mean/issue-36798_unknown_field.rs index 2970a325a6af8..ec54a8d2b4390 100644 --- a/src/test/ui/did_you_mean/issue-36798_unknown_field.rs +++ b/src/test/ui/did_you_mean/issue-36798_unknown_field.rs @@ -14,5 +14,5 @@ struct Foo { fn main() { let f = Foo { bar: 22 }; - f.zz; + f.zz; //~ ERROR no field } diff --git a/src/test/ui/did_you_mean/issue-36798_unknown_field.stderr b/src/test/ui/did_you_mean/issue-36798_unknown_field.stderr index 20bb7d4c91de3..f17672b234fc6 100644 --- a/src/test/ui/did_you_mean/issue-36798_unknown_field.stderr +++ b/src/test/ui/did_you_mean/issue-36798_unknown_field.stderr @@ -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` diff --git a/src/test/ui/did_you_mean/issue-37139.rs b/src/test/ui/did_you_mean/issue-37139.rs index 65181768053c0..8a1a7ce0c320b 100644 --- a/src/test/ui/did_you_mean/issue-37139.rs +++ b/src/test/ui/did_you_mean/issue-37139.rs @@ -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 } } } diff --git a/src/test/ui/did_you_mean/issue-37139.stderr b/src/test/ui/did_you_mean/issue-37139.stderr index 9fc364f861275..65de724616d10 100644 --- a/src/test/ui/did_you_mean/issue-37139.stderr +++ b/src/test/ui/did_you_mean/issue-37139.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs b/src/test/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs index 1938d33e53030..c9c1c5d141d6a 100644 --- a/src/test/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs +++ b/src/test/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs @@ -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() {} diff --git a/src/test/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.stderr b/src/test/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.stderr index 325f55e686c62..c58958c7f5e3f 100644 --- a/src/test/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.stderr +++ b/src/test/ui/did_you_mean/issue-38054-do-not-show-unresolved-names.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-38147-1.rs b/src/test/ui/did_you_mean/issue-38147-1.rs index 136921dd0a569..a7ce7406566b3 100644 --- a/src/test/ui/did_you_mean/issue-38147-1.rs +++ b/src/test/ui/did_you_mean/issue-38147-1.rs @@ -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 } } diff --git a/src/test/ui/did_you_mean/issue-38147-1.stderr b/src/test/ui/did_you_mean/issue-38147-1.stderr index e9f2b1dad806d..6a262b3102638 100644 --- a/src/test/ui/did_you_mean/issue-38147-1.stderr +++ b/src/test/ui/did_you_mean/issue-38147-1.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-38147-2.rs b/src/test/ui/did_you_mean/issue-38147-2.rs index a5d533edf75ec..cc6be98bcf8a7 100644 --- a/src/test/ui/did_you_mean/issue-38147-2.rs +++ b/src/test/ui/did_you_mean/issue-38147-2.rs @@ -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 } } diff --git a/src/test/ui/did_you_mean/issue-38147-2.stderr b/src/test/ui/did_you_mean/issue-38147-2.stderr index e81bc722fa098..b09ecf9057c0b 100644 --- a/src/test/ui/did_you_mean/issue-38147-2.stderr +++ b/src/test/ui/did_you_mean/issue-38147-2.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-38147-3.rs b/src/test/ui/did_you_mean/issue-38147-3.rs index 5e8f2d3eaefaa..42b2910051722 100644 --- a/src/test/ui/did_you_mean/issue-38147-3.rs +++ b/src/test/ui/did_you_mean/issue-38147-3.rs @@ -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 } } diff --git a/src/test/ui/did_you_mean/issue-38147-3.stderr b/src/test/ui/did_you_mean/issue-38147-3.stderr index 749795f4d8fbd..ca721f133a44b 100644 --- a/src/test/ui/did_you_mean/issue-38147-3.stderr +++ b/src/test/ui/did_you_mean/issue-38147-3.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-38147-4.rs b/src/test/ui/did_you_mean/issue-38147-4.rs index 4eb20ceeed48e..49a8f2b6ff691 100644 --- a/src/test/ui/did_you_mean/issue-38147-4.rs +++ b/src/test/ui/did_you_mean/issue-38147-4.rs @@ -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() {} diff --git a/src/test/ui/did_you_mean/issue-38147-4.stderr b/src/test/ui/did_you_mean/issue-38147-4.stderr index 9a8853f4fbbdb..33bf2e1160c90 100644 --- a/src/test/ui/did_you_mean/issue-38147-4.stderr +++ b/src/test/ui/did_you_mean/issue-38147-4.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-39544.rs b/src/test/ui/did_you_mean/issue-39544.rs index d7c8935560623..7cd7768078a0c 100644 --- a/src/test/ui/did_you_mean/issue-39544.rs +++ b/src/test/ui/did_you_mean/issue-39544.rs @@ -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 } diff --git a/src/test/ui/did_you_mean/issue-39544.stderr b/src/test/ui/did_you_mean/issue-39544.stderr index 28aaab97bdad1..1fcb05374f681 100644 --- a/src/test/ui/did_you_mean/issue-39544.stderr +++ b/src/test/ui/did_you_mean/issue-39544.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.rs b/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.rs index 68b1f79c89bbe..660aedc3596ed 100644 --- a/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.rs +++ b/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.rs @@ -31,7 +31,7 @@ impl Foo for bool {} impl Foo for bool {} fn main() { - Foo::::bar(&1i8); - Foo::::bar(&1u8); - Foo::::bar(&true); + Foo::::bar(&1i8); //~ ERROR is not satisfied + Foo::::bar(&1u8); //~ ERROR is not satisfied + Foo::::bar(&true); //~ ERROR is not satisfied } diff --git a/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr b/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr index 4ea4adfcfe0fc..d5c4add34b526 100644 --- a/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr +++ b/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `i8: Foo` is not satisfied --> $DIR/issue-39802-show-5-trait-impls.rs:34:5 | -34 | Foo::::bar(&1i8); +34 | Foo::::bar(&1i8); //~ ERROR is not satisfied | ^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i8` | = help: the following implementations were found: @@ -15,7 +15,7 @@ error[E0277]: the trait bound `i8: Foo` is not satisfied error[E0277]: the trait bound `u8: Foo` is not satisfied --> $DIR/issue-39802-show-5-trait-impls.rs:35:5 | -35 | Foo::::bar(&1u8); +35 | Foo::::bar(&1u8); //~ ERROR is not satisfied | ^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u8` | = help: the following implementations were found: @@ -28,7 +28,7 @@ error[E0277]: the trait bound `u8: Foo` is not satisfied error[E0277]: the trait bound `bool: Foo` is not satisfied --> $DIR/issue-39802-show-5-trait-impls.rs:36:5 | -36 | Foo::::bar(&true); +36 | Foo::::bar(&true); //~ ERROR is not satisfied | ^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `bool` | = help: the following implementations were found: diff --git a/src/test/ui/did_you_mean/issue-40006.rs b/src/test/ui/did_you_mean/issue-40006.rs index d68c25faa8a84..62316b96db03f 100644 --- a/src/test/ui/did_you_mean/issue-40006.rs +++ b/src/test/ui/did_you_mean/issue-40006.rs @@ -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"); } } diff --git a/src/test/ui/did_you_mean/issue-40006.stderr b/src/test/ui/did_you_mean/issue-40006.stderr index 3b7f32cf8904a..8fadb4ff6b682 100644 --- a/src/test/ui/did_you_mean/issue-40006.stderr +++ b/src/test/ui/did_you_mean/issue-40006.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-40396.rs b/src/test/ui/did_you_mean/issue-40396.rs index 1eae180976ad3..eb62dc5408494 100644 --- a/src/test/ui/did_you_mean/issue-40396.rs +++ b/src/test/ui/did_you_mean/issue-40396.rs @@ -9,15 +9,16 @@ // except according to those terms. fn foo() { - println!("{:?}", (0..13).collect>()); + println!("{:?}", (0..13).collect>()); //~ ERROR chained comparison } fn bar() { - println!("{:?}", Vec::new()); + println!("{:?}", Vec::new()); //~ ERROR chained comparison } fn qux() { - println!("{:?}", (0..13).collect()); + println!("{:?}", (0..13).collect()); //~ ERROR chained comparison + //~^ ERROR chained comparison } fn main() {} diff --git a/src/test/ui/did_you_mean/issue-40396.stderr b/src/test/ui/did_you_mean/issue-40396.stderr index 11279f5c6129f..8f4118b3ff05a 100644 --- a/src/test/ui/did_you_mean/issue-40396.stderr +++ b/src/test/ui/did_you_mean/issue-40396.stderr @@ -1,7 +1,7 @@ error: chained comparison operators require parentheses --> $DIR/issue-40396.rs:12:37 | -12 | println!("{:?}", (0..13).collect>()); +12 | println!("{:?}", (0..13).collect>()); //~ 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::new()); +16 | println!("{:?}", Vec::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()); +20 | println!("{:?}", (0..13).collect()); //~ 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()); +20 | println!("{:?}", (0..13).collect()); //~ ERROR chained comparison | ^^^^^^ | = help: use `::<...>` instead of `<...>` if you meant to specify type arguments diff --git a/src/test/ui/did_you_mean/issue-40823.rs b/src/test/ui/did_you_mean/issue-40823.rs index f4ae325727982..3b48cef19021b 100644 --- a/src/test/ui/did_you_mean/issue-40823.rs +++ b/src/test/ui/did_you_mean/issue-40823.rs @@ -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 } diff --git a/src/test/ui/did_you_mean/issue-40823.stderr b/src/test/ui/did_you_mean/issue-40823.stderr index 7daab09c09e37..0b71fc1d306a2 100644 --- a/src/test/ui/did_you_mean/issue-40823.stderr +++ b/src/test/ui/did_you_mean/issue-40823.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-41679.rs b/src/test/ui/did_you_mean/issue-41679.rs index 5091b9efc3422..98c909e212fdd 100644 --- a/src/test/ui/did_you_mean/issue-41679.rs +++ b/src/test/ui/did_you_mean/issue-41679.rs @@ -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 } diff --git a/src/test/ui/did_you_mean/issue-41679.stderr b/src/test/ui/did_you_mean/issue-41679.stderr index 2abbbf65ba9b5..f1ccb3e6e141c 100644 --- a/src/test/ui/did_you_mean/issue-41679.stderr +++ b/src/test/ui/did_you_mean/issue-41679.stderr @@ -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 diff --git a/src/test/ui/did_you_mean/issue-42599_available_fields_note.rs b/src/test/ui/did_you_mean/issue-42599_available_fields_note.rs index 7fe9950801227..ad5bedcefc2dd 100644 --- a/src/test/ui/did_you_mean/issue-42599_available_fields_note.rs +++ b/src/test/ui/did_you_mean/issue-42599_available_fields_note.rs @@ -24,10 +24,12 @@ mod submodule { 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 } diff --git a/src/test/ui/did_you_mean/issue-42599_available_fields_note.stderr b/src/test/ui/did_you_mean/issue-42599_available_fields_note.stderr index e2bb7fbd9a895..d5dcef638471e 100644 --- a/src/test/ui/did_you_mean/issue-42599_available_fields_note.stderr +++ b/src/test/ui/did_you_mean/issue-42599_available_fields_note.stderr @@ -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` diff --git a/src/test/ui/did_you_mean/issue-42764.rs b/src/test/ui/did_you_mean/issue-42764.rs index ecaeb7b1161f7..ff4bb428d5f5f 100644 --- a/src/test/ui/did_you_mean/issue-42764.rs +++ b/src/test/ui/did_you_mean/issue-42764.rs @@ -19,4 +19,5 @@ fn this_function_expects_a_double_option(d: DoubleOption) {} fn main() { let n: usize = 42; this_function_expects_a_double_option(n); + //~^ ERROR mismatched types } diff --git a/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.rs b/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.rs index 923b0984d063b..7b877523e35cc 100644 --- a/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.rs +++ b/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.rs @@ -11,15 +11,15 @@ 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."); } } diff --git a/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr b/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr index 8371413c5a252..5390e541fb714 100644 --- a/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr +++ b/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr @@ -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? diff --git a/src/test/ui/did_you_mean/recursion_limit.rs b/src/test/ui/did_you_mean/recursion_limit.rs index becb81b1fff7e..2d27f167a03a4 100644 --- a/src/test/ui/did_you_mean/recursion_limit.rs +++ b/src/test/ui/did_you_mean/recursion_limit.rs @@ -41,5 +41,5 @@ enum N { N(usize) } fn is_send() { } fn main() { - is_send::(); + is_send::(); //~ ERROR overflow evaluating the requirement } diff --git a/src/test/ui/did_you_mean/recursion_limit.stderr b/src/test/ui/did_you_mean/recursion_limit.stderr index d157c5de6c7f5..7fac604ba49d7 100644 --- a/src/test/ui/did_you_mean/recursion_limit.stderr +++ b/src/test/ui/did_you_mean/recursion_limit.stderr @@ -1,7 +1,7 @@ error[E0275]: overflow evaluating the requirement `K: std::marker::Send` --> $DIR/recursion_limit.rs:44:5 | -44 | is_send::(); +44 | is_send::(); //~ ERROR overflow evaluating the requirement | ^^^^^^^^^^^^ | = help: consider adding a `#![recursion_limit="20"]` attribute to your crate diff --git a/src/test/ui/did_you_mean/recursion_limit_deref.rs b/src/test/ui/did_you_mean/recursion_limit_deref.rs index ebc56c94adf84..3e261ec636c08 100644 --- a/src/test/ui/did_you_mean/recursion_limit_deref.rs +++ b/src/test/ui/did_you_mean/recursion_limit_deref.rs @@ -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 @@ link!(K, Bottom); fn main() { let t = Top::new(); - let x: &Bottom = &t; + let x: &Bottom = &t; //~ ERROR mismatched types + //~^ error recursion limit } diff --git a/src/test/ui/did_you_mean/recursion_limit_deref.stderr b/src/test/ui/did_you_mean/recursion_limit_deref.stderr index 57b28d0373622..951b0b1058060 100644 --- a/src/test/ui/did_you_mean/recursion_limit_deref.stderr +++ b/src/test/ui/did_you_mean/recursion_limit_deref.stderr @@ -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` diff --git a/src/test/ui/did_you_mean/recursion_limit_macro.rs b/src/test/ui/did_you_mean/recursion_limit_macro.rs index 9fb82b730c9b3..16d07f369907b 100644 --- a/src/test/ui/did_you_mean/recursion_limit_macro.rs +++ b/src/test/ui/did_you_mean/recursion_limit_macro.rs @@ -17,7 +17,7 @@ macro_rules! recurse { () => { }; - ($t:tt $($tail:tt)*) => { recurse!($($tail)*) }; + ($t:tt $($tail:tt)*) => { recurse!($($tail)*) }; //~ ERROR recursion limit } fn main() { diff --git a/src/test/ui/did_you_mean/recursion_limit_macro.stderr b/src/test/ui/did_you_mean/recursion_limit_macro.stderr index 19aac1f77e7c1..24e223c797b21 100644 --- a/src/test/ui/did_you_mean/recursion_limit_macro.stderr +++ b/src/test/ui/did_you_mean/recursion_limit_macro.stderr @@ -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); diff --git a/src/test/ui/did_you_mean/trait-object-reference-without-parens-suggestion.rs b/src/test/ui/did_you_mean/trait-object-reference-without-parens-suggestion.rs index 11757abae9c97..76bc971e115f7 100644 --- a/src/test/ui/did_you_mean/trait-object-reference-without-parens-suggestion.rs +++ b/src/test/ui/did_you_mean/trait-object-reference-without-parens-suggestion.rs @@ -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 } diff --git a/src/test/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr b/src/test/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr index 498255cb9ea37..325a19eee140b 100644 --- a/src/test/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr +++ b/src/test/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr @@ -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` diff --git a/src/test/ui/dropck/dropck-eyepatch-extern-crate.rs b/src/test/ui/dropck/dropck-eyepatch-extern-crate.rs index 5e200dbdbfa01..f76c2251f8c70 100644 --- a/src/test/ui/dropck/dropck-eyepatch-extern-crate.rs +++ b/src/test/ui/dropck/dropck-eyepatch-extern-crate.rs @@ -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 diff --git a/src/test/ui/dropck/dropck-eyepatch-extern-crate.stderr b/src/test/ui/dropck/dropck-eyepatch-extern-crate.stderr index 62ce3209c919d..43d5294c93a05 100644 --- a/src/test/ui/dropck/dropck-eyepatch-extern-crate.stderr +++ b/src/test/ui/dropck/dropck-eyepatch-extern-crate.stderr @@ -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 diff --git a/src/test/ui/dropck/dropck-eyepatch-reorder.rs b/src/test/ui/dropck/dropck-eyepatch-reorder.rs index 68b0ff3b5f096..95ee45a6117c7 100644 --- a/src/test/ui/dropck/dropck-eyepatch-reorder.rs +++ b/src/test/ui/dropck/dropck-eyepatch-reorder.rs @@ -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 diff --git a/src/test/ui/dropck/dropck-eyepatch-reorder.stderr b/src/test/ui/dropck/dropck-eyepatch-reorder.stderr index d94808bbcb6d0..1ca456c7ba38b 100644 --- a/src/test/ui/dropck/dropck-eyepatch-reorder.stderr +++ b/src/test/ui/dropck/dropck-eyepatch-reorder.stderr @@ -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 | } diff --git a/src/test/ui/dropck/dropck-eyepatch.rs b/src/test/ui/dropck/dropck-eyepatch.rs index e442fade19730..de94954e9218b 100644 --- a/src/test/ui/dropck/dropck-eyepatch.rs +++ b/src/test/ui/dropck/dropck-eyepatch.rs @@ -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 diff --git a/src/test/ui/dropck/dropck-eyepatch.stderr b/src/test/ui/dropck/dropck-eyepatch.stderr index 811eee0e85f15..d41ff37411976 100644 --- a/src/test/ui/dropck/dropck-eyepatch.stderr +++ b/src/test/ui/dropck/dropck-eyepatch.stderr @@ -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 | } diff --git a/src/test/ui/e0119/complex-impl.rs b/src/test/ui/e0119/complex-impl.rs index f0d2630b9d0ce..b8b30a2841421 100644 --- a/src/test/ui/e0119/complex-impl.rs +++ b/src/test/ui/e0119/complex-impl.rs @@ -16,6 +16,7 @@ use complex_impl_support::{External, M}; struct Q; -impl External for (Q, R) {} +impl External for (Q, R) {} //~ ERROR must be used +//~^ ERROR conflicting implementations of trait -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/ui/e0119/complex-impl.stderr b/src/test/ui/e0119/complex-impl.stderr index ff7c8a160a4a8..e4f8020145c65 100644 --- a/src/test/ui/e0119/complex-impl.stderr +++ b/src/test/ui/e0119/complex-impl.stderr @@ -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 External for (Q, R) {} +19 | impl 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`); only traits defined in the current crate can be implemented for a type parameter --> $DIR/complex-impl.rs:19:1 | -19 | impl External for (Q, R) {} +19 | impl External for (Q, R) {} //~ ERROR must be used | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/e0119/conflict-with-std.rs b/src/test/ui/e0119/conflict-with-std.rs index ead62256a598e..ed9033ad53d56 100644 --- a/src/test/ui/e0119/conflict-with-std.rs +++ b/src/test/ui/e0119/conflict-with-std.rs @@ -14,25 +14,25 @@ use std::marker::PhantomData; use std::convert::{TryFrom, AsRef}; struct Q; -impl AsRef for Box { +impl AsRef for Box { //~ ERROR conflicting implementations fn as_ref(&self) -> &Q { &**self } } struct S; -impl From for S { +impl From for S { //~ ERROR conflicting implementations fn from(s: S) -> S { s } } struct X; -impl TryFrom for X { +impl TryFrom for X { //~ ERROR conflicting implementations type Error = (); fn try_from(u: X) -> Result { Ok(u) } } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/ui/e0119/conflict-with-std.stderr b/src/test/ui/e0119/conflict-with-std.stderr index f3e33291ef5bd..21f2dd05b4d79 100644 --- a/src/test/ui/e0119/conflict-with-std.stderr +++ b/src/test/ui/e0119/conflict-with-std.stderr @@ -1,7 +1,7 @@ error[E0119]: conflicting implementations of trait `std::convert::AsRef` for type `std::boxed::Box`: --> $DIR/conflict-with-std.rs:17:1 | -17 | / impl AsRef for Box { +17 | / impl AsRef for Box { //~ 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` for error[E0119]: conflicting implementations of trait `std::convert::From` for type `S`: --> $DIR/conflict-with-std.rs:24:1 | -24 | / impl From for S { +24 | / impl From 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` for t error[E0119]: conflicting implementations of trait `std::convert::TryFrom` for type `X`: --> $DIR/conflict-with-std.rs:31:1 | -31 | / impl TryFrom for X { +31 | / impl TryFrom for X { //~ ERROR conflicting implementations 32 | | type Error = (); 33 | | fn try_from(u: X) -> Result { 34 | | Ok(u) diff --git a/src/test/ui/e0119/issue-23563.rs b/src/test/ui/e0119/issue-23563.rs index 67710af9369d1..c6d03a4cfc0a7 100644 --- a/src/test/ui/e0119/issue-23563.rs +++ b/src/test/ui/e0119/issue-23563.rs @@ -20,7 +20,7 @@ use a::LolTo; struct LocalType(Option); -impl<'a, T> LolFrom<&'a [T]> for LocalType { +impl<'a, T> LolFrom<&'a [T]> for LocalType { //~ ERROR conflicting implementations of trait fn from(_: &'a [T]) -> LocalType { LocalType(None) } } @@ -36,4 +36,4 @@ impl LolTo> for [u8] { } } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/ui/e0119/issue-23563.stderr b/src/test/ui/e0119/issue-23563.stderr index dcb76d71b3dc8..9dddf193063fb 100644 --- a/src/test/ui/e0119/issue-23563.stderr +++ b/src/test/ui/e0119/issue-23563.stderr @@ -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 { +23 | / impl<'a, T> LolFrom<&'a [T]> for LocalType { //~ ERROR conflicting implementations of trait 24 | | fn from(_: &'a [T]) -> LocalType { LocalType(None) } 25 | | } | |_^ diff --git a/src/test/ui/e0119/issue-27403.rs b/src/test/ui/e0119/issue-27403.rs index c880921b65b1d..98953153faf96 100644 --- a/src/test/ui/e0119/issue-27403.rs +++ b/src/test/ui/e0119/issue-27403.rs @@ -12,10 +12,10 @@ pub struct GenX { inner: S, } -impl Into for GenX { +impl Into for GenX { //~ ERROR conflicting implementations fn into(self) -> S { self.inner } } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/ui/e0119/issue-27403.stderr b/src/test/ui/e0119/issue-27403.stderr index d03171fc10a89..68d7235f6aaee 100644 --- a/src/test/ui/e0119/issue-27403.stderr +++ b/src/test/ui/e0119/issue-27403.stderr @@ -1,7 +1,7 @@ error[E0119]: conflicting implementations of trait `std::convert::Into<_>` for type `GenX<_>`: --> $DIR/issue-27403.rs:15:1 | -15 | / impl Into for GenX { +15 | / impl Into for GenX { //~ ERROR conflicting implementations 16 | | fn into(self) -> S { 17 | | self.inner 18 | | } diff --git a/src/test/ui/e0119/issue-28981.rs b/src/test/ui/e0119/issue-28981.rs index 06018286b319f..8a52464ff50a4 100644 --- a/src/test/ui/e0119/issue-28981.rs +++ b/src/test/ui/e0119/issue-28981.rs @@ -12,6 +12,7 @@ use std::ops::Deref; struct Foo; -impl Deref for Foo { } +impl Deref for Foo { } //~ ERROR must be used +//~^ ERROR conflicting implementations -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/ui/e0119/issue-28981.stderr b/src/test/ui/e0119/issue-28981.stderr index c6c7c117a426e..aac9f7ae964a4 100644 --- a/src/test/ui/e0119/issue-28981.stderr +++ b/src/test/ui/e0119/issue-28981.stderr @@ -1,7 +1,7 @@ error[E0119]: conflicting implementations of trait `std::ops::Deref` for type `&_`: --> $DIR/issue-28981.rs:15:1 | -15 | impl Deref for Foo { } +15 | impl 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`); only traits defined in the current crate can be implemented for a type parameter --> $DIR/issue-28981.rs:15:1 | -15 | impl Deref for Foo { } +15 | impl Deref for Foo { } //~ ERROR must be used | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/e0119/so-37347311.rs b/src/test/ui/e0119/so-37347311.rs index 0d21120eac333..933cdb3cd533d 100644 --- a/src/test/ui/e0119/so-37347311.rs +++ b/src/test/ui/e0119/so-37347311.rs @@ -18,10 +18,10 @@ enum MyError { StorageProblem(S::Error), } -impl From for MyError { +impl From for MyError { //~ ERROR conflicting implementations fn from(error: S::Error) -> MyError { MyError::StorageProblem(error) } } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/src/test/ui/e0119/so-37347311.stderr b/src/test/ui/e0119/so-37347311.stderr index 8a26597a1c2f8..351c0e1bbb626 100644 --- a/src/test/ui/e0119/so-37347311.stderr +++ b/src/test/ui/e0119/so-37347311.stderr @@ -1,7 +1,7 @@ error[E0119]: conflicting implementations of trait `std::convert::From>` for type `MyError<_>`: --> $DIR/so-37347311.rs:21:1 | -21 | / impl From for MyError { +21 | / impl From for MyError { //~ ERROR conflicting implementations 22 | | fn from(error: S::Error) -> MyError { 23 | | MyError::StorageProblem(error) 24 | | } diff --git a/src/test/ui/fmt/send-sync.rs b/src/test/ui/fmt/send-sync.rs index bb4f9dfffc754..3f13fd2e4913a 100644 --- a/src/test/ui/fmt/send-sync.rs +++ b/src/test/ui/fmt/send-sync.rs @@ -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 } diff --git a/src/test/ui/fmt/send-sync.stderr b/src/test/ui/fmt/send-sync.stderr index 1ec53d220e963..9e0e563c35f65 100644 --- a/src/test/ui/fmt/send-sync.stderr +++ b/src/test/ui/fmt/send-sync.stderr @@ -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` diff --git a/src/test/ui/generator/ref-escapes-but-not-over-yield.rs b/src/test/ui/generator/ref-escapes-but-not-over-yield.rs index 87edbb22baae1..299106bd552f2 100644 --- a/src/test/ui/generator/ref-escapes-but-not-over-yield.rs +++ b/src/test/ui/generator/ref-escapes-but-not-over-yield.rs @@ -21,8 +21,8 @@ fn foo(x: &i32) { let mut b = move || { yield(); let b = 5; - a = &b; //~ ERROR - }; + a = &b; + }; //~ ERROR } fn main() { } diff --git a/src/test/ui/generator/ref-escapes-but-not-over-yield.stderr b/src/test/ui/generator/ref-escapes-but-not-over-yield.stderr index e30d28c2db83b..7310e54925ff8 100644 --- a/src/test/ui/generator/ref-escapes-but-not-over-yield.stderr +++ b/src/test/ui/generator/ref-escapes-but-not-over-yield.stderr @@ -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 diff --git a/src/test/ui/generator/yield-while-local-borrowed.rs b/src/test/ui/generator/yield-while-local-borrowed.rs index d21c86e88681e..504f3e8739f24 100644 --- a/src/test/ui/generator/yield-while-local-borrowed.rs +++ b/src/test/ui/generator/yield-while-local-borrowed.rs @@ -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); }; diff --git a/src/test/ui/impl-trait/equality.rs b/src/test/ui/impl-trait/equality.rs index 96db53ad2e46e..36df4f0eb4d46 100644 --- a/src/test/ui/impl-trait/equality.rs +++ b/src/test/ui/impl-trait/equality.rs @@ -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` is not satisfied } } diff --git a/src/test/ui/impl-trait/issue-21659-show-relevant-trait-impls-3.rs b/src/test/ui/impl-trait/issue-21659-show-relevant-trait-impls-3.rs index 0bb944edb9d84..9120cdab59861 100644 --- a/src/test/ui/impl-trait/issue-21659-show-relevant-trait-impls-3.rs +++ b/src/test/ui/impl-trait/issue-21659-show-relevant-trait-impls-3.rs @@ -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` } diff --git a/src/test/ui/impl-trait/method-suggestion-no-duplication.rs b/src/test/ui/impl-trait/method-suggestion-no-duplication.rs index 390b8f07b2fbd..15ddadf4c513d 100644 --- a/src/test/ui/impl-trait/method-suggestion-no-duplication.rs +++ b/src/test/ui/impl-trait/method-suggestion-no-duplication.rs @@ -18,8 +18,5 @@ fn foo(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 } diff --git a/src/test/ui/impl-trait/no-method-suggested-traits.rs b/src/test/ui/impl-trait/no-method-suggested-traits.rs index 15891b00028dc..d9866772bdd37 100644 --- a/src/test/ui/impl-trait/no-method-suggested-traits.rs +++ b/src/test/ui/impl-trait/no-method-suggested-traits.rs @@ -11,7 +11,12 @@ // 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 diff --git a/src/test/ui/impl-trait/no-method-suggested-traits.stderr b/src/test/ui/impl-trait/no-method-suggested-traits.stderr index ce9a6fa4e053e..2d519c11b948e 100644 --- a/src/test/ui/impl-trait/no-method-suggested-traits.stderr +++ b/src/test/ui/impl-trait/no-method-suggested-traits.stderr @@ -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 diff --git a/src/test/ui/impl-trait/trait_type.rs b/src/test/ui/impl-trait/trait_type.rs index 3507dcfbe172a..7eefa5c600617 100644 --- a/src/test/ui/impl-trait/trait_type.rs +++ b/src/test/ui/impl-trait/trait_type.rs @@ -15,16 +15,20 @@ struct MyType4; 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() {} diff --git a/src/test/ui/impl-trait/trait_type.stderr b/src/test/ui/impl-trait/trait_type.stderr index 9216c6e290775..42e1dcdb1c42a 100644 --- a/src/test/ui/impl-trait/trait_type.stderr +++ b/src/test/ui/impl-trait/trait_type.stderr @@ -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>` diff --git a/src/test/ui/impl-trait/universal-mismatched-type.rs b/src/test/ui/impl-trait/universal-mismatched-type.rs index af7adc4c657d9..00fc22ff0d853 100644 --- a/src/test/ui/impl-trait/universal-mismatched-type.rs +++ b/src/test/ui/impl-trait/universal-mismatched-type.rs @@ -13,7 +13,7 @@ use std::fmt::Debug; fn foo(x: impl Debug) -> String { - x + x //~ ERROR mismatched types } fn main() { } diff --git a/src/test/ui/impl-trait/universal-mismatched-type.stderr b/src/test/ui/impl-trait/universal-mismatched-type.stderr index 2be2458449768..b4dd6c8446c59 100644 --- a/src/test/ui/impl-trait/universal-mismatched-type.stderr +++ b/src/test/ui/impl-trait/universal-mismatched-type.stderr @@ -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` diff --git a/src/test/ui/impl-trait/universal-two-impl-traits.rs b/src/test/ui/impl-trait/universal-two-impl-traits.rs index f8855a7975550..9a4847b56062a 100644 --- a/src/test/ui/impl-trait/universal-two-impl-traits.rs +++ b/src/test/ui/impl-trait/universal-two-impl-traits.rs @@ -14,7 +14,7 @@ use std::fmt::Debug; fn foo(x: impl Debug, y: impl Debug) -> String { let mut a = x; - a = y; + a = y; //~ ERROR mismatched format!("{:?}", a) } diff --git a/src/test/ui/impl-trait/universal-two-impl-traits.stderr b/src/test/ui/impl-trait/universal-two-impl-traits.stderr index c663d38ca8a48..9903e26bbbd0b 100644 --- a/src/test/ui/impl-trait/universal-two-impl-traits.stderr +++ b/src/test/ui/impl-trait/universal-two-impl-traits.stderr @@ -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) diff --git a/src/test/ui/impl-trait/universal_wrong_bounds.rs b/src/test/ui/impl-trait/universal_wrong_bounds.rs index fd35d04b25861..36d9f615c5f57 100644 --- a/src/test/ui/impl-trait/universal_wrong_bounds.rs +++ b/src/test/ui/impl-trait/universal_wrong_bounds.rs @@ -15,11 +15,11 @@ use std::fmt::Display; 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() { diff --git a/src/test/ui/impl-trait/universal_wrong_bounds.stderr b/src/test/ui/impl-trait/universal_wrong_bounds.stderr index 600064c71dcc6..b457e025c29ff 100644 --- a/src/test/ui/impl-trait/universal_wrong_bounds.stderr +++ b/src/test/ui/impl-trait/universal_wrong_bounds.stderr @@ -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 | diff --git a/src/test/ui/in-band-lifetimes/E0687.rs b/src/test/ui/in-band-lifetimes/E0687.rs index 57b355cbb6a31..4eddebb15e120 100644 --- a/src/test/ui/in-band-lifetimes/E0687.rs +++ b/src/test/ui/in-band-lifetimes/E0687.rs @@ -11,16 +11,16 @@ #![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() {} diff --git a/src/test/ui/in-band-lifetimes/E0687.stderr b/src/test/ui/in-band-lifetimes/E0687.stderr index 14b513fc52aa2..42714f21685f9 100644 --- a/src/test/ui/in-band-lifetimes/E0687.stderr +++ b/src/test/ui/in-band-lifetimes/E0687.stderr @@ -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 diff --git a/src/test/ui/in-band-lifetimes/E0687_where.rs b/src/test/ui/in-band-lifetimes/E0687_where.rs index 6f04720dd4ace..ac67558772007 100644 --- a/src/test/ui/in-band-lifetimes/E0687_where.rs +++ b/src/test/ui/in-band-lifetimes/E0687_where.rs @@ -11,8 +11,8 @@ #![allow(warnings)] #![feature(in_band_lifetimes, universal_impl_trait)] -fn bar(x: &F) where F: Fn(&'a u32) {} +fn bar(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() {} diff --git a/src/test/ui/in-band-lifetimes/E0687_where.stderr b/src/test/ui/in-band-lifetimes/E0687_where.stderr index db50076fe7c01..a9913f6b64464 100644 --- a/src/test/ui/in-band-lifetimes/E0687_where.stderr +++ b/src/test/ui/in-band-lifetimes/E0687_where.stderr @@ -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(x: &F) where F: Fn(&'a u32) {} +14 | fn bar(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 diff --git a/src/test/ui/in-band-lifetimes/E0688.rs b/src/test/ui/in-band-lifetimes/E0688.rs index e6fe4e138e474..29b954e9a8360 100644 --- a/src/test/ui/in-band-lifetimes/E0688.rs +++ b/src/test/ui/in-band-lifetimes/E0688.rs @@ -11,15 +11,15 @@ #![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() {} } diff --git a/src/test/ui/in-band-lifetimes/E0688.stderr b/src/test/ui/in-band-lifetimes/E0688.stderr index 1289e7fd01039..c33b088f0faab 100644 --- a/src/test/ui/in-band-lifetimes/E0688.stderr +++ b/src/test/ui/in-band-lifetimes/E0688.stderr @@ -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 diff --git a/src/test/ui/in-band-lifetimes/mismatched.rs b/src/test/ui/in-band-lifetimes/mismatched.rs index 6b0a3fedfc5cc..80bc56c0f441c 100644 --- a/src/test/ui/in-band-lifetimes/mismatched.rs +++ b/src/test/ui/in-band-lifetimes/mismatched.rs @@ -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() {} diff --git a/src/test/ui/in-band-lifetimes/mismatched.stderr b/src/test/ui/in-band-lifetimes/mismatched.stderr index bbc25869f46c0..0c1231e01de6e 100644 --- a/src/test/ui/in-band-lifetimes/mismatched.stderr +++ b/src/test/ui/in-band-lifetimes/mismatched.stderr @@ -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... diff --git a/src/test/ui/in-band-lifetimes/mismatched_trait.rs b/src/test/ui/in-band-lifetimes/mismatched_trait.rs index 2e31677040425..bc175803ebda7 100644 --- a/src/test/ui/in-band-lifetimes/mismatched_trait.rs +++ b/src/test/ui/in-band-lifetimes/mismatched_trait.rs @@ -13,7 +13,7 @@ trait Get { fn baz(&self, x: &'a u32, y: &u32) -> &'a u32 { - y + y //~ ERROR explicit lifetime required } } diff --git a/src/test/ui/in-band-lifetimes/mismatched_trait.stderr b/src/test/ui/in-band-lifetimes/mismatched_trait.stderr index 315e881bf0738..58ff1694fb74c 100644 --- a/src/test/ui/in-band-lifetimes/mismatched_trait.stderr +++ b/src/test/ui/in-band-lifetimes/mismatched_trait.stderr @@ -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 diff --git a/src/test/ui/in-band-lifetimes/mismatched_trait_impl.rs b/src/test/ui/in-band-lifetimes/mismatched_trait_impl.rs index 1be32e5c51e71..52641059b1fa8 100644 --- a/src/test/ui/in-band-lifetimes/mismatched_trait_impl.rs +++ b/src/test/ui/in-band-lifetimes/mismatched_trait_impl.rs @@ -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 } } diff --git a/src/test/ui/in-band-lifetimes/mismatched_trait_impl.stderr b/src/test/ui/in-band-lifetimes/mismatched_trait_impl.stderr index d1f3ae450f8b0..e96f7181a6dae 100644 --- a/src/test/ui/in-band-lifetimes/mismatched_trait_impl.stderr +++ b/src/test/ui/in-band-lifetimes/mismatched_trait_impl.stderr @@ -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 | | } | |_____^ diff --git a/src/test/ui/in-band-lifetimes/mut_while_borrow.rs b/src/test/ui/in-band-lifetimes/mut_while_borrow.rs index fabf531968a4c..08ce13d0bccd1 100644 --- a/src/test/ui/in-band-lifetimes/mut_while_borrow.rs +++ b/src/test/ui/in-band-lifetimes/mut_while_borrow.rs @@ -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); } diff --git a/src/test/ui/in-band-lifetimes/mut_while_borrow.stderr b/src/test/ui/in-band-lifetimes/mut_while_borrow.stderr index 4800e39269f0a..14f9098c6c2f6 100644 --- a/src/test/ui/in-band-lifetimes/mut_while_borrow.stderr +++ b/src/test/ui/in-band-lifetimes/mut_while_borrow.stderr @@ -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 diff --git a/src/test/ui/in-band-lifetimes/no_in_band_in_struct.rs b/src/test/ui/in-band-lifetimes/no_in_band_in_struct.rs index b421e16092c2b..0d3e6ba644e63 100644 --- a/src/test/ui/in-band-lifetimes/no_in_band_in_struct.rs +++ b/src/test/ui/in-band-lifetimes/no_in_band_in_struct.rs @@ -12,11 +12,11 @@ #![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() {} diff --git a/src/test/ui/in-band-lifetimes/no_in_band_in_struct.stderr b/src/test/ui/in-band-lifetimes/no_in_band_in_struct.stderr index 7ffbfbd89b672..a8df6dbca0a11 100644 --- a/src/test/ui/in-band-lifetimes/no_in_band_in_struct.stderr +++ b/src/test/ui/in-band-lifetimes/no_in_band_in_struct.stderr @@ -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 diff --git a/src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.rs b/src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.rs index a7c9d4ece9569..eaa082a35da59 100644 --- a/src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.rs +++ b/src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.rs @@ -12,12 +12,12 @@ #![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() {} diff --git a/src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.stderr b/src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.stderr index a0c2e8199694a..e2340dbba23e1 100644 --- a/src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.stderr +++ b/src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.stderr @@ -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 diff --git a/src/test/ui/in-band-lifetimes/shadow.rs b/src/test/ui/in-band-lifetimes/shadow.rs index a9053d09f6c60..b6438f01af5f3 100644 --- a/src/test/ui/in-band-lifetimes/shadow.rs +++ b/src/test/ui/in-band-lifetimes/shadow.rs @@ -14,8 +14,8 @@ struct Foo(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() {} diff --git a/src/test/ui/in-band-lifetimes/shadow.stderr b/src/test/ui/in-band-lifetimes/shadow.stderr index f05b76fbea4c5..49b82fa495a05 100644 --- a/src/test/ui/in-band-lifetimes/shadow.stderr +++ b/src/test/ui/in-band-lifetimes/shadow.stderr @@ -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 diff --git a/src/test/ui/interior-mutability/interior-mutability.rs b/src/test/ui/interior-mutability/interior-mutability.rs index 60d85d1b3b787..a772d1f90cc0b 100644 --- a/src/test/ui/interior-mutability/interior-mutability.rs +++ b/src/test/ui/interior-mutability/interior-mutability.rs @@ -12,5 +12,5 @@ use std::cell::Cell; 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 } diff --git a/src/test/ui/interior-mutability/interior-mutability.stderr b/src/test/ui/interior-mutability/interior-mutability.stderr index 76362f1f494a6..f4beb44b82dc7 100644 --- a/src/test/ui/interior-mutability/interior-mutability.stderr +++ b/src/test/ui/interior-mutability/interior-mutability.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `std::cell::UnsafeCell: std::panic::RefUnwindSafe` is not satisfied in `std::cell::Cell` --> $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 may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | = help: within `std::cell::Cell`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell` diff --git a/src/test/ui/issue-13483.rs b/src/test/ui/issue-13483.rs index 8637804391276..c44465b221cdc 100644 --- a/src/test/ui/issue-13483.rs +++ b/src/test/ui/issue-13483.rs @@ -10,14 +10,14 @@ fn main() { if true { - } else if { + } else if { //~ ERROR missing condition } else { } } fn foo() { if true { - } else if { + } else if { //~ ERROR missing condition } bar(); } diff --git a/src/test/ui/issue-13483.stderr b/src/test/ui/issue-13483.stderr index 3446969dfd213..344e179695369 100644 --- a/src/test/ui/issue-13483.stderr +++ b/src/test/ui/issue-13483.stderr @@ -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 diff --git a/src/test/ui/issue-22644.rs b/src/test/ui/issue-22644.rs index c8e0cd1763ffa..f787e43dbdf57 100644 --- a/src/test/ui/issue-22644.rs +++ b/src/test/ui/issue-22644.rs @@ -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` } diff --git a/src/test/ui/issue-22644.stderr b/src/test/ui/issue-22644.stderr index 5777c24ae8889..91107fbe35610 100644 --- a/src/test/ui/issue-22644.stderr +++ b/src/test/ui/issue-22644.stderr @@ -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 diff --git a/src/test/ui/issue-33525.rs b/src/test/ui/issue-33525.rs index 0e777fe8a9454..0589618a82faf 100644 --- a/src/test/ui/issue-33525.rs +++ b/src/test/ui/issue-33525.rs @@ -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 } diff --git a/src/test/ui/issue-33525.stderr b/src/test/ui/issue-33525.stderr index 5de2d98f86a9d..4909340fa4c35 100644 --- a/src/test/ui/issue-33525.stderr +++ b/src/test/ui/issue-33525.stderr @@ -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 diff --git a/src/test/ui/issue-33941.rs b/src/test/ui/issue-33941.rs index eb111d33b99c2..21c169c663828 100644 --- a/src/test/ui/issue-33941.rs +++ b/src/test/ui/issue-33941.rs @@ -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 } diff --git a/src/test/ui/issue-33941.stderr b/src/test/ui/issue-33941.stderr index 5a8d1fab3f659..953e6fe77d716 100644 --- a/src/test/ui/issue-33941.stderr +++ b/src/test/ui/issue-33941.stderr @@ -1,7 +1,7 @@ error[E0271]: type mismatch resolving ` 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 ` 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 `(&_, &_)` diff --git a/src/test/ui/issue-35241.rs b/src/test/ui/issue-35241.rs index 7ec3974854b33..4616f25bdfb86 100644 --- a/src/test/ui/issue-35241.rs +++ b/src/test/ui/issue-35241.rs @@ -10,6 +10,6 @@ struct Foo(u32); -fn test() -> Foo { Foo } +fn test() -> Foo { Foo } //~ ERROR mismatched types fn main() {} diff --git a/src/test/ui/issue-35241.stderr b/src/test/ui/issue-35241.stderr index bb1bba152bbd3..25cef7388977d 100644 --- a/src/test/ui/issue-35241.stderr +++ b/src/test/ui/issue-35241.stderr @@ -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 diff --git a/src/test/ui/issue-35675.rs b/src/test/ui/issue-35675.rs index 001c1f2eddca1..ee9d1324cdbb7 100644 --- a/src/test/ui/issue-35675.rs +++ b/src/test/ui/issue-35675.rs @@ -12,14 +12,13 @@ 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 @@ mod x { Variant1, Variant2(), Variant3(usize), - //~^ HELP there is an enum variant `x::Enum::Variant3`, did you mean to use `x::Enum`? Variant4 {}, } } diff --git a/src/test/ui/issue-35675.stderr b/src/test/ui/issue-35675.stderr index e125d74e28ffa..550e094dc51bb 100644 --- a/src/test/ui/issue-35675.stderr +++ b/src/test/ui/issue-35675.stderr @@ -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`? diff --git a/src/test/ui/issue-35976.rs b/src/test/ui/issue-35976.rs index 169d7b5591670..d45b0c5a0416c 100644 --- a/src/test/ui/issue-35976.rs +++ b/src/test/ui/issue-35976.rs @@ -23,7 +23,6 @@ mod private { fn bar(arg: Box) { 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() { diff --git a/src/test/ui/issue-36400.rs b/src/test/ui/issue-36400.rs index c0aec5b4296be..fa4361e42aa5b 100644 --- a/src/test/ui/issue-36400.rs +++ b/src/test/ui/issue-36400.rs @@ -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 } diff --git a/src/test/ui/issue-36400.stderr b/src/test/ui/issue-36400.stderr index 69e9c455f357d..84e6855e23b46 100644 --- a/src/test/ui/issue-36400.stderr +++ b/src/test/ui/issue-36400.stderr @@ -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 diff --git a/src/test/ui/issue-37311-type-length-limit/issue-37311.rs b/src/test/ui/issue-37311-type-length-limit/issue-37311.rs index add96461f1bfe..1e05bdb0c6086 100644 --- a/src/test/ui/issue-37311-type-length-limit/issue-37311.rs +++ b/src/test/ui/issue-37311-type-length-limit/issue-37311.rs @@ -20,7 +20,7 @@ trait Foo { impl Foo for T { #[allow(unconditional_recursion)] - fn recurse(&self) { + fn recurse(&self) { //~ ERROR reached the type-length limit (self, self).recurse(); } } diff --git a/src/test/ui/issue-37311-type-length-limit/issue-37311.stderr b/src/test/ui/issue-37311-type-length-limit/issue-37311.stderr index b51b683a1ac3a..fe173867da109 100644 --- a/src/test/ui/issue-37311-type-length-limit/issue-37311.stderr +++ b/src/test/ui/issue-37311-type-length-limit/issue-37311.stderr @@ -1,7 +1,7 @@ error: reached the type-length limit while instantiating `<(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(), &()), &(&()...` --> $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 | | } | |_____^ diff --git a/src/test/ui/issue-40402-ref-hints/issue-40402-1.rs b/src/test/ui/issue-40402-ref-hints/issue-40402-1.rs index 7efa3bd9d5b31..f2de2030bd196 100644 --- a/src/test/ui/issue-40402-ref-hints/issue-40402-1.rs +++ b/src/test/ui/issue-40402-ref-hints/issue-40402-1.rs @@ -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 } diff --git a/src/test/ui/issue-40402-ref-hints/issue-40402-1.stderr b/src/test/ui/issue-40402-ref-hints/issue-40402-1.stderr index 56d0a5351ce83..173a60b0f0885 100644 --- a/src/test/ui/issue-40402-ref-hints/issue-40402-1.stderr +++ b/src/test/ui/issue-40402-ref-hints/issue-40402-1.stderr @@ -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 diff --git a/src/test/ui/issue-40402-ref-hints/issue-40402-2.rs b/src/test/ui/issue-40402-ref-hints/issue-40402-2.rs index 76e038b696e8f..894923605c024 100644 --- a/src/test/ui/issue-40402-ref-hints/issue-40402-2.rs +++ b/src/test/ui/issue-40402-ref-hints/issue-40402-2.rs @@ -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 } diff --git a/src/test/ui/issue-40402-ref-hints/issue-40402-2.stderr b/src/test/ui/issue-40402-ref-hints/issue-40402-2.stderr index 0060b683bba43..7b992e376dc74 100644 --- a/src/test/ui/issue-40402-ref-hints/issue-40402-2.stderr +++ b/src/test/ui/issue-40402-ref-hints/issue-40402-2.stderr @@ -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`) diff --git a/src/test/ui/issue-40782.rs b/src/test/ui/issue-40782.rs index 56ee225105f89..10dc177c7e95d 100644 --- a/src/test/ui/issue-40782.rs +++ b/src/test/ui/issue-40782.rs @@ -9,7 +9,7 @@ // except according to those terms. fn main() { - for i 0..2 { + for i 0..2 { //~ ERROR missing `in` } } diff --git a/src/test/ui/issue-40782.stderr b/src/test/ui/issue-40782.stderr index 0d49eebbdbfc9..543233e0cc620 100644 --- a/src/test/ui/issue-40782.stderr +++ b/src/test/ui/issue-40782.stderr @@ -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 diff --git a/src/test/ui/issue-42106.rs b/src/test/ui/issue-42106.rs index f13f1dd114517..f35eee186a2a5 100644 --- a/src/test/ui/issue-42106.rs +++ b/src/test/ui/issue-42106.rs @@ -10,7 +10,7 @@ fn do_something(collection: &mut Vec) { let _a = &collection; - collection.swap(1, 2); + collection.swap(1, 2); //~ ERROR also borrowed as immutable } fn main() {} diff --git a/src/test/ui/issue-42106.stderr b/src/test/ui/issue-42106.stderr index 481cdb5f5b2f6..0f96377c062a8 100644 --- a/src/test/ui/issue-42106.stderr +++ b/src/test/ui/issue-42106.stderr @@ -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 diff --git a/src/test/ui/issue-42954.rs b/src/test/ui/issue-42954.rs index bdfdf44c0e28a..6fa2c69bf6696 100644 --- a/src/test/ui/issue-42954.rs +++ b/src/test/ui/issue-42954.rs @@ -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 }; } diff --git a/src/test/ui/issue-42954.stderr b/src/test/ui/issue-42954.stderr index 7287c8f37eb06..d0fc410c474a4 100644 --- a/src/test/ui/issue-42954.stderr +++ b/src/test/ui/issue-42954.stderr @@ -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 diff --git a/src/test/ui/issue-44023.rs b/src/test/ui/issue-44023.rs index 295d480828930..97b82dc58dcfc 100644 --- a/src/test/ui/issue-44023.rs +++ b/src/test/ui/issue-44023.rs @@ -12,5 +12,5 @@ pub fn main () {} -fn საჭმელად_გემრიელი_სადილი ( ) -> isize { +fn საჭმელად_გემრიელი_სადილი ( ) -> isize { //~ ERROR mismatched types } diff --git a/src/test/ui/issue-44023.stderr b/src/test/ui/issue-44023.stderr index a17512ba4abc4..fc6363dc921a2 100644 --- a/src/test/ui/issue-44023.stderr +++ b/src/test/ui/issue-44023.stderr @@ -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 () diff --git a/src/test/ui/issue-44078.rs b/src/test/ui/issue-44078.rs index ef47214f2b393..356a7be0b419e 100644 --- a/src/test/ui/issue-44078.rs +++ b/src/test/ui/issue-44078.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - "😊""; + "😊""; //~ ERROR unterminated double quote } diff --git a/src/test/ui/issue-44078.stderr b/src/test/ui/issue-44078.stderr index 2ed4578d5389e..49e461bd18d18 100644 --- a/src/test/ui/issue-44078.stderr +++ b/src/test/ui/issue-44078.stderr @@ -1,7 +1,7 @@ error: unterminated double quote string --> $DIR/issue-44078.rs:12:8 | -12 | "😊""; +12 | "😊""; //~ ERROR unterminated double quote | _________^ 13 | | } | |__^ diff --git a/src/test/ui/issue-44406.rs b/src/test/ui/issue-44406.rs index abf572118fc68..8e99caff4efa2 100644 --- a/src/test/ui/issue-44406.rs +++ b/src/test/ui/issue-44406.rs @@ -15,5 +15,6 @@ macro_rules! foo { } fn main() { - foo!(true); + foo!(true); //~ ERROR expected type, found keyword + //~^ ERROR expected identifier, found keyword } diff --git a/src/test/ui/issue-44406.stderr b/src/test/ui/issue-44406.stderr index e7afbb574efd7..2e71b001d7ac0 100644 --- a/src/test/ui/issue-44406.stderr +++ b/src/test/ui/issue-44406.stderr @@ -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 diff --git a/src/test/ui/issue-45107-unnecessary-unsafe-in-closure.rs b/src/test/ui/issue-45107-unnecessary-unsafe-in-closure.rs index 833fc2802a3a5..2fce8d723d39c 100644 --- a/src/test/ui/issue-45107-unnecessary-unsafe-in-closure.rs +++ b/src/test/ui/issue-45107-unnecessary-unsafe-in-closure.rs @@ -14,13 +14,13 @@ fn main() { unsafe { let f = |v: &mut Vec<_>| { - unsafe { + unsafe { //~ ERROR unnecessary `unsafe` v.set_len(24); - |w: &mut Vec| { unsafe { + |w: &mut Vec| { unsafe { //~ ERROR unnecessary `unsafe` w.set_len(32); } }; } - |x: &mut Vec| { unsafe { + |x: &mut Vec| { unsafe { //~ ERROR unnecessary `unsafe` x.set_len(40); } }; }; diff --git a/src/test/ui/issue-45107-unnecessary-unsafe-in-closure.stderr b/src/test/ui/issue-45107-unnecessary-unsafe-in-closure.stderr index be6b1e30a59da..abd875c48083d 100644 --- a/src/test/ui/issue-45107-unnecessary-unsafe-in-closure.stderr +++ b/src/test/ui/issue-45107-unnecessary-unsafe-in-closure.stderr @@ -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| { unsafe { +19 | | |w: &mut Vec| { 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| { unsafe { +19 | |w: &mut Vec| { 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| { unsafe { +23 | |x: &mut Vec| { 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); diff --git a/src/test/ui/issue-45296.rs b/src/test/ui/issue-45296.rs index 7a2b4e56d6944..965747cfa05ca 100644 --- a/src/test/ui/issue-45296.rs +++ b/src/test/ui/issue-45296.rs @@ -11,5 +11,5 @@ fn main() { let unused = (); - #![allow(unused_variables)] + #![allow(unused_variables)] //~ ERROR not permitted in this context } diff --git a/src/test/ui/issue-45296.stderr b/src/test/ui/issue-45296.stderr index 1a660e4c6784e..45a80750de716 100644 --- a/src/test/ui/issue-45296.stderr +++ b/src/test/ui/issue-45296.stderr @@ -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. diff --git a/src/test/ui/issue-45730.rs b/src/test/ui/issue-45730.rs index f725d69ca65cd..d733c8e6de26f 100644 --- a/src/test/ui/issue-45730.rs +++ b/src/test/ui/issue-45730.rs @@ -10,10 +10,10 @@ 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 } diff --git a/src/test/ui/issue-45730.stderr b/src/test/ui/issue-45730.stderr index c4f2e856b7b57..94d39239117ad 100644 --- a/src/test/ui/issue-45730.stderr +++ b/src/test/ui/issue-45730.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.rs b/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.rs index 04112c303bd93..5ded42e7c972c 100644 --- a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.rs +++ b/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.rs @@ -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 } } diff --git a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr b/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr index 613c903853ae5..9bfa72c2f36ce 100644 --- a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr +++ b/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.rs b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.rs index 55752f753ef12..1705767834fb2 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.rs +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.rs @@ -18,7 +18,7 @@ impl<'a> Foo<'a> { match *self { Foo::Bar(s) => { if s == "test" { - other + other //~ ERROR explicit lifetime } else { self.clone() } diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr index d1660a620b6c7..4c5e37b8f10fb 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.rs b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.rs index a1716c4e79792..964f2f1c003ec 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.rs +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.rs @@ -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() { } diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr index 83716b7791d83..457e347faaa4d 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.rs b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.rs index 7bd32d8761705..96d5c5bb16100 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.rs +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.rs @@ -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 () { } diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr index 6d5e94a5e78ad..8c3592379ef12 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.rs b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.rs index 8849f7084b3cd..5cf52fe79f014 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.rs +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.rs @@ -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 } } diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr index 4288fdf89a417..d5d1d16a4245f 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.rs b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.rs index 362290ff3fa7d..3727ddf91298e 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.rs +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.rs @@ -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 } diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr index 95076bfbdc7da..23b9c0cf2506f 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs index 36d956a39966f..cec73d79ec21b 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs @@ -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 } diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr index cb9a1edf1ddf9..f418e1c01f2ae 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.rs b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.rs index 30239f4c0946c..5ee2663317e96 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.rs +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.rs @@ -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() { } diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr index 5d1336c7c3a22..b28f102cd5ac1 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs index 96b733be9b4eb..4d57c61ba9e2e 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs @@ -15,7 +15,7 @@ struct Foo { impl Foo { fn foo<'a>(&self, x: &'a i32) -> &i32 { - x + x //~ ERROR lifetime mismatch } diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr index 8af6acc62c436..d26cb6be709b1 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs index a8ce60c47b6f5..a6ccf4a53d155 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs @@ -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 } } diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr index c09de0c33af7a..0430e4c271507 100644 --- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.rs b/src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.rs index 098950e13b315..7f5b23728fd31 100644 --- a/src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.rs +++ b/src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.rs @@ -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 } } diff --git a/src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.stderr b/src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.stderr index fccc44caac81a..7cd5ca65981b7 100644 --- a/src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.stderr +++ b/src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.stderr @@ -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` diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.rs b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.rs index dd34e1aa6d9d2..f35a7555d708b 100644 --- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.rs +++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.rs @@ -13,7 +13,7 @@ struct Ref<'a, T: 'a> { } fn foo<'a>(x: Ref, y: &mut Vec>) { - y.push(x); + y.push(x); //~ ERROR explicit lifetime } fn main() { } diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr index 8dba0c33f201a..7abc093512b46 100644 --- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr +++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr @@ -3,7 +3,7 @@ error[E0621]: explicit lifetime required in the type of `x` | 15 | fn foo<'a>(x: Ref, y: &mut Vec>) { | - 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 diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs index 5d1820082093e..18a720f345d7f 100644 --- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs +++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs @@ -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; diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr index 980f14a51d9b1..ca522596fbff8 100644 --- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr +++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.rs b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.rs index 71a1c865e0995..1834395bd3b82 100644 --- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.rs +++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.rs @@ -13,7 +13,7 @@ struct Ref<'a, T: 'a> { } fn foo<'a>(x: &mut Vec>, y: Ref) { - x.push(y); + x.push(y); //~ ERROR explicit lifetime } fn main() { } diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr index e529d6ffe46b4..5d8f2c1decb2c 100644 --- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr +++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr @@ -3,7 +3,7 @@ error[E0621]: explicit lifetime required in the type of `y` | 15 | fn foo<'a>(x: &mut Vec>, y: Ref) { | - 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 diff --git a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.rs b/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.rs index 09038d8ce9027..6cf626adf82e3 100644 --- a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.rs +++ b/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.rs @@ -13,7 +13,7 @@ struct Ref<'a, T: 'a> { } fn foo(x: &mut Vec>, y: Ref) { - x.push(y); + x.push(y); //~ ERROR lifetime mismatch } fn main() { } diff --git a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.stderr b/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.stderr index 1ee0099799760..69ff29db3570a 100644 --- a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.stderr +++ b/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.stderr @@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch | 15 | fn foo(x: &mut Vec>, y: Ref) { | -------- -------- 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 diff --git a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.rs b/src/test/ui/lifetime-errors/ex2c-push-inference-variable.rs index cb083f778deeb..36bd1c32286e1 100644 --- a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.rs +++ b/src/test/ui/lifetime-errors/ex2c-push-inference-variable.rs @@ -14,7 +14,7 @@ struct Ref<'a, T: 'a> { fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { let z = Ref { data: y.data }; - x.push(z); + x.push(z); //~ ERROR lifetime mismatch } fn main() { } diff --git a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr b/src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr index 495af8ae208f6..dacb0708b0580 100644 --- a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr +++ b/src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr @@ -4,7 +4,7 @@ error[E0623]: lifetime mismatch 15 | fn foo<'a, 'b, 'c>(x: &'a mut Vec>, 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 diff --git a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.rs b/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.rs index bcb7583beefcf..96316819e937f 100644 --- a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.rs +++ b/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.rs @@ -13,7 +13,7 @@ struct Ref<'a, T: 'a> { } fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { - let a: &mut Vec> = x; + let a: &mut Vec> = x; //~ ERROR lifetime mismatch let b = Ref { data: y.data }; a.push(b); } diff --git a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.stderr b/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.stderr index 1f250a888472c..e30355891ee78 100644 --- a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.stderr +++ b/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.stderr @@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch | 15 | fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { | ------------ ------------ these two types are declared with different lifetimes... -16 | let a: &mut Vec> = x; +16 | let a: &mut Vec> = x; //~ ERROR lifetime mismatch | ^ ...but data from `y` flows into `x` here error: aborting due to previous error diff --git a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.rs b/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.rs index 2d05adb7ecd37..9352ebc77f5b2 100644 --- a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.rs +++ b/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.rs @@ -13,7 +13,7 @@ struct Ref<'a, T: 'a> { } fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { - let a: &mut Vec> = x; + let a: &mut Vec> = x; //~ ERROR lifetime mismatch let b = Ref { data: y.data }; Vec::push(a, b); } diff --git a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.stderr b/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.stderr index 343c35b871ede..841555c1fcb38 100644 --- a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.stderr +++ b/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.stderr @@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch | 15 | fn foo<'a, 'b, 'c>(x: &'a mut Vec>, y: Ref<'c, i32>) { | ------------ ------------ these two types are declared with different lifetimes... -16 | let a: &mut Vec> = x; +16 | let a: &mut Vec> = x; //~ ERROR lifetime mismatch | ^ ...but data from `y` flows into `x` here error: aborting due to previous error diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.rs index 905eae18d1807..5d490824d02f9 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.rs @@ -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() { } diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr index 74a40c87c2fb1..5e1a4593ae459 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.rs index 51271243bdfdc..fe6b40c05a603 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.rs @@ -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() { } diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr index 898866c75f214..b5b90c077d064 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs index 2fbf31aead5ed..f16120ddc22a0 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs @@ -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() {} diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr index 26f31defc9eb1..e7317e63ab472 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs index 120a7ca74aeee..78e6dc2d3e75f 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs @@ -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() {} diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr index 73460277de44c..71eef13a67db7 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.rs index 606e611865fc7..78e6dc2d3e75f 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.rs @@ -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() {} diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.stderr index fb524ae62c57a..61b59b8f121c1 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs index 0fef709ae5363..ffec0e8d5bbb6 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs @@ -15,7 +15,7 @@ fn foo<'a, 'b>(mut x: Vec>, y: Ref<'b>) where &'a (): Sized, &'b u32: Sized { - x.push(y); + x.push(y); //~ ERROR lifetime mismatch } fn main() {} diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr index 59bf5d17222b7..0b1b01d86b8ea 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr @@ -4,7 +4,7 @@ error[E0623]: lifetime mismatch 14 | fn foo<'a, 'b>(mut x: Vec>, 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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs index a91d0b55dc7ab..16d18f309516c 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs @@ -12,7 +12,7 @@ struct Ref<'a> { } fn foo<'a, 'b>(mut x: Vec>, y: Ref<'b>) { - x.push(y); + x.push(y); //~ ERROR lifetime mismatch } fn main() {} diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr index 878351210681b..36885b7e076e4 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr @@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch | 14 | fn foo<'a, 'b>(mut x: Vec>, 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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs index 67ba8ee532ad0..3b90b3474a140 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs @@ -12,7 +12,7 @@ struct Ref<'a> { } fn foo(mut x: Vec, y: Ref) { - x.push(y); + x.push(y); //~ ERROR lifetime mismatch } fn main() {} diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr index 6ad795400b334..961b8e310fe16 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr @@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch | 14 | fn foo(mut x: Vec, 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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs index 5abfc983f883a..966b4f0b6c329 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs @@ -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() { } diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr index be628f226d3dd..b70d26a99d732 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs index a8b1f53fc98d6..055c3f804685a 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs @@ -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() { } diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr index 31c7ebf6504cc..7a50371306369 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs index 4933dbb7e7a7a..474da4a7d1613 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs @@ -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() { } diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr index d54b526aef97f..66155bec0bb9a 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs index 4933dbb7e7a7a..474da4a7d1613 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs @@ -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() { } diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr index 40f026bcb1b58..d47cffbc6222f 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs index e1594b1a277cd..1ffaec7ba00d3 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs @@ -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() {} diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr index bb7b9ea68436c..43c85e43e7738 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs index 0dc257ac0921e..97af35980105d 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs @@ -14,7 +14,7 @@ struct Foo { impl Foo { fn foo<'a>(&self, x: &i32) -> &i32 { - x + x //~ ERROR lifetime mismatch } } diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr index 1409b2161330b..73927f0c1d31f 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs index 0940ce15d1e76..e6f4f0966ca62 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs @@ -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 } } diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr index cae45023e26b2..edb7ce2d6e9f7 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs index 9220c34489fab..db53acf5afceb 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs @@ -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() { } diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr index adfc4dc0c276e..065b669e6929b 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs index 3a7ba415c0ded..b3ef06f189897 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs @@ -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() {} diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr index 9591df8e8aad2..20badfccd8e14 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr @@ -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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs index 78a6ad54eae4f..ebde6a3b53ff6 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. fn foo(x:Box , y: Vec<&u8>, z: &u8) { - y.push(z); + y.push(z); //~ ERROR lifetime mismatch } fn main() { } diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr index ce766b2e406a2..b8a4d9ed24ec9 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr @@ -3,7 +3,7 @@ error[E0623]: lifetime mismatch | 10 | fn foo(x:Box , 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 diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions.rs b/src/test/ui/lifetime-errors/ex3-both-anon-regions.rs index be48d07b94e06..f88eca494eb5a 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions.rs +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions.rs @@ -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() { } diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr index d3291063859ca..2a30172c43a18 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr +++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr @@ -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 diff --git a/src/test/ui/lifetimes/borrowck-let-suggestion.rs b/src/test/ui/lifetimes/borrowck-let-suggestion.rs index 1c904648f9e7b..7bf0ed34cbfd2 100644 --- a/src/test/ui/lifetimes/borrowck-let-suggestion.rs +++ b/src/test/ui/lifetimes/borrowck-let-suggestion.rs @@ -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() { diff --git a/src/test/ui/lifetimes/borrowck-let-suggestion.stderr b/src/test/ui/lifetimes/borrowck-let-suggestion.stderr index ea8aafadc8e79..f61595e869d75 100644 --- a/src/test/ui/lifetimes/borrowck-let-suggestion.stderr +++ b/src/test/ui/lifetimes/borrowck-let-suggestion.stderr @@ -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 diff --git a/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.rs b/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.rs index 242520cdb32c7..58c33af0ddd27 100644 --- a/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.rs +++ b/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.rs @@ -16,6 +16,7 @@ trait Collection { fn len(&self) -> usize; } 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 @@ impl<'a, T: ListItem<'a>> Collection for List<'a, T> { struct Foo { foo: &'static T + //~^ ERROR may not live long enough } trait X: Sized { fn foo<'a, L: X<&'a Nested>>(); + //~^ ERROR may not live long enough // check that we give a sane error for `Self` fn bar<'a, L: X<&'a Nested>>(); + //~^ ERROR may not live long enough } struct Nested(K); impl Nested { fn generic_in_parent<'a, L: X<&'a Nested>>() { + //~^ ERROR may not live long enough } fn generic_in_child<'a, 'b, L: X<&'a Nested>, M: 'b>() { + //~^ ERROR may not live long enough } } diff --git a/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr b/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr index 42e4f28260ea2..342c6ab8f1624 100644 --- a/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr +++ b/src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr @@ -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 { +28 | struct Foo { | - 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: Sized { +33 | trait X: Sized { | - help: consider adding an explicit lifetime bound `K: 'a`... -32 | fn foo<'a, L: X<&'a Nested>>(); +34 | fn foo<'a, L: X<&'a Nested>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: ...so that the reference type `&'a Nested` 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>>(); +34 | fn foo<'a, L: X<&'a Nested>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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>>(); +37 | fn bar<'a, L: X<&'a Nested>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider adding an explicit lifetime bound `Self: 'a`... note: ...so that the reference type `&'a Nested` 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>>(); +37 | fn bar<'a, L: X<&'a Nested>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 Nested { +42 | impl Nested { | - help: consider adding an explicit lifetime bound `K: 'a`... -39 | / fn generic_in_parent<'a, L: X<&'a Nested>>() { -40 | | } +43 | / fn generic_in_parent<'a, L: X<&'a Nested>>() { +44 | | //~^ ERROR may not live long enough +45 | | } | |_____^ | note: ...so that the reference type `&'a Nested` 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>>() { -40 | | } +43 | / fn generic_in_parent<'a, L: X<&'a Nested>>() { +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: 'b>() { +46 | fn generic_in_child<'a, 'b, L: X<&'a Nested>, 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` 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: 'b>() { -42 | | } +46 | / fn generic_in_child<'a, 'b, L: X<&'a Nested>, M: 'b>() { +47 | | //~^ ERROR may not live long enough +48 | | } | |_____^ error: aborting due to 6 previous errors diff --git a/src/test/ui/lint/command-line-lint-group-deny.rs b/src/test/ui/lint/command-line-lint-group-deny.rs index 1248601c1e44a..6ffc9b5aa1701 100644 --- a/src/test/ui/lint/command-line-lint-group-deny.rs +++ b/src/test/ui/lint/command-line-lint-group-deny.rs @@ -11,5 +11,5 @@ // compile-flags: -D bad-style fn main() { - let _InappropriateCamelCasing = true; + let _InappropriateCamelCasing = true; //~ ERROR should have a snake } diff --git a/src/test/ui/lint/command-line-lint-group-deny.stderr b/src/test/ui/lint/command-line-lint-group-deny.stderr index 23fac66cc6c98..a6182de0a7587 100644 --- a/src/test/ui/lint/command-line-lint-group-deny.stderr +++ b/src/test/ui/lint/command-line-lint-group-deny.stderr @@ -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` diff --git a/src/test/ui/lint/command-line-lint-group-forbid.rs b/src/test/ui/lint/command-line-lint-group-forbid.rs index ae16db44864c9..eb4645a4fc8dd 100644 --- a/src/test/ui/lint/command-line-lint-group-forbid.rs +++ b/src/test/ui/lint/command-line-lint-group-forbid.rs @@ -11,5 +11,5 @@ // compile-flags: -F bad-style fn main() { - let _InappropriateCamelCasing = true; + let _InappropriateCamelCasing = true; //~ ERROR should have a snake } diff --git a/src/test/ui/lint/command-line-lint-group-forbid.stderr b/src/test/ui/lint/command-line-lint-group-forbid.stderr index 0babd7f6fe47a..7ae6734c8a397 100644 --- a/src/test/ui/lint/command-line-lint-group-forbid.stderr +++ b/src/test/ui/lint/command-line-lint-group-forbid.stderr @@ -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` diff --git a/src/test/ui/lint/lint-group-style.rs b/src/test/ui/lint/lint-group-style.rs index 2bd760e417a89..9f33f57f48a28 100644 --- a/src/test/ui/lint/lint-group-style.rs +++ b/src/test/ui/lint/lint-group-style.rs @@ -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 @@ mod test { #[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 } } diff --git a/src/test/ui/lint/lint-group-style.stderr b/src/test/ui/lint/lint-group-style.stderr index 862e94b873a0c..3dfe2cee991a0 100644 --- a/src/test/ui/lint/lint-group-style.stderr +++ b/src/test/ui/lint/lint-group-style.stderr @@ -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 diff --git a/src/test/ui/lint/outer-forbid.rs b/src/test/ui/lint/outer-forbid.rs index a79dacbc1c959..d72f307b46124 100644 --- a/src/test/ui/lint/outer-forbid.rs +++ b/src/test/ui/lint/outer-forbid.rs @@ -16,13 +16,13 @@ #![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") } diff --git a/src/test/ui/lint/outer-forbid.stderr b/src/test/ui/lint/outer-forbid.stderr index 67a1f4f88adc6..0bc4e4dcf5fd6 100644 --- a/src/test/ui/lint/outer-forbid.stderr +++ b/src/test/ui/lint/outer-forbid.stderr @@ -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 diff --git a/src/test/ui/lint/suggestions.rs b/src/test/ui/lint/suggestions.rs index bf2b5769bf830..3789b6dfc8b3a 100644 --- a/src/test/ui/lint/suggestions.rs +++ b/src/test/ui/lint/suggestions.rs @@ -12,25 +12,34 @@ #![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) {} +//~^ 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); } diff --git a/src/test/ui/lint/suggestions.stderr b/src/test/ui/lint/suggestions.stderr index a00146668362a..7b84cc1f4b490 100644 --- a/src/test/ui/lint/suggestions.stderr +++ b/src/test/ui/lint/suggestions.stderr @@ -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) {} +20 | pub fn defiant(_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 diff --git a/src/test/ui/loop-break-value-no-repeat.rs b/src/test/ui/loop-break-value-no-repeat.rs index b52d540fd7511..f24840eca5441 100644 --- a/src/test/ui/loop-break-value-no-repeat.rs +++ b/src/test/ui/loop-break-value-no-repeat.rs @@ -19,6 +19,6 @@ use std::ptr; fn main() { for _ in &[1,2,3] { - break 22 + break 22 //~ ERROR `break` with value from a `for` loop } } diff --git a/src/test/ui/loop-break-value-no-repeat.stderr b/src/test/ui/loop-break-value-no-repeat.stderr index c154ea6f8c2d6..296b3b191e319 100644 --- a/src/test/ui/loop-break-value-no-repeat.stderr +++ b/src/test/ui/loop-break-value-no-repeat.stderr @@ -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 diff --git a/src/test/ui/lub-glb/old-lub-glb-hr.rs b/src/test/ui/lub-glb/old-lub-glb-hr.rs index 85c90bb375fc7..7526b2f946c12 100644 --- a/src/test/ui/lub-glb/old-lub-glb-hr.rs +++ b/src/test/ui/lub-glb/old-lub-glb-hr.rs @@ -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, }; diff --git a/src/test/ui/lub-glb/old-lub-glb-hr.stderr b/src/test/ui/lub-glb/old-lub-glb-hr.stderr index 4a310a5e6b296..72d9787b93aed 100644 --- a/src/test/ui/lub-glb/old-lub-glb-hr.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-hr.stderr @@ -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, diff --git a/src/test/ui/lub-glb/old-lub-glb-object.rs b/src/test/ui/lub-glb/old-lub-glb-object.rs index 7cf89b68be197..63dcfa3fc1e91 100644 --- a/src/test/ui/lub-glb/old-lub-glb-object.rs +++ b/src/test/ui/lub-glb/old-lub-glb-object.rs @@ -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, }; diff --git a/src/test/ui/lub-glb/old-lub-glb-object.stderr b/src/test/ui/lub-glb/old-lub-glb-object.stderr index a1077f40bf561..852f74b4e7542 100644 --- a/src/test/ui/lub-glb/old-lub-glb-object.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-object.stderr @@ -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, diff --git a/src/test/ui/macro_backtrace/main.rs b/src/test/ui/macro_backtrace/main.rs index 488aeddbf549b..ec9218e3ec001 100644 --- a/src/test/ui/macro_backtrace/main.rs +++ b/src/test/ui/macro_backtrace/main.rs @@ -16,7 +16,8 @@ // a local macro macro_rules! pong { - () => { syntax error }; + () => { syntax error }; //~ ERROR expected one of + //~^ ERROR expected one of } fn main() { diff --git a/src/test/ui/macro_backtrace/main.stderr b/src/test/ui/macro_backtrace/main.stderr index 37f3d45021572..e8434a79f4490 100644 --- a/src/test/ui/macro_backtrace/main.stderr +++ b/src/test/ui/macro_backtrace/main.stderr @@ -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 ) +$DIR/main.rs:25:5: 25:13 note: in this expansion of ping! (defined in ) :1:11: 1:24 note: in this expansion of pong! (defined in $DIR/main.rs) error: aborting due to 2 previous errors diff --git a/src/test/ui/macros/bad_hello.rs b/src/test/ui/macros/bad_hello.rs index a18771deacee7..174dcc9b6cd3f 100644 --- a/src/test/ui/macros/bad_hello.rs +++ b/src/test/ui/macros/bad_hello.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - println!(3 + 4); + println!(3 + 4); //~ ERROR expected a literal } diff --git a/src/test/ui/macros/bad_hello.stderr b/src/test/ui/macros/bad_hello.stderr index bffb33f468fc8..825aa64e40f52 100644 --- a/src/test/ui/macros/bad_hello.stderr +++ b/src/test/ui/macros/bad_hello.stderr @@ -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 diff --git a/src/test/ui/macros/format-foreign.rs b/src/test/ui/macros/format-foreign.rs index cca45ca9ecdd9..91ca8f5ff7602 100644 --- a/src/test/ui/macros/format-foreign.rs +++ b/src/test/ui/macros/format-foreign.rs @@ -10,11 +10,11 @@ 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 } diff --git a/src/test/ui/macros/format-foreign.stderr b/src/test/ui/macros/format-foreign.stderr index cb27bb2281d26..95f348b8b8b00 100644 --- a/src/test/ui/macros/format-foreign.stderr +++ b/src/test/ui/macros/format-foreign.stderr @@ -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}` diff --git a/src/test/ui/macros/format-unused-lables.rs b/src/test/ui/macros/format-unused-lables.rs index f1e349ea9f431..7a32d932ba386 100644 --- a/src/test/ui/macros/format-unused-lables.rs +++ b/src/test/ui/macros/format-unused-lables.rs @@ -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!", diff --git a/src/test/ui/macros/format-unused-lables.stderr b/src/test/ui/macros/format-unused-lables.stderr index 0205e9a9bfca3..01d3577a7c92d 100644 --- a/src/test/ui/macros/format-unused-lables.stderr +++ b/src/test/ui/macros/format-unused-lables.stderr @@ -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 diff --git a/src/test/ui/macros/macro-backtrace-invalid-internals.rs b/src/test/ui/macros/macro-backtrace-invalid-internals.rs index 546e06b6c79f3..037f0d839e2b6 100644 --- a/src/test/ui/macros/macro-backtrace-invalid-internals.rs +++ b/src/test/ui/macros/macro-backtrace-invalid-internals.rs @@ -12,37 +12,37 @@ 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 } } diff --git a/src/test/ui/macros/macro-backtrace-invalid-internals.stderr b/src/test/ui/macros/macro-backtrace-invalid-internals.stderr index c80c0fce35806..42144f63c3710 100644 --- a/src/test/ui/macros/macro-backtrace-invalid-internals.stderr +++ b/src/test/ui/macros/macro-backtrace-invalid-internals.stderr @@ -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!(); diff --git a/src/test/ui/macros/macro-backtrace-nested.rs b/src/test/ui/macros/macro-backtrace-nested.rs index d8bf6222c1c2c..d261633c60c86 100644 --- a/src/test/ui/macros/macro-backtrace-nested.rs +++ b/src/test/ui/macros/macro-backtrace-nested.rs @@ -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 { diff --git a/src/test/ui/macros/macro-backtrace-nested.stderr b/src/test/ui/macros/macro-backtrace-nested.stderr index 8b69d112d4d42..ee4a38312e289 100644 --- a/src/test/ui/macros/macro-backtrace-nested.stderr +++ b/src/test/ui/macros/macro-backtrace-nested.stderr @@ -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 diff --git a/src/test/ui/macros/macro-backtrace-println.rs b/src/test/ui/macros/macro-backtrace-println.rs index baf276919a5e8..6f035bc9d2355 100644 --- a/src/test/ui/macros/macro-backtrace-println.rs +++ b/src/test/ui/macros/macro-backtrace-println.rs @@ -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() { diff --git a/src/test/ui/macros/macro-backtrace-println.stderr b/src/test/ui/macros/macro-backtrace-println.stderr index 3e782294484e7..c587654d880a0 100644 --- a/src/test/ui/macros/macro-backtrace-println.stderr +++ b/src/test/ui/macros/macro-backtrace-println.stderr @@ -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!("{}"); diff --git a/src/test/ui/macros/macro-name-typo.rs b/src/test/ui/macros/macro-name-typo.rs index ec8d27f9138f7..7fadbf2a90bba 100644 --- a/src/test/ui/macros/macro-name-typo.rs +++ b/src/test/ui/macros/macro-name-typo.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - printlx!("oh noes!"); + printlx!("oh noes!"); //~ ERROR cannot find } diff --git a/src/test/ui/macros/macro-name-typo.stderr b/src/test/ui/macros/macro-name-typo.stderr index 7c83250fe8ada..84851749c7074 100644 --- a/src/test/ui/macros/macro-name-typo.stderr +++ b/src/test/ui/macros/macro-name-typo.stderr @@ -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 diff --git a/src/test/ui/macros/macro_path_as_generic_bound.rs b/src/test/ui/macros/macro_path_as_generic_bound.rs index 781ea30ed8bc3..85cf597489da9 100644 --- a/src/test/ui/macros/macro_path_as_generic_bound.rs +++ b/src/test/ui/macros/macro_path_as_generic_bound.rs @@ -14,6 +14,6 @@ macro_rules! foo(($t:path) => { impl Foo for T {} }); -foo!(m::m2::A); +foo!(m::m2::A); //~ ERROR failed to resolve fn main() {} diff --git a/src/test/ui/macros/macro_path_as_generic_bound.stderr b/src/test/ui/macros/macro_path_as_generic_bound.stderr index 5c3bb66d83a87..d59bcaa316e5d 100644 --- a/src/test/ui/macros/macro_path_as_generic_bound.stderr +++ b/src/test/ui/macros/macro_path_as_generic_bound.stderr @@ -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 diff --git a/src/test/ui/macros/macro_undefined.rs b/src/test/ui/macros/macro_undefined.rs index db93ba5e2c41d..c0acbc979ad1f 100644 --- a/src/test/ui/macros/macro_undefined.rs +++ b/src/test/ui/macros/macro_undefined.rs @@ -18,6 +18,6 @@ mod m { } fn main() { - k!(); - kl!(); + k!(); //~ ERROR cannot find + kl!(); //~ ERROR cannot find } diff --git a/src/test/ui/macros/macro_undefined.stderr b/src/test/ui/macros/macro_undefined.stderr index 5c33ae99734e8..6cfb05e786703 100644 --- a/src/test/ui/macros/macro_undefined.stderr +++ b/src/test/ui/macros/macro_undefined.stderr @@ -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 diff --git a/src/test/ui/macros/trace_faulty_macros.rs b/src/test/ui/macros/trace_faulty_macros.rs index eb7292b0a652b..ced1a7f68fb53 100644 --- a/src/test/ui/macros/trace_faulty_macros.rs +++ b/src/test/ui/macros/trace_faulty_macros.rs @@ -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 }; } diff --git a/src/test/ui/macros/trace_faulty_macros.stderr b/src/test/ui/macros/trace_faulty_macros.stderr index f4aeb8332f0b0..b0e4a56a3d1d6 100644 --- a/src/test/ui/macros/trace_faulty_macros.stderr +++ b/src/test/ui/macros/trace_faulty_macros.stderr @@ -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!(); diff --git a/src/test/ui/method-call-err-msg.rs b/src/test/ui/method-call-err-msg.rs index 14fa74d1f32e5..37806e43a9d1c 100644 --- a/src/test/ui/method-call-err-msg.rs +++ b/src/test/ui/method-call-err-msg.rs @@ -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 diff --git a/src/test/ui/method-call-err-msg.stderr b/src/test/ui/method-call-err-msg.stderr index 1d4558cad6717..472879261ef01 100644 --- a/src/test/ui/method-call-err-msg.stderr +++ b/src/test/ui/method-call-err-msg.stderr @@ -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 diff --git a/src/test/ui/mismatched_types/E0053.rs b/src/test/ui/mismatched_types/E0053.rs index 933462e553e3b..f82f3fb0fa4f7 100644 --- a/src/test/ui/mismatched_types/E0053.rs +++ b/src/test/ui/mismatched_types/E0053.rs @@ -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() { diff --git a/src/test/ui/mismatched_types/E0053.stderr b/src/test/ui/mismatched_types/E0053.stderr index d9871b8970c5c..b80363e3d3e1a 100644 --- a/src/test/ui/mismatched_types/E0053.stderr +++ b/src/test/ui/mismatched_types/E0053.stderr @@ -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)` diff --git a/src/test/ui/mismatched_types/E0409.rs b/src/test/ui/mismatched_types/E0409.rs index e89cc9ea5cbf2..17bbc3f24336f 100644 --- a/src/test/ui/mismatched_types/E0409.rs +++ b/src/test/ui/mismatched_types/E0409.rs @@ -18,7 +18,6 @@ fn main() { //~| ERROR E0308 //~| NOTE expected &{integer}, found integral variable //~| NOTE expected type `&{integer}` - //~| NOTE found type `{integer}` _ => () } } diff --git a/src/test/ui/mismatched_types/E0631.rs b/src/test/ui/mismatched_types/E0631.rs index e28f15ab0b62e..7e5490b37c43e 100644 --- a/src/test/ui/mismatched_types/E0631.rs +++ b/src/test/ui/mismatched_types/E0631.rs @@ -14,8 +14,8 @@ fn foo(_: F) {} fn bar>(_: 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 } diff --git a/src/test/ui/mismatched_types/E0631.stderr b/src/test/ui/mismatched_types/E0631.stderr index 235e7a100633d..33a68a29ddca3 100644 --- a/src/test/ui/mismatched_types/E0631.stderr +++ b/src/test/ui/mismatched_types/E0631.stderr @@ -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) -> _` diff --git a/src/test/ui/mismatched_types/abridged.rs b/src/test/ui/mismatched_types/abridged.rs index 03f889224bedc..f496df58f734e 100644 --- a/src/test/ui/mismatched_types/abridged.rs +++ b/src/test/ui/mismatched_types/abridged.rs @@ -23,19 +23,19 @@ struct X { } 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 { bar: 1 } + Foo { bar: 1 } //~ ERROR mismatched types } fn c() -> Result { - Foo { bar: 1 } + Foo { bar: 1 } //~ ERROR mismatched types } fn d() -> X, String> { @@ -46,7 +46,7 @@ fn d() -> X, String> { }, y: 3, }; - x + x //~ ERROR mismatched types } fn e() -> X, String> { @@ -57,7 +57,7 @@ fn e() -> X, String> { }, y: "".to_string(), }; - x + x //~ ERROR mismatched types } fn main() {} diff --git a/src/test/ui/mismatched_types/abridged.stderr b/src/test/ui/mismatched_types/abridged.stderr index 8c63d7d6f91c5..2e1e5afad32c1 100644 --- a/src/test/ui/mismatched_types/abridged.stderr +++ b/src/test/ui/mismatched_types/abridged.stderr @@ -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 { | ----------- expected `std::option::Option` 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` @@ -36,7 +36,7 @@ error[E0308]: mismatched types | 37 | fn c() -> Result { | ---------------- expected `std::result::Result` 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` @@ -48,7 +48,7 @@ error[E0308]: mismatched types 41 | fn d() -> X, String> { | ---------------------------- expected `X, 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, std::string::String>` @@ -60,7 +60,7 @@ error[E0308]: mismatched types 52 | fn e() -> X, String> { | ---------------------------- expected `X, 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, _>` diff --git a/src/test/ui/mismatched_types/binops.rs b/src/test/ui/mismatched_types/binops.rs index 98449e596641e..e45616cd67a81 100644 --- a/src/test/ui/mismatched_types/binops.rs +++ b/src/test/ui/mismatched_types/binops.rs @@ -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 } diff --git a/src/test/ui/mismatched_types/binops.stderr b/src/test/ui/mismatched_types/binops.stderr index 6d1a39e0d93c0..8541ad52e0177 100644 --- a/src/test/ui/mismatched_types/binops.stderr +++ b/src/test/ui/mismatched_types/binops.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `{integer}: std::ops::Add>` 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>` is not implemented for `{integer}` @@ -9,7 +9,7 @@ error[E0277]: the trait bound `{integer}: std::ops::Add>` 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>` is not implemented for `usize` @@ -17,7 +17,7 @@ error[E0277]: the trait bound `usize: std::ops::Sub` 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` 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` is not implemented for `{integer}` @@ -41,7 +41,7 @@ error[E0277]: the trait bound `{integer}: std::cmp::PartialOrd>` 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>` is not implemented for `{integer}` diff --git a/src/test/ui/mismatched_types/cast-rfc0401.rs b/src/test/ui/mismatched_types/cast-rfc0401.rs index f72be0d7054db..15388b3a7647f 100644 --- a/src/test/ui/mismatched_types/cast-rfc0401.rs +++ b/src/test/ui/mismatched_types/cast-rfc0401.rs @@ -10,12 +10,12 @@ fn illegal_cast(u: *const U) -> *const V { - u as *const V + u as *const V //~ ERROR is invalid } fn illegal_cast_2(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![0.0].iter().map(|s| s as f32).collect::>(); //~ ERROR is invalid } diff --git a/src/test/ui/mismatched_types/cast-rfc0401.stderr b/src/test/ui/mismatched_types/cast-rfc0401.stderr index fb363c388b6e6..fa4f590362123 100644 --- a/src/test/ui/mismatched_types/cast-rfc0401.stderr +++ b/src/test/ui/mismatched_types/cast-rfc0401.stderr @@ -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::>(); +81 | vec![0.0].iter().map(|s| s as f32).collect::>(); //~ 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::>(); +81 | vec![0.0].iter().map(|s| s as f32).collect::>(); //~ ERROR is invalid | ^ error: aborting due to 34 previous errors diff --git a/src/test/ui/mismatched_types/closure-arg-count.rs b/src/test/ui/mismatched_types/closure-arg-count.rs index 5d2d1d2b04c50..dcdf3070d68a1 100644 --- a/src/test/ui/mismatched_types/closure-arg-count.rs +++ b/src/test/ui/mismatched_types/closure-arg-count.rs @@ -13,11 +13,18 @@ fn f>(_: 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 } diff --git a/src/test/ui/mismatched_types/closure-arg-count.stderr b/src/test/ui/mismatched_types/closure-arg-count.stderr index 9de5e8fea0194..2d792373cd7e7 100644 --- a/src/test/ui/mismatched_types/closure-arg-count.stderr +++ b/src/test/ui/mismatched_types/closure-arg-count.stderr @@ -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 diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs b/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs index aa9dba4c3f417..566998c374e9e 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs @@ -10,12 +10,13 @@ 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 _test<'a>(f: fn(*mut &'a u32)) { - baz(f); + baz(f); //~ ERROR type mismatch + //~^ ERROR type mismatch } diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr index 866a024ab08b8..77d3a33276737 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr @@ -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> >::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` diff --git a/src/test/ui/mismatched_types/closure-mismatch.rs b/src/test/ui/mismatched_types/closure-mismatch.rs index 91298cb2bbd52..5a74e8f933de0 100644 --- a/src/test/ui/mismatched_types/closure-mismatch.rs +++ b/src/test/ui/mismatched_types/closure-mismatch.rs @@ -15,5 +15,6 @@ impl Foo for T {} fn baz(_: T) {} fn main() { - baz(|_| ()); + baz(|_| ()); //~ ERROR type mismatch + //~^ ERROR type mismatch } diff --git a/src/test/ui/mismatched_types/closure-mismatch.stderr b/src/test/ui/mismatched_types/closure-mismatch.stderr index a54fd118cc5ea..99767ba1afaef 100644 --- a/src/test/ui/mismatched_types/closure-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-mismatch.stderr @@ -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 ()) -> _` diff --git a/src/test/ui/mismatched_types/const-fn-in-trait.rs b/src/test/ui/mismatched_types/const-fn-in-trait.rs index 5e44030eab71a..e0d5c19f12558 100644 --- a/src/test/ui/mismatched_types/const-fn-in-trait.rs +++ b/src/test/ui/mismatched_types/const-fn-in-trait.rs @@ -14,11 +14,11 @@ 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() {} } diff --git a/src/test/ui/mismatched_types/const-fn-in-trait.stderr b/src/test/ui/mismatched_types/const-fn-in-trait.stderr index f7b7635e41aec..4911db6b2eb43 100644 --- a/src/test/ui/mismatched_types/const-fn-in-trait.stderr +++ b/src/test/ui/mismatched_types/const-fn-in-trait.stderr @@ -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 diff --git a/src/test/ui/mismatched_types/fn-variance-1.rs b/src/test/ui/mismatched_types/fn-variance-1.rs index 4bea8177b7c5e..e9e34abc09203 100644 --- a/src/test/ui/mismatched_types/fn-variance-1.rs +++ b/src/test/ui/mismatched_types/fn-variance-1.rs @@ -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 } diff --git a/src/test/ui/mismatched_types/fn-variance-1.stderr b/src/test/ui/mismatched_types/fn-variance-1.stderr index 09a90ef3d6be6..e593298633af5 100644 --- a/src/test/ui/mismatched_types/fn-variance-1.stderr +++ b/src/test/ui/mismatched_types/fn-variance-1.stderr @@ -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}) -> _` diff --git a/src/test/ui/mismatched_types/issue-19109.rs b/src/test/ui/mismatched_types/issue-19109.rs index 580684e2e140b..59127c10cd1e6 100644 --- a/src/test/ui/mismatched_types/issue-19109.rs +++ b/src/test/ui/mismatched_types/issue-19109.rs @@ -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 } diff --git a/src/test/ui/mismatched_types/issue-26480.rs b/src/test/ui/mismatched_types/issue-26480.rs index f842627e76fee..33c5e74fafa1f 100644 --- a/src/test/ui/mismatched_types/issue-26480.rs +++ b/src/test/ui/mismatched_types/issue-26480.rs @@ -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() { diff --git a/src/test/ui/mismatched_types/issue-26480.stderr b/src/test/ui/mismatched_types/issue-26480.stderr index fae831ffb868f..5d25cb2f93c15 100644 --- a/src/test/ui/mismatched_types/issue-26480.stderr +++ b/src/test/ui/mismatched_types/issue-26480.stderr @@ -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); diff --git a/src/test/ui/mismatched_types/issue-35030.rs b/src/test/ui/mismatched_types/issue-35030.rs index 006074ead13bd..503b2e08c39bb 100644 --- a/src/test/ui/mismatched_types/issue-35030.rs +++ b/src/test/ui/mismatched_types/issue-35030.rs @@ -16,7 +16,7 @@ trait Parser { impl Parser for bool { fn parse(text: &str) -> Option { - Some(true) + Some(true) //~ ERROR mismatched types } } diff --git a/src/test/ui/mismatched_types/issue-35030.stderr b/src/test/ui/mismatched_types/issue-35030.stderr index 46d690c5f037b..3ec5d1b7b40c1 100644 --- a/src/test/ui/mismatched_types/issue-35030.stderr +++ b/src/test/ui/mismatched_types/issue-35030.stderr @@ -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) diff --git a/src/test/ui/mismatched_types/issue-36053-2.rs b/src/test/ui/mismatched_types/issue-36053-2.rs index 7e489621e2102..76885651c5b53 100644 --- a/src/test/ui/mismatched_types/issue-36053-2.rs +++ b/src/test/ui/mismatched_types/issue-36053-2.rs @@ -16,13 +16,8 @@ use std::iter::once; 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 } diff --git a/src/test/ui/mismatched_types/issue-38371.rs b/src/test/ui/mismatched_types/issue-38371.rs index 6b49079c47210..b9b6b05996b66 100644 --- a/src/test/ui/mismatched_types/issue-38371.rs +++ b/src/test/ui/mismatched_types/issue-38371.rs @@ -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() {} diff --git a/src/test/ui/mismatched_types/issue-38371.stderr b/src/test/ui/mismatched_types/issue-38371.stderr index c80f075021ec8..d34f05e054a67 100644 --- a/src/test/ui/mismatched_types/issue-38371.stderr +++ b/src/test/ui/mismatched_types/issue-38371.stderr @@ -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 diff --git a/src/test/ui/mismatched_types/main.rs b/src/test/ui/mismatched_types/main.rs index f7f1c78c3ba0d..7cf1de7cfee3f 100644 --- a/src/test/ui/mismatched_types/main.rs +++ b/src/test/ui/mismatched_types/main.rs @@ -9,7 +9,7 @@ // except according to those terms. fn main() { - let x: u32 = ( + let x: u32 = ( //~ ERROR mismatched types ); } diff --git a/src/test/ui/mismatched_types/main.stderr b/src/test/ui/mismatched_types/main.stderr index c8941fbf95073..41e4c51239804 100644 --- a/src/test/ui/mismatched_types/main.stderr +++ b/src/test/ui/mismatched_types/main.stderr @@ -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 () diff --git a/src/test/ui/mismatched_types/overloaded-calls-bad.rs b/src/test/ui/mismatched_types/overloaded-calls-bad.rs index 3295e2bebd231..da1265dfeff7e 100644 --- a/src/test/ui/mismatched_types/overloaded-calls-bad.rs +++ b/src/test/ui/mismatched_types/overloaded-calls-bad.rs @@ -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 diff --git a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr index cd05684f15d55..feec86342e5cd 100644 --- a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr +++ b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr @@ -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 diff --git a/src/test/ui/mismatched_types/trait-bounds-cant-coerce.rs b/src/test/ui/mismatched_types/trait-bounds-cant-coerce.rs index 9f832c7b6e500..115be1bf4de55 100644 --- a/src/test/ui/mismatched_types/trait-bounds-cant-coerce.rs +++ b/src/test/ui/mismatched_types/trait-bounds-cant-coerce.rs @@ -22,8 +22,7 @@ fn c(x: Box) { fn d(x: Box) { a(x); //~ ERROR mismatched types [E0308] - //~| NOTE expected type `Box` - //~| NOTE found type `Box` + //~| NOTE expected type `std::boxed::Box` //~| NOTE expected trait `Foo + std::marker::Send`, found trait `Foo` } diff --git a/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.rs b/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.rs index 099c8699e493b..420b59a4df1af 100644 --- a/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.rs +++ b/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.rs @@ -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() { diff --git a/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr b/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr index 349432f64bbc2..f3cf1d5661533 100644 --- a/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr +++ b/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr @@ -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)` diff --git a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs index 693a1585320ee..814f2c4d187cd 100644 --- a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs +++ b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs @@ -20,15 +20,10 @@ fn call_itisize>(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); } diff --git a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr index 5988364928013..1d25632c5e2c2 100644 --- a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr +++ b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr @@ -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` diff --git a/src/test/ui/missing-items/issue-40221.rs b/src/test/ui/missing-items/issue-40221.rs index 9cf1c7d6de8a4..526fc3a8658a2 100644 --- a/src/test/ui/missing-items/issue-40221.rs +++ b/src/test/ui/missing-items/issue-40221.rs @@ -18,7 +18,7 @@ enum PC { } fn test(proto: P) { - match proto { + match proto { //~ ERROR non-exhaustive patterns P::C(PC::Q) => (), } } diff --git a/src/test/ui/missing-items/issue-40221.stderr b/src/test/ui/missing-items/issue-40221.stderr index fc90c8a2b20be..883c4329f4db6 100644 --- a/src/test/ui/missing-items/issue-40221.stderr +++ b/src/test/ui/missing-items/issue-40221.stderr @@ -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 diff --git a/src/test/ui/missing-items/m2.rs b/src/test/ui/missing-items/m2.rs index ffd7ff7f4323d..9f1954526916f 100644 --- a/src/test/ui/missing-items/m2.rs +++ b/src/test/ui/missing-items/m2.rs @@ -16,5 +16,5 @@ extern crate m1; struct X { } -impl m1::X for X { +impl m1::X for X { //~ ERROR not all trait items implemented } diff --git a/src/test/ui/missing-items/m2.stderr b/src/test/ui/missing-items/m2.stderr index ce061bd167a88..47164a5304abb 100644 --- a/src/test/ui/missing-items/m2.stderr +++ b/src/test/ui/missing-items/m2.stderr @@ -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 | diff --git a/src/test/ui/missing-items/missing-type-parameter.rs b/src/test/ui/missing-items/missing-type-parameter.rs index 79368587062e8..f2d5359fb167b 100644 --- a/src/test/ui/missing-items/missing-type-parameter.rs +++ b/src/test/ui/missing-items/missing-type-parameter.rs @@ -11,5 +11,5 @@ fn foo() { } fn main() { - foo(); + foo(); //~ ERROR type annotations needed } diff --git a/src/test/ui/missing-items/missing-type-parameter.stderr b/src/test/ui/missing-items/missing-type-parameter.stderr index a16ae5538bf92..1cb9e5f56d351 100644 --- a/src/test/ui/missing-items/missing-type-parameter.stderr +++ b/src/test/ui/missing-items/missing-type-parameter.stderr @@ -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 diff --git a/src/test/ui/mut-ref.rs b/src/test/ui/mut-ref.rs index f888369968852..715c4adf2e692 100644 --- a/src/test/ui/mut-ref.rs +++ b/src/test/ui/mut-ref.rs @@ -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; } diff --git a/src/test/ui/mut-ref.stderr b/src/test/ui/mut-ref.stderr index ce6a42f1e5ef1..aaab243e22f72 100644 --- a/src/test/ui/mut-ref.stderr +++ b/src/test/ui/mut-ref.stderr @@ -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 diff --git a/src/test/ui/nll/get_default.rs b/src/test/ui/nll/get_default.rs index 5605206221a11..e65159390db4f 100644 --- a/src/test/ui/nll/get_default.rs +++ b/src/test/ui/nll/get_default.rs @@ -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) } } } diff --git a/src/test/ui/nll/get_default.stderr b/src/test/ui/nll/get_default.stderr index 8e1e9faef2f00..fff2684af1399 100644 --- a/src/test/ui/nll/get_default.stderr +++ b/src/test/ui/nll/get_default.stderr @@ -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 diff --git a/src/test/ui/nll/named-region-basic.rs b/src/test/ui/nll/named-region-basic.rs index 539c2017ea6c0..001ce41c27793 100644 --- a/src/test/ui/nll/named-region-basic.rs +++ b/src/test/ui/nll/named-region-basic.rs @@ -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() { } diff --git a/src/test/ui/nll/named-region-basic.stderr b/src/test/ui/nll/named-region-basic.stderr index 42b2aea01f0df..9c1de6c366cc9 100644 --- a/src/test/ui/nll/named-region-basic.stderr +++ b/src/test/ui/nll/named-region-basic.stderr @@ -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 diff --git a/src/test/ui/on-unimplemented/bad-annotation.rs b/src/test/ui/on-unimplemented/bad-annotation.rs index 54d3b3e087653..e7483dbd3b546 100644 --- a/src/test/ui/on-unimplemented/bad-annotation.rs +++ b/src/test/ui/on-unimplemented/bad-annotation.rs @@ -23,7 +23,7 @@ trait MyFromIterator { fn my_from_iter>(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 {} #[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() { diff --git a/src/test/ui/on-unimplemented/bad-annotation.stderr b/src/test/ui/on-unimplemented/bad-annotation.stderr index 73834f4422d38..7126cc76eb727 100644 --- a/src/test/ui/on-unimplemented/bad-annotation.stderr +++ b/src/test/ui/on-unimplemented/bad-annotation.stderr @@ -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"]` diff --git a/src/test/ui/pub/pub-restricted-error-fn.rs b/src/test/ui/pub/pub-restricted-error-fn.rs index 13514310371cc..58f3d379ed991 100644 --- a/src/test/ui/pub/pub-restricted-error-fn.rs +++ b/src/test/ui/pub/pub-restricted-error-fn.rs @@ -10,4 +10,4 @@ #![feature(pub_restricted)] -pub(crate) () fn foo() {} +pub(crate) () fn foo() {} //~ unmatched visibility diff --git a/src/test/ui/pub/pub-restricted-error-fn.stderr b/src/test/ui/pub/pub-restricted-error-fn.stderr index 470e833124785..9cfc3968ab125 100644 --- a/src/test/ui/pub/pub-restricted-error-fn.stderr +++ b/src/test/ui/pub/pub-restricted-error-fn.stderr @@ -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 diff --git a/src/test/ui/pub/pub-restricted-error.rs b/src/test/ui/pub/pub-restricted-error.rs index 99af031899ab6..dfc927f2cb5c4 100644 --- a/src/test/ui/pub/pub-restricted-error.rs +++ b/src/test/ui/pub/pub-restricted-error.rs @@ -13,7 +13,7 @@ struct Bar(pub(())); struct Foo { - pub(crate) () foo: usize, + pub(crate) () foo: usize, //~ ERROR expected identifier } diff --git a/src/test/ui/pub/pub-restricted-error.stderr b/src/test/ui/pub/pub-restricted-error.stderr index b8b4c80778d96..cbf206e6aed5d 100644 --- a/src/test/ui/pub/pub-restricted-error.stderr +++ b/src/test/ui/pub/pub-restricted-error.stderr @@ -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 diff --git a/src/test/ui/pub/pub-restricted-non-path.rs b/src/test/ui/pub/pub-restricted-non-path.rs index 3f74285717a7b..11428b778edfc 100644 --- a/src/test/ui/pub/pub-restricted-non-path.rs +++ b/src/test/ui/pub/pub-restricted-non-path.rs @@ -10,6 +10,6 @@ #![feature(pub_restricted)] -pub (.) fn afn() {} +pub (.) fn afn() {} //~ ERROR expected identifier fn main() {} diff --git a/src/test/ui/pub/pub-restricted-non-path.stderr b/src/test/ui/pub/pub-restricted-non-path.stderr index ebfccc4d72045..b76e87840c6de 100644 --- a/src/test/ui/pub/pub-restricted-non-path.stderr +++ b/src/test/ui/pub/pub-restricted-non-path.stderr @@ -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 diff --git a/src/test/ui/pub/pub-restricted.rs b/src/test/ui/pub/pub-restricted.rs index 934ad24c16779..07184d935b437 100644 --- a/src/test/ui/pub/pub-restricted.rs +++ b/src/test/ui/pub/pub-restricted.rs @@ -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 @@ mod y { 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 diff --git a/src/test/ui/pub/pub-restricted.stderr b/src/test/ui/pub/pub-restricted.stderr index ae283f1fb636a..0bedcddc0b4cc 100644 --- a/src/test/ui/pub/pub-restricted.stderr +++ b/src/test/ui/pub/pub-restricted.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_add.rs b/src/test/ui/reachable/expr_add.rs index 87d017adf6819..dd43c58de6df1 100644 --- a/src/test/ui/reachable/expr_add.rs +++ b/src/test/ui/reachable/expr_add.rs @@ -24,5 +24,5 @@ impl ops::Add for Foo { } fn main() { - let x = Foo + return; + let x = Foo + return; //~ ERROR unreachable } diff --git a/src/test/ui/reachable/expr_add.stderr b/src/test/ui/reachable/expr_add.stderr index 1a2cc252051bf..4ae286d2fff11 100644 --- a/src/test/ui/reachable/expr_add.stderr +++ b/src/test/ui/reachable/expr_add.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_array.rs b/src/test/ui/reachable/expr_array.rs index 00e8be0772547..31229668796e8 100644 --- a/src/test/ui/reachable/expr_array.rs +++ b/src/test/ui/reachable/expr_array.rs @@ -17,12 +17,12 @@ 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() { } diff --git a/src/test/ui/reachable/expr_array.stderr b/src/test/ui/reachable/expr_array.stderr index f8dbdb5f8bb66..0f64d15850360 100644 --- a/src/test/ui/reachable/expr_array.stderr +++ b/src/test/ui/reachable/expr_array.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_assign.rs b/src/test/ui/reachable/expr_assign.rs index 1b9357013d270..e6fb46a5bac0c 100644 --- a/src/test/ui/reachable/expr_assign.rs +++ b/src/test/ui/reachable/expr_assign.rs @@ -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() { } diff --git a/src/test/ui/reachable/expr_assign.stderr b/src/test/ui/reachable/expr_assign.stderr index 807f6a1c1d584..42c00d5a8b7d8 100644 --- a/src/test/ui/reachable/expr_assign.stderr +++ b/src/test/ui/reachable/expr_assign.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_block.rs b/src/test/ui/reachable/expr_block.rs index 093589b4dc839..57b5d3cabce61 100644 --- a/src/test/ui/reachable/expr_block.rs +++ b/src/test/ui/reachable/expr_block.rs @@ -18,7 +18,7 @@ fn a() { // Here the tail expression is considered unreachable: let x = { return; - 22 + 22 //~ ERROR unreachable }; } diff --git a/src/test/ui/reachable/expr_block.stderr b/src/test/ui/reachable/expr_block.stderr index 8a17d4e6278cc..4c361dc885579 100644 --- a/src/test/ui/reachable/expr_block.stderr +++ b/src/test/ui/reachable/expr_block.stderr @@ -1,7 +1,7 @@ error: unreachable expression --> $DIR/expr_block.rs:21:9 | -21 | 22 +21 | 22 //~ ERROR unreachable | ^^ | note: lint level defined here diff --git a/src/test/ui/reachable/expr_box.rs b/src/test/ui/reachable/expr_box.rs index 6509b608335af..ab62cbdf83747 100644 --- a/src/test/ui/reachable/expr_box.rs +++ b/src/test/ui/reachable/expr_box.rs @@ -13,6 +13,6 @@ #![deny(unreachable_code)] fn main() { - let x = box return; + let x = box return; //~ ERROR unreachable println!("hi"); } diff --git a/src/test/ui/reachable/expr_box.stderr b/src/test/ui/reachable/expr_box.stderr index 78ba231cef9fc..d8b5d9f8d7684 100644 --- a/src/test/ui/reachable/expr_box.stderr +++ b/src/test/ui/reachable/expr_box.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_call.rs b/src/test/ui/reachable/expr_call.rs index 8d9f303df7fdc..86b95aad9c253 100644 --- a/src/test/ui/reachable/expr_call.rs +++ b/src/test/ui/reachable/expr_call.rs @@ -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() { } diff --git a/src/test/ui/reachable/expr_call.stderr b/src/test/ui/reachable/expr_call.stderr index 5526827f59fc9..eaafe8dc5d593 100644 --- a/src/test/ui/reachable/expr_call.stderr +++ b/src/test/ui/reachable/expr_call.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_cast.rs b/src/test/ui/reachable/expr_cast.rs index 926ef864ebf21..76b00c00ad985 100644 --- a/src/test/ui/reachable/expr_cast.rs +++ b/src/test/ui/reachable/expr_cast.rs @@ -17,7 +17,7 @@ fn a() { // the cast is unreachable: - let x = {return} as !; + let x = {return} as !; //~ ERROR unreachable } fn main() { } diff --git a/src/test/ui/reachable/expr_cast.stderr b/src/test/ui/reachable/expr_cast.stderr index a22300dcc1398..d6fb37768c541 100644 --- a/src/test/ui/reachable/expr_cast.stderr +++ b/src/test/ui/reachable/expr_cast.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_match.rs b/src/test/ui/reachable/expr_match.rs index 23bdcc035b227..d2b96e51a9519 100644 --- a/src/test/ui/reachable/expr_match.rs +++ b/src/test/ui/reachable/expr_match.rs @@ -17,7 +17,7 @@ fn a() { // The match is considered unreachable here, because the `return` // diverges: - match {return} { } + match {return} { } //~ ERROR unreachable } fn b() { diff --git a/src/test/ui/reachable/expr_match.stderr b/src/test/ui/reachable/expr_match.stderr index dcfefe109c383..4b44b38895c31 100644 --- a/src/test/ui/reachable/expr_match.stderr +++ b/src/test/ui/reachable/expr_match.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_method.rs b/src/test/ui/reachable/expr_method.rs index f1d979d7df79d..8be71e464b202 100644 --- a/src/test/ui/reachable/expr_method.rs +++ b/src/test/ui/reachable/expr_method.rs @@ -23,12 +23,12 @@ impl Foo { 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() { } diff --git a/src/test/ui/reachable/expr_method.stderr b/src/test/ui/reachable/expr_method.stderr index 177d4352a376d..db9d5c3d22c1a 100644 --- a/src/test/ui/reachable/expr_method.stderr +++ b/src/test/ui/reachable/expr_method.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_repeat.rs b/src/test/ui/reachable/expr_repeat.rs index 6078d6d5bde46..47ee2ba62b829 100644 --- a/src/test/ui/reachable/expr_repeat.rs +++ b/src/test/ui/reachable/expr_repeat.rs @@ -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() { } diff --git a/src/test/ui/reachable/expr_repeat.stderr b/src/test/ui/reachable/expr_repeat.stderr index 19afc5dd7b5ee..54b29b616f3d7 100644 --- a/src/test/ui/reachable/expr_repeat.stderr +++ b/src/test/ui/reachable/expr_repeat.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_return.rs b/src/test/ui/reachable/expr_return.rs index c640ca0663029..fac1116dc6897 100644 --- a/src/test/ui/reachable/expr_return.rs +++ b/src/test/ui/reachable/expr_return.rs @@ -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() { } diff --git a/src/test/ui/reachable/expr_return.stderr b/src/test/ui/reachable/expr_return.stderr index 3eb70a4dd7c84..a96def6011eb8 100644 --- a/src/test/ui/reachable/expr_return.stderr +++ b/src/test/ui/reachable/expr_return.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_struct.rs b/src/test/ui/reachable/expr_struct.rs index 09e31819279f2..b5acd395be620 100644 --- a/src/test/ui/reachable/expr_struct.rs +++ b/src/test/ui/reachable/expr_struct.rs @@ -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() { } diff --git a/src/test/ui/reachable/expr_struct.stderr b/src/test/ui/reachable/expr_struct.stderr index 4b7ac6604132c..b2cb1ef19cf83 100644 --- a/src/test/ui/reachable/expr_struct.stderr +++ b/src/test/ui/reachable/expr_struct.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_tup.rs b/src/test/ui/reachable/expr_tup.rs index 7c75296de6c54..089020bf3853f 100644 --- a/src/test/ui/reachable/expr_tup.rs +++ b/src/test/ui/reachable/expr_tup.rs @@ -17,12 +17,12 @@ 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() { } diff --git a/src/test/ui/reachable/expr_tup.stderr b/src/test/ui/reachable/expr_tup.stderr index 63f477fd0c373..af43162a98447 100644 --- a/src/test/ui/reachable/expr_tup.stderr +++ b/src/test/ui/reachable/expr_tup.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_type.rs b/src/test/ui/reachable/expr_type.rs index 2fa277c382e87..29c59d5304f92 100644 --- a/src/test/ui/reachable/expr_type.rs +++ b/src/test/ui/reachable/expr_type.rs @@ -17,7 +17,7 @@ fn a() { // the cast is unreachable: - let x = {return}: !; + let x = {return}: !; //~ ERROR unreachable } fn main() { } diff --git a/src/test/ui/reachable/expr_type.stderr b/src/test/ui/reachable/expr_type.stderr index 6ed79974ccb77..d6bcb4ec80f8b 100644 --- a/src/test/ui/reachable/expr_type.stderr +++ b/src/test/ui/reachable/expr_type.stderr @@ -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 diff --git a/src/test/ui/reachable/expr_unary.rs b/src/test/ui/reachable/expr_unary.rs index 57901fbaa7c44..6cff3ff964439 100644 --- a/src/test/ui/reachable/expr_unary.rs +++ b/src/test/ui/reachable/expr_unary.rs @@ -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() { } diff --git a/src/test/ui/reachable/expr_unary.stderr b/src/test/ui/reachable/expr_unary.stderr index 9f4562fe29718..f14824728a70c 100644 --- a/src/test/ui/reachable/expr_unary.stderr +++ b/src/test/ui/reachable/expr_unary.stderr @@ -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 diff --git a/src/test/ui/resolve/enums-are-namespaced-xc.rs b/src/test/ui/resolve/enums-are-namespaced-xc.rs index 4f55f33d7f808..4059aa5527ed1 100644 --- a/src/test/ui/resolve/enums-are-namespaced-xc.rs +++ b/src/test/ui/resolve/enums-are-namespaced-xc.rs @@ -13,12 +13,9 @@ extern crate namespaced_enums; 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` } diff --git a/src/test/ui/resolve/enums-are-namespaced-xc.stderr b/src/test/ui/resolve/enums-are-namespaced-xc.stderr index 52d798a2ca5fb..5acc678df90e3 100644 --- a/src/test/ui/resolve/enums-are-namespaced-xc.stderr +++ b/src/test/ui/resolve/enums-are-namespaced-xc.stderr @@ -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 | diff --git a/src/test/ui/resolve/issue-14254.rs b/src/test/ui/resolve/issue-14254.rs index b1fc6c477207a..38444f69628d1 100644 --- a/src/test/ui/resolve/issue-14254.rs +++ b/src/test/ui/resolve/issue-14254.rs @@ -27,111 +27,92 @@ impl BarTy { 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 { 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 { 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` } } diff --git a/src/test/ui/resolve/issue-14254.stderr b/src/test/ui/resolve/issue-14254.stderr index 7aa0c2707b56f..a472fc861eb65 100644 --- a/src/test/ui/resolve/issue-14254.stderr +++ b/src/test/ui/resolve/issue-14254.stderr @@ -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 diff --git a/src/test/ui/resolve/issue-16058.rs b/src/test/ui/resolve/issue-16058.rs index 1f777e53632dd..6d9df46eed416 100644 --- a/src/test/ui/resolve/issue-16058.rs +++ b/src/test/ui/resolve/issue-16058.rs @@ -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 } diff --git a/src/test/ui/resolve/issue-17518.rs b/src/test/ui/resolve/issue-17518.rs index 3ac9b379d1892..295880c949988 100644 --- a/src/test/ui/resolve/issue-17518.rs +++ b/src/test/ui/resolve/issue-17518.rs @@ -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` } diff --git a/src/test/ui/resolve/issue-17518.stderr b/src/test/ui/resolve/issue-17518.stderr index bdc4fb0d34970..33f15267e4af4 100644 --- a/src/test/ui/resolve/issue-17518.stderr +++ b/src/test/ui/resolve/issue-17518.stderr @@ -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 | diff --git a/src/test/ui/resolve/issue-21221-1.rs b/src/test/ui/resolve/issue-21221-1.rs index b1266a5af3581..d3c18d4c80a1c 100644 --- a/src/test/ui/resolve/issue-21221-1.rs +++ b/src/test/ui/resolve/issue-21221-1.rs @@ -51,11 +51,7 @@ struct Foo; // 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() { diff --git a/src/test/ui/resolve/issue-21221-1.stderr b/src/test/ui/resolve/issue-21221-1.stderr index 6038c683e436b..88405fd841b06 100644 --- a/src/test/ui/resolve/issue-21221-1.stderr +++ b/src/test/ui/resolve/issue-21221-1.stderr @@ -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 | diff --git a/src/test/ui/resolve/issue-21221-2.rs b/src/test/ui/resolve/issue-21221-2.rs index 15e859329c407..c0ebc57efb5c2 100644 --- a/src/test/ui/resolve/issue-21221-2.rs +++ b/src/test/ui/resolve/issue-21221-2.rs @@ -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` diff --git a/src/test/ui/resolve/issue-21221-2.stderr b/src/test/ui/resolve/issue-21221-2.stderr index 0ae8052758dac..ffe57c5099d68 100644 --- a/src/test/ui/resolve/issue-21221-2.stderr +++ b/src/test/ui/resolve/issue-21221-2.stderr @@ -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 | diff --git a/src/test/ui/resolve/issue-21221-3.rs b/src/test/ui/resolve/issue-21221-3.rs index 5d62cb85914fd..046066b198639 100644 --- a/src/test/ui/resolve/issue-21221-3.rs +++ b/src/test/ui/resolve/issue-21221-3.rs @@ -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 @@ struct Foo; // `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!"); } diff --git a/src/test/ui/resolve/issue-21221-3.stderr b/src/test/ui/resolve/issue-21221-3.stderr index b26a8cdacb029..f134b86441400 100644 --- a/src/test/ui/resolve/issue-21221-3.stderr +++ b/src/test/ui/resolve/issue-21221-3.stderr @@ -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 | diff --git a/src/test/ui/resolve/issue-21221-4.rs b/src/test/ui/resolve/issue-21221-4.rs index ff6698f8717bb..da8f2c6e778e5 100644 --- a/src/test/ui/resolve/issue-21221-4.rs +++ b/src/test/ui/resolve/issue-21221-4.rs @@ -16,10 +16,10 @@ 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!"); diff --git a/src/test/ui/resolve/issue-21221-4.stderr b/src/test/ui/resolve/issue-21221-4.stderr index 0a22d8e1fe1ad..0f3830bc2581d 100644 --- a/src/test/ui/resolve/issue-21221-4.stderr +++ b/src/test/ui/resolve/issue-21221-4.stderr @@ -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 | diff --git a/src/test/ui/resolve/issue-23305.rs b/src/test/ui/resolve/issue-23305.rs index 19069f4916769..9f7b6ff5767c1 100644 --- a/src/test/ui/resolve/issue-23305.rs +++ b/src/test/ui/resolve/issue-23305.rs @@ -13,10 +13,9 @@ pub trait ToNbt { } impl ToNbt {} -//~^ 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() {} diff --git a/src/test/ui/resolve/issue-2356.rs b/src/test/ui/resolve/issue-2356.rs index 6deb598b631f5..d0490ff981dca 100644 --- a/src/test/ui/resolve/issue-2356.rs +++ b/src/test/ui/resolve/issue-2356.rs @@ -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 @@ impl Default for cat { 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 @@ impl cat { 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 @@ impl cat { 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 } } diff --git a/src/test/ui/resolve/issue-2356.stderr b/src/test/ui/resolve/issue-2356.stderr index ed0edd52587ec..e98d132b519a3 100644 --- a/src/test/ui/resolve/issue-2356.stderr +++ b/src/test/ui/resolve/issue-2356.stderr @@ -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 diff --git a/src/test/ui/resolve/issue-24968.rs b/src/test/ui/resolve/issue-24968.rs index 0d562cab6b8b1..6065646401fcb 100644 --- a/src/test/ui/resolve/issue-24968.rs +++ b/src/test/ui/resolve/issue-24968.rs @@ -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 } diff --git a/src/test/ui/resolve/issue-39226.rs b/src/test/ui/resolve/issue-39226.rs index f290a74861d18..f58f7cc3869d2 100644 --- a/src/test/ui/resolve/issue-39226.rs +++ b/src/test/ui/resolve/issue-39226.rs @@ -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` }; } diff --git a/src/test/ui/resolve/issue-5035.rs b/src/test/ui/resolve/issue-5035.rs index 6263e6f6db44f..06a753cca8585 100644 --- a/src/test/ui/resolve/issue-5035.rs +++ b/src/test/ui/resolve/issue-5035.rs @@ -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 diff --git a/src/test/ui/resolve/issue-5035.stderr b/src/test/ui/resolve/issue-5035.stderr index 3c093e068c507..c9de39759b5ff 100644 --- a/src/test/ui/resolve/issue-5035.stderr +++ b/src/test/ui/resolve/issue-5035.stderr @@ -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` diff --git a/src/test/ui/resolve/levenshtein.rs b/src/test/ui/resolve/levenshtein.rs index 53b6372d8eb40..af27629385dcd 100644 --- a/src/test/ui/resolve/levenshtein.rs +++ b/src/test/ui/resolve/levenshtein.rs @@ -13,14 +13,18 @@ const MAX_ITEM: usize = 10; 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; // 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 } diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr index 4dff2620319e4..68d46ccf6857d 100644 --- a/src/test/ui/resolve/levenshtein.stderr +++ b/src/test/ui/resolve/levenshtein.stderr @@ -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; // Misspelled type name from the prelude. +22 | type B = Opiton; // 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 diff --git a/src/test/ui/resolve/privacy-struct-ctor.rs b/src/test/ui/resolve/privacy-struct-ctor.rs index 87e7b4f42a1c0..fe3774af47ddb 100644 --- a/src/test/ui/resolve/privacy-struct-ctor.rs +++ b/src/test/ui/resolve/privacy-struct-ctor.rs @@ -25,7 +25,9 @@ mod m { 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 } diff --git a/src/test/ui/resolve/privacy-struct-ctor.stderr b/src/test/ui/resolve/privacy-struct-ctor.stderr index cb459ae474506..81c52a1b7c37d 100644 --- a/src/test/ui/resolve/privacy-struct-ctor.stderr +++ b/src/test/ui/resolve/privacy-struct-ctor.stderr @@ -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 diff --git a/src/test/ui/resolve/resolve-assoc-suggestions.rs b/src/test/ui/resolve/resolve-assoc-suggestions.rs index 53e26ddafec37..62d2dc7a8faeb 100644 --- a/src/test/ui/resolve/resolve-assoc-suggestions.rs +++ b/src/test/ui/resolve/resolve-assoc-suggestions.rs @@ -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` } } diff --git a/src/test/ui/resolve/resolve-assoc-suggestions.stderr b/src/test/ui/resolve/resolve-assoc-suggestions.stderr index 77aa545e2ad6b..4bb3947a02811 100644 --- a/src/test/ui/resolve/resolve-assoc-suggestions.stderr +++ b/src/test/ui/resolve/resolve-assoc-suggestions.stderr @@ -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 diff --git a/src/test/ui/resolve/resolve-speculative-adjustment.rs b/src/test/ui/resolve/resolve-speculative-adjustment.rs index 95289e23f9e81..120237b662df8 100644 --- a/src/test/ui/resolve/resolve-speculative-adjustment.rs +++ b/src/test/ui/resolve/resolve-speculative-adjustment.rs @@ -25,19 +25,17 @@ impl Tr for S { // 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` } } diff --git a/src/test/ui/resolve/resolve-speculative-adjustment.stderr b/src/test/ui/resolve/resolve-speculative-adjustment.stderr index 3e1b075679a50..2d74e427ea04e 100644 --- a/src/test/ui/resolve/resolve-speculative-adjustment.stderr +++ b/src/test/ui/resolve/resolve-speculative-adjustment.stderr @@ -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 diff --git a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs index 789bdfb414db4..70d072a388b90 100644 --- a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs +++ b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs @@ -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` } diff --git a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr index d1794d19f6a53..fd5de16bdd1da 100644 --- a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr +++ b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr @@ -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`? diff --git a/src/test/ui/resolve/token-error-correct-2.rs b/src/test/ui/resolve/token-error-correct-2.rs index 6fa1260d18041..121a565b2b1eb 100644 --- a/src/test/ui/resolve/token-error-correct-2.rs +++ b/src/test/ui/resolve/token-error-correct-2.rs @@ -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: `)` } diff --git a/src/test/ui/resolve/token-error-correct-3.rs b/src/test/ui/resolve/token-error-correct-3.rs index f72b7adf593a9..746eee9ecd74e 100644 --- a/src/test/ui/resolve/token-error-correct-3.rs +++ b/src/test/ui/resolve/token-error-correct-3.rs @@ -18,16 +18,19 @@ pub mod raw { pub fn ensure_dir_exists, F: FnOnce(&Path)>(path: P, callback: F) -> io::Result { - 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` + //~| expected one of } else { //~ ERROR: incorrect close delimiter: `}` //~^ ERROR: expected one of + //~| unexpected token Ok(false); } diff --git a/src/test/ui/resolve/token-error-correct-3.stderr b/src/test/ui/resolve/token-error-correct-3.stderr index c8e19db3707e1..b500a349f6cf6 100644 --- a/src/test/ui/resolve/token-error-correct-3.stderr +++ b/src/test/ui/resolve/token-error-correct-3.stderr @@ -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` diff --git a/src/test/ui/resolve/token-error-correct.rs b/src/test/ui/resolve/token-error-correct.rs index 5fd35e51336f3..0c7fe0df1c706 100644 --- a/src/test/ui/resolve/token-error-correct.rs +++ b/src/test/ui/resolve/token-error-correct.rs @@ -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: `}` diff --git a/src/test/ui/resolve/token-error-correct.stderr b/src/test/ui/resolve/token-error-correct.stderr index 6bd63f4fbbb89..cad58b30df206 100644 --- a/src/test/ui/resolve/token-error-correct.stderr +++ b/src/test/ui/resolve/token-error-correct.stderr @@ -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 diff --git a/src/test/ui/resolve/tuple-struct-alias.rs b/src/test/ui/resolve/tuple-struct-alias.rs index c9c05202fea2b..0dbca07b771d7 100644 --- a/src/test/ui/resolve/tuple-struct-alias.rs +++ b/src/test/ui/resolve/tuple-struct-alias.rs @@ -13,16 +13,16 @@ type A = S; 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 } } diff --git a/src/test/ui/resolve/tuple-struct-alias.stderr b/src/test/ui/resolve/tuple-struct-alias.stderr index e2ef8f0e568fc..aea9fc356bf2e 100644 --- a/src/test/ui/resolve/tuple-struct-alias.stderr +++ b/src/test/ui/resolve/tuple-struct-alias.stderr @@ -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`? diff --git a/src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.rs b/src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.rs index 57f6ddd2d3c6c..ee4c40f2c8d4d 100644 --- a/src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.rs +++ b/src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.rs @@ -9,8 +9,8 @@ // except according to those terms. fn f 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; diff --git a/src/test/ui/resolve/unresolved_static_type_field.rs b/src/test/ui/resolve/unresolved_static_type_field.rs index 19beabd88232e..711e46b1248b7 100644 --- a/src/test/ui/resolve/unresolved_static_type_field.rs +++ b/src/test/ui/resolve/unresolved_static_type_field.rs @@ -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 } } diff --git a/src/test/ui/resolve/use_suggestion_placement.rs b/src/test/ui/resolve/use_suggestion_placement.rs index a43b8fc99df5f..87f38df0442cf 100644 --- a/src/test/ui/resolve/use_suggestion_placement.rs +++ b/src/test/ui/resolve/use_suggestion_placement.rs @@ -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 = HashMap; + type Dict = HashMap; //~ ERROR cannot find } diff --git a/src/test/ui/resolve/use_suggestion_placement.stderr b/src/test/ui/resolve/use_suggestion_placement.stderr index 401825367dd9b..1cc2d06ab6843 100644 --- a/src/test/ui/resolve/use_suggestion_placement.stderr +++ b/src/test/ui/resolve/use_suggestion_placement.stderr @@ -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 = HashMap; +35 | type Dict = HashMap; //~ ERROR cannot find | ^^^^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope | diff --git a/src/test/ui/rfc-2005-default-binding-mode/const.rs b/src/test/ui/rfc-2005-default-binding-mode/const.rs index 31923343b6aa7..fca99f064a273 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/const.rs +++ b/src/test/ui/rfc-2005-default-binding-mode/const.rs @@ -23,7 +23,7 @@ fn main() { let f = Foo{bar:6}; match &f { - FOO => {}, + FOO => {}, //~ ERROR mismatched types _ => panic!(), } } diff --git a/src/test/ui/rfc-2005-default-binding-mode/const.stderr b/src/test/ui/rfc-2005-default-binding-mode/const.stderr index 0dfd79f356545..afcbf76c1a44f 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/const.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/const.stderr @@ -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` diff --git a/src/test/ui/rfc-2005-default-binding-mode/enum.rs b/src/test/ui/rfc-2005-default-binding-mode/enum.rs index 58902bf06b314..76ea64e248ef8 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/enum.rs +++ b/src/test/ui/rfc-2005-default-binding-mode/enum.rs @@ -18,17 +18,17 @@ use Wrapper::Wrap; 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; } } diff --git a/src/test/ui/rfc-2005-default-binding-mode/enum.stderr b/src/test/ui/rfc-2005-default-binding-mode/enum.stderr index ad08ae83a49ef..052ab5892d254 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/enum.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/enum.stderr @@ -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 diff --git a/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs b/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs index b5287b7cccc76..2e43d9722a900 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs +++ b/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.rs @@ -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 => {}, diff --git a/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.stderr b/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.stderr index 1dbd769373b9d..c1c59fe678525 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.stderr @@ -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 diff --git a/src/test/ui/rfc-2005-default-binding-mode/for.rs b/src/test/ui/rfc-2005-default-binding-mode/for.rs index 35f8fbb9b71f7..e9004c13a0e27 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/for.rs +++ b/src/test/ui/rfc-2005-default-binding-mode/for.rs @@ -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 } } diff --git a/src/test/ui/rfc-2005-default-binding-mode/issue-44912-or.rs b/src/test/ui/rfc-2005-default-binding-mode/issue-44912-or.rs index 294d6b88596bf..9fbcf5d68b6ff 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/issue-44912-or.rs +++ b/src/test/ui/rfc-2005-default-binding-mode/issue-44912-or.rs @@ -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, }; } diff --git a/src/test/ui/rfc-2005-default-binding-mode/lit.rs b/src/test/ui/rfc-2005-default-binding-mode/lit.rs index 54cee39209ba3..783287fd458bc 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/lit.rs +++ b/src/test/ui/rfc-2005-default-binding-mode/lit.rs @@ -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!(), }; } diff --git a/src/test/ui/rfc-2005-default-binding-mode/lit.stderr b/src/test/ui/rfc-2005-default-binding-mode/lit.stderr index 811d3b8074f53..f5ed7ee7181dd 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/lit.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/lit.stderr @@ -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]` diff --git a/src/test/ui/rfc-2005-default-binding-mode/no-double-error.rs b/src/test/ui/rfc-2005-default-binding-mode/no-double-error.rs index a0134c499bb01..0b2318d7621d6 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/no-double-error.rs +++ b/src/test/ui/rfc-2005-default-binding-mode/no-double-error.rs @@ -15,7 +15,7 @@ fn main() { let foo = 22; match foo { - u32::XXX => { } + u32::XXX => { } //~ ERROR no associated item named _ => { } } } diff --git a/src/test/ui/rfc-2005-default-binding-mode/no-double-error.stderr b/src/test/ui/rfc-2005-default-binding-mode/no-double-error.stderr index 4a83b606dccd9..830422875886b 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/no-double-error.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/no-double-error.stderr @@ -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 diff --git a/src/test/ui/rfc-2005-default-binding-mode/slice.rs b/src/test/ui/rfc-2005-default-binding-mode/slice.rs index fb87ed72abc3f..40aa957242cb8 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/slice.rs +++ b/src/test/ui/rfc-2005-default-binding-mode/slice.rs @@ -14,7 +14,7 @@ pub fn main() { let sl: &[u8] = b"foo"; - match sl { + match sl { //~ ERROR non-exhaustive patterns [first, remainder..] => {}, }; } diff --git a/src/test/ui/rfc-2005-default-binding-mode/slice.stderr b/src/test/ui/rfc-2005-default-binding-mode/slice.stderr index 90a2f75c07fb0..ec2225c9f9236 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/slice.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/slice.stderr @@ -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 diff --git a/src/test/ui/rfc-2005-default-binding-mode/suggestion.rs b/src/test/ui/rfc-2005-default-binding-mode/suggestion.rs index 52ff817dff488..b9b974ff3c521 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/suggestion.rs +++ b/src/test/ui/rfc-2005-default-binding-mode/suggestion.rs @@ -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); } } diff --git a/src/test/ui/rfc-2005-default-binding-mode/suggestion.stderr b/src/test/ui/rfc-2005-default-binding-mode/suggestion.stderr index 0594f865f327e..b10980d6bd605 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/suggestion.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/suggestion.stderr @@ -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 diff --git a/src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.rs b/src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.rs index 3741ba4f3ae7a..b24b2d0fb2461 100644 --- a/src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.rs +++ b/src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.rs @@ -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 } diff --git a/src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.stderr b/src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.stderr index fdd0a591bc78d..4778f2e6d1b23 100644 --- a/src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.stderr +++ b/src/test/ui/rfc_1940-must_use_on_functions/fn_must_use.stderr @@ -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 | ^^^^^^ diff --git a/src/test/ui/similar-tokens.rs b/src/test/ui/similar-tokens.rs index 986382bc8ee85..b16d584ed4246 100644 --- a/src/test/ui/similar-tokens.rs +++ b/src/test/ui/similar-tokens.rs @@ -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() {} diff --git a/src/test/ui/similar-tokens.stderr b/src/test/ui/similar-tokens.stderr index cf0ed646db708..1b9eb1d8ef547 100644 --- a/src/test/ui/similar-tokens.stderr +++ b/src/test/ui/similar-tokens.stderr @@ -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 diff --git a/src/test/ui/span/E0072.rs b/src/test/ui/span/E0072.rs index 18ade4f1ab68e..554dfc619d7b7 100644 --- a/src/test/ui/span/E0072.rs +++ b/src/test/ui/span/E0072.rs @@ -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, } diff --git a/src/test/ui/span/E0072.stderr b/src/test/ui/span/E0072.stderr index 1f6dd6b1d165f..82b8579d5a12c 100644 --- a/src/test/ui/span/E0072.stderr +++ b/src/test/ui/span/E0072.stderr @@ -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, diff --git a/src/test/ui/span/E0204.rs b/src/test/ui/span/E0204.rs index 9fb37607c7da7..0ad6b67330d1a 100644 --- a/src/test/ui/span/E0204.rs +++ b/src/test/ui/span/E0204.rs @@ -12,9 +12,9 @@ struct Foo { foo: Vec, } -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, diff --git a/src/test/ui/span/E0204.stderr b/src/test/ui/span/E0204.stderr index 4fe6afaca8ec6..0d9617c4c7324 100644 --- a/src/test/ui/span/E0204.stderr +++ b/src/test/ui/span/E0204.stderr @@ -4,13 +4,13 @@ error[E0204]: the trait `Copy` may not be implemented for this type 12 | foo: Vec, | ------------- 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 }, | ----------- 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), diff --git a/src/test/ui/span/E0493.rs b/src/test/ui/span/E0493.rs index 7915564cafb0a..de81068e2683d 100644 --- a/src/test/ui/span/E0493.rs +++ b/src/test/ui/span/E0493.rs @@ -25,6 +25,7 @@ impl Drop for Bar { } const F : Foo = (Foo { a : 0 }, Foo { a : 1 }).1; +//~^ destructors cannot be evaluated at compile-time fn main() { } diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs index 29fea052b06c2..1c45771ff8a3c 100644 --- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs +++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.rs @@ -24,6 +24,7 @@ fn call(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) where F: FnMut(Box, isize) {} let mut f = |g: Box, b: isize| {}; - //~^ NOTE moved + //~^ NOTE captured outer variable f(Box::new(|a| { //~^ NOTE borrow of `f` occurs here foo(f); diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr index 6e7d0c17f1dfe..0a1429d5509b0 100644 --- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr +++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr @@ -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) where F: FnMut() { +38 | fn test2(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, b: isize| {}; +69 | let mut f = |g: Box, 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 diff --git a/src/test/ui/span/borrowck-let-suggestion-suffixes.rs b/src/test/ui/span/borrowck-let-suggestion-suffixes.rs index 9e316b989a475..b31ba324b0cda 100644 --- a/src/test/ui/span/borrowck-let-suggestion-suffixes.rs +++ b/src/test/ui/span/borrowck-let-suggestion-suffixes.rs @@ -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]); diff --git a/src/test/ui/span/borrowck-ref-into-rvalue.rs b/src/test/ui/span/borrowck-ref-into-rvalue.rs index 726d4bcdf1d08..a059232daca38 100644 --- a/src/test/ui/span/borrowck-ref-into-rvalue.rs +++ b/src/test/ui/span/borrowck-ref-into-rvalue.rs @@ -11,10 +11,10 @@ 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); } diff --git a/src/test/ui/span/borrowck-ref-into-rvalue.stderr b/src/test/ui/span/borrowck-ref-into-rvalue.stderr index ced1f762af4a4..91f9cddd58985 100644 --- a/src/test/ui/span/borrowck-ref-into-rvalue.stderr +++ b/src/test/ui/span/borrowck-ref-into-rvalue.stderr @@ -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 | } diff --git a/src/test/ui/span/coerce-suggestions.rs b/src/test/ui/span/coerce-suggestions.rs index 32d80069f0087..a1a250b0e9ad2 100644 --- a/src/test/ui/span/coerce-suggestions.rs +++ b/src/test/ui/span/coerce-suggestions.rs @@ -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 } diff --git a/src/test/ui/span/coerce-suggestions.stderr b/src/test/ui/span/coerce-suggestions.stderr index 5bd6ef806b5a5..73169e86a1c74 100644 --- a/src/test/ui/span/coerce-suggestions.stderr +++ b/src/test/ui/span/coerce-suggestions.stderr @@ -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` diff --git a/src/test/ui/span/destructor-restrictions.rs b/src/test/ui/span/destructor-restrictions.rs index 22f615cafd71e..7c80867856d3b 100644 --- a/src/test/ui/span/destructor-restrictions.rs +++ b/src/test/ui/span/destructor-restrictions.rs @@ -15,7 +15,7 @@ use std::cell::RefCell; 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); } diff --git a/src/test/ui/span/destructor-restrictions.stderr b/src/test/ui/span/destructor-restrictions.stderr index ee885454169cb..e6d24d7c13599 100644 --- a/src/test/ui/span/destructor-restrictions.stderr +++ b/src/test/ui/span/destructor-restrictions.stderr @@ -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 diff --git a/src/test/ui/span/gated-features-attr-spans.rs b/src/test/ui/span/gated-features-attr-spans.rs index d5ccd2ea7ad3f..ace185d01694a 100644 --- a/src/test/ui/span/gated-features-attr-spans.rs +++ b/src/test/ui/span/gated-features-attr-spans.rs @@ -10,14 +10,14 @@ #![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 { if gem.poofed { Ok(gem) diff --git a/src/test/ui/span/gated-features-attr-spans.stderr b/src/test/ui/span/gated-features-attr-spans.stderr index 66b2567f728a3..d067470942e33 100644 --- a/src/test/ui/span/gated-features-attr-spans.stderr +++ b/src/test/ui/span/gated-features-attr-spans.stderr @@ -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 diff --git a/src/test/ui/span/impl-wrong-item-for-trait.rs b/src/test/ui/span/impl-wrong-item-for-trait.rs index 091df1d5dc898..d4aafabed3791 100644 --- a/src/test/ui/span/impl-wrong-item-for-trait.rs +++ b/src/test/ui/span/impl-wrong-item-for-trait.rs @@ -13,7 +13,13 @@ use std::fmt::Debug; 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 () {} diff --git a/src/test/ui/span/impl-wrong-item-for-trait.stderr b/src/test/ui/span/impl-wrong-item-for-trait.stderr index 5812cab0d050a..dfca435f2a073 100644 --- a/src/test/ui/span/impl-wrong-item-for-trait.stderr +++ b/src/test/ui/span/impl-wrong-item-for-trait.stderr @@ -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>` diff --git a/src/test/ui/span/issue-11925.rs b/src/test/ui/span/issue-11925.rs index 7bea8642cce14..fd5625f68923a 100644 --- a/src/test/ui/span/issue-11925.rs +++ b/src/test/ui/span/issue-11925.rs @@ -15,7 +15,7 @@ fn to_fn_once>(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() }; diff --git a/src/test/ui/span/issue-11925.stderr b/src/test/ui/span/issue-11925.stderr index 6b2942bc7a8a7..057ccc8d677e9 100644 --- a/src/test/ui/span/issue-11925.stderr +++ b/src/test/ui/span/issue-11925.stderr @@ -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 diff --git a/src/test/ui/span/issue-15480.rs b/src/test/ui/span/issue-15480.rs index 871e0af50bfc6..90f3e1fd00a08 100644 --- a/src/test/ui/span/issue-15480.rs +++ b/src/test/ui/span/issue-15480.rs @@ -13,7 +13,7 @@ fn id(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); diff --git a/src/test/ui/span/issue-15480.stderr b/src/test/ui/span/issue-15480.stderr index 7f4ca19241cd2..4d2e6f8374c1f 100644 --- a/src/test/ui/span/issue-15480.stderr +++ b/src/test/ui/span/issue-15480.stderr @@ -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 | } diff --git a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.rs b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.rs index a04edd99b8b6b..583c569062170 100644 --- a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.rs +++ b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.rs @@ -24,8 +24,8 @@ fn foo(x: RefCell) -> String { fn foo2(x: RefCell) -> 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 } diff --git a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr index 02c033153725c..090cf1d924bdb 100644 --- a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr +++ b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr @@ -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 diff --git a/src/test/ui/span/issue-24690.rs b/src/test/ui/span/issue-24690.rs index f59d2845108fb..041ca6c426c1f 100644 --- a/src/test/ui/span/issue-24690.rs +++ b/src/test/ui/span/issue-24690.rs @@ -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); } diff --git a/src/test/ui/span/issue-24690.stderr b/src/test/ui/span/issue-24690.stderr index 718720ebf8383..7e19c7492ce0b 100644 --- a/src/test/ui/span/issue-24690.stderr +++ b/src/test/ui/span/issue-24690.stderr @@ -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 | | } | |_^ diff --git a/src/test/ui/span/issue-27522.rs b/src/test/ui/span/issue-27522.rs index 81fcb007eb491..1e3eba4bf3631 100644 --- a/src/test/ui/span/issue-27522.rs +++ b/src/test/ui/span/issue-27522.rs @@ -13,7 +13,7 @@ struct SomeType {} trait Foo { - fn handler(self: &SomeType); + fn handler(self: &SomeType); //~ ERROR invalid `self` type } fn main() {} diff --git a/src/test/ui/span/issue-27522.stderr b/src/test/ui/span/issue-27522.stderr index e12fb57f15dc9..dc02ad73ee2bc 100644 --- a/src/test/ui/span/issue-27522.stderr +++ b/src/test/ui/span/issue-27522.stderr @@ -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` diff --git a/src/test/ui/span/issue-34264.rs b/src/test/ui/span/issue-34264.rs index 00482f50618db..8baa381fb2d73 100644 --- a/src/test/ui/span/issue-34264.rs +++ b/src/test/ui/span/issue-34264.rs @@ -8,13 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo(Option, String) {} -fn bar(x, y: usize) {} +fn foo(Option, 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 } diff --git a/src/test/ui/span/issue-34264.stderr b/src/test/ui/span/issue-34264.stderr index e25caacac8feb..6ab92cab83dc2 100644 --- a/src/test/ui/span/issue-34264.stderr +++ b/src/test/ui/span/issue-34264.stderr @@ -1,34 +1,34 @@ error: expected one of `:` or `@`, found `<` --> $DIR/issue-34264.rs:11:14 | -11 | fn foo(Option, String) {} +11 | fn foo(Option, 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, String) {} +11 | fn foo(Option, 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, String) {} +11 | fn foo(Option, 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 diff --git a/src/test/ui/span/issue-35987.rs b/src/test/ui/span/issue-35987.rs index 8ff5f3b83986c..fa0410686c26c 100644 --- a/src/test/ui/span/issue-35987.rs +++ b/src/test/ui/span/issue-35987.rs @@ -13,6 +13,7 @@ struct Foo(T); use std::ops::Add; impl Add for Foo { +//~^ ERROR expected trait, found type parameter type Output = usize; fn add(self, rhs: Self) -> Self::Output { diff --git a/src/test/ui/span/issue-36530.rs b/src/test/ui/span/issue-36530.rs index 893c2168c2e16..c6cdb8b6db7cf 100644 --- a/src/test/ui/span/issue-36530.rs +++ b/src/test/ui/span/issue-36530.rs @@ -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 } diff --git a/src/test/ui/span/issue-36530.stderr b/src/test/ui/span/issue-36530.stderr index dc6190c2e76b0..50908b2ca3970 100644 --- a/src/test/ui/span/issue-36530.stderr +++ b/src/test/ui/span/issue-36530.stderr @@ -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 diff --git a/src/test/ui/span/issue-37767.rs b/src/test/ui/span/issue-37767.rs index 49ad40259d91f..2b0250d332df7 100644 --- a/src/test/ui/span/issue-37767.rs +++ b/src/test/ui/span/issue-37767.rs @@ -17,7 +17,7 @@ trait B : A { } fn bar(a: &T) { - a.foo() + a.foo() //~ ERROR multiple applicable items } trait C { @@ -29,7 +29,7 @@ trait D : C { } fn quz(a: &T) { - a.foo() + a.foo() //~ ERROR multiple applicable items } trait E : Sized { @@ -41,7 +41,7 @@ trait F : E { } fn foo(a: T) { - a.foo() + a.foo() //~ ERROR multiple applicable items } fn pass(a: &T) { diff --git a/src/test/ui/span/issue-37767.stderr b/src/test/ui/span/issue-37767.stderr index 7cf74eaab8db1..8babcc74ed5f3 100644 --- a/src/test/ui/span/issue-37767.stderr +++ b/src/test/ui/span/issue-37767.stderr @@ -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` diff --git a/src/test/ui/span/issue-39018.rs b/src/test/ui/span/issue-39018.rs index 1cbc5ff1d2ab5..4c9d10ba46bc8 100644 --- a/src/test/ui/span/issue-39018.rs +++ b/src/test/ui/span/issue-39018.rs @@ -10,11 +10,13 @@ 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 { diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr index e865b5192a407..db662a1df5972 100644 --- a/src/test/ui/span/issue-39018.stderr +++ b/src/test/ui/span/issue-39018.stderr @@ -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` diff --git a/src/test/ui/span/issue-39698.rs b/src/test/ui/span/issue-39698.rs index 17b3f1c5a885e..33071c468b872 100644 --- a/src/test/ui/span/issue-39698.rs +++ b/src/test/ui/span/issue-39698.rs @@ -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 } } diff --git a/src/test/ui/span/issue-40157.rs b/src/test/ui/span/issue-40157.rs index 8f3a7ae341736..9e33ecde91ced 100644 --- a/src/test/ui/span/issue-40157.rs +++ b/src/test/ui/span/issue-40157.rs @@ -10,4 +10,5 @@ fn main () { {println!("{:?}", match { let foo = vec![1, 2]; foo.get(1) } { x => x });} + //~^ ERROR does not live long enough } diff --git a/src/test/ui/span/issue-43927-non-ADT-derive.rs b/src/test/ui/span/issue-43927-non-ADT-derive.rs index cf2a4b8d03767..782cce26a9578 100644 --- a/src/test/ui/span/issue-43927-non-ADT-derive.rs +++ b/src/test/ui/span/issue-43927-non-ADT-derive.rs @@ -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() {} diff --git a/src/test/ui/span/issue-7575.rs b/src/test/ui/span/issue-7575.rs index b74036c4f5ce8..f7059e01261a6 100644 --- a/src/test/ui/span/issue-7575.rs +++ b/src/test/ui/span/issue-7575.rs @@ -45,7 +45,7 @@ impl OtherTrait for 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: 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() { diff --git a/src/test/ui/span/issue-7575.stderr b/src/test/ui/span/issue-7575.stderr index 9b248f49e08b8..a1ed5db69c0db 100644 --- a/src/test/ui/span/issue-7575.stderr +++ b/src/test/ui/span/issue-7575.stderr @@ -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) diff --git a/src/test/ui/span/macro-span-replacement.rs b/src/test/ui/span/macro-span-replacement.rs index b7aae39c46927..71f37f6555e47 100644 --- a/src/test/ui/span/macro-span-replacement.rs +++ b/src/test/ui/span/macro-span-replacement.rs @@ -12,7 +12,7 @@ macro_rules! m { ($a:tt $b:tt) => { - $b $a; + $b $a; //~ WARN struct is never used } } diff --git a/src/test/ui/span/macro-span-replacement.stderr b/src/test/ui/span/macro-span-replacement.stderr index af03aa6a36908..ed96189630698 100644 --- a/src/test/ui/span/macro-span-replacement.stderr +++ b/src/test/ui/span/macro-span-replacement.stderr @@ -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); diff --git a/src/test/ui/span/macro-ty-params.rs b/src/test/ui/span/macro-ty-params.rs index c2443b024ceb2..5d93b1266a4ae 100644 --- a/src/test/ui/span/macro-ty-params.rs +++ b/src/test/ui/span/macro-ty-params.rs @@ -15,7 +15,8 @@ macro_rules! m { } fn main() { - foo::!(); - foo::<>!(); - m!(MyTrait<>); + foo::!(); //~ 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 } diff --git a/src/test/ui/span/macro-ty-params.stderr b/src/test/ui/span/macro-ty-params.stderr index 017a449d96f46..e3e9334d9fbb7 100644 --- a/src/test/ui/span/macro-ty-params.stderr +++ b/src/test/ui/span/macro-ty-params.stderr @@ -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::!(); +18 | foo::!(); //~ 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 diff --git a/src/test/ui/span/missing-unit-argument.rs b/src/test/ui/span/missing-unit-argument.rs index ba1a999121cc5..a586d33eaa738 100644 --- a/src/test/ui/span/missing-unit-argument.rs +++ b/src/test/ui/span/missing-unit-argument.rs @@ -18,10 +18,10 @@ impl S { } 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 } diff --git a/src/test/ui/span/missing-unit-argument.stderr b/src/test/ui/span/missing-unit-argument.stderr index 672b0718a02d3..27f9972557b77 100644 --- a/src/test/ui/span/missing-unit-argument.stderr +++ b/src/test/ui/span/missing-unit-argument.stderr @@ -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(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 diff --git a/src/test/ui/span/move-closure.rs b/src/test/ui/span/move-closure.rs index e11ef0dddaa94..87ce15292979a 100644 --- a/src/test/ui/span/move-closure.rs +++ b/src/test/ui/span/move-closure.rs @@ -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 } diff --git a/src/test/ui/span/move-closure.stderr b/src/test/ui/span/move-closure.stderr index 2294e6476d61f..9135a26bbaf77 100644 --- a/src/test/ui/span/move-closure.stderr +++ b/src/test/ui/span/move-closure.stderr @@ -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 `()` diff --git a/src/test/ui/span/multiline-span-E0072.rs b/src/test/ui/span/multiline-span-E0072.rs index 323e7fb5a42c0..2344d72f45c79 100644 --- a/src/test/ui/span/multiline-span-E0072.rs +++ b/src/test/ui/span/multiline-span-E0072.rs @@ -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, diff --git a/src/test/ui/span/multiline-span-E0072.stderr b/src/test/ui/span/multiline-span-E0072.stderr index a06cbd04deb4f..124a53219a9dc 100644 --- a/src/test/ui/span/multiline-span-E0072.stderr +++ b/src/test/ui/span/multiline-span-E0072.stderr @@ -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, diff --git a/src/test/ui/span/multiline-span-simple.rs b/src/test/ui/span/multiline-span-simple.rs index 451492ba6930b..f8e4cbcbf191f 100644 --- a/src/test/ui/span/multiline-span-simple.rs +++ b/src/test/ui/span/multiline-span-simple.rs @@ -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, diff --git a/src/test/ui/span/multiline-span-simple.stderr b/src/test/ui/span/multiline-span-simple.stderr index 3915f1b655cf5..b068798630ed8 100644 --- a/src/test/ui/span/multiline-span-simple.stderr +++ b/src/test/ui/span/multiline-span-simple.stderr @@ -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` diff --git a/src/test/ui/span/multispan-import-lint.rs b/src/test/ui/span/multispan-import-lint.rs index 66536b29c0298..c3582b0a0c5c6 100644 --- a/src/test/ui/span/multispan-import-lint.rs +++ b/src/test/ui/span/multispan-import-lint.rs @@ -11,6 +11,7 @@ #![warn(unused)] use std::cmp::{Eq, Ord, min, PartialEq, PartialOrd}; +//~^ WARN unused imports fn main() { let _ = min(1, 2); diff --git a/src/test/ui/span/mut-arg-hint.rs b/src/test/ui/span/mut-arg-hint.rs index 296ee6ca10e05..b22cadf3ef2b0 100644 --- a/src/test/ui/span/mut-arg-hint.rs +++ b/src/test/ui/span/mut-arg-hint.rs @@ -10,19 +10,19 @@ 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 } } diff --git a/src/test/ui/span/mut-arg-hint.stderr b/src/test/ui/span/mut-arg-hint.stderr index f8584c6739078..02c607ddc3775 100644 --- a/src/test/ui/span/mut-arg-hint.stderr +++ b/src/test/ui/span/mut-arg-hint.stderr @@ -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 diff --git a/src/test/ui/span/mut-ptr-cant-outlive-ref.rs b/src/test/ui/span/mut-ptr-cant-outlive-ref.rs index 8e968d90a2f65..135b577d7f785 100644 --- a/src/test/ui/span/mut-ptr-cant-outlive-ref.rs +++ b/src/test/ui/span/mut-ptr-cant-outlive-ref.rs @@ -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 } diff --git a/src/test/ui/span/mut-ptr-cant-outlive-ref.stderr b/src/test/ui/span/mut-ptr-cant-outlive-ref.stderr index 007a9fad83073..d9f5736061a35 100644 --- a/src/test/ui/span/mut-ptr-cant-outlive-ref.stderr +++ b/src/test/ui/span/mut-ptr-cant-outlive-ref.stderr @@ -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 diff --git a/src/test/ui/span/non-existing-module-import.rs b/src/test/ui/span/non-existing-module-import.rs index 3d45a94d531c1..ad6409f014ad1 100644 --- a/src/test/ui/span/non-existing-module-import.rs +++ b/src/test/ui/span/non-existing-module-import.rs @@ -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() {} diff --git a/src/test/ui/span/non-existing-module-import.stderr b/src/test/ui/span/non-existing-module-import.stderr index 93339576f4904..74f5dac493772 100644 --- a/src/test/ui/span/non-existing-module-import.stderr +++ b/src/test/ui/span/non-existing-module-import.stderr @@ -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 diff --git a/src/test/ui/span/pub-struct-field.rs b/src/test/ui/span/pub-struct-field.rs index 54cb0b59c75c3..11af361e8a846 100644 --- a/src/test/ui/span/pub-struct-field.rs +++ b/src/test/ui/span/pub-struct-field.rs @@ -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() {} diff --git a/src/test/ui/span/pub-struct-field.stderr b/src/test/ui/span/pub-struct-field.stderr index c66361c8546b8..5b303758d2bac 100644 --- a/src/test/ui/span/pub-struct-field.stderr +++ b/src/test/ui/span/pub-struct-field.stderr @@ -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 diff --git a/src/test/ui/span/range-2.rs b/src/test/ui/span/range-2.rs index 94967693ecf91..589f7182129d8 100644 --- a/src/test/ui/span/range-2.rs +++ b/src/test/ui/span/range-2.rs @@ -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 } diff --git a/src/test/ui/span/range-2.stderr b/src/test/ui/span/range-2.stderr index 285ab4aee4bc4..80d364cd8be4b 100644 --- a/src/test/ui/span/range-2.stderr +++ b/src/test/ui/span/range-2.stderr @@ -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 diff --git a/src/test/ui/span/recursive-type-field.rs b/src/test/ui/span/recursive-type-field.rs index 6fef4d30f7a77..764b5392578b8 100644 --- a/src/test/ui/span/recursive-type-field.rs +++ b/src/test/ui/span/recursive-type-field.rs @@ -10,12 +10,12 @@ use std::rc::Rc; -struct Foo<'a> { +struct Foo<'a> { //~ ERROR recursive type bar: Bar<'a>, b: Rc>, } -struct Bar<'a> { +struct Bar<'a> { //~ ERROR recursive type y: (Foo<'a>, Foo<'a>), z: Option>, a: &'a Foo<'a>, diff --git a/src/test/ui/span/recursive-type-field.stderr b/src/test/ui/span/recursive-type-field.stderr index b4d0b5a6a25d0..bd9f5f032ef37 100644 --- a/src/test/ui/span/recursive-type-field.stderr +++ b/src/test/ui/span/recursive-type-field.stderr @@ -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 diff --git a/src/test/ui/span/regionck-unboxed-closure-lifetimes.rs b/src/test/ui/span/regionck-unboxed-closure-lifetimes.rs index 8ec6036762f48..74a6a2960c947 100644 --- a/src/test/ui/span/regionck-unboxed-closure-lifetimes.rs +++ b/src/test/ui/span/regionck-unboxed-closure-lifetimes.rs @@ -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 } diff --git a/src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr b/src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr index 29848412e4e77..acd995c6bb86f 100644 --- a/src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr +++ b/src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr @@ -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 diff --git a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.rs b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.rs index 99b0d6ed2964c..5449bbfdce3a3 100644 --- a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.rs +++ b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.rs @@ -21,5 +21,5 @@ fn main() { { let ss: &isize = &id(1); blah = box ss as Box; - } + } //~ ERROR does not live long enough } diff --git a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr index 6a3625441b49e..69bdde889166f 100644 --- a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr +++ b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr @@ -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; -24 | } +24 | } //~ ERROR does not live long enough | ^ temporary value dropped here while still borrowed 25 | } | - temporary value needs to live until here diff --git a/src/test/ui/span/regions-close-over-type-parameter-2.rs b/src/test/ui/span/regions-close-over-type-parameter-2.rs index 053af49e0684b..cd838db92e188 100644 --- a/src/test/ui/span/regions-close-over-type-parameter-2.rs +++ b/src/test/ui/span/regions-close-over-type-parameter-2.rs @@ -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 } diff --git a/src/test/ui/span/regions-close-over-type-parameter-2.stderr b/src/test/ui/span/regions-close-over-type-parameter-2.stderr index a89127b1436c5..a7f79f8b26528 100644 --- a/src/test/ui/span/regions-close-over-type-parameter-2.stderr +++ b/src/test/ui/span/regions-close-over-type-parameter-2.stderr @@ -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 diff --git a/src/test/ui/span/regions-escape-loop-via-variable.rs b/src/test/ui/span/regions-escape-loop-via-variable.rs index f588655d1afa8..1dc1ae6071578 100644 --- a/src/test/ui/span/regions-escape-loop-via-variable.rs +++ b/src/test/ui/span/regions-escape-loop-via-variable.rs @@ -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 } diff --git a/src/test/ui/span/regions-escape-loop-via-variable.stderr b/src/test/ui/span/regions-escape-loop-via-variable.stderr index cfdd1c8b1539d..554ffe91e6d1f 100644 --- a/src/test/ui/span/regions-escape-loop-via-variable.stderr +++ b/src/test/ui/span/regions-escape-loop-via-variable.stderr @@ -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 diff --git a/src/test/ui/span/regions-escape-loop-via-vec.rs b/src/test/ui/span/regions-escape-loop-via-vec.rs index 8982b5cd98de4..7c4834751d899 100644 --- a/src/test/ui/span/regions-escape-loop-via-vec.rs +++ b/src/test/ui/span/regions-escape-loop-via-vec.rs @@ -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 diff --git a/src/test/ui/span/regions-escape-loop-via-vec.stderr b/src/test/ui/span/regions-escape-loop-via-vec.stderr index b61df82e8a14f..a7224fcd4cc8c 100644 --- a/src/test/ui/span/regions-escape-loop-via-vec.stderr +++ b/src/test/ui/span/regions-escape-loop-via-vec.stderr @@ -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 diff --git a/src/test/ui/span/regions-infer-borrow-scope-within-loop.rs b/src/test/ui/span/regions-infer-borrow-scope-within-loop.rs index a05658e9e581d..3bb069813a29f 100644 --- a/src/test/ui/span/regions-infer-borrow-scope-within-loop.rs +++ b/src/test/ui/span/regions-infer-borrow-scope-within-loop.rs @@ -21,11 +21,11 @@ fn foo(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); } diff --git a/src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr b/src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr index 0960f5e1b2566..4a44a3a681379 100644 --- a/src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr +++ b/src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr @@ -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 | } diff --git a/src/test/ui/span/send-is-not-static-ensures-scoping.rs b/src/test/ui/span/send-is-not-static-ensures-scoping.rs index 1b7718d2283a7..d294840bdfb33 100644 --- a/src/test/ui/span/send-is-not-static-ensures-scoping.rs +++ b/src/test/ui/span/send-is-not-static-ensures-scoping.rs @@ -23,13 +23,13 @@ impl<'a> Guard<'a> { 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(); } diff --git a/src/test/ui/span/send-is-not-static-ensures-scoping.stderr b/src/test/ui/span/send-is-not-static-ensures-scoping.stderr index 02fc9820495a9..cc12b2c1ee2b2 100644 --- a/src/test/ui/span/send-is-not-static-ensures-scoping.stderr +++ b/src/test/ui/span/send-is-not-static-ensures-scoping.stderr @@ -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 | } diff --git a/src/test/ui/span/send-is-not-static-std-sync-2.rs b/src/test/ui/span/send-is-not-static-std-sync-2.rs index d9d3706586ba9..762eeffaa6af4 100644 --- a/src/test/ui/span/send-is-not-static-std-sync-2.rs +++ b/src/test/ui/span/send-is-not-static-std-sync-2.rs @@ -18,8 +18,8 @@ use std::sync::{Mutex, RwLock, mpsc}; 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(); } diff --git a/src/test/ui/span/send-is-not-static-std-sync-2.stderr b/src/test/ui/span/send-is-not-static-std-sync-2.stderr index 318dab599f5a3..beee85c8b1d9a 100644 --- a/src/test/ui/span/send-is-not-static-std-sync-2.stderr +++ b/src/test/ui/span/send-is-not-static-std-sync-2.stderr @@ -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 | } diff --git a/src/test/ui/span/send-is-not-static-std-sync.rs b/src/test/ui/span/send-is-not-static-std-sync.rs index 8ec2fe8a1ec89..05cb962755801 100644 --- a/src/test/ui/span/send-is-not-static-std-sync.rs +++ b/src/test/ui/span/send-is-not-static-std-sync.rs @@ -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() {} diff --git a/src/test/ui/span/send-is-not-static-std-sync.stderr b/src/test/ui/span/send-is-not-static-std-sync.stderr index 988ff228105de..e078e4e14a5ca 100644 --- a/src/test/ui/span/send-is-not-static-std-sync.stderr +++ b/src/test/ui/span/send-is-not-static-std-sync.stderr @@ -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 diff --git a/src/test/ui/span/slice-borrow.rs b/src/test/ui/span/slice-borrow.rs index 1b022f2324662..6bb98c34b7e6f 100644 --- a/src/test/ui/span/slice-borrow.rs +++ b/src/test/ui/span/slice-borrow.rs @@ -15,5 +15,5 @@ fn main() { { let x: &[isize] = &vec![1, 2, 3, 4, 5]; y = &x[1..]; - } + } //~ ERROR does not live long enough } diff --git a/src/test/ui/span/slice-borrow.stderr b/src/test/ui/span/slice-borrow.stderr index f9dbddd226f09..d1e5cf62a0289 100644 --- a/src/test/ui/span/slice-borrow.stderr +++ b/src/test/ui/span/slice-borrow.stderr @@ -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 diff --git a/src/test/ui/span/suggestion-non-ascii.rs b/src/test/ui/span/suggestion-non-ascii.rs index 67dbe1dc7b566..2d82bba33c5bd 100644 --- a/src/test/ui/span/suggestion-non-ascii.rs +++ b/src/test/ui/span/suggestion-non-ascii.rs @@ -11,6 +11,6 @@ fn main() { let tup = (1,); - println!("☃{}", tup[0]); + println!("☃{}", tup[0]); //~ ERROR cannot index into a value of type } diff --git a/src/test/ui/span/suggestion-non-ascii.stderr b/src/test/ui/span/suggestion-non-ascii.stderr index c67a8fe32b9dd..9ee8ccb01d0f1 100644 --- a/src/test/ui/span/suggestion-non-ascii.stderr +++ b/src/test/ui/span/suggestion-non-ascii.stderr @@ -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 diff --git a/src/test/ui/span/type-binding.rs b/src/test/ui/span/type-binding.rs index 05285c732f414..d8a2e332a030f 100644 --- a/src/test/ui/span/type-binding.rs +++ b/src/test/ui/span/type-binding.rs @@ -14,5 +14,6 @@ use std::ops::Deref; fn homura>(_: T) {} +//~^ ERROR not found fn main() {} diff --git a/src/test/ui/span/typo-suggestion.rs b/src/test/ui/span/typo-suggestion.rs index 536bf16142b30..7aeaa44bec282 100644 --- a/src/test/ui/span/typo-suggestion.rs +++ b/src/test/ui/span/typo-suggestion.rs @@ -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 } diff --git a/src/test/ui/span/typo-suggestion.stderr b/src/test/ui/span/typo-suggestion.stderr index dca0a93f897ba..2a084b1ae67ff 100644 --- a/src/test/ui/span/typo-suggestion.stderr +++ b/src/test/ui/span/typo-suggestion.stderr @@ -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 diff --git a/src/test/ui/span/unused-warning-point-at-signature.rs b/src/test/ui/span/unused-warning-point-at-signature.rs index eb659d08da0c9..6a7071d49aed6 100644 --- a/src/test/ui/span/unused-warning-point-at-signature.rs +++ b/src/test/ui/span/unused-warning-point-at-signature.rs @@ -12,25 +12,25 @@ #![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 { diff --git a/src/test/ui/span/unused-warning-point-at-signature.stderr b/src/test/ui/span/unused-warning-point-at-signature.stderr index 8e658670e9c0c..ed36bd1780178 100644 --- a/src/test/ui/span/unused-warning-point-at-signature.stderr +++ b/src/test/ui/span/unused-warning-point-at-signature.stderr @@ -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 | | { diff --git a/src/test/ui/span/visibility-ty-params.rs b/src/test/ui/span/visibility-ty-params.rs index 2a4a5edd04c08..5df28971e9942 100644 --- a/src/test/ui/span/visibility-ty-params.rs +++ b/src/test/ui/span/visibility-ty-params.rs @@ -14,7 +14,6 @@ macro_rules! m { struct S(T); m!{ S } //~ ERROR unexpected generic arguments in path -//~^ ERROR expected module, found struct `S` mod m { m!{ m<> } //~ ERROR unexpected generic arguments in path diff --git a/src/test/ui/span/visibility-ty-params.stderr b/src/test/ui/span/visibility-ty-params.stderr index 673b9a38e035f..8460f81af8335 100644 --- a/src/test/ui/span/visibility-ty-params.stderr +++ b/src/test/ui/span/visibility-ty-params.stderr @@ -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 diff --git a/src/test/ui/span/wf-method-late-bound-regions.rs b/src/test/ui/span/wf-method-late-bound-regions.rs index b9d292fd15685..ce5ec63fbd10d 100644 --- a/src/test/ui/span/wf-method-late-bound-regions.rs +++ b/src/test/ui/span/wf-method-late-bound-regions.rs @@ -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); } diff --git a/src/test/ui/span/wf-method-late-bound-regions.stderr b/src/test/ui/span/wf-method-late-bound-regions.stderr index a37b5d17aac98..a3fdc53b8e54f 100644 --- a/src/test/ui/span/wf-method-late-bound-regions.stderr +++ b/src/test/ui/span/wf-method-late-bound-regions.stderr @@ -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 | } diff --git a/src/test/ui/static-lifetime.rs b/src/test/ui/static-lifetime.rs index 7b1887b2d1a29..62abf11654edf 100644 --- a/src/test/ui/static-lifetime.rs +++ b/src/test/ui/static-lifetime.rs @@ -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 +} diff --git a/src/test/ui/static-lifetime.stderr b/src/test/ui/static-lifetime.stderr index adeabd91302ce..a99dbf21e54e2 100644 --- a/src/test/ui/static-lifetime.stderr +++ b/src/test/ui/static-lifetime.stderr @@ -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 diff --git a/src/test/ui/str-lit-type-mismatch.rs b/src/test/ui/str-lit-type-mismatch.rs index 0fd7d3a9d869e..4a062f78a327d 100644 --- a/src/test/ui/str-lit-type-mismatch.rs +++ b/src/test/ui/str-lit-type-mismatch.rs @@ -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 } diff --git a/src/test/ui/str-lit-type-mismatch.stderr b/src/test/ui/str-lit-type-mismatch.stderr index 47418522df8ac..bf7646d81eb1d 100644 --- a/src/test/ui/str-lit-type-mismatch.stderr +++ b/src/test/ui/str-lit-type-mismatch.stderr @@ -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` diff --git a/src/test/ui/struct-field-init-syntax.rs b/src/test/ui/struct-field-init-syntax.rs index 8ea62fef9fad1..f1e24495f844f 100644 --- a/src/test/ui/struct-field-init-syntax.rs +++ b/src/test/ui/struct-field-init-syntax.rs @@ -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, }; } diff --git a/src/test/ui/suggestions/closure-immutable-outer-variable.rs b/src/test/ui/suggestions/closure-immutable-outer-variable.rs index fe8e2bc6c8ed1..1d14afd6a01ac 100644 --- a/src/test/ui/suggestions/closure-immutable-outer-variable.rs +++ b/src/test/ui/suggestions/closure-immutable-outer-variable.rs @@ -16,5 +16,5 @@ fn foo(mut f: Box) { 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 } diff --git a/src/test/ui/suggestions/closure-immutable-outer-variable.stderr b/src/test/ui/suggestions/closure-immutable-outer-variable.stderr index 19f1cd071714e..f272a3582c619 100644 --- a/src/test/ui/suggestions/closure-immutable-outer-variable.stderr +++ b/src/test/ui/suggestions/closure-immutable-outer-variable.stderr @@ -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 diff --git a/src/test/ui/suggestions/confuse-field-and-method/issue-18343.rs b/src/test/ui/suggestions/confuse-field-and-method/issue-18343.rs index fc3c58e5223a3..6e0f9999ec1d2 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/issue-18343.rs +++ b/src/test/ui/suggestions/confuse-field-and-method/issue-18343.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct Obj where F: FnMut() -> u32 { +struct Obj where F: FnMut() -> u32 { //~ NOTE not found for this closure: F, } diff --git a/src/test/ui/suggestions/confuse-field-and-method/issue-18343.stderr b/src/test/ui/suggestions/confuse-field-and-method/issue-18343.stderr index bbe8fe7345aa0..62dceceedf388 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/issue-18343.stderr +++ b/src/test/ui/suggestions/confuse-field-and-method/issue-18343.stderr @@ -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 where F: FnMut() -> u32 { +11 | struct Obj where F: FnMut() -> u32 { //~ NOTE not found for this | ------------------------------------- method `closure` not found for this ... 17 | o.closure(); diff --git a/src/test/ui/suggestions/confuse-field-and-method/issue-2392.rs b/src/test/ui/suggestions/confuse-field-and-method/issue-2392.rs index f84f35ce84bf9..cba0ecbf58ec6 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/issue-2392.rs +++ b/src/test/ui/suggestions/confuse-field-and-method/issue-2392.rs @@ -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 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 u32>, } diff --git a/src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr b/src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr index a9211e1864e3b..b4086b1602701 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr +++ b/src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr @@ -1,120 +1,120 @@ -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 where F: FnOnce() -> u32 { +28 | struct Obj 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 where F: FnOnce() -> u32 { +28 | struct Obj 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 u32 {func}>` in the current scope - --> $DIR/issue-2392.rs:60:12 + --> $DIR/issue-2392.rs:71:12 | -25 | struct Obj where F: FnOnce() -> u32 { +28 | struct Obj 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 u32 {func}>` in the current scope - --> $DIR/issue-2392.rs:77:12 + --> $DIR/issue-2392.rs:88:12 | -25 | struct Obj where F: FnOnce() -> u32 { +28 | struct Obj 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 u32 {func}>` in the current scope - --> $DIR/issue-2392.rs:81:12 + --> $DIR/issue-2392.rs:92:12 | -25 | struct Obj where F: FnOnce() -> u32 { +28 | struct Obj 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 + 'static>>` in the current scope - --> $DIR/issue-2392.rs:86:24 + --> $DIR/issue-2392.rs:97:24 | -25 | struct Obj where F: FnOnce() -> u32 { +28 | struct Obj 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 diff --git a/src/test/ui/suggestions/confuse-field-and-method/issue-32128.rs b/src/test/ui/suggestions/confuse-field-and-method/issue-32128.rs index 2fd7dc246c206..32d5c7f5e8aef 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/issue-32128.rs +++ b/src/test/ui/suggestions/confuse-field-and-method/issue-32128.rs @@ -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 i32> } diff --git a/src/test/ui/suggestions/confuse-field-and-method/issue-32128.stderr b/src/test/ui/suggestions/confuse-field-and-method/issue-32128.stderr index d6a837a17ae1c..813b6060db072 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/issue-32128.stderr +++ b/src/test/ui/suggestions/confuse-field-and-method/issue-32128.stderr @@ -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); diff --git a/src/test/ui/suggestions/confuse-field-and-method/issue-33784.rs b/src/test/ui/suggestions/confuse-field-and-method/issue-33784.rs index 03c84fc57befe..8734985522191 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/issue-33784.rs +++ b/src/test/ui/suggestions/confuse-field-and-method/issue-33784.rs @@ -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 } diff --git a/src/test/ui/suggestions/confuse-field-and-method/private-field.rs b/src/test/ui/suggestions/confuse-field-and-method/private-field.rs index 94cf38fb32f2f..4cf939bbed6f5 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/private-field.rs +++ b/src/test/ui/suggestions/confuse-field-and-method/private-field.rs @@ -23,7 +23,7 @@ pub mod animal { 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); } diff --git a/src/test/ui/suggestions/confuse-field-and-method/private-field.stderr b/src/test/ui/suggestions/confuse-field-and-method/private-field.stderr index dd0081782f418..caf78af6eb9f9 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/private-field.stderr +++ b/src/test/ui/suggestions/confuse-field-and-method/private-field.stderr @@ -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 diff --git a/src/test/ui/suggestions/extern-crate-rename.rs b/src/test/ui/suggestions/extern-crate-rename.rs index b3fa5871a82f5..b58149fb0b8dc 100644 --- a/src/test/ui/suggestions/extern-crate-rename.rs +++ b/src/test/ui/suggestions/extern-crate-rename.rs @@ -13,6 +13,6 @@ extern crate m1; -extern crate m2 as m1; +extern crate m2 as m1; //~ ERROR is defined multiple times fn main() {} diff --git a/src/test/ui/suggestions/extern-crate-rename.stderr b/src/test/ui/suggestions/extern-crate-rename.stderr index c15e238e8b0a3..6268935b08cca 100644 --- a/src/test/ui/suggestions/extern-crate-rename.stderr +++ b/src/test/ui/suggestions/extern-crate-rename.stderr @@ -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 diff --git a/src/test/ui/suggestions/issue-32354-suggest-import-rename.rs b/src/test/ui/suggestions/issue-32354-suggest-import-rename.rs index 51aba27498f88..9d71ab1a788eb 100644 --- a/src/test/ui/suggestions/issue-32354-suggest-import-rename.rs +++ b/src/test/ui/suggestions/issue-32354-suggest-import-rename.rs @@ -17,6 +17,6 @@ pub mod extension2 { } use extension1::ConstructorExtension; -use extension2::ConstructorExtension; +use extension2::ConstructorExtension; //~ ERROR is defined multiple times fn main() {} diff --git a/src/test/ui/suggestions/issue-32354-suggest-import-rename.stderr b/src/test/ui/suggestions/issue-32354-suggest-import-rename.stderr index 0798519128474..ae892db364ba7 100644 --- a/src/test/ui/suggestions/issue-32354-suggest-import-rename.stderr +++ b/src/test/ui/suggestions/issue-32354-suggest-import-rename.stderr @@ -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 diff --git a/src/test/ui/suggestions/issue-43420-no-over-suggest.rs b/src/test/ui/suggestions/issue-43420-no-over-suggest.rs index d504b7cae28c4..8c5bde45baed0 100644 --- a/src/test/ui/suggestions/issue-43420-no-over-suggest.rs +++ b/src/test/ui/suggestions/issue-43420-no-over-suggest.rs @@ -15,5 +15,5 @@ fn foo(b: &[u16]) {} fn main() { let a: Vec = Vec::new(); - foo(&a); + foo(&a); //~ ERROR mismatched types } diff --git a/src/test/ui/suggestions/issue-43420-no-over-suggest.stderr b/src/test/ui/suggestions/issue-43420-no-over-suggest.stderr index bcad9ce56c65e..c3f64fef50c66 100644 --- a/src/test/ui/suggestions/issue-43420-no-over-suggest.stderr +++ b/src/test/ui/suggestions/issue-43420-no-over-suggest.stderr @@ -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]` diff --git a/src/test/ui/suggestions/suggest-labels.rs b/src/test/ui/suggestions/suggest-labels.rs index 5bebce79eccbc..8c97301f40b91 100644 --- a/src/test/ui/suggestions/suggest-labels.rs +++ b/src/test/ui/suggestions/suggest-labels.rs @@ -11,16 +11,16 @@ #[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 } } } diff --git a/src/test/ui/suggestions/suggest-labels.stderr b/src/test/ui/suggestions/suggest-labels.stderr index 23aa18a3655fb..c82b5decfd839 100644 --- a/src/test/ui/suggestions/suggest-labels.stderr +++ b/src/test/ui/suggestions/suggest-labels.stderr @@ -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 diff --git a/src/test/ui/suggestions/suggest-methods.rs b/src/test/ui/suggestions/suggest-methods.rs index b02881dc7eee0..49027deecc198 100644 --- a/src/test/ui/suggestions/suggest-methods.rs +++ b/src/test/ui/suggestions/suggest-methods.rs @@ -25,16 +25,16 @@ impl FooT for Foo { 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 } diff --git a/src/test/ui/suggestions/suggest-methods.stderr b/src/test/ui/suggestions/suggest-methods.stderr index 30e3bbd997976..d3d8d302c70c4 100644 --- a/src/test/ui/suggestions/suggest-methods.stderr +++ b/src/test/ui/suggestions/suggest-methods.stderr @@ -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 diff --git a/src/test/ui/suggestions/try-on-option.rs b/src/test/ui/suggestions/try-on-option.rs index 4cd8cd81151cc..65ca23402d27e 100644 --- a/src/test/ui/suggestions/try-on-option.rs +++ b/src/test/ui/suggestions/try-on-option.rs @@ -14,12 +14,12 @@ fn main() {} fn foo() -> Result { let x: Option = None; - x?; + x?; //~ the trait bound Ok(22) } fn bar() -> u32 { let x: Option = None; - x?; + x?; //~ the `?` operator 22 } diff --git a/src/test/ui/suggestions/try-on-option.stderr b/src/test/ui/suggestions/try-on-option.stderr index 86d4510cad3c2..b1be9ad3cf697 100644 --- a/src/test/ui/suggestions/try-on-option.stderr +++ b/src/test/ui/suggestions/try-on-option.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `(): std::convert::From` is not satisfied --> $DIR/try-on-option.rs:17:5 | -17 | x?; +17 | x?; //~ the trait bound | ^^ the trait `std::convert::From` is not implemented for `()` | = note: required by `std::convert::From::from` @@ -9,7 +9,7 @@ error[E0277]: the trait bound `(): std::convert::From` 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` diff --git a/src/test/ui/suggestions/try-operator-on-main.rs b/src/test/ui/suggestions/try-operator-on-main.rs index eadd12924df66..e9d285941b762 100644 --- a/src/test/ui/suggestions/try-operator-on-main.rs +++ b/src/test/ui/suggestions/try-operator-on-main.rs @@ -14,20 +14,20 @@ use std::ops::Try; 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 { // and a non-`Try` object on a `Try` fn. - ()?; + ()?; //~ ERROR the `?` operator can only loop {} } diff --git a/src/test/ui/suggestions/try-operator-on-main.stderr b/src/test/ui/suggestions/try-operator-on-main.stderr index e83bf2abc1504..8b17e06065b5e 100644 --- a/src/test/ui/suggestions/try-operator-on-main.stderr +++ b/src/test/ui/suggestions/try-operator-on-main.stderr @@ -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 `()` diff --git a/src/test/ui/suggestions/tuple-float-index.rs b/src/test/ui/suggestions/tuple-float-index.rs index 8bfbd0e74db22..0a188305a9228 100644 --- a/src/test/ui/suggestions/tuple-float-index.rs +++ b/src/test/ui/suggestions/tuple-float-index.rs @@ -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` } diff --git a/src/test/ui/suggestions/tuple-float-index.stderr b/src/test/ui/suggestions/tuple-float-index.stderr index 4b1be26c86b0e..7d133f11cbb60 100644 --- a/src/test/ui/suggestions/tuple-float-index.stderr +++ b/src/test/ui/suggestions/tuple-float-index.stderr @@ -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 diff --git a/src/test/ui/suggestions/type-ascription-instead-of-initializer.rs b/src/test/ui/suggestions/type-ascription-instead-of-initializer.rs index bcd965f10fabb..d80dad8fbd4c2 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-initializer.rs +++ b/src/test/ui/suggestions/type-ascription-instead-of-initializer.rs @@ -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 } diff --git a/src/test/ui/suggestions/type-ascription-instead-of-initializer.stderr b/src/test/ui/suggestions/type-ascription-instead-of-initializer.stderr index 647e3f84685f1..c3e8d7fcd61ac 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-initializer.stderr +++ b/src/test/ui/suggestions/type-ascription-instead-of-initializer.stderr @@ -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 diff --git a/src/test/ui/suggestions/type-ascription-instead-of-statement-end.rs b/src/test/ui/suggestions/type-ascription-instead-of-statement-end.rs index 93de55a39e954..01d773dd5e103 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-statement-end.rs +++ b/src/test/ui/suggestions/type-ascription-instead-of-statement-end.rs @@ -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` } diff --git a/src/test/ui/suggestions/type-ascription-instead-of-statement-end.stderr b/src/test/ui/suggestions/type-ascription-instead-of-statement-end.stderr index 550048c7b88f1..9d26d00467480 100644 --- a/src/test/ui/suggestions/type-ascription-instead-of-statement-end.stderr +++ b/src/test/ui/suggestions/type-ascription-instead-of-statement-end.stderr @@ -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 diff --git a/src/test/ui/suggestions/type-ascription-with-fn-call.rs b/src/test/ui/suggestions/type-ascription-with-fn-call.rs index 7c10bf98c8409..b2c25c37e8e32 100644 --- a/src/test/ui/suggestions/type-ascription-with-fn-call.rs +++ b/src/test/ui/suggestions/type-ascription-with-fn-call.rs @@ -12,7 +12,7 @@ fn main() { f() : - f(); + f(); //~ ERROR expected type, found function } fn f() {} diff --git a/src/test/ui/suggestions/type-ascription-with-fn-call.stderr b/src/test/ui/suggestions/type-ascription-with-fn-call.stderr index 93c65c263dd12..d5e0b00f3dff0 100644 --- a/src/test/ui/suggestions/type-ascription-with-fn-call.stderr +++ b/src/test/ui/suggestions/type-ascription-with-fn-call.stderr @@ -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 diff --git a/src/test/ui/token/bounds-obj-parens.rs b/src/test/ui/token/bounds-obj-parens.rs index 02c119cf727fe..9617df8fa21a9 100644 --- a/src/test/ui/token/bounds-obj-parens.rs +++ b/src/test/ui/token/bounds-obj-parens.rs @@ -14,4 +14,3 @@ type A = Box<(Fn(D::Error) -> E) + 'static + Send + Sync>; // OK (but see #39318 FAIL //~^ ERROR -//~| ERROR diff --git a/src/test/ui/token/issue-10636-2.rs b/src/test/ui/token/issue-10636-2.rs index 93759123618fb..c22baee680a02 100644 --- a/src/test/ui/token/issue-10636-2.rs +++ b/src/test/ui/token/issue-10636-2.rs @@ -15,6 +15,6 @@ pub fn trace_option(option: Option) { 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 `)` diff --git a/src/test/ui/token/issue-41155.rs b/src/test/ui/token/issue-41155.rs index 0f473c9e07388..550a90fc6af26 100644 --- a/src/test/ui/token/issue-41155.rs +++ b/src/test/ui/token/issue-41155.rs @@ -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 diff --git a/src/test/ui/token/issue-41155.stderr b/src/test/ui/token/issue-41155.stderr index 50a38da9d8c18..707784272ede8 100644 --- a/src/test/ui/token/issue-41155.stderr +++ b/src/test/ui/token/issue-41155.stderr @@ -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 diff --git a/src/test/ui/token/macro-incomplete-parse.rs b/src/test/ui/token/macro-incomplete-parse.rs index 08749373432f5..fd2561ce49653 100644 --- a/src/test/ui/token/macro-incomplete-parse.rs +++ b/src/test/ui/token/macro-incomplete-parse.rs @@ -21,7 +21,7 @@ macro_rules! ignored_item { 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 ) } diff --git a/src/test/ui/token/trailing-plus-in-bounds.rs b/src/test/ui/token/trailing-plus-in-bounds.rs index 2bb2c97790c12..72cae6abc2dbe 100644 --- a/src/test/ui/token/trailing-plus-in-bounds.rs +++ b/src/test/ui/token/trailing-plus-in-bounds.rs @@ -18,4 +18,3 @@ fn main() { FAIL //~^ ERROR -//~| ERROR diff --git a/src/test/ui/trait-method-private.rs b/src/test/ui/trait-method-private.rs index 5c1bd668ac649..54cf6e6783eb7 100644 --- a/src/test/ui/trait-method-private.rs +++ b/src/test/ui/trait-method-private.rs @@ -26,5 +26,5 @@ mod inner { fn main() { let foo = inner::Foo; - foo.method(); + foo.method(); //~ ERROR is private } diff --git a/src/test/ui/trait-method-private.stderr b/src/test/ui/trait-method-private.stderr index 549c84b9b0325..7406541a9da55 100644 --- a/src/test/ui/trait-method-private.stderr +++ b/src/test/ui/trait-method-private.stderr @@ -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 diff --git a/src/test/ui/transmute/transmute-from-fn-item-types-error.rs b/src/test/ui/transmute/transmute-from-fn-item-types-error.rs index d60c97f1d59a8..0a0214a24ff2d 100644 --- a/src/test/ui/transmute/transmute-from-fn-item-types-error.rs +++ b/src/test/ui/transmute/transmute-from-fn-item-types-error.rs @@ -12,16 +12,16 @@ use std::mem; unsafe fn foo() -> (i8, *const (), Option) { 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::(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>(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::, usize>(Some(main)); diff --git a/src/test/ui/transmute/transmute-type-parameters.rs b/src/test/ui/transmute/transmute-type-parameters.rs index 117fc2cc5df24..fe340295f74c7 100644 --- a/src/test/ui/transmute/transmute-type-parameters.rs +++ b/src/test/ui/transmute/transmute-type-parameters.rs @@ -19,17 +19,17 @@ use std::mem::transmute; unsafe fn f(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(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(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 { @@ -38,7 +38,7 @@ struct Bad { unsafe fn i(x: Bad) { let _: i32 = transmute(x); -//~^ ERROR differently sized types: Bad (size can vary because of T) to i32 +//~^ ERROR transmute called with types of different sizes } enum Worse { @@ -48,12 +48,12 @@ enum Worse { unsafe fn j(x: Worse) { let _: i32 = transmute(x); -//~^ ERROR differently sized types: Worse (size can vary because of T) to i32 +//~^ ERROR transmute called with types of different sizes } unsafe fn k(x: Option) { let _: i32 = transmute(x); -//~^ ERROR differently sized types: std::option::Option (size can vary because of T) to i32 +//~^ ERROR transmute called with types of different sizes } fn main() {} diff --git a/src/test/ui/type-check/assignment-in-if.rs b/src/test/ui/type-check/assignment-in-if.rs index 98dc55c666303..e4422f0b99aa4 100644 --- a/src/test/ui/type-check/assignment-in-if.rs +++ b/src/test/ui/type-check/assignment-in-if.rs @@ -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 }) { diff --git a/src/test/ui/type-check/cannot_infer_local_or_array.rs b/src/test/ui/type-check/cannot_infer_local_or_array.rs index 0b35a9c3dbebc..3ec96144da544 100644 --- a/src/test/ui/type-check/cannot_infer_local_or_array.rs +++ b/src/test/ui/type-check/cannot_infer_local_or_array.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - let x = []; + let x = []; //~ ERROR type annotations needed } diff --git a/src/test/ui/type-check/cannot_infer_local_or_array.stderr b/src/test/ui/type-check/cannot_infer_local_or_array.stderr index 8c52bb5a1d3a5..19369f5ca60fe 100644 --- a/src/test/ui/type-check/cannot_infer_local_or_array.stderr +++ b/src/test/ui/type-check/cannot_infer_local_or_array.stderr @@ -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 diff --git a/src/test/ui/type-check/issue-22897.rs b/src/test/ui/type-check/issue-22897.rs index 296dc81a89bcf..62eaa616d3199 100644 --- a/src/test/ui/type-check/issue-22897.rs +++ b/src/test/ui/type-check/issue-22897.rs @@ -11,5 +11,5 @@ fn main() { } fn unconstrained_type() { - []; + []; //~ ERROR type annotations needed } diff --git a/src/test/ui/type-check/issue-22897.stderr b/src/test/ui/type-check/issue-22897.stderr index 9568411885192..5ee350746bee8 100644 --- a/src/test/ui/type-check/issue-22897.stderr +++ b/src/test/ui/type-check/issue-22897.stderr @@ -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 diff --git a/src/test/ui/type-check/issue-40294.rs b/src/test/ui/type-check/issue-40294.rs index d30a425d1099b..d2817062b27ff 100644 --- a/src/test/ui/type-check/issue-40294.rs +++ b/src/test/ui/type-check/issue-40294.rs @@ -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 { diff --git a/src/test/ui/type-check/issue-40294.stderr b/src/test/ui/type-check/issue-40294.stderr index bb3a371b26e0c..2ca97aa3ef067 100644 --- a/src/test/ui/type-check/issue-40294.stderr +++ b/src/test/ui/type-check/issue-40294.stderr @@ -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 | | { diff --git a/src/test/ui/type-check/issue-41314.rs b/src/test/ui/type-check/issue-41314.rs index 5127a8ce17482..7b4d2f05f5fd0 100644 --- a/src/test/ui/type-check/issue-41314.rs +++ b/src/test/ui/type-check/issue-41314.rs @@ -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` } } diff --git a/src/test/ui/type-check/issue-41314.stderr b/src/test/ui/type-check/issue-41314.stderr index acae7a350877a..569924da6f446 100644 --- a/src/test/ui/type-check/issue-41314.stderr +++ b/src/test/ui/type-check/issue-41314.stderr @@ -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 diff --git a/src/test/ui/type-check/unknown_type_for_closure.rs b/src/test/ui/type-check/unknown_type_for_closure.rs index f1d357df12c43..0c355976330fd 100644 --- a/src/test/ui/type-check/unknown_type_for_closure.rs +++ b/src/test/ui/type-check/unknown_type_for_closure.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - let x = |_| { }; + let x = |_| { }; //~ ERROR type annotations needed } diff --git a/src/test/ui/type-check/unknown_type_for_closure.stderr b/src/test/ui/type-check/unknown_type_for_closure.stderr index afbd15ca486bd..1d8c0ddc8b601 100644 --- a/src/test/ui/type-check/unknown_type_for_closure.stderr +++ b/src/test/ui/type-check/unknown_type_for_closure.stderr @@ -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 diff --git a/src/test/ui/unboxed-closure-no-cyclic-sig.rs b/src/test/ui/unboxed-closure-no-cyclic-sig.rs index 78d119ef329d0..506bce0dbec21 100644 --- a/src/test/ui/unboxed-closure-no-cyclic-sig.rs +++ b/src/test/ui/unboxed-closure-no-cyclic-sig.rs @@ -15,5 +15,5 @@ fn g(_: F) where F: FnOnce(Option) {} fn main() { - g(|_| { }); + g(|_| { }); //~ ERROR closure/generator type that references itself } diff --git a/src/test/ui/unboxed-closure-no-cyclic-sig.stderr b/src/test/ui/unboxed-closure-no-cyclic-sig.stderr index a4279a2afac60..75a87f70660d5 100644 --- a/src/test/ui/unboxed-closure-no-cyclic-sig.stderr +++ b/src/test/ui/unboxed-closure-no-cyclic-sig.stderr @@ -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; diff --git a/src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.rs b/src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.rs index 14ef3b5f178ac..481346ad4b6eb 100644 --- a/src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.rs +++ b/src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.rs @@ -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); } diff --git a/src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.stderr b/src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.stderr index d968c40939631..d3d9ce2b34a1c 100644 --- a/src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.stderr +++ b/src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.stderr @@ -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 diff --git a/src/test/ui/union-fields.rs b/src/test/ui/union-fields.rs index 021f57e3eee0a..dc551bb899861 100644 --- a/src/test/ui/union-fields.rs +++ b/src/test/ui/union-fields.rs @@ -13,19 +13,19 @@ 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; diff --git a/src/test/ui/union-fields.stderr b/src/test/ui/union-fields.stderr index f3a2702d5aefa..ffcd178ca548f 100644 --- a/src/test/ui/union-fields.stderr +++ b/src/test/ui/union-fields.stderr @@ -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 diff --git a/src/test/ui/union-sized-field.rs b/src/test/ui/union-sized-field.rs index eeca5ab740450..8999f1e0930be 100644 --- a/src/test/ui/union-sized-field.rs +++ b/src/test/ui/union-sized-field.rs @@ -11,16 +11,16 @@ #![feature(untagged_unions)] union Foo { - value: T, + value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied } struct Foo2 { - value: T, + value: T, //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied t: u32, } enum Foo3 { - Value(T), + Value(T), //~ ERROR the trait bound `T: std::marker::Sized` is not satisfied } fn main() {} diff --git a/src/test/ui/union-sized-field.stderr b/src/test/ui/union-sized-field.stderr index ea90d97c4c3d1..9586f9507391f 100644 --- a/src/test/ui/union-sized-field.stderr +++ b/src/test/ui/union-sized-field.stderr @@ -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` diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index bb7c3616f2aa5..5ff7589a2a492 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2218,9 +2218,9 @@ actual:\n\ // 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); @@ -2244,9 +2244,6 @@ actual:\n\ 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 @@ actual:\n\ &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 @@ actual:\n\ 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) { diff --git a/src/tools/miri b/src/tools/miri index 80853e2f24a01..6dbfe23c4d1af 160000 --- a/src/tools/miri +++ b/src/tools/miri @@ -1 +1 @@ -Subproject commit 80853e2f24a01db96fe9821e468dd2af75a4d2e5 +Subproject commit 6dbfe23c4d1af109c894ff9d7d5da97c025584e5