From d4e51a8fb286444a8c276a05a1c3ba6ba8ca6576 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 10 Dec 2017 22:47:55 +0300 Subject: [PATCH] Move compile-fail tests with NOTE/HELP annotations to UI --- .../arbitrary-self-types-not-object-safe.rs | 0 ...rbitrary-self-types-not-object-safe.stderr | 19 ++ .../asm-out-assign-imm.rs | 0 src/test/ui/asm-out-assign-imm.stderr | 11 + .../associated-const-impl-wrong-lifetime.rs | 0 ...ssociated-const-impl-wrong-lifetime.stderr | 23 ++ .../associated-const-impl-wrong-type.rs | 0 .../associated-const-impl-wrong-type.stderr | 11 + ...pe-projection-from-multiple-supertraits.rs | 0 ...rojection-from-multiple-supertraits.stderr | 44 ++++ ...ed-types-ICE-when-projecting-out-of-err.rs | 0 ...ypes-ICE-when-projecting-out-of-err.stderr | 8 + .../associated-types-in-ambiguous-context.rs | 0 ...sociated-types-in-ambiguous-context.stderr | 26 ++ .../augmented-assignments.rs | 0 src/test/ui/augmented-assignments.stderr | 22 ++ .../auxiliary/changing-crates-a1.rs | 0 .../auxiliary/changing-crates-a2.rs | 0 .../auxiliary/changing-crates-b.rs | 0 src/test/ui/auxiliary/coherence_lib.rs | 25 ++ src/test/ui/auxiliary/empty-struct.rs | 19 ++ .../auxiliary/issue-36708.rs | 0 src/test/ui/auxiliary/lint_output_format.rs | 30 +++ src/test/ui/auxiliary/struct_field_privacy.rs | 19 ++ .../auxiliary/svh-a-base.rs | 0 .../auxiliary/svh-a-change-lit.rs | 0 .../auxiliary/svh-a-change-significant-cfg.rs | 0 .../auxiliary/svh-a-change-trait-bound.rs | 0 .../auxiliary/svh-a-change-type-arg.rs | 0 .../auxiliary/svh-a-change-type-ret.rs | 0 .../auxiliary/svh-a-change-type-static.rs | 0 .../{compile-fail => ui}/auxiliary/svh-b.rs | 0 .../auxiliary/svh-uta-base.rs | 0 .../auxiliary/svh-uta-change-use-trait.rs | 0 .../{compile-fail => ui}/auxiliary/svh-utb.rs | 0 src/test/ui/auxiliary/two_macros.rs | 15 ++ .../binary-op-on-double-ref.rs | 0 src/test/ui/binary-op-on-double-ref.stderr | 11 + .../blind-item-item-shadow.rs | 0 src/test/ui/blind-item-item-shadow.stderr | 17 ++ src/test/{compile-fail => ui}/bogus-tag.rs | 0 src/test/ui/bogus-tag.stderr | 11 + .../borrowck/borrowck-box-insensitivity.rs | 0 .../borrowck-box-insensitivity.stderr | 170 ++++++++++++ .../borrowck-escaping-closure-error-1.rs | 0 .../borrowck-escaping-closure-error-1.stderr | 14 + .../borrowck-escaping-closure-error-2.rs | 0 .../borrowck-escaping-closure-error-2.stderr | 14 + .../borrowck/borrowck-move-error-with-note.rs | 0 .../borrowck-move-error-with-note.stderr | 36 +++ .../borrowck/borrowck-move-out-of-vec-tail.rs | 0 .../borrowck-move-out-of-vec-tail.stderr | 17 ++ .../borrowck-report-with-custom-diagnostic.rs | 0 ...rowck-report-with-custom-diagnostic.stderr | 38 +++ .../borrowck/borrowck-vec-pattern-nesting.rs | 0 .../borrowck-vec-pattern-nesting.stderr | 82 ++++++ src/test/{compile-fail => ui}/cast-as-bool.rs | 0 src/test/ui/cast-as-bool.stderr | 10 + .../{compile-fail => ui}/cast-rfc0401-2.rs | 0 src/test/ui/cast-rfc0401-2.stderr | 10 + .../{compile-fail => ui}/changing-crates.rs | 0 src/test/ui/changing-crates.stderr | 13 + .../coherence-error-suppression.rs | 0 .../ui/coherence-error-suppression.stderr | 8 + .../coherence-impls-copy.rs | 0 src/test/ui/coherence-impls-copy.stderr | 59 +++++ .../coherence-overlap-downstream-inherent.rs | 0 ...herence-overlap-downstream-inherent.stderr | 22 ++ .../coherence-overlap-downstream.rs | 0 .../ui/coherence-overlap-downstream.stderr | 22 ++ .../coherence-overlap-issue-23516-inherent.rs | 0 ...erence-overlap-issue-23516-inherent.stderr | 13 + .../coherence-overlap-issue-23516.rs | 0 .../ui/coherence-overlap-issue-23516.stderr | 13 + .../coherence-overlap-upstream-inherent.rs | 0 ...coherence-overlap-upstream-inherent.stderr | 13 + .../coherence-overlap-upstream.rs | 0 src/test/ui/coherence-overlap-upstream.stderr | 13 + .../{compile-fail => ui}/const-deref-ptr.rs | 0 src/test/ui/const-deref-ptr.stderr | 8 + .../const-eval-overflow-2.rs | 0 src/test/ui/const-eval-overflow-2.stderr | 14 + .../const-eval-overflow-4.rs | 0 src/test/ui/const-eval-overflow-4.stderr | 8 + .../{compile-fail => ui}/const-eval-span.rs | 0 src/test/ui/const-eval-span.stderr | 11 + .../{compile-fail => ui}/const-fn-error.rs | 0 src/test/ui/const-fn-error.stderr | 14 + .../{compile-fail => ui}/const-fn-mismatch.rs | 0 src/test/ui/const-fn-mismatch.stderr | 8 + .../const-fn-not-in-trait.rs | 0 src/test/ui/const-fn-not-in-trait.stderr | 14 + .../const-len-underflow-separate-spans.rs | 0 .../const-len-underflow-separate-spans.stderr | 14 + .../const-pattern-not-const-evaluable.rs | 0 .../const-pattern-not-const-evaluable.stderr | 14 + .../{compile-fail => ui}/const-unsized.rs | 0 src/test/ui/const-unsized.stderr | 38 +++ .../cycle-trait-supertrait-indirect.rs | 0 .../ui/cycle-trait-supertrait-indirect.stderr | 20 ++ .../derived-errors/issue-31997-1.rs | 0 .../ui/derived-errors/issue-31997-1.stderr | 8 + .../discrim-overflow-2.rs | 0 src/test/ui/discrim-overflow-2.stderr | 66 +++++ .../{compile-fail => ui}/discrim-overflow.rs | 0 src/test/ui/discrim-overflow.stderr | 66 +++++ .../{compile-fail => ui}/double-import.rs | 0 src/test/ui/double-import.stderr | 16 ++ .../duplicate-check-macro-exports.rs | 0 .../ui/duplicate-check-macro-exports.stderr | 14 + .../empty-struct-unit-expr.rs | 0 src/test/ui/empty-struct-unit-expr.stderr | 41 +++ .../enum-and-module-in-same-scope.rs | 0 .../ui/enum-and-module-in-same-scope.stderr | 20 ++ src/test/{compile-fail => ui}/fat-ptr-cast.rs | 0 src/test/ui/fat-ptr-cast.stderr | 62 +++++ .../generic-type-less-params-with-defaults.rs | 0 ...eric-type-less-params-with-defaults.stderr | 8 + .../generic-type-more-params-with-defaults.rs | 0 ...eric-type-more-params-with-defaults.stderr | 8 + .../{compile-fail => ui}/if-let-arm-types.rs | 0 src/test/ui/if-let-arm-types.stderr | 25 ++ .../impl-duplicate-methods.rs | 0 src/test/ui/impl-duplicate-methods.stderr | 10 + .../impl-unused-rps-in-assoc-type.rs | 0 .../ui/impl-unused-rps-in-assoc-type.stderr | 8 + .../imports/auxiliary/two_macros.rs | 0 .../{compile-fail => ui}/imports/duplicate.rs | 0 src/test/ui/imports/duplicate.stderr | 88 +++++++ .../imports/macro-paths.rs | 0 src/test/ui/imports/macro-paths.stderr | 42 +++ .../{compile-fail => ui}/imports/macros.rs | 0 src/test/ui/imports/macros.stderr | 57 ++++ .../imports/rfc-1560-warning-cycle.rs | 0 .../ui/imports/rfc-1560-warning-cycle.stderr | 16 ++ .../imports/shadow_builtin_macros.rs | 0 .../ui/imports/shadow_builtin_macros.stderr | 59 +++++ .../{compile-fail => ui}/impossible_range.rs | 0 src/test/ui/impossible_range.stderr | 18 ++ src/test/{compile-fail => ui}/index-help.rs | 0 src/test/ui/index-help.stderr | 10 + .../invalid-path-in-const.rs | 0 src/test/ui/invalid-path-in-const.stderr | 8 + src/test/{compile-fail => ui}/issue-10969.rs | 0 src/test/ui/issue-10969.stderr | 26 ++ src/test/{compile-fail => ui}/issue-11004.rs | 0 src/test/ui/issue-11004.stderr | 18 ++ src/test/{compile-fail => ui}/issue-11319.rs | 0 src/test/ui/issue-11319.stderr | 22 ++ .../{compile-fail => ui}/issue-12187-1.rs | 0 src/test/ui/issue-12187-1.stderr | 11 + .../{compile-fail => ui}/issue-12187-2.rs | 0 src/test/ui/issue-12187-2.stderr | 11 + src/test/{compile-fail => ui}/issue-12511.rs | 0 src/test/ui/issue-12511.stderr | 20 ++ src/test/{compile-fail => ui}/issue-13058.rs | 0 src/test/ui/issue-13058.stderr | 23 ++ src/test/{compile-fail => ui}/issue-14092.rs | 0 src/test/ui/issue-14092.stderr | 8 + src/test/{compile-fail => ui}/issue-15260.rs | 0 src/test/ui/issue-15260.stderr | 36 +++ src/test/{compile-fail => ui}/issue-15524.rs | 0 src/test/ui/issue-15524.stderr | 29 +++ src/test/{compile-fail => ui}/issue-17263.rs | 0 src/test/ui/issue-17263.stderr | 24 ++ src/test/{compile-fail => ui}/issue-17441.rs | 0 src/test/ui/issue-17441.stderr | 46 ++++ src/test/{compile-fail => ui}/issue-17954.rs | 0 src/test/ui/issue-17954.stderr | 13 + src/test/{compile-fail => ui}/issue-18183.rs | 0 src/test/ui/issue-18183.stderr | 8 + src/test/{compile-fail => ui}/issue-18819.rs | 0 src/test/ui/issue-18819.stderr | 14 + src/test/{compile-fail => ui}/issue-19498.rs | 0 src/test/ui/issue-19498.stderr | 46 ++++ src/test/{compile-fail => ui}/issue-1962.rs | 0 src/test/ui/issue-1962.stderr | 17 ++ src/test/{compile-fail => ui}/issue-19707.rs | 0 src/test/ui/issue-19707.stderr | 18 ++ src/test/{compile-fail => ui}/issue-19922.rs | 0 src/test/ui/issue-19922.stderr | 10 + src/test/{compile-fail => ui}/issue-20692.rs | 0 src/test/ui/issue-20692.stderr | 19 ++ src/test/{compile-fail => ui}/issue-21546.rs | 0 src/test/ui/issue-21546.stderr | 68 +++++ src/test/{compile-fail => ui}/issue-21600.rs | 0 src/test/ui/issue-21600.stderr | 32 +++ src/test/{compile-fail => ui}/issue-21950.rs | 0 src/test/ui/issue-21950.stderr | 16 ++ src/test/{compile-fail => ui}/issue-22370.rs | 0 src/test/ui/issue-22370.stderr | 10 + src/test/{compile-fail => ui}/issue-22560.rs | 0 src/test/ui/issue-22560.stderr | 37 +++ src/test/{compile-fail => ui}/issue-22886.rs | 0 src/test/ui/issue-22886.stderr | 8 + .../{compile-fail => ui}/issue-22933-2.rs | 0 src/test/ui/issue-22933-2.stderr | 11 + src/test/{compile-fail => ui}/issue-23041.rs | 0 src/test/ui/issue-23041.stderr | 8 + src/test/{compile-fail => ui}/issue-23173.rs | 0 src/test/ui/issue-23173.stderr | 38 +++ src/test/{compile-fail => ui}/issue-23217.rs | 0 src/test/ui/issue-23217.stderr | 10 + src/test/{compile-fail => ui}/issue-23302.rs | 0 src/test/ui/issue-23302.stderr | 26 ++ src/test/{compile-fail => ui}/issue-23543.rs | 0 src/test/ui/issue-23543.stderr | 8 + src/test/{compile-fail => ui}/issue-23544.rs | 0 src/test/ui/issue-23544.stderr | 8 + src/test/{compile-fail => ui}/issue-23716.rs | 0 src/test/ui/issue-23716.stderr | 20 ++ src/test/{compile-fail => ui}/issue-24036.rs | 0 src/test/ui/issue-24036.stderr | 63 +++++ src/test/{compile-fail => ui}/issue-24081.rs | 0 src/test/ui/issue-24081.stderr | 77 ++++++ src/test/{compile-fail => ui}/issue-24424.rs | 0 src/test/ui/issue-24424.stderr | 10 + src/test/{compile-fail => ui}/issue-25385.rs | 0 src/test/ui/issue-25385.stderr | 17 ++ src/test/{compile-fail => ui}/issue-25793.rs | 0 src/test/ui/issue-25793.stderr | 13 + src/test/{compile-fail => ui}/issue-25826.rs | 0 src/test/ui/issue-25826.stderr | 8 + src/test/{compile-fail => ui}/issue-26056.rs | 0 src/test/ui/issue-26056.stderr | 10 + src/test/{compile-fail => ui}/issue-26093.rs | 0 src/test/ui/issue-26093.stderr | 11 + src/test/{compile-fail => ui}/issue-26472.rs | 0 src/test/ui/issue-26472.stderr | 10 + src/test/{compile-fail => ui}/issue-26638.rs | 0 src/test/ui/issue-26638.stderr | 28 ++ src/test/{compile-fail => ui}/issue-26886.rs | 0 src/test/ui/issue-26886.stderr | 32 +++ src/test/{compile-fail => ui}/issue-27842.rs | 1 - src/test/ui/issue-27842.stderr | 16 ++ src/test/{compile-fail => ui}/issue-27942.rs | 0 src/test/ui/issue-27942.stderr | 52 ++++ src/test/{compile-fail => ui}/issue-2848.rs | 0 src/test/ui/issue-2848.stderr | 10 + src/test/{compile-fail => ui}/issue-28568.rs | 0 src/test/ui/issue-28568.stderr | 18 ++ src/test/{compile-fail => ui}/issue-28776.rs | 0 src/test/ui/issue-28776.stderr | 8 + src/test/{compile-fail => ui}/issue-28837.rs | 0 src/test/ui/issue-28837.stderr | 122 +++++++++ src/test/{compile-fail => ui}/issue-28971.rs | 0 src/test/ui/issue-28971.stderr | 11 + src/test/{compile-fail => ui}/issue-29124.rs | 0 src/test/ui/issue-29124.stderr | 18 ++ src/test/{compile-fail => ui}/issue-30007.rs | 0 src/test/ui/issue-30007.stderr | 14 + src/test/{compile-fail => ui}/issue-3008-1.rs | 0 src/test/ui/issue-3008-1.stderr | 13 + src/test/{compile-fail => ui}/issue-3008-2.rs | 0 src/test/ui/issue-3008-2.stderr | 12 + src/test/{compile-fail => ui}/issue-30255.rs | 0 src/test/ui/issue-30255.stderr | 26 ++ src/test/{compile-fail => ui}/issue-30302.rs | 0 src/test/ui/issue-30302.stderr | 27 ++ src/test/{compile-fail => ui}/issue-3044.rs | 0 src/test/ui/issue-3044.stderr | 10 + src/test/{compile-fail => ui}/issue-30730.rs | 0 src/test/ui/issue-30730.stderr | 15 ++ src/test/{compile-fail => ui}/issue-31221.rs | 0 src/test/ui/issue-31221.stderr | 43 +++ src/test/{compile-fail => ui}/issue-32326.rs | 0 src/test/ui/issue-32326.stderr | 15 ++ src/test/{compile-fail => ui}/issue-32950.rs | 0 src/test/ui/issue-32950.stderr | 9 + src/test/{compile-fail => ui}/issue-34047.rs | 0 src/test/ui/issue-34047.stderr | 11 + src/test/{compile-fail => ui}/issue-34209.rs | 0 src/test/ui/issue-34209.stderr | 10 + src/test/{compile-fail => ui}/issue-35139.rs | 0 src/test/ui/issue-35139.stderr | 8 + src/test/{compile-fail => ui}/issue-35869.rs | 0 src/test/ui/issue-35869.stderr | 50 ++++ src/test/{compile-fail => ui}/issue-36163.rs | 0 src/test/ui/issue-36163.stderr | 20 ++ src/test/{compile-fail => ui}/issue-36708.rs | 0 src/test/ui/issue-36708.stderr | 8 + src/test/{compile-fail => ui}/issue-3779.rs | 0 src/test/ui/issue-3779.stderr | 13 + src/test/{compile-fail => ui}/issue-37884.rs | 0 src/test/ui/issue-37884.stderr | 39 +++ src/test/{compile-fail => ui}/issue-4335.rs | 0 src/test/ui/issue-4335.stderr | 20 ++ src/test/{compile-fail => ui}/issue-4935.rs | 0 src/test/ui/issue-4935.stderr | 11 + src/test/{compile-fail => ui}/issue-5239-1.rs | 0 src/test/ui/issue-5239-1.stderr | 10 + src/test/{compile-fail => ui}/issue-6458-3.rs | 0 src/test/ui/issue-6458-3.stderr | 8 + src/test/{compile-fail => ui}/issue-6458-4.rs | 0 src/test/ui/issue-6458-4.stderr | 15 ++ src/test/{compile-fail => ui}/issue-6458.rs | 0 src/test/ui/issue-6458.stderr | 8 + src/test/{compile-fail => ui}/issue-7813.rs | 0 src/test/ui/issue-7813.stderr | 10 + ...-return-type-requires-explicit-lifetime.rs | 0 ...urn-type-requires-explicit-lifetime.stderr | 54 ++++ .../{compile-fail => ui}/lint-forbid-attr.rs | 0 src/test/ui/lint-forbid-attr.stderr | 11 + .../lint-output-format-2.rs | 0 src/test/ui/lint-output-format-2.stderr | 24 ++ .../lint-unconditional-recursion.rs | 0 .../ui/lint-unconditional-recursion.stderr | 240 +++++++++++++++++ .../liveness-return-last-stmt-semi.rs | 0 .../ui/liveness-return-last-stmt-semi.stderr | 51 ++++ .../loops-reject-duplicate-labels-2.rs | 0 .../ui/loops-reject-duplicate-labels-2.stderr | 72 +++++ .../loops-reject-duplicate-labels.rs | 0 .../ui/loops-reject-duplicate-labels.stderr | 75 ++++++ ...loops-reject-labels-shadowing-lifetimes.rs | 0 ...s-reject-labels-shadowing-lifetimes.stderr | 111 ++++++++ .../loops-reject-lifetime-shadowing-label.rs | 0 ...ops-reject-lifetime-shadowing-label.stderr | 16 ++ .../{compile-fail => ui}/macro-context.rs | 0 src/test/ui/macro-context.stderr | 47 ++++ .../macro-invalid-fragment-spec.rs | 0 .../ui/macro-invalid-fragment-spec.stderr | 10 + .../{compile-fail => ui}/macro-shadowing.rs | 0 src/test/ui/macro-shadowing.stderr | 24 ++ .../main-wrong-location.rs | 0 src/test/ui/main-wrong-location.stderr | 11 + src/test/{compile-fail => ui}/maybe-bounds.rs | 0 src/test/ui/maybe-bounds.stderr | 22 ++ .../method-missing-call.rs | 0 src/test/ui/method-missing-call.stderr | 18 ++ .../missing-block-hint.rs | 1 - src/test/ui/missing-block-hint.stderr | 16 ++ .../moves-based-on-type-block-bad.rs | 0 .../ui/moves-based-on-type-block-bad.stderr | 11 + .../moves-based-on-type-match-bindings.rs | 0 .../moves-based-on-type-match-bindings.stderr | 13 + .../no-patterns-in-args.rs | 0 src/test/ui/no-patterns-in-args.stderr | 32 +++ .../non-constant-expr-for-arr-len.rs | 0 .../ui/non-constant-expr-for-arr-len.stderr | 8 + .../non-exhaustive-pattern-witness.rs | 0 .../ui/non-exhaustive-pattern-witness.stderr | 44 ++++ .../not-enough-arguments.rs | 0 src/test/ui/not-enough-arguments.stderr | 14 + .../{compile-fail => ui}/numeric-fields.rs | 0 src/test/ui/numeric-fields.stderr | 16 ++ .../object-safety-associated-consts.rs | 0 .../ui/object-safety-associated-consts.stderr | 10 + .../object-safety-generics.rs | 0 src/test/ui/object-safety-generics.stderr | 18 ++ .../object-safety-mentions-Self.rs | 0 .../ui/object-safety-mentions-Self.stderr | 18 ++ .../object-safety-sized.rs | 0 src/test/ui/object-safety-sized.stderr | 10 + .../object-safety-supertrait-mentions-Self.rs | 0 ...ect-safety-supertrait-mentions-Self.stderr | 10 + .../{compile-fail => ui}/partialeq_help.rs | 0 src/test/ui/partialeq_help.stderr | 11 + .../pat-slice-old-style.rs | 0 src/test/ui/pat-slice-old-style.stderr | 10 + .../qualified-path-params-2.rs | 0 src/test/ui/qualified-path-params-2.stderr | 16 ++ .../region-borrow-params-issue-29793-small.rs | 0 ...ion-borrow-params-issue-29793-small.stderr | 246 ++++++++++++++++++ .../regions-nested-fns-2.rs | 0 src/test/ui/regions-nested-fns-2.stderr | 15 ++ .../resolve-conflict-item-vs-import.rs | 0 .../ui/resolve-conflict-item-vs-import.stderr | 17 ++ .../resolve-inconsistent-names.rs | 0 src/test/ui/resolve-inconsistent-names.stderr | 18 ++ src/test/{compile-fail => ui}/self-impl.rs | 0 src/test/ui/self-impl.stderr | 18 ++ .../{compile-fail => ui}/shadowed-lifetime.rs | 0 src/test/ui/shadowed-lifetime.stderr | 20 ++ .../str-concat-on-double-ref.rs | 0 src/test/ui/str-concat-on-double-ref.stderr | 10 + .../struct-fields-decl-dupe.rs | 0 src/test/ui/struct-fields-decl-dupe.stderr | 10 + .../struct-fields-hints-no-dupe.rs | 0 .../ui/struct-fields-hints-no-dupe.stderr | 8 + .../struct-fields-hints.rs | 0 src/test/ui/struct-fields-hints.stderr | 8 + .../struct-fields-too-many.rs | 0 src/test/ui/struct-fields-too-many.stderr | 10 + .../struct-path-self-type-mismatch.rs | 0 .../ui/struct-path-self-type-mismatch.stderr | 34 +++ .../suggest-private-fields.rs | 0 src/test/ui/suggest-private-fields.stderr | 28 ++ .../{compile-fail => ui}/svh-change-lit.rs | 0 src/test/ui/svh-change-lit.stderr | 13 + .../svh-change-significant-cfg.rs | 0 src/test/ui/svh-change-significant-cfg.stderr | 13 + .../svh-change-trait-bound.rs | 0 src/test/ui/svh-change-trait-bound.stderr | 13 + .../svh-change-type-arg.rs | 0 src/test/ui/svh-change-type-arg.stderr | 13 + .../svh-change-type-ret.rs | 0 src/test/ui/svh-change-type-ret.stderr | 13 + .../svh-change-type-static.rs | 0 src/test/ui/svh-change-type-static.stderr | 13 + .../{compile-fail => ui}/svh-use-trait.rs | 0 src/test/ui/svh-use-trait.stderr | 13 + .../trait-duplicate-methods.rs | 0 src/test/ui/trait-duplicate-methods.stderr | 12 + .../trait-safety-fn-body.rs | 0 src/test/ui/trait-safety-fn-body.stderr | 8 + .../trait-suggest-where-clause.rs | 0 src/test/ui/trait-suggest-where-clause.stderr | 67 +++++ ...traits-multidispatch-convert-ambig-dest.rs | 0 ...ts-multidispatch-convert-ambig-dest.stderr | 8 + .../{compile-fail => ui}/type-recursive.rs | 0 src/test/ui/type-recursive.stderr | 13 + .../typeck-builtin-bound-type-parameters.rs | 0 ...ypeck-builtin-bound-type-parameters.stderr | 38 +++ ...typeck-default-trait-impl-outside-crate.rs | 0 ...ck-default-trait-impl-outside-crate.stderr | 8 + .../typeck_type_placeholder_item.rs | 0 .../ui/typeck_type_placeholder_item.stderr | 206 +++++++++++++++ .../typeck_type_placeholder_lifetime_1.rs | 0 .../typeck_type_placeholder_lifetime_1.stderr | 8 + .../typeck_type_placeholder_lifetime_2.rs | 0 .../typeck_type_placeholder_lifetime_2.stderr | 8 + .../unboxed-closure-sugar-wrong-trait.rs | 0 .../unboxed-closure-sugar-wrong-trait.stderr | 14 + .../unconstrained-none.rs | 0 src/test/ui/unconstrained-none.stderr | 8 + .../{compile-fail => ui}/unconstrained-ref.rs | 0 src/test/ui/unconstrained-ref.stderr | 8 + .../union/union-const-eval.rs | 0 src/test/ui/union/union-const-eval.stderr | 8 + .../union/union-derive-eq.rs | 0 src/test/ui/union/union-derive-eq.stderr | 10 + .../union-fields-1.rs} | 0 .../union-fields-1.stderr} | 10 +- .../union/union-fields-2.rs} | 0 src/test/ui/union/union-fields-2.stderr | 82 ++++++ src/test/ui/{ => union}/union-sized-field.rs | 0 .../ui/{ => union}/union-sized-field.stderr | 0 .../union/union-suggest-field.rs | 0 src/test/ui/union/union-suggest-field.stderr | 22 ++ .../{compile-fail => ui}/unsafe-const-fn.rs | 0 src/test/ui/unsafe-const-fn.stderr | 8 + .../{compile-fail => ui}/unsized-enum2.rs | 0 src/test/ui/unsized-enum2.stderr | 190 ++++++++++++++ src/test/{compile-fail => ui}/use-mod.rs | 0 src/test/ui/use-mod.stderr | 35 +++ .../{compile-fail => ui}/variadic-ffi-3.rs | 0 src/test/ui/variadic-ffi-3.stderr | 74 ++++++ .../variance-unused-type-param.rs | 0 src/test/ui/variance-unused-type-param.stderr | 26 ++ .../{compile-fail => ui}/vector-no-ann.rs | 0 src/test/ui/vector-no-ann.stderr | 10 + 451 files changed, 5821 insertions(+), 7 deletions(-) rename src/test/{compile-fail => ui}/arbitrary-self-types-not-object-safe.rs (100%) create mode 100644 src/test/ui/arbitrary-self-types-not-object-safe.stderr rename src/test/{compile-fail => ui}/asm-out-assign-imm.rs (100%) create mode 100644 src/test/ui/asm-out-assign-imm.stderr rename src/test/{compile-fail => ui}/associated-const-impl-wrong-lifetime.rs (100%) create mode 100644 src/test/ui/associated-const-impl-wrong-lifetime.stderr rename src/test/{compile-fail => ui}/associated-const-impl-wrong-type.rs (100%) create mode 100644 src/test/ui/associated-const-impl-wrong-type.stderr rename src/test/{compile-fail => ui}/associated-type-projection-from-multiple-supertraits.rs (100%) create mode 100644 src/test/ui/associated-type-projection-from-multiple-supertraits.stderr rename src/test/{compile-fail => ui}/associated-types-ICE-when-projecting-out-of-err.rs (100%) create mode 100644 src/test/ui/associated-types-ICE-when-projecting-out-of-err.stderr rename src/test/{compile-fail => ui}/associated-types-in-ambiguous-context.rs (100%) create mode 100644 src/test/ui/associated-types-in-ambiguous-context.stderr rename src/test/{compile-fail => ui}/augmented-assignments.rs (100%) create mode 100644 src/test/ui/augmented-assignments.stderr rename src/test/{compile-fail => ui}/auxiliary/changing-crates-a1.rs (100%) rename src/test/{compile-fail => ui}/auxiliary/changing-crates-a2.rs (100%) rename src/test/{compile-fail => ui}/auxiliary/changing-crates-b.rs (100%) create mode 100644 src/test/ui/auxiliary/coherence_lib.rs create mode 100644 src/test/ui/auxiliary/empty-struct.rs rename src/test/{compile-fail => ui}/auxiliary/issue-36708.rs (100%) create mode 100644 src/test/ui/auxiliary/lint_output_format.rs create mode 100644 src/test/ui/auxiliary/struct_field_privacy.rs rename src/test/{compile-fail => ui}/auxiliary/svh-a-base.rs (100%) rename src/test/{compile-fail => ui}/auxiliary/svh-a-change-lit.rs (100%) rename src/test/{compile-fail => ui}/auxiliary/svh-a-change-significant-cfg.rs (100%) rename src/test/{compile-fail => ui}/auxiliary/svh-a-change-trait-bound.rs (100%) rename src/test/{compile-fail => ui}/auxiliary/svh-a-change-type-arg.rs (100%) rename src/test/{compile-fail => ui}/auxiliary/svh-a-change-type-ret.rs (100%) rename src/test/{compile-fail => ui}/auxiliary/svh-a-change-type-static.rs (100%) rename src/test/{compile-fail => ui}/auxiliary/svh-b.rs (100%) rename src/test/{compile-fail => ui}/auxiliary/svh-uta-base.rs (100%) rename src/test/{compile-fail => ui}/auxiliary/svh-uta-change-use-trait.rs (100%) rename src/test/{compile-fail => ui}/auxiliary/svh-utb.rs (100%) create mode 100644 src/test/ui/auxiliary/two_macros.rs rename src/test/{compile-fail => ui}/binary-op-on-double-ref.rs (100%) create mode 100644 src/test/ui/binary-op-on-double-ref.stderr rename src/test/{compile-fail => ui}/blind-item-item-shadow.rs (100%) create mode 100644 src/test/ui/blind-item-item-shadow.stderr rename src/test/{compile-fail => ui}/bogus-tag.rs (100%) create mode 100644 src/test/ui/bogus-tag.stderr rename src/test/{compile-fail => ui}/borrowck/borrowck-box-insensitivity.rs (100%) create mode 100644 src/test/ui/borrowck/borrowck-box-insensitivity.stderr rename src/test/{compile-fail => ui}/borrowck/borrowck-escaping-closure-error-1.rs (100%) create mode 100644 src/test/ui/borrowck/borrowck-escaping-closure-error-1.stderr rename src/test/{compile-fail => ui}/borrowck/borrowck-escaping-closure-error-2.rs (100%) create mode 100644 src/test/ui/borrowck/borrowck-escaping-closure-error-2.stderr rename src/test/{compile-fail => ui}/borrowck/borrowck-move-error-with-note.rs (100%) create mode 100644 src/test/ui/borrowck/borrowck-move-error-with-note.stderr rename src/test/{compile-fail => ui}/borrowck/borrowck-move-out-of-vec-tail.rs (100%) create mode 100644 src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr rename src/test/{compile-fail => ui}/borrowck/borrowck-report-with-custom-diagnostic.rs (100%) create mode 100644 src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr rename src/test/{compile-fail => ui}/borrowck/borrowck-vec-pattern-nesting.rs (100%) create mode 100644 src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr rename src/test/{compile-fail => ui}/cast-as-bool.rs (100%) create mode 100644 src/test/ui/cast-as-bool.stderr rename src/test/{compile-fail => ui}/cast-rfc0401-2.rs (100%) create mode 100644 src/test/ui/cast-rfc0401-2.stderr rename src/test/{compile-fail => ui}/changing-crates.rs (100%) create mode 100644 src/test/ui/changing-crates.stderr rename src/test/{compile-fail => ui}/coherence-error-suppression.rs (100%) create mode 100644 src/test/ui/coherence-error-suppression.stderr rename src/test/{compile-fail => ui}/coherence-impls-copy.rs (100%) create mode 100644 src/test/ui/coherence-impls-copy.stderr rename src/test/{compile-fail => ui}/coherence-overlap-downstream-inherent.rs (100%) create mode 100644 src/test/ui/coherence-overlap-downstream-inherent.stderr rename src/test/{compile-fail => ui}/coherence-overlap-downstream.rs (100%) create mode 100644 src/test/ui/coherence-overlap-downstream.stderr rename src/test/{compile-fail => ui}/coherence-overlap-issue-23516-inherent.rs (100%) create mode 100644 src/test/ui/coherence-overlap-issue-23516-inherent.stderr rename src/test/{compile-fail => ui}/coherence-overlap-issue-23516.rs (100%) create mode 100644 src/test/ui/coherence-overlap-issue-23516.stderr rename src/test/{compile-fail => ui}/coherence-overlap-upstream-inherent.rs (100%) create mode 100644 src/test/ui/coherence-overlap-upstream-inherent.stderr rename src/test/{compile-fail => ui}/coherence-overlap-upstream.rs (100%) create mode 100644 src/test/ui/coherence-overlap-upstream.stderr rename src/test/{compile-fail => ui}/const-deref-ptr.rs (100%) create mode 100644 src/test/ui/const-deref-ptr.stderr rename src/test/{compile-fail => ui}/const-eval-overflow-2.rs (100%) create mode 100644 src/test/ui/const-eval-overflow-2.stderr rename src/test/{compile-fail => ui}/const-eval-overflow-4.rs (100%) create mode 100644 src/test/ui/const-eval-overflow-4.stderr rename src/test/{compile-fail => ui}/const-eval-span.rs (100%) create mode 100644 src/test/ui/const-eval-span.stderr rename src/test/{compile-fail => ui}/const-fn-error.rs (100%) create mode 100644 src/test/ui/const-fn-error.stderr rename src/test/{compile-fail => ui}/const-fn-mismatch.rs (100%) create mode 100644 src/test/ui/const-fn-mismatch.stderr rename src/test/{compile-fail => ui}/const-fn-not-in-trait.rs (100%) create mode 100644 src/test/ui/const-fn-not-in-trait.stderr rename src/test/{compile-fail => ui}/const-len-underflow-separate-spans.rs (100%) create mode 100644 src/test/ui/const-len-underflow-separate-spans.stderr rename src/test/{compile-fail => ui}/const-pattern-not-const-evaluable.rs (100%) create mode 100644 src/test/ui/const-pattern-not-const-evaluable.stderr rename src/test/{compile-fail => ui}/const-unsized.rs (100%) create mode 100644 src/test/ui/const-unsized.stderr rename src/test/{compile-fail => ui}/cycle-trait-supertrait-indirect.rs (100%) create mode 100644 src/test/ui/cycle-trait-supertrait-indirect.stderr rename src/test/{compile-fail => ui}/derived-errors/issue-31997-1.rs (100%) create mode 100644 src/test/ui/derived-errors/issue-31997-1.stderr rename src/test/{compile-fail => ui}/discrim-overflow-2.rs (100%) create mode 100644 src/test/ui/discrim-overflow-2.stderr rename src/test/{compile-fail => ui}/discrim-overflow.rs (100%) create mode 100644 src/test/ui/discrim-overflow.stderr rename src/test/{compile-fail => ui}/double-import.rs (100%) create mode 100644 src/test/ui/double-import.stderr rename src/test/{compile-fail => ui}/duplicate-check-macro-exports.rs (100%) create mode 100644 src/test/ui/duplicate-check-macro-exports.stderr rename src/test/{compile-fail => ui}/empty-struct-unit-expr.rs (100%) create mode 100644 src/test/ui/empty-struct-unit-expr.stderr rename src/test/{compile-fail => ui}/enum-and-module-in-same-scope.rs (100%) create mode 100644 src/test/ui/enum-and-module-in-same-scope.stderr rename src/test/{compile-fail => ui}/fat-ptr-cast.rs (100%) create mode 100644 src/test/ui/fat-ptr-cast.stderr rename src/test/{compile-fail => ui}/generic-type-less-params-with-defaults.rs (100%) create mode 100644 src/test/ui/generic-type-less-params-with-defaults.stderr rename src/test/{compile-fail => ui}/generic-type-more-params-with-defaults.rs (100%) create mode 100644 src/test/ui/generic-type-more-params-with-defaults.stderr rename src/test/{compile-fail => ui}/if-let-arm-types.rs (100%) create mode 100644 src/test/ui/if-let-arm-types.stderr rename src/test/{compile-fail => ui}/impl-duplicate-methods.rs (100%) create mode 100644 src/test/ui/impl-duplicate-methods.stderr rename src/test/{compile-fail => ui}/impl-unused-rps-in-assoc-type.rs (100%) create mode 100644 src/test/ui/impl-unused-rps-in-assoc-type.stderr rename src/test/{compile-fail => ui}/imports/auxiliary/two_macros.rs (100%) rename src/test/{compile-fail => ui}/imports/duplicate.rs (100%) create mode 100644 src/test/ui/imports/duplicate.stderr rename src/test/{compile-fail => ui}/imports/macro-paths.rs (100%) create mode 100644 src/test/ui/imports/macro-paths.stderr rename src/test/{compile-fail => ui}/imports/macros.rs (100%) create mode 100644 src/test/ui/imports/macros.stderr rename src/test/{compile-fail => ui}/imports/rfc-1560-warning-cycle.rs (100%) create mode 100644 src/test/ui/imports/rfc-1560-warning-cycle.stderr rename src/test/{compile-fail => ui}/imports/shadow_builtin_macros.rs (100%) create mode 100644 src/test/ui/imports/shadow_builtin_macros.stderr rename src/test/{compile-fail => ui}/impossible_range.rs (100%) create mode 100644 src/test/ui/impossible_range.stderr rename src/test/{compile-fail => ui}/index-help.rs (100%) create mode 100644 src/test/ui/index-help.stderr rename src/test/{compile-fail => ui}/invalid-path-in-const.rs (100%) create mode 100644 src/test/ui/invalid-path-in-const.stderr rename src/test/{compile-fail => ui}/issue-10969.rs (100%) create mode 100644 src/test/ui/issue-10969.stderr rename src/test/{compile-fail => ui}/issue-11004.rs (100%) create mode 100644 src/test/ui/issue-11004.stderr rename src/test/{compile-fail => ui}/issue-11319.rs (100%) create mode 100644 src/test/ui/issue-11319.stderr rename src/test/{compile-fail => ui}/issue-12187-1.rs (100%) create mode 100644 src/test/ui/issue-12187-1.stderr rename src/test/{compile-fail => ui}/issue-12187-2.rs (100%) create mode 100644 src/test/ui/issue-12187-2.stderr rename src/test/{compile-fail => ui}/issue-12511.rs (100%) create mode 100644 src/test/ui/issue-12511.stderr rename src/test/{compile-fail => ui}/issue-13058.rs (100%) create mode 100644 src/test/ui/issue-13058.stderr rename src/test/{compile-fail => ui}/issue-14092.rs (100%) create mode 100644 src/test/ui/issue-14092.stderr rename src/test/{compile-fail => ui}/issue-15260.rs (100%) create mode 100644 src/test/ui/issue-15260.stderr rename src/test/{compile-fail => ui}/issue-15524.rs (100%) create mode 100644 src/test/ui/issue-15524.stderr rename src/test/{compile-fail => ui}/issue-17263.rs (100%) create mode 100644 src/test/ui/issue-17263.stderr rename src/test/{compile-fail => ui}/issue-17441.rs (100%) create mode 100644 src/test/ui/issue-17441.stderr rename src/test/{compile-fail => ui}/issue-17954.rs (100%) create mode 100644 src/test/ui/issue-17954.stderr rename src/test/{compile-fail => ui}/issue-18183.rs (100%) create mode 100644 src/test/ui/issue-18183.stderr rename src/test/{compile-fail => ui}/issue-18819.rs (100%) create mode 100644 src/test/ui/issue-18819.stderr rename src/test/{compile-fail => ui}/issue-19498.rs (100%) create mode 100644 src/test/ui/issue-19498.stderr rename src/test/{compile-fail => ui}/issue-1962.rs (100%) create mode 100644 src/test/ui/issue-1962.stderr rename src/test/{compile-fail => ui}/issue-19707.rs (100%) create mode 100644 src/test/ui/issue-19707.stderr rename src/test/{compile-fail => ui}/issue-19922.rs (100%) create mode 100644 src/test/ui/issue-19922.stderr rename src/test/{compile-fail => ui}/issue-20692.rs (100%) create mode 100644 src/test/ui/issue-20692.stderr rename src/test/{compile-fail => ui}/issue-21546.rs (100%) create mode 100644 src/test/ui/issue-21546.stderr rename src/test/{compile-fail => ui}/issue-21600.rs (100%) create mode 100644 src/test/ui/issue-21600.stderr rename src/test/{compile-fail => ui}/issue-21950.rs (100%) create mode 100644 src/test/ui/issue-21950.stderr rename src/test/{compile-fail => ui}/issue-22370.rs (100%) create mode 100644 src/test/ui/issue-22370.stderr rename src/test/{compile-fail => ui}/issue-22560.rs (100%) create mode 100644 src/test/ui/issue-22560.stderr rename src/test/{compile-fail => ui}/issue-22886.rs (100%) create mode 100644 src/test/ui/issue-22886.stderr rename src/test/{compile-fail => ui}/issue-22933-2.rs (100%) create mode 100644 src/test/ui/issue-22933-2.stderr rename src/test/{compile-fail => ui}/issue-23041.rs (100%) create mode 100644 src/test/ui/issue-23041.stderr rename src/test/{compile-fail => ui}/issue-23173.rs (100%) create mode 100644 src/test/ui/issue-23173.stderr rename src/test/{compile-fail => ui}/issue-23217.rs (100%) create mode 100644 src/test/ui/issue-23217.stderr rename src/test/{compile-fail => ui}/issue-23302.rs (100%) create mode 100644 src/test/ui/issue-23302.stderr rename src/test/{compile-fail => ui}/issue-23543.rs (100%) create mode 100644 src/test/ui/issue-23543.stderr rename src/test/{compile-fail => ui}/issue-23544.rs (100%) create mode 100644 src/test/ui/issue-23544.stderr rename src/test/{compile-fail => ui}/issue-23716.rs (100%) create mode 100644 src/test/ui/issue-23716.stderr rename src/test/{compile-fail => ui}/issue-24036.rs (100%) create mode 100644 src/test/ui/issue-24036.stderr rename src/test/{compile-fail => ui}/issue-24081.rs (100%) create mode 100644 src/test/ui/issue-24081.stderr rename src/test/{compile-fail => ui}/issue-24424.rs (100%) create mode 100644 src/test/ui/issue-24424.stderr rename src/test/{compile-fail => ui}/issue-25385.rs (100%) create mode 100644 src/test/ui/issue-25385.stderr rename src/test/{compile-fail => ui}/issue-25793.rs (100%) create mode 100644 src/test/ui/issue-25793.stderr rename src/test/{compile-fail => ui}/issue-25826.rs (100%) create mode 100644 src/test/ui/issue-25826.stderr rename src/test/{compile-fail => ui}/issue-26056.rs (100%) create mode 100644 src/test/ui/issue-26056.stderr rename src/test/{compile-fail => ui}/issue-26093.rs (100%) create mode 100644 src/test/ui/issue-26093.stderr rename src/test/{compile-fail => ui}/issue-26472.rs (100%) create mode 100644 src/test/ui/issue-26472.stderr rename src/test/{compile-fail => ui}/issue-26638.rs (100%) create mode 100644 src/test/ui/issue-26638.stderr rename src/test/{compile-fail => ui}/issue-26886.rs (100%) create mode 100644 src/test/ui/issue-26886.stderr rename src/test/{compile-fail => ui}/issue-27842.rs (97%) create mode 100644 src/test/ui/issue-27842.stderr rename src/test/{compile-fail => ui}/issue-27942.rs (100%) create mode 100644 src/test/ui/issue-27942.stderr rename src/test/{compile-fail => ui}/issue-2848.rs (100%) create mode 100644 src/test/ui/issue-2848.stderr rename src/test/{compile-fail => ui}/issue-28568.rs (100%) create mode 100644 src/test/ui/issue-28568.stderr rename src/test/{compile-fail => ui}/issue-28776.rs (100%) create mode 100644 src/test/ui/issue-28776.stderr rename src/test/{compile-fail => ui}/issue-28837.rs (100%) create mode 100644 src/test/ui/issue-28837.stderr rename src/test/{compile-fail => ui}/issue-28971.rs (100%) create mode 100644 src/test/ui/issue-28971.stderr rename src/test/{compile-fail => ui}/issue-29124.rs (100%) create mode 100644 src/test/ui/issue-29124.stderr rename src/test/{compile-fail => ui}/issue-30007.rs (100%) create mode 100644 src/test/ui/issue-30007.stderr rename src/test/{compile-fail => ui}/issue-3008-1.rs (100%) create mode 100644 src/test/ui/issue-3008-1.stderr rename src/test/{compile-fail => ui}/issue-3008-2.rs (100%) create mode 100644 src/test/ui/issue-3008-2.stderr rename src/test/{compile-fail => ui}/issue-30255.rs (100%) create mode 100644 src/test/ui/issue-30255.stderr rename src/test/{compile-fail => ui}/issue-30302.rs (100%) create mode 100644 src/test/ui/issue-30302.stderr rename src/test/{compile-fail => ui}/issue-3044.rs (100%) create mode 100644 src/test/ui/issue-3044.stderr rename src/test/{compile-fail => ui}/issue-30730.rs (100%) create mode 100644 src/test/ui/issue-30730.stderr rename src/test/{compile-fail => ui}/issue-31221.rs (100%) create mode 100644 src/test/ui/issue-31221.stderr rename src/test/{compile-fail => ui}/issue-32326.rs (100%) create mode 100644 src/test/ui/issue-32326.stderr rename src/test/{compile-fail => ui}/issue-32950.rs (100%) create mode 100644 src/test/ui/issue-32950.stderr rename src/test/{compile-fail => ui}/issue-34047.rs (100%) create mode 100644 src/test/ui/issue-34047.stderr rename src/test/{compile-fail => ui}/issue-34209.rs (100%) create mode 100644 src/test/ui/issue-34209.stderr rename src/test/{compile-fail => ui}/issue-35139.rs (100%) create mode 100644 src/test/ui/issue-35139.stderr rename src/test/{compile-fail => ui}/issue-35869.rs (100%) create mode 100644 src/test/ui/issue-35869.stderr rename src/test/{compile-fail => ui}/issue-36163.rs (100%) create mode 100644 src/test/ui/issue-36163.stderr rename src/test/{compile-fail => ui}/issue-36708.rs (100%) create mode 100644 src/test/ui/issue-36708.stderr rename src/test/{compile-fail => ui}/issue-3779.rs (100%) create mode 100644 src/test/ui/issue-3779.stderr rename src/test/{compile-fail => ui}/issue-37884.rs (100%) create mode 100644 src/test/ui/issue-37884.stderr rename src/test/{compile-fail => ui}/issue-4335.rs (100%) create mode 100644 src/test/ui/issue-4335.stderr rename src/test/{compile-fail => ui}/issue-4935.rs (100%) create mode 100644 src/test/ui/issue-4935.stderr rename src/test/{compile-fail => ui}/issue-5239-1.rs (100%) create mode 100644 src/test/ui/issue-5239-1.stderr rename src/test/{compile-fail => ui}/issue-6458-3.rs (100%) create mode 100644 src/test/ui/issue-6458-3.stderr rename src/test/{compile-fail => ui}/issue-6458-4.rs (100%) create mode 100644 src/test/ui/issue-6458-4.stderr rename src/test/{compile-fail => ui}/issue-6458.rs (100%) create mode 100644 src/test/ui/issue-6458.stderr rename src/test/{compile-fail => ui}/issue-7813.rs (100%) create mode 100644 src/test/ui/issue-7813.stderr rename src/test/{compile-fail => ui}/lifetime-elision-return-type-requires-explicit-lifetime.rs (100%) create mode 100644 src/test/ui/lifetime-elision-return-type-requires-explicit-lifetime.stderr rename src/test/{compile-fail => ui}/lint-forbid-attr.rs (100%) create mode 100644 src/test/ui/lint-forbid-attr.stderr rename src/test/{compile-fail => ui}/lint-output-format-2.rs (100%) create mode 100644 src/test/ui/lint-output-format-2.stderr rename src/test/{compile-fail => ui}/lint-unconditional-recursion.rs (100%) create mode 100644 src/test/ui/lint-unconditional-recursion.stderr rename src/test/{compile-fail => ui}/liveness-return-last-stmt-semi.rs (100%) create mode 100644 src/test/ui/liveness-return-last-stmt-semi.stderr rename src/test/{compile-fail => ui}/loops-reject-duplicate-labels-2.rs (100%) create mode 100644 src/test/ui/loops-reject-duplicate-labels-2.stderr rename src/test/{compile-fail => ui}/loops-reject-duplicate-labels.rs (100%) create mode 100644 src/test/ui/loops-reject-duplicate-labels.stderr rename src/test/{compile-fail => ui}/loops-reject-labels-shadowing-lifetimes.rs (100%) create mode 100644 src/test/ui/loops-reject-labels-shadowing-lifetimes.stderr rename src/test/{compile-fail => ui}/loops-reject-lifetime-shadowing-label.rs (100%) create mode 100644 src/test/ui/loops-reject-lifetime-shadowing-label.stderr rename src/test/{compile-fail => ui}/macro-context.rs (100%) create mode 100644 src/test/ui/macro-context.stderr rename src/test/{compile-fail => ui}/macro-invalid-fragment-spec.rs (100%) create mode 100644 src/test/ui/macro-invalid-fragment-spec.stderr rename src/test/{compile-fail => ui}/macro-shadowing.rs (100%) create mode 100644 src/test/ui/macro-shadowing.stderr rename src/test/{compile-fail => ui}/main-wrong-location.rs (100%) create mode 100644 src/test/ui/main-wrong-location.stderr rename src/test/{compile-fail => ui}/maybe-bounds.rs (100%) create mode 100644 src/test/ui/maybe-bounds.stderr rename src/test/{compile-fail => ui}/method-missing-call.rs (100%) create mode 100644 src/test/ui/method-missing-call.stderr rename src/test/{compile-fail => ui}/missing-block-hint.rs (94%) create mode 100644 src/test/ui/missing-block-hint.stderr rename src/test/{compile-fail => ui}/moves-based-on-type-block-bad.rs (100%) create mode 100644 src/test/ui/moves-based-on-type-block-bad.stderr rename src/test/{compile-fail => ui}/moves-based-on-type-match-bindings.rs (100%) create mode 100644 src/test/ui/moves-based-on-type-match-bindings.stderr rename src/test/{compile-fail => ui}/no-patterns-in-args.rs (100%) create mode 100644 src/test/ui/no-patterns-in-args.stderr rename src/test/{compile-fail => ui}/non-constant-expr-for-arr-len.rs (100%) create mode 100644 src/test/ui/non-constant-expr-for-arr-len.stderr rename src/test/{compile-fail => ui}/non-exhaustive-pattern-witness.rs (100%) create mode 100644 src/test/ui/non-exhaustive-pattern-witness.stderr rename src/test/{compile-fail => ui}/not-enough-arguments.rs (100%) create mode 100644 src/test/ui/not-enough-arguments.stderr rename src/test/{compile-fail => ui}/numeric-fields.rs (100%) create mode 100644 src/test/ui/numeric-fields.stderr rename src/test/{compile-fail => ui}/object-safety-associated-consts.rs (100%) create mode 100644 src/test/ui/object-safety-associated-consts.stderr rename src/test/{compile-fail => ui}/object-safety-generics.rs (100%) create mode 100644 src/test/ui/object-safety-generics.stderr rename src/test/{compile-fail => ui}/object-safety-mentions-Self.rs (100%) create mode 100644 src/test/ui/object-safety-mentions-Self.stderr rename src/test/{compile-fail => ui}/object-safety-sized.rs (100%) create mode 100644 src/test/ui/object-safety-sized.stderr rename src/test/{compile-fail => ui}/object-safety-supertrait-mentions-Self.rs (100%) create mode 100644 src/test/ui/object-safety-supertrait-mentions-Self.stderr rename src/test/{compile-fail => ui}/partialeq_help.rs (100%) create mode 100644 src/test/ui/partialeq_help.stderr rename src/test/{compile-fail => ui}/pat-slice-old-style.rs (100%) create mode 100644 src/test/ui/pat-slice-old-style.stderr rename src/test/{compile-fail => ui}/qualified-path-params-2.rs (100%) create mode 100644 src/test/ui/qualified-path-params-2.stderr rename src/test/{compile-fail => ui}/region-borrow-params-issue-29793-small.rs (100%) create mode 100644 src/test/ui/region-borrow-params-issue-29793-small.stderr rename src/test/{compile-fail => ui}/regions-nested-fns-2.rs (100%) create mode 100644 src/test/ui/regions-nested-fns-2.stderr rename src/test/{compile-fail => ui}/resolve-conflict-item-vs-import.rs (100%) create mode 100644 src/test/ui/resolve-conflict-item-vs-import.stderr rename src/test/{compile-fail => ui}/resolve-inconsistent-names.rs (100%) create mode 100644 src/test/ui/resolve-inconsistent-names.stderr rename src/test/{compile-fail => ui}/self-impl.rs (100%) create mode 100644 src/test/ui/self-impl.stderr rename src/test/{compile-fail => ui}/shadowed-lifetime.rs (100%) create mode 100644 src/test/ui/shadowed-lifetime.stderr rename src/test/{compile-fail => ui}/str-concat-on-double-ref.rs (100%) create mode 100644 src/test/ui/str-concat-on-double-ref.stderr rename src/test/{compile-fail => ui}/struct-fields-decl-dupe.rs (100%) create mode 100644 src/test/ui/struct-fields-decl-dupe.stderr rename src/test/{compile-fail => ui}/struct-fields-hints-no-dupe.rs (100%) create mode 100644 src/test/ui/struct-fields-hints-no-dupe.stderr rename src/test/{compile-fail => ui}/struct-fields-hints.rs (100%) create mode 100644 src/test/ui/struct-fields-hints.stderr rename src/test/{compile-fail => ui}/struct-fields-too-many.rs (100%) create mode 100644 src/test/ui/struct-fields-too-many.stderr rename src/test/{compile-fail => ui}/struct-path-self-type-mismatch.rs (100%) create mode 100644 src/test/ui/struct-path-self-type-mismatch.stderr rename src/test/{compile-fail => ui}/suggest-private-fields.rs (100%) create mode 100644 src/test/ui/suggest-private-fields.stderr rename src/test/{compile-fail => ui}/svh-change-lit.rs (100%) create mode 100644 src/test/ui/svh-change-lit.stderr rename src/test/{compile-fail => ui}/svh-change-significant-cfg.rs (100%) create mode 100644 src/test/ui/svh-change-significant-cfg.stderr rename src/test/{compile-fail => ui}/svh-change-trait-bound.rs (100%) create mode 100644 src/test/ui/svh-change-trait-bound.stderr rename src/test/{compile-fail => ui}/svh-change-type-arg.rs (100%) create mode 100644 src/test/ui/svh-change-type-arg.stderr rename src/test/{compile-fail => ui}/svh-change-type-ret.rs (100%) create mode 100644 src/test/ui/svh-change-type-ret.stderr rename src/test/{compile-fail => ui}/svh-change-type-static.rs (100%) create mode 100644 src/test/ui/svh-change-type-static.stderr rename src/test/{compile-fail => ui}/svh-use-trait.rs (100%) create mode 100644 src/test/ui/svh-use-trait.stderr rename src/test/{compile-fail => ui}/trait-duplicate-methods.rs (100%) create mode 100644 src/test/ui/trait-duplicate-methods.stderr rename src/test/{compile-fail => ui}/trait-safety-fn-body.rs (100%) create mode 100644 src/test/ui/trait-safety-fn-body.stderr rename src/test/{compile-fail => ui}/trait-suggest-where-clause.rs (100%) create mode 100644 src/test/ui/trait-suggest-where-clause.stderr rename src/test/{compile-fail => ui}/traits-multidispatch-convert-ambig-dest.rs (100%) create mode 100644 src/test/ui/traits-multidispatch-convert-ambig-dest.stderr rename src/test/{compile-fail => ui}/type-recursive.rs (100%) create mode 100644 src/test/ui/type-recursive.stderr rename src/test/{compile-fail => ui}/typeck-builtin-bound-type-parameters.rs (100%) create mode 100644 src/test/ui/typeck-builtin-bound-type-parameters.stderr rename src/test/{compile-fail => ui}/typeck-default-trait-impl-outside-crate.rs (100%) create mode 100644 src/test/ui/typeck-default-trait-impl-outside-crate.stderr rename src/test/{compile-fail => ui}/typeck_type_placeholder_item.rs (100%) create mode 100644 src/test/ui/typeck_type_placeholder_item.stderr rename src/test/{compile-fail => ui}/typeck_type_placeholder_lifetime_1.rs (100%) create mode 100644 src/test/ui/typeck_type_placeholder_lifetime_1.stderr rename src/test/{compile-fail => ui}/typeck_type_placeholder_lifetime_2.rs (100%) create mode 100644 src/test/ui/typeck_type_placeholder_lifetime_2.stderr rename src/test/{compile-fail => ui}/unboxed-closure-sugar-wrong-trait.rs (100%) create mode 100644 src/test/ui/unboxed-closure-sugar-wrong-trait.stderr rename src/test/{compile-fail => ui}/unconstrained-none.rs (100%) create mode 100644 src/test/ui/unconstrained-none.stderr rename src/test/{compile-fail => ui}/unconstrained-ref.rs (100%) create mode 100644 src/test/ui/unconstrained-ref.stderr rename src/test/{compile-fail => ui}/union/union-const-eval.rs (100%) create mode 100644 src/test/ui/union/union-const-eval.stderr rename src/test/{compile-fail => ui}/union/union-derive-eq.rs (100%) create mode 100644 src/test/ui/union/union-derive-eq.stderr rename src/test/ui/{union-fields.rs => union/union-fields-1.rs} (100%) rename src/test/ui/{union-fields.stderr => union/union-fields-1.stderr} (76%) rename src/test/{compile-fail/union/union-fields.rs => ui/union/union-fields-2.rs} (100%) create mode 100644 src/test/ui/union/union-fields-2.stderr rename src/test/ui/{ => union}/union-sized-field.rs (100%) rename src/test/ui/{ => union}/union-sized-field.stderr (100%) rename src/test/{compile-fail => ui}/union/union-suggest-field.rs (100%) create mode 100644 src/test/ui/union/union-suggest-field.stderr rename src/test/{compile-fail => ui}/unsafe-const-fn.rs (100%) create mode 100644 src/test/ui/unsafe-const-fn.stderr rename src/test/{compile-fail => ui}/unsized-enum2.rs (100%) create mode 100644 src/test/ui/unsized-enum2.stderr rename src/test/{compile-fail => ui}/use-mod.rs (100%) create mode 100644 src/test/ui/use-mod.stderr rename src/test/{compile-fail => ui}/variadic-ffi-3.rs (100%) create mode 100644 src/test/ui/variadic-ffi-3.stderr rename src/test/{compile-fail => ui}/variance-unused-type-param.rs (100%) create mode 100644 src/test/ui/variance-unused-type-param.stderr rename src/test/{compile-fail => ui}/vector-no-ann.rs (100%) create mode 100644 src/test/ui/vector-no-ann.stderr diff --git a/src/test/compile-fail/arbitrary-self-types-not-object-safe.rs b/src/test/ui/arbitrary-self-types-not-object-safe.rs similarity index 100% rename from src/test/compile-fail/arbitrary-self-types-not-object-safe.rs rename to src/test/ui/arbitrary-self-types-not-object-safe.rs diff --git a/src/test/ui/arbitrary-self-types-not-object-safe.stderr b/src/test/ui/arbitrary-self-types-not-object-safe.stderr new file mode 100644 index 0000000000000..a1090fe031eb9 --- /dev/null +++ b/src/test/ui/arbitrary-self-types-not-object-safe.stderr @@ -0,0 +1,19 @@ +error[E0038]: the trait `Foo` cannot be made into an object + --> $DIR/arbitrary-self-types-not-object-safe.rs:40:33 + | +40 | let x = Box::new(5usize) as Box; + | ^^^^^^^^ the trait `Foo` cannot be made into an object + | + = note: method `foo` has a non-standard `self` type. Only `&self`, `&mut self`, and `Box` are currently supported for trait objects + +error[E0038]: the trait `Foo` cannot be made into an object + --> $DIR/arbitrary-self-types-not-object-safe.rs:40:13 + | +40 | let x = Box::new(5usize) as Box; + | ^^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object + | + = note: method `foo` has a non-standard `self` type. Only `&self`, `&mut self`, and `Box` are currently supported for trait objects + = note: required because of the requirements on the impl of `std::ops::CoerceUnsized>` for `std::boxed::Box` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/asm-out-assign-imm.rs b/src/test/ui/asm-out-assign-imm.rs similarity index 100% rename from src/test/compile-fail/asm-out-assign-imm.rs rename to src/test/ui/asm-out-assign-imm.rs diff --git a/src/test/ui/asm-out-assign-imm.stderr b/src/test/ui/asm-out-assign-imm.stderr new file mode 100644 index 0000000000000..642eb36e4cb36 --- /dev/null +++ b/src/test/ui/asm-out-assign-imm.stderr @@ -0,0 +1,11 @@ +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/asm-out-assign-imm.rs:29:9 + | +26 | x = 1; //~ NOTE first assignment + | ----- first assignment to `x` +... +29 | asm!("mov $1, $0" : "=r"(x) : "r"(5)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + diff --git a/src/test/compile-fail/associated-const-impl-wrong-lifetime.rs b/src/test/ui/associated-const-impl-wrong-lifetime.rs similarity index 100% rename from src/test/compile-fail/associated-const-impl-wrong-lifetime.rs rename to src/test/ui/associated-const-impl-wrong-lifetime.rs diff --git a/src/test/ui/associated-const-impl-wrong-lifetime.stderr b/src/test/ui/associated-const-impl-wrong-lifetime.stderr new file mode 100644 index 0000000000000..7768d734bdb9a --- /dev/null +++ b/src/test/ui/associated-const-impl-wrong-lifetime.stderr @@ -0,0 +1,23 @@ +error[E0308]: mismatched types + --> $DIR/associated-const-impl-wrong-lifetime.rs:19:5 + | +19 | const NAME: &'a str = "unit"; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `&'static str` + found type `&'a str` +note: the lifetime 'a as defined on the impl at 17:1... + --> $DIR/associated-const-impl-wrong-lifetime.rs:17:1 + | +17 | / impl<'a> Foo for &'a () { +18 | | //~^ NOTE the lifetime 'a as defined +19 | | const NAME: &'a str = "unit"; +20 | | //~^ ERROR mismatched types [E0308] +... | +23 | | //~| NOTE ...does not necessarily outlive the static lifetime +24 | | } + | |_^ + = note: ...does not necessarily outlive the static lifetime + +error: aborting due to previous error + diff --git a/src/test/compile-fail/associated-const-impl-wrong-type.rs b/src/test/ui/associated-const-impl-wrong-type.rs similarity index 100% rename from src/test/compile-fail/associated-const-impl-wrong-type.rs rename to src/test/ui/associated-const-impl-wrong-type.rs diff --git a/src/test/ui/associated-const-impl-wrong-type.stderr b/src/test/ui/associated-const-impl-wrong-type.stderr new file mode 100644 index 0000000000000..6ac734bb775d8 --- /dev/null +++ b/src/test/ui/associated-const-impl-wrong-type.stderr @@ -0,0 +1,11 @@ +error[E0326]: implemented const `BAR` has an incompatible type for trait + --> $DIR/associated-const-impl-wrong-type.rs:19:16 + | +13 | const BAR: u32; //~ NOTE type in trait + | --- type in trait +... +19 | const BAR: i32 = -1; + | ^^^ expected u32, found i32 + +error: aborting due to previous error + diff --git a/src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs b/src/test/ui/associated-type-projection-from-multiple-supertraits.rs similarity index 100% rename from src/test/compile-fail/associated-type-projection-from-multiple-supertraits.rs rename to src/test/ui/associated-type-projection-from-multiple-supertraits.rs diff --git a/src/test/ui/associated-type-projection-from-multiple-supertraits.stderr b/src/test/ui/associated-type-projection-from-multiple-supertraits.stderr new file mode 100644 index 0000000000000..bc2b8193c8589 --- /dev/null +++ b/src/test/ui/associated-type-projection-from-multiple-supertraits.stderr @@ -0,0 +1,44 @@ +error[E0221]: ambiguous associated type `Color` in bounds of `C` + --> $DIR/associated-type-projection-from-multiple-supertraits.rs:35:32 + | +15 | type Color; + | ----------- ambiguous `Color` from `Vehicle` +... +24 | type Color; + | ----------- ambiguous `Color` from `Box` +... +35 | fn dent(c: C, color: C::Color) { + | ^^^^^^^^ ambiguous associated type `Color` + +error[E0221]: ambiguous associated type `Color` in bounds of `BoxCar` + --> $DIR/associated-type-projection-from-multiple-supertraits.rs:40:33 + | +15 | type Color; + | ----------- ambiguous `Color` from `Vehicle` +... +24 | type Color; + | ----------- ambiguous `Color` from `Box` +... +40 | fn dent_object(c: BoxCar) { + | ^^^^^^^^^^^ ambiguous associated type `Color` + +error[E0191]: the value of the associated type `Color` (from the trait `Vehicle`) must be specified + --> $DIR/associated-type-projection-from-multiple-supertraits.rs:40:26 + | +40 | fn dent_object(c: BoxCar) { + | ^^^^^^^^^^^^^^^^^^^ missing associated type `Color` value + +error[E0221]: ambiguous associated type `Color` in bounds of `C` + --> $DIR/associated-type-projection-from-multiple-supertraits.rs:47:29 + | +15 | type Color; + | ----------- ambiguous `Color` from `Vehicle` +... +24 | type Color; + | ----------- ambiguous `Color` from `Box` +... +47 | fn paint(c: C, d: C::Color) { + | ^^^^^^^^ ambiguous associated type `Color` + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs b/src/test/ui/associated-types-ICE-when-projecting-out-of-err.rs similarity index 100% rename from src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs rename to src/test/ui/associated-types-ICE-when-projecting-out-of-err.rs diff --git a/src/test/ui/associated-types-ICE-when-projecting-out-of-err.stderr b/src/test/ui/associated-types-ICE-when-projecting-out-of-err.stderr new file mode 100644 index 0000000000000..1a49cc7a283bb --- /dev/null +++ b/src/test/ui/associated-types-ICE-when-projecting-out-of-err.stderr @@ -0,0 +1,8 @@ +error[E0277]: the trait bound `(): Add` is not satisfied + --> $DIR/associated-types-ICE-when-projecting-out-of-err.rs:33:11 + | +33 | r = r + a; + | ^ the trait `Add` is not implemented for `()` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/associated-types-in-ambiguous-context.rs b/src/test/ui/associated-types-in-ambiguous-context.rs similarity index 100% rename from src/test/compile-fail/associated-types-in-ambiguous-context.rs rename to src/test/ui/associated-types-in-ambiguous-context.rs diff --git a/src/test/ui/associated-types-in-ambiguous-context.stderr b/src/test/ui/associated-types-in-ambiguous-context.stderr new file mode 100644 index 0000000000000..a568d104acdd2 --- /dev/null +++ b/src/test/ui/associated-types-in-ambiguous-context.stderr @@ -0,0 +1,26 @@ +error[E0223]: ambiguous associated type + --> $DIR/associated-types-in-ambiguous-context.rs:16:36 + | +16 | fn get(x: T, y: U) -> Get::Value {} + | ^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `::Value` + +error[E0223]: ambiguous associated type + --> $DIR/associated-types-in-ambiguous-context.rs:29:10 + | +29 | type X = std::ops::Deref::Target; + | ^^^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `::Target` + +error[E0223]: ambiguous associated type + --> $DIR/associated-types-in-ambiguous-context.rs:23:23 + | +23 | fn grab(&self) -> Grab::Value; + | ^^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `::Value` + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/augmented-assignments.rs b/src/test/ui/augmented-assignments.rs similarity index 100% rename from src/test/compile-fail/augmented-assignments.rs rename to src/test/ui/augmented-assignments.rs diff --git a/src/test/ui/augmented-assignments.stderr b/src/test/ui/augmented-assignments.stderr new file mode 100644 index 0000000000000..dcc14ea8fdf66 --- /dev/null +++ b/src/test/ui/augmented-assignments.stderr @@ -0,0 +1,22 @@ +error[E0596]: cannot borrow immutable local variable `y` as mutable + --> $DIR/augmented-assignments.rs:31:5 + | +29 | let y = Int(2); + | - consider changing this to `mut y` +30 | //~^ consider changing this to `mut y` +31 | y //~ error: cannot borrow immutable local variable `y` as mutable + | ^ cannot borrow mutably + +error[E0382]: use of moved value: `x` + --> $DIR/augmented-assignments.rs:23:5 + | +23 | x //~ error: use of moved value: `x` + | ^ value used here after move +... +27 | x; //~ value moved here + | - value moved here + | + = note: move occurs because `x` has type `Int`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/auxiliary/changing-crates-a1.rs b/src/test/ui/auxiliary/changing-crates-a1.rs similarity index 100% rename from src/test/compile-fail/auxiliary/changing-crates-a1.rs rename to src/test/ui/auxiliary/changing-crates-a1.rs diff --git a/src/test/compile-fail/auxiliary/changing-crates-a2.rs b/src/test/ui/auxiliary/changing-crates-a2.rs similarity index 100% rename from src/test/compile-fail/auxiliary/changing-crates-a2.rs rename to src/test/ui/auxiliary/changing-crates-a2.rs diff --git a/src/test/compile-fail/auxiliary/changing-crates-b.rs b/src/test/ui/auxiliary/changing-crates-b.rs similarity index 100% rename from src/test/compile-fail/auxiliary/changing-crates-b.rs rename to src/test/ui/auxiliary/changing-crates-b.rs diff --git a/src/test/ui/auxiliary/coherence_lib.rs b/src/test/ui/auxiliary/coherence_lib.rs new file mode 100644 index 0000000000000..daa123849e4e7 --- /dev/null +++ b/src/test/ui/auxiliary/coherence_lib.rs @@ -0,0 +1,25 @@ +// Copyright 2012 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. + +#![crate_type="lib"] + +pub trait Remote { + fn foo(&self) { } +} + +pub trait Remote1 { + fn foo(&self, t: T) { } +} + +pub trait Remote2 { + fn foo(&self, t: T, u: U) { } +} + +pub struct Pair(T,U); diff --git a/src/test/ui/auxiliary/empty-struct.rs b/src/test/ui/auxiliary/empty-struct.rs new file mode 100644 index 0000000000000..4a30286563422 --- /dev/null +++ b/src/test/ui/auxiliary/empty-struct.rs @@ -0,0 +1,19 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub struct XEmpty1 {} +pub struct XEmpty2; +pub struct XEmpty6(); + +pub enum XE { + XEmpty3 {}, + XEmpty4, + XEmpty5(), +} diff --git a/src/test/compile-fail/auxiliary/issue-36708.rs b/src/test/ui/auxiliary/issue-36708.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue-36708.rs rename to src/test/ui/auxiliary/issue-36708.rs diff --git a/src/test/ui/auxiliary/lint_output_format.rs b/src/test/ui/auxiliary/lint_output_format.rs new file mode 100644 index 0000000000000..0553b4a49b7ae --- /dev/null +++ b/src/test/ui/auxiliary/lint_output_format.rs @@ -0,0 +1,30 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_name="lint_output_format"] +#![crate_type = "lib"] +#![feature(staged_api)] +#![unstable(feature = "test_feature", issue = "0")] + +#[stable(feature = "test_feature", since = "1.0.0")] +#[rustc_deprecated(since = "1.0.0", reason = "text")] +pub fn foo() -> usize { + 20 +} + +#[unstable(feature = "test_feature", issue = "0")] +pub fn bar() -> usize { + 40 +} + +#[unstable(feature = "test_feature", issue = "0")] +pub fn baz() -> usize { + 30 +} diff --git a/src/test/ui/auxiliary/struct_field_privacy.rs b/src/test/ui/auxiliary/struct_field_privacy.rs new file mode 100644 index 0000000000000..5fea97da03ee3 --- /dev/null +++ b/src/test/ui/auxiliary/struct_field_privacy.rs @@ -0,0 +1,19 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub struct A { + a: isize, + pub b: isize, +} + +pub struct B { + pub a: isize, + b: isize, +} diff --git a/src/test/compile-fail/auxiliary/svh-a-base.rs b/src/test/ui/auxiliary/svh-a-base.rs similarity index 100% rename from src/test/compile-fail/auxiliary/svh-a-base.rs rename to src/test/ui/auxiliary/svh-a-base.rs diff --git a/src/test/compile-fail/auxiliary/svh-a-change-lit.rs b/src/test/ui/auxiliary/svh-a-change-lit.rs similarity index 100% rename from src/test/compile-fail/auxiliary/svh-a-change-lit.rs rename to src/test/ui/auxiliary/svh-a-change-lit.rs diff --git a/src/test/compile-fail/auxiliary/svh-a-change-significant-cfg.rs b/src/test/ui/auxiliary/svh-a-change-significant-cfg.rs similarity index 100% rename from src/test/compile-fail/auxiliary/svh-a-change-significant-cfg.rs rename to src/test/ui/auxiliary/svh-a-change-significant-cfg.rs diff --git a/src/test/compile-fail/auxiliary/svh-a-change-trait-bound.rs b/src/test/ui/auxiliary/svh-a-change-trait-bound.rs similarity index 100% rename from src/test/compile-fail/auxiliary/svh-a-change-trait-bound.rs rename to src/test/ui/auxiliary/svh-a-change-trait-bound.rs diff --git a/src/test/compile-fail/auxiliary/svh-a-change-type-arg.rs b/src/test/ui/auxiliary/svh-a-change-type-arg.rs similarity index 100% rename from src/test/compile-fail/auxiliary/svh-a-change-type-arg.rs rename to src/test/ui/auxiliary/svh-a-change-type-arg.rs diff --git a/src/test/compile-fail/auxiliary/svh-a-change-type-ret.rs b/src/test/ui/auxiliary/svh-a-change-type-ret.rs similarity index 100% rename from src/test/compile-fail/auxiliary/svh-a-change-type-ret.rs rename to src/test/ui/auxiliary/svh-a-change-type-ret.rs diff --git a/src/test/compile-fail/auxiliary/svh-a-change-type-static.rs b/src/test/ui/auxiliary/svh-a-change-type-static.rs similarity index 100% rename from src/test/compile-fail/auxiliary/svh-a-change-type-static.rs rename to src/test/ui/auxiliary/svh-a-change-type-static.rs diff --git a/src/test/compile-fail/auxiliary/svh-b.rs b/src/test/ui/auxiliary/svh-b.rs similarity index 100% rename from src/test/compile-fail/auxiliary/svh-b.rs rename to src/test/ui/auxiliary/svh-b.rs diff --git a/src/test/compile-fail/auxiliary/svh-uta-base.rs b/src/test/ui/auxiliary/svh-uta-base.rs similarity index 100% rename from src/test/compile-fail/auxiliary/svh-uta-base.rs rename to src/test/ui/auxiliary/svh-uta-base.rs diff --git a/src/test/compile-fail/auxiliary/svh-uta-change-use-trait.rs b/src/test/ui/auxiliary/svh-uta-change-use-trait.rs similarity index 100% rename from src/test/compile-fail/auxiliary/svh-uta-change-use-trait.rs rename to src/test/ui/auxiliary/svh-uta-change-use-trait.rs diff --git a/src/test/compile-fail/auxiliary/svh-utb.rs b/src/test/ui/auxiliary/svh-utb.rs similarity index 100% rename from src/test/compile-fail/auxiliary/svh-utb.rs rename to src/test/ui/auxiliary/svh-utb.rs diff --git a/src/test/ui/auxiliary/two_macros.rs b/src/test/ui/auxiliary/two_macros.rs new file mode 100644 index 0000000000000..060960f0dbc88 --- /dev/null +++ b/src/test/ui/auxiliary/two_macros.rs @@ -0,0 +1,15 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[macro_export] +macro_rules! macro_one { () => ("one") } + +#[macro_export] +macro_rules! macro_two { () => ("two") } diff --git a/src/test/compile-fail/binary-op-on-double-ref.rs b/src/test/ui/binary-op-on-double-ref.rs similarity index 100% rename from src/test/compile-fail/binary-op-on-double-ref.rs rename to src/test/ui/binary-op-on-double-ref.rs diff --git a/src/test/ui/binary-op-on-double-ref.stderr b/src/test/ui/binary-op-on-double-ref.stderr new file mode 100644 index 0000000000000..4a2490bac91ab --- /dev/null +++ b/src/test/ui/binary-op-on-double-ref.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `%` cannot be applied to type `&&{integer}` + --> $DIR/binary-op-on-double-ref.rs:14:9 + | +14 | x % 2 == 0 + | ^^^^^ + | + = note: this is a reference to a type that `%` can be applied to; you need to dereference this variable once for this operation to work + = note: an implementation of `std::ops::Rem` might be missing for `&&{integer}` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/blind-item-item-shadow.rs b/src/test/ui/blind-item-item-shadow.rs similarity index 100% rename from src/test/compile-fail/blind-item-item-shadow.rs rename to src/test/ui/blind-item-item-shadow.rs diff --git a/src/test/ui/blind-item-item-shadow.stderr b/src/test/ui/blind-item-item-shadow.stderr new file mode 100644 index 0000000000000..5eab628245084 --- /dev/null +++ b/src/test/ui/blind-item-item-shadow.stderr @@ -0,0 +1,17 @@ +error[E0255]: the name `foo` is defined multiple times + --> $DIR/blind-item-item-shadow.rs:13:5 + | +11 | mod foo { pub mod foo { } } //~ NOTE previous definition of the module `foo` here + | ---------------------------- previous definition of the module `foo` here +12 | +13 | use foo::foo; + | ^^^^^^^^ `foo` reimported here + | + = note: `foo` 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 + | +13 | use foo::foo as Otherfoo; + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/bogus-tag.rs b/src/test/ui/bogus-tag.rs similarity index 100% rename from src/test/compile-fail/bogus-tag.rs rename to src/test/ui/bogus-tag.rs diff --git a/src/test/ui/bogus-tag.stderr b/src/test/ui/bogus-tag.stderr new file mode 100644 index 0000000000000..66e7d62855112 --- /dev/null +++ b/src/test/ui/bogus-tag.stderr @@ -0,0 +1,11 @@ +error[E0599]: no variant named `hsl` found for type `color` in the current scope + --> $DIR/bogus-tag.rs:19:7 + | +12 | enum color { rgb(isize, isize, isize), rgba(isize, isize, isize, isize), } + | ---------- variant `hsl` not found here +... +19 | color::hsl(h, s, l) => { println!("hsl"); } + | ^^^^^^^^^^^^^^^^^^^ variant not found in `color` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/borrowck/borrowck-box-insensitivity.rs b/src/test/ui/borrowck/borrowck-box-insensitivity.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-box-insensitivity.rs rename to src/test/ui/borrowck/borrowck-box-insensitivity.rs diff --git a/src/test/ui/borrowck/borrowck-box-insensitivity.stderr b/src/test/ui/borrowck/borrowck-box-insensitivity.stderr new file mode 100644 index 0000000000000..120a3f9c3abd1 --- /dev/null +++ b/src/test/ui/borrowck/borrowck-box-insensitivity.stderr @@ -0,0 +1,170 @@ +error[E0382]: use of moved value: `a` + --> $DIR/borrowck-box-insensitivity.rs:37:9 + | +35 | let _x = a.x; + | -- value moved here +36 | //~^ value moved here +37 | let _y = a.y; //~ ERROR use of moved + | ^^ value used here after move + | + = note: move occurs because `a.x` has type `std::boxed::Box`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `a` + --> $DIR/borrowck-box-insensitivity.rs:46:9 + | +44 | let _x = a.x; + | -- value moved here +45 | //~^ value moved here +46 | let _y = a.y; //~ ERROR use of moved + | ^^ value used here after move + | + = note: move occurs because `a.x` has type `std::boxed::Box`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `a` + --> $DIR/borrowck-box-insensitivity.rs:55:15 + | +53 | let _x = a.x; + | -- value moved here +54 | //~^ value moved here +55 | let _y = &a.y; //~ ERROR use of moved + | ^^^ value used here after move + | + = note: move occurs because `a.x` has type `std::boxed::Box`, which does not implement the `Copy` trait + +error[E0505]: cannot move out of `a.y` because it is borrowed + --> $DIR/borrowck-box-insensitivity.rs:64:9 + | +62 | let _x = &a.x; + | --- borrow of `a.x` occurs here +63 | //~^ NOTE borrow of `a.x` occurs here +64 | let _y = a.y; + | ^^ move out of `a.y` occurs here + +error[E0503]: cannot use `a.y` because it was mutably borrowed + --> $DIR/borrowck-box-insensitivity.rs:73:9 + | +71 | let _x = &mut a.x; + | --- borrow of `a.x` occurs here +72 | //~^ NOTE borrow of `a.x` occurs here +73 | let _y = a.y; //~ ERROR cannot use + | ^^ use of borrowed `a.x` + +error[E0505]: cannot move out of `a.y` because it is borrowed + --> $DIR/borrowck-box-insensitivity.rs:81:9 + | +79 | let _x = &mut a.x; + | --- borrow of `a.x` occurs here +80 | //~^ NOTE borrow of `a.x` occurs here +81 | let _y = a.y; + | ^^ move out of `a.y` occurs here + +error[E0502]: cannot borrow `a` (via `a.y`) as immutable because `a` is also borrowed as mutable (via `a.x`) + --> $DIR/borrowck-box-insensitivity.rs:90:15 + | +88 | let _x = &mut a.x; + | --- mutable borrow occurs here (via `a.x`) +89 | //~^ NOTE mutable borrow occurs here (via `a.x`) +90 | let _y = &a.y; //~ ERROR cannot borrow + | ^^^ immutable borrow occurs here (via `a.y`) +91 | //~^ immutable borrow occurs here (via `a.y`) +92 | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `a` (via `a.y`) as mutable because `a` is also borrowed as immutable (via `a.x`) + --> $DIR/borrowck-box-insensitivity.rs:99:19 + | +97 | let _x = &a.x; + | --- immutable borrow occurs here (via `a.x`) +98 | //~^ NOTE immutable borrow occurs here (via `a.x`) +99 | let _y = &mut a.y; //~ ERROR cannot borrow + | ^^^ mutable borrow occurs here (via `a.y`) +100 | //~^ mutable borrow occurs here (via `a.y`) +101 | } + | - immutable borrow ends here + +error[E0382]: use of collaterally moved value: `a.y` + --> $DIR/borrowck-box-insensitivity.rs:108:9 + | +106 | let _x = a.x.x; + | -- value moved here +107 | //~^ value moved here +108 | let _y = a.y; //~ ERROR use of collaterally moved + | ^^ value used here after move + | + = note: move occurs because `a.x.x` has type `std::boxed::Box`, which does not implement the `Copy` trait + +error[E0382]: use of collaterally moved value: `a.y` + --> $DIR/borrowck-box-insensitivity.rs:117:9 + | +115 | let _x = a.x.x; + | -- value moved here +116 | //~^ value moved here +117 | let _y = a.y; //~ ERROR use of collaterally moved + | ^^ value used here after move + | + = note: move occurs because `a.x.x` has type `std::boxed::Box`, which does not implement the `Copy` trait + +error[E0382]: use of collaterally moved value: `a.y` + --> $DIR/borrowck-box-insensitivity.rs:126:15 + | +124 | let _x = a.x.x; + | -- value moved here +125 | //~^ value moved here +126 | let _y = &a.y; //~ ERROR use of collaterally moved + | ^^^ value used here after move + | + = note: move occurs because `a.x.x` has type `std::boxed::Box`, which does not implement the `Copy` trait + +error[E0505]: cannot move out of `a.y` because it is borrowed + --> $DIR/borrowck-box-insensitivity.rs:135:9 + | +133 | let _x = &a.x.x; + | ----- borrow of `a.x.x` occurs here +134 | //~^ borrow of `a.x.x` occurs here +135 | let _y = a.y; + | ^^ move out of `a.y` occurs here + +error[E0503]: cannot use `a.y` because it was mutably borrowed + --> $DIR/borrowck-box-insensitivity.rs:144:9 + | +142 | let _x = &mut a.x.x; + | ----- borrow of `a.x.x` occurs here +143 | //~^ NOTE borrow of `a.x.x` occurs here +144 | let _y = a.y; //~ ERROR cannot use + | ^^ use of borrowed `a.x.x` + +error[E0505]: cannot move out of `a.y` because it is borrowed + --> $DIR/borrowck-box-insensitivity.rs:152:9 + | +150 | let _x = &mut a.x.x; + | ----- borrow of `a.x.x` occurs here +151 | //~^ NOTE borrow of `a.x.x` occurs here +152 | let _y = a.y; + | ^^ move out of `a.y` occurs here + +error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed as mutable + --> $DIR/borrowck-box-insensitivity.rs:161:15 + | +159 | let _x = &mut a.x.x; + | ----- mutable borrow occurs here +160 | //~^ mutable borrow occurs here +161 | let _y = &a.y; //~ ERROR cannot borrow + | ^^^ immutable borrow occurs here +162 | //~^ immutable borrow occurs here +163 | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as immutable + --> $DIR/borrowck-box-insensitivity.rs:170:19 + | +168 | let _x = &a.x.x; + | ----- immutable borrow occurs here +169 | //~^ immutable borrow occurs here +170 | let _y = &mut a.y; //~ ERROR cannot borrow + | ^^^ mutable borrow occurs here +171 | //~^ mutable borrow occurs here +172 | } + | - immutable borrow ends here + +error: aborting due to 16 previous errors + diff --git a/src/test/compile-fail/borrowck/borrowck-escaping-closure-error-1.rs b/src/test/ui/borrowck/borrowck-escaping-closure-error-1.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-escaping-closure-error-1.rs rename to src/test/ui/borrowck/borrowck-escaping-closure-error-1.rs diff --git a/src/test/ui/borrowck/borrowck-escaping-closure-error-1.stderr b/src/test/ui/borrowck/borrowck-escaping-closure-error-1.stderr new file mode 100644 index 0000000000000..cc0bd15c489ea --- /dev/null +++ b/src/test/ui/borrowck/borrowck-escaping-closure-error-1.stderr @@ -0,0 +1,14 @@ +error[E0373]: closure may outlive the current function, but it borrows `books`, which is owned by the current function + --> $DIR/borrowck-escaping-closure-error-1.rs:23:11 + | +23 | spawn(|| books.push(4)); + | ^^ ----- `books` is borrowed here + | | + | may outlive borrowed value `books` +help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword + | +23 | spawn(move || books.push(4)); + | ^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/borrowck/borrowck-escaping-closure-error-2.rs b/src/test/ui/borrowck/borrowck-escaping-closure-error-2.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-escaping-closure-error-2.rs rename to src/test/ui/borrowck/borrowck-escaping-closure-error-2.rs diff --git a/src/test/ui/borrowck/borrowck-escaping-closure-error-2.stderr b/src/test/ui/borrowck/borrowck-escaping-closure-error-2.stderr new file mode 100644 index 0000000000000..f8963c175c8ab --- /dev/null +++ b/src/test/ui/borrowck/borrowck-escaping-closure-error-2.stderr @@ -0,0 +1,14 @@ +error[E0373]: closure may outlive the current function, but it borrows `books`, which is owned by the current function + --> $DIR/borrowck-escaping-closure-error-2.rs:21:14 + | +21 | Box::new(|| books.push(4)) + | ^^ ----- `books` is borrowed here + | | + | may outlive borrowed value `books` +help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword + | +21 | Box::new(move || books.push(4)) + | ^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/borrowck/borrowck-move-error-with-note.rs b/src/test/ui/borrowck/borrowck-move-error-with-note.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-error-with-note.rs rename to src/test/ui/borrowck/borrowck-move-error-with-note.rs diff --git a/src/test/ui/borrowck/borrowck-move-error-with-note.stderr b/src/test/ui/borrowck/borrowck-move-error-with-note.stderr new file mode 100644 index 0000000000000..2742899e78a0e --- /dev/null +++ b/src/test/ui/borrowck/borrowck-move-error-with-note.stderr @@ -0,0 +1,36 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-error-with-note.rs:21:11 + | +21 | match *f { //~ ERROR cannot move out of + | ^^ cannot move out of borrowed content +22 | //~| cannot move out +23 | Foo::Foo1(num1, //~ NOTE to prevent move + | ---- hint: to prevent move, use `ref num1` or `ref mut num1` +24 | num2) => (), //~ NOTE and here + | ---- ...and here (use `ref num2` or `ref mut num2`) +25 | Foo::Foo2(num) => (), //~ NOTE and here + | --- ...and here (use `ref num` or `ref mut num`) + +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-error-with-note.rs:40:9 + | +40 | / S { //~ ERROR cannot move out of type `S`, which implements the `Drop` trait +41 | | //~| cannot move out of here +42 | | f: _s, //~ NOTE to prevent move + | | -- hint: to prevent move, use `ref _s` or `ref mut _s` +43 | | g: _t //~ NOTE and here + | | -- ...and here (use `ref _t` or `ref mut _t`) +44 | | } => {} + | |_________^ cannot move out of here + +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-error-with-note.rs:57:11 + | +57 | match a.a { //~ ERROR cannot move out of + | ^ cannot move out of borrowed content +58 | //~| cannot move out +59 | n => { //~ NOTE to prevent move + | - hint: to prevent move, use `ref n` or `ref mut n` + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/borrowck/borrowck-move-out-of-vec-tail.rs b/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-out-of-vec-tail.rs rename to src/test/ui/borrowck/borrowck-move-out-of-vec-tail.rs diff --git a/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr b/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr new file mode 100644 index 0000000000000..f99bbb20ccdf1 --- /dev/null +++ b/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr @@ -0,0 +1,17 @@ +error[E0508]: cannot move out of type `[Foo]`, a non-copy slice + --> $DIR/borrowck-move-out-of-vec-tail.rs:30:18 + | +30 | &[Foo { string: a }, + | ^ - hint: to prevent move, use `ref a` or `ref mut a` + | __________________| + | | +31 | | //~^ ERROR cannot move out of type `[Foo]` +32 | | //~| cannot move out +33 | | //~| to prevent move +34 | | Foo { string: b }] => { + | |_________________________________-__^ cannot move out of here + | | + | ...and here (use `ref b` or `ref mut b`) + +error: aborting due to previous error + diff --git a/src/test/compile-fail/borrowck/borrowck-report-with-custom-diagnostic.rs b/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-report-with-custom-diagnostic.rs rename to src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.rs diff --git a/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr b/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr new file mode 100644 index 0000000000000..107cd38adfeb8 --- /dev/null +++ b/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr @@ -0,0 +1,38 @@ +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-report-with-custom-diagnostic.rs:17:14 + | +15 | let y = &mut x; + | - mutable borrow occurs here +16 | //~^ mutable borrow occurs here +17 | let z = &x; //~ ERROR cannot borrow + | ^ immutable borrow occurs here +18 | //~^ immutable borrow occurs here +19 | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-report-with-custom-diagnostic.rs:29:26 + | +27 | let y = &x; + | - immutable borrow occurs here +28 | //~^ immutable borrow occurs here +29 | let z = &mut x; //~ ERROR cannot borrow + | ^ mutable borrow occurs here +30 | //~^ mutable borrow occurs here +31 | } + | - immutable borrow ends here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-report-with-custom-diagnostic.rs:43:22 + | +41 | let y = &mut x; + | - first mutable borrow occurs here +42 | //~^ first mutable borrow occurs here +43 | let z = &mut x; //~ ERROR cannot borrow + | ^ second mutable borrow occurs here +44 | //~^ second mutable borrow occurs here +45 | }; + | - first borrow ends here + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/borrowck/borrowck-vec-pattern-nesting.rs b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-vec-pattern-nesting.rs rename to src/test/ui/borrowck/borrowck-vec-pattern-nesting.rs diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr new file mode 100644 index 0000000000000..6b099d28fb101 --- /dev/null +++ b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr @@ -0,0 +1,82 @@ +error[E0506]: cannot assign to `vec[..]` because it is borrowed + --> $DIR/borrowck-vec-pattern-nesting.rs:21:13 + | +19 | [box ref _a, _, _] => { + | ------ borrow of `vec[..]` occurs here +20 | //~^ borrow of `vec[..]` occurs here +21 | vec[0] = box 4; //~ ERROR cannot assign + | ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here + +error[E0506]: cannot assign to `vec[..]` because it is borrowed + --> $DIR/borrowck-vec-pattern-nesting.rs:33:13 + | +31 | &mut [ref _b..] => { + | ------ borrow of `vec[..]` occurs here +32 | //~^ borrow of `vec[..]` occurs here +33 | vec[0] = box 4; //~ ERROR cannot assign + | ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here + +error[E0508]: cannot move out of type `[std::boxed::Box]`, a non-copy slice + --> $DIR/borrowck-vec-pattern-nesting.rs:43:14 + | +43 | &mut [_a, //~ ERROR cannot move out + | ^-- hint: to prevent move, use `ref _a` or `ref mut _a` + | ______________| + | | +44 | | //~| cannot move out +45 | | //~| to prevent move +46 | | .. +47 | | ] => { + | |_________^ cannot move out of here + +error[E0508]: cannot move out of type `[std::boxed::Box]`, a non-copy slice + --> $DIR/borrowck-vec-pattern-nesting.rs:56:13 + | +56 | let a = vec[0]; //~ ERROR cannot move out + | ^^^^^^ + | | + | cannot move out of here + | help: consider using a reference instead: `&vec[0]` + +error[E0508]: cannot move out of type `[std::boxed::Box]`, a non-copy slice + --> $DIR/borrowck-vec-pattern-nesting.rs:64:14 + | +64 | &mut [ //~ ERROR cannot move out + | ______________^ +65 | | //~^ cannot move out +66 | | _b] => {} //~ NOTE to prevent move + | |__________--^ cannot move out of here + | | + | hint: to prevent move, use `ref _b` or `ref mut _b` + +error[E0508]: cannot move out of type `[std::boxed::Box]`, a non-copy slice + --> $DIR/borrowck-vec-pattern-nesting.rs:69:13 + | +69 | let a = vec[0]; //~ ERROR cannot move out + | ^^^^^^ + | | + | cannot move out of here + | help: consider using a reference instead: `&vec[0]` + +error[E0508]: cannot move out of type `[std::boxed::Box]`, a non-copy slice + --> $DIR/borrowck-vec-pattern-nesting.rs:77:14 + | +77 | &mut [_a, _b, _c] => {} //~ ERROR cannot move out + | ^--^^--^^--^ + | || | | + | || | ...and here (use `ref _c` or `ref mut _c`) + | || ...and here (use `ref _b` or `ref mut _b`) + | |hint: to prevent move, use `ref _a` or `ref mut _a` + | cannot move out of here + +error[E0508]: cannot move out of type `[std::boxed::Box]`, a non-copy slice + --> $DIR/borrowck-vec-pattern-nesting.rs:84:13 + | +84 | let a = vec[0]; //~ ERROR cannot move out + | ^^^^^^ + | | + | cannot move out of here + | help: consider using a reference instead: `&vec[0]` + +error: aborting due to 8 previous errors + diff --git a/src/test/compile-fail/cast-as-bool.rs b/src/test/ui/cast-as-bool.rs similarity index 100% rename from src/test/compile-fail/cast-as-bool.rs rename to src/test/ui/cast-as-bool.rs diff --git a/src/test/ui/cast-as-bool.stderr b/src/test/ui/cast-as-bool.stderr new file mode 100644 index 0000000000000..346ebf07fc3f5 --- /dev/null +++ b/src/test/ui/cast-as-bool.stderr @@ -0,0 +1,10 @@ +error[E0054]: cannot cast as `bool` + --> $DIR/cast-as-bool.rs:12:13 + | +12 | let u = 5 as bool; + | ^^^^^^^^^ unsupported cast + | + = help: compare with zero instead + +error: aborting due to previous error + diff --git a/src/test/compile-fail/cast-rfc0401-2.rs b/src/test/ui/cast-rfc0401-2.rs similarity index 100% rename from src/test/compile-fail/cast-rfc0401-2.rs rename to src/test/ui/cast-rfc0401-2.rs diff --git a/src/test/ui/cast-rfc0401-2.stderr b/src/test/ui/cast-rfc0401-2.stderr new file mode 100644 index 0000000000000..1febe6a618fde --- /dev/null +++ b/src/test/ui/cast-rfc0401-2.stderr @@ -0,0 +1,10 @@ +error[E0054]: cannot cast as `bool` + --> $DIR/cast-rfc0401-2.rs:16:13 + | +16 | let _ = 3 as bool; + | ^^^^^^^^^ unsupported cast + | + = help: compare with zero instead + +error: aborting due to previous error + diff --git a/src/test/compile-fail/changing-crates.rs b/src/test/ui/changing-crates.rs similarity index 100% rename from src/test/compile-fail/changing-crates.rs rename to src/test/ui/changing-crates.rs diff --git a/src/test/ui/changing-crates.stderr b/src/test/ui/changing-crates.stderr new file mode 100644 index 0000000000000..e6c054183cbf4 --- /dev/null +++ b/src/test/ui/changing-crates.stderr @@ -0,0 +1,13 @@ +error[E0460]: found possibly newer version of crate `a` which `b` depends on + --> $DIR/changing-crates.rs:19:1 + | +19 | extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on + | ^^^^^^^^^^^^^^^ + | + = note: perhaps that crate needs to be recompiled? + = note: the following crate versions were found: + crate `a`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/changing-crates.stage1-x86_64-pc-windows-gnu.aux/a.dll + crate `b`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/changing-crates.stage1-x86_64-pc-windows-gnu.aux/b.dll + +error: aborting due to previous error + diff --git a/src/test/compile-fail/coherence-error-suppression.rs b/src/test/ui/coherence-error-suppression.rs similarity index 100% rename from src/test/compile-fail/coherence-error-suppression.rs rename to src/test/ui/coherence-error-suppression.rs diff --git a/src/test/ui/coherence-error-suppression.stderr b/src/test/ui/coherence-error-suppression.stderr new file mode 100644 index 0000000000000..57b746f19e856 --- /dev/null +++ b/src/test/ui/coherence-error-suppression.stderr @@ -0,0 +1,8 @@ +error[E0412]: cannot find type `DoesNotExist` in this scope + --> $DIR/coherence-error-suppression.rs:19:14 + | +19 | impl Foo for DoesNotExist {} //~ ERROR cannot find type `DoesNotExist` in this scope + | ^^^^^^^^^^^^ not found in this scope + +error: aborting due to previous error + diff --git a/src/test/compile-fail/coherence-impls-copy.rs b/src/test/ui/coherence-impls-copy.rs similarity index 100% rename from src/test/compile-fail/coherence-impls-copy.rs rename to src/test/ui/coherence-impls-copy.rs diff --git a/src/test/ui/coherence-impls-copy.stderr b/src/test/ui/coherence-impls-copy.stderr new file mode 100644 index 0000000000000..977e9ce260f75 --- /dev/null +++ b/src/test/ui/coherence-impls-copy.stderr @@ -0,0 +1,59 @@ +error[E0206]: the trait `Copy` may not be implemented for this type + --> $DIR/coherence-impls-copy.rs:29:15 + | +29 | impl Copy for &'static mut MyType {} + | ^^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration + +error[E0206]: the trait `Copy` may not be implemented for this type + --> $DIR/coherence-impls-copy.rs:34:15 + | +34 | impl Copy for (MyType, MyType) {} + | ^^^^^^^^^^^^^^^^ type is not a structure or enumeration + +error[E0206]: the trait `Copy` may not be implemented for this type + --> $DIR/coherence-impls-copy.rs:42:15 + | +42 | impl Copy for &'static NotSync {} + | ^^^^^^^^^^^^^^^^ type is not a structure or enumeration + +error[E0206]: the trait `Copy` may not be implemented for this type + --> $DIR/coherence-impls-copy.rs:46:15 + | +46 | impl Copy for [MyType] {} + | ^^^^^^^^ type is not a structure or enumeration + +error[E0206]: the trait `Copy` may not be implemented for this type + --> $DIR/coherence-impls-copy.rs:54:15 + | +54 | impl Copy for &'static [NotSync] {} + | ^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration + +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence-impls-copy.rs:34:1 + | +34 | impl Copy for (MyType, MyType) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence-impls-copy.rs:46:1 + | +46 | impl Copy for [MyType] {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence-impls-copy.rs:54:1 + | +54 | impl Copy for &'static [NotSync] {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error: aborting due to 8 previous errors + diff --git a/src/test/compile-fail/coherence-overlap-downstream-inherent.rs b/src/test/ui/coherence-overlap-downstream-inherent.rs similarity index 100% rename from src/test/compile-fail/coherence-overlap-downstream-inherent.rs rename to src/test/ui/coherence-overlap-downstream-inherent.rs diff --git a/src/test/ui/coherence-overlap-downstream-inherent.stderr b/src/test/ui/coherence-overlap-downstream-inherent.stderr new file mode 100644 index 0000000000000..23287e2f578bd --- /dev/null +++ b/src/test/ui/coherence-overlap-downstream-inherent.stderr @@ -0,0 +1,22 @@ +error[E0592]: duplicate definitions with name `dummy` + --> $DIR/coherence-overlap-downstream-inherent.rs:17:26 + | +17 | impl Sweet { fn dummy(&self) { } } + | ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy` +... +20 | impl Sweet { fn dummy(&self) { } } + | ------------------- other definition for `dummy` + +error[E0592]: duplicate definitions with name `f` + --> $DIR/coherence-overlap-downstream-inherent.rs:25:38 + | +25 | impl A where T: Bar { fn f(&self) {} } + | ^^^^^^^^^^^^^^ duplicate definitions for `f` +... +29 | impl A { fn f(&self) {} } + | -------------- other definition for `f` + | + = note: downstream crates may implement trait `Bar<_>` for type `i32` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/coherence-overlap-downstream.rs b/src/test/ui/coherence-overlap-downstream.rs similarity index 100% rename from src/test/compile-fail/coherence-overlap-downstream.rs rename to src/test/ui/coherence-overlap-downstream.rs diff --git a/src/test/ui/coherence-overlap-downstream.stderr b/src/test/ui/coherence-overlap-downstream.stderr new file mode 100644 index 0000000000000..2b129644e84d5 --- /dev/null +++ b/src/test/ui/coherence-overlap-downstream.stderr @@ -0,0 +1,22 @@ +error[E0119]: conflicting implementations of trait `Sweet`: + --> $DIR/coherence-overlap-downstream.rs:19:1 + | +17 | impl Sweet for T { } + | ----------------------------- first implementation here +18 | //~^ NOTE first implementation here +19 | impl Sweet for T { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation + +error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`: + --> $DIR/coherence-overlap-downstream.rs:27:1 + | +25 | impl Foo for T where T: Bar {} + | ------------------------------------------ first implementation here +26 | //~^ NOTE first implementation here +27 | impl Foo for i32 {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32` + | + = note: downstream crates may implement trait `Bar<_>` for type `i32` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/coherence-overlap-issue-23516-inherent.rs b/src/test/ui/coherence-overlap-issue-23516-inherent.rs similarity index 100% rename from src/test/compile-fail/coherence-overlap-issue-23516-inherent.rs rename to src/test/ui/coherence-overlap-issue-23516-inherent.rs diff --git a/src/test/ui/coherence-overlap-issue-23516-inherent.stderr b/src/test/ui/coherence-overlap-issue-23516-inherent.stderr new file mode 100644 index 0000000000000..265de9304898a --- /dev/null +++ b/src/test/ui/coherence-overlap-issue-23516-inherent.stderr @@ -0,0 +1,13 @@ +error[E0592]: duplicate definitions with name `dummy` + --> $DIR/coherence-overlap-issue-23516-inherent.rs:19:25 + | +19 | impl Cake { fn dummy(&self) { } } + | ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy` +... +23 | impl Cake> { fn dummy(&self) { } } + | ------------------- other definition for `dummy` + | + = note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/coherence-overlap-issue-23516.rs b/src/test/ui/coherence-overlap-issue-23516.rs similarity index 100% rename from src/test/compile-fail/coherence-overlap-issue-23516.rs rename to src/test/ui/coherence-overlap-issue-23516.rs diff --git a/src/test/ui/coherence-overlap-issue-23516.stderr b/src/test/ui/coherence-overlap-issue-23516.stderr new file mode 100644 index 0000000000000..ac3293b5f3fcf --- /dev/null +++ b/src/test/ui/coherence-overlap-issue-23516.stderr @@ -0,0 +1,13 @@ +error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>`: + --> $DIR/coherence-overlap-issue-23516.rs:19:1 + | +17 | impl Sweet for T { } + | ----------------------------- first implementation here +18 | //~^ NOTE first implementation here +19 | impl Sweet for Box { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::boxed::Box<_>` + | + = note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/coherence-overlap-upstream-inherent.rs b/src/test/ui/coherence-overlap-upstream-inherent.rs similarity index 100% rename from src/test/compile-fail/coherence-overlap-upstream-inherent.rs rename to src/test/ui/coherence-overlap-upstream-inherent.rs diff --git a/src/test/ui/coherence-overlap-upstream-inherent.stderr b/src/test/ui/coherence-overlap-upstream-inherent.stderr new file mode 100644 index 0000000000000..547e1d7646178 --- /dev/null +++ b/src/test/ui/coherence-overlap-upstream-inherent.stderr @@ -0,0 +1,13 @@ +error[E0592]: duplicate definitions with name `dummy` + --> $DIR/coherence-overlap-upstream-inherent.rs:21:32 + | +21 | impl A where T: Remote { fn dummy(&self) { } } + | ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy` +... +25 | impl A { fn dummy(&self) { } } + | ------------------- other definition for `dummy` + | + = note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions + +error: aborting due to previous error + diff --git a/src/test/compile-fail/coherence-overlap-upstream.rs b/src/test/ui/coherence-overlap-upstream.rs similarity index 100% rename from src/test/compile-fail/coherence-overlap-upstream.rs rename to src/test/ui/coherence-overlap-upstream.rs diff --git a/src/test/ui/coherence-overlap-upstream.stderr b/src/test/ui/coherence-overlap-upstream.stderr new file mode 100644 index 0000000000000..ab0daf322c343 --- /dev/null +++ b/src/test/ui/coherence-overlap-upstream.stderr @@ -0,0 +1,13 @@ +error[E0119]: conflicting implementations of trait `Foo` for type `i16`: + --> $DIR/coherence-overlap-upstream.rs:23:1 + | +21 | impl Foo for T where T: Remote {} + | ------------------------------------ first implementation here +22 | //~^ NOTE first implementation here +23 | impl Foo for i16 {} + | ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i16` + | + = note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions + +error: aborting due to previous error + diff --git a/src/test/compile-fail/const-deref-ptr.rs b/src/test/ui/const-deref-ptr.rs similarity index 100% rename from src/test/compile-fail/const-deref-ptr.rs rename to src/test/ui/const-deref-ptr.rs diff --git a/src/test/ui/const-deref-ptr.stderr b/src/test/ui/const-deref-ptr.stderr new file mode 100644 index 0000000000000..60f9a3a37ba99 --- /dev/null +++ b/src/test/ui/const-deref-ptr.stderr @@ -0,0 +1,8 @@ +error[E0396]: raw pointers cannot be dereferenced in statics + --> $DIR/const-deref-ptr.rs:14:29 + | +14 | static C: u64 = unsafe {*(0xdeadbeef as *const u64)}; //~ ERROR E0396 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer in constant + +error: aborting due to previous error + diff --git a/src/test/compile-fail/const-eval-overflow-2.rs b/src/test/ui/const-eval-overflow-2.rs similarity index 100% rename from src/test/compile-fail/const-eval-overflow-2.rs rename to src/test/ui/const-eval-overflow-2.rs diff --git a/src/test/ui/const-eval-overflow-2.stderr b/src/test/ui/const-eval-overflow-2.stderr new file mode 100644 index 0000000000000..51cd0bac868d9 --- /dev/null +++ b/src/test/ui/const-eval-overflow-2.stderr @@ -0,0 +1,14 @@ +error[E0080]: constant evaluation error + --> $DIR/const-eval-overflow-2.rs:21:25 + | +21 | const NEG_NEG_128: i8 = -NEG_128; + | ^^^^^^^^ attempt to negate with overflow + | +note: for pattern here + --> $DIR/const-eval-overflow-2.rs:27:9 + | +27 | NEG_NEG_128 => println!("A"), //~ NOTE for pattern here + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/const-eval-overflow-4.rs b/src/test/ui/const-eval-overflow-4.rs similarity index 100% rename from src/test/compile-fail/const-eval-overflow-4.rs rename to src/test/ui/const-eval-overflow-4.rs diff --git a/src/test/ui/const-eval-overflow-4.stderr b/src/test/ui/const-eval-overflow-4.stderr new file mode 100644 index 0000000000000..d35b9c6c571b4 --- /dev/null +++ b/src/test/ui/const-eval-overflow-4.stderr @@ -0,0 +1,8 @@ +error[E0080]: constant evaluation error + --> $DIR/const-eval-overflow-4.rs:23:13 + | +23 | : [u32; (i8::MAX as i8 + 1i8) as usize] + | ^^^^^^^^^^^^^^^^^^^^^ attempt to add with overflow + +error: aborting due to previous error + diff --git a/src/test/compile-fail/const-eval-span.rs b/src/test/ui/const-eval-span.rs similarity index 100% rename from src/test/compile-fail/const-eval-span.rs rename to src/test/ui/const-eval-span.rs diff --git a/src/test/ui/const-eval-span.stderr b/src/test/ui/const-eval-span.stderr new file mode 100644 index 0000000000000..e64af57a18649 --- /dev/null +++ b/src/test/ui/const-eval-span.stderr @@ -0,0 +1,11 @@ +error[E0308]: mismatched types + --> $DIR/const-eval-span.rs:19:9 + | +19 | V = CONSTANT, + | ^^^^^^^^ expected isize, found struct `S` + | + = note: expected type `isize` + found type `S` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/const-fn-error.rs b/src/test/ui/const-fn-error.rs similarity index 100% rename from src/test/compile-fail/const-fn-error.rs rename to src/test/ui/const-fn-error.rs diff --git a/src/test/ui/const-fn-error.stderr b/src/test/ui/const-fn-error.stderr new file mode 100644 index 0000000000000..2bf88cf2d0377 --- /dev/null +++ b/src/test/ui/const-fn-error.stderr @@ -0,0 +1,14 @@ +error[E0080]: constant evaluation error + --> $DIR/const-fn-error.rs:20:5 + | +20 | sum //~ ERROR E0080 + | ^^^ non-constant path in constant expression + | +note: for constant expression here + --> $DIR/const-fn-error.rs:26:13 + | +26 | let a : [i32; f(X)]; //~ NOTE for constant expression here + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/const-fn-mismatch.rs b/src/test/ui/const-fn-mismatch.rs similarity index 100% rename from src/test/compile-fail/const-fn-mismatch.rs rename to src/test/ui/const-fn-mismatch.rs diff --git a/src/test/ui/const-fn-mismatch.stderr b/src/test/ui/const-fn-mismatch.stderr new file mode 100644 index 0000000000000..4f6a98fb8eb05 --- /dev/null +++ b/src/test/ui/const-fn-mismatch.stderr @@ -0,0 +1,8 @@ +error[E0379]: trait fns cannot be declared const + --> $DIR/const-fn-mismatch.rs:23:5 + | +23 | const fn f() -> u32 { 22 } + | ^^^^^ trait fns cannot be const + +error: aborting due to previous error + diff --git a/src/test/compile-fail/const-fn-not-in-trait.rs b/src/test/ui/const-fn-not-in-trait.rs similarity index 100% rename from src/test/compile-fail/const-fn-not-in-trait.rs rename to src/test/ui/const-fn-not-in-trait.rs diff --git a/src/test/ui/const-fn-not-in-trait.stderr b/src/test/ui/const-fn-not-in-trait.stderr new file mode 100644 index 0000000000000..118e186cf8a47 --- /dev/null +++ b/src/test/ui/const-fn-not-in-trait.stderr @@ -0,0 +1,14 @@ +error[E0379]: trait fns cannot be declared const + --> $DIR/const-fn-not-in-trait.rs:17:5 + | +17 | const fn f() -> u32; + | ^^^^^ trait fns cannot be const + +error[E0379]: trait fns cannot be declared const + --> $DIR/const-fn-not-in-trait.rs:20:5 + | +20 | const fn g() -> u32 { 0 } + | ^^^^^ trait fns cannot be const + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/const-len-underflow-separate-spans.rs b/src/test/ui/const-len-underflow-separate-spans.rs similarity index 100% rename from src/test/compile-fail/const-len-underflow-separate-spans.rs rename to src/test/ui/const-len-underflow-separate-spans.rs diff --git a/src/test/ui/const-len-underflow-separate-spans.stderr b/src/test/ui/const-len-underflow-separate-spans.stderr new file mode 100644 index 0000000000000..1c45d37f48943 --- /dev/null +++ b/src/test/ui/const-len-underflow-separate-spans.stderr @@ -0,0 +1,14 @@ +error[E0080]: constant evaluation error + --> $DIR/const-len-underflow-separate-spans.rs:17:20 + | +17 | const LEN: usize = ONE - TWO; + | ^^^^^^^^^ attempt to subtract with overflow + | +note: for constant expression here + --> $DIR/const-len-underflow-separate-spans.rs:22:12 + | +22 | let a: [i8; LEN] = unimplemented!(); + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/const-pattern-not-const-evaluable.rs b/src/test/ui/const-pattern-not-const-evaluable.rs similarity index 100% rename from src/test/compile-fail/const-pattern-not-const-evaluable.rs rename to src/test/ui/const-pattern-not-const-evaluable.rs diff --git a/src/test/ui/const-pattern-not-const-evaluable.stderr b/src/test/ui/const-pattern-not-const-evaluable.stderr new file mode 100644 index 0000000000000..5a64a756a0a2f --- /dev/null +++ b/src/test/ui/const-pattern-not-const-evaluable.stderr @@ -0,0 +1,14 @@ +error[E0080]: constant evaluation error + --> $DIR/const-pattern-not-const-evaluable.rs:22:31 + | +22 | const BOO: Pair = Pair(Marmor, BlackForest); + | ^^^^ unimplemented constant expression: tuple struct constructors + | +note: for pattern here + --> $DIR/const-pattern-not-const-evaluable.rs:37:9 + | +37 | FOO => println!("hi"), //~ NOTE: for pattern here + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/const-unsized.rs b/src/test/ui/const-unsized.rs similarity index 100% rename from src/test/compile-fail/const-unsized.rs rename to src/test/ui/const-unsized.rs diff --git a/src/test/ui/const-unsized.stderr b/src/test/ui/const-unsized.stderr new file mode 100644 index 0000000000000..ab496b7bce3c8 --- /dev/null +++ b/src/test/ui/const-unsized.stderr @@ -0,0 +1,38 @@ +error[E0277]: the trait bound `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied + --> $DIR/const-unsized.rs:13:29 + | +13 | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync)); + | ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static` + = note: constant expressions must have a statically known size + +error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied + --> $DIR/const-unsized.rs:18:24 + | +18 | const CONST_FOO: str = *"foo"; + | ^^^^^^ `str` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: constant expressions must have a statically known size + +error[E0277]: the trait bound `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied + --> $DIR/const-unsized.rs:23:31 + | +23 | static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync)); + | ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static` + = note: constant expressions must have a statically known size + +error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied + --> $DIR/const-unsized.rs:28:26 + | +28 | static STATIC_BAR: str = *"bar"; + | ^^^^^^ `str` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: constant expressions must have a statically known size + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/cycle-trait-supertrait-indirect.rs b/src/test/ui/cycle-trait-supertrait-indirect.rs similarity index 100% rename from src/test/compile-fail/cycle-trait-supertrait-indirect.rs rename to src/test/ui/cycle-trait-supertrait-indirect.rs diff --git a/src/test/ui/cycle-trait-supertrait-indirect.stderr b/src/test/ui/cycle-trait-supertrait-indirect.stderr new file mode 100644 index 0000000000000..1f4e1016bb1d6 --- /dev/null +++ b/src/test/ui/cycle-trait-supertrait-indirect.stderr @@ -0,0 +1,20 @@ +error[E0391]: unsupported cyclic reference between types/traits detected + --> $DIR/cycle-trait-supertrait-indirect.rs:22:1 + | +22 | trait C: B { } + | ^^^^^^^^^^ cyclic reference + | +note: the cycle begins when computing the supertraits of `B`... + --> $DIR/cycle-trait-supertrait-indirect.rs:14:1 + | +14 | trait A: B { + | ^^^^^^^^^^ +note: ...which then requires computing the supertraits of `C`... + --> $DIR/cycle-trait-supertrait-indirect.rs:18:1 + | +18 | trait B: C { + | ^^^^^^^^^^ + = note: ...which then again requires computing the supertraits of `B`, completing the cycle. + +error: aborting due to previous error + diff --git a/src/test/compile-fail/derived-errors/issue-31997-1.rs b/src/test/ui/derived-errors/issue-31997-1.rs similarity index 100% rename from src/test/compile-fail/derived-errors/issue-31997-1.rs rename to src/test/ui/derived-errors/issue-31997-1.rs diff --git a/src/test/ui/derived-errors/issue-31997-1.stderr b/src/test/ui/derived-errors/issue-31997-1.stderr new file mode 100644 index 0000000000000..732cf9bacbcd1 --- /dev/null +++ b/src/test/ui/derived-errors/issue-31997-1.stderr @@ -0,0 +1,8 @@ +error[E0433]: failed to resolve. Use of undeclared type or module `HashMap` + --> $DIR/issue-31997-1.rs:30:19 + | +30 | let mut map = HashMap::new(); + | ^^^^^^^ Use of undeclared type or module `HashMap` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/discrim-overflow-2.rs b/src/test/ui/discrim-overflow-2.rs similarity index 100% rename from src/test/compile-fail/discrim-overflow-2.rs rename to src/test/ui/discrim-overflow-2.rs diff --git a/src/test/ui/discrim-overflow-2.stderr b/src/test/ui/discrim-overflow-2.stderr new file mode 100644 index 0000000000000..be1b5f0ef2046 --- /dev/null +++ b/src/test/ui/discrim-overflow-2.stderr @@ -0,0 +1,66 @@ +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow-2.rs:27:9 + | +27 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 127i8 + | + = note: explicitly set `OhNo = -128i8` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow-2.rs:38:9 + | +38 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 255u8 + | + = note: explicitly set `OhNo = 0u8` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow-2.rs:49:9 + | +49 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 32767i16 + | + = note: explicitly set `OhNo = -32768i16` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow-2.rs:60:9 + | +60 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 65535u16 + | + = note: explicitly set `OhNo = 0u16` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow-2.rs:71:9 + | +71 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 2147483647i32 + | + = note: explicitly set `OhNo = -2147483648i32` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow-2.rs:82:9 + | +82 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 4294967295u32 + | + = note: explicitly set `OhNo = 0u32` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow-2.rs:93:9 + | +93 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 9223372036854775807i64 + | + = note: explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow-2.rs:104:9 + | +104 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 18446744073709551615u64 + | + = note: explicitly set `OhNo = 0u64` if that is desired outcome + +error: aborting due to 8 previous errors + diff --git a/src/test/compile-fail/discrim-overflow.rs b/src/test/ui/discrim-overflow.rs similarity index 100% rename from src/test/compile-fail/discrim-overflow.rs rename to src/test/ui/discrim-overflow.rs diff --git a/src/test/ui/discrim-overflow.stderr b/src/test/ui/discrim-overflow.stderr new file mode 100644 index 0000000000000..3af82876f6f08 --- /dev/null +++ b/src/test/ui/discrim-overflow.stderr @@ -0,0 +1,66 @@ +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow.rs:25:9 + | +25 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 127i8 + | + = note: explicitly set `OhNo = -128i8` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow.rs:38:9 + | +38 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 255u8 + | + = note: explicitly set `OhNo = 0u8` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow.rs:51:9 + | +51 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 32767i16 + | + = note: explicitly set `OhNo = -32768i16` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow.rs:64:9 + | +64 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 65535u16 + | + = note: explicitly set `OhNo = 0u16` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow.rs:77:9 + | +77 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 2147483647i32 + | + = note: explicitly set `OhNo = -2147483648i32` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow.rs:90:9 + | +90 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 4294967295u32 + | + = note: explicitly set `OhNo = 0u32` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow.rs:103:9 + | +103 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 9223372036854775807i64 + | + = note: explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome + +error[E0370]: enum discriminant overflowed + --> $DIR/discrim-overflow.rs:116:9 + | +116 | OhNo, //~ ERROR enum discriminant overflowed [E0370] + | ^^^^ overflowed on value after 18446744073709551615u64 + | + = note: explicitly set `OhNo = 0u64` if that is desired outcome + +error: aborting due to 8 previous errors + diff --git a/src/test/compile-fail/double-import.rs b/src/test/ui/double-import.rs similarity index 100% rename from src/test/compile-fail/double-import.rs rename to src/test/ui/double-import.rs diff --git a/src/test/ui/double-import.stderr b/src/test/ui/double-import.stderr new file mode 100644 index 0000000000000..0219a17618b7a --- /dev/null +++ b/src/test/ui/double-import.stderr @@ -0,0 +1,16 @@ +error[E0252]: the name `foo` is defined multiple times + --> $DIR/double-import.rs:23:5 + | +22 | use sub1::foo; //~ NOTE previous import of the value `foo` here + | --------- previous import of the value `foo` here +23 | use sub2::foo; //~ ERROR the name `foo` is defined multiple times + | ^^^^^^^^^ `foo` reimported here + | + = note: `foo` must be defined only once in the value namespace of this module +help: You can use `as` to change the binding name of the import + | +23 | use sub2::foo as Otherfoo; //~ ERROR the name `foo` is defined multiple times + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/duplicate-check-macro-exports.rs b/src/test/ui/duplicate-check-macro-exports.rs similarity index 100% rename from src/test/compile-fail/duplicate-check-macro-exports.rs rename to src/test/ui/duplicate-check-macro-exports.rs diff --git a/src/test/ui/duplicate-check-macro-exports.stderr b/src/test/ui/duplicate-check-macro-exports.stderr new file mode 100644 index 0000000000000..c512291f2d9b3 --- /dev/null +++ b/src/test/ui/duplicate-check-macro-exports.stderr @@ -0,0 +1,14 @@ +error: a macro named `panic` has already been exported + --> $DIR/duplicate-check-macro-exports.rs:16:1 + | +16 | macro_rules! panic { () => {} } //~ ERROR a macro named `panic` has already been exported + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `panic` already exported + | +note: previous macro export here + --> $DIR/duplicate-check-macro-exports.rs:13:9 + | +13 | pub use std::panic; //~ NOTE previous macro export here + | ^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/empty-struct-unit-expr.rs b/src/test/ui/empty-struct-unit-expr.rs similarity index 100% rename from src/test/compile-fail/empty-struct-unit-expr.rs rename to src/test/ui/empty-struct-unit-expr.rs diff --git a/src/test/ui/empty-struct-unit-expr.stderr b/src/test/ui/empty-struct-unit-expr.stderr new file mode 100644 index 0000000000000..0c722dd645d3e --- /dev/null +++ b/src/test/ui/empty-struct-unit-expr.stderr @@ -0,0 +1,41 @@ +error[E0618]: expected function, found `Empty2` + --> $DIR/empty-struct-unit-expr.rs:25:14 + | +25 | let e2 = Empty2(); //~ ERROR expected function, found `Empty2` + | ^^^^^^^^ + | +note: defined here + --> $DIR/empty-struct-unit-expr.rs:18:1 + | +18 | struct Empty2; + | ^^^^^^^^^^^^^^ + +error[E0618]: expected function, found `E::Empty4` + --> $DIR/empty-struct-unit-expr.rs:26:14 + | +26 | let e4 = E::Empty4(); + | ^^^^^^^^^^^ + | + = help: did you mean to write `E::Empty4`? +note: defined here + --> $DIR/empty-struct-unit-expr.rs:21:5 + | +21 | Empty4 + | ^^^^^^ + +error[E0618]: expected function, found `empty_struct::XEmpty2` + --> $DIR/empty-struct-unit-expr.rs:29:15 + | +29 | let xe2 = XEmpty2(); //~ ERROR expected function, found `empty_struct::XEmpty2` + | ^^^^^^^^^ + +error[E0618]: expected function, found `XE::XEmpty4` + --> $DIR/empty-struct-unit-expr.rs:30:15 + | +30 | let xe4 = XE::XEmpty4(); + | ^^^^^^^^^^^^^ + | + = help: did you mean to write `XE::XEmpty4`? + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/enum-and-module-in-same-scope.rs b/src/test/ui/enum-and-module-in-same-scope.rs similarity index 100% rename from src/test/compile-fail/enum-and-module-in-same-scope.rs rename to src/test/ui/enum-and-module-in-same-scope.rs diff --git a/src/test/ui/enum-and-module-in-same-scope.stderr b/src/test/ui/enum-and-module-in-same-scope.stderr new file mode 100644 index 0000000000000..6f3a2c89d19e6 --- /dev/null +++ b/src/test/ui/enum-and-module-in-same-scope.stderr @@ -0,0 +1,20 @@ +error[E0428]: the name `Foo` is defined multiple times + --> $DIR/enum-and-module-in-same-scope.rs:15:1 + | +11 | / enum Foo { //~ NOTE previous definition of the type `Foo` here +12 | | X +13 | | } + | |_- previous definition of the type `Foo` here +14 | +15 | / mod Foo { //~ ERROR the name `Foo` is defined multiple times +16 | | //~| NOTE `Foo` redefined here +17 | | //~| NOTE `Foo` must be defined only once in the type namespace of this module +18 | | pub static X: isize = 42; +19 | | fn f() { f() } // Check that this does not result in a resolution error +20 | | } + | |_^ `Foo` redefined here + | + = note: `Foo` must be defined only once in the type namespace of this module + +error: aborting due to previous error + diff --git a/src/test/compile-fail/fat-ptr-cast.rs b/src/test/ui/fat-ptr-cast.rs similarity index 100% rename from src/test/compile-fail/fat-ptr-cast.rs rename to src/test/ui/fat-ptr-cast.rs diff --git a/src/test/ui/fat-ptr-cast.stderr b/src/test/ui/fat-ptr-cast.stderr new file mode 100644 index 0000000000000..1cad2eeaee250 --- /dev/null +++ b/src/test/ui/fat-ptr-cast.stderr @@ -0,0 +1,62 @@ +error[E0606]: casting `&[i32]` as `usize` is invalid + --> $DIR/fat-ptr-cast.rs:20:5 + | +20 | a as usize; //~ ERROR casting + | ^^^^^^^^^^ + | + = help: cast through a raw pointer first + +error[E0606]: casting `&[i32]` as `isize` is invalid + --> $DIR/fat-ptr-cast.rs:22:5 + | +22 | a as isize; //~ ERROR casting + | ^^^^^^^^^^ + +error[E0606]: casting `&[i32]` as `i16` is invalid + --> $DIR/fat-ptr-cast.rs:23:5 + | +23 | a as i16; //~ ERROR casting `&[i32]` as `i16` is invalid + | ^^^^^^^^ + +error[E0606]: casting `&[i32]` as `u32` is invalid + --> $DIR/fat-ptr-cast.rs:24:5 + | +24 | a as u32; //~ ERROR casting `&[i32]` as `u32` is invalid + | ^^^^^^^^ + +error[E0605]: non-primitive cast: `std::boxed::Box<[i32]>` as `usize` + --> $DIR/fat-ptr-cast.rs:25:5 + | +25 | b as usize; //~ ERROR non-primitive cast + | ^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error[E0606]: casting `*const [i32]` as `usize` is invalid + --> $DIR/fat-ptr-cast.rs:26:5 + | +26 | p as usize; + | ^^^^^^^^^^ + | + = help: cast through a thin pointer first + +error[E0607]: cannot cast thin pointer `*const i32` to fat pointer `*const [i32]` + --> $DIR/fat-ptr-cast.rs:31:5 + | +31 | q as *const [i32]; //~ ERROR cannot cast + | ^^^^^^^^^^^^^^^^^ + +error[E0606]: casting `usize` as `*mut Trait + 'static` is invalid + --> $DIR/fat-ptr-cast.rs:34:37 + | +34 | let t: *mut (Trait + 'static) = 0 as *mut _; //~ ERROR casting + | ^^^^^^^^^^^ + +error[E0606]: casting `usize` as `*const str` is invalid + --> $DIR/fat-ptr-cast.rs:35:32 + | +35 | let mut fail: *const str = 0 as *const str; //~ ERROR casting + | ^^^^^^^^^^^^^^^ + +error: aborting due to 9 previous errors + diff --git a/src/test/compile-fail/generic-type-less-params-with-defaults.rs b/src/test/ui/generic-type-less-params-with-defaults.rs similarity index 100% rename from src/test/compile-fail/generic-type-less-params-with-defaults.rs rename to src/test/ui/generic-type-less-params-with-defaults.rs diff --git a/src/test/ui/generic-type-less-params-with-defaults.stderr b/src/test/ui/generic-type-less-params-with-defaults.stderr new file mode 100644 index 0000000000000..0351923eff651 --- /dev/null +++ b/src/test/ui/generic-type-less-params-with-defaults.stderr @@ -0,0 +1,8 @@ +error[E0243]: wrong number of type arguments: expected at least 1, found 0 + --> $DIR/generic-type-less-params-with-defaults.rs:19:12 + | +19 | let _: Vec; + | ^^^ expected at least 1 type argument + +error: aborting due to previous error + diff --git a/src/test/compile-fail/generic-type-more-params-with-defaults.rs b/src/test/ui/generic-type-more-params-with-defaults.rs similarity index 100% rename from src/test/compile-fail/generic-type-more-params-with-defaults.rs rename to src/test/ui/generic-type-more-params-with-defaults.rs diff --git a/src/test/ui/generic-type-more-params-with-defaults.stderr b/src/test/ui/generic-type-more-params-with-defaults.stderr new file mode 100644 index 0000000000000..11ce6b1656ded --- /dev/null +++ b/src/test/ui/generic-type-more-params-with-defaults.stderr @@ -0,0 +1,8 @@ +error[E0244]: wrong number of type arguments: expected at most 2, found 3 + --> $DIR/generic-type-more-params-with-defaults.rs:19:12 + | +19 | let _: Vec; + | ^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type arguments + +error: aborting due to previous error + diff --git a/src/test/compile-fail/if-let-arm-types.rs b/src/test/ui/if-let-arm-types.rs similarity index 100% rename from src/test/compile-fail/if-let-arm-types.rs rename to src/test/ui/if-let-arm-types.rs diff --git a/src/test/ui/if-let-arm-types.stderr b/src/test/ui/if-let-arm-types.stderr new file mode 100644 index 0000000000000..cc232027ceeb9 --- /dev/null +++ b/src/test/ui/if-let-arm-types.stderr @@ -0,0 +1,25 @@ +error[E0308]: `if let` arms have incompatible types + --> $DIR/if-let-arm-types.rs:12:5 + | +12 | / if let Some(b) = None { //~ ERROR: `if let` arms have incompatible types +13 | | //~^ expected (), found integral variable +14 | | //~| expected type `()` +15 | | //~| found type `{integer}` +... | +18 | | 1 +19 | | }; + | |_____^ expected (), found integral variable + | + = note: expected type `()` + found type `{integer}` +note: `if let` arm with an incompatible type + --> $DIR/if-let-arm-types.rs:17:12 + | +17 | } else { //~ NOTE: `if let` arm with an incompatible type + | ____________^ +18 | | 1 +19 | | }; + | |_____^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/impl-duplicate-methods.rs b/src/test/ui/impl-duplicate-methods.rs similarity index 100% rename from src/test/compile-fail/impl-duplicate-methods.rs rename to src/test/ui/impl-duplicate-methods.rs diff --git a/src/test/ui/impl-duplicate-methods.stderr b/src/test/ui/impl-duplicate-methods.stderr new file mode 100644 index 0000000000000..66b2d6059674c --- /dev/null +++ b/src/test/ui/impl-duplicate-methods.stderr @@ -0,0 +1,10 @@ +error[E0201]: duplicate definitions with name `orange`: + --> $DIR/impl-duplicate-methods.rs:15:5 + | +14 | fn orange(&self) {} //~ NOTE previous definition of `orange` here + | ------------------- previous definition of `orange` here +15 | fn orange(&self) {} + | ^^^^^^^^^^^^^^^^^^^ duplicate definition + +error: aborting due to previous error + diff --git a/src/test/compile-fail/impl-unused-rps-in-assoc-type.rs b/src/test/ui/impl-unused-rps-in-assoc-type.rs similarity index 100% rename from src/test/compile-fail/impl-unused-rps-in-assoc-type.rs rename to src/test/ui/impl-unused-rps-in-assoc-type.rs diff --git a/src/test/ui/impl-unused-rps-in-assoc-type.stderr b/src/test/ui/impl-unused-rps-in-assoc-type.stderr new file mode 100644 index 0000000000000..ec261ed63b1e8 --- /dev/null +++ b/src/test/ui/impl-unused-rps-in-assoc-type.stderr @@ -0,0 +1,8 @@ +error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates + --> $DIR/impl-unused-rps-in-assoc-type.rs:21:6 + | +21 | impl<'a> Fun for Holder { //~ ERROR E0207 + | ^^ unconstrained lifetime parameter + +error: aborting due to previous error + diff --git a/src/test/compile-fail/imports/auxiliary/two_macros.rs b/src/test/ui/imports/auxiliary/two_macros.rs similarity index 100% rename from src/test/compile-fail/imports/auxiliary/two_macros.rs rename to src/test/ui/imports/auxiliary/two_macros.rs diff --git a/src/test/compile-fail/imports/duplicate.rs b/src/test/ui/imports/duplicate.rs similarity index 100% rename from src/test/compile-fail/imports/duplicate.rs rename to src/test/ui/imports/duplicate.rs diff --git a/src/test/ui/imports/duplicate.stderr b/src/test/ui/imports/duplicate.stderr new file mode 100644 index 0000000000000..a990a816fe94b --- /dev/null +++ b/src/test/ui/imports/duplicate.stderr @@ -0,0 +1,88 @@ +error[E0252]: the name `foo` is defined multiple times + --> $DIR/duplicate.rs:25:9 + | +24 | use a::foo; //~ NOTE previous import of the value `foo` here + | ------ previous import of the value `foo` here +25 | use a::foo; //~ ERROR the name `foo` is defined multiple times + | ^^^^^^ `foo` reimported here + | + = note: `foo` must be defined only once in the value namespace of this module +help: You can use `as` to change the binding name of the import + | +25 | use a::foo as Otherfoo; //~ ERROR the name `foo` is defined multiple times + | ^^^^^^^^^^^^^^^^^^ + +error: `foo` is ambiguous + --> $DIR/duplicate.rs:62:9 + | +62 | use self::foo::bar; //~ ERROR `foo` is ambiguous + | ^^^^^^^^^^^^^^ + | +note: `foo` could refer to the name imported here + --> $DIR/duplicate.rs:57:9 + | +57 | use self::m1::*; //~ NOTE + | ^^^^^^^^^^^ +note: `foo` could also refer to the name imported here + --> $DIR/duplicate.rs:59:9 + | +59 | use self::m2::*; //~ NOTE + | ^^^^^^^^^^^ + = note: consider adding an explicit import of `foo` to disambiguate + +error: `foo` is ambiguous + --> $DIR/duplicate.rs:47:5 + | +47 | f::foo(); //~ ERROR `foo` is ambiguous + | ^^^^^^ + | +note: `foo` could refer to the name imported here + --> $DIR/duplicate.rs:36:13 + | +36 | pub use a::*; //~ NOTE `foo` could refer to the name imported here + | ^^^^ +note: `foo` could also refer to the name imported here + --> $DIR/duplicate.rs:37:13 + | +37 | pub use b::*; //~ NOTE `foo` could also refer to the name imported here + | ^^^^ + = note: consider adding an explicit import of `foo` to disambiguate + +error: `foo` is ambiguous + --> $DIR/duplicate.rs:49:5 + | +49 | g::foo(); //~ ERROR `foo` is ambiguous + | ^^^^^^ + | +note: `foo` could refer to the name imported here + --> $DIR/duplicate.rs:41:13 + | +41 | pub use a::*; //~ NOTE `foo` could refer to the name imported here + | ^^^^ +note: `foo` could also refer to the name imported here + --> $DIR/duplicate.rs:42:13 + | +42 | pub use f::*; //~ NOTE `foo` could also refer to the name imported here + | ^^^^ + = note: consider adding an explicit import of `foo` to disambiguate + +error: `foo` is ambiguous + --> $DIR/duplicate.rs:66:9 + | +66 | foo::bar(); //~ ERROR `foo` is ambiguous + | ^^^^^^^^ + | +note: `foo` could refer to the name imported here + --> $DIR/duplicate.rs:57:9 + | +57 | use self::m1::*; //~ NOTE + | ^^^^^^^^^^^ +note: `foo` could also refer to the name imported here + --> $DIR/duplicate.rs:59:9 + | +59 | use self::m2::*; //~ NOTE + | ^^^^^^^^^^^ + = note: consider adding an explicit import of `foo` to disambiguate + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/imports/macro-paths.rs b/src/test/ui/imports/macro-paths.rs similarity index 100% rename from src/test/compile-fail/imports/macro-paths.rs rename to src/test/ui/imports/macro-paths.rs diff --git a/src/test/ui/imports/macro-paths.stderr b/src/test/ui/imports/macro-paths.stderr new file mode 100644 index 0000000000000..cd8ab3de4f9c5 --- /dev/null +++ b/src/test/ui/imports/macro-paths.stderr @@ -0,0 +1,42 @@ +error: `bar` is ambiguous + --> $DIR/macro-paths.rs:25:5 + | +25 | bar::m! { //~ ERROR ambiguous + | ^^^^^^ + | +note: `bar` could refer to the name defined here + --> $DIR/macro-paths.rs:27:9 + | +27 | mod bar { pub use two_macros::m; } //~ NOTE could refer to the name defined here + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: `bar` could also refer to the name imported here + --> $DIR/macro-paths.rs:24:9 + | +24 | use foo::*; //~ NOTE could also refer to the name imported here + | ^^^^^^ + = note: macro-expanded items do not shadow when used in a macro invocation path + +error: `baz` is ambiguous + --> $DIR/macro-paths.rs:36:5 + | +36 | baz::m! { //~ ERROR ambiguous + | ^^^^^^ + | +note: `baz` could refer to the name defined here + --> $DIR/macro-paths.rs:38:9 + | +38 | mod baz { pub use two_macros::m; } //~ NOTE could refer to the name defined here + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: `baz` could also refer to the name defined here + --> $DIR/macro-paths.rs:31:1 + | +31 | / pub mod baz { //~ NOTE could also refer to the name defined here +32 | | pub use two_macros::m; +33 | | } + | |_^ + = note: macro-expanded items do not shadow when used in a macro invocation path + +error[E0601]: main function not found + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/imports/macros.rs b/src/test/ui/imports/macros.rs similarity index 100% rename from src/test/compile-fail/imports/macros.rs rename to src/test/ui/imports/macros.rs diff --git a/src/test/ui/imports/macros.stderr b/src/test/ui/imports/macros.stderr new file mode 100644 index 0000000000000..857335f783a71 --- /dev/null +++ b/src/test/ui/imports/macros.stderr @@ -0,0 +1,57 @@ +error: `m` is ambiguous + --> $DIR/macros.rs:52:5 + | +52 | m!(); //~ ERROR ambiguous + | ^ + | +note: `m` could refer to the macro defined here + --> $DIR/macros.rs:50:5 + | +50 | macro_rules! m { () => {} } //~ NOTE could refer to the macro defined here + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: `m` could also refer to the macro imported here + --> $DIR/macros.rs:51:9 + | +51 | use two_macros::m; //~ NOTE could also refer to the macro imported here + | ^^^^^^^^^^^^^ + +error: `m` is ambiguous + --> $DIR/macros.rs:28:5 + | +28 | m! { //~ ERROR ambiguous + | ^ + | +note: `m` could refer to the name imported here + --> $DIR/macros.rs:30:13 + | +30 | use foo::m; //~ NOTE could refer to the name imported here + | ^^^^^^ +note: `m` could also refer to the name imported here + --> $DIR/macros.rs:27:9 + | +27 | use two_macros::*; //~ NOTE could also refer + | ^^^^^^^^^^^^^ + = note: macro-expanded macro imports do not shadow + +error: `m` is ambiguous + --> $DIR/macros.rs:42:9 + | +42 | m! { //~ ERROR ambiguous + | ^ + | +note: `m` could refer to the name imported here + --> $DIR/macros.rs:44:17 + | +44 | use two_macros::n as m; //~ NOTE could refer to the name imported here + | ^^^^^^^^^^^^^^^^^^ +note: `m` could also refer to the name imported here + --> $DIR/macros.rs:35:9 + | +35 | use two_macros::m; //~ NOTE could also refer + | ^^^^^^^^^^^^^ + = note: macro-expanded macro imports do not shadow + +error[E0601]: main function not found + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/imports/rfc-1560-warning-cycle.rs b/src/test/ui/imports/rfc-1560-warning-cycle.rs similarity index 100% rename from src/test/compile-fail/imports/rfc-1560-warning-cycle.rs rename to src/test/ui/imports/rfc-1560-warning-cycle.rs diff --git a/src/test/ui/imports/rfc-1560-warning-cycle.stderr b/src/test/ui/imports/rfc-1560-warning-cycle.stderr new file mode 100644 index 0000000000000..c5e6f23fdae2a --- /dev/null +++ b/src/test/ui/imports/rfc-1560-warning-cycle.stderr @@ -0,0 +1,16 @@ +error: `Foo` is ambiguous + --> $DIR/rfc-1560-warning-cycle.rs:21:17 + | +19 | use *; //~ NOTE `Foo` could refer to the name imported here + | - `Foo` could refer to the name imported here +20 | use bar::*; //~ NOTE `Foo` could also refer to the name imported here + | ------ `Foo` could also refer to the name imported here +21 | fn f(_: Foo) {} + | ^^^ + | + = note: #[deny(legacy_imports)] on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #38260 + +error: aborting due to previous error + diff --git a/src/test/compile-fail/imports/shadow_builtin_macros.rs b/src/test/ui/imports/shadow_builtin_macros.rs similarity index 100% rename from src/test/compile-fail/imports/shadow_builtin_macros.rs rename to src/test/ui/imports/shadow_builtin_macros.rs diff --git a/src/test/ui/imports/shadow_builtin_macros.stderr b/src/test/ui/imports/shadow_builtin_macros.stderr new file mode 100644 index 0000000000000..53a0cdd82b2d5 --- /dev/null +++ b/src/test/ui/imports/shadow_builtin_macros.stderr @@ -0,0 +1,59 @@ +error: `panic` is already in scope + --> $DIR/shadow_builtin_macros.rs:46:9 + | +46 | macro_rules! panic { () => {} } //~ ERROR `panic` is already in scope + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +49 | m!(); //~ NOTE in this expansion + | ----- in this macro invocation + | + = note: macro-expanded `macro_rules!`s may not shadow existing macros (see RFC 1560) + +error: `panic` is ambiguous + --> $DIR/shadow_builtin_macros.rs:27:14 + | +27 | fn f() { panic!(); } //~ ERROR ambiguous + | ^^^^^ + | +note: `panic` could refer to the name imported here + --> $DIR/shadow_builtin_macros.rs:26:9 + | +26 | use foo::*; //~ NOTE `panic` could refer to the name imported here + | ^^^^^^ + = note: `panic` is also a builtin macro + = note: consider adding an explicit import of `panic` to disambiguate + +error: `panic` is ambiguous + --> $DIR/shadow_builtin_macros.rs:34:14 + | +34 | fn f() { panic!(); } //~ ERROR ambiguous + | ^^^^^ + | +note: `panic` could refer to the name imported here + --> $DIR/shadow_builtin_macros.rs:33:26 + | +33 | ::two_macros::m!(use foo::panic;); //~ NOTE `panic` could refer to the name imported here + | ^^^^^^^^^^ + = note: `panic` is also a builtin macro + = note: macro-expanded macro imports do not shadow + +error: `n` is ambiguous + --> $DIR/shadow_builtin_macros.rs:67:5 + | +67 | n!(); //~ ERROR ambiguous + | ^ + | +note: `n` could refer to the name imported here + --> $DIR/shadow_builtin_macros.rs:66:9 + | +66 | use bar::*; //~ NOTE `n` could refer to the name imported here + | ^^^^^^ +note: `n` could also refer to the name imported here + --> $DIR/shadow_builtin_macros.rs:54:13 + | +54 | #[macro_use(n)] //~ NOTE `n` could also refer to the name imported here + | ^ + = note: consider adding an explicit import of `n` to disambiguate + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/impossible_range.rs b/src/test/ui/impossible_range.rs similarity index 100% rename from src/test/compile-fail/impossible_range.rs rename to src/test/ui/impossible_range.rs diff --git a/src/test/ui/impossible_range.stderr b/src/test/ui/impossible_range.stderr new file mode 100644 index 0000000000000..8ea5942314d4b --- /dev/null +++ b/src/test/ui/impossible_range.stderr @@ -0,0 +1,18 @@ +error[E0586]: inclusive range with no end + --> $DIR/impossible_range.rs:21:8 + | +21 | ..=; //~ERROR inclusive range with no end + | ^ + | + = help: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) + +error[E0586]: inclusive range with no end + --> $DIR/impossible_range.rs:23:9 + | +23 | 0..=; //~ERROR inclusive range with no end + | ^ + | + = help: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/index-help.rs b/src/test/ui/index-help.rs similarity index 100% rename from src/test/compile-fail/index-help.rs rename to src/test/ui/index-help.rs diff --git a/src/test/ui/index-help.stderr b/src/test/ui/index-help.stderr new file mode 100644 index 0000000000000..e1652b6c262c7 --- /dev/null +++ b/src/test/ui/index-help.stderr @@ -0,0 +1,10 @@ +error[E0277]: the trait bound `std::vec::Vec<{integer}>: std::ops::Index` is not satisfied + --> $DIR/index-help.rs:13:5 + | +13 | x[0i32]; //~ ERROR E0277 + | ^^^^^^^ vector indices are of type `usize` or ranges of `usize` + | + = help: the trait `std::ops::Index` is not implemented for `std::vec::Vec<{integer}>` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/invalid-path-in-const.rs b/src/test/ui/invalid-path-in-const.rs similarity index 100% rename from src/test/compile-fail/invalid-path-in-const.rs rename to src/test/ui/invalid-path-in-const.rs diff --git a/src/test/ui/invalid-path-in-const.stderr b/src/test/ui/invalid-path-in-const.stderr new file mode 100644 index 0000000000000..be1de60bca559 --- /dev/null +++ b/src/test/ui/invalid-path-in-const.stderr @@ -0,0 +1,8 @@ +error[E0599]: no associated item named `DOESNOTEXIST` found for type `u32` in the current scope + --> $DIR/invalid-path-in-const.rs:12:18 + | +12 | fn f(a: [u8; u32::DOESNOTEXIST]) {} + | ^^^^^^^^^^^^^^^^^ associated item not found in `u32` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-10969.rs b/src/test/ui/issue-10969.rs similarity index 100% rename from src/test/compile-fail/issue-10969.rs rename to src/test/ui/issue-10969.rs diff --git a/src/test/ui/issue-10969.stderr b/src/test/ui/issue-10969.stderr new file mode 100644 index 0000000000000..f537c51026e14 --- /dev/null +++ b/src/test/ui/issue-10969.stderr @@ -0,0 +1,26 @@ +error[E0618]: expected function, found `i32` + --> $DIR/issue-10969.rs:12:5 + | +12 | i(); //~ERROR expected function, found `i32` + | ^^^ + | +note: defined here + --> $DIR/issue-10969.rs:11:9 + | +11 | fn func(i: i32) { //~NOTE defined here + | ^ + +error[E0618]: expected function, found `i32` + --> $DIR/issue-10969.rs:16:5 + | +16 | i(); //~ERROR expected function, found `i32` + | ^^^ + | +note: defined here + --> $DIR/issue-10969.rs:15:9 + | +15 | let i = 0i32; //~NOTE defined here + | ^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-11004.rs b/src/test/ui/issue-11004.rs similarity index 100% rename from src/test/compile-fail/issue-11004.rs rename to src/test/ui/issue-11004.rs diff --git a/src/test/ui/issue-11004.stderr b/src/test/ui/issue-11004.stderr new file mode 100644 index 0000000000000..3dfa14bc415ce --- /dev/null +++ b/src/test/ui/issue-11004.stderr @@ -0,0 +1,18 @@ +error[E0609]: no field `x` on type `*mut A` + --> $DIR/issue-11004.rs:17:21 + | +17 | let x : i32 = n.x; //~ no field `x` on type `*mut A` + | ^ + | + = note: `n` is a native pointer; perhaps you need to deref with `(*n).x` + +error[E0609]: no field `y` on type `*mut A` + --> $DIR/issue-11004.rs:19:21 + | +19 | let y : f64 = n.y; //~ no field `y` on type `*mut A` + | ^ + | + = note: `n` is a native pointer; perhaps you need to deref with `(*n).y` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-11319.rs b/src/test/ui/issue-11319.rs similarity index 100% rename from src/test/compile-fail/issue-11319.rs rename to src/test/ui/issue-11319.rs diff --git a/src/test/ui/issue-11319.stderr b/src/test/ui/issue-11319.stderr new file mode 100644 index 0000000000000..bcb7dd8b8f5b1 --- /dev/null +++ b/src/test/ui/issue-11319.stderr @@ -0,0 +1,22 @@ +error[E0308]: match arms have incompatible types + --> $DIR/issue-11319.rs:12:5 + | +12 | / match Some(10) { +13 | | //~^ ERROR match arms have incompatible types +14 | | //~| expected type `bool` +15 | | //~| found type `()` +... | +20 | | _ => true +21 | | } + | |_____^ expected bool, found () + | + = note: expected type `bool` + found type `()` +note: match arm with an incompatible type + --> $DIR/issue-11319.rs:19:20 + | +19 | None => (), //~ NOTE match arm with an incompatible type + | ^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-12187-1.rs b/src/test/ui/issue-12187-1.rs similarity index 100% rename from src/test/compile-fail/issue-12187-1.rs rename to src/test/ui/issue-12187-1.rs diff --git a/src/test/ui/issue-12187-1.stderr b/src/test/ui/issue-12187-1.stderr new file mode 100644 index 0000000000000..e36c278df6e41 --- /dev/null +++ b/src/test/ui/issue-12187-1.stderr @@ -0,0 +1,11 @@ +error[E0282]: type annotations needed + --> $DIR/issue-12187-1.rs:16:10 + | +16 | let &v = new(); + | -^ + | || + | |cannot infer type for `_` + | consider giving the pattern a type + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-12187-2.rs b/src/test/ui/issue-12187-2.rs similarity index 100% rename from src/test/compile-fail/issue-12187-2.rs rename to src/test/ui/issue-12187-2.rs diff --git a/src/test/ui/issue-12187-2.stderr b/src/test/ui/issue-12187-2.stderr new file mode 100644 index 0000000000000..b72c23987ec3c --- /dev/null +++ b/src/test/ui/issue-12187-2.stderr @@ -0,0 +1,11 @@ +error[E0282]: type annotations needed + --> $DIR/issue-12187-2.rs:16:10 + | +16 | let &v = new(); + | -^ + | || + | |cannot infer type for `_` + | consider giving the pattern a type + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-12511.rs b/src/test/ui/issue-12511.rs similarity index 100% rename from src/test/compile-fail/issue-12511.rs rename to src/test/ui/issue-12511.rs diff --git a/src/test/ui/issue-12511.stderr b/src/test/ui/issue-12511.stderr new file mode 100644 index 0000000000000..3f039d9496df0 --- /dev/null +++ b/src/test/ui/issue-12511.stderr @@ -0,0 +1,20 @@ +error[E0391]: unsupported cyclic reference between types/traits detected + --> $DIR/issue-12511.rs:16:1 + | +16 | trait t2 : t1 { + | ^^^^^^^^^^^^^ cyclic reference + | +note: the cycle begins when computing the supertraits of `t1`... + --> $DIR/issue-12511.rs:11:1 + | +11 | trait t1 : t2 { + | ^^^^^^^^^^^^^ +note: ...which then requires computing the supertraits of `t2`... + --> $DIR/issue-12511.rs:11:1 + | +11 | trait t1 : t2 { + | ^^^^^^^^^^^^^ + = note: ...which then again requires computing the supertraits of `t1`, completing the cycle. + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-13058.rs b/src/test/ui/issue-13058.rs similarity index 100% rename from src/test/compile-fail/issue-13058.rs rename to src/test/ui/issue-13058.rs diff --git a/src/test/ui/issue-13058.stderr b/src/test/ui/issue-13058.stderr new file mode 100644 index 0000000000000..fb8fb058daa26 --- /dev/null +++ b/src/test/ui/issue-13058.stderr @@ -0,0 +1,23 @@ +error[E0621]: explicit lifetime required in the type of `cont` + --> $DIR/issue-13058.rs:24:26 + | +22 | fn check<'r, I: Iterator, T: Itble<'r, usize, I>>(cont: &T) -> bool + | ---- consider changing the type of `cont` to `&'r T` +23 | { +24 | let cont_iter = cont.iter(); + | ^^^^ lifetime `'r` required + +error[E0308]: mismatched types + --> $DIR/issue-13058.rs:36:11 + | +36 | check((3, 5)); + | ^^^^^^ + | | + | expected reference, found tuple + | help: consider borrowing here: `&(3, 5)` + | + = note: expected type `&_` + found type `({integer}, {integer})` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-14092.rs b/src/test/ui/issue-14092.rs similarity index 100% rename from src/test/compile-fail/issue-14092.rs rename to src/test/ui/issue-14092.rs diff --git a/src/test/ui/issue-14092.stderr b/src/test/ui/issue-14092.stderr new file mode 100644 index 0000000000000..e0b5bdb93d80e --- /dev/null +++ b/src/test/ui/issue-14092.stderr @@ -0,0 +1,8 @@ +error[E0243]: wrong number of type arguments: expected 1, found 0 + --> $DIR/issue-14092.rs:11:11 + | +11 | fn fn1(0: Box) {} + | ^^^ expected 1 type argument + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-15260.rs b/src/test/ui/issue-15260.rs similarity index 100% rename from src/test/compile-fail/issue-15260.rs rename to src/test/ui/issue-15260.rs diff --git a/src/test/ui/issue-15260.stderr b/src/test/ui/issue-15260.stderr new file mode 100644 index 0000000000000..f33662a7ee911 --- /dev/null +++ b/src/test/ui/issue-15260.stderr @@ -0,0 +1,36 @@ +error[E0025]: field `a` bound multiple times in the pattern + --> $DIR/issue-15260.rs:18:9 + | +17 | a: _, //~ NOTE first use of `a` + | ---- first use of `a` +18 | a: _ + | ^^^^ multiple uses of `a` in pattern + +error[E0025]: field `a` bound multiple times in the pattern + --> $DIR/issue-15260.rs:25:9 + | +24 | a, //~ NOTE first use of `a` + | - first use of `a` +25 | a: _ + | ^^^^ multiple uses of `a` in pattern + +error[E0025]: field `a` bound multiple times in the pattern + --> $DIR/issue-15260.rs:34:9 + | +31 | a, + | - first use of `a` +... +34 | a: _, + | ^^^^ multiple uses of `a` in pattern + +error[E0025]: field `a` bound multiple times in the pattern + --> $DIR/issue-15260.rs:37:9 + | +31 | a, + | - first use of `a` +... +37 | a: x + | ^^^^ multiple uses of `a` in pattern + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/issue-15524.rs b/src/test/ui/issue-15524.rs similarity index 100% rename from src/test/compile-fail/issue-15524.rs rename to src/test/ui/issue-15524.rs diff --git a/src/test/ui/issue-15524.stderr b/src/test/ui/issue-15524.stderr new file mode 100644 index 0000000000000..9a26b4d4af4ee --- /dev/null +++ b/src/test/ui/issue-15524.stderr @@ -0,0 +1,29 @@ +error[E0081]: discriminant value `1isize` already exists + --> $DIR/issue-15524.rs:18:9 + | +14 | A = 1, + | - first use of `1isize` +... +18 | B = 1, + | ^ enum already has `1isize` + +error[E0081]: discriminant value `1isize` already exists + --> $DIR/issue-15524.rs:22:5 + | +14 | A = 1, + | - first use of `1isize` +... +22 | D, + | ^ enum already has `1isize` + +error[E0081]: discriminant value `1isize` already exists + --> $DIR/issue-15524.rs:26:9 + | +14 | A = 1, + | - first use of `1isize` +... +26 | E = N, + | ^ enum already has `1isize` + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/issue-17263.rs b/src/test/ui/issue-17263.rs similarity index 100% rename from src/test/compile-fail/issue-17263.rs rename to src/test/ui/issue-17263.rs diff --git a/src/test/ui/issue-17263.stderr b/src/test/ui/issue-17263.stderr new file mode 100644 index 0000000000000..934311ee41292 --- /dev/null +++ b/src/test/ui/issue-17263.stderr @@ -0,0 +1,24 @@ +error[E0499]: cannot borrow `x` (via `x.b`) as mutable more than once at a time + --> $DIR/issue-17263.rs:17:34 + | +17 | let (a, b) = (&mut x.a, &mut x.b); + | --- ^^^ second mutable borrow occurs here (via `x.b`) + | | + | first mutable borrow occurs here (via `x.a`) +... +27 | } + | - first borrow ends here + +error[E0502]: cannot borrow `foo` (via `foo.b`) as immutable because `foo` is also borrowed as mutable (via `foo.a`) + --> $DIR/issue-17263.rs:23:32 + | +23 | let (c, d) = (&mut foo.a, &foo.b); + | ----- ^^^^^ immutable borrow occurs here (via `foo.b`) + | | + | mutable borrow occurs here (via `foo.a`) +... +27 | } + | - mutable borrow ends here + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-17441.rs b/src/test/ui/issue-17441.rs similarity index 100% rename from src/test/compile-fail/issue-17441.rs rename to src/test/ui/issue-17441.rs diff --git a/src/test/ui/issue-17441.stderr b/src/test/ui/issue-17441.stderr new file mode 100644 index 0000000000000..4b0feb844291d --- /dev/null +++ b/src/test/ui/issue-17441.stderr @@ -0,0 +1,46 @@ +error[E0620]: cast to unsized type: `&[usize; 2]` as `[usize]` + --> $DIR/issue-17441.rs:12:16 + | +12 | let _foo = &[1_usize, 2] as [usize]; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: consider using an implicit coercion to `&[usize]` instead + --> $DIR/issue-17441.rs:12:16 + | +12 | let _foo = &[1_usize, 2] as [usize]; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0620]: cast to unsized type: `std::boxed::Box` as `std::fmt::Debug` + --> $DIR/issue-17441.rs:16:16 + | +16 | let _bar = Box::new(1_usize) as std::fmt::Debug; + | ^^^^^^^^^^^^^^^^^^^^^--------------- + | | + | help: try casting to a `Box` instead: `Box` + +error[E0620]: cast to unsized type: `usize` as `std::fmt::Debug` + --> $DIR/issue-17441.rs:20:16 + | +20 | let _baz = 1_usize as std::fmt::Debug; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: consider using a box or reference as appropriate + --> $DIR/issue-17441.rs:20:16 + | +20 | let _baz = 1_usize as std::fmt::Debug; + | ^^^^^^^ + +error[E0620]: cast to unsized type: `[usize; 2]` as `[usize]` + --> $DIR/issue-17441.rs:24:17 + | +24 | let _quux = [1_usize, 2] as [usize]; + | ^^^^^^^^^^^^^^^^^^^^^^^ + | +help: consider using a box or reference as appropriate + --> $DIR/issue-17441.rs:24:17 + | +24 | let _quux = [1_usize, 2] as [usize]; + | ^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/issue-17954.rs b/src/test/ui/issue-17954.rs similarity index 100% rename from src/test/compile-fail/issue-17954.rs rename to src/test/ui/issue-17954.rs diff --git a/src/test/ui/issue-17954.stderr b/src/test/ui/issue-17954.stderr new file mode 100644 index 0000000000000..cfd8da1d67b41 --- /dev/null +++ b/src/test/ui/issue-17954.stderr @@ -0,0 +1,13 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-17954.rs:17:14 + | +17 | let a = &FOO; + | ^^^ does not live long enough +... +25 | } //~ temporary value only lives until here + | - temporary value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-18183.rs b/src/test/ui/issue-18183.rs similarity index 100% rename from src/test/compile-fail/issue-18183.rs rename to src/test/ui/issue-18183.rs diff --git a/src/test/ui/issue-18183.stderr b/src/test/ui/issue-18183.stderr new file mode 100644 index 0000000000000..3105080226110 --- /dev/null +++ b/src/test/ui/issue-18183.stderr @@ -0,0 +1,8 @@ +error[E0128]: type parameters with a default cannot use forward declared identifiers + --> $DIR/issue-18183.rs:11:20 + | +11 | pub struct Foo(Bar); //~ ERROR E0128 + | ^^^ defaulted type parameters cannot be forward declared + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-18819.rs b/src/test/ui/issue-18819.rs similarity index 100% rename from src/test/compile-fail/issue-18819.rs rename to src/test/ui/issue-18819.rs diff --git a/src/test/ui/issue-18819.stderr b/src/test/ui/issue-18819.stderr new file mode 100644 index 0000000000000..a3f1b23c27042 --- /dev/null +++ b/src/test/ui/issue-18819.stderr @@ -0,0 +1,14 @@ +error[E0061]: this function takes 2 parameters but 1 parameter was supplied + --> $DIR/issue-18819.rs:27:13 + | +21 | / fn print_x(_: &Foo, extra: &str) { +22 | | //~^ NOTE defined here +23 | | println!("{}", extra); +24 | | } + | |_- defined here +... +27 | print_x(X); + | ^ expected 2 parameters + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-19498.rs b/src/test/ui/issue-19498.rs similarity index 100% rename from src/test/compile-fail/issue-19498.rs rename to src/test/ui/issue-19498.rs diff --git a/src/test/ui/issue-19498.stderr b/src/test/ui/issue-19498.stderr new file mode 100644 index 0000000000000..fca9d1581b337 --- /dev/null +++ b/src/test/ui/issue-19498.stderr @@ -0,0 +1,46 @@ +error[E0255]: the name `A` is defined multiple times + --> $DIR/issue-19498.rs:13:1 + | +11 | use self::A; //~ NOTE previous import of the module `A` here + | ------- previous import of the module `A` here +12 | use self::B; //~ NOTE previous import of the module `B` here +13 | mod A {} //~ ERROR the name `A` is defined multiple times + | ^^^^^^^^ `A` redefined here + | + = note: `A` 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 + | +11 | use self::A as OtherA; //~ NOTE previous import of the module `A` here + | ^^^^^^^^^^^^^^^^^ + +error[E0255]: the name `B` is defined multiple times + --> $DIR/issue-19498.rs:16:1 + | +12 | use self::B; //~ NOTE previous import of the module `B` here + | ------- previous import of the module `B` here +... +16 | pub mod B {} //~ ERROR the name `B` is defined multiple times + | ^^^^^^^^^^^^ `B` redefined here + | + = note: `B` 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 + | +12 | use self::B as OtherB; //~ NOTE previous import of the module `B` here + | ^^^^^^^^^^^^^^^^^ + +error[E0255]: the name `D` is defined multiple times + --> $DIR/issue-19498.rs:21:5 + | +20 | use C::D; //~ NOTE previous import of the module `D` here + | ---- previous import of the module `D` here +21 | mod D {} //~ ERROR the name `D` is defined multiple times + | ^^^^^^^^ `D` redefined here + | + = note: `D` 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 C::D as OtherD; //~ NOTE previous import of the module `D` here + | ^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/issue-1962.rs b/src/test/ui/issue-1962.rs similarity index 100% rename from src/test/compile-fail/issue-1962.rs rename to src/test/ui/issue-1962.rs diff --git a/src/test/ui/issue-1962.stderr b/src/test/ui/issue-1962.stderr new file mode 100644 index 0000000000000..4e34898bebe69 --- /dev/null +++ b/src/test/ui/issue-1962.stderr @@ -0,0 +1,17 @@ +error: denote infinite loops with `loop { ... }` + --> $DIR/issue-1962.rs:14:3 + | +14 | while true { //~ ERROR denote infinite loops with `loop + | ^--------- + | | + | ___help: use `loop` + | | +15 | | i += 1; +16 | | if i == 5 { break; } +17 | | } + | |___^ + | + = note: requested on the command line with `-D while-true` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-19707.rs b/src/test/ui/issue-19707.rs similarity index 100% rename from src/test/compile-fail/issue-19707.rs rename to src/test/ui/issue-19707.rs diff --git a/src/test/ui/issue-19707.stderr b/src/test/ui/issue-19707.stderr new file mode 100644 index 0000000000000..73f6823fa80cb --- /dev/null +++ b/src/test/ui/issue-19707.stderr @@ -0,0 +1,18 @@ +error[E0106]: missing lifetime specifier + --> $DIR/issue-19707.rs:13:28 + | +13 | type foo = fn(&u8, &u8) -> &u8; //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2 + +error[E0106]: missing lifetime specifier + --> $DIR/issue-19707.rs:16:27 + | +16 | fn bar &u8>(f: &F) {} //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2 + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-19922.rs b/src/test/ui/issue-19922.rs similarity index 100% rename from src/test/compile-fail/issue-19922.rs rename to src/test/ui/issue-19922.rs diff --git a/src/test/ui/issue-19922.stderr b/src/test/ui/issue-19922.stderr new file mode 100644 index 0000000000000..f96392441967f --- /dev/null +++ b/src/test/ui/issue-19922.stderr @@ -0,0 +1,10 @@ +error[E0559]: variant `Homura::Akemi` has no field named `kaname` + --> $DIR/issue-19922.rs:16:34 + | +16 | let homura = Homura::Akemi { kaname: () }; + | ^^^^^^^ `Homura::Akemi` does not have this field + | + = note: available fields are: `madoka` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-20692.rs b/src/test/ui/issue-20692.rs similarity index 100% rename from src/test/compile-fail/issue-20692.rs rename to src/test/ui/issue-20692.rs diff --git a/src/test/ui/issue-20692.stderr b/src/test/ui/issue-20692.stderr new file mode 100644 index 0000000000000..08ce96ece6a3e --- /dev/null +++ b/src/test/ui/issue-20692.stderr @@ -0,0 +1,19 @@ +error[E0038]: the trait `Array` cannot be made into an object + --> $DIR/issue-20692.rs:20:5 + | +20 | &Array; + | ^^^^^^ the trait `Array` cannot be made into an object + | + = note: the trait cannot require that `Self : Sized` + +error[E0038]: the trait `Array` cannot be made into an object + --> $DIR/issue-20692.rs:14:13 + | +14 | let _ = x + | ^ the trait `Array` cannot be made into an object + | + = note: the trait cannot require that `Self : Sized` + = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&Array>` for `&T` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-21546.rs b/src/test/ui/issue-21546.rs similarity index 100% rename from src/test/compile-fail/issue-21546.rs rename to src/test/ui/issue-21546.rs diff --git a/src/test/ui/issue-21546.stderr b/src/test/ui/issue-21546.stderr new file mode 100644 index 0000000000000..aea93ec1c8bd1 --- /dev/null +++ b/src/test/ui/issue-21546.stderr @@ -0,0 +1,68 @@ +error[E0428]: the name `Foo` is defined multiple times + --> $DIR/issue-21546.rs:18:1 + | +14 | mod Foo { } + | ----------- previous definition of the module `Foo` here +... +18 | struct Foo; + | ^^^^^^^^^^^ `Foo` redefined here + | + = note: `Foo` must be defined only once in the type namespace of this module + +error[E0428]: the name `Bar` is defined multiple times + --> $DIR/issue-21546.rs:28:1 + | +24 | mod Bar { } + | ----------- previous definition of the module `Bar` here +... +28 | struct Bar(i32); + | ^^^^^^^^^^^^^^^^ `Bar` redefined here + | + = note: `Bar` must be defined only once in the type namespace of this module + +error[E0428]: the name `Baz` is defined multiple times + --> $DIR/issue-21546.rs:39:1 + | +35 | struct Baz(i32); + | ---------------- previous definition of the type `Baz` here +... +39 | mod Baz { } + | ^^^^^^^^^^^ `Baz` redefined here + | + = note: `Baz` must be defined only once in the type namespace of this module + +error[E0428]: the name `Qux` is defined multiple times + --> $DIR/issue-21546.rs:50:1 + | +46 | struct Qux { x: bool } + | ---------------------- previous definition of the type `Qux` here +... +50 | mod Qux { } + | ^^^^^^^^^^^ `Qux` redefined here + | + = note: `Qux` must be defined only once in the type namespace of this module + +error[E0428]: the name `Quux` is defined multiple times + --> $DIR/issue-21546.rs:61:1 + | +57 | struct Quux; + | ------------ previous definition of the type `Quux` here +... +61 | mod Quux { } + | ^^^^^^^^^^^^ `Quux` redefined here + | + = note: `Quux` must be defined only once in the type namespace of this module + +error[E0428]: the name `Corge` is defined multiple times + --> $DIR/issue-21546.rs:72:1 + | +68 | enum Corge { A, B } + | ------------------- previous definition of the type `Corge` here +... +72 | mod Corge { } + | ^^^^^^^^^^^^^ `Corge` redefined here + | + = note: `Corge` must be defined only once in the type namespace of this module + +error: aborting due to 6 previous errors + diff --git a/src/test/compile-fail/issue-21600.rs b/src/test/ui/issue-21600.rs similarity index 100% rename from src/test/compile-fail/issue-21600.rs rename to src/test/ui/issue-21600.rs diff --git a/src/test/ui/issue-21600.stderr b/src/test/ui/issue-21600.stderr new file mode 100644 index 0000000000000..4cbc4448f78b9 --- /dev/null +++ b/src/test/ui/issue-21600.stderr @@ -0,0 +1,32 @@ +error[E0387]: cannot borrow data mutably in a captured outer variable in an `Fn` closure + --> $DIR/issue-21600.rs:24:17 + | +24 | call_it(|| x.gen_mut()); //~ ERROR cannot borrow data mutably in a captured outer + | ^^ + | +help: consider changing this to accept closures that implement `FnMut` + --> $DIR/issue-21600.rs:22:13 + | +22 | call_it(|| { //~ HELP consider changing this to accept closures that implement `FnMut` + | _____________^ +23 | | call_it(|| x.gen()); +24 | | call_it(|| x.gen_mut()); //~ ERROR cannot borrow data mutably in a captured outer +25 | | //~^ ERROR cannot borrow data mutably in a captured outer +26 | | //~| HELP consider changing this closure to take self by mutable reference +27 | | }); + | |_____^ + +error[E0387]: cannot borrow data mutably in a captured outer variable in an `Fn` closure + --> $DIR/issue-21600.rs:24:20 + | +24 | call_it(|| x.gen_mut()); //~ ERROR cannot borrow data mutably in a captured outer + | ^ + | +help: consider changing this closure to take self by mutable reference + --> $DIR/issue-21600.rs:24:17 + | +24 | call_it(|| x.gen_mut()); //~ ERROR cannot borrow data mutably in a captured outer + | ^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-21950.rs b/src/test/ui/issue-21950.rs similarity index 100% rename from src/test/compile-fail/issue-21950.rs rename to src/test/ui/issue-21950.rs diff --git a/src/test/ui/issue-21950.stderr b/src/test/ui/issue-21950.stderr new file mode 100644 index 0000000000000..123d61a261db1 --- /dev/null +++ b/src/test/ui/issue-21950.stderr @@ -0,0 +1,16 @@ +error[E0393]: the type parameter `RHS` must be explicitly specified + --> $DIR/issue-21950.rs:17:14 + | +17 | &Add; + | ^^^ missing reference to `RHS` + | + = note: because of the default `Self` reference, type parameters must be specified on object types + +error[E0191]: the value of the associated type `Output` (from the trait `std::ops::Add`) must be specified + --> $DIR/issue-21950.rs:17:14 + | +17 | &Add; + | ^^^ missing associated type `Output` value + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-22370.rs b/src/test/ui/issue-22370.rs similarity index 100% rename from src/test/compile-fail/issue-22370.rs rename to src/test/ui/issue-22370.rs diff --git a/src/test/ui/issue-22370.stderr b/src/test/ui/issue-22370.stderr new file mode 100644 index 0000000000000..9498000ca56eb --- /dev/null +++ b/src/test/ui/issue-22370.stderr @@ -0,0 +1,10 @@ +error[E0393]: the type parameter `T` must be explicitly specified + --> $DIR/issue-22370.rs:15:10 + | +15 | fn f(a: &A) {} + | ^ missing reference to `T` + | + = note: because of the default `Self` reference, type parameters must be specified on object types + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-22560.rs b/src/test/ui/issue-22560.rs similarity index 100% rename from src/test/compile-fail/issue-22560.rs rename to src/test/ui/issue-22560.rs diff --git a/src/test/ui/issue-22560.stderr b/src/test/ui/issue-22560.stderr new file mode 100644 index 0000000000000..8eac545e40c20 --- /dev/null +++ b/src/test/ui/issue-22560.stderr @@ -0,0 +1,37 @@ +error[E0393]: the type parameter `RHS` must be explicitly specified + --> $DIR/issue-22560.rs:15:13 + | +15 | type Test = Add + + | ^^^ missing reference to `RHS` + | + = note: because of the default `Self` reference, type parameters must be specified on object types + +error[E0393]: the type parameter `RHS` must be explicitly specified + --> $DIR/issue-22560.rs:21:13 + | +21 | Sub; + | ^^^ missing reference to `RHS` + | + = note: because of the default `Self` reference, type parameters must be specified on object types + +error[E0225]: only auto traits can be used as additional traits in a trait object + --> $DIR/issue-22560.rs:21:13 + | +21 | Sub; + | ^^^ non-auto additional trait + +error[E0191]: the value of the associated type `Output` (from the trait `std::ops::Add`) must be specified + --> $DIR/issue-22560.rs:15:13 + | +15 | type Test = Add + + | _____________^ +16 | | //~^ ERROR E0393 +17 | | //~| NOTE missing reference to `RHS` +18 | | //~| NOTE because of the default `Self` reference, type parameters must be specified on object types +19 | | //~| ERROR E0191 +20 | | //~| NOTE missing associated type `Output` value +21 | | Sub; + | |_______________^ missing associated type `Output` value + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/issue-22886.rs b/src/test/ui/issue-22886.rs similarity index 100% rename from src/test/compile-fail/issue-22886.rs rename to src/test/ui/issue-22886.rs diff --git a/src/test/ui/issue-22886.stderr b/src/test/ui/issue-22886.stderr new file mode 100644 index 0000000000000..23d05edc919b3 --- /dev/null +++ b/src/test/ui/issue-22886.stderr @@ -0,0 +1,8 @@ +error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-22886.rs:23:6 + | +23 | impl<'a> Iterator for Newtype { //~ ERROR E0207 + | ^^ unconstrained lifetime parameter + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-22933-2.rs b/src/test/ui/issue-22933-2.rs similarity index 100% rename from src/test/compile-fail/issue-22933-2.rs rename to src/test/ui/issue-22933-2.rs diff --git a/src/test/ui/issue-22933-2.stderr b/src/test/ui/issue-22933-2.stderr new file mode 100644 index 0000000000000..29e4c02d435e3 --- /dev/null +++ b/src/test/ui/issue-22933-2.stderr @@ -0,0 +1,11 @@ +error[E0599]: no variant named `PIE` found for type `Delicious` in the current scope + --> $DIR/issue-22933-2.rs:14:44 + | +11 | enum Delicious { //~ NOTE variant `PIE` not found here + | -------------- variant `PIE` not found here +... +14 | ApplePie = Delicious::Apple as isize | Delicious::PIE as isize, + | ^^^^^^^^^^^^^^ variant not found in `Delicious` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-23041.rs b/src/test/ui/issue-23041.rs similarity index 100% rename from src/test/compile-fail/issue-23041.rs rename to src/test/ui/issue-23041.rs diff --git a/src/test/ui/issue-23041.stderr b/src/test/ui/issue-23041.stderr new file mode 100644 index 0000000000000..048ae5834e3c4 --- /dev/null +++ b/src/test/ui/issue-23041.stderr @@ -0,0 +1,8 @@ +error[E0282]: type annotations needed + --> $DIR/issue-23041.rs:16:22 + | +16 | b.downcast_ref::_>(); //~ ERROR E0282 + | ^^^^^^^^ cannot infer type for `_` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-23173.rs b/src/test/ui/issue-23173.rs similarity index 100% rename from src/test/compile-fail/issue-23173.rs rename to src/test/ui/issue-23173.rs diff --git a/src/test/ui/issue-23173.stderr b/src/test/ui/issue-23173.stderr new file mode 100644 index 0000000000000..2e1b9b45f93d6 --- /dev/null +++ b/src/test/ui/issue-23173.stderr @@ -0,0 +1,38 @@ +error[E0599]: no variant named `Homura` found for type `Token` in the current scope + --> $DIR/issue-23173.rs:23:16 + | +11 | enum Token { LeftParen, RightParen, Plus, Minus, /* etc */ } + | ---------- variant `Homura` not found here +... +23 | use_token(&Token::Homura); + | ^^^^^^^^^^^^^ variant not found in `Token` + +error[E0599]: no function or associated item named `method` found for type `Struct` in the current scope + --> $DIR/issue-23173.rs:26:5 + | +13 | struct Struct { + | ------------- function or associated item `method` not found for this +... +26 | Struct::method(); + | ^^^^^^^^^^^^^^ function or associated item not found in `Struct` + +error[E0599]: no function or associated item named `method` found for type `Struct` in the current scope + --> $DIR/issue-23173.rs:29:5 + | +13 | struct Struct { + | ------------- function or associated item `method` not found for this +... +29 | Struct::method; + | ^^^^^^^^^^^^^^ function or associated item not found in `Struct` + +error[E0599]: no associated item named `Assoc` found for type `Struct` in the current scope + --> $DIR/issue-23173.rs:32:5 + | +13 | struct Struct { + | ------------- associated item `Assoc` not found for this +... +32 | Struct::Assoc; + | ^^^^^^^^^^^^^ associated item not found in `Struct` + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/issue-23217.rs b/src/test/ui/issue-23217.rs similarity index 100% rename from src/test/compile-fail/issue-23217.rs rename to src/test/ui/issue-23217.rs diff --git a/src/test/ui/issue-23217.stderr b/src/test/ui/issue-23217.stderr new file mode 100644 index 0000000000000..7c46a131f722d --- /dev/null +++ b/src/test/ui/issue-23217.stderr @@ -0,0 +1,10 @@ +error[E0599]: no variant named `A` found for type `SomeEnum` in the current scope + --> $DIR/issue-23217.rs:12:9 + | +11 | pub enum SomeEnum { //~ NOTE variant `A` not found here + | ----------------- variant `A` not found here +12 | B = SomeEnum::A, + | ^^^^^^^^^^^ variant not found in `SomeEnum` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-23302.rs b/src/test/ui/issue-23302.rs similarity index 100% rename from src/test/compile-fail/issue-23302.rs rename to src/test/ui/issue-23302.rs diff --git a/src/test/ui/issue-23302.stderr b/src/test/ui/issue-23302.stderr new file mode 100644 index 0000000000000..32caa7611ef55 --- /dev/null +++ b/src/test/ui/issue-23302.stderr @@ -0,0 +1,26 @@ +error[E0265]: recursive constant + --> $DIR/issue-23302.rs:14:9 + | +14 | A = X::A as isize, //~ ERROR E0265 + | ^^^^^^^^^^^^^ recursion not allowed in constant + +error[E0265]: recursive constant + --> $DIR/issue-23302.rs:21:9 + | +21 | A = Y::B as isize, //~ ERROR E0265 + | ^^^^^^^^^^^^^ recursion not allowed in constant + +error[E0265]: recursive constant + --> $DIR/issue-23302.rs:26:1 + | +26 | const A: i32 = B; //~ ERROR E0265 + | ^^^^^^^^^^^^^^^^^ recursion not allowed in constant + +error[E0265]: recursive constant + --> $DIR/issue-23302.rs:29:1 + | +29 | const B: i32 = A; //~ ERROR E0265 + | ^^^^^^^^^^^^^^^^^ recursion not allowed in constant + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/issue-23543.rs b/src/test/ui/issue-23543.rs similarity index 100% rename from src/test/compile-fail/issue-23543.rs rename to src/test/ui/issue-23543.rs diff --git a/src/test/ui/issue-23543.stderr b/src/test/ui/issue-23543.stderr new file mode 100644 index 0000000000000..e5181960753bd --- /dev/null +++ b/src/test/ui/issue-23543.stderr @@ -0,0 +1,8 @@ +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-23543.rs:17:17 + | +17 | where T: A; + | ^^^^^^^^^^^ associated type not allowed here + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-23544.rs b/src/test/ui/issue-23544.rs similarity index 100% rename from src/test/compile-fail/issue-23544.rs rename to src/test/ui/issue-23544.rs diff --git a/src/test/ui/issue-23544.stderr b/src/test/ui/issue-23544.stderr new file mode 100644 index 0000000000000..496a7aff7b731 --- /dev/null +++ b/src/test/ui/issue-23544.stderr @@ -0,0 +1,8 @@ +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-23544.rs:15:17 + | +15 | where T: A; + | ^^^^^^^^^^^^^^^^^^^^^^^ associated type not allowed here + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-23716.rs b/src/test/ui/issue-23716.rs similarity index 100% rename from src/test/compile-fail/issue-23716.rs rename to src/test/ui/issue-23716.rs diff --git a/src/test/ui/issue-23716.stderr b/src/test/ui/issue-23716.stderr new file mode 100644 index 0000000000000..cedff3318249a --- /dev/null +++ b/src/test/ui/issue-23716.stderr @@ -0,0 +1,20 @@ +error[E0530]: function parameters cannot shadow statics + --> $DIR/issue-23716.rs:14:8 + | +11 | static foo: i32 = 0; + | -------------------- a static `foo` is defined here +... +14 | fn bar(foo: i32) {} + | ^^^ cannot be named the same as a static + +error[E0530]: function parameters cannot shadow statics + --> $DIR/issue-23716.rs:25:13 + | +22 | use self::submod::answer; + | -------------------- a static `answer` is imported here +... +25 | fn question(answer: i32) {} + | ^^^^^^ cannot be named the same as a static + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-24036.rs b/src/test/ui/issue-24036.rs similarity index 100% rename from src/test/compile-fail/issue-24036.rs rename to src/test/ui/issue-24036.rs diff --git a/src/test/ui/issue-24036.stderr b/src/test/ui/issue-24036.stderr new file mode 100644 index 0000000000000..8486c14417c5b --- /dev/null +++ b/src/test/ui/issue-24036.stderr @@ -0,0 +1,63 @@ +error[E0308]: mismatched types + --> $DIR/issue-24036.rs:13:9 + | +13 | x = |c| c + 1; + | ^^^^^^^^^ expected closure, found a different closure + | + = note: expected type `[closure@$DIR/issue-24036.rs:12:17: 12:26]` + found type `[closure@$DIR/issue-24036.rs:13:9: 13:18]` +note: no two closures, even if identical, have the same type + --> $DIR/issue-24036.rs:13:9 + | +13 | x = |c| c + 1; + | ^^^^^^^^^ +help: consider boxing your closure and/or using it as a trait object + --> $DIR/issue-24036.rs:13:9 + | +13 | x = |c| c + 1; + | ^^^^^^^^^ + +error[E0308]: match arms have incompatible types + --> $DIR/issue-24036.rs:23:13 + | +23 | let x = match 1usize { + | _____________^ +24 | | 1 => |c| c + 1, +25 | | 2 => |c| c - 1, +26 | | //~^ NOTE match arm with an incompatible type +27 | | _ => |c| c - 1 +28 | | }; + | |_____^ expected closure, found a different closure + | + = note: expected type `[closure@$DIR/issue-24036.rs:24:14: 24:23]` + found type `[closure@$DIR/issue-24036.rs:25:14: 25:23]` +note: no two closures, even if identical, have the same type + --> $DIR/issue-24036.rs:23:13 + | +23 | let x = match 1usize { + | _____________^ +24 | | 1 => |c| c + 1, +25 | | 2 => |c| c - 1, +26 | | //~^ NOTE match arm with an incompatible type +27 | | _ => |c| c - 1 +28 | | }; + | |_____^ +help: consider boxing your closure and/or using it as a trait object + --> $DIR/issue-24036.rs:23:13 + | +23 | let x = match 1usize { + | _____________^ +24 | | 1 => |c| c + 1, +25 | | 2 => |c| c - 1, +26 | | //~^ NOTE match arm with an incompatible type +27 | | _ => |c| c - 1 +28 | | }; + | |_____^ +note: match arm with an incompatible type + --> $DIR/issue-24036.rs:25:14 + | +25 | 2 => |c| c - 1, + | ^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-24081.rs b/src/test/ui/issue-24081.rs similarity index 100% rename from src/test/compile-fail/issue-24081.rs rename to src/test/ui/issue-24081.rs diff --git a/src/test/ui/issue-24081.stderr b/src/test/ui/issue-24081.stderr new file mode 100644 index 0000000000000..599f23b84623f --- /dev/null +++ b/src/test/ui/issue-24081.stderr @@ -0,0 +1,77 @@ +error[E0255]: the name `Add` is defined multiple times + --> $DIR/issue-24081.rs:17:1 + | +11 | use std::ops::Add; //~ NOTE previous import of the trait `Add` here + | ------------- previous import of the trait `Add` here +... +17 | type Add = bool; //~ ERROR the name `Add` is defined multiple times + | ^^^^^^^^^^^^^^^^ `Add` redefined here + | + = note: `Add` 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 + | +11 | use std::ops::Add as OtherAdd; //~ NOTE previous import of the trait `Add` here + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0255]: the name `Sub` is defined multiple times + --> $DIR/issue-24081.rs:20:1 + | +12 | use std::ops::Sub; //~ NOTE previous import of the trait `Sub` here + | ------------- previous import of the trait `Sub` here +... +20 | struct Sub { x: f32 } //~ ERROR the name `Sub` is defined multiple times + | ^^^^^^^^^^^^^^^^^^^^^ `Sub` redefined here + | + = note: `Sub` 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 + | +12 | use std::ops::Sub as OtherSub; //~ NOTE previous import of the trait `Sub` here + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0255]: the name `Mul` is defined multiple times + --> $DIR/issue-24081.rs:23:1 + | +13 | use std::ops::Mul; //~ NOTE previous import of the trait `Mul` here + | ------------- previous import of the trait `Mul` here +... +23 | enum Mul { A, B } //~ ERROR the name `Mul` is defined multiple times + | ^^^^^^^^^^^^^^^^^ `Mul` redefined here + | + = note: `Mul` 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 + | +13 | use std::ops::Mul as OtherMul; //~ NOTE previous import of the trait `Mul` here + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0255]: the name `Div` is defined multiple times + --> $DIR/issue-24081.rs:26:1 + | +14 | use std::ops::Div; //~ NOTE previous import of the trait `Div` here + | ------------- previous import of the trait `Div` here +... +26 | mod Div { } //~ ERROR the name `Div` is defined multiple times + | ^^^^^^^^^^^ `Div` redefined here + | + = note: `Div` 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 + | +14 | use std::ops::Div as OtherDiv; //~ NOTE previous import of the trait `Div` here + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0255]: the name `Rem` is defined multiple times + --> $DIR/issue-24081.rs:29:1 + | +15 | use std::ops::Rem; //~ NOTE previous import of the trait `Rem` here + | ------------- previous import of the trait `Rem` here +... +29 | trait Rem { } //~ ERROR the name `Rem` is defined multiple times + | ^^^^^^^^^^^^^^ `Rem` redefined here + | + = note: `Rem` 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 + | +15 | use std::ops::Rem as OtherRem; //~ NOTE previous import of the trait `Rem` here + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/issue-24424.rs b/src/test/ui/issue-24424.rs similarity index 100% rename from src/test/compile-fail/issue-24424.rs rename to src/test/ui/issue-24424.rs diff --git a/src/test/ui/issue-24424.stderr b/src/test/ui/issue-24424.stderr new file mode 100644 index 0000000000000..acdf348791b20 --- /dev/null +++ b/src/test/ui/issue-24424.stderr @@ -0,0 +1,10 @@ +error[E0283]: type annotations required: cannot resolve `T0: Trait0<'l0>` + --> $DIR/issue-24424.rs:14:1 + | +14 | impl <'l0, 'l1, T0> Trait1<'l0, T0> for bool where T0 : Trait0<'l0>, T0 : Trait0<'l1> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: required by `Trait0` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-25385.rs b/src/test/ui/issue-25385.rs similarity index 100% rename from src/test/compile-fail/issue-25385.rs rename to src/test/ui/issue-25385.rs diff --git a/src/test/ui/issue-25385.stderr b/src/test/ui/issue-25385.stderr new file mode 100644 index 0000000000000..2e000115ae87d --- /dev/null +++ b/src/test/ui/issue-25385.stderr @@ -0,0 +1,17 @@ +error[E0599]: no method named `foo` found for type `i32` in the current scope + --> $DIR/issue-25385.rs:13:23 + | +13 | ($e:expr) => { $e.foo() } + | ^^^ +... +19 | foo!(a); + | -------- in this macro invocation + +error[E0599]: no method named `foo` found for type `i32` in the current scope + --> $DIR/issue-25385.rs:22:15 + | +22 | foo!(1i32.foo()); + | ^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-25793.rs b/src/test/ui/issue-25793.rs similarity index 100% rename from src/test/compile-fail/issue-25793.rs rename to src/test/ui/issue-25793.rs diff --git a/src/test/ui/issue-25793.stderr b/src/test/ui/issue-25793.stderr new file mode 100644 index 0000000000000..2a8368c47a945 --- /dev/null +++ b/src/test/ui/issue-25793.stderr @@ -0,0 +1,13 @@ +error[E0503]: cannot use `self.width` because it was mutably borrowed + --> $DIR/issue-25793.rs:13:9 + | +13 | $this.width.unwrap() + | ^^^^^^^^^^^ use of borrowed `*self` +... +29 | self.get_size(width!(self)) + | ---- ------------ in this macro invocation + | | + | borrow of `*self` occurs here + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-25826.rs b/src/test/ui/issue-25826.rs similarity index 100% rename from src/test/compile-fail/issue-25826.rs rename to src/test/ui/issue-25826.rs diff --git a/src/test/ui/issue-25826.stderr b/src/test/ui/issue-25826.stderr new file mode 100644 index 0000000000000..3b6599ccbd6da --- /dev/null +++ b/src/test/ui/issue-25826.stderr @@ -0,0 +1,8 @@ +error[E0395]: raw pointers cannot be compared in constants + --> $DIR/issue-25826.rs:13:21 + | +13 | const A: bool = id:: as *const () < id:: as *const (); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comparing raw pointers in static + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-26056.rs b/src/test/ui/issue-26056.rs similarity index 100% rename from src/test/compile-fail/issue-26056.rs rename to src/test/ui/issue-26056.rs diff --git a/src/test/ui/issue-26056.stderr b/src/test/ui/issue-26056.stderr new file mode 100644 index 0000000000000..b95438314c398 --- /dev/null +++ b/src/test/ui/issue-26056.stderr @@ -0,0 +1,10 @@ +error[E0038]: the trait `Map` cannot be made into an object + --> $DIR/issue-26056.rs:30:13 + | +30 | as &Map; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Map` cannot be made into an object + | + = note: the trait cannot use `Self` as a type parameter in the supertraits or where-clauses + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-26093.rs b/src/test/ui/issue-26093.rs similarity index 100% rename from src/test/compile-fail/issue-26093.rs rename to src/test/ui/issue-26093.rs diff --git a/src/test/ui/issue-26093.stderr b/src/test/ui/issue-26093.stderr new file mode 100644 index 0000000000000..1af248d1631a0 --- /dev/null +++ b/src/test/ui/issue-26093.stderr @@ -0,0 +1,11 @@ +error[E0070]: invalid left-hand side expression + --> $DIR/issue-26093.rs:13:9 + | +13 | $thing = 42; + | ^^^^^^^^^^^ left-hand of expression not valid +... +20 | not_an_lvalue!(99); + | ------------------- in this macro invocation + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-26472.rs b/src/test/ui/issue-26472.rs similarity index 100% rename from src/test/compile-fail/issue-26472.rs rename to src/test/ui/issue-26472.rs diff --git a/src/test/ui/issue-26472.stderr b/src/test/ui/issue-26472.stderr new file mode 100644 index 0000000000000..5b61aa98c3f97 --- /dev/null +++ b/src/test/ui/issue-26472.stderr @@ -0,0 +1,10 @@ +error[E0616]: field `len` of struct `sub::S` is private + --> $DIR/issue-26472.rs:21:13 + | +21 | let v = s.len; + | ^^^^^ + | + = note: a method `len` also exists, perhaps you wish to call it + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-26638.rs b/src/test/ui/issue-26638.rs similarity index 100% rename from src/test/compile-fail/issue-26638.rs rename to src/test/ui/issue-26638.rs diff --git a/src/test/ui/issue-26638.stderr b/src/test/ui/issue-26638.stderr new file mode 100644 index 0000000000000..733c46adbf978 --- /dev/null +++ b/src/test/ui/issue-26638.stderr @@ -0,0 +1,28 @@ +error[E0106]: missing lifetime specifier + --> $DIR/issue-26638.rs:11:58 + | +11 | fn parse_type(iter: Box+'static>) -> &str { iter.next() } + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say which one of `iter`'s 2 lifetimes it is borrowed from + +error[E0106]: missing lifetime specifier + --> $DIR/issue-26638.rs:15:40 + | +15 | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments + = help: consider giving it an explicit bounded or 'static lifetime + +error[E0106]: missing lifetime specifier + --> $DIR/issue-26638.rs:20:22 + | +20 | fn parse_type_3() -> &str { unimplemented!() } + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from + = help: consider giving it a 'static lifetime + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/issue-26886.rs b/src/test/ui/issue-26886.rs similarity index 100% rename from src/test/compile-fail/issue-26886.rs rename to src/test/ui/issue-26886.rs diff --git a/src/test/ui/issue-26886.stderr b/src/test/ui/issue-26886.stderr new file mode 100644 index 0000000000000..1cdf5174a9697 --- /dev/null +++ b/src/test/ui/issue-26886.stderr @@ -0,0 +1,32 @@ +error[E0252]: the name `Arc` is defined multiple times + --> $DIR/issue-26886.rs:13:5 + | +11 | use std::sync::{self, Arc}; //~ NOTE previous import of the type `Arc` here + | --- previous import of the type `Arc` here +12 | //~^ NOTE previous import of the module `sync` here +13 | use std::sync::Arc; //~ ERROR the name `Arc` is defined multiple times + | ^^^^^^^^^^^^^^ `Arc` reimported here + | + = note: `Arc` 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 + | +13 | use std::sync::Arc as OtherArc; //~ ERROR the name `Arc` is defined multiple times + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0252]: the name `sync` is defined multiple times + --> $DIR/issue-26886.rs:16:5 + | +11 | use std::sync::{self, Arc}; //~ NOTE previous import of the type `Arc` here + | ---- previous import of the module `sync` here +... +16 | use std::sync; //~ ERROR the name `sync` is defined multiple times + | ^^^^^^^^^ `sync` reimported here + | + = note: `sync` 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 + | +16 | use std::sync as Othersync; //~ ERROR the name `sync` is defined multiple times + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-27842.rs b/src/test/ui/issue-27842.rs similarity index 97% rename from src/test/compile-fail/issue-27842.rs rename to src/test/ui/issue-27842.rs index eb28e36dc076e..b4cfa6072927d 100644 --- a/src/test/compile-fail/issue-27842.rs +++ b/src/test/ui/issue-27842.rs @@ -14,7 +14,6 @@ fn main() { let _ = tup[0]; //~^ ERROR cannot index into a value of type //~| HELP to access tuple elements, use - //~| SUGGESTION tup.0 // the case where we show just a general hint let i = 0_usize; diff --git a/src/test/ui/issue-27842.stderr b/src/test/ui/issue-27842.stderr new file mode 100644 index 0000000000000..30bc3a85a1161 --- /dev/null +++ b/src/test/ui/issue-27842.stderr @@ -0,0 +1,16 @@ +error[E0608]: cannot index into a value of type `({integer}, {integer}, {integer})` + --> $DIR/issue-27842.rs:14:13 + | +14 | let _ = tup[0]; + | ^^^^^^ help: to access tuple elements, use: `tup.0` + +error[E0608]: cannot index into a value of type `({integer}, {integer}, {integer})` + --> $DIR/issue-27842.rs:20:13 + | +20 | let _ = tup[i]; + | ^^^^^^ + | + = help: to access tuple elements, use tuple indexing syntax (e.g. `tuple.0`) + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-27942.rs b/src/test/ui/issue-27942.rs similarity index 100% rename from src/test/compile-fail/issue-27942.rs rename to src/test/ui/issue-27942.rs diff --git a/src/test/ui/issue-27942.stderr b/src/test/ui/issue-27942.stderr new file mode 100644 index 0000000000000..528377adcb705 --- /dev/null +++ b/src/test/ui/issue-27942.stderr @@ -0,0 +1,52 @@ +error[E0308]: mismatched types + --> $DIR/issue-27942.rs:17:5 + | +17 | fn select(&self) -> BufferViewHandle; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Resources<'_>` + found type `Resources<'a>` +note: the anonymous lifetime #1 defined on the method body at 17:5... + --> $DIR/issue-27942.rs:17:5 + | +17 | fn select(&self) -> BufferViewHandle; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: ...does not necessarily outlive the lifetime 'a as defined on the trait at 13:1 + --> $DIR/issue-27942.rs:13:1 + | +13 | / pub trait Buffer<'a, R: Resources<'a>> { +14 | | //~^ NOTE the lifetime 'a as defined on the trait at 13:1... +15 | | //~| NOTE ...does not necessarily outlive the lifetime 'a as defined on the trait +16 | | +... | +25 | | //~| NOTE the anonymous lifetime #1 defined on the method body at 17:5... +26 | | } + | |_^ + +error[E0308]: mismatched types + --> $DIR/issue-27942.rs:17:5 + | +17 | fn select(&self) -> BufferViewHandle; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Resources<'_>` + found type `Resources<'a>` +note: the lifetime 'a as defined on the trait at 13:1... + --> $DIR/issue-27942.rs:13:1 + | +13 | / pub trait Buffer<'a, R: Resources<'a>> { +14 | | //~^ NOTE the lifetime 'a as defined on the trait at 13:1... +15 | | //~| NOTE ...does not necessarily outlive the lifetime 'a as defined on the trait +16 | | +... | +25 | | //~| NOTE the anonymous lifetime #1 defined on the method body at 17:5... +26 | | } + | |_^ +note: ...does not necessarily outlive the anonymous lifetime #1 defined on the method body at 17:5 + --> $DIR/issue-27942.rs:17:5 + | +17 | fn select(&self) -> BufferViewHandle; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-2848.rs b/src/test/ui/issue-2848.rs similarity index 100% rename from src/test/compile-fail/issue-2848.rs rename to src/test/ui/issue-2848.rs diff --git a/src/test/ui/issue-2848.stderr b/src/test/ui/issue-2848.stderr new file mode 100644 index 0000000000000..6d4ed9c01111f --- /dev/null +++ b/src/test/ui/issue-2848.stderr @@ -0,0 +1,10 @@ +error[E0408]: variable `beta` is not bound in all patterns + --> $DIR/issue-2848.rs:22:7 + | +22 | alpha | beta => {} //~ ERROR variable `beta` is not bound in all patterns + | ^^^^^ ---- variable not in all patterns + | | + | pattern doesn't bind `beta` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-28568.rs b/src/test/ui/issue-28568.rs similarity index 100% rename from src/test/compile-fail/issue-28568.rs rename to src/test/ui/issue-28568.rs diff --git a/src/test/ui/issue-28568.stderr b/src/test/ui/issue-28568.stderr new file mode 100644 index 0000000000000..19e1550248781 --- /dev/null +++ b/src/test/ui/issue-28568.stderr @@ -0,0 +1,18 @@ +error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `MyStruct`: + --> $DIR/issue-28568.rs:18:1 + | +13 | / impl Drop for MyStruct { +14 | | //~^ NOTE first implementation here +15 | | fn drop(&mut self) { } +16 | | } + | |_- first implementation here +17 | +18 | / impl Drop for MyStruct { +19 | | //~^ ERROR conflicting implementations of trait +20 | | //~| NOTE conflicting implementation for `MyStruct` +21 | | fn drop(&mut self) { } +22 | | } + | |_^ conflicting implementation for `MyStruct` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-28776.rs b/src/test/ui/issue-28776.rs similarity index 100% rename from src/test/compile-fail/issue-28776.rs rename to src/test/ui/issue-28776.rs diff --git a/src/test/ui/issue-28776.stderr b/src/test/ui/issue-28776.stderr new file mode 100644 index 0000000000000..cf24a8312af9b --- /dev/null +++ b/src/test/ui/issue-28776.stderr @@ -0,0 +1,8 @@ +error[E0133]: call to unsafe function requires unsafe function or block + --> $DIR/issue-28776.rs:14:5 + | +14 | (&ptr::write)(1 as *mut _, 42); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-28837.rs b/src/test/ui/issue-28837.rs similarity index 100% rename from src/test/compile-fail/issue-28837.rs rename to src/test/ui/issue-28837.rs diff --git a/src/test/ui/issue-28837.stderr b/src/test/ui/issue-28837.stderr new file mode 100644 index 0000000000000..71f9d57a0657b --- /dev/null +++ b/src/test/ui/issue-28837.stderr @@ -0,0 +1,122 @@ +error[E0369]: binary operation `+` cannot be applied to type `A` + --> $DIR/issue-28837.rs:16:5 + | +16 | a + a; //~ ERROR binary operation `+` cannot be applied to type `A` + | ^^^^^ + | + = note: an implementation of `std::ops::Add` might be missing for `A` + +error[E0369]: binary operation `-` cannot be applied to type `A` + --> $DIR/issue-28837.rs:19:5 + | +19 | a - a; //~ ERROR binary operation `-` cannot be applied to type `A` + | ^^^^^ + | + = note: an implementation of `std::ops::Sub` might be missing for `A` + +error[E0369]: binary operation `*` cannot be applied to type `A` + --> $DIR/issue-28837.rs:22:5 + | +22 | a * a; //~ ERROR binary operation `*` cannot be applied to type `A` + | ^^^^^ + | + = note: an implementation of `std::ops::Mul` might be missing for `A` + +error[E0369]: binary operation `/` cannot be applied to type `A` + --> $DIR/issue-28837.rs:25:5 + | +25 | a / a; //~ ERROR binary operation `/` cannot be applied to type `A` + | ^^^^^ + | + = note: an implementation of `std::ops::Div` might be missing for `A` + +error[E0369]: binary operation `%` cannot be applied to type `A` + --> $DIR/issue-28837.rs:28:5 + | +28 | a % a; //~ ERROR binary operation `%` cannot be applied to type `A` + | ^^^^^ + | + = note: an implementation of `std::ops::Rem` might be missing for `A` + +error[E0369]: binary operation `&` cannot be applied to type `A` + --> $DIR/issue-28837.rs:31:5 + | +31 | a & a; //~ ERROR binary operation `&` cannot be applied to type `A` + | ^^^^^ + | + = note: an implementation of `std::ops::BitAnd` might be missing for `A` + +error[E0369]: binary operation `|` cannot be applied to type `A` + --> $DIR/issue-28837.rs:34:5 + | +34 | a | a; //~ ERROR binary operation `|` cannot be applied to type `A` + | ^^^^^ + | + = note: an implementation of `std::ops::BitOr` might be missing for `A` + +error[E0369]: binary operation `<<` cannot be applied to type `A` + --> $DIR/issue-28837.rs:37:5 + | +37 | a << a; //~ ERROR binary operation `<<` cannot be applied to type `A` + | ^^^^^^ + | + = note: an implementation of `std::ops::Shl` might be missing for `A` + +error[E0369]: binary operation `>>` cannot be applied to type `A` + --> $DIR/issue-28837.rs:40:5 + | +40 | a >> a; //~ ERROR binary operation `>>` cannot be applied to type `A` + | ^^^^^^ + | + = note: an implementation of `std::ops::Shr` might be missing for `A` + +error[E0369]: binary operation `==` cannot be applied to type `A` + --> $DIR/issue-28837.rs:43:5 + | +43 | a == a; //~ ERROR binary operation `==` cannot be applied to type `A` + | ^^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `A` + +error[E0369]: binary operation `!=` cannot be applied to type `A` + --> $DIR/issue-28837.rs:46:5 + | +46 | a != a; //~ ERROR binary operation `!=` cannot be applied to type `A` + | ^^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `A` + +error[E0369]: binary operation `<` cannot be applied to type `A` + --> $DIR/issue-28837.rs:49:5 + | +49 | a < a; //~ ERROR binary operation `<` cannot be applied to type `A` + | ^^^^^ + | + = note: an implementation of `std::cmp::PartialOrd` might be missing for `A` + +error[E0369]: binary operation `<=` cannot be applied to type `A` + --> $DIR/issue-28837.rs:52:5 + | +52 | a <= a; //~ ERROR binary operation `<=` cannot be applied to type `A` + | ^^^^^^ + | + = note: an implementation of `std::cmp::PartialOrd` might be missing for `A` + +error[E0369]: binary operation `>` cannot be applied to type `A` + --> $DIR/issue-28837.rs:55:5 + | +55 | a > a; //~ ERROR binary operation `>` cannot be applied to type `A` + | ^^^^^ + | + = note: an implementation of `std::cmp::PartialOrd` might be missing for `A` + +error[E0369]: binary operation `>=` cannot be applied to type `A` + --> $DIR/issue-28837.rs:58:5 + | +58 | a >= a; //~ ERROR binary operation `>=` cannot be applied to type `A` + | ^^^^^^ + | + = note: an implementation of `std::cmp::PartialOrd` might be missing for `A` + +error: aborting due to 15 previous errors + diff --git a/src/test/compile-fail/issue-28971.rs b/src/test/ui/issue-28971.rs similarity index 100% rename from src/test/compile-fail/issue-28971.rs rename to src/test/ui/issue-28971.rs diff --git a/src/test/ui/issue-28971.stderr b/src/test/ui/issue-28971.stderr new file mode 100644 index 0000000000000..6a2cf0443735b --- /dev/null +++ b/src/test/ui/issue-28971.stderr @@ -0,0 +1,11 @@ +error[E0599]: no variant named `Baz` found for type `Foo` in the current scope + --> $DIR/issue-28971.rs:19:13 + | +13 | enum Foo { //~ NOTE variant `Baz` not found here + | -------- variant `Baz` not found here +... +19 | Foo::Baz(..) => (), + | ^^^^^^^^^^^^ variant not found in `Foo` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-29124.rs b/src/test/ui/issue-29124.rs similarity index 100% rename from src/test/compile-fail/issue-29124.rs rename to src/test/ui/issue-29124.rs diff --git a/src/test/ui/issue-29124.stderr b/src/test/ui/issue-29124.stderr new file mode 100644 index 0000000000000..7c350b18752bc --- /dev/null +++ b/src/test/ui/issue-29124.stderr @@ -0,0 +1,18 @@ +error[E0599]: no method named `x` found for type `fn() -> ret {obj::func}` in the current scope + --> $DIR/issue-29124.rs:25:15 + | +25 | obj::func.x(); + | ^ + | + = note: obj::func is a function, perhaps you wish to call it + +error[E0599]: no method named `x` found for type `fn() -> ret {func}` in the current scope + --> $DIR/issue-29124.rs:28:10 + | +28 | func.x(); + | ^ + | + = note: func is a function, perhaps you wish to call it + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-30007.rs b/src/test/ui/issue-30007.rs similarity index 100% rename from src/test/compile-fail/issue-30007.rs rename to src/test/ui/issue-30007.rs diff --git a/src/test/ui/issue-30007.stderr b/src/test/ui/issue-30007.stderr new file mode 100644 index 0000000000000..cf4bc10a3d756 --- /dev/null +++ b/src/test/ui/issue-30007.stderr @@ -0,0 +1,14 @@ +error: macro expansion ignores token `;` and any following + --> $DIR/issue-30007.rs:12:20 + | +12 | () => ( String ; ); //~ ERROR macro expansion ignores token `;` + | ^ + | +note: caused by the macro expansion here; the usage of `t!` is likely invalid in type context + --> $DIR/issue-30007.rs:16:16 + | +16 | let i: Vec; //~ NOTE caused by the macro expansion here + | ^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-3008-1.rs b/src/test/ui/issue-3008-1.rs similarity index 100% rename from src/test/compile-fail/issue-3008-1.rs rename to src/test/ui/issue-3008-1.rs diff --git a/src/test/ui/issue-3008-1.stderr b/src/test/ui/issue-3008-1.stderr new file mode 100644 index 0000000000000..7d1e139e5ce64 --- /dev/null +++ b/src/test/ui/issue-3008-1.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `Bar` has infinite size + --> $DIR/issue-3008-1.rs:15:1 + | +15 | enum Bar { + | ^^^^^^^^ recursive type has infinite size +... +19 | BarSome(Bar) //~ NOTE recursive without indirection + | ---- recursive without indirection + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Bar` representable + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-3008-2.rs b/src/test/ui/issue-3008-2.rs similarity index 100% rename from src/test/compile-fail/issue-3008-2.rs rename to src/test/ui/issue-3008-2.rs diff --git a/src/test/ui/issue-3008-2.stderr b/src/test/ui/issue-3008-2.stderr new file mode 100644 index 0000000000000..2d5e2966df9c6 --- /dev/null +++ b/src/test/ui/issue-3008-2.stderr @@ -0,0 +1,12 @@ +error[E0072]: recursive type `bar` has infinite size + --> $DIR/issue-3008-2.rs:12:1 + | +12 | struct bar { x: bar } + | ^^^^^^^^^^ ------ recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `bar` representable + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-30255.rs b/src/test/ui/issue-30255.rs similarity index 100% rename from src/test/compile-fail/issue-30255.rs rename to src/test/ui/issue-30255.rs diff --git a/src/test/ui/issue-30255.stderr b/src/test/ui/issue-30255.stderr new file mode 100644 index 0000000000000..54b14bc6419ce --- /dev/null +++ b/src/test/ui/issue-30255.stderr @@ -0,0 +1,26 @@ +error[E0106]: missing lifetime specifier + --> $DIR/issue-30255.rs:18:24 + | +18 | fn f(a: &S, b: i32) -> &i32 { + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say which one of `a`'s 2 lifetimes it is borrowed from + +error[E0106]: missing lifetime specifier + --> $DIR/issue-30255.rs:24:34 + | +24 | fn g(a: &S, b: bool, c: &i32) -> &i32 { + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from one of `a`'s 2 lifetimes or `c` + +error[E0106]: missing lifetime specifier + --> $DIR/issue-30255.rs:30:44 + | +30 | fn h(a: &bool, b: bool, c: &S, d: &i32) -> &i32 { + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a`, one of `c`'s 2 lifetimes, or `d` + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/issue-30302.rs b/src/test/ui/issue-30302.rs similarity index 100% rename from src/test/compile-fail/issue-30302.rs rename to src/test/ui/issue-30302.rs diff --git a/src/test/ui/issue-30302.stderr b/src/test/ui/issue-30302.stderr new file mode 100644 index 0000000000000..b880a4e0ea221 --- /dev/null +++ b/src/test/ui/issue-30302.stderr @@ -0,0 +1,27 @@ +warning[E0170]: pattern binding `Nil` is named the same as one of the variants of the type `Stack` + --> $DIR/issue-30302.rs:23:9 + | +23 | Nil => true, + | ^^^ + | + = help: if you meant to match on a variant, consider making the path in the pattern qualified: `Stack::Nil` + +error: unreachable pattern + --> $DIR/issue-30302.rs:26:9 + | +26 | _ => false + | ^ this is an unreachable pattern + | +note: lint level defined here + --> $DIR/issue-30302.rs:14:9 + | +14 | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ +note: this pattern matches any value + --> $DIR/issue-30302.rs:23:9 + | +23 | Nil => true, + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-3044.rs b/src/test/ui/issue-3044.rs similarity index 100% rename from src/test/compile-fail/issue-3044.rs rename to src/test/ui/issue-3044.rs diff --git a/src/test/ui/issue-3044.stderr b/src/test/ui/issue-3044.stderr new file mode 100644 index 0000000000000..3fede94c115f2 --- /dev/null +++ b/src/test/ui/issue-3044.stderr @@ -0,0 +1,10 @@ +error[E0061]: this function takes 2 parameters but 1 parameter was supplied + --> $DIR/issue-3044.rs:14:28 + | +14 | needlesArr.iter().fold(|x, y| { + | ____________________________^ +15 | | }); + | |_____^ expected 2 parameters + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-30730.rs b/src/test/ui/issue-30730.rs similarity index 100% rename from src/test/compile-fail/issue-30730.rs rename to src/test/ui/issue-30730.rs diff --git a/src/test/ui/issue-30730.stderr b/src/test/ui/issue-30730.stderr new file mode 100644 index 0000000000000..1a91ee2e84174 --- /dev/null +++ b/src/test/ui/issue-30730.stderr @@ -0,0 +1,15 @@ +error: unused import: `std::thread` + --> $DIR/issue-30730.rs:13:5 + | +13 | use std::thread; + | ^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/issue-30730.rs:12:9 + | +12 | #![deny(warnings)] //~ NOTE: lint level defined here + | ^^^^^^^^ + = note: #[deny(unused_imports)] implied by #[deny(warnings)] + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-31221.rs b/src/test/ui/issue-31221.rs similarity index 100% rename from src/test/compile-fail/issue-31221.rs rename to src/test/ui/issue-31221.rs diff --git a/src/test/ui/issue-31221.stderr b/src/test/ui/issue-31221.stderr new file mode 100644 index 0000000000000..13a2e5aeef7b5 --- /dev/null +++ b/src/test/ui/issue-31221.stderr @@ -0,0 +1,43 @@ +error: unreachable pattern + --> $DIR/issue-31221.rs:30:9 + | +30 | Var2 => (), + | ^^^^ this is an unreachable pattern + | +note: lint level defined here + --> $DIR/issue-31221.rs:14:9 + | +14 | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ +note: this pattern matches any value + --> $DIR/issue-31221.rs:28:9 + | +28 | Var3 => (), + | ^^^^ + +error: unreachable pattern + --> $DIR/issue-31221.rs:38:9 + | +38 | &Var2 => (), + | ^^^^^ this is an unreachable pattern + | +note: this pattern matches any value + --> $DIR/issue-31221.rs:36:9 + | +36 | &Var3 => (), + | ^^^^^ + +error: unreachable pattern + --> $DIR/issue-31221.rs:47:9 + | +47 | anything => () + | ^^^^^^^^ this is an unreachable pattern + | +note: this pattern matches any value + --> $DIR/issue-31221.rs:45:9 + | +45 | (c, d) => (), + | ^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/issue-32326.rs b/src/test/ui/issue-32326.rs similarity index 100% rename from src/test/compile-fail/issue-32326.rs rename to src/test/ui/issue-32326.rs diff --git a/src/test/ui/issue-32326.stderr b/src/test/ui/issue-32326.stderr new file mode 100644 index 0000000000000..79110a0547507 --- /dev/null +++ b/src/test/ui/issue-32326.stderr @@ -0,0 +1,15 @@ +error[E0072]: recursive type `Expr` has infinite size + --> $DIR/issue-32326.rs:15:1 + | +15 | enum Expr { //~ ERROR E0072 + | ^^^^^^^^^ recursive type has infinite size +16 | //~| NOTE recursive type has infinite size +17 | Plus(Expr, Expr), + | ----- ----- recursive without indirection + | | + | recursive without indirection + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Expr` representable + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-32950.rs b/src/test/ui/issue-32950.rs similarity index 100% rename from src/test/compile-fail/issue-32950.rs rename to src/test/ui/issue-32950.rs diff --git a/src/test/ui/issue-32950.stderr b/src/test/ui/issue-32950.stderr new file mode 100644 index 0000000000000..0933c81d65560 --- /dev/null +++ b/src/test/ui/issue-32950.stderr @@ -0,0 +1,9 @@ +error: `derive` cannot be used on items with type macros + --> $DIR/issue-32950.rs:15:5 + | +15 | / concat_idents!(Foo, Bar) //~ ERROR `derive` cannot be used on items with type macros +16 | | ); + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-34047.rs b/src/test/ui/issue-34047.rs similarity index 100% rename from src/test/compile-fail/issue-34047.rs rename to src/test/ui/issue-34047.rs diff --git a/src/test/ui/issue-34047.stderr b/src/test/ui/issue-34047.stderr new file mode 100644 index 0000000000000..d2e1826b63418 --- /dev/null +++ b/src/test/ui/issue-34047.stderr @@ -0,0 +1,11 @@ +error[E0530]: match bindings cannot shadow constants + --> $DIR/issue-34047.rs:15:13 + | +11 | const C: u8 = 0; //~ NOTE a constant `C` is defined here + | ---------------- a constant `C` is defined here +... +15 | mut C => {} //~ ERROR match bindings cannot shadow constants + | ^ cannot be named the same as a constant + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-34209.rs b/src/test/ui/issue-34209.rs similarity index 100% rename from src/test/compile-fail/issue-34209.rs rename to src/test/ui/issue-34209.rs diff --git a/src/test/ui/issue-34209.stderr b/src/test/ui/issue-34209.stderr new file mode 100644 index 0000000000000..a832aab4c2653 --- /dev/null +++ b/src/test/ui/issue-34209.stderr @@ -0,0 +1,10 @@ +error[E0223]: ambiguous associated type + --> $DIR/issue-34209.rs:17:9 + | +17 | S::B{ } => { }, + | ^^^^ ambiguous associated type + | + = note: specify the type using the syntax `::B` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-35139.rs b/src/test/ui/issue-35139.rs similarity index 100% rename from src/test/compile-fail/issue-35139.rs rename to src/test/ui/issue-35139.rs diff --git a/src/test/ui/issue-35139.stderr b/src/test/ui/issue-35139.stderr new file mode 100644 index 0000000000000..19356cad31797 --- /dev/null +++ b/src/test/ui/issue-35139.stderr @@ -0,0 +1,8 @@ +error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-35139.rs:19:6 + | +19 | impl<'a> MethodType for MTFn { //~ ERROR E0207 + | ^^ unconstrained lifetime parameter + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-35869.rs b/src/test/ui/issue-35869.rs similarity index 100% rename from src/test/compile-fail/issue-35869.rs rename to src/test/ui/issue-35869.rs diff --git a/src/test/ui/issue-35869.stderr b/src/test/ui/issue-35869.stderr new file mode 100644 index 0000000000000..cd79f8912ba23 --- /dev/null +++ b/src/test/ui/issue-35869.stderr @@ -0,0 +1,50 @@ +error[E0053]: method `foo` has an incompatible type for trait + --> $DIR/issue-35869.rs:23:15 + | +14 | fn foo(_: fn(u8) -> ()); //~ NOTE type in trait + | ------------ type in trait +... +23 | fn foo(_: fn(u16) -> ()) {} + | ^^^^^^^^^^^^^ expected u8, found u16 + | + = note: expected type `fn(fn(u8))` + found type `fn(fn(u16))` + +error[E0053]: method `bar` has an incompatible type for trait + --> $DIR/issue-35869.rs:27:15 + | +15 | fn bar(_: Option); //~ NOTE type in trait + | ---------- type in trait +... +27 | fn bar(_: Option) {} + | ^^^^^^^^^^^ expected u8, found u16 + | + = note: expected type `fn(std::option::Option)` + found type `fn(std::option::Option)` + +error[E0053]: method `baz` has an incompatible type for trait + --> $DIR/issue-35869.rs:31:15 + | +16 | fn baz(_: (u8, u16)); //~ NOTE type in trait + | --------- type in trait +... +31 | fn baz(_: (u16, u16)) {} + | ^^^^^^^^^^ expected u8, found u16 + | + = note: expected type `fn((u8, u16))` + found type `fn((u16, u16))` + +error[E0053]: method `qux` has an incompatible type for trait + --> $DIR/issue-35869.rs:35:17 + | +17 | fn qux() -> u8; //~ NOTE type in trait + | -- type in trait +... +35 | fn qux() -> u16 { 5u16 } + | ^^^ expected u8, found u16 + | + = note: expected type `fn() -> u8` + found type `fn() -> u16` + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/issue-36163.rs b/src/test/ui/issue-36163.rs similarity index 100% rename from src/test/compile-fail/issue-36163.rs rename to src/test/ui/issue-36163.rs diff --git a/src/test/ui/issue-36163.stderr b/src/test/ui/issue-36163.stderr new file mode 100644 index 0000000000000..79267bdbeed8a --- /dev/null +++ b/src/test/ui/issue-36163.stderr @@ -0,0 +1,20 @@ +error[E0265]: recursive constant + --> $DIR/issue-36163.rs:11:1 + | +11 | const A: i32 = Foo::B; //~ ERROR E0265 + | ^^^^^^^^^^^^^^^^^^^^^^ recursion not allowed in constant + +error[E0265]: recursive constant + --> $DIR/issue-36163.rs:15:9 + | +15 | B = A, //~ ERROR E0265 + | ^ recursion not allowed in constant + +error[E0265]: recursive constant + --> $DIR/issue-36163.rs:20:9 + | +20 | C = Bar::C, //~ ERROR E0265 + | ^^^^^^ recursion not allowed in constant + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/issue-36708.rs b/src/test/ui/issue-36708.rs similarity index 100% rename from src/test/compile-fail/issue-36708.rs rename to src/test/ui/issue-36708.rs diff --git a/src/test/ui/issue-36708.stderr b/src/test/ui/issue-36708.stderr new file mode 100644 index 0000000000000..016841de16902 --- /dev/null +++ b/src/test/ui/issue-36708.stderr @@ -0,0 +1,8 @@ +error[E0049]: method `foo` has 1 type parameter but its trait declaration has 0 type parameters + --> $DIR/issue-36708.rs:18:11 + | +18 | fn foo() {} + | ^^^ found 1 type parameter, expected 0 + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-3779.rs b/src/test/ui/issue-3779.rs similarity index 100% rename from src/test/compile-fail/issue-3779.rs rename to src/test/ui/issue-3779.rs diff --git a/src/test/ui/issue-3779.stderr b/src/test/ui/issue-3779.stderr new file mode 100644 index 0000000000000..18f2726b63ba3 --- /dev/null +++ b/src/test/ui/issue-3779.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `S` has infinite size + --> $DIR/issue-3779.rs:11:1 + | +11 | struct S { + | ^^^^^^^^ recursive type has infinite size +... +14 | element: Option + | ------------------ recursive without indirection + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `S` representable + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-37884.rs b/src/test/ui/issue-37884.rs similarity index 100% rename from src/test/compile-fail/issue-37884.rs rename to src/test/ui/issue-37884.rs diff --git a/src/test/ui/issue-37884.stderr b/src/test/ui/issue-37884.stderr new file mode 100644 index 0000000000000..b101adfdd7cba --- /dev/null +++ b/src/test/ui/issue-37884.stderr @@ -0,0 +1,39 @@ +error[E0308]: method not compatible with trait + --> $DIR/issue-37884.rs:17:5 + | +17 | / fn next(&'a mut self) -> Option +18 | | //~^ ERROR method not compatible with trait +19 | | //~| lifetime mismatch +20 | | //~| NOTE expected type `fn(&mut RepeatMut<'a, T>) -> std::option::Option<&mut T>` +... | +23 | | Some(&mut self.0) +24 | | } + | |_____^ lifetime mismatch + | + = note: expected type `fn(&mut RepeatMut<'a, T>) -> std::option::Option<&mut T>` + found type `fn(&'a mut RepeatMut<'a, T>) -> std::option::Option<&mut T>` +note: the anonymous lifetime #1 defined on the method body at 17:5... + --> $DIR/issue-37884.rs:17:5 + | +17 | / fn next(&'a mut self) -> Option +18 | | //~^ ERROR method not compatible with trait +19 | | //~| lifetime mismatch +20 | | //~| NOTE expected type `fn(&mut RepeatMut<'a, T>) -> std::option::Option<&mut T>` +... | +23 | | Some(&mut self.0) +24 | | } + | |_____^ +note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 13:1 + --> $DIR/issue-37884.rs:13:1 + | +13 | / impl<'a, T: 'a> Iterator for RepeatMut<'a, T> { +14 | | //~^ NOTE ...does not necessarily outlive the lifetime 'a as defined on the impl +15 | | +16 | | type Item = &'a mut T; +... | +24 | | } +25 | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-4335.rs b/src/test/ui/issue-4335.rs similarity index 100% rename from src/test/compile-fail/issue-4335.rs rename to src/test/ui/issue-4335.rs diff --git a/src/test/ui/issue-4335.stderr b/src/test/ui/issue-4335.stderr new file mode 100644 index 0000000000000..5840838b823d3 --- /dev/null +++ b/src/test/ui/issue-4335.stderr @@ -0,0 +1,20 @@ +error[E0373]: closure may outlive the current function, but it borrows `v`, which is owned by the current function + --> $DIR/issue-4335.rs:16:17 + | +16 | id(Box::new(|| *v)) + | ^^ - `v` is borrowed here + | | + | may outlive borrowed value `v` +help: to force the closure to take ownership of `v` (and any other referenced variables), use the `move` keyword + | +16 | id(Box::new(move || *v)) + | ^^^^^^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/issue-4335.rs:16:20 + | +16 | id(Box::new(|| *v)) + | ^^ cannot move out of borrowed content + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/issue-4935.rs b/src/test/ui/issue-4935.rs similarity index 100% rename from src/test/compile-fail/issue-4935.rs rename to src/test/ui/issue-4935.rs diff --git a/src/test/ui/issue-4935.stderr b/src/test/ui/issue-4935.stderr new file mode 100644 index 0000000000000..8859ab8550b8d --- /dev/null +++ b/src/test/ui/issue-4935.stderr @@ -0,0 +1,11 @@ +error[E0061]: this function takes 1 parameter but 2 parameters were supplied + --> $DIR/issue-4935.rs:15:17 + | +13 | fn foo(a: usize) {} + | ------------------- defined here +14 | //~^ defined here +15 | fn main() { foo(5, 6) } + | ^^^^ expected 1 parameter + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-5239-1.rs b/src/test/ui/issue-5239-1.rs similarity index 100% rename from src/test/compile-fail/issue-5239-1.rs rename to src/test/ui/issue-5239-1.rs diff --git a/src/test/ui/issue-5239-1.stderr b/src/test/ui/issue-5239-1.stderr new file mode 100644 index 0000000000000..b97b58981de62 --- /dev/null +++ b/src/test/ui/issue-5239-1.stderr @@ -0,0 +1,10 @@ +error[E0368]: binary assignment operation `+=` cannot be applied to type `&isize` + --> $DIR/issue-5239-1.rs:14:30 + | +14 | let x = |ref x: isize| { x += 1; }; + | -^^^^^ + | | + | cannot use `+=` on type `&isize` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-6458-3.rs b/src/test/ui/issue-6458-3.rs similarity index 100% rename from src/test/compile-fail/issue-6458-3.rs rename to src/test/ui/issue-6458-3.rs diff --git a/src/test/ui/issue-6458-3.stderr b/src/test/ui/issue-6458-3.stderr new file mode 100644 index 0000000000000..761a9b38f6f06 --- /dev/null +++ b/src/test/ui/issue-6458-3.stderr @@ -0,0 +1,8 @@ +error[E0282]: type annotations needed + --> $DIR/issue-6458-3.rs:14:5 + | +14 | mem::transmute(0); + | ^^^^^^^^^^^^^^ cannot infer type for `U` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-6458-4.rs b/src/test/ui/issue-6458-4.rs similarity index 100% rename from src/test/compile-fail/issue-6458-4.rs rename to src/test/ui/issue-6458-4.rs diff --git a/src/test/ui/issue-6458-4.stderr b/src/test/ui/issue-6458-4.stderr new file mode 100644 index 0000000000000..acb9b218df402 --- /dev/null +++ b/src/test/ui/issue-6458-4.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/issue-6458-4.rs:11:40 + | +11 | fn foo(b: bool) -> Result { //~ ERROR mismatched types + | ________________________________________^ +12 | | Err("bar".to_string()); //~ HELP consider removing this semicolon + | | - help: consider removing this semicolon +13 | | } + | |_^ expected enum `std::result::Result`, found () + | + = note: expected type `std::result::Result` + found type `()` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-6458.rs b/src/test/ui/issue-6458.rs similarity index 100% rename from src/test/compile-fail/issue-6458.rs rename to src/test/ui/issue-6458.rs diff --git a/src/test/ui/issue-6458.stderr b/src/test/ui/issue-6458.stderr new file mode 100644 index 0000000000000..b5d4ac831393f --- /dev/null +++ b/src/test/ui/issue-6458.stderr @@ -0,0 +1,8 @@ +error[E0282]: type annotations needed + --> $DIR/issue-6458.rs:19:4 + | +19 | foo(TypeWithState(marker::PhantomData)); + | ^^^ cannot infer type for `State` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-7813.rs b/src/test/ui/issue-7813.rs similarity index 100% rename from src/test/compile-fail/issue-7813.rs rename to src/test/ui/issue-7813.rs diff --git a/src/test/ui/issue-7813.stderr b/src/test/ui/issue-7813.stderr new file mode 100644 index 0000000000000..11f8e4d00fd1d --- /dev/null +++ b/src/test/ui/issue-7813.stderr @@ -0,0 +1,10 @@ +error[E0282]: type annotations needed + --> $DIR/issue-7813.rs:12:13 + | +12 | let v = &[]; //~ ERROR type annotations needed + | - ^^^ cannot infer type for `_` + | | + | consider giving `v` a type + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lifetime-elision-return-type-requires-explicit-lifetime.rs b/src/test/ui/lifetime-elision-return-type-requires-explicit-lifetime.rs similarity index 100% rename from src/test/compile-fail/lifetime-elision-return-type-requires-explicit-lifetime.rs rename to src/test/ui/lifetime-elision-return-type-requires-explicit-lifetime.rs diff --git a/src/test/ui/lifetime-elision-return-type-requires-explicit-lifetime.stderr b/src/test/ui/lifetime-elision-return-type-requires-explicit-lifetime.stderr new file mode 100644 index 0000000000000..3e67d9ab11b29 --- /dev/null +++ b/src/test/ui/lifetime-elision-return-type-requires-explicit-lifetime.stderr @@ -0,0 +1,54 @@ +error[E0106]: missing lifetime specifier + --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:12:11 + | +12 | fn f() -> &isize { //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from + = help: consider giving it a 'static lifetime + +error[E0106]: missing lifetime specifier + --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:19:33 + | +19 | fn g(_x: &isize, _y: &isize) -> &isize { //~ ERROR missing lifetime specifier + | ^ 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` + +error[E0106]: missing lifetime specifier + --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:30:19 + | +30 | fn h(_x: &Foo) -> &isize { //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say which one of `_x`'s 2 lifetimes it is borrowed from + +error[E0106]: missing lifetime specifier + --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:35:20 + | +35 | fn i(_x: isize) -> &isize { //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments + = help: consider giving it an explicit bounded or 'static lifetime + +error[E0106]: missing lifetime specifier + --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:50:24 + | +50 | fn j(_x: StaticStr) -> &isize { //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments + = help: consider giving it an explicit bounded or 'static lifetime + +error[E0106]: missing lifetime specifier + --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:58:49 + | +58 | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize { + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments + = help: consider giving it an explicit bounded or 'static lifetime + +error: aborting due to 6 previous errors + diff --git a/src/test/compile-fail/lint-forbid-attr.rs b/src/test/ui/lint-forbid-attr.rs similarity index 100% rename from src/test/compile-fail/lint-forbid-attr.rs rename to src/test/ui/lint-forbid-attr.rs diff --git a/src/test/ui/lint-forbid-attr.stderr b/src/test/ui/lint-forbid-attr.stderr new file mode 100644 index 0000000000000..e2ecb6a201e49 --- /dev/null +++ b/src/test/ui/lint-forbid-attr.stderr @@ -0,0 +1,11 @@ +error[E0453]: allow(deprecated) overruled by outer forbid(deprecated) + --> $DIR/lint-forbid-attr.rs:14:9 + | +11 | #![forbid(deprecated)] + | ---------- `forbid` level set here +... +14 | #[allow(deprecated)] + | ^^^^^^^^^^ overruled by previous forbid + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-output-format-2.rs b/src/test/ui/lint-output-format-2.rs similarity index 100% rename from src/test/compile-fail/lint-output-format-2.rs rename to src/test/ui/lint-output-format-2.rs diff --git a/src/test/ui/lint-output-format-2.stderr b/src/test/ui/lint-output-format-2.stderr new file mode 100644 index 0000000000000..b68eced0c1a73 --- /dev/null +++ b/src/test/ui/lint-output-format-2.stderr @@ -0,0 +1,24 @@ +warning: use of deprecated item 'lint_output_format::foo': text + --> $DIR/lint-output-format-2.rs:20:5 + | +20 | use lint_output_format::{foo, bar}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: #[warn(deprecated)] on by default + +warning: use of deprecated item 'lint_output_format::foo': text + --> $DIR/lint-output-format-2.rs:26:14 + | +26 | let _x = foo(); + | ^^^ + +error: compilation successful + --> $DIR/lint-output-format-2.rs:25:1 + | +25 | / fn main() { //~ ERROR: compilation successful +26 | | let _x = foo(); +27 | | //~^ WARNING use of deprecated item 'lint_output_format::foo': text +28 | | let _y = bar(); +29 | | } + | |_^ + diff --git a/src/test/compile-fail/lint-unconditional-recursion.rs b/src/test/ui/lint-unconditional-recursion.rs similarity index 100% rename from src/test/compile-fail/lint-unconditional-recursion.rs rename to src/test/ui/lint-unconditional-recursion.rs diff --git a/src/test/ui/lint-unconditional-recursion.stderr b/src/test/ui/lint-unconditional-recursion.stderr new file mode 100644 index 0000000000000..fc8b9f87d8009 --- /dev/null +++ b/src/test/ui/lint-unconditional-recursion.stderr @@ -0,0 +1,240 @@ +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:15:1 + | +15 | / fn foo() { //~ ERROR function cannot return without recurring +16 | | foo(); //~ NOTE recursive call site +17 | | } + | |_^ + | +note: lint level defined here + --> $DIR/lint-unconditional-recursion.rs:11:9 + | +11 | #![deny(unconditional_recursion)] + | ^^^^^^^^^^^^^^^^^^^^^^^ +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:16:5 + | +16 | foo(); //~ NOTE recursive call site + | ^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:25:1 + | +25 | / fn baz() { //~ ERROR function cannot return without recurring +26 | | if true { +27 | | baz() //~ NOTE recursive call site +28 | | } else { +29 | | baz() //~ NOTE recursive call site +30 | | } +31 | | } + | |_^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:27:9 + | +27 | baz() //~ NOTE recursive call site + | ^^^^^ +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:29:9 + | +29 | baz() //~ NOTE recursive call site + | ^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:37:1 + | +37 | / fn quz() -> bool { //~ ERROR function cannot return without recurring +38 | | if true { +39 | | while quz() {} //~ NOTE recursive call site +40 | | true +... | +43 | | } +44 | | } + | |_^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:39:15 + | +39 | while quz() {} //~ NOTE recursive call site + | ^^^^^ +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:42:16 + | +42 | loop { quz(); } //~ NOTE recursive call site + | ^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:48:5 + | +48 | / fn bar(&self) { //~ ERROR function cannot return without recurring +49 | | self.bar() //~ NOTE recursive call site +50 | | } + | |_____^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:49:9 + | +49 | self.bar() //~ NOTE recursive call site + | ^^^^^^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:54:5 + | +54 | / fn bar(&self) { //~ ERROR function cannot return without recurring +55 | | loop { +56 | | self.bar() //~ NOTE recursive call site +57 | | } +58 | | } + | |_____^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:56:13 + | +56 | self.bar() //~ NOTE recursive call site + | ^^^^^^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:63:5 + | +63 | / fn bar(&self) { //~ ERROR function cannot return without recurring +64 | | 0.bar() //~ NOTE recursive call site +65 | | } + | |_____^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:64:9 + | +64 | 0.bar() //~ NOTE recursive call site + | ^^^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:76:5 + | +76 | / fn bar(&self) { //~ ERROR function cannot return without recurring +77 | | Foo2::bar(self) //~ NOTE recursive call site +78 | | } + | |_____^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:77:9 + | +77 | Foo2::bar(self) //~ NOTE recursive call site + | ^^^^^^^^^^^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:82:5 + | +82 | / fn bar(&self) { //~ ERROR function cannot return without recurring +83 | | loop { +84 | | Foo2::bar(self) //~ NOTE recursive call site +85 | | } +86 | | } + | |_____^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:84:13 + | +84 | Foo2::bar(self) //~ NOTE recursive call site + | ^^^^^^^^^^^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:92:5 + | +92 | / fn qux(&self) { //~ ERROR function cannot return without recurring +93 | | self.qux(); //~ NOTE recursive call site +94 | | } + | |_____^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:93:9 + | +93 | self.qux(); //~ NOTE recursive call site + | ^^^^^^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:97:5 + | +97 | / fn as_ref(&self) -> &Self { //~ ERROR function cannot return without recurring +98 | | Baz::as_ref(self) //~ NOTE recursive call site +99 | | } + | |_____^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:98:9 + | +98 | Baz::as_ref(self) //~ NOTE recursive call site + | ^^^^^^^^^^^^^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:104:5 + | +104 | / fn default() -> Baz { //~ ERROR function cannot return without recurring +105 | | let x = Default::default(); //~ NOTE recursive call site +106 | | x +107 | | } + | |_____^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:105:17 + | +105 | let x = Default::default(); //~ NOTE recursive call site + | ^^^^^^^^^^^^^^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:113:5 + | +113 | / fn deref(&self) -> &() { //~ ERROR function cannot return without recurring +114 | | &**self //~ NOTE recursive call site +115 | | } + | |_____^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:114:10 + | +114 | &**self //~ NOTE recursive call site + | ^^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:120:5 + | +120 | / fn index(&self, x: usize) -> &Baz { //~ ERROR function cannot return without recurring +121 | | &self[x] //~ NOTE recursive call site +122 | | } + | |_____^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:121:10 + | +121 | &self[x] //~ NOTE recursive call site + | ^^^^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: function cannot return without recurring + --> $DIR/lint-unconditional-recursion.rs:129:5 + | +129 | / fn deref(&self) -> &Baz { //~ ERROR function cannot return without recurring +130 | | self.as_ref() //~ NOTE recursive call site +131 | | } + | |_____^ + | +note: recursive call site + --> $DIR/lint-unconditional-recursion.rs:130:9 + | +130 | self.as_ref() //~ NOTE recursive call site + | ^^^^ + = help: a `loop` may express intention better if this is on purpose + +error: aborting due to 14 previous errors + diff --git a/src/test/compile-fail/liveness-return-last-stmt-semi.rs b/src/test/ui/liveness-return-last-stmt-semi.rs similarity index 100% rename from src/test/compile-fail/liveness-return-last-stmt-semi.rs rename to src/test/ui/liveness-return-last-stmt-semi.rs diff --git a/src/test/ui/liveness-return-last-stmt-semi.stderr b/src/test/ui/liveness-return-last-stmt-semi.stderr new file mode 100644 index 0000000000000..f27091a115d1a --- /dev/null +++ b/src/test/ui/liveness-return-last-stmt-semi.stderr @@ -0,0 +1,51 @@ +error[E0308]: mismatched types + --> $DIR/liveness-return-last-stmt-semi.rs:13:45 + | +13 | macro_rules! test { () => { fn foo() -> i32 { 1; } } } + | ^^^-^^ + | | | + | | help: consider removing this semicolon + | expected i32, found () +... +28 | test!(); + | -------- in this macro invocation + | + = note: expected type `i32` + found type `()` + +error[E0308]: mismatched types + --> $DIR/liveness-return-last-stmt-semi.rs:17:23 + | +17 | fn no_return() -> i32 {} //~ ERROR mismatched types + | ^^ expected i32, found () + | + = note: expected type `i32` + found type `()` + +error[E0308]: mismatched types + --> $DIR/liveness-return-last-stmt-semi.rs:19:23 + | +19 | fn bar(x: u32) -> u32 { //~ ERROR mismatched types + | _______________________^ +20 | | x * 2; //~ HELP consider removing this semicolon + | | - help: consider removing this semicolon +21 | | } + | |_^ expected u32, found () + | + = note: expected type `u32` + found type `()` + +error[E0308]: mismatched types + --> $DIR/liveness-return-last-stmt-semi.rs:23:23 + | +23 | fn baz(x: u64) -> u32 { //~ ERROR mismatched types + | _______________________^ +24 | | x * 2; +25 | | } + | |_^ expected u32, found () + | + = note: expected type `u32` + found type `()` + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/loops-reject-duplicate-labels-2.rs b/src/test/ui/loops-reject-duplicate-labels-2.rs similarity index 100% rename from src/test/compile-fail/loops-reject-duplicate-labels-2.rs rename to src/test/ui/loops-reject-duplicate-labels-2.rs diff --git a/src/test/ui/loops-reject-duplicate-labels-2.stderr b/src/test/ui/loops-reject-duplicate-labels-2.stderr new file mode 100644 index 0000000000000..4bd318d5aa17c --- /dev/null +++ b/src/test/ui/loops-reject-duplicate-labels-2.stderr @@ -0,0 +1,72 @@ +warning: label name `'fl` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels-2.rs:23:7 + | +22 | { 'fl: for _ in 0..10 { break; } } //~ NOTE first declared here + | --- first declared here +23 | { 'fl: loop { break; } } //~ WARN label name `'fl` shadows a label name that is already in scope + | ^^^ lifetime 'fl already in scope + +warning: label name `'lf` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels-2.rs:26:7 + | +25 | { 'lf: loop { break; } } //~ NOTE first declared here + | --- first declared here +26 | { 'lf: for _ in 0..10 { break; } } //~ WARN label name `'lf` shadows a label name that is already in scope + | ^^^ lifetime 'lf already in scope + +warning: label name `'wl` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels-2.rs:29:7 + | +28 | { 'wl: while 2 > 1 { break; } } //~ NOTE first declared here + | --- first declared here +29 | { 'wl: loop { break; } } //~ WARN label name `'wl` shadows a label name that is already in scope + | ^^^ lifetime 'wl already in scope + +warning: label name `'lw` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels-2.rs:32:7 + | +31 | { 'lw: loop { break; } } //~ NOTE first declared here + | --- first declared here +32 | { 'lw: while 2 > 1 { break; } } //~ WARN label name `'lw` shadows a label name that is already in scope + | ^^^ lifetime 'lw already in scope + +warning: label name `'fw` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels-2.rs:35:7 + | +34 | { 'fw: for _ in 0..10 { break; } } //~ NOTE first declared here + | --- first declared here +35 | { 'fw: while 2 > 1 { break; } } //~ WARN label name `'fw` shadows a label name that is already in scope + | ^^^ lifetime 'fw already in scope + +warning: label name `'wf` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels-2.rs:38:7 + | +37 | { 'wf: while 2 > 1 { break; } } //~ NOTE first declared here + | --- first declared here +38 | { 'wf: for _ in 0..10 { break; } } //~ WARN label name `'wf` shadows a label name that is already in scope + | ^^^ lifetime 'wf already in scope + +warning: label name `'tl` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels-2.rs:41:7 + | +40 | { 'tl: while let Some(_) = None:: { break; } } //~ NOTE first declared here + | --- first declared here +41 | { 'tl: loop { break; } } //~ WARN label name `'tl` shadows a label name that is already in scope + | ^^^ lifetime 'tl already in scope + +warning: label name `'lt` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels-2.rs:44:7 + | +43 | { 'lt: loop { break; } } //~ NOTE first declared here + | --- first declared here +44 | { 'lt: while let Some(_) = None:: { break; } } + | ^^^ lifetime 'lt already in scope + +error: compilation successful + --> $DIR/loops-reject-duplicate-labels-2.rs:50:1 + | +50 | / pub fn main() { //~ ERROR compilation successful +51 | | foo(); +52 | | } + | |_^ + diff --git a/src/test/compile-fail/loops-reject-duplicate-labels.rs b/src/test/ui/loops-reject-duplicate-labels.rs similarity index 100% rename from src/test/compile-fail/loops-reject-duplicate-labels.rs rename to src/test/ui/loops-reject-duplicate-labels.rs diff --git a/src/test/ui/loops-reject-duplicate-labels.stderr b/src/test/ui/loops-reject-duplicate-labels.stderr new file mode 100644 index 0000000000000..f97be84f896dd --- /dev/null +++ b/src/test/ui/loops-reject-duplicate-labels.stderr @@ -0,0 +1,75 @@ +warning: label name `'fl` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels.rs:20:5 + | +19 | 'fl: for _ in 0..10 { break; } //~ NOTE first declared here + | --- first declared here +20 | 'fl: loop { break; } //~ WARN label name `'fl` shadows a label name that is already in scope + | ^^^ lifetime 'fl already in scope + +warning: label name `'lf` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels.rs:24:5 + | +23 | 'lf: loop { break; } //~ NOTE first declared here + | --- first declared here +24 | 'lf: for _ in 0..10 { break; } //~ WARN label name `'lf` shadows a label name that is already in scope + | ^^^ lifetime 'lf already in scope + +warning: label name `'wl` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels.rs:27:5 + | +26 | 'wl: while 2 > 1 { break; } //~ NOTE first declared here + | --- first declared here +27 | 'wl: loop { break; } //~ WARN label name `'wl` shadows a label name that is already in scope + | ^^^ lifetime 'wl already in scope + +warning: label name `'lw` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels.rs:30:5 + | +29 | 'lw: loop { break; } //~ NOTE first declared here + | --- first declared here +30 | 'lw: while 2 > 1 { break; } //~ WARN label name `'lw` shadows a label name that is already in scope + | ^^^ lifetime 'lw already in scope + +warning: label name `'fw` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels.rs:33:5 + | +32 | 'fw: for _ in 0..10 { break; } //~ NOTE first declared here + | --- first declared here +33 | 'fw: while 2 > 1 { break; } //~ WARN label name `'fw` shadows a label name that is already in scope + | ^^^ lifetime 'fw already in scope + +warning: label name `'wf` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels.rs:36:5 + | +35 | 'wf: while 2 > 1 { break; } //~ NOTE first declared here + | --- first declared here +36 | 'wf: for _ in 0..10 { break; } //~ WARN label name `'wf` shadows a label name that is already in scope + | ^^^ lifetime 'wf already in scope + +warning: label name `'tl` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels.rs:39:5 + | +38 | 'tl: while let Some(_) = None:: { break; } //~ NOTE first declared here + | --- first declared here +39 | 'tl: loop { break; } //~ WARN label name `'tl` shadows a label name that is already in scope + | ^^^ lifetime 'tl already in scope + +warning: label name `'lt` shadows a label name that is already in scope + --> $DIR/loops-reject-duplicate-labels.rs:42:5 + | +41 | 'lt: loop { break; } //~ NOTE first declared here + | --- first declared here +42 | 'lt: while let Some(_) = None:: { break; } + | ^^^ lifetime 'lt already in scope + +error: compilation successful + --> $DIR/loops-reject-duplicate-labels.rs:57:1 + | +57 | / pub fn main() { //~ ERROR compilation successful +58 | | let s = S; +59 | | s.m1(); +60 | | s.m2(); +61 | | foo(); +62 | | } + | |_^ + diff --git a/src/test/compile-fail/loops-reject-labels-shadowing-lifetimes.rs b/src/test/ui/loops-reject-labels-shadowing-lifetimes.rs similarity index 100% rename from src/test/compile-fail/loops-reject-labels-shadowing-lifetimes.rs rename to src/test/ui/loops-reject-labels-shadowing-lifetimes.rs diff --git a/src/test/ui/loops-reject-labels-shadowing-lifetimes.stderr b/src/test/ui/loops-reject-labels-shadowing-lifetimes.stderr new file mode 100644 index 0000000000000..bd2b439b70f96 --- /dev/null +++ b/src/test/ui/loops-reject-labels-shadowing-lifetimes.stderr @@ -0,0 +1,111 @@ +warning: label name `'a` shadows a lifetime name that is already in scope + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:20:9 + | +19 | fn foo<'a>() { //~ NOTE first declared here + | -- first declared here +20 | 'a: loop { break 'a; } + | ^^ lifetime 'a already in scope + +warning: label name `'bad` shadows a lifetime name that is already in scope + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:46:13 + | +44 | impl<'bad, 'c> Struct<'bad, 'c> { //~ NOTE first declared here + | ---- first declared here +45 | fn meth_bad(&self) { +46 | 'bad: loop { break 'bad; } + | ^^^^ lifetime 'bad already in scope + +warning: label name `'bad` shadows a lifetime name that is already in scope + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:54:13 + | +52 | impl<'b, 'bad> Struct<'b, 'bad> { //~ NOTE first declared here + | ---- first declared here +53 | fn meth_bad2(&self) { +54 | 'bad: loop { break 'bad; } + | ^^^^ lifetime 'bad already in scope + +warning: label name `'bad` shadows a lifetime name that is already in scope + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:62:13 + | +61 | fn meth_bad3<'bad>(x: &'bad i8) { //~ NOTE first declared here + | ---- first declared here +62 | 'bad: loop { break 'bad; } + | ^^^^ lifetime 'bad already in scope + +warning: label name `'bad` shadows a lifetime name that is already in scope + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:69:13 + | +67 | fn meth_bad4<'a,'bad>(x: &'a i8, y: &'bad i8) { + | ---- first declared here +68 | //~^ NOTE first declared here +69 | 'bad: loop { break 'bad; } + | ^^^^ lifetime 'bad already in scope + +warning: label name `'bad` shadows a lifetime name that is already in scope + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:77:13 + | +75 | impl <'bad, 'e> Enum<'bad, 'e> { //~ NOTE first declared here + | ---- first declared here +76 | fn meth_bad(&self) { +77 | 'bad: loop { break 'bad; } + | ^^^^ lifetime 'bad already in scope + +warning: label name `'bad` shadows a lifetime name that is already in scope + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:84:13 + | +82 | impl <'d, 'bad> Enum<'d, 'bad> { //~ NOTE first declared here + | ---- first declared here +83 | fn meth_bad2(&self) { +84 | 'bad: loop { break 'bad; } + | ^^^^ lifetime 'bad already in scope + +warning: label name `'bad` shadows a lifetime name that is already in scope + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:91:13 + | +90 | fn meth_bad3<'bad>(x: &'bad i8) { //~ NOTE first declared here + | ---- first declared here +91 | 'bad: loop { break 'bad; } + | ^^^^ lifetime 'bad already in scope + +warning: label name `'bad` shadows a lifetime name that is already in scope + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:97:13 + | +96 | fn meth_bad4<'a,'bad>(x: &'bad i8) { //~ NOTE first declared here + | ---- first declared here +97 | 'bad: loop { break 'bad; } + | ^^^^ lifetime 'bad already in scope + +warning: label name `'bad` shadows a lifetime name that is already in scope + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:108:13 + | +103 | trait HasDefaultMethod1<'bad> { //~ NOTE first declared here + | ---- first declared here +... +108 | 'bad: loop { break 'bad; } + | ^^^^ lifetime 'bad already in scope + +warning: label name `'bad` shadows a lifetime name that is already in scope + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:115:13 + | +113 | trait HasDefaultMethod2<'a,'bad> { //~ NOTE first declared here + | ---- first declared here +114 | fn meth_bad(&self) { +115 | 'bad: loop { break 'bad; } + | ^^^^ lifetime 'bad already in scope + +warning: label name `'bad` shadows a lifetime name that is already in scope + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:122:13 + | +121 | fn meth_bad<'bad>(&self) { //~ NOTE first declared here + | ---- first declared here +122 | 'bad: loop { break 'bad; } + | ^^^^ lifetime 'bad already in scope + +error: compilation successful + --> $DIR/loops-reject-labels-shadowing-lifetimes.rs:130:1 + | +130 | / pub fn main() { //~ ERROR compilation successful +131 | | foo(); +132 | | } + | |_^ + diff --git a/src/test/compile-fail/loops-reject-lifetime-shadowing-label.rs b/src/test/ui/loops-reject-lifetime-shadowing-label.rs similarity index 100% rename from src/test/compile-fail/loops-reject-lifetime-shadowing-label.rs rename to src/test/ui/loops-reject-lifetime-shadowing-label.rs diff --git a/src/test/ui/loops-reject-lifetime-shadowing-label.stderr b/src/test/ui/loops-reject-lifetime-shadowing-label.stderr new file mode 100644 index 0000000000000..7671c505e1b3e --- /dev/null +++ b/src/test/ui/loops-reject-lifetime-shadowing-label.stderr @@ -0,0 +1,16 @@ +warning: lifetime name `'a` shadows a label name that is already in scope + --> $DIR/loops-reject-lifetime-shadowing-label.rs:31:51 + | +30 | 'a: loop { //~ NOTE first declared here + | -- first declared here +31 | let b = Box::new(|x: &i8| *x) as Box Fn(&'a i8) -> i8>; + | ^^ lifetime 'a already in scope + +error: compilation successful + --> $DIR/loops-reject-lifetime-shadowing-label.rs:40:1 + | +40 | / pub fn main() { //~ ERROR compilation successful +41 | | foo(); +42 | | } + | |_^ + diff --git a/src/test/compile-fail/macro-context.rs b/src/test/ui/macro-context.rs similarity index 100% rename from src/test/compile-fail/macro-context.rs rename to src/test/ui/macro-context.rs diff --git a/src/test/ui/macro-context.stderr b/src/test/ui/macro-context.stderr new file mode 100644 index 0000000000000..7eb2016b4e7ca --- /dev/null +++ b/src/test/ui/macro-context.stderr @@ -0,0 +1,47 @@ +error: macro expansion ignores token `;` and any following + --> $DIR/macro-context.rs:13:15 + | +13 | () => ( i ; typeof ); //~ ERROR expected expression, found reserved keyword `typeof` + | ^ + | +note: caused by the macro expansion here; the usage of `m!` is likely invalid in type context + --> $DIR/macro-context.rs:20:12 + | +20 | let a: m!(); //~ NOTE the usage of `m!` is likely invalid in type context + | ^^^^ + +error: macro expansion ignores token `typeof` and any following + --> $DIR/macro-context.rs:13:17 + | +13 | () => ( i ; typeof ); //~ ERROR expected expression, found reserved keyword `typeof` + | ^^^^^^ + | +note: caused by the macro expansion here; the usage of `m!` is likely invalid in expression context + --> $DIR/macro-context.rs:21:13 + | +21 | let i = m!(); //~ NOTE the usage of `m!` is likely invalid in expression context + | ^^^^ + +error: macro expansion ignores token `;` and any following + --> $DIR/macro-context.rs:13:15 + | +13 | () => ( i ; typeof ); //~ ERROR expected expression, found reserved keyword `typeof` + | ^ + | +note: caused by the macro expansion here; the usage of `m!` is likely invalid in pattern context + --> $DIR/macro-context.rs:23:9 + | +23 | m!() => {} //~ NOTE the usage of `m!` is likely invalid in pattern context + | ^^^^ + +error: expected expression, found reserved keyword `typeof` + --> $DIR/macro-context.rs:13:17 + | +13 | () => ( i ; typeof ); //~ ERROR expected expression, found reserved keyword `typeof` + | ^^^^^^ +... +26 | m!(); //~ NOTE in this expansion + | ----- in this macro invocation + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/macro-invalid-fragment-spec.rs b/src/test/ui/macro-invalid-fragment-spec.rs similarity index 100% rename from src/test/compile-fail/macro-invalid-fragment-spec.rs rename to src/test/ui/macro-invalid-fragment-spec.rs diff --git a/src/test/ui/macro-invalid-fragment-spec.stderr b/src/test/ui/macro-invalid-fragment-spec.stderr new file mode 100644 index 0000000000000..b279933bd0512 --- /dev/null +++ b/src/test/ui/macro-invalid-fragment-spec.stderr @@ -0,0 +1,10 @@ +error: invalid fragment specifier `foo` + --> $DIR/macro-invalid-fragment-spec.rs:12:6 + | +12 | ($x:foo) => () + | ^^^^^^ + | + = help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `path`, `meta`, `tt`, `item` and `vis` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/macro-shadowing.rs b/src/test/ui/macro-shadowing.rs similarity index 100% rename from src/test/compile-fail/macro-shadowing.rs rename to src/test/ui/macro-shadowing.rs diff --git a/src/test/ui/macro-shadowing.stderr b/src/test/ui/macro-shadowing.stderr new file mode 100644 index 0000000000000..95370e50925c0 --- /dev/null +++ b/src/test/ui/macro-shadowing.stderr @@ -0,0 +1,24 @@ +error: `macro_two` is already in scope + --> $DIR/macro-shadowing.rs:23:5 + | +23 | #[macro_use] //~ ERROR `macro_two` is already in scope + | ^^^^^^^^^^^^ +... +27 | m1!(); //~ NOTE in this expansion + | ------ in this macro invocation + | + = note: macro-expanded `#[macro_use]`s may not shadow existing macros (see RFC 1560) + +error: `foo` is already in scope + --> $DIR/macro-shadowing.rs:20:5 + | +20 | macro_rules! foo { () => {} } //~ ERROR `foo` is already in scope + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +27 | m1!(); //~ NOTE in this expansion + | ------ in this macro invocation + | + = note: macro-expanded `macro_rules!`s may not shadow existing macros (see RFC 1560) + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/main-wrong-location.rs b/src/test/ui/main-wrong-location.rs similarity index 100% rename from src/test/compile-fail/main-wrong-location.rs rename to src/test/ui/main-wrong-location.rs diff --git a/src/test/ui/main-wrong-location.stderr b/src/test/ui/main-wrong-location.stderr new file mode 100644 index 0000000000000..22a270aabf64f --- /dev/null +++ b/src/test/ui/main-wrong-location.stderr @@ -0,0 +1,11 @@ +error[E0601]: main function not found + | + = note: the main function must be defined at the crate level but you have one or more functions named 'main' that are not defined at the crate level. Either move the definition or attach the `#[main]` attribute to override this behavior. +note: here is a function named 'main' + --> $DIR/main-wrong-location.rs:14:5 + | +14| fn main() { } //~ NOTE here is a function named 'main' + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/maybe-bounds.rs b/src/test/ui/maybe-bounds.rs similarity index 100% rename from src/test/compile-fail/maybe-bounds.rs rename to src/test/ui/maybe-bounds.rs diff --git a/src/test/ui/maybe-bounds.stderr b/src/test/ui/maybe-bounds.stderr new file mode 100644 index 0000000000000..a6036c8001864 --- /dev/null +++ b/src/test/ui/maybe-bounds.stderr @@ -0,0 +1,22 @@ +error: `?Trait` is not permitted in supertraits + --> $DIR/maybe-bounds.rs:11:12 + | +11 | trait Tr: ?Sized {} //~ ERROR `?Trait` is not permitted in supertraits + | ^^^^^ + | + = note: traits are `?Sized` by default + +error: `?Trait` is not permitted in trait object types + --> $DIR/maybe-bounds.rs:14:17 + | +14 | type A1 = Tr + ?Sized; //~ ERROR `?Trait` is not permitted in trait object types + | ^^^^^ + +error: `?Trait` is not permitted in trait object types + --> $DIR/maybe-bounds.rs:15:25 + | +15 | type A2 = for<'a> Tr + ?Sized; //~ ERROR `?Trait` is not permitted in trait object types + | ^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/method-missing-call.rs b/src/test/ui/method-missing-call.rs similarity index 100% rename from src/test/compile-fail/method-missing-call.rs rename to src/test/ui/method-missing-call.rs diff --git a/src/test/ui/method-missing-call.stderr b/src/test/ui/method-missing-call.stderr new file mode 100644 index 0000000000000..9ebaed11e7d8d --- /dev/null +++ b/src/test/ui/method-missing-call.stderr @@ -0,0 +1,18 @@ +error[E0615]: attempted to take value of method `get_x` on type `Point` + --> $DIR/method-missing-call.rs:32:26 + | +32 | .get_x;//~ ERROR attempted to take value of method `get_x` on type `Point` + | ^^^^^ + | + = help: maybe a `()` to call it is missing? + +error[E0615]: attempted to take value of method `filter_map` on type `std::iter::Filter, [closure@$DIR/method-missing-call.rs:38:20: 38:25]>, [closure@$DIR/method-missing-call.rs:39:23: 39:35]>` + --> $DIR/method-missing-call.rs:40:16 + | +40 | .filter_map; //~ ERROR attempted to take value of method `filter_map` on type + | ^^^^^^^^^^ + | + = help: maybe a `()` to call it is missing? + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/missing-block-hint.rs b/src/test/ui/missing-block-hint.rs similarity index 94% rename from src/test/compile-fail/missing-block-hint.rs rename to src/test/ui/missing-block-hint.rs index 6a140e6f21c19..22636b0a5a13a 100644 --- a/src/test/compile-fail/missing-block-hint.rs +++ b/src/test/ui/missing-block-hint.rs @@ -16,6 +16,5 @@ fn main() { if (foo) bar; //~ ERROR expected `{`, found `bar` //~^ HELP try placing this code inside a block - //~| SUGGESTION { bar; } } } diff --git a/src/test/ui/missing-block-hint.stderr b/src/test/ui/missing-block-hint.stderr new file mode 100644 index 0000000000000..3f50fdd4613eb --- /dev/null +++ b/src/test/ui/missing-block-hint.stderr @@ -0,0 +1,16 @@ +error: expected `{`, found `=>` + --> $DIR/missing-block-hint.rs:13:18 + | +13 | if (foo) => {} //~ ERROR expected `{`, found `=>` + | ^^ + +error: expected `{`, found `bar` + --> $DIR/missing-block-hint.rs:17:13 + | +17 | bar; //~ ERROR expected `{`, found `bar` + | ^^^- + | | + | help: try placing this code inside a block: `{ bar; }` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/moves-based-on-type-block-bad.rs b/src/test/ui/moves-based-on-type-block-bad.rs similarity index 100% rename from src/test/compile-fail/moves-based-on-type-block-bad.rs rename to src/test/ui/moves-based-on-type-block-bad.rs diff --git a/src/test/ui/moves-based-on-type-block-bad.stderr b/src/test/ui/moves-based-on-type-block-bad.stderr new file mode 100644 index 0000000000000..5fc26a8ad68fa --- /dev/null +++ b/src/test/ui/moves-based-on-type-block-bad.stderr @@ -0,0 +1,11 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/moves-based-on-type-block-bad.rs:34:19 + | +34 | match hellothere.x { //~ ERROR cannot move out + | ^^^^^^^^^^ cannot move out of borrowed content +... +37 | box E::Bar(x) => println!("{}", x.to_string()), + | - hint: to prevent move, use `ref x` or `ref mut x` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/moves-based-on-type-match-bindings.rs b/src/test/ui/moves-based-on-type-match-bindings.rs similarity index 100% rename from src/test/compile-fail/moves-based-on-type-match-bindings.rs rename to src/test/ui/moves-based-on-type-match-bindings.rs diff --git a/src/test/ui/moves-based-on-type-match-bindings.stderr b/src/test/ui/moves-based-on-type-match-bindings.stderr new file mode 100644 index 0000000000000..74d90e0eb7f92 --- /dev/null +++ b/src/test/ui/moves-based-on-type-match-bindings.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of partially moved value: `x` + --> $DIR/moves-based-on-type-match-bindings.rs:26:12 + | +23 | Foo {f} => {} //~ NOTE moved here + | - value moved here +... +26 | touch(&x); //~ ERROR use of partially moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x.f` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to previous error + diff --git a/src/test/compile-fail/no-patterns-in-args.rs b/src/test/ui/no-patterns-in-args.rs similarity index 100% rename from src/test/compile-fail/no-patterns-in-args.rs rename to src/test/ui/no-patterns-in-args.rs diff --git a/src/test/ui/no-patterns-in-args.stderr b/src/test/ui/no-patterns-in-args.stderr new file mode 100644 index 0000000000000..1aa1469161124 --- /dev/null +++ b/src/test/ui/no-patterns-in-args.stderr @@ -0,0 +1,32 @@ +error[E0130]: patterns aren't allowed in foreign function declarations + --> $DIR/no-patterns-in-args.rs:12:11 + | +12 | fn f1(mut arg: u8); //~ ERROR patterns aren't allowed in foreign function declarations + | ^^^^^^^ pattern not allowed in foreign function + +error[E0130]: patterns aren't allowed in foreign function declarations + --> $DIR/no-patterns-in-args.rs:14:11 + | +14 | fn f2(&arg: u8); //~ ERROR patterns aren't allowed in foreign function declarations + | ^^^^ pattern not allowed in foreign function + +error[E0130]: patterns aren't allowed in foreign function declarations + --> $DIR/no-patterns-in-args.rs:16:11 + | +16 | fn f3(arg @ _: u8); //~ ERROR patterns aren't allowed in foreign function declarations + | ^^^^^^^ pattern not allowed in foreign function + +error[E0561]: patterns aren't allowed in function pointer types + --> $DIR/no-patterns-in-args.rs:23:14 + | +23 | type A1 = fn(mut arg: u8); //~ ERROR patterns aren't allowed in function pointer types + | ^^^^^^^ + +error[E0561]: patterns aren't allowed in function pointer types + --> $DIR/no-patterns-in-args.rs:24:14 + | +24 | type A2 = fn(&arg: u8); //~ ERROR patterns aren't allowed in function pointer types + | ^^^^ + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/non-constant-expr-for-arr-len.rs b/src/test/ui/non-constant-expr-for-arr-len.rs similarity index 100% rename from src/test/compile-fail/non-constant-expr-for-arr-len.rs rename to src/test/ui/non-constant-expr-for-arr-len.rs diff --git a/src/test/ui/non-constant-expr-for-arr-len.stderr b/src/test/ui/non-constant-expr-for-arr-len.stderr new file mode 100644 index 0000000000000..be7e8583824a5 --- /dev/null +++ b/src/test/ui/non-constant-expr-for-arr-len.stderr @@ -0,0 +1,8 @@ +error[E0435]: attempt to use a non-constant value in a constant + --> $DIR/non-constant-expr-for-arr-len.rs:15:22 + | +15 | let _x = [0; n]; + | ^ non-constant value + +error: aborting due to previous error + diff --git a/src/test/compile-fail/non-exhaustive-pattern-witness.rs b/src/test/ui/non-exhaustive-pattern-witness.rs similarity index 100% rename from src/test/compile-fail/non-exhaustive-pattern-witness.rs rename to src/test/ui/non-exhaustive-pattern-witness.rs diff --git a/src/test/ui/non-exhaustive-pattern-witness.stderr b/src/test/ui/non-exhaustive-pattern-witness.stderr new file mode 100644 index 0000000000000..d9574c9e9602e --- /dev/null +++ b/src/test/ui/non-exhaustive-pattern-witness.stderr @@ -0,0 +1,44 @@ +error[E0004]: non-exhaustive patterns: `Foo { first: false, second: Some([_, _, _, _]) }` not covered + --> $DIR/non-exhaustive-pattern-witness.rs:20:11 + | +20 | match (Foo { first: true, second: None }) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo { first: false, second: Some([_, _, _, _]) }` not covered + +error[E0004]: non-exhaustive patterns: `Red` not covered + --> $DIR/non-exhaustive-pattern-witness.rs:37:11 + | +37 | match Color::Red { + | ^^^^^^^^^^ pattern `Red` not covered + +error[E0004]: non-exhaustive patterns: `East`, `South` and `West` not covered + --> $DIR/non-exhaustive-pattern-witness.rs:50:11 + | +50 | match Direction::North { + | ^^^^^^^^^^^^^^^^ patterns `East`, `South` and `West` not covered + +error[E0004]: non-exhaustive patterns: `Second`, `Third`, `Fourth` and 8 more not covered + --> $DIR/non-exhaustive-pattern-witness.rs:62:11 + | +62 | match ExcessiveEnum::First { + | ^^^^^^^^^^^^^^^^^^^^ patterns `Second`, `Third`, `Fourth` and 8 more not covered + +error[E0004]: non-exhaustive patterns: `CustomRGBA { a: true, .. }` not covered + --> $DIR/non-exhaustive-pattern-witness.rs:71:11 + | +71 | match Color::Red { + | ^^^^^^^^^^ pattern `CustomRGBA { a: true, .. }` not covered + +error[E0004]: non-exhaustive patterns: `[Second(true), Second(false)]` not covered + --> $DIR/non-exhaustive-pattern-witness.rs:88:11 + | +88 | match *x { + | ^^ pattern `[Second(true), Second(false)]` not covered + +error[E0004]: non-exhaustive patterns: `((), false)` not covered + --> $DIR/non-exhaustive-pattern-witness.rs:102:11 + | +102 | match ((), false) { + | ^^^^^^^^^^^ pattern `((), false)` not covered + +error: aborting due to 7 previous errors + diff --git a/src/test/compile-fail/not-enough-arguments.rs b/src/test/ui/not-enough-arguments.rs similarity index 100% rename from src/test/compile-fail/not-enough-arguments.rs rename to src/test/ui/not-enough-arguments.rs diff --git a/src/test/ui/not-enough-arguments.stderr b/src/test/ui/not-enough-arguments.stderr new file mode 100644 index 0000000000000..70b53fca6da8d --- /dev/null +++ b/src/test/ui/not-enough-arguments.stderr @@ -0,0 +1,14 @@ +error[E0061]: this function takes 4 parameters but 3 parameters were supplied + --> $DIR/not-enough-arguments.rs:21:7 + | +15 | / fn foo(a: isize, b: isize, c: isize, d:isize) { +16 | | //~^ NOTE defined here +17 | | panic!(); +18 | | } + | |_- defined here +... +21 | foo(1, 2, 3); + | ^^^^^^^ expected 4 parameters + +error: aborting due to previous error + diff --git a/src/test/compile-fail/numeric-fields.rs b/src/test/ui/numeric-fields.rs similarity index 100% rename from src/test/compile-fail/numeric-fields.rs rename to src/test/ui/numeric-fields.rs diff --git a/src/test/ui/numeric-fields.stderr b/src/test/ui/numeric-fields.stderr new file mode 100644 index 0000000000000..23f7be2fd133d --- /dev/null +++ b/src/test/ui/numeric-fields.stderr @@ -0,0 +1,16 @@ +error[E0560]: struct `S` has no field named `0b1` + --> $DIR/numeric-fields.rs:14:15 + | +14 | let s = S{0b1: 10, 0: 11}; + | ^^^^ `S` does not have this field + | + = note: available fields are: `0`, `1` + +error[E0026]: struct `S` does not have a field named `0x1` + --> $DIR/numeric-fields.rs:19:17 + | +19 | S{0: a, 0x1: b, ..} => {} + | ^^^^^^ struct `S` does not have field `0x1` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/object-safety-associated-consts.rs b/src/test/ui/object-safety-associated-consts.rs similarity index 100% rename from src/test/compile-fail/object-safety-associated-consts.rs rename to src/test/ui/object-safety-associated-consts.rs diff --git a/src/test/ui/object-safety-associated-consts.stderr b/src/test/ui/object-safety-associated-consts.stderr new file mode 100644 index 0000000000000..f63ded9a8b108 --- /dev/null +++ b/src/test/ui/object-safety-associated-consts.stderr @@ -0,0 +1,10 @@ +error[E0038]: the trait `Bar` cannot be made into an object + --> $DIR/object-safety-associated-consts.rs:19:1 + | +19 | fn make_bar(t: &T) -> &Bar { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object + | + = note: the trait cannot contain associated consts like `X` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/object-safety-generics.rs b/src/test/ui/object-safety-generics.rs similarity index 100% rename from src/test/compile-fail/object-safety-generics.rs rename to src/test/ui/object-safety-generics.rs diff --git a/src/test/ui/object-safety-generics.stderr b/src/test/ui/object-safety-generics.stderr new file mode 100644 index 0000000000000..62a1a27d68449 --- /dev/null +++ b/src/test/ui/object-safety-generics.stderr @@ -0,0 +1,18 @@ +error[E0038]: the trait `Bar` cannot be made into an object + --> $DIR/object-safety-generics.rs:24:1 + | +24 | fn make_bar(t: &T) -> &Bar { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object + | + = note: method `bar` has generic type parameters + +error[E0038]: the trait `Bar` cannot be made into an object + --> $DIR/object-safety-generics.rs:31:1 + | +31 | fn make_bar_explicit(t: &T) -> &Bar { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object + | + = note: method `bar` has generic type parameters + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/object-safety-mentions-Self.rs b/src/test/ui/object-safety-mentions-Self.rs similarity index 100% rename from src/test/compile-fail/object-safety-mentions-Self.rs rename to src/test/ui/object-safety-mentions-Self.rs diff --git a/src/test/ui/object-safety-mentions-Self.stderr b/src/test/ui/object-safety-mentions-Self.stderr new file mode 100644 index 0000000000000..2f7c8d5eec2c2 --- /dev/null +++ b/src/test/ui/object-safety-mentions-Self.stderr @@ -0,0 +1,18 @@ +error[E0038]: the trait `Bar` cannot be made into an object + --> $DIR/object-safety-mentions-Self.rs:27:1 + | +27 | fn make_bar(t: &T) -> &Bar { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object + | + = note: method `bar` references the `Self` type in its arguments or return type + +error[E0038]: the trait `Baz` cannot be made into an object + --> $DIR/object-safety-mentions-Self.rs:34:1 + | +34 | fn make_baz(t: &T) -> &Baz { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Baz` cannot be made into an object + | + = note: method `bar` references the `Self` type in its arguments or return type + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/object-safety-sized.rs b/src/test/ui/object-safety-sized.rs similarity index 100% rename from src/test/compile-fail/object-safety-sized.rs rename to src/test/ui/object-safety-sized.rs diff --git a/src/test/ui/object-safety-sized.stderr b/src/test/ui/object-safety-sized.stderr new file mode 100644 index 0000000000000..a733416ef6ccf --- /dev/null +++ b/src/test/ui/object-safety-sized.stderr @@ -0,0 +1,10 @@ +error[E0038]: the trait `Bar` cannot be made into an object + --> $DIR/object-safety-sized.rs:18:1 + | +18 | fn make_bar(t: &T) -> &Bar { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object + | + = note: the trait cannot require that `Self : Sized` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/object-safety-supertrait-mentions-Self.rs b/src/test/ui/object-safety-supertrait-mentions-Self.rs similarity index 100% rename from src/test/compile-fail/object-safety-supertrait-mentions-Self.rs rename to src/test/ui/object-safety-supertrait-mentions-Self.rs diff --git a/src/test/ui/object-safety-supertrait-mentions-Self.stderr b/src/test/ui/object-safety-supertrait-mentions-Self.stderr new file mode 100644 index 0000000000000..a5a67553c6154 --- /dev/null +++ b/src/test/ui/object-safety-supertrait-mentions-Self.stderr @@ -0,0 +1,10 @@ +error[E0038]: the trait `Baz` cannot be made into an object + --> $DIR/object-safety-supertrait-mentions-Self.rs:25:31 + | +25 | fn make_baz(t: &T) -> &Baz { + | ^^^ the trait `Baz` cannot be made into an object + | + = note: the trait cannot use `Self` as a type parameter in the supertraits or where-clauses + +error: aborting due to previous error + diff --git a/src/test/compile-fail/partialeq_help.rs b/src/test/ui/partialeq_help.rs similarity index 100% rename from src/test/compile-fail/partialeq_help.rs rename to src/test/ui/partialeq_help.rs diff --git a/src/test/ui/partialeq_help.stderr b/src/test/ui/partialeq_help.stderr new file mode 100644 index 0000000000000..25ae8b1276815 --- /dev/null +++ b/src/test/ui/partialeq_help.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `&T: std::cmp::PartialEq` is not satisfied + --> $DIR/partialeq_help.rs:12:7 + | +12 | a == b; //~ ERROR E0277 + | ^^ can't compare `&T` with `T` + | + = help: the trait `std::cmp::PartialEq` is not implemented for `&T` + = help: consider adding a `where &T: std::cmp::PartialEq` bound + +error: aborting due to previous error + diff --git a/src/test/compile-fail/pat-slice-old-style.rs b/src/test/ui/pat-slice-old-style.rs similarity index 100% rename from src/test/compile-fail/pat-slice-old-style.rs rename to src/test/ui/pat-slice-old-style.rs diff --git a/src/test/ui/pat-slice-old-style.stderr b/src/test/ui/pat-slice-old-style.stderr new file mode 100644 index 0000000000000..5e7cd10235d4d --- /dev/null +++ b/src/test/ui/pat-slice-old-style.stderr @@ -0,0 +1,10 @@ +error: non-reference pattern used to match a reference (see issue #42640) + --> $DIR/pat-slice-old-style.rs:19:9 + | +19 | [a, b..] => {}, + | ^^^^^^^^ help: consider using a reference: `&[a, b..]` + | + = help: add #![feature(match_default_bindings)] to the crate attributes to enable + +error: aborting due to previous error + diff --git a/src/test/compile-fail/qualified-path-params-2.rs b/src/test/ui/qualified-path-params-2.rs similarity index 100% rename from src/test/compile-fail/qualified-path-params-2.rs rename to src/test/ui/qualified-path-params-2.rs diff --git a/src/test/ui/qualified-path-params-2.stderr b/src/test/ui/qualified-path-params-2.stderr new file mode 100644 index 0000000000000..35a9698451f1b --- /dev/null +++ b/src/test/ui/qualified-path-params-2.stderr @@ -0,0 +1,16 @@ +error[E0109]: type parameters are not allowed on this type + --> $DIR/qualified-path-params-2.rs:28:26 + | +28 | type A = ::A::f; + | ^^ type parameter not allowed + +error[E0223]: ambiguous associated type + --> $DIR/qualified-path-params-2.rs:28:10 + | +28 | type A = ::A::f; + | ^^^^^^^^^^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<::A as Trait>::f` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/region-borrow-params-issue-29793-small.rs b/src/test/ui/region-borrow-params-issue-29793-small.rs similarity index 100% rename from src/test/compile-fail/region-borrow-params-issue-29793-small.rs rename to src/test/ui/region-borrow-params-issue-29793-small.rs diff --git a/src/test/ui/region-borrow-params-issue-29793-small.stderr b/src/test/ui/region-borrow-params-issue-29793-small.stderr new file mode 100644 index 0000000000000..3a25832c15137 --- /dev/null +++ b/src/test/ui/region-borrow-params-issue-29793-small.stderr @@ -0,0 +1,246 @@ +error[E0597]: `x` does not live long enough + --> $DIR/region-borrow-params-issue-29793-small.rs:19:34 + | +19 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | --------- ^ does not live long enough + | | + | capture occurs here +... +29 | }; + | - borrowed value dropped before borrower + | + = note: values in a scope are dropped in the opposite order they are created + +error[E0597]: `y` does not live long enough + --> $DIR/region-borrow-params-issue-29793-small.rs:19:45 + | +19 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | --------- ^ does not live long enough + | | + | capture occurs here +... +29 | }; + | - borrowed value dropped before borrower + | + = note: values in a scope are dropped in the opposite order they are created + +error[E0597]: `x` does not live long enough + --> $DIR/region-borrow-params-issue-29793-small.rs:42:34 + | +42 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | --------- ^ does not live long enough + | | + | capture occurs here +... +52 | }; + | - borrowed value dropped before borrower + | + = note: values in a scope are dropped in the opposite order they are created + +error[E0597]: `y` does not live long enough + --> $DIR/region-borrow-params-issue-29793-small.rs:42:45 + | +42 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | --------- ^ does not live long enough + | | + | capture occurs here +... +52 | }; + | - borrowed value dropped before borrower + | + = note: values in a scope are dropped in the opposite order they are created + +error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:81:17 + | +81 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `x` is borrowed here + | | + | may outlive borrowed value `x` +help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword + | +81 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:81:17 + | +81 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `y` is borrowed here + | | + | may outlive borrowed value `y` +help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword + | +81 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:96:17 + | +96 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `x` is borrowed here + | | + | may outlive borrowed value `x` +help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword + | +96 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:96:17 + | +96 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `y` is borrowed here + | | + | may outlive borrowed value `y` +help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword + | +96 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:124:21 + | +124 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `x` is borrowed here + | | + | may outlive borrowed value `x` +help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword + | +124 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:124:21 + | +124 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `y` is borrowed here + | | + | may outlive borrowed value `y` +help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword + | +124 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:142:21 + | +142 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `x` is borrowed here + | | + | may outlive borrowed value `x` +help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword + | +142 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:142:21 + | +142 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `y` is borrowed here + | | + | may outlive borrowed value `y` +help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword + | +142 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:174:21 + | +174 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `x` is borrowed here + | | + | may outlive borrowed value `x` +help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword + | +174 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:174:21 + | +174 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `y` is borrowed here + | | + | may outlive borrowed value `y` +help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword + | +174 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:193:21 + | +193 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `x` is borrowed here + | | + | may outlive borrowed value `x` +help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword + | +193 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:193:21 + | +193 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `y` is borrowed here + | | + | may outlive borrowed value `y` +help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword + | +193 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:225:21 + | +225 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `x` is borrowed here + | | + | may outlive borrowed value `x` +help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword + | +225 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:225:21 + | +225 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `y` is borrowed here + | | + | may outlive borrowed value `y` +help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword + | +225 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:243:21 + | +243 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `x` is borrowed here + | | + | may outlive borrowed value `x` +help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword + | +243 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function + --> $DIR/region-borrow-params-issue-29793-small.rs:243:21 + | +243 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^ - `y` is borrowed here + | | + | may outlive borrowed value `y` +help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword + | +243 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`) + | ^^^^^^^^^^^^^^ + +error: aborting due to 20 previous errors + diff --git a/src/test/compile-fail/regions-nested-fns-2.rs b/src/test/ui/regions-nested-fns-2.rs similarity index 100% rename from src/test/compile-fail/regions-nested-fns-2.rs rename to src/test/ui/regions-nested-fns-2.rs diff --git a/src/test/ui/regions-nested-fns-2.stderr b/src/test/ui/regions-nested-fns-2.stderr new file mode 100644 index 0000000000000..98d82d438c0d3 --- /dev/null +++ b/src/test/ui/regions-nested-fns-2.stderr @@ -0,0 +1,15 @@ +error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function + --> $DIR/regions-nested-fns-2.rs:16:9 + | +16 | |z| { + | ^^^ may outlive borrowed value `y` +... +19 | if false { &y } else { z } + | - `y` is borrowed here +help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword + | +16 | move |z| { + | ^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/resolve-conflict-item-vs-import.rs b/src/test/ui/resolve-conflict-item-vs-import.rs similarity index 100% rename from src/test/compile-fail/resolve-conflict-item-vs-import.rs rename to src/test/ui/resolve-conflict-item-vs-import.rs diff --git a/src/test/ui/resolve-conflict-item-vs-import.stderr b/src/test/ui/resolve-conflict-item-vs-import.stderr new file mode 100644 index 0000000000000..c01bf998e58c9 --- /dev/null +++ b/src/test/ui/resolve-conflict-item-vs-import.stderr @@ -0,0 +1,17 @@ +error[E0255]: the name `transmute` is defined multiple times + --> $DIR/resolve-conflict-item-vs-import.rs:14:1 + | +11 | use std::mem::transmute; + | ------------------- previous import of the value `transmute` here +... +14 | fn transmute() {} + | ^^^^^^^^^^^^^^^^^ `transmute` redefined here + | + = note: `transmute` must be defined only once in the value namespace of this module +help: You can use `as` to change the binding name of the import + | +11 | use std::mem::transmute as Othertransmute; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/resolve-inconsistent-names.rs b/src/test/ui/resolve-inconsistent-names.rs similarity index 100% rename from src/test/compile-fail/resolve-inconsistent-names.rs rename to src/test/ui/resolve-inconsistent-names.rs diff --git a/src/test/ui/resolve-inconsistent-names.stderr b/src/test/ui/resolve-inconsistent-names.stderr new file mode 100644 index 0000000000000..8ae5a6b8a820f --- /dev/null +++ b/src/test/ui/resolve-inconsistent-names.stderr @@ -0,0 +1,18 @@ +error[E0408]: variable `a` is not bound in all patterns + --> $DIR/resolve-inconsistent-names.rs:14:12 + | +14 | a | b => {} //~ ERROR variable `a` is not bound in all patterns + | - ^ pattern doesn't bind `a` + | | + | variable not in all patterns + +error[E0408]: variable `b` is not bound in all patterns + --> $DIR/resolve-inconsistent-names.rs:14:8 + | +14 | a | b => {} //~ ERROR variable `a` is not bound in all patterns + | ^ - variable not in all patterns + | | + | pattern doesn't bind `b` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/self-impl.rs b/src/test/ui/self-impl.rs similarity index 100% rename from src/test/compile-fail/self-impl.rs rename to src/test/ui/self-impl.rs diff --git a/src/test/ui/self-impl.stderr b/src/test/ui/self-impl.stderr new file mode 100644 index 0000000000000..ab056127ee6b2 --- /dev/null +++ b/src/test/ui/self-impl.stderr @@ -0,0 +1,18 @@ +error[E0223]: ambiguous associated type + --> $DIR/self-impl.rs:33:16 + | +33 | let _: ::Baz = true; + | ^^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `::Baz` + +error[E0223]: ambiguous associated type + --> $DIR/self-impl.rs:37:16 + | +37 | let _: Self::Baz = true; + | ^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `::Baz` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/shadowed-lifetime.rs b/src/test/ui/shadowed-lifetime.rs similarity index 100% rename from src/test/compile-fail/shadowed-lifetime.rs rename to src/test/ui/shadowed-lifetime.rs diff --git a/src/test/ui/shadowed-lifetime.stderr b/src/test/ui/shadowed-lifetime.stderr new file mode 100644 index 0000000000000..d4c6a7c9aafbb --- /dev/null +++ b/src/test/ui/shadowed-lifetime.stderr @@ -0,0 +1,20 @@ +error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope + --> $DIR/shadowed-lifetime.rs:17:25 + | +15 | impl<'a> Foo<'a> { + | -- first declared here +16 | //~^ NOTE first declared here +17 | fn shadow_in_method<'a>(&'a self) -> &'a isize { + | ^^ lifetime 'a already in scope + +error[E0496]: lifetime name `'b` shadows a lifetime name that is already in scope + --> $DIR/shadowed-lifetime.rs:25:20 + | +23 | fn shadow_in_type<'b>(&'b self) -> &'b isize { + | -- first declared here +24 | //~^ NOTE first declared here +25 | let x: for<'b> fn(&'b isize) = panic!(); + | ^^ lifetime 'b already in scope + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/str-concat-on-double-ref.rs b/src/test/ui/str-concat-on-double-ref.rs similarity index 100% rename from src/test/compile-fail/str-concat-on-double-ref.rs rename to src/test/ui/str-concat-on-double-ref.rs diff --git a/src/test/ui/str-concat-on-double-ref.stderr b/src/test/ui/str-concat-on-double-ref.stderr new file mode 100644 index 0000000000000..15d578133016f --- /dev/null +++ b/src/test/ui/str-concat-on-double-ref.stderr @@ -0,0 +1,10 @@ +error[E0369]: binary operation `+` cannot be applied to type `&std::string::String` + --> $DIR/str-concat-on-double-ref.rs:14:13 + | +14 | let c = a + b; + | ^^^^^ + | + = note: an implementation of `std::ops::Add` might be missing for `&std::string::String` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/struct-fields-decl-dupe.rs b/src/test/ui/struct-fields-decl-dupe.rs similarity index 100% rename from src/test/compile-fail/struct-fields-decl-dupe.rs rename to src/test/ui/struct-fields-decl-dupe.rs diff --git a/src/test/ui/struct-fields-decl-dupe.stderr b/src/test/ui/struct-fields-decl-dupe.stderr new file mode 100644 index 0000000000000..4908441cb5997 --- /dev/null +++ b/src/test/ui/struct-fields-decl-dupe.stderr @@ -0,0 +1,10 @@ +error[E0124]: field `foo` is already declared + --> $DIR/struct-fields-decl-dupe.rs:13:5 + | +12 | foo: isize, //~ NOTE `foo` first declared here + | ---------- `foo` first declared here +13 | foo: isize, + | ^^^^^^^^^^ field already declared + +error: aborting due to previous error + diff --git a/src/test/compile-fail/struct-fields-hints-no-dupe.rs b/src/test/ui/struct-fields-hints-no-dupe.rs similarity index 100% rename from src/test/compile-fail/struct-fields-hints-no-dupe.rs rename to src/test/ui/struct-fields-hints-no-dupe.rs diff --git a/src/test/ui/struct-fields-hints-no-dupe.stderr b/src/test/ui/struct-fields-hints-no-dupe.stderr new file mode 100644 index 0000000000000..93cbe1f5afa80 --- /dev/null +++ b/src/test/ui/struct-fields-hints-no-dupe.stderr @@ -0,0 +1,8 @@ +error[E0560]: struct `A` has no field named `bar` + --> $DIR/struct-fields-hints-no-dupe.rs:20:9 + | +20 | bar : 42, + | ^^^^^ field does not exist - did you mean `barr`? + +error: aborting due to previous error + diff --git a/src/test/compile-fail/struct-fields-hints.rs b/src/test/ui/struct-fields-hints.rs similarity index 100% rename from src/test/compile-fail/struct-fields-hints.rs rename to src/test/ui/struct-fields-hints.rs diff --git a/src/test/ui/struct-fields-hints.stderr b/src/test/ui/struct-fields-hints.stderr new file mode 100644 index 0000000000000..a7c77103e7357 --- /dev/null +++ b/src/test/ui/struct-fields-hints.stderr @@ -0,0 +1,8 @@ +error[E0560]: struct `A` has no field named `bar` + --> $DIR/struct-fields-hints.rs:20:9 + | +20 | bar : 42, + | ^^^^^ field does not exist - did you mean `car`? + +error: aborting due to previous error + diff --git a/src/test/compile-fail/struct-fields-too-many.rs b/src/test/ui/struct-fields-too-many.rs similarity index 100% rename from src/test/compile-fail/struct-fields-too-many.rs rename to src/test/ui/struct-fields-too-many.rs diff --git a/src/test/ui/struct-fields-too-many.stderr b/src/test/ui/struct-fields-too-many.stderr new file mode 100644 index 0000000000000..ec353d00aa7ee --- /dev/null +++ b/src/test/ui/struct-fields-too-many.stderr @@ -0,0 +1,10 @@ +error[E0560]: struct `BuildData` has no field named `bar` + --> $DIR/struct-fields-too-many.rs:18:9 + | +18 | bar: 0 + | ^^^^ `BuildData` does not have this field + | + = note: available fields are: `foo` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/struct-path-self-type-mismatch.rs b/src/test/ui/struct-path-self-type-mismatch.rs similarity index 100% rename from src/test/compile-fail/struct-path-self-type-mismatch.rs rename to src/test/ui/struct-path-self-type-mismatch.rs diff --git a/src/test/ui/struct-path-self-type-mismatch.stderr b/src/test/ui/struct-path-self-type-mismatch.stderr new file mode 100644 index 0000000000000..ead941e66e80d --- /dev/null +++ b/src/test/ui/struct-path-self-type-mismatch.stderr @@ -0,0 +1,34 @@ +error[E0308]: mismatched types + --> $DIR/struct-path-self-type-mismatch.rs:17:23 + | +17 | Self { inner: 1.5f32 }; //~ ERROR mismatched types + | ^^^^^^ expected i32, found f32 + +error[E0308]: mismatched types + --> $DIR/struct-path-self-type-mismatch.rs:28:20 + | +28 | inner: u + | ^ expected type parameter, found a different type parameter + | + = note: expected type `T` + found type `U` + +error[E0308]: mismatched types + --> $DIR/struct-path-self-type-mismatch.rs:24:9 + | +23 | fn new(u: U) -> Foo { //~ NOTE expected `Foo` because of return type + | ------ expected `Foo` because of return type +24 | / Self { +25 | | //~^ ERROR mismatched types +26 | | //~| NOTE expected type parameter, found a different type parameter +27 | | //~| NOTE expected type `Foo` +... | +31 | | //~| NOTE expected type `T` +32 | | } + | |_________^ expected type parameter, found a different type parameter + | + = note: expected type `Foo` + found type `Foo` + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/suggest-private-fields.rs b/src/test/ui/suggest-private-fields.rs similarity index 100% rename from src/test/compile-fail/suggest-private-fields.rs rename to src/test/ui/suggest-private-fields.rs diff --git a/src/test/ui/suggest-private-fields.stderr b/src/test/ui/suggest-private-fields.stderr new file mode 100644 index 0000000000000..1cc323c1c331b --- /dev/null +++ b/src/test/ui/suggest-private-fields.stderr @@ -0,0 +1,28 @@ +error[E0560]: struct `xc::B` has no field named `aa` + --> $DIR/suggest-private-fields.rs:25:9 + | +25 | aa: 20, + | ^^^ field does not exist - did you mean `a`? + +error[E0560]: struct `xc::B` has no field named `bb` + --> $DIR/suggest-private-fields.rs:28:9 + | +28 | bb: 20, + | ^^^ `xc::B` does not have this field + | + = note: available fields are: `a` + +error[E0560]: struct `A` has no field named `aa` + --> $DIR/suggest-private-fields.rs:35:9 + | +35 | aa: 20, + | ^^^ field does not exist - did you mean `a`? + +error[E0560]: struct `A` has no field named `bb` + --> $DIR/suggest-private-fields.rs:38:9 + | +38 | bb: 20, + | ^^^ field does not exist - did you mean `b`? + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/svh-change-lit.rs b/src/test/ui/svh-change-lit.rs similarity index 100% rename from src/test/compile-fail/svh-change-lit.rs rename to src/test/ui/svh-change-lit.rs diff --git a/src/test/ui/svh-change-lit.stderr b/src/test/ui/svh-change-lit.stderr new file mode 100644 index 0000000000000..08c4809479eae --- /dev/null +++ b/src/test/ui/svh-change-lit.stderr @@ -0,0 +1,13 @@ +error[E0460]: found possibly newer version of crate `a` which `b` depends on + --> $DIR/svh-change-lit.rs:19:1 + | +19 | extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on + | ^^^^^^^^^^^^^^^ + | + = note: perhaps that crate needs to be recompiled? + = note: the following crate versions were found: + crate `a`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-change-lit.stage1-x86_64-pc-windows-gnu.aux/a.dll + crate `b`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-change-lit.stage1-x86_64-pc-windows-gnu.aux/b.dll + +error: aborting due to previous error + diff --git a/src/test/compile-fail/svh-change-significant-cfg.rs b/src/test/ui/svh-change-significant-cfg.rs similarity index 100% rename from src/test/compile-fail/svh-change-significant-cfg.rs rename to src/test/ui/svh-change-significant-cfg.rs diff --git a/src/test/ui/svh-change-significant-cfg.stderr b/src/test/ui/svh-change-significant-cfg.stderr new file mode 100644 index 0000000000000..57c636d4aa5f0 --- /dev/null +++ b/src/test/ui/svh-change-significant-cfg.stderr @@ -0,0 +1,13 @@ +error[E0460]: found possibly newer version of crate `a` which `b` depends on + --> $DIR/svh-change-significant-cfg.rs:19:1 + | +19 | extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on + | ^^^^^^^^^^^^^^^ + | + = note: perhaps that crate needs to be recompiled? + = note: the following crate versions were found: + crate `a`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-change-significant-cfg.stage1-x86_64-pc-windows-gnu.aux/a.dll + crate `b`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-change-significant-cfg.stage1-x86_64-pc-windows-gnu.aux/b.dll + +error: aborting due to previous error + diff --git a/src/test/compile-fail/svh-change-trait-bound.rs b/src/test/ui/svh-change-trait-bound.rs similarity index 100% rename from src/test/compile-fail/svh-change-trait-bound.rs rename to src/test/ui/svh-change-trait-bound.rs diff --git a/src/test/ui/svh-change-trait-bound.stderr b/src/test/ui/svh-change-trait-bound.stderr new file mode 100644 index 0000000000000..40fb5aeaf148c --- /dev/null +++ b/src/test/ui/svh-change-trait-bound.stderr @@ -0,0 +1,13 @@ +error[E0460]: found possibly newer version of crate `a` which `b` depends on + --> $DIR/svh-change-trait-bound.rs:19:1 + | +19 | extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on + | ^^^^^^^^^^^^^^^ + | + = note: perhaps that crate needs to be recompiled? + = note: the following crate versions were found: + crate `a`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-change-trait-bound.stage1-x86_64-pc-windows-gnu.aux/a.dll + crate `b`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-change-trait-bound.stage1-x86_64-pc-windows-gnu.aux/b.dll + +error: aborting due to previous error + diff --git a/src/test/compile-fail/svh-change-type-arg.rs b/src/test/ui/svh-change-type-arg.rs similarity index 100% rename from src/test/compile-fail/svh-change-type-arg.rs rename to src/test/ui/svh-change-type-arg.rs diff --git a/src/test/ui/svh-change-type-arg.stderr b/src/test/ui/svh-change-type-arg.stderr new file mode 100644 index 0000000000000..654d73d708565 --- /dev/null +++ b/src/test/ui/svh-change-type-arg.stderr @@ -0,0 +1,13 @@ +error[E0460]: found possibly newer version of crate `a` which `b` depends on + --> $DIR/svh-change-type-arg.rs:19:1 + | +19 | extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on + | ^^^^^^^^^^^^^^^ + | + = note: perhaps that crate needs to be recompiled? + = note: the following crate versions were found: + crate `a`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-change-type-arg.stage1-x86_64-pc-windows-gnu.aux/a.dll + crate `b`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-change-type-arg.stage1-x86_64-pc-windows-gnu.aux/b.dll + +error: aborting due to previous error + diff --git a/src/test/compile-fail/svh-change-type-ret.rs b/src/test/ui/svh-change-type-ret.rs similarity index 100% rename from src/test/compile-fail/svh-change-type-ret.rs rename to src/test/ui/svh-change-type-ret.rs diff --git a/src/test/ui/svh-change-type-ret.stderr b/src/test/ui/svh-change-type-ret.stderr new file mode 100644 index 0000000000000..c71c0288d8f40 --- /dev/null +++ b/src/test/ui/svh-change-type-ret.stderr @@ -0,0 +1,13 @@ +error[E0460]: found possibly newer version of crate `a` which `b` depends on + --> $DIR/svh-change-type-ret.rs:19:1 + | +19 | extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on + | ^^^^^^^^^^^^^^^ + | + = note: perhaps that crate needs to be recompiled? + = note: the following crate versions were found: + crate `a`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-change-type-ret.stage1-x86_64-pc-windows-gnu.aux/a.dll + crate `b`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-change-type-ret.stage1-x86_64-pc-windows-gnu.aux/b.dll + +error: aborting due to previous error + diff --git a/src/test/compile-fail/svh-change-type-static.rs b/src/test/ui/svh-change-type-static.rs similarity index 100% rename from src/test/compile-fail/svh-change-type-static.rs rename to src/test/ui/svh-change-type-static.rs diff --git a/src/test/ui/svh-change-type-static.stderr b/src/test/ui/svh-change-type-static.stderr new file mode 100644 index 0000000000000..05cc02d132303 --- /dev/null +++ b/src/test/ui/svh-change-type-static.stderr @@ -0,0 +1,13 @@ +error[E0460]: found possibly newer version of crate `a` which `b` depends on + --> $DIR/svh-change-type-static.rs:19:1 + | +19 | extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on + | ^^^^^^^^^^^^^^^ + | + = note: perhaps that crate needs to be recompiled? + = note: the following crate versions were found: + crate `a`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-change-type-static.stage1-x86_64-pc-windows-gnu.aux/a.dll + crate `b`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-change-type-static.stage1-x86_64-pc-windows-gnu.aux/b.dll + +error: aborting due to previous error + diff --git a/src/test/compile-fail/svh-use-trait.rs b/src/test/ui/svh-use-trait.rs similarity index 100% rename from src/test/compile-fail/svh-use-trait.rs rename to src/test/ui/svh-use-trait.rs diff --git a/src/test/ui/svh-use-trait.stderr b/src/test/ui/svh-use-trait.stderr new file mode 100644 index 0000000000000..b12d173b6cbf1 --- /dev/null +++ b/src/test/ui/svh-use-trait.stderr @@ -0,0 +1,13 @@ +error[E0460]: found possibly newer version of crate `uta` which `utb` depends on + --> $DIR/svh-use-trait.rs:24:1 + | +24 | extern crate utb; //~ ERROR: found possibly newer version of crate `uta` which `utb` depends + | ^^^^^^^^^^^^^^^^^ + | + = note: perhaps that crate needs to be recompiled? + = note: the following crate versions were found: + crate `uta`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-use-trait.stage1-x86_64-pc-windows-gnu.aux/uta.dll + crate `utb`: /?/C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/ui/svh-use-trait.stage1-x86_64-pc-windows-gnu.aux/utb.dll + +error: aborting due to previous error + diff --git a/src/test/compile-fail/trait-duplicate-methods.rs b/src/test/ui/trait-duplicate-methods.rs similarity index 100% rename from src/test/compile-fail/trait-duplicate-methods.rs rename to src/test/ui/trait-duplicate-methods.rs diff --git a/src/test/ui/trait-duplicate-methods.stderr b/src/test/ui/trait-duplicate-methods.stderr new file mode 100644 index 0000000000000..0deec625d1025 --- /dev/null +++ b/src/test/ui/trait-duplicate-methods.stderr @@ -0,0 +1,12 @@ +error[E0428]: the name `orange` is defined multiple times + --> $DIR/trait-duplicate-methods.rs:13:5 + | +12 | fn orange(&self); //~ NOTE previous definition of the value `orange` here + | ----------------- previous definition of the value `orange` here +13 | fn orange(&self); //~ ERROR the name `orange` is defined multiple times + | ^^^^^^^^^^^^^^^^^ `orange` redefined here + | + = note: `orange` must be defined only once in the value namespace of this trait + +error: aborting due to previous error + diff --git a/src/test/compile-fail/trait-safety-fn-body.rs b/src/test/ui/trait-safety-fn-body.rs similarity index 100% rename from src/test/compile-fail/trait-safety-fn-body.rs rename to src/test/ui/trait-safety-fn-body.rs diff --git a/src/test/ui/trait-safety-fn-body.stderr b/src/test/ui/trait-safety-fn-body.stderr new file mode 100644 index 0000000000000..ab8793f8a7403 --- /dev/null +++ b/src/test/ui/trait-safety-fn-body.stderr @@ -0,0 +1,8 @@ +error[E0133]: dereference of raw pointer requires unsafe function or block + --> $DIR/trait-safety-fn-body.rs:21:9 + | +21 | *self += 1; + | ^^^^^^^^^^ dereference of raw pointer + +error: aborting due to previous error + diff --git a/src/test/compile-fail/trait-suggest-where-clause.rs b/src/test/ui/trait-suggest-where-clause.rs similarity index 100% rename from src/test/compile-fail/trait-suggest-where-clause.rs rename to src/test/ui/trait-suggest-where-clause.rs diff --git a/src/test/ui/trait-suggest-where-clause.stderr b/src/test/ui/trait-suggest-where-clause.stderr new file mode 100644 index 0000000000000..ddf549f4ecd9d --- /dev/null +++ b/src/test/ui/trait-suggest-where-clause.stderr @@ -0,0 +1,67 @@ +error[E0277]: the trait bound `U: std::marker::Sized` is not satisfied + --> $DIR/trait-suggest-where-clause.rs:17:5 + | +17 | mem::size_of::(); + | ^^^^^^^^^^^^^^^^^ `U` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `U` + = help: consider adding a `where U: std::marker::Sized` bound + = note: required by `std::mem::size_of` + +error[E0277]: the trait bound `U: std::marker::Sized` is not satisfied in `Misc` + --> $DIR/trait-suggest-where-clause.rs:24:5 + | +24 | mem::size_of::>(); + | ^^^^^^^^^^^^^^^^^^^^^^^ `U` does not have a constant size known at compile-time + | + = help: within `Misc`, the trait `std::marker::Sized` is not implemented for `U` + = help: consider adding a `where U: std::marker::Sized` bound + = note: required because it appears within the type `Misc` + = note: required by `std::mem::size_of` + +error[E0277]: the trait bound `u64: std::convert::From` is not satisfied + --> $DIR/trait-suggest-where-clause.rs:34:5 + | +34 | >::from; + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From` is not implemented for `u64` + | + = help: consider adding a `where u64: std::convert::From` bound + = note: required by `std::convert::From::from` + +error[E0277]: the trait bound `u64: std::convert::From<::Item>` is not satisfied + --> $DIR/trait-suggest-where-clause.rs:40:5 + | +40 | ::Item>>::from; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<::Item>` is not implemented for `u64` + | + = help: consider adding a `where u64: std::convert::From<::Item>` bound + = note: required by `std::convert::From::from` + +error[E0277]: the trait bound `Misc<_>: std::convert::From` is not satisfied + --> $DIR/trait-suggest-where-clause.rs:48:5 + | +48 | as From>::from; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From` is not implemented for `Misc<_>` + | + = note: required by `std::convert::From::from` + +error[E0277]: the trait bound `[T]: std::marker::Sized` is not satisfied + --> $DIR/trait-suggest-where-clause.rs:55:5 + | +55 | mem::size_of::<[T]>(); + | ^^^^^^^^^^^^^^^^^^^ `[T]` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[T]` + = note: required by `std::mem::size_of` + +error[E0277]: the trait bound `[&U]: std::marker::Sized` is not satisfied + --> $DIR/trait-suggest-where-clause.rs:61:5 + | +61 | mem::size_of::<[&U]>(); + | ^^^^^^^^^^^^^^^^^^^^ `[&U]` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[&U]` + = note: required by `std::mem::size_of` + +error: aborting due to 7 previous errors + diff --git a/src/test/compile-fail/traits-multidispatch-convert-ambig-dest.rs b/src/test/ui/traits-multidispatch-convert-ambig-dest.rs similarity index 100% rename from src/test/compile-fail/traits-multidispatch-convert-ambig-dest.rs rename to src/test/ui/traits-multidispatch-convert-ambig-dest.rs diff --git a/src/test/ui/traits-multidispatch-convert-ambig-dest.stderr b/src/test/ui/traits-multidispatch-convert-ambig-dest.stderr new file mode 100644 index 0000000000000..8304fb3b7972a --- /dev/null +++ b/src/test/ui/traits-multidispatch-convert-ambig-dest.stderr @@ -0,0 +1,8 @@ +error[E0282]: type annotations needed + --> $DIR/traits-multidispatch-convert-ambig-dest.rs:36:5 + | +36 | test(22, std::default::Default::default()); + | ^^^^ cannot infer type for `U` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/type-recursive.rs b/src/test/ui/type-recursive.rs similarity index 100% rename from src/test/compile-fail/type-recursive.rs rename to src/test/ui/type-recursive.rs diff --git a/src/test/ui/type-recursive.stderr b/src/test/ui/type-recursive.stderr new file mode 100644 index 0000000000000..d96b1f3e98700 --- /dev/null +++ b/src/test/ui/type-recursive.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `t1` has infinite size + --> $DIR/type-recursive.rs:11:1 + | +11 | struct t1 { //~ ERROR E0072 + | ^^^^^^^^^ recursive type has infinite size +... +14 | foolish: t1 //~ NOTE recursive without indirection + | ----------- recursive without indirection + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `t1` representable + +error: aborting due to previous error + diff --git a/src/test/compile-fail/typeck-builtin-bound-type-parameters.rs b/src/test/ui/typeck-builtin-bound-type-parameters.rs similarity index 100% rename from src/test/compile-fail/typeck-builtin-bound-type-parameters.rs rename to src/test/ui/typeck-builtin-bound-type-parameters.rs diff --git a/src/test/ui/typeck-builtin-bound-type-parameters.stderr b/src/test/ui/typeck-builtin-bound-type-parameters.stderr new file mode 100644 index 0000000000000..fc39b2b8e9d43 --- /dev/null +++ b/src/test/ui/typeck-builtin-bound-type-parameters.stderr @@ -0,0 +1,38 @@ +error[E0244]: wrong number of type arguments: expected 0, found 1 + --> $DIR/typeck-builtin-bound-type-parameters.rs:11:11 + | +11 | fn foo1, U>(x: T) {} + | ^^^^^^^ expected no type arguments + +error[E0244]: wrong number of type arguments: expected 0, found 1 + --> $DIR/typeck-builtin-bound-type-parameters.rs:15:14 + | +15 | trait Trait: Copy {} + | ^^^^^^^^^^ expected no type arguments + +error[E0244]: wrong number of type arguments: expected 0, found 1 + --> $DIR/typeck-builtin-bound-type-parameters.rs:19:21 + | +19 | struct MyStruct1>; + | ^^^^^^^ expected no type arguments + +error[E0107]: wrong number of lifetime parameters: expected 0, found 1 + --> $DIR/typeck-builtin-bound-type-parameters.rs:23:25 + | +23 | struct MyStruct2<'a, T: Copy<'a>>; + | ^^^^^^^^ unexpected lifetime parameter + +error[E0107]: wrong number of lifetime parameters: expected 0, found 1 + --> $DIR/typeck-builtin-bound-type-parameters.rs:28:15 + | +28 | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} + | ^^^^^^^^^^^ unexpected lifetime parameter + +error[E0244]: wrong number of type arguments: expected 0, found 1 + --> $DIR/typeck-builtin-bound-type-parameters.rs:28:15 + | +28 | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} + | ^^^^^^^^^^^ expected no type arguments + +error: aborting due to 6 previous errors + diff --git a/src/test/compile-fail/typeck-default-trait-impl-outside-crate.rs b/src/test/ui/typeck-default-trait-impl-outside-crate.rs similarity index 100% rename from src/test/compile-fail/typeck-default-trait-impl-outside-crate.rs rename to src/test/ui/typeck-default-trait-impl-outside-crate.rs diff --git a/src/test/ui/typeck-default-trait-impl-outside-crate.stderr b/src/test/ui/typeck-default-trait-impl-outside-crate.stderr new file mode 100644 index 0000000000000..6b50fde01d8a2 --- /dev/null +++ b/src/test/ui/typeck-default-trait-impl-outside-crate.stderr @@ -0,0 +1,8 @@ +error[E0318]: cannot create default implementations for traits outside the crate they're defined in; define a new trait instead + --> $DIR/typeck-default-trait-impl-outside-crate.rs:14:6 + | +14 | impl Copy for .. {} //~ ERROR E0318 + | ^^^^ `Copy` trait not defined in this crate + +error: aborting due to previous error + diff --git a/src/test/compile-fail/typeck_type_placeholder_item.rs b/src/test/ui/typeck_type_placeholder_item.rs similarity index 100% rename from src/test/compile-fail/typeck_type_placeholder_item.rs rename to src/test/ui/typeck_type_placeholder_item.rs diff --git a/src/test/ui/typeck_type_placeholder_item.stderr b/src/test/ui/typeck_type_placeholder_item.stderr new file mode 100644 index 0000000000000..046fce4e32559 --- /dev/null +++ b/src/test/ui/typeck_type_placeholder_item.stderr @@ -0,0 +1,206 @@ +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:14:14 + | +14 | fn test() -> _ { 5 } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:18:16 + | +18 | fn test2() -> (_, _) { (5, 5) } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:18:19 + | +18 | fn test2() -> (_, _) { (5, 5) } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:24:15 + | +24 | static TEST3: _ = "test"; + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:28:15 + | +28 | static TEST4: _ = 145; + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:32:16 + | +32 | static TEST5: (_, _) = (1, 2); + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:32:19 + | +32 | static TEST5: (_, _) = (1, 2); + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:38:13 + | +38 | fn test6(_: _) { } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:42:13 + | +42 | fn test7(x: _) { let _x: usize = x; } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:46:22 + | +46 | fn test8(_f: fn() -> _) { } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:73:8 + | +73 | a: _, + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:76:9 + | +76 | b: (_, _), + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:76:12 + | +76 | b: (_, _), + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:84:21 + | +84 | fn fn_test() -> _ { 5 } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:88:23 + | +88 | fn fn_test2() -> (_, _) { (5, 5) } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:88:26 + | +88 | fn fn_test2() -> (_, _) { (5, 5) } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:94:22 + | +94 | static FN_TEST3: _ = "test"; + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:98:22 + | +98 | static FN_TEST4: _ = 145; + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:102:23 + | +102 | static FN_TEST5: (_, _) = (1, 2); + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:102:26 + | +102 | static FN_TEST5: (_, _) = (1, 2); + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:108:20 + | +108 | fn fn_test6(_: _) { } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:112:20 + | +112 | fn fn_test7(x: _) { let _x: usize = x; } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:116:29 + | +116 | fn fn_test8(_f: fn() -> _) { } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:143:12 + | +143 | a: _, + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:146:13 + | +146 | b: (_, _), + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:146:16 + | +146 | b: (_, _), + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:53:24 + | +53 | fn test9(&self) -> _ { () } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:57:27 + | +57 | fn test10(&self, _x : _) { } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:63:24 + | +63 | fn clone(&self) -> _ { Test9 } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:67:37 + | +67 | fn clone_from(&mut self, other: _) { *self = Test9; } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:123:31 + | +123 | fn fn_test9(&self) -> _ { () } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:127:34 + | +127 | fn fn_test10(&self, _x : _) { } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:133:28 + | +133 | fn clone(&self) -> _ { FnTest9 } + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/typeck_type_placeholder_item.rs:137:41 + | +137 | fn clone_from(&mut self, other: _) { *self = FnTest9; } + | ^ not allowed in type signatures + +error: aborting due to 34 previous errors + diff --git a/src/test/compile-fail/typeck_type_placeholder_lifetime_1.rs b/src/test/ui/typeck_type_placeholder_lifetime_1.rs similarity index 100% rename from src/test/compile-fail/typeck_type_placeholder_lifetime_1.rs rename to src/test/ui/typeck_type_placeholder_lifetime_1.rs diff --git a/src/test/ui/typeck_type_placeholder_lifetime_1.stderr b/src/test/ui/typeck_type_placeholder_lifetime_1.stderr new file mode 100644 index 0000000000000..8f017e6d9a2dc --- /dev/null +++ b/src/test/ui/typeck_type_placeholder_lifetime_1.stderr @@ -0,0 +1,8 @@ +error[E0244]: wrong number of type arguments: expected 1, found 2 + --> $DIR/typeck_type_placeholder_lifetime_1.rs:19:12 + | +19 | let c: Foo<_, _> = Foo { r: &5 }; + | ^^^^^^^^^ expected 1 type argument + +error: aborting due to previous error + diff --git a/src/test/compile-fail/typeck_type_placeholder_lifetime_2.rs b/src/test/ui/typeck_type_placeholder_lifetime_2.rs similarity index 100% rename from src/test/compile-fail/typeck_type_placeholder_lifetime_2.rs rename to src/test/ui/typeck_type_placeholder_lifetime_2.rs diff --git a/src/test/ui/typeck_type_placeholder_lifetime_2.stderr b/src/test/ui/typeck_type_placeholder_lifetime_2.stderr new file mode 100644 index 0000000000000..396715f57ab7c --- /dev/null +++ b/src/test/ui/typeck_type_placeholder_lifetime_2.stderr @@ -0,0 +1,8 @@ +error[E0244]: wrong number of type arguments: expected 1, found 2 + --> $DIR/typeck_type_placeholder_lifetime_2.rs:19:12 + | +19 | let c: Foo<_, usize> = Foo { r: &5 }; + | ^^^^^^^^^^^^^ expected 1 type argument + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unboxed-closure-sugar-wrong-trait.rs b/src/test/ui/unboxed-closure-sugar-wrong-trait.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-sugar-wrong-trait.rs rename to src/test/ui/unboxed-closure-sugar-wrong-trait.rs diff --git a/src/test/ui/unboxed-closure-sugar-wrong-trait.stderr b/src/test/ui/unboxed-closure-sugar-wrong-trait.stderr new file mode 100644 index 0000000000000..544d4b74bb7e6 --- /dev/null +++ b/src/test/ui/unboxed-closure-sugar-wrong-trait.stderr @@ -0,0 +1,14 @@ +error[E0244]: wrong number of type arguments: expected 0, found 1 + --> $DIR/unboxed-closure-sugar-wrong-trait.rs:15:8 + | +15 | fn f isize>(x: F) {} + | ^^^^^^^^^^^^^^^^^^^^^ expected no type arguments + +error[E0220]: associated type `Output` not found for `Trait` + --> $DIR/unboxed-closure-sugar-wrong-trait.rs:15:24 + | +15 | fn f isize>(x: F) {} + | ^^^^^ associated type `Output` not found + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/unconstrained-none.rs b/src/test/ui/unconstrained-none.rs similarity index 100% rename from src/test/compile-fail/unconstrained-none.rs rename to src/test/ui/unconstrained-none.rs diff --git a/src/test/ui/unconstrained-none.stderr b/src/test/ui/unconstrained-none.stderr new file mode 100644 index 0000000000000..0f70cc5fd1093 --- /dev/null +++ b/src/test/ui/unconstrained-none.stderr @@ -0,0 +1,8 @@ +error[E0282]: type annotations needed + --> $DIR/unconstrained-none.rs:14:5 + | +14 | None; //~ ERROR type annotations needed [E0282] + | ^^^^ cannot infer type for `T` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unconstrained-ref.rs b/src/test/ui/unconstrained-ref.rs similarity index 100% rename from src/test/compile-fail/unconstrained-ref.rs rename to src/test/ui/unconstrained-ref.rs diff --git a/src/test/ui/unconstrained-ref.stderr b/src/test/ui/unconstrained-ref.stderr new file mode 100644 index 0000000000000..96d9b8396a4f9 --- /dev/null +++ b/src/test/ui/unconstrained-ref.stderr @@ -0,0 +1,8 @@ +error[E0282]: type annotations needed + --> $DIR/unconstrained-ref.rs:16:5 + | +16 | S { o: &None }; //~ ERROR type annotations needed [E0282] + | ^ cannot infer type for `T` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/union/union-const-eval.rs b/src/test/ui/union/union-const-eval.rs similarity index 100% rename from src/test/compile-fail/union/union-const-eval.rs rename to src/test/ui/union/union-const-eval.rs diff --git a/src/test/ui/union/union-const-eval.stderr b/src/test/ui/union/union-const-eval.stderr new file mode 100644 index 0000000000000..e61a9d390cc78 --- /dev/null +++ b/src/test/ui/union/union-const-eval.stderr @@ -0,0 +1,8 @@ +error[E0080]: constant evaluation error + --> $DIR/union-const-eval.rs:21:21 + | +21 | let b: [u8; C.b]; //~ ERROR constant evaluation error + | ^^^ nonexistent struct field + +error: aborting due to previous error + diff --git a/src/test/compile-fail/union/union-derive-eq.rs b/src/test/ui/union/union-derive-eq.rs similarity index 100% rename from src/test/compile-fail/union/union-derive-eq.rs rename to src/test/ui/union/union-derive-eq.rs diff --git a/src/test/ui/union/union-derive-eq.stderr b/src/test/ui/union/union-derive-eq.stderr new file mode 100644 index 0000000000000..569191ca6e7b5 --- /dev/null +++ b/src/test/ui/union/union-derive-eq.stderr @@ -0,0 +1,10 @@ +error[E0277]: the trait bound `PartialEqNotEq: std::cmp::Eq` is not satisfied + --> $DIR/union-derive-eq.rs:25:5 + | +25 | a: PartialEqNotEq, //~ ERROR the trait bound `PartialEqNotEq: std::cmp::Eq` is not satisfied + | ^^^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `PartialEqNotEq` + | + = note: required by `std::cmp::AssertParamIsEq` + +error: aborting due to previous error + diff --git a/src/test/ui/union-fields.rs b/src/test/ui/union/union-fields-1.rs similarity index 100% rename from src/test/ui/union-fields.rs rename to src/test/ui/union/union-fields-1.rs diff --git a/src/test/ui/union-fields.stderr b/src/test/ui/union/union-fields-1.stderr similarity index 76% rename from src/test/ui/union-fields.stderr rename to src/test/ui/union/union-fields-1.stderr index ffcd178ca548f..5204a13f6f209 100644 --- a/src/test/ui/union-fields.stderr +++ b/src/test/ui/union/union-fields-1.stderr @@ -1,29 +1,29 @@ error: field is never used: `c` - --> $DIR/union-fields.rs:16:5 + --> $DIR/union-fields-1.rs:16:5 | 16 | c: u8, //~ ERROR field is never used | ^^^^^ | note: lint level defined here - --> $DIR/union-fields.rs:11:9 + --> $DIR/union-fields-1.rs:11:9 | 11 | #![deny(dead_code)] | ^^^^^^^^^ error: field is never used: `a` - --> $DIR/union-fields.rs:19:5 + --> $DIR/union-fields-1.rs:19:5 | 19 | a: u8, //~ ERROR field is never used | ^^^^^ error: field is never used: `a` - --> $DIR/union-fields.rs:23:20 + --> $DIR/union-fields-1.rs:23:20 | 23 | union NoDropLike { a: u8 } //~ ERROR field is never used | ^^^^^ error: field is never used: `c` - --> $DIR/union-fields.rs:28:5 + --> $DIR/union-fields-1.rs:28:5 | 28 | c: u8, //~ ERROR field is never used | ^^^^^ diff --git a/src/test/compile-fail/union/union-fields.rs b/src/test/ui/union/union-fields-2.rs similarity index 100% rename from src/test/compile-fail/union/union-fields.rs rename to src/test/ui/union/union-fields-2.rs diff --git a/src/test/ui/union/union-fields-2.stderr b/src/test/ui/union/union-fields-2.stderr new file mode 100644 index 0000000000000..19c0552fdaa7e --- /dev/null +++ b/src/test/ui/union/union-fields-2.stderr @@ -0,0 +1,82 @@ +error: union expressions should have exactly one field + --> $DIR/union-fields-2.rs:17:13 + | +17 | let u = U {}; //~ ERROR union expressions should have exactly one field + | ^ + +error: union expressions should have exactly one field + --> $DIR/union-fields-2.rs:19:13 + | +19 | let u = U { a: 0, b: 1 }; //~ ERROR union expressions should have exactly one field + | ^ + +error[E0560]: union `U` has no field named `c` + --> $DIR/union-fields-2.rs:20:29 + | +20 | let u = U { a: 0, b: 1, c: 2 }; //~ ERROR union expressions should have exactly one field + | ^^ `U` does not have this field + | + = note: available fields are: `a`, `b` + +error: union expressions should have exactly one field + --> $DIR/union-fields-2.rs:20:13 + | +20 | let u = U { a: 0, b: 1, c: 2 }; //~ ERROR union expressions should have exactly one field + | ^ + +error: union expressions should have exactly one field + --> $DIR/union-fields-2.rs:24:13 + | +24 | let u = U { ..u }; //~ ERROR union expressions should have exactly one field + | ^ + +error[E0436]: functional record update syntax requires a struct + --> $DIR/union-fields-2.rs:24:19 + | +24 | let u = U { ..u }; //~ ERROR union expressions should have exactly one field + | ^ + +error: union patterns should have exactly one field + --> $DIR/union-fields-2.rs:27:9 + | +27 | let U {} = u; //~ ERROR union patterns should have exactly one field + | ^^^^ + +error: union patterns should have exactly one field + --> $DIR/union-fields-2.rs:29:9 + | +29 | let U { a, b } = u; //~ ERROR union patterns should have exactly one field + | ^^^^^^^^^^ + +error[E0026]: union `U` does not have a field named `c` + --> $DIR/union-fields-2.rs:30:19 + | +30 | let U { a, b, c } = u; //~ ERROR union patterns should have exactly one field + | ^ union `U` does not have field `c` + +error: union patterns should have exactly one field + --> $DIR/union-fields-2.rs:30:9 + | +30 | let U { a, b, c } = u; //~ ERROR union patterns should have exactly one field + | ^^^^^^^^^^^^^ + +error: union patterns should have exactly one field + --> $DIR/union-fields-2.rs:33:9 + | +33 | let U { .. } = u; //~ ERROR union patterns should have exactly one field + | ^^^^^^^^ + +error: `..` cannot be used in union patterns + --> $DIR/union-fields-2.rs:33:9 + | +33 | let U { .. } = u; //~ ERROR union patterns should have exactly one field + | ^^^^^^^^ + +error: `..` cannot be used in union patterns + --> $DIR/union-fields-2.rs:35:9 + | +35 | let U { a, .. } = u; //~ ERROR `..` cannot be used in union patterns + | ^^^^^^^^^^^ + +error: aborting due to 13 previous errors + diff --git a/src/test/ui/union-sized-field.rs b/src/test/ui/union/union-sized-field.rs similarity index 100% rename from src/test/ui/union-sized-field.rs rename to src/test/ui/union/union-sized-field.rs diff --git a/src/test/ui/union-sized-field.stderr b/src/test/ui/union/union-sized-field.stderr similarity index 100% rename from src/test/ui/union-sized-field.stderr rename to src/test/ui/union/union-sized-field.stderr diff --git a/src/test/compile-fail/union/union-suggest-field.rs b/src/test/ui/union/union-suggest-field.rs similarity index 100% rename from src/test/compile-fail/union/union-suggest-field.rs rename to src/test/ui/union/union-suggest-field.rs diff --git a/src/test/ui/union/union-suggest-field.stderr b/src/test/ui/union/union-suggest-field.stderr new file mode 100644 index 0000000000000..d76a92cf56ec7 --- /dev/null +++ b/src/test/ui/union/union-suggest-field.stderr @@ -0,0 +1,22 @@ +error[E0560]: union `U` has no field named `principle` + --> $DIR/union-suggest-field.rs:20:17 + | +20 | let u = U { principle: 0 }; + | ^^^^^^^^^^ field does not exist - did you mean `principal`? + +error[E0609]: no field `principial` on type `U` + --> $DIR/union-suggest-field.rs:23:15 + | +23 | let w = u.principial; //~ ERROR no field `principial` on type `U` + | ^^^^^^^^^^ did you mean `principal`? + +error[E0615]: attempted to take value of method `calculate` on type `U` + --> $DIR/union-suggest-field.rs:26:15 + | +26 | let y = u.calculate; //~ ERROR attempted to take value of method `calculate` on type `U` + | ^^^^^^^^^ + | + = help: maybe a `()` to call it is missing? + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/unsafe-const-fn.rs b/src/test/ui/unsafe-const-fn.rs similarity index 100% rename from src/test/compile-fail/unsafe-const-fn.rs rename to src/test/ui/unsafe-const-fn.rs diff --git a/src/test/ui/unsafe-const-fn.stderr b/src/test/ui/unsafe-const-fn.stderr new file mode 100644 index 0000000000000..f3923244aba85 --- /dev/null +++ b/src/test/ui/unsafe-const-fn.stderr @@ -0,0 +1,8 @@ +error[E0133]: call to unsafe function requires unsafe function or block + --> $DIR/unsafe-const-fn.rs:19:18 + | +19 | const VAL: u32 = dummy(0xFFFF); + | ^^^^^^^^^^^^^ call to unsafe function + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unsized-enum2.rs b/src/test/ui/unsized-enum2.rs similarity index 100% rename from src/test/compile-fail/unsized-enum2.rs rename to src/test/ui/unsized-enum2.rs diff --git a/src/test/ui/unsized-enum2.stderr b/src/test/ui/unsized-enum2.stderr new file mode 100644 index 0000000000000..97a83456bb4c7 --- /dev/null +++ b/src/test/ui/unsized-enum2.stderr @@ -0,0 +1,190 @@ +error[E0277]: the trait bound `W: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:33:8 + | +33 | VA(W), //~ ERROR `W: std::marker::Sized` is not satisfied + | ^^ `W` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `W` + = help: consider adding a `where W: std::marker::Sized` bound + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `X: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:34:8 + | +34 | VB{x: X}, //~ ERROR `X: std::marker::Sized` is not satisfied + | ^^^^ `X` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = help: consider adding a `where X: std::marker::Sized` bound + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `Y: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:35:15 + | +35 | VC(isize, Y), //~ ERROR `Y: std::marker::Sized` is not satisfied + | ^^ `Y` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `Y` + = help: consider adding a `where Y: std::marker::Sized` bound + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `Z: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:36:18 + | +36 | VD{u: isize, x: Z}, //~ ERROR `Z: std::marker::Sized` is not satisfied + | ^^^^ `Z` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `Z` + = help: consider adding a `where Z: std::marker::Sized` bound + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:39:8 + | +39 | VE([u8]), //~ ERROR `[u8]: std::marker::Sized` 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]` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:40:8 + | +40 | VF{x: str}, //~ ERROR `str: std::marker::Sized` 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` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `[f32]: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:41:15 + | +41 | VG(isize, [f32]), //~ ERROR `[f32]: std::marker::Sized` is not satisfied + | ^^^^^^ `[f32]` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[f32]` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `[u32]: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:42:18 + | +42 | VH{u: isize, x: [u32]}, //~ ERROR `[u32]: std::marker::Sized` is not satisfied + | ^^^^^^^^ `[u32]` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[u32]` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `Foo + 'static: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:51:8 + | +51 | VM(Foo), //~ ERROR `Foo + 'static: std::marker::Sized` is not satisfied + | ^^^^ `Foo + 'static` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `Foo + 'static` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `Bar + 'static: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:52:8 + | +52 | VN{x: Bar}, //~ ERROR `Bar + 'static: std::marker::Sized` is not satisfied + | ^^^^^^ `Bar + 'static` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `Bar + 'static` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `FooBar + 'static: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:53:15 + | +53 | VO(isize, FooBar), //~ ERROR `FooBar + 'static: std::marker::Sized` is not satisfied + | ^^^^^^^ `FooBar + 'static` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `FooBar + 'static` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `BarFoo + 'static: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:54:18 + | +54 | VP{u: isize, x: BarFoo}, //~ ERROR `BarFoo + 'static: std::marker::Sized` is not satisfied + | ^^^^^^^^^ `BarFoo + 'static` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `BarFoo + 'static` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `[i8]: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:57:8 + | +57 | VQ(<&'static [i8] as Deref>::Target), //~ ERROR `[i8]: std::marker::Sized` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[i8]` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[i8]` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `[char]: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:58:8 + | +58 | VR{x: <&'static [char] as Deref>::Target}, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[char]` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[char]` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `[f64]: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:60:15 + | +60 | VS(isize, <&'static [f64] as Deref>::Target), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[f64]` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[f64]` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `[i32]: std::marker::Sized` is not satisfied + --> $DIR/unsized-enum2.rs:62:18 + | +62 | VT{u: isize, x: <&'static [i32] as Deref>::Target}, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `[i32]` does not have a constant size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[i32]` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `PathHelper1 + 'static: std::marker::Sized` is not satisfied in `Path1` + --> $DIR/unsized-enum2.rs:45:8 + | +45 | VI(Path1), //~ ERROR `PathHelper1 + 'static: std::marker::Sized` is not satisfied + | ^^^^^^ `PathHelper1 + 'static` does not have a constant size known at compile-time + | + = help: within `Path1`, the trait `std::marker::Sized` is not implemented for `PathHelper1 + 'static` + = note: required because it appears within the type `Path1` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `PathHelper2 + 'static: std::marker::Sized` is not satisfied in `Path2` + --> $DIR/unsized-enum2.rs:46:8 + | +46 | VJ{x: Path2}, //~ ERROR `PathHelper2 + 'static: std::marker::Sized` is not satisfied + | ^^^^^^^^ `PathHelper2 + 'static` does not have a constant size known at compile-time + | + = help: within `Path2`, the trait `std::marker::Sized` is not implemented for `PathHelper2 + 'static` + = note: required because it appears within the type `Path2` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `PathHelper3 + 'static: std::marker::Sized` is not satisfied in `Path3` + --> $DIR/unsized-enum2.rs:47:15 + | +47 | VK(isize, Path3), //~ ERROR `PathHelper3 + 'static: std::marker::Sized` is not satisfied + | ^^^^^^ `PathHelper3 + 'static` does not have a constant size known at compile-time + | + = help: within `Path3`, the trait `std::marker::Sized` is not implemented for `PathHelper3 + 'static` + = note: required because it appears within the type `Path3` + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the trait bound `PathHelper4 + 'static: std::marker::Sized` is not satisfied in `Path4` + --> $DIR/unsized-enum2.rs:48:18 + | +48 | VL{u: isize, x: Path4}, //~ ERROR `PathHelper4 + 'static: std::marker::Sized` is not satisfied + | ^^^^^^^^ `PathHelper4 + 'static` does not have a constant size known at compile-time + | + = help: within `Path4`, the trait `std::marker::Sized` is not implemented for `PathHelper4 + 'static` + = note: required because it appears within the type `Path4` + = note: no field of an enum variant may have a dynamically sized type + +error: aborting due to 20 previous errors + diff --git a/src/test/compile-fail/use-mod.rs b/src/test/ui/use-mod.rs similarity index 100% rename from src/test/compile-fail/use-mod.rs rename to src/test/ui/use-mod.rs diff --git a/src/test/ui/use-mod.stderr b/src/test/ui/use-mod.stderr new file mode 100644 index 0000000000000..ea2f8662c5cd1 --- /dev/null +++ b/src/test/ui/use-mod.stderr @@ -0,0 +1,35 @@ +error[E0430]: `self` import can only appear once in the list + --> $DIR/use-mod.rs:12:5 + | +12 | self, + | ^^^^ + | +note: another `self` import appears here + --> $DIR/use-mod.rs:16:5 + | +16 | self + | ^^^^ + +error[E0431]: `self` import can only appear in an import list with a non-empty prefix + --> $DIR/use-mod.rs:23:6 + | +23 | use {self}; + | ^^^^ + +error[E0252]: the name `bar` is defined multiple times + --> $DIR/use-mod.rs:16:5 + | +12 | self, + | ---- previous import of the module `bar` here +... +16 | self + | ^^^^ `bar` reimported here + | + = note: `bar` 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 + | +16 | self as Otherbar + | + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/variadic-ffi-3.rs b/src/test/ui/variadic-ffi-3.rs similarity index 100% rename from src/test/compile-fail/variadic-ffi-3.rs rename to src/test/ui/variadic-ffi-3.rs diff --git a/src/test/ui/variadic-ffi-3.stderr b/src/test/ui/variadic-ffi-3.stderr new file mode 100644 index 0000000000000..ebee6398274b8 --- /dev/null +++ b/src/test/ui/variadic-ffi-3.stderr @@ -0,0 +1,74 @@ +error[E0060]: this function takes at least 2 parameters but 0 parameters were supplied + --> $DIR/variadic-ffi-3.rs:21:9 + | +12 | fn foo(f: isize, x: u8, ...); + | ----------------------------- defined here +... +21 | foo(); //~ ERROR: this function takes at least 2 parameters but 0 parameters were supplied + | ^^^^^ expected at least 2 parameters + +error[E0060]: this function takes at least 2 parameters but 1 parameter was supplied + --> $DIR/variadic-ffi-3.rs:23:13 + | +12 | fn foo(f: isize, x: u8, ...); + | ----------------------------- defined here +... +23 | foo(1); //~ ERROR: this function takes at least 2 parameters but 1 parameter was supplied + | ^ expected at least 2 parameters + +error[E0308]: mismatched types + --> $DIR/variadic-ffi-3.rs:26:56 + | +26 | let x: unsafe extern "C" fn(f: isize, x: u8) = foo; + | ^^^ expected non-variadic fn, found variadic function + | + = note: expected type `unsafe extern "C" fn(isize, u8)` + found type `unsafe extern "C" fn(isize, u8, ...) {foo}` + +error[E0308]: mismatched types + --> $DIR/variadic-ffi-3.rs:32:54 + | +32 | let y: extern "C" fn(f: isize, x: u8, ...) = bar; + | ^^^ expected variadic fn, found non-variadic function + | + = note: expected type `extern "C" fn(isize, u8, ...)` + found type `extern "C" fn(isize, u8) {bar}` + +error[E0617]: can't pass `f32` to variadic function, cast to `c_double` + --> $DIR/variadic-ffi-3.rs:38:19 + | +38 | foo(1, 2, 3f32); //~ ERROR can't pass `f32` to variadic function, cast to `c_double` + | ^^^^ + +error[E0617]: can't pass `bool` to variadic function, cast to `c_int` + --> $DIR/variadic-ffi-3.rs:39:19 + | +39 | foo(1, 2, true); //~ ERROR can't pass `bool` to variadic function, cast to `c_int` + | ^^^^ + +error[E0617]: can't pass `i8` to variadic function, cast to `c_int` + --> $DIR/variadic-ffi-3.rs:40:19 + | +40 | foo(1, 2, 1i8); //~ ERROR can't pass `i8` to variadic function, cast to `c_int` + | ^^^ + +error[E0617]: can't pass `u8` to variadic function, cast to `c_uint` + --> $DIR/variadic-ffi-3.rs:41:19 + | +41 | foo(1, 2, 1u8); //~ ERROR can't pass `u8` to variadic function, cast to `c_uint` + | ^^^ + +error[E0617]: can't pass `i16` to variadic function, cast to `c_int` + --> $DIR/variadic-ffi-3.rs:42:19 + | +42 | foo(1, 2, 1i16); //~ ERROR can't pass `i16` to variadic function, cast to `c_int` + | ^^^^ + +error[E0617]: can't pass `u16` to variadic function, cast to `c_uint` + --> $DIR/variadic-ffi-3.rs:43:19 + | +43 | foo(1, 2, 1u16); //~ ERROR can't pass `u16` to variadic function, cast to `c_uint` + | ^^^^ + +error: aborting due to 10 previous errors + diff --git a/src/test/compile-fail/variance-unused-type-param.rs b/src/test/ui/variance-unused-type-param.rs similarity index 100% rename from src/test/compile-fail/variance-unused-type-param.rs rename to src/test/ui/variance-unused-type-param.rs diff --git a/src/test/ui/variance-unused-type-param.stderr b/src/test/ui/variance-unused-type-param.stderr new file mode 100644 index 0000000000000..4ff6ce78ac5e8 --- /dev/null +++ b/src/test/ui/variance-unused-type-param.stderr @@ -0,0 +1,26 @@ +error[E0392]: parameter `A` is never used + --> $DIR/variance-unused-type-param.rs:16:19 + | +16 | struct SomeStruct { x: u32 } + | ^ unused type parameter + | + = help: consider removing `A` or using a marker such as `std::marker::PhantomData` + +error[E0392]: parameter `A` is never used + --> $DIR/variance-unused-type-param.rs:20:15 + | +20 | enum SomeEnum { Nothing } + | ^ unused type parameter + | + = help: consider removing `A` or using a marker such as `std::marker::PhantomData` + +error[E0392]: parameter `T` is never used + --> $DIR/variance-unused-type-param.rs:25:15 + | +25 | enum ListCell { + | ^ unused type parameter + | + = help: consider removing `T` or using a marker such as `std::marker::PhantomData` + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/vector-no-ann.rs b/src/test/ui/vector-no-ann.rs similarity index 100% rename from src/test/compile-fail/vector-no-ann.rs rename to src/test/ui/vector-no-ann.rs diff --git a/src/test/ui/vector-no-ann.stderr b/src/test/ui/vector-no-ann.stderr new file mode 100644 index 0000000000000..e788ea125ad40 --- /dev/null +++ b/src/test/ui/vector-no-ann.stderr @@ -0,0 +1,10 @@ +error[E0282]: type annotations needed + --> $DIR/vector-no-ann.rs:13:16 + | +13 | let _foo = Vec::new(); + | ---- ^^^^^^^^ cannot infer type for `T` + | | + | consider giving `_foo` a type + +error: aborting due to previous error +